@bitovi/vybit 0.13.2 → 0.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/overlay/dist/overlay.js +94 -4
- package/package.json +1 -1
- package/panel/dist/assets/{DesignMode-0yrf7kUU.js → DesignMode-DTled2fb.js} +37 -37
- package/panel/dist/assets/index-BT9whNBX.js +62 -0
- package/panel/dist/assets/index-rvhMGLF5.css +1 -0
- package/panel/dist/index.html +2 -2
- package/server/app.ts +3 -3
- package/server/ghost-cache.ts +5 -11
- package/shared/css-utils.ts +21 -0
- package/shared/types.ts +4 -0
- package/panel/dist/assets/index-BmjlwBEu.js +0 -61
- package/panel/dist/assets/index-DN-H7d0q.css +0 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var sm=Object.defineProperty;var im=(e,t,n)=>t in e?sm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ot=(e,t,n)=>im(e,typeof t!="symbol"?t+"":t,n);function am(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(r,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const s of l.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function um(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zd={exports:{}},_s={},qd={exports:{}},ue={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Jo=Symbol.for("react.element"),cm=Symbol.for("react.portal"),dm=Symbol.for("react.fragment"),fm=Symbol.for("react.strict_mode"),pm=Symbol.for("react.profiler"),hm=Symbol.for("react.provider"),mm=Symbol.for("react.context"),gm=Symbol.for("react.forward_ref"),ym=Symbol.for("react.suspense"),xm=Symbol.for("react.memo"),vm=Symbol.for("react.lazy"),ec=Symbol.iterator;function bm(e){return e===null||typeof e!="object"?null:(e=ec&&e[ec]||e["@@iterator"],typeof e=="function"?e:null)}var Jd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ef=Object.assign,tf={};function to(e,t,n){this.props=e,this.context=t,this.refs=tf,this.updater=n||Jd}to.prototype.isReactComponent={};to.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};to.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function nf(){}nf.prototype=to.prototype;function qa(e,t,n){this.props=e,this.context=t,this.refs=tf,this.updater=n||Jd}var Ja=qa.prototype=new nf;Ja.constructor=qa;ef(Ja,to.prototype);Ja.isPureReactComponent=!0;var tc=Array.isArray,rf=Object.prototype.hasOwnProperty,eu={current:null},of={key:!0,ref:!0,__self:!0,__source:!0};function lf(e,t,n){var r,o={},l=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(l=""+t.key),t)rf.call(t,r)&&!of.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];o.children=u}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:Jo,type:e,key:l,ref:s,props:o,_owner:eu.current}}function wm(e,t){return{$$typeof:Jo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function tu(e){return typeof e=="object"&&e!==null&&e.$$typeof===Jo}function Sm(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var nc=/\/+/g;function ei(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Sm(""+e.key):t.toString(36)}function _l(e,t,n,r,o){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(l){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Jo:case cm:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+ei(s,0):r,tc(o)?(n="",e!=null&&(n=e.replace(nc,"$&/")+"/"),_l(o,t,n,"",function(c){return c})):o!=null&&(tu(o)&&(o=wm(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(nc,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",tc(e))for(var a=0;a<e.length;a++){l=e[a];var u=r+ei(l,a);s+=_l(l,t,n,u,o)}else if(u=bm(e),typeof u=="function")for(e=u.call(e),a=0;!(l=e.next()).done;)l=l.value,u=r+ei(l,a++),s+=_l(l,t,n,u,o);else if(l==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function al(e,t,n){if(e==null)return e;var r=[],o=0;return _l(e,r,"","",function(l){return t.call(n,l,o++)}),r}function Cm(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var et={current:null},Il={transition:null},km={ReactCurrentDispatcher:et,ReactCurrentBatchConfig:Il,ReactCurrentOwner:eu};function sf(){throw Error("act(...) is not supported in production builds of React.")}ue.Children={map:al,forEach:function(e,t,n){al(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return al(e,function(){t++}),t},toArray:function(e){return al(e,function(t){return t})||[]},only:function(e){if(!tu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ue.Component=to;ue.Fragment=dm;ue.Profiler=pm;ue.PureComponent=qa;ue.StrictMode=fm;ue.Suspense=ym;ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=km;ue.act=sf;ue.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=ef({},e.props),o=e.key,l=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,s=eu.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(u in t)rf.call(t,u)&&!of.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&a!==void 0?a[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){a=Array(u);for(var c=0;c<u;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Jo,type:e.type,key:o,ref:l,props:r,_owner:s}};ue.createContext=function(e){return e={$$typeof:mm,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:hm,_context:e},e.Consumer=e};ue.createElement=lf;ue.createFactory=function(e){var t=lf.bind(null,e);return t.type=e,t};ue.createRef=function(){return{current:null}};ue.forwardRef=function(e){return{$$typeof:gm,render:e}};ue.isValidElement=tu;ue.lazy=function(e){return{$$typeof:vm,_payload:{_status:-1,_result:e},_init:Cm}};ue.memo=function(e,t){return{$$typeof:xm,type:e,compare:t===void 0?null:t}};ue.startTransition=function(e){var t=Il.transition;Il.transition={};try{e()}finally{Il.transition=t}};ue.unstable_act=sf;ue.useCallback=function(e,t){return et.current.useCallback(e,t)};ue.useContext=function(e){return et.current.useContext(e)};ue.useDebugValue=function(){};ue.useDeferredValue=function(e){return et.current.useDeferredValue(e)};ue.useEffect=function(e,t){return et.current.useEffect(e,t)};ue.useId=function(){return et.current.useId()};ue.useImperativeHandle=function(e,t,n){return et.current.useImperativeHandle(e,t,n)};ue.useInsertionEffect=function(e,t){return et.current.useInsertionEffect(e,t)};ue.useLayoutEffect=function(e,t){return et.current.useLayoutEffect(e,t)};ue.useMemo=function(e,t){return et.current.useMemo(e,t)};ue.useReducer=function(e,t,n){return et.current.useReducer(e,t,n)};ue.useRef=function(e){return et.current.useRef(e)};ue.useState=function(e){return et.current.useState(e)};ue.useSyncExternalStore=function(e,t,n){return et.current.useSyncExternalStore(e,t,n)};ue.useTransition=function(){return et.current.useTransition()};ue.version="18.3.1";qd.exports=ue;var w=qd.exports;const af=um(w),uf=am({__proto__:null,default:af},[w]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Em=w,jm=Symbol.for("react.element"),Tm=Symbol.for("react.fragment"),Nm=Object.prototype.hasOwnProperty,Rm=Em.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Pm={key:!0,ref:!0,__self:!0,__source:!0};function cf(e,t,n){var r,o={},l=null,s=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Nm.call(t,r)&&!Pm.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:jm,type:e,key:l,ref:s,props:o,_owner:Rm.current}}_s.Fragment=Tm;_s.jsx=cf;_s.jsxs=cf;Zd.exports=_s;var i=Zd.exports,Ui={},df={exports:{}},gt={},ff={exports:{}},pf={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(T,R){var P=T.length;T.push(R);e:for(;0<P;){var Y=P-1>>>1,X=T[Y];if(0<o(X,R))T[Y]=R,T[P]=X,P=Y;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var R=T[0],P=T.pop();if(P!==R){T[0]=P;e:for(var Y=0,X=T.length,Ne=X>>>1;Y<Ne;){var Pe=2*(Y+1)-1,$=T[Pe],ne=Pe+1,me=T[ne];if(0>o($,P))ne<X&&0>o(me,$)?(T[Y]=me,T[ne]=P,Y=ne):(T[Y]=$,T[Pe]=P,Y=Pe);else if(ne<X&&0>o(me,P))T[Y]=me,T[ne]=P,Y=ne;else break e}}return R}function o(T,R){var P=T.sortIndex-R.sortIndex;return P!==0?P:T.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var u=[],c=[],f=1,h=null,d=3,m=!1,v=!1,b=!1,S=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(T){for(var R=n(c);R!==null;){if(R.callback===null)r(c);else if(R.startTime<=T)r(c),R.sortIndex=R.expirationTime,t(u,R);else break;R=n(c)}}function x(T){if(b=!1,y(T),!v)if(n(u)!==null)v=!0,Q(k);else{var R=n(c);R!==null&&q(x,R.startTime-T)}}function k(T,R){v=!1,b&&(b=!1,p(E),E=-1),m=!0;var P=d;try{for(y(R),h=n(u);h!==null&&(!(h.expirationTime>R)||T&&!L());){var Y=h.callback;if(typeof Y=="function"){h.callback=null,d=h.priorityLevel;var X=Y(h.expirationTime<=R);R=e.unstable_now(),typeof X=="function"?h.callback=X:h===n(u)&&r(u),y(R)}else r(u);h=n(u)}if(h!==null)var Ne=!0;else{var Pe=n(c);Pe!==null&&q(x,Pe.startTime-R),Ne=!1}return Ne}finally{h=null,d=P,m=!1}}var C=!1,j=null,E=-1,A=5,_=-1;function L(){return!(e.unstable_now()-_<A)}function B(){if(j!==null){var T=e.unstable_now();_=T;var R=!0;try{R=j(!0,T)}finally{R?H():(C=!1,j=null)}}else C=!1}var H;if(typeof g=="function")H=function(){g(B)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,G=D.port2;D.port1.onmessage=B,H=function(){G.postMessage(null)}}else H=function(){S(B,0)};function Q(T){j=T,C||(C=!0,H())}function q(T,R){E=S(function(){T(e.unstable_now())},R)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_continueExecution=function(){v||m||(v=!0,Q(k))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(T){switch(d){case 1:case 2:case 3:var R=3;break;default:R=d}var P=d;d=R;try{return T()}finally{d=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,R){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var P=d;d=T;try{return R()}finally{d=P}},e.unstable_scheduleCallback=function(T,R,P){var Y=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?Y+P:Y):P=Y,T){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=P+X,T={id:f++,callback:R,priorityLevel:T,startTime:P,expirationTime:X,sortIndex:-1},P>Y?(T.sortIndex=P,t(c,T),n(u)===null&&T===n(c)&&(b?(p(E),E=-1):b=!0,q(x,P-Y))):(T.sortIndex=X,t(u,T),v||m||(v=!0,Q(k))),T},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(T){var R=d;return function(){var P=d;d=R;try{return T.apply(this,arguments)}finally{d=P}}}})(pf);ff.exports=pf;var _m=ff.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Im=w,mt=_m;function M(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var hf=new Set,Ao={};function gr(e,t){Ur(e,t),Ur(e+"Capture",t)}function Ur(e,t){for(Ao[e]=t,e=0;e<t.length;e++)hf.add(t[e])}var cn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gi=Object.prototype.hasOwnProperty,Am=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,rc={},oc={};function Lm(e){return Gi.call(oc,e)?!0:Gi.call(rc,e)?!1:Am.test(e)?oc[e]=!0:(rc[e]=!0,!1)}function Dm(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Om(e,t,n,r){if(t===null||typeof t>"u"||Dm(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function tt(e,t,n,r,o,l,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=s}var Ue={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ue[e]=new tt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ue[t]=new tt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ue[e]=new tt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ue[e]=new tt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ue[e]=new tt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ue[e]=new tt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ue[e]=new tt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ue[e]=new tt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ue[e]=new tt(e,5,!1,e.toLowerCase(),null,!1,!1)});var nu=/[\-:]([a-z])/g;function ru(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(nu,ru);Ue[t]=new tt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(nu,ru);Ue[t]=new tt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(nu,ru);Ue[t]=new tt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ue[e]=new tt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ue.xlinkHref=new tt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ue[e]=new tt(e,1,!1,e.toLowerCase(),null,!0,!0)});function ou(e,t,n,r){var o=Ue.hasOwnProperty(t)?Ue[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Om(t,n,o,r)&&(n=null),r||o===null?Lm(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var wn=Im.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ul=Symbol.for("react.element"),Er=Symbol.for("react.portal"),jr=Symbol.for("react.fragment"),lu=Symbol.for("react.strict_mode"),Yi=Symbol.for("react.profiler"),mf=Symbol.for("react.provider"),gf=Symbol.for("react.context"),su=Symbol.for("react.forward_ref"),Qi=Symbol.for("react.suspense"),Xi=Symbol.for("react.suspense_list"),iu=Symbol.for("react.memo"),Cn=Symbol.for("react.lazy"),yf=Symbol.for("react.offscreen"),lc=Symbol.iterator;function ao(e){return e===null||typeof e!="object"?null:(e=lc&&e[lc]||e["@@iterator"],typeof e=="function"?e:null)}var Te=Object.assign,ti;function vo(e){if(ti===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ti=t&&t[1]||""}return`
|
|
34
|
+
`+ti+e}var ni=!1;function ri(e,t){if(!e||ni)return"";ni=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
|
|
35
|
+
`),l=r.stack.split(`
|
|
36
|
+
`),s=o.length-1,a=l.length-1;1<=s&&0<=a&&o[s]!==l[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==l[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==l[a]){var u=`
|
|
37
|
+
`+o[s].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=s&&0<=a);break}}}finally{ni=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?vo(e):""}function Mm(e){switch(e.tag){case 5:return vo(e.type);case 16:return vo("Lazy");case 13:return vo("Suspense");case 19:return vo("SuspenseList");case 0:case 2:case 15:return e=ri(e.type,!1),e;case 11:return e=ri(e.type.render,!1),e;case 1:return e=ri(e.type,!0),e;default:return""}}function Zi(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case jr:return"Fragment";case Er:return"Portal";case Yi:return"Profiler";case lu:return"StrictMode";case Qi:return"Suspense";case Xi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case gf:return(e.displayName||"Context")+".Consumer";case mf:return(e._context.displayName||"Context")+".Provider";case su:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case iu:return t=e.displayName||null,t!==null?t:Zi(e.type)||"Memo";case Cn:t=e._payload,e=e._init;try{return Zi(e(t))}catch{}}return null}function $m(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Zi(t);case 8:return t===lu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Kn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zm(e){var t=xf(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,l.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function cl(e){e._valueTracker||(e._valueTracker=zm(e))}function vf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=xf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Xl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function qi(e,t){var n=t.checked;return Te({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function sc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Kn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function bf(e,t){t=t.checked,t!=null&&ou(e,"checked",t,!1)}function Ji(e,t){bf(e,t);var n=Kn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ea(e,t.type,n):t.hasOwnProperty("defaultValue")&&ea(e,t.type,Kn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ic(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ea(e,t,n){(t!=="number"||Xl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var bo=Array.isArray;function $r(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Kn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function ta(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(M(91));return Te({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ac(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(M(92));if(bo(n)){if(1<n.length)throw Error(M(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Kn(n)}}function wf(e,t){var n=Kn(t.value),r=Kn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function uc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Sf(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function na(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Sf(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var dl,Cf=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(dl=dl||document.createElement("div"),dl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=dl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Lo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ko={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Km=["Webkit","ms","Moz","O"];Object.keys(ko).forEach(function(e){Km.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ko[t]=ko[e]})});function kf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ko.hasOwnProperty(e)&&ko[e]?(""+t).trim():t+"px"}function Ef(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=kf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Fm=Te({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ra(e,t){if(t){if(Fm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(M(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(M(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(M(61))}if(t.style!=null&&typeof t.style!="object")throw Error(M(62))}}function oa(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var la=null;function au(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var sa=null,zr=null,Kr=null;function cc(e){if(e=nl(e)){if(typeof sa!="function")throw Error(M(280));var t=e.stateNode;t&&(t=Os(t),sa(e.stateNode,e.type,t))}}function jf(e){zr?Kr?Kr.push(e):Kr=[e]:zr=e}function Tf(){if(zr){var e=zr,t=Kr;if(Kr=zr=null,cc(e),t)for(e=0;e<t.length;e++)cc(t[e])}}function Nf(e,t){return e(t)}function Rf(){}var oi=!1;function Pf(e,t,n){if(oi)return e(t,n);oi=!0;try{return Nf(e,t,n)}finally{oi=!1,(zr!==null||Kr!==null)&&(Rf(),Tf())}}function Do(e,t){var n=e.stateNode;if(n===null)return null;var r=Os(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(M(231,t,typeof n));return n}var ia=!1;if(cn)try{var uo={};Object.defineProperty(uo,"passive",{get:function(){ia=!0}}),window.addEventListener("test",uo,uo),window.removeEventListener("test",uo,uo)}catch{ia=!1}function Hm(e,t,n,r,o,l,s,a,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(f){this.onError(f)}}var Eo=!1,Zl=null,ql=!1,aa=null,Wm={onError:function(e){Eo=!0,Zl=e}};function Bm(e,t,n,r,o,l,s,a,u){Eo=!1,Zl=null,Hm.apply(Wm,arguments)}function Vm(e,t,n,r,o,l,s,a,u){if(Bm.apply(this,arguments),Eo){if(Eo){var c=Zl;Eo=!1,Zl=null}else throw Error(M(198));ql||(ql=!0,aa=c)}}function yr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function _f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function dc(e){if(yr(e)!==e)throw Error(M(188))}function Um(e){var t=e.alternate;if(!t){if(t=yr(e),t===null)throw Error(M(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var l=o.alternate;if(l===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===l.child){for(l=o.child;l;){if(l===n)return dc(o),e;if(l===r)return dc(o),t;l=l.sibling}throw Error(M(188))}if(n.return!==r.return)n=o,r=l;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=l;break}if(a===r){s=!0,r=o,n=l;break}a=a.sibling}if(!s){for(a=l.child;a;){if(a===n){s=!0,n=l,r=o;break}if(a===r){s=!0,r=l,n=o;break}a=a.sibling}if(!s)throw Error(M(189))}}if(n.alternate!==r)throw Error(M(190))}if(n.tag!==3)throw Error(M(188));return n.stateNode.current===n?e:t}function If(e){return e=Um(e),e!==null?Af(e):null}function Af(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Af(e);if(t!==null)return t;e=e.sibling}return null}var Lf=mt.unstable_scheduleCallback,fc=mt.unstable_cancelCallback,Gm=mt.unstable_shouldYield,Ym=mt.unstable_requestPaint,Ie=mt.unstable_now,Qm=mt.unstable_getCurrentPriorityLevel,uu=mt.unstable_ImmediatePriority,Df=mt.unstable_UserBlockingPriority,Jl=mt.unstable_NormalPriority,Xm=mt.unstable_LowPriority,Of=mt.unstable_IdlePriority,Is=null,Ft=null;function Zm(e){if(Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(Is,e,void 0,(e.current.flags&128)===128)}catch{}}var Lt=Math.clz32?Math.clz32:eg,qm=Math.log,Jm=Math.LN2;function eg(e){return e>>>=0,e===0?32:31-(qm(e)/Jm|0)|0}var fl=64,pl=4194304;function wo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function es(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,l=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=wo(a):(l&=s,l!==0&&(r=wo(l)))}else s=n&~o,s!==0?r=wo(s):l!==0&&(r=wo(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,l=t&-t,o>=l||o===16&&(l&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Lt(t),o=1<<n,r|=e[n],t&=~o;return r}function tg(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ng(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,l=e.pendingLanes;0<l;){var s=31-Lt(l),a=1<<s,u=o[s];u===-1?(!(a&n)||a&r)&&(o[s]=tg(a,t)):u<=t&&(e.expiredLanes|=a),l&=~a}}function ua(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Mf(){var e=fl;return fl<<=1,!(fl&4194240)&&(fl=64),e}function li(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function el(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Lt(t),e[t]=n}function rg(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Lt(n),l=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~l}}function cu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Lt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var pe=0;function $f(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var zf,du,Kf,Ff,Hf,ca=!1,hl=[],_n=null,In=null,An=null,Oo=new Map,Mo=new Map,jn=[],og="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function pc(e,t){switch(e){case"focusin":case"focusout":_n=null;break;case"dragenter":case"dragleave":In=null;break;case"mouseover":case"mouseout":An=null;break;case"pointerover":case"pointerout":Oo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mo.delete(t.pointerId)}}function co(e,t,n,r,o,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:l,targetContainers:[o]},t!==null&&(t=nl(t),t!==null&&du(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function lg(e,t,n,r,o){switch(t){case"focusin":return _n=co(_n,e,t,n,r,o),!0;case"dragenter":return In=co(In,e,t,n,r,o),!0;case"mouseover":return An=co(An,e,t,n,r,o),!0;case"pointerover":var l=o.pointerId;return Oo.set(l,co(Oo.get(l)||null,e,t,n,r,o)),!0;case"gotpointercapture":return l=o.pointerId,Mo.set(l,co(Mo.get(l)||null,e,t,n,r,o)),!0}return!1}function Wf(e){var t=Jn(e.target);if(t!==null){var n=yr(t);if(n!==null){if(t=n.tag,t===13){if(t=_f(n),t!==null){e.blockedOn=t,Hf(e.priority,function(){Kf(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Al(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=da(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);la=r,n.target.dispatchEvent(r),la=null}else return t=nl(n),t!==null&&du(t),e.blockedOn=n,!1;t.shift()}return!0}function hc(e,t,n){Al(e)&&n.delete(t)}function sg(){ca=!1,_n!==null&&Al(_n)&&(_n=null),In!==null&&Al(In)&&(In=null),An!==null&&Al(An)&&(An=null),Oo.forEach(hc),Mo.forEach(hc)}function fo(e,t){e.blockedOn===t&&(e.blockedOn=null,ca||(ca=!0,mt.unstable_scheduleCallback(mt.unstable_NormalPriority,sg)))}function $o(e){function t(o){return fo(o,e)}if(0<hl.length){fo(hl[0],e);for(var n=1;n<hl.length;n++){var r=hl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(_n!==null&&fo(_n,e),In!==null&&fo(In,e),An!==null&&fo(An,e),Oo.forEach(t),Mo.forEach(t),n=0;n<jn.length;n++)r=jn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<jn.length&&(n=jn[0],n.blockedOn===null);)Wf(n),n.blockedOn===null&&jn.shift()}var Fr=wn.ReactCurrentBatchConfig,ts=!0;function ig(e,t,n,r){var o=pe,l=Fr.transition;Fr.transition=null;try{pe=1,fu(e,t,n,r)}finally{pe=o,Fr.transition=l}}function ag(e,t,n,r){var o=pe,l=Fr.transition;Fr.transition=null;try{pe=4,fu(e,t,n,r)}finally{pe=o,Fr.transition=l}}function fu(e,t,n,r){if(ts){var o=da(e,t,n,r);if(o===null)mi(e,t,r,ns,n),pc(e,r);else if(lg(o,e,t,n,r))r.stopPropagation();else if(pc(e,r),t&4&&-1<og.indexOf(e)){for(;o!==null;){var l=nl(o);if(l!==null&&zf(l),l=da(e,t,n,r),l===null&&mi(e,t,r,ns,n),l===o)break;o=l}o!==null&&r.stopPropagation()}else mi(e,t,r,null,n)}}var ns=null;function da(e,t,n,r){if(ns=null,e=au(r),e=Jn(e),e!==null)if(t=yr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=_f(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ns=e,null}function Bf(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Qm()){case uu:return 1;case Df:return 4;case Jl:case Xm:return 16;case Of:return 536870912;default:return 16}default:return 16}}var Rn=null,pu=null,Ll=null;function Vf(){if(Ll)return Ll;var e,t=pu,n=t.length,r,o="value"in Rn?Rn.value:Rn.textContent,l=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[l-r];r++);return Ll=o.slice(e,1<r?1-r:void 0)}function Dl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ml(){return!0}function mc(){return!1}function yt(e){function t(n,r,o,l,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=l,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(l):l[a]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?ml:mc,this.isPropagationStopped=mc,this}return Te(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ml)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ml)},persist:function(){},isPersistent:ml}),t}var no={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hu=yt(no),tl=Te({},no,{view:0,detail:0}),ug=yt(tl),si,ii,po,As=Te({},tl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==po&&(po&&e.type==="mousemove"?(si=e.screenX-po.screenX,ii=e.screenY-po.screenY):ii=si=0,po=e),si)},movementY:function(e){return"movementY"in e?e.movementY:ii}}),gc=yt(As),cg=Te({},As,{dataTransfer:0}),dg=yt(cg),fg=Te({},tl,{relatedTarget:0}),ai=yt(fg),pg=Te({},no,{animationName:0,elapsedTime:0,pseudoElement:0}),hg=yt(pg),mg=Te({},no,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),gg=yt(mg),yg=Te({},no,{data:0}),yc=yt(yg),xg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vg={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},bg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=bg[e])?!!t[e]:!1}function mu(){return wg}var Sg=Te({},tl,{key:function(e){if(e.key){var t=xg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Dl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?vg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mu,charCode:function(e){return e.type==="keypress"?Dl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Dl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Cg=yt(Sg),kg=Te({},As,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xc=yt(kg),Eg=Te({},tl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mu}),jg=yt(Eg),Tg=Te({},no,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ng=yt(Tg),Rg=Te({},As,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Pg=yt(Rg),_g=[9,13,27,32],gu=cn&&"CompositionEvent"in window,jo=null;cn&&"documentMode"in document&&(jo=document.documentMode);var Ig=cn&&"TextEvent"in window&&!jo,Uf=cn&&(!gu||jo&&8<jo&&11>=jo),vc=" ",bc=!1;function Gf(e,t){switch(e){case"keyup":return _g.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Tr=!1;function Ag(e,t){switch(e){case"compositionend":return Yf(t);case"keypress":return t.which!==32?null:(bc=!0,vc);case"textInput":return e=t.data,e===vc&&bc?null:e;default:return null}}function Lg(e,t){if(Tr)return e==="compositionend"||!gu&&Gf(e,t)?(e=Vf(),Ll=pu=Rn=null,Tr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Uf&&t.locale!=="ko"?null:t.data;default:return null}}var Dg={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function wc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Dg[e.type]:t==="textarea"}function Qf(e,t,n,r){jf(r),t=rs(t,"onChange"),0<t.length&&(n=new hu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var To=null,zo=null;function Og(e){sp(e,0)}function Ls(e){var t=Pr(e);if(vf(t))return e}function Mg(e,t){if(e==="change")return t}var Xf=!1;if(cn){var ui;if(cn){var ci="oninput"in document;if(!ci){var Sc=document.createElement("div");Sc.setAttribute("oninput","return;"),ci=typeof Sc.oninput=="function"}ui=ci}else ui=!1;Xf=ui&&(!document.documentMode||9<document.documentMode)}function Cc(){To&&(To.detachEvent("onpropertychange",Zf),zo=To=null)}function Zf(e){if(e.propertyName==="value"&&Ls(zo)){var t=[];Qf(t,zo,e,au(e)),Pf(Og,t)}}function $g(e,t,n){e==="focusin"?(Cc(),To=t,zo=n,To.attachEvent("onpropertychange",Zf)):e==="focusout"&&Cc()}function zg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ls(zo)}function Kg(e,t){if(e==="click")return Ls(t)}function Fg(e,t){if(e==="input"||e==="change")return Ls(t)}function Hg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ot=typeof Object.is=="function"?Object.is:Hg;function Ko(e,t){if(Ot(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Gi.call(t,o)||!Ot(e[o],t[o]))return!1}return!0}function kc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ec(e,t){var n=kc(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=kc(n)}}function qf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jf(){for(var e=window,t=Xl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Xl(e.document)}return t}function yu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Wg(e){var t=Jf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&qf(n.ownerDocument.documentElement,n)){if(r!==null&&yu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,l=Math.min(r.start,o);r=r.end===void 0?l:Math.min(r.end,o),!e.extend&&l>r&&(o=r,r=l,l=o),o=Ec(n,l);var s=Ec(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Bg=cn&&"documentMode"in document&&11>=document.documentMode,Nr=null,fa=null,No=null,pa=!1;function jc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;pa||Nr==null||Nr!==Xl(r)||(r=Nr,"selectionStart"in r&&yu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),No&&Ko(No,r)||(No=r,r=rs(fa,"onSelect"),0<r.length&&(t=new hu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Nr)))}function gl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Rr={animationend:gl("Animation","AnimationEnd"),animationiteration:gl("Animation","AnimationIteration"),animationstart:gl("Animation","AnimationStart"),transitionend:gl("Transition","TransitionEnd")},di={},ep={};cn&&(ep=document.createElement("div").style,"AnimationEvent"in window||(delete Rr.animationend.animation,delete Rr.animationiteration.animation,delete Rr.animationstart.animation),"TransitionEvent"in window||delete Rr.transitionend.transition);function Ds(e){if(di[e])return di[e];if(!Rr[e])return e;var t=Rr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ep)return di[e]=t[n];return e}var tp=Ds("animationend"),np=Ds("animationiteration"),rp=Ds("animationstart"),op=Ds("transitionend"),lp=new Map,Tc="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Bn(e,t){lp.set(e,t),gr(t,[e])}for(var fi=0;fi<Tc.length;fi++){var pi=Tc[fi],Vg=pi.toLowerCase(),Ug=pi[0].toUpperCase()+pi.slice(1);Bn(Vg,"on"+Ug)}Bn(tp,"onAnimationEnd");Bn(np,"onAnimationIteration");Bn(rp,"onAnimationStart");Bn("dblclick","onDoubleClick");Bn("focusin","onFocus");Bn("focusout","onBlur");Bn(op,"onTransitionEnd");Ur("onMouseEnter",["mouseout","mouseover"]);Ur("onMouseLeave",["mouseout","mouseover"]);Ur("onPointerEnter",["pointerout","pointerover"]);Ur("onPointerLeave",["pointerout","pointerover"]);gr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));gr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));gr("onBeforeInput",["compositionend","keypress","textInput","paste"]);gr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));gr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));gr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var So="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Gg=new Set("cancel close invalid load scroll toggle".split(" ").concat(So));function Nc(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Vm(r,t,void 0,e),e.currentTarget=null}function sp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var l=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],u=a.instance,c=a.currentTarget;if(a=a.listener,u!==l&&o.isPropagationStopped())break e;Nc(o,a,c),l=u}else for(s=0;s<r.length;s++){if(a=r[s],u=a.instance,c=a.currentTarget,a=a.listener,u!==l&&o.isPropagationStopped())break e;Nc(o,a,c),l=u}}}if(ql)throw e=aa,ql=!1,aa=null,e}function be(e,t){var n=t[xa];n===void 0&&(n=t[xa]=new Set);var r=e+"__bubble";n.has(r)||(ip(t,e,2,!1),n.add(r))}function hi(e,t,n){var r=0;t&&(r|=4),ip(n,e,r,t)}var yl="_reactListening"+Math.random().toString(36).slice(2);function Fo(e){if(!e[yl]){e[yl]=!0,hf.forEach(function(n){n!=="selectionchange"&&(Gg.has(n)||hi(n,!1,e),hi(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[yl]||(t[yl]=!0,hi("selectionchange",!1,t))}}function ip(e,t,n,r){switch(Bf(t)){case 1:var o=ig;break;case 4:o=ag;break;default:o=fu}n=o.bind(null,t,n,e),o=void 0,!ia||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function mi(e,t,n,r,o){var l=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var u=s.tag;if((u===3||u===4)&&(u=s.stateNode.containerInfo,u===o||u.nodeType===8&&u.parentNode===o))return;s=s.return}for(;a!==null;){if(s=Jn(a),s===null)return;if(u=s.tag,u===5||u===6){r=l=s;continue e}a=a.parentNode}}r=r.return}Pf(function(){var c=l,f=au(n),h=[];e:{var d=lp.get(e);if(d!==void 0){var m=hu,v=e;switch(e){case"keypress":if(Dl(n)===0)break e;case"keydown":case"keyup":m=Cg;break;case"focusin":v="focus",m=ai;break;case"focusout":v="blur",m=ai;break;case"beforeblur":case"afterblur":m=ai;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=gc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=dg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=jg;break;case tp:case np:case rp:m=hg;break;case op:m=Ng;break;case"scroll":m=ug;break;case"wheel":m=Pg;break;case"copy":case"cut":case"paste":m=gg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=xc}var b=(t&4)!==0,S=!b&&e==="scroll",p=b?d!==null?d+"Capture":null:d;b=[];for(var g=c,y;g!==null;){y=g;var x=y.stateNode;if(y.tag===5&&x!==null&&(y=x,p!==null&&(x=Do(g,p),x!=null&&b.push(Ho(g,x,y)))),S)break;g=g.return}0<b.length&&(d=new m(d,v,null,n,f),h.push({event:d,listeners:b}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",d&&n!==la&&(v=n.relatedTarget||n.fromElement)&&(Jn(v)||v[dn]))break e;if((m||d)&&(d=f.window===f?f:(d=f.ownerDocument)?d.defaultView||d.parentWindow:window,m?(v=n.relatedTarget||n.toElement,m=c,v=v?Jn(v):null,v!==null&&(S=yr(v),v!==S||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=c),m!==v)){if(b=gc,x="onMouseLeave",p="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(b=xc,x="onPointerLeave",p="onPointerEnter",g="pointer"),S=m==null?d:Pr(m),y=v==null?d:Pr(v),d=new b(x,g+"leave",m,n,f),d.target=S,d.relatedTarget=y,x=null,Jn(f)===c&&(b=new b(p,g+"enter",v,n,f),b.target=y,b.relatedTarget=S,x=b),S=x,m&&v)t:{for(b=m,p=v,g=0,y=b;y;y=br(y))g++;for(y=0,x=p;x;x=br(x))y++;for(;0<g-y;)b=br(b),g--;for(;0<y-g;)p=br(p),y--;for(;g--;){if(b===p||p!==null&&b===p.alternate)break t;b=br(b),p=br(p)}b=null}else b=null;m!==null&&Rc(h,d,m,b,!1),v!==null&&S!==null&&Rc(h,S,v,b,!0)}}e:{if(d=c?Pr(c):window,m=d.nodeName&&d.nodeName.toLowerCase(),m==="select"||m==="input"&&d.type==="file")var k=Mg;else if(wc(d))if(Xf)k=Fg;else{k=zg;var C=$g}else(m=d.nodeName)&&m.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(k=Kg);if(k&&(k=k(e,c))){Qf(h,k,n,f);break e}C&&C(e,d,c),e==="focusout"&&(C=d._wrapperState)&&C.controlled&&d.type==="number"&&ea(d,"number",d.value)}switch(C=c?Pr(c):window,e){case"focusin":(wc(C)||C.contentEditable==="true")&&(Nr=C,fa=c,No=null);break;case"focusout":No=fa=Nr=null;break;case"mousedown":pa=!0;break;case"contextmenu":case"mouseup":case"dragend":pa=!1,jc(h,n,f);break;case"selectionchange":if(Bg)break;case"keydown":case"keyup":jc(h,n,f)}var j;if(gu)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Tr?Gf(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(Uf&&n.locale!=="ko"&&(Tr||E!=="onCompositionStart"?E==="onCompositionEnd"&&Tr&&(j=Vf()):(Rn=f,pu="value"in Rn?Rn.value:Rn.textContent,Tr=!0)),C=rs(c,E),0<C.length&&(E=new yc(E,e,null,n,f),h.push({event:E,listeners:C}),j?E.data=j:(j=Yf(n),j!==null&&(E.data=j)))),(j=Ig?Ag(e,n):Lg(e,n))&&(c=rs(c,"onBeforeInput"),0<c.length&&(f=new yc("onBeforeInput","beforeinput",null,n,f),h.push({event:f,listeners:c}),f.data=j))}sp(h,t)})}function Ho(e,t,n){return{instance:e,listener:t,currentTarget:n}}function rs(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,l=o.stateNode;o.tag===5&&l!==null&&(o=l,l=Do(e,n),l!=null&&r.unshift(Ho(e,l,o)),l=Do(e,t),l!=null&&r.push(Ho(e,l,o))),e=e.return}return r}function br(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Rc(e,t,n,r,o){for(var l=t._reactName,s=[];n!==null&&n!==r;){var a=n,u=a.alternate,c=a.stateNode;if(u!==null&&u===r)break;a.tag===5&&c!==null&&(a=c,o?(u=Do(n,l),u!=null&&s.unshift(Ho(n,u,a))):o||(u=Do(n,l),u!=null&&s.push(Ho(n,u,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Yg=/\r\n?/g,Qg=/\u0000|\uFFFD/g;function Pc(e){return(typeof e=="string"?e:""+e).replace(Yg,`
|
|
38
|
+
`).replace(Qg,"")}function xl(e,t,n){if(t=Pc(t),Pc(e)!==t&&n)throw Error(M(425))}function os(){}var ha=null,ma=null;function ga(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ya=typeof setTimeout=="function"?setTimeout:void 0,Xg=typeof clearTimeout=="function"?clearTimeout:void 0,_c=typeof Promise=="function"?Promise:void 0,Zg=typeof queueMicrotask=="function"?queueMicrotask:typeof _c<"u"?function(e){return _c.resolve(null).then(e).catch(qg)}:ya;function qg(e){setTimeout(function(){throw e})}function gi(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),$o(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);$o(t)}function Ln(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Ic(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var ro=Math.random().toString(36).slice(2),Kt="__reactFiber$"+ro,Wo="__reactProps$"+ro,dn="__reactContainer$"+ro,xa="__reactEvents$"+ro,Jg="__reactListeners$"+ro,ey="__reactHandles$"+ro;function Jn(e){var t=e[Kt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[dn]||n[Kt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ic(e);e!==null;){if(n=e[Kt])return n;e=Ic(e)}return t}e=n,n=e.parentNode}return null}function nl(e){return e=e[Kt]||e[dn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Pr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(M(33))}function Os(e){return e[Wo]||null}var va=[],_r=-1;function Vn(e){return{current:e}}function we(e){0>_r||(e.current=va[_r],va[_r]=null,_r--)}function xe(e,t){_r++,va[_r]=e.current,e.current=t}var Fn={},Xe=Vn(Fn),it=Vn(!1),sr=Fn;function Gr(e,t){var n=e.type.contextTypes;if(!n)return Fn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},l;for(l in n)o[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function at(e){return e=e.childContextTypes,e!=null}function ls(){we(it),we(Xe)}function Ac(e,t,n){if(Xe.current!==Fn)throw Error(M(168));xe(Xe,t),xe(it,n)}function ap(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(M(108,$m(e)||"Unknown",o));return Te({},n,r)}function ss(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Fn,sr=Xe.current,xe(Xe,e),xe(it,it.current),!0}function Lc(e,t,n){var r=e.stateNode;if(!r)throw Error(M(169));n?(e=ap(e,t,sr),r.__reactInternalMemoizedMergedChildContext=e,we(it),we(Xe),xe(Xe,e)):we(it),xe(it,n)}var tn=null,Ms=!1,yi=!1;function up(e){tn===null?tn=[e]:tn.push(e)}function ty(e){Ms=!0,up(e)}function Un(){if(!yi&&tn!==null){yi=!0;var e=0,t=pe;try{var n=tn;for(pe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}tn=null,Ms=!1}catch(o){throw tn!==null&&(tn=tn.slice(e+1)),Lf(uu,Un),o}finally{pe=t,yi=!1}}return null}var Ir=[],Ar=0,is=null,as=0,St=[],Ct=0,ir=null,rn=1,on="";function Zn(e,t){Ir[Ar++]=as,Ir[Ar++]=is,is=e,as=t}function cp(e,t,n){St[Ct++]=rn,St[Ct++]=on,St[Ct++]=ir,ir=e;var r=rn;e=on;var o=32-Lt(r)-1;r&=~(1<<o),n+=1;var l=32-Lt(t)+o;if(30<l){var s=o-o%5;l=(r&(1<<s)-1).toString(32),r>>=s,o-=s,rn=1<<32-Lt(t)+o|n<<o|r,on=l+e}else rn=1<<l|n<<o|r,on=e}function xu(e){e.return!==null&&(Zn(e,1),cp(e,1,0))}function vu(e){for(;e===is;)is=Ir[--Ar],Ir[Ar]=null,as=Ir[--Ar],Ir[Ar]=null;for(;e===ir;)ir=St[--Ct],St[Ct]=null,on=St[--Ct],St[Ct]=null,rn=St[--Ct],St[Ct]=null}var pt=null,ft=null,Se=!1,At=null;function dp(e,t){var n=kt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Dc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,pt=e,ft=Ln(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,pt=e,ft=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ir!==null?{id:rn,overflow:on}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=kt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,pt=e,ft=null,!0):!1;default:return!1}}function ba(e){return(e.mode&1)!==0&&(e.flags&128)===0}function wa(e){if(Se){var t=ft;if(t){var n=t;if(!Dc(e,t)){if(ba(e))throw Error(M(418));t=Ln(n.nextSibling);var r=pt;t&&Dc(e,t)?dp(r,n):(e.flags=e.flags&-4097|2,Se=!1,pt=e)}}else{if(ba(e))throw Error(M(418));e.flags=e.flags&-4097|2,Se=!1,pt=e}}}function Oc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;pt=e}function vl(e){if(e!==pt)return!1;if(!Se)return Oc(e),Se=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ga(e.type,e.memoizedProps)),t&&(t=ft)){if(ba(e))throw fp(),Error(M(418));for(;t;)dp(e,t),t=Ln(t.nextSibling)}if(Oc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ft=Ln(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ft=null}}else ft=pt?Ln(e.stateNode.nextSibling):null;return!0}function fp(){for(var e=ft;e;)e=Ln(e.nextSibling)}function Yr(){ft=pt=null,Se=!1}function bu(e){At===null?At=[e]:At.push(e)}var ny=wn.ReactCurrentBatchConfig;function ho(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(M(309));var r=n.stateNode}if(!r)throw Error(M(147,e));var o=r,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(s){var a=o.refs;s===null?delete a[l]:a[l]=s},t._stringRef=l,t)}if(typeof e!="string")throw Error(M(284));if(!n._owner)throw Error(M(290,e))}return e}function bl(e,t){throw e=Object.prototype.toString.call(t),Error(M(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Mc(e){var t=e._init;return t(e._payload)}function pp(e){function t(p,g){if(e){var y=p.deletions;y===null?(p.deletions=[g],p.flags|=16):y.push(g)}}function n(p,g){if(!e)return null;for(;g!==null;)t(p,g),g=g.sibling;return null}function r(p,g){for(p=new Map;g!==null;)g.key!==null?p.set(g.key,g):p.set(g.index,g),g=g.sibling;return p}function o(p,g){return p=$n(p,g),p.index=0,p.sibling=null,p}function l(p,g,y){return p.index=y,e?(y=p.alternate,y!==null?(y=y.index,y<g?(p.flags|=2,g):y):(p.flags|=2,g)):(p.flags|=1048576,g)}function s(p){return e&&p.alternate===null&&(p.flags|=2),p}function a(p,g,y,x){return g===null||g.tag!==6?(g=ki(y,p.mode,x),g.return=p,g):(g=o(g,y),g.return=p,g)}function u(p,g,y,x){var k=y.type;return k===jr?f(p,g,y.props.children,x,y.key):g!==null&&(g.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Cn&&Mc(k)===g.type)?(x=o(g,y.props),x.ref=ho(p,g,y),x.return=p,x):(x=Hl(y.type,y.key,y.props,null,p.mode,x),x.ref=ho(p,g,y),x.return=p,x)}function c(p,g,y,x){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=Ei(y,p.mode,x),g.return=p,g):(g=o(g,y.children||[]),g.return=p,g)}function f(p,g,y,x,k){return g===null||g.tag!==7?(g=or(y,p.mode,x,k),g.return=p,g):(g=o(g,y),g.return=p,g)}function h(p,g,y){if(typeof g=="string"&&g!==""||typeof g=="number")return g=ki(""+g,p.mode,y),g.return=p,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ul:return y=Hl(g.type,g.key,g.props,null,p.mode,y),y.ref=ho(p,null,g),y.return=p,y;case Er:return g=Ei(g,p.mode,y),g.return=p,g;case Cn:var x=g._init;return h(p,x(g._payload),y)}if(bo(g)||ao(g))return g=or(g,p.mode,y,null),g.return=p,g;bl(p,g)}return null}function d(p,g,y,x){var k=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return k!==null?null:a(p,g,""+y,x);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ul:return y.key===k?u(p,g,y,x):null;case Er:return y.key===k?c(p,g,y,x):null;case Cn:return k=y._init,d(p,g,k(y._payload),x)}if(bo(y)||ao(y))return k!==null?null:f(p,g,y,x,null);bl(p,y)}return null}function m(p,g,y,x,k){if(typeof x=="string"&&x!==""||typeof x=="number")return p=p.get(y)||null,a(g,p,""+x,k);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case ul:return p=p.get(x.key===null?y:x.key)||null,u(g,p,x,k);case Er:return p=p.get(x.key===null?y:x.key)||null,c(g,p,x,k);case Cn:var C=x._init;return m(p,g,y,C(x._payload),k)}if(bo(x)||ao(x))return p=p.get(y)||null,f(g,p,x,k,null);bl(g,x)}return null}function v(p,g,y,x){for(var k=null,C=null,j=g,E=g=0,A=null;j!==null&&E<y.length;E++){j.index>E?(A=j,j=null):A=j.sibling;var _=d(p,j,y[E],x);if(_===null){j===null&&(j=A);break}e&&j&&_.alternate===null&&t(p,j),g=l(_,g,E),C===null?k=_:C.sibling=_,C=_,j=A}if(E===y.length)return n(p,j),Se&&Zn(p,E),k;if(j===null){for(;E<y.length;E++)j=h(p,y[E],x),j!==null&&(g=l(j,g,E),C===null?k=j:C.sibling=j,C=j);return Se&&Zn(p,E),k}for(j=r(p,j);E<y.length;E++)A=m(j,p,E,y[E],x),A!==null&&(e&&A.alternate!==null&&j.delete(A.key===null?E:A.key),g=l(A,g,E),C===null?k=A:C.sibling=A,C=A);return e&&j.forEach(function(L){return t(p,L)}),Se&&Zn(p,E),k}function b(p,g,y,x){var k=ao(y);if(typeof k!="function")throw Error(M(150));if(y=k.call(y),y==null)throw Error(M(151));for(var C=k=null,j=g,E=g=0,A=null,_=y.next();j!==null&&!_.done;E++,_=y.next()){j.index>E?(A=j,j=null):A=j.sibling;var L=d(p,j,_.value,x);if(L===null){j===null&&(j=A);break}e&&j&&L.alternate===null&&t(p,j),g=l(L,g,E),C===null?k=L:C.sibling=L,C=L,j=A}if(_.done)return n(p,j),Se&&Zn(p,E),k;if(j===null){for(;!_.done;E++,_=y.next())_=h(p,_.value,x),_!==null&&(g=l(_,g,E),C===null?k=_:C.sibling=_,C=_);return Se&&Zn(p,E),k}for(j=r(p,j);!_.done;E++,_=y.next())_=m(j,p,E,_.value,x),_!==null&&(e&&_.alternate!==null&&j.delete(_.key===null?E:_.key),g=l(_,g,E),C===null?k=_:C.sibling=_,C=_);return e&&j.forEach(function(B){return t(p,B)}),Se&&Zn(p,E),k}function S(p,g,y,x){if(typeof y=="object"&&y!==null&&y.type===jr&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case ul:e:{for(var k=y.key,C=g;C!==null;){if(C.key===k){if(k=y.type,k===jr){if(C.tag===7){n(p,C.sibling),g=o(C,y.props.children),g.return=p,p=g;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Cn&&Mc(k)===C.type){n(p,C.sibling),g=o(C,y.props),g.ref=ho(p,C,y),g.return=p,p=g;break e}n(p,C);break}else t(p,C);C=C.sibling}y.type===jr?(g=or(y.props.children,p.mode,x,y.key),g.return=p,p=g):(x=Hl(y.type,y.key,y.props,null,p.mode,x),x.ref=ho(p,g,y),x.return=p,p=x)}return s(p);case Er:e:{for(C=y.key;g!==null;){if(g.key===C)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(p,g.sibling),g=o(g,y.children||[]),g.return=p,p=g;break e}else{n(p,g);break}else t(p,g);g=g.sibling}g=Ei(y,p.mode,x),g.return=p,p=g}return s(p);case Cn:return C=y._init,S(p,g,C(y._payload),x)}if(bo(y))return v(p,g,y,x);if(ao(y))return b(p,g,y,x);bl(p,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(n(p,g.sibling),g=o(g,y),g.return=p,p=g):(n(p,g),g=ki(y,p.mode,x),g.return=p,p=g),s(p)):n(p,g)}return S}var Qr=pp(!0),hp=pp(!1),us=Vn(null),cs=null,Lr=null,wu=null;function Su(){wu=Lr=cs=null}function Cu(e){var t=us.current;we(us),e._currentValue=t}function Sa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Hr(e,t){cs=e,wu=Lr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(st=!0),e.firstContext=null)}function Tt(e){var t=e._currentValue;if(wu!==e)if(e={context:e,memoizedValue:t,next:null},Lr===null){if(cs===null)throw Error(M(308));Lr=e,cs.dependencies={lanes:0,firstContext:e}}else Lr=Lr.next=e;return t}var er=null;function ku(e){er===null?er=[e]:er.push(e)}function mp(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,ku(t)):(n.next=o.next,o.next=n),t.interleaved=n,fn(e,r)}function fn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var kn=!1;function Eu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function sn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Dn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ce&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,fn(e,n)}return o=r.interleaved,o===null?(t.next=t,ku(r)):(t.next=o.next,o.next=t),r.interleaved=t,fn(e,n)}function Ol(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,cu(e,n)}}function $c(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?o=l=s:l=l.next=s,n=n.next}while(n!==null);l===null?o=l=t:l=l.next=t}else o=l=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ds(e,t,n,r){var o=e.updateQueue;kn=!1;var l=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var u=a,c=u.next;u.next=null,s===null?l=c:s.next=c,s=u;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==s&&(a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=u))}if(l!==null){var h=o.baseState;s=0,f=c=u=null,a=l;do{var d=a.lane,m=a.eventTime;if((r&d)===d){f!==null&&(f=f.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,b=a;switch(d=t,m=n,b.tag){case 1:if(v=b.payload,typeof v=="function"){h=v.call(m,h,d);break e}h=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=b.payload,d=typeof v=="function"?v.call(m,h,d):v,d==null)break e;h=Te({},h,d);break e;case 2:kn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,d=o.effects,d===null?o.effects=[a]:d.push(a))}else m={eventTime:m,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(c=f=m,u=h):f=f.next=m,s|=d;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;d=a,a=d.next,d.next=null,o.lastBaseUpdate=d,o.shared.pending=null}}while(!0);if(f===null&&(u=h),o.baseState=u,o.firstBaseUpdate=c,o.lastBaseUpdate=f,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else l===null&&(o.shared.lanes=0);ur|=s,e.lanes=s,e.memoizedState=h}}function zc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(M(191,o));o.call(r)}}}var rl={},Ht=Vn(rl),Bo=Vn(rl),Vo=Vn(rl);function tr(e){if(e===rl)throw Error(M(174));return e}function ju(e,t){switch(xe(Vo,t),xe(Bo,e),xe(Ht,rl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:na(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=na(t,e)}we(Ht),xe(Ht,t)}function Xr(){we(Ht),we(Bo),we(Vo)}function yp(e){tr(Vo.current);var t=tr(Ht.current),n=na(t,e.type);t!==n&&(xe(Bo,e),xe(Ht,n))}function Tu(e){Bo.current===e&&(we(Ht),we(Bo))}var Ee=Vn(0);function fs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var xi=[];function Nu(){for(var e=0;e<xi.length;e++)xi[e]._workInProgressVersionPrimary=null;xi.length=0}var Ml=wn.ReactCurrentDispatcher,vi=wn.ReactCurrentBatchConfig,ar=0,je=null,$e=null,Fe=null,ps=!1,Ro=!1,Uo=0,ry=0;function Ge(){throw Error(M(321))}function Ru(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ot(e[n],t[n]))return!1;return!0}function Pu(e,t,n,r,o,l){if(ar=l,je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ml.current=e===null||e.memoizedState===null?iy:ay,e=n(r,o),Ro){l=0;do{if(Ro=!1,Uo=0,25<=l)throw Error(M(301));l+=1,Fe=$e=null,t.updateQueue=null,Ml.current=uy,e=n(r,o)}while(Ro)}if(Ml.current=hs,t=$e!==null&&$e.next!==null,ar=0,Fe=$e=je=null,ps=!1,t)throw Error(M(300));return e}function _u(){var e=Uo!==0;return Uo=0,e}function $t(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fe===null?je.memoizedState=Fe=e:Fe=Fe.next=e,Fe}function Nt(){if($e===null){var e=je.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=Fe===null?je.memoizedState:Fe.next;if(t!==null)Fe=t,$e=e;else{if(e===null)throw Error(M(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},Fe===null?je.memoizedState=Fe=e:Fe=Fe.next=e}return Fe}function Go(e,t){return typeof t=="function"?t(e):t}function bi(e){var t=Nt(),n=t.queue;if(n===null)throw Error(M(311));n.lastRenderedReducer=e;var r=$e,o=r.baseQueue,l=n.pending;if(l!==null){if(o!==null){var s=o.next;o.next=l.next,l.next=s}r.baseQueue=o=l,n.pending=null}if(o!==null){l=o.next,r=r.baseState;var a=s=null,u=null,c=l;do{var f=c.lane;if((ar&f)===f)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var h={lane:f,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(a=u=h,s=r):u=u.next=h,je.lanes|=f,ur|=f}c=c.next}while(c!==null&&c!==l);u===null?s=r:u.next=a,Ot(r,t.memoizedState)||(st=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do l=o.lane,je.lanes|=l,ur|=l,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function wi(e){var t=Nt(),n=t.queue;if(n===null)throw Error(M(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,l=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do l=e(l,s.action),s=s.next;while(s!==o);Ot(l,t.memoizedState)||(st=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function xp(){}function vp(e,t){var n=je,r=Nt(),o=t(),l=!Ot(r.memoizedState,o);if(l&&(r.memoizedState=o,st=!0),r=r.queue,Iu(Sp.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||Fe!==null&&Fe.memoizedState.tag&1){if(n.flags|=2048,Yo(9,wp.bind(null,n,r,o,t),void 0,null),He===null)throw Error(M(349));ar&30||bp(n,t,o)}return o}function bp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=je.updateQueue,t===null?(t={lastEffect:null,stores:null},je.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function wp(e,t,n,r){t.value=n,t.getSnapshot=r,Cp(t)&&kp(e)}function Sp(e,t,n){return n(function(){Cp(t)&&kp(e)})}function Cp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ot(e,n)}catch{return!0}}function kp(e){var t=fn(e,1);t!==null&&Dt(t,e,1,-1)}function Kc(e){var t=$t();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Go,lastRenderedState:e},t.queue=e,e=e.dispatch=sy.bind(null,je,e),[t.memoizedState,e]}function Yo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=je.updateQueue,t===null?(t={lastEffect:null,stores:null},je.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Ep(){return Nt().memoizedState}function $l(e,t,n,r){var o=$t();je.flags|=e,o.memoizedState=Yo(1|t,n,void 0,r===void 0?null:r)}function $s(e,t,n,r){var o=Nt();r=r===void 0?null:r;var l=void 0;if($e!==null){var s=$e.memoizedState;if(l=s.destroy,r!==null&&Ru(r,s.deps)){o.memoizedState=Yo(t,n,l,r);return}}je.flags|=e,o.memoizedState=Yo(1|t,n,l,r)}function Fc(e,t){return $l(8390656,8,e,t)}function Iu(e,t){return $s(2048,8,e,t)}function jp(e,t){return $s(4,2,e,t)}function Tp(e,t){return $s(4,4,e,t)}function Np(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Rp(e,t,n){return n=n!=null?n.concat([e]):null,$s(4,4,Np.bind(null,t,e),n)}function Au(){}function Pp(e,t){var n=Nt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ru(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _p(e,t){var n=Nt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ru(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ip(e,t,n){return ar&21?(Ot(n,t)||(n=Mf(),je.lanes|=n,ur|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,st=!0),e.memoizedState=n)}function oy(e,t){var n=pe;pe=n!==0&&4>n?n:4,e(!0);var r=vi.transition;vi.transition={};try{e(!1),t()}finally{pe=n,vi.transition=r}}function Ap(){return Nt().memoizedState}function ly(e,t,n){var r=Mn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Lp(e))Dp(t,n);else if(n=mp(e,t,n,r),n!==null){var o=qe();Dt(n,e,r,o),Op(n,t,r)}}function sy(e,t,n){var r=Mn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Lp(e))Dp(t,o);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var s=t.lastRenderedState,a=l(s,n);if(o.hasEagerState=!0,o.eagerState=a,Ot(a,s)){var u=t.interleaved;u===null?(o.next=o,ku(t)):(o.next=u.next,u.next=o),t.interleaved=o;return}}catch{}finally{}n=mp(e,t,o,r),n!==null&&(o=qe(),Dt(n,e,r,o),Op(n,t,r))}}function Lp(e){var t=e.alternate;return e===je||t!==null&&t===je}function Dp(e,t){Ro=ps=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Op(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,cu(e,n)}}var hs={readContext:Tt,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useInsertionEffect:Ge,useLayoutEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useMutableSource:Ge,useSyncExternalStore:Ge,useId:Ge,unstable_isNewReconciler:!1},iy={readContext:Tt,useCallback:function(e,t){return $t().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:Fc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$l(4194308,4,Np.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $l(4194308,4,e,t)},useInsertionEffect:function(e,t){return $l(4,2,e,t)},useMemo:function(e,t){var n=$t();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=$t();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ly.bind(null,je,e),[r.memoizedState,e]},useRef:function(e){var t=$t();return e={current:e},t.memoizedState=e},useState:Kc,useDebugValue:Au,useDeferredValue:function(e){return $t().memoizedState=e},useTransition:function(){var e=Kc(!1),t=e[0];return e=oy.bind(null,e[1]),$t().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=je,o=$t();if(Se){if(n===void 0)throw Error(M(407));n=n()}else{if(n=t(),He===null)throw Error(M(349));ar&30||bp(r,t,n)}o.memoizedState=n;var l={value:n,getSnapshot:t};return o.queue=l,Fc(Sp.bind(null,r,l,e),[e]),r.flags|=2048,Yo(9,wp.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=$t(),t=He.identifierPrefix;if(Se){var n=on,r=rn;n=(r&~(1<<32-Lt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Uo++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=ry++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ay={readContext:Tt,useCallback:Pp,useContext:Tt,useEffect:Iu,useImperativeHandle:Rp,useInsertionEffect:jp,useLayoutEffect:Tp,useMemo:_p,useReducer:bi,useRef:Ep,useState:function(){return bi(Go)},useDebugValue:Au,useDeferredValue:function(e){var t=Nt();return Ip(t,$e.memoizedState,e)},useTransition:function(){var e=bi(Go)[0],t=Nt().memoizedState;return[e,t]},useMutableSource:xp,useSyncExternalStore:vp,useId:Ap,unstable_isNewReconciler:!1},uy={readContext:Tt,useCallback:Pp,useContext:Tt,useEffect:Iu,useImperativeHandle:Rp,useInsertionEffect:jp,useLayoutEffect:Tp,useMemo:_p,useReducer:wi,useRef:Ep,useState:function(){return wi(Go)},useDebugValue:Au,useDeferredValue:function(e){var t=Nt();return $e===null?t.memoizedState=e:Ip(t,$e.memoizedState,e)},useTransition:function(){var e=wi(Go)[0],t=Nt().memoizedState;return[e,t]},useMutableSource:xp,useSyncExternalStore:vp,useId:Ap,unstable_isNewReconciler:!1};function _t(e,t){if(e&&e.defaultProps){t=Te({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ca(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Te({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zs={isMounted:function(e){return(e=e._reactInternals)?yr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=qe(),o=Mn(e),l=sn(r,o);l.payload=t,n!=null&&(l.callback=n),t=Dn(e,l,o),t!==null&&(Dt(t,e,o,r),Ol(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=qe(),o=Mn(e),l=sn(r,o);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=Dn(e,l,o),t!==null&&(Dt(t,e,o,r),Ol(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=qe(),r=Mn(e),o=sn(n,r);o.tag=2,t!=null&&(o.callback=t),t=Dn(e,o,r),t!==null&&(Dt(t,e,r,n),Ol(t,e,r))}};function Hc(e,t,n,r,o,l,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,l,s):t.prototype&&t.prototype.isPureReactComponent?!Ko(n,r)||!Ko(o,l):!0}function Mp(e,t,n){var r=!1,o=Fn,l=t.contextType;return typeof l=="object"&&l!==null?l=Tt(l):(o=at(t)?sr:Xe.current,r=t.contextTypes,l=(r=r!=null)?Gr(e,o):Fn),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=zs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=l),t}function Wc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&zs.enqueueReplaceState(t,t.state,null)}function ka(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Eu(e);var l=t.contextType;typeof l=="object"&&l!==null?o.context=Tt(l):(l=at(t)?sr:Xe.current,o.context=Gr(e,l)),o.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(Ca(e,t,l,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&zs.enqueueReplaceState(o,o.state,null),ds(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Zr(e,t){try{var n="",r=t;do n+=Mm(r),r=r.return;while(r);var o=n}catch(l){o=`
|
|
39
|
+
Error generating stack: `+l.message+`
|
|
40
|
+
`+l.stack}return{value:e,source:t,stack:o,digest:null}}function Si(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ea(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var cy=typeof WeakMap=="function"?WeakMap:Map;function $p(e,t,n){n=sn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){gs||(gs=!0,Da=r),Ea(e,t)},n}function zp(e,t,n){n=sn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Ea(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){Ea(e,t),typeof r!="function"&&(On===null?On=new Set([this]):On.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Bc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new cy;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=ky.bind(null,e,t,n),t.then(e,e))}function Vc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Uc(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=sn(-1,1),t.tag=2,Dn(n,t,1))),n.lanes|=1),e)}var dy=wn.ReactCurrentOwner,st=!1;function Ze(e,t,n,r){t.child=e===null?hp(t,null,n,r):Qr(t,e.child,n,r)}function Gc(e,t,n,r,o){n=n.render;var l=t.ref;return Hr(t,o),r=Pu(e,t,n,r,l,o),n=_u(),e!==null&&!st?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,pn(e,t,o)):(Se&&n&&xu(t),t.flags|=1,Ze(e,t,r,o),t.child)}function Yc(e,t,n,r,o){if(e===null){var l=n.type;return typeof l=="function"&&!Fu(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,Kp(e,t,l,r,o)):(e=Hl(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&o)){var s=l.memoizedProps;if(n=n.compare,n=n!==null?n:Ko,n(s,r)&&e.ref===t.ref)return pn(e,t,o)}return t.flags|=1,e=$n(l,r),e.ref=t.ref,e.return=t,t.child=e}function Kp(e,t,n,r,o){if(e!==null){var l=e.memoizedProps;if(Ko(l,r)&&e.ref===t.ref)if(st=!1,t.pendingProps=r=l,(e.lanes&o)!==0)e.flags&131072&&(st=!0);else return t.lanes=e.lanes,pn(e,t,o)}return ja(e,t,n,r,o)}function Fp(e,t,n){var r=t.pendingProps,o=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},xe(Or,ct),ct|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,xe(Or,ct),ct|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,xe(Or,ct),ct|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,xe(Or,ct),ct|=r;return Ze(e,t,o,n),t.child}function Hp(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ja(e,t,n,r,o){var l=at(n)?sr:Xe.current;return l=Gr(t,l),Hr(t,o),n=Pu(e,t,n,r,l,o),r=_u(),e!==null&&!st?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,pn(e,t,o)):(Se&&r&&xu(t),t.flags|=1,Ze(e,t,n,o),t.child)}function Qc(e,t,n,r,o){if(at(n)){var l=!0;ss(t)}else l=!1;if(Hr(t,o),t.stateNode===null)zl(e,t),Mp(t,n,r),ka(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var u=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Tt(c):(c=at(n)?sr:Xe.current,c=Gr(t,c));var f=n.getDerivedStateFromProps,h=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function";h||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||u!==c)&&Wc(t,s,r,c),kn=!1;var d=t.memoizedState;s.state=d,ds(t,r,s,o),u=t.memoizedState,a!==r||d!==u||it.current||kn?(typeof f=="function"&&(Ca(t,n,f,r),u=t.memoizedState),(a=kn||Hc(t,n,a,r,d,u,c))?(h||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),s.props=r,s.state=u,s.context=c,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,gp(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:_t(t.type,a),s.props=c,h=t.pendingProps,d=s.context,u=n.contextType,typeof u=="object"&&u!==null?u=Tt(u):(u=at(n)?sr:Xe.current,u=Gr(t,u));var m=n.getDerivedStateFromProps;(f=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==h||d!==u)&&Wc(t,s,r,u),kn=!1,d=t.memoizedState,s.state=d,ds(t,r,s,o);var v=t.memoizedState;a!==h||d!==v||it.current||kn?(typeof m=="function"&&(Ca(t,n,m,r),v=t.memoizedState),(c=kn||Hc(t,n,c,r,d,v,u)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,v,u),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,v,u)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),s.props=r,s.state=v,s.context=u,r=c):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return Ta(e,t,n,r,l,o)}function Ta(e,t,n,r,o,l){Hp(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Lc(t,n,!1),pn(e,t,l);r=t.stateNode,dy.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Qr(t,e.child,null,l),t.child=Qr(t,null,a,l)):Ze(e,t,a,l),t.memoizedState=r.state,o&&Lc(t,n,!0),t.child}function Wp(e){var t=e.stateNode;t.pendingContext?Ac(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ac(e,t.context,!1),ju(e,t.containerInfo)}function Xc(e,t,n,r,o){return Yr(),bu(o),t.flags|=256,Ze(e,t,n,r),t.child}var Na={dehydrated:null,treeContext:null,retryLane:0};function Ra(e){return{baseLanes:e,cachePool:null,transitions:null}}function Bp(e,t,n){var r=t.pendingProps,o=Ee.current,l=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),xe(Ee,o&1),e===null)return wa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,l?(r=t.mode,l=t.child,s={mode:"hidden",children:s},!(r&1)&&l!==null?(l.childLanes=0,l.pendingProps=s):l=Hs(s,r,0,null),e=or(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=Ra(n),t.memoizedState=Na,e):Lu(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return fy(e,t,s,r,a,o,n);if(l){l=r.fallback,s=t.mode,o=e.child,a=o.sibling;var u={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=$n(o,u),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?l=$n(a,l):(l=or(l,s,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,r=l,l=t.child,s=e.child.memoizedState,s=s===null?Ra(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},l.memoizedState=s,l.childLanes=e.childLanes&~n,t.memoizedState=Na,r}return l=e.child,e=l.sibling,r=$n(l,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Lu(e,t){return t=Hs({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function wl(e,t,n,r){return r!==null&&bu(r),Qr(t,e.child,null,n),e=Lu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function fy(e,t,n,r,o,l,s){if(n)return t.flags&256?(t.flags&=-257,r=Si(Error(M(422))),wl(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,o=t.mode,r=Hs({mode:"visible",children:r.children},o,0,null),l=or(l,o,s,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,t.mode&1&&Qr(t,e.child,null,s),t.child.memoizedState=Ra(s),t.memoizedState=Na,l);if(!(t.mode&1))return wl(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,l=Error(M(419)),r=Si(l,r,void 0),wl(e,t,s,r)}if(a=(s&e.childLanes)!==0,st||a){if(r=He,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==l.retryLane&&(l.retryLane=o,fn(e,o),Dt(r,e,o,-1))}return Ku(),r=Si(Error(M(421))),wl(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Ey.bind(null,e),o._reactRetry=t,null):(e=l.treeContext,ft=Ln(o.nextSibling),pt=t,Se=!0,At=null,e!==null&&(St[Ct++]=rn,St[Ct++]=on,St[Ct++]=ir,rn=e.id,on=e.overflow,ir=t),t=Lu(t,r.children),t.flags|=4096,t)}function Zc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Sa(e.return,t,n)}function Ci(e,t,n,r,o){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=o)}function Vp(e,t,n){var r=t.pendingProps,o=r.revealOrder,l=r.tail;if(Ze(e,t,r.children,n),r=Ee.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zc(e,n,t);else if(e.tag===19)Zc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(xe(Ee,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&fs(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ci(t,!1,o,n,l);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&fs(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ci(t,!0,n,null,l);break;case"together":Ci(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function zl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function pn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ur|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(M(153));if(t.child!==null){for(e=t.child,n=$n(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$n(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function py(e,t,n){switch(t.tag){case 3:Wp(t),Yr();break;case 5:yp(t);break;case 1:at(t.type)&&ss(t);break;case 4:ju(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;xe(us,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(xe(Ee,Ee.current&1),t.flags|=128,null):n&t.child.childLanes?Bp(e,t,n):(xe(Ee,Ee.current&1),e=pn(e,t,n),e!==null?e.sibling:null);xe(Ee,Ee.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Vp(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),xe(Ee,Ee.current),r)break;return null;case 22:case 23:return t.lanes=0,Fp(e,t,n)}return pn(e,t,n)}var Up,Pa,Gp,Yp;Up=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Pa=function(){};Gp=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,tr(Ht.current);var l=null;switch(n){case"input":o=qi(e,o),r=qi(e,r),l=[];break;case"select":o=Te({},o,{value:void 0}),r=Te({},r,{value:void 0}),l=[];break;case"textarea":o=ta(e,o),r=ta(e,r),l=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=os)}ra(n,r);var s;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var a=o[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Ao.hasOwnProperty(c)?l||(l=[]):(l=l||[]).push(c,null));for(c in r){var u=r[c];if(a=o!=null?o[c]:void 0,r.hasOwnProperty(c)&&u!==a&&(u!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in u)u.hasOwnProperty(s)&&a[s]!==u[s]&&(n||(n={}),n[s]=u[s])}else n||(l||(l=[]),l.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,a=a?a.__html:void 0,u!=null&&a!==u&&(l=l||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(l=l||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Ao.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&be("scroll",e),l||a===u||(l=[])):(l=l||[]).push(c,u))}n&&(l=l||[]).push("style",n);var c=l;(t.updateQueue=c)&&(t.flags|=4)}};Yp=function(e,t,n,r){n!==r&&(t.flags|=4)};function mo(e,t){if(!Se)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ye(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function hy(e,t,n){var r=t.pendingProps;switch(vu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ye(t),null;case 1:return at(t.type)&&ls(),Ye(t),null;case 3:return r=t.stateNode,Xr(),we(it),we(Xe),Nu(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(vl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,At!==null&&($a(At),At=null))),Pa(e,t),Ye(t),null;case 5:Tu(t);var o=tr(Vo.current);if(n=t.type,e!==null&&t.stateNode!=null)Gp(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(M(166));return Ye(t),null}if(e=tr(Ht.current),vl(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[Kt]=t,r[Wo]=l,e=(t.mode&1)!==0,n){case"dialog":be("cancel",r),be("close",r);break;case"iframe":case"object":case"embed":be("load",r);break;case"video":case"audio":for(o=0;o<So.length;o++)be(So[o],r);break;case"source":be("error",r);break;case"img":case"image":case"link":be("error",r),be("load",r);break;case"details":be("toggle",r);break;case"input":sc(r,l),be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},be("invalid",r);break;case"textarea":ac(r,l),be("invalid",r)}ra(n,l),o=null;for(var s in l)if(l.hasOwnProperty(s)){var a=l[s];s==="children"?typeof a=="string"?r.textContent!==a&&(l.suppressHydrationWarning!==!0&&xl(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(l.suppressHydrationWarning!==!0&&xl(r.textContent,a,e),o=["children",""+a]):Ao.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&be("scroll",r)}switch(n){case"input":cl(r),ic(r,l,!0);break;case"textarea":cl(r),uc(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=os)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Sf(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Kt]=t,e[Wo]=r,Up(e,t,!1,!1),t.stateNode=e;e:{switch(s=oa(n,r),n){case"dialog":be("cancel",e),be("close",e),o=r;break;case"iframe":case"object":case"embed":be("load",e),o=r;break;case"video":case"audio":for(o=0;o<So.length;o++)be(So[o],e);o=r;break;case"source":be("error",e),o=r;break;case"img":case"image":case"link":be("error",e),be("load",e),o=r;break;case"details":be("toggle",e),o=r;break;case"input":sc(e,r),o=qi(e,r),be("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Te({},r,{value:void 0}),be("invalid",e);break;case"textarea":ac(e,r),o=ta(e,r),be("invalid",e);break;default:o=r}ra(n,o),a=o;for(l in a)if(a.hasOwnProperty(l)){var u=a[l];l==="style"?Ef(e,u):l==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Cf(e,u)):l==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Lo(e,u):typeof u=="number"&&Lo(e,""+u):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Ao.hasOwnProperty(l)?u!=null&&l==="onScroll"&&be("scroll",e):u!=null&&ou(e,l,u,s))}switch(n){case"input":cl(e),ic(e,r,!1);break;case"textarea":cl(e),uc(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Kn(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?$r(e,!!r.multiple,l,!1):r.defaultValue!=null&&$r(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=os)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ye(t),null;case 6:if(e&&t.stateNode!=null)Yp(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(M(166));if(n=tr(Vo.current),tr(Ht.current),vl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Kt]=t,(l=r.nodeValue!==n)&&(e=pt,e!==null))switch(e.tag){case 3:xl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&xl(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Kt]=t,t.stateNode=r}return Ye(t),null;case 13:if(we(Ee),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Se&&ft!==null&&t.mode&1&&!(t.flags&128))fp(),Yr(),t.flags|=98560,l=!1;else if(l=vl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(M(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(M(317));l[Kt]=t}else Yr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ye(t),l=!1}else At!==null&&($a(At),At=null),l=!0;if(!l)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ee.current&1?ze===0&&(ze=3):Ku())),t.updateQueue!==null&&(t.flags|=4),Ye(t),null);case 4:return Xr(),Pa(e,t),e===null&&Fo(t.stateNode.containerInfo),Ye(t),null;case 10:return Cu(t.type._context),Ye(t),null;case 17:return at(t.type)&&ls(),Ye(t),null;case 19:if(we(Ee),l=t.memoizedState,l===null)return Ye(t),null;if(r=(t.flags&128)!==0,s=l.rendering,s===null)if(r)mo(l,!1);else{if(ze!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=fs(e),s!==null){for(t.flags|=128,mo(l,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)l=n,e=r,l.flags&=14680066,s=l.alternate,s===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=s.childLanes,l.lanes=s.lanes,l.child=s.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=s.memoizedProps,l.memoizedState=s.memoizedState,l.updateQueue=s.updateQueue,l.type=s.type,e=s.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return xe(Ee,Ee.current&1|2),t.child}e=e.sibling}l.tail!==null&&Ie()>qr&&(t.flags|=128,r=!0,mo(l,!1),t.lanes=4194304)}else{if(!r)if(e=fs(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),mo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!Se)return Ye(t),null}else 2*Ie()-l.renderingStartTime>qr&&n!==1073741824&&(t.flags|=128,r=!0,mo(l,!1),t.lanes=4194304);l.isBackwards?(s.sibling=t.child,t.child=s):(n=l.last,n!==null?n.sibling=s:t.child=s,l.last=s)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Ie(),t.sibling=null,n=Ee.current,xe(Ee,r?n&1|2:n&1),t):(Ye(t),null);case 22:case 23:return zu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ct&1073741824&&(Ye(t),t.subtreeFlags&6&&(t.flags|=8192)):Ye(t),null;case 24:return null;case 25:return null}throw Error(M(156,t.tag))}function my(e,t){switch(vu(t),t.tag){case 1:return at(t.type)&&ls(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xr(),we(it),we(Xe),Nu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Tu(t),null;case 13:if(we(Ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));Yr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return we(Ee),null;case 4:return Xr(),null;case 10:return Cu(t.type._context),null;case 22:case 23:return zu(),null;case 24:return null;default:return null}}var Sl=!1,Qe=!1,gy=typeof WeakSet=="function"?WeakSet:Set,W=null;function Dr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Re(e,t,r)}else n.current=null}function _a(e,t,n){try{n()}catch(r){Re(e,t,r)}}var qc=!1;function yy(e,t){if(ha=ts,e=Jf(),yu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var s=0,a=-1,u=-1,c=0,f=0,h=e,d=null;t:for(;;){for(var m;h!==n||o!==0&&h.nodeType!==3||(a=s+o),h!==l||r!==0&&h.nodeType!==3||(u=s+r),h.nodeType===3&&(s+=h.nodeValue.length),(m=h.firstChild)!==null;)d=h,h=m;for(;;){if(h===e)break t;if(d===n&&++c===o&&(a=s),d===l&&++f===r&&(u=s),(m=h.nextSibling)!==null)break;h=d,d=h.parentNode}h=m}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ma={focusedElem:e,selectionRange:n},ts=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var b=v.memoizedProps,S=v.memoizedState,p=t.stateNode,g=p.getSnapshotBeforeUpdate(t.elementType===t.type?b:_t(t.type,b),S);p.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(M(163))}}catch(x){Re(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return v=qc,qc=!1,v}function Po(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var l=o.destroy;o.destroy=void 0,l!==void 0&&_a(t,n,l)}o=o.next}while(o!==r)}}function Ks(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ia(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Qp(e){var t=e.alternate;t!==null&&(e.alternate=null,Qp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Kt],delete t[Wo],delete t[xa],delete t[Jg],delete t[ey])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Xp(e){return e.tag===5||e.tag===3||e.tag===4}function Jc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Aa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=os));else if(r!==4&&(e=e.child,e!==null))for(Aa(e,t,n),e=e.sibling;e!==null;)Aa(e,t,n),e=e.sibling}function La(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(La(e,t,n),e=e.sibling;e!==null;)La(e,t,n),e=e.sibling}var Be=null,It=!1;function Sn(e,t,n){for(n=n.child;n!==null;)Zp(e,t,n),n=n.sibling}function Zp(e,t,n){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(Is,n)}catch{}switch(n.tag){case 5:Qe||Dr(n,t);case 6:var r=Be,o=It;Be=null,Sn(e,t,n),Be=r,It=o,Be!==null&&(It?(e=Be,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Be.removeChild(n.stateNode));break;case 18:Be!==null&&(It?(e=Be,n=n.stateNode,e.nodeType===8?gi(e.parentNode,n):e.nodeType===1&&gi(e,n),$o(e)):gi(Be,n.stateNode));break;case 4:r=Be,o=It,Be=n.stateNode.containerInfo,It=!0,Sn(e,t,n),Be=r,It=o;break;case 0:case 11:case 14:case 15:if(!Qe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var l=o,s=l.destroy;l=l.tag,s!==void 0&&(l&2||l&4)&&_a(n,t,s),o=o.next}while(o!==r)}Sn(e,t,n);break;case 1:if(!Qe&&(Dr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Re(n,t,a)}Sn(e,t,n);break;case 21:Sn(e,t,n);break;case 22:n.mode&1?(Qe=(r=Qe)||n.memoizedState!==null,Sn(e,t,n),Qe=r):Sn(e,t,n);break;default:Sn(e,t,n)}}function ed(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new gy),t.forEach(function(r){var o=jy.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Pt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var l=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:Be=a.stateNode,It=!1;break e;case 3:Be=a.stateNode.containerInfo,It=!0;break e;case 4:Be=a.stateNode.containerInfo,It=!0;break e}a=a.return}if(Be===null)throw Error(M(160));Zp(l,s,o),Be=null,It=!1;var u=o.alternate;u!==null&&(u.return=null),o.return=null}catch(c){Re(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)qp(t,e),t=t.sibling}function qp(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Pt(t,e),Mt(e),r&4){try{Po(3,e,e.return),Ks(3,e)}catch(b){Re(e,e.return,b)}try{Po(5,e,e.return)}catch(b){Re(e,e.return,b)}}break;case 1:Pt(t,e),Mt(e),r&512&&n!==null&&Dr(n,n.return);break;case 5:if(Pt(t,e),Mt(e),r&512&&n!==null&&Dr(n,n.return),e.flags&32){var o=e.stateNode;try{Lo(o,"")}catch(b){Re(e,e.return,b)}}if(r&4&&(o=e.stateNode,o!=null)){var l=e.memoizedProps,s=n!==null?n.memoizedProps:l,a=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{a==="input"&&l.type==="radio"&&l.name!=null&&bf(o,l),oa(a,s);var c=oa(a,l);for(s=0;s<u.length;s+=2){var f=u[s],h=u[s+1];f==="style"?Ef(o,h):f==="dangerouslySetInnerHTML"?Cf(o,h):f==="children"?Lo(o,h):ou(o,f,h,c)}switch(a){case"input":Ji(o,l);break;case"textarea":wf(o,l);break;case"select":var d=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!l.multiple;var m=l.value;m!=null?$r(o,!!l.multiple,m,!1):d!==!!l.multiple&&(l.defaultValue!=null?$r(o,!!l.multiple,l.defaultValue,!0):$r(o,!!l.multiple,l.multiple?[]:"",!1))}o[Wo]=l}catch(b){Re(e,e.return,b)}}break;case 6:if(Pt(t,e),Mt(e),r&4){if(e.stateNode===null)throw Error(M(162));o=e.stateNode,l=e.memoizedProps;try{o.nodeValue=l}catch(b){Re(e,e.return,b)}}break;case 3:if(Pt(t,e),Mt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{$o(t.containerInfo)}catch(b){Re(e,e.return,b)}break;case 4:Pt(t,e),Mt(e);break;case 13:Pt(t,e),Mt(e),o=e.child,o.flags&8192&&(l=o.memoizedState!==null,o.stateNode.isHidden=l,!l||o.alternate!==null&&o.alternate.memoizedState!==null||(Mu=Ie())),r&4&&ed(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(Qe=(c=Qe)||f,Pt(t,e),Qe=c):Pt(t,e),Mt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!f&&e.mode&1)for(W=e,f=e.child;f!==null;){for(h=W=f;W!==null;){switch(d=W,m=d.child,d.tag){case 0:case 11:case 14:case 15:Po(4,d,d.return);break;case 1:Dr(d,d.return);var v=d.stateNode;if(typeof v.componentWillUnmount=="function"){r=d,n=d.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(b){Re(r,n,b)}}break;case 5:Dr(d,d.return);break;case 22:if(d.memoizedState!==null){nd(h);continue}}m!==null?(m.return=d,W=m):nd(h)}f=f.sibling}e:for(f=null,h=e;;){if(h.tag===5){if(f===null){f=h;try{o=h.stateNode,c?(l=o.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(a=h.stateNode,u=h.memoizedProps.style,s=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=kf("display",s))}catch(b){Re(e,e.return,b)}}}else if(h.tag===6){if(f===null)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(b){Re(e,e.return,b)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;f===h&&(f=null),h=h.return}f===h&&(f=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Pt(t,e),Mt(e),r&4&&ed(e);break;case 21:break;default:Pt(t,e),Mt(e)}}function Mt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Xp(n)){var r=n;break e}n=n.return}throw Error(M(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Lo(o,""),r.flags&=-33);var l=Jc(e);La(e,l,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=Jc(e);Aa(e,a,s);break;default:throw Error(M(161))}}catch(u){Re(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xy(e,t,n){W=e,Jp(e)}function Jp(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var o=W,l=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Sl;if(!s){var a=o.alternate,u=a!==null&&a.memoizedState!==null||Qe;a=Sl;var c=Qe;if(Sl=s,(Qe=u)&&!c)for(W=o;W!==null;)s=W,u=s.child,s.tag===22&&s.memoizedState!==null?rd(o):u!==null?(u.return=s,W=u):rd(o);for(;l!==null;)W=l,Jp(l),l=l.sibling;W=o,Sl=a,Qe=c}td(e)}else o.subtreeFlags&8772&&l!==null?(l.return=o,W=l):td(e)}}function td(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Qe||Ks(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Qe)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:_t(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&zc(t,l,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}zc(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var f=c.memoizedState;if(f!==null){var h=f.dehydrated;h!==null&&$o(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(M(163))}Qe||t.flags&512&&Ia(t)}catch(d){Re(t,t.return,d)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function nd(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function rd(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ks(4,t)}catch(u){Re(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(u){Re(t,o,u)}}var l=t.return;try{Ia(t)}catch(u){Re(t,l,u)}break;case 5:var s=t.return;try{Ia(t)}catch(u){Re(t,s,u)}}}catch(u){Re(t,t.return,u)}if(t===e){W=null;break}var a=t.sibling;if(a!==null){a.return=t.return,W=a;break}W=t.return}}var vy=Math.ceil,ms=wn.ReactCurrentDispatcher,Du=wn.ReactCurrentOwner,Et=wn.ReactCurrentBatchConfig,ce=0,He=null,Oe=null,Ve=0,ct=0,Or=Vn(0),ze=0,Qo=null,ur=0,Fs=0,Ou=0,_o=null,lt=null,Mu=0,qr=1/0,qt=null,gs=!1,Da=null,On=null,Cl=!1,Pn=null,ys=0,Io=0,Oa=null,Kl=-1,Fl=0;function qe(){return ce&6?Ie():Kl!==-1?Kl:Kl=Ie()}function Mn(e){return e.mode&1?ce&2&&Ve!==0?Ve&-Ve:ny.transition!==null?(Fl===0&&(Fl=Mf()),Fl):(e=pe,e!==0||(e=window.event,e=e===void 0?16:Bf(e.type)),e):1}function Dt(e,t,n,r){if(50<Io)throw Io=0,Oa=null,Error(M(185));el(e,n,r),(!(ce&2)||e!==He)&&(e===He&&(!(ce&2)&&(Fs|=n),ze===4&&Tn(e,Ve)),ut(e,r),n===1&&ce===0&&!(t.mode&1)&&(qr=Ie()+500,Ms&&Un()))}function ut(e,t){var n=e.callbackNode;ng(e,t);var r=es(e,e===He?Ve:0);if(r===0)n!==null&&fc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&fc(n),t===1)e.tag===0?ty(od.bind(null,e)):up(od.bind(null,e)),Zg(function(){!(ce&6)&&Un()}),n=null;else{switch($f(r)){case 1:n=uu;break;case 4:n=Df;break;case 16:n=Jl;break;case 536870912:n=Of;break;default:n=Jl}n=ih(n,eh.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function eh(e,t){if(Kl=-1,Fl=0,ce&6)throw Error(M(327));var n=e.callbackNode;if(Wr()&&e.callbackNode!==n)return null;var r=es(e,e===He?Ve:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=xs(e,r);else{t=r;var o=ce;ce|=2;var l=nh();(He!==e||Ve!==t)&&(qt=null,qr=Ie()+500,rr(e,t));do try{Sy();break}catch(a){th(e,a)}while(!0);Su(),ms.current=l,ce=o,Oe!==null?t=0:(He=null,Ve=0,t=ze)}if(t!==0){if(t===2&&(o=ua(e),o!==0&&(r=o,t=Ma(e,o))),t===1)throw n=Qo,rr(e,0),Tn(e,r),ut(e,Ie()),n;if(t===6)Tn(e,r);else{if(o=e.current.alternate,!(r&30)&&!by(o)&&(t=xs(e,r),t===2&&(l=ua(e),l!==0&&(r=l,t=Ma(e,l))),t===1))throw n=Qo,rr(e,0),Tn(e,r),ut(e,Ie()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(M(345));case 2:qn(e,lt,qt);break;case 3:if(Tn(e,r),(r&130023424)===r&&(t=Mu+500-Ie(),10<t)){if(es(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){qe(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ya(qn.bind(null,e,lt,qt),t);break}qn(e,lt,qt);break;case 4:if(Tn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Lt(r);l=1<<s,s=t[s],s>o&&(o=s),r&=~l}if(r=o,r=Ie()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*vy(r/1960))-r,10<r){e.timeoutHandle=ya(qn.bind(null,e,lt,qt),r);break}qn(e,lt,qt);break;case 5:qn(e,lt,qt);break;default:throw Error(M(329))}}}return ut(e,Ie()),e.callbackNode===n?eh.bind(null,e):null}function Ma(e,t){var n=_o;return e.current.memoizedState.isDehydrated&&(rr(e,t).flags|=256),e=xs(e,t),e!==2&&(t=lt,lt=n,t!==null&&$a(t)),e}function $a(e){lt===null?lt=e:lt.push.apply(lt,e)}function by(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],l=o.getSnapshot;o=o.value;try{if(!Ot(l(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Tn(e,t){for(t&=~Ou,t&=~Fs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Lt(t),r=1<<n;e[n]=-1,t&=~r}}function od(e){if(ce&6)throw Error(M(327));Wr();var t=es(e,0);if(!(t&1))return ut(e,Ie()),null;var n=xs(e,t);if(e.tag!==0&&n===2){var r=ua(e);r!==0&&(t=r,n=Ma(e,r))}if(n===1)throw n=Qo,rr(e,0),Tn(e,t),ut(e,Ie()),n;if(n===6)throw Error(M(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,qn(e,lt,qt),ut(e,Ie()),null}function $u(e,t){var n=ce;ce|=1;try{return e(t)}finally{ce=n,ce===0&&(qr=Ie()+500,Ms&&Un())}}function cr(e){Pn!==null&&Pn.tag===0&&!(ce&6)&&Wr();var t=ce;ce|=1;var n=Et.transition,r=pe;try{if(Et.transition=null,pe=1,e)return e()}finally{pe=r,Et.transition=n,ce=t,!(ce&6)&&Un()}}function zu(){ct=Or.current,we(Or)}function rr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Xg(n)),Oe!==null)for(n=Oe.return;n!==null;){var r=n;switch(vu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ls();break;case 3:Xr(),we(it),we(Xe),Nu();break;case 5:Tu(r);break;case 4:Xr();break;case 13:we(Ee);break;case 19:we(Ee);break;case 10:Cu(r.type._context);break;case 22:case 23:zu()}n=n.return}if(He=e,Oe=e=$n(e.current,null),Ve=ct=t,ze=0,Qo=null,Ou=Fs=ur=0,lt=_o=null,er!==null){for(t=0;t<er.length;t++)if(n=er[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,l=n.pending;if(l!==null){var s=l.next;l.next=o,r.next=s}n.pending=r}er=null}return e}function th(e,t){do{var n=Oe;try{if(Su(),Ml.current=hs,ps){for(var r=je.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ps=!1}if(ar=0,Fe=$e=je=null,Ro=!1,Uo=0,Du.current=null,n===null||n.return===null){ze=1,Qo=t,Oe=null;break}e:{var l=e,s=n.return,a=n,u=t;if(t=Ve,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,f=a,h=f.tag;if(!(f.mode&1)&&(h===0||h===11||h===15)){var d=f.alternate;d?(f.updateQueue=d.updateQueue,f.memoizedState=d.memoizedState,f.lanes=d.lanes):(f.updateQueue=null,f.memoizedState=null)}var m=Vc(s);if(m!==null){m.flags&=-257,Uc(m,s,a,l,t),m.mode&1&&Bc(l,c,t),t=m,u=c;var v=t.updateQueue;if(v===null){var b=new Set;b.add(u),t.updateQueue=b}else v.add(u);break e}else{if(!(t&1)){Bc(l,c,t),Ku();break e}u=Error(M(426))}}else if(Se&&a.mode&1){var S=Vc(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),Uc(S,s,a,l,t),bu(Zr(u,a));break e}}l=u=Zr(u,a),ze!==4&&(ze=2),_o===null?_o=[l]:_o.push(l),l=s;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var p=$p(l,u,t);$c(l,p);break e;case 1:a=u;var g=l.type,y=l.stateNode;if(!(l.flags&128)&&(typeof g.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(On===null||!On.has(y)))){l.flags|=65536,t&=-t,l.lanes|=t;var x=zp(l,a,t);$c(l,x);break e}}l=l.return}while(l!==null)}oh(n)}catch(k){t=k,Oe===n&&n!==null&&(Oe=n=n.return);continue}break}while(!0)}function nh(){var e=ms.current;return ms.current=hs,e===null?hs:e}function Ku(){(ze===0||ze===3||ze===2)&&(ze=4),He===null||!(ur&268435455)&&!(Fs&268435455)||Tn(He,Ve)}function xs(e,t){var n=ce;ce|=2;var r=nh();(He!==e||Ve!==t)&&(qt=null,rr(e,t));do try{wy();break}catch(o){th(e,o)}while(!0);if(Su(),ce=n,ms.current=r,Oe!==null)throw Error(M(261));return He=null,Ve=0,ze}function wy(){for(;Oe!==null;)rh(Oe)}function Sy(){for(;Oe!==null&&!Gm();)rh(Oe)}function rh(e){var t=sh(e.alternate,e,ct);e.memoizedProps=e.pendingProps,t===null?oh(e):Oe=t,Du.current=null}function oh(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=my(n,t),n!==null){n.flags&=32767,Oe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ze=6,Oe=null;return}}else if(n=hy(n,t,ct),n!==null){Oe=n;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);ze===0&&(ze=5)}function qn(e,t,n){var r=pe,o=Et.transition;try{Et.transition=null,pe=1,Cy(e,t,n,r)}finally{Et.transition=o,pe=r}return null}function Cy(e,t,n,r){do Wr();while(Pn!==null);if(ce&6)throw Error(M(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(M(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(rg(e,l),e===He&&(Oe=He=null,Ve=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Cl||(Cl=!0,ih(Jl,function(){return Wr(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=Et.transition,Et.transition=null;var s=pe;pe=1;var a=ce;ce|=4,Du.current=null,yy(e,n),qp(n,e),Wg(ma),ts=!!ha,ma=ha=null,e.current=n,xy(n),Ym(),ce=a,pe=s,Et.transition=l}else e.current=n;if(Cl&&(Cl=!1,Pn=e,ys=o),l=e.pendingLanes,l===0&&(On=null),Zm(n.stateNode),ut(e,Ie()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(gs)throw gs=!1,e=Da,Da=null,e;return ys&1&&e.tag!==0&&Wr(),l=e.pendingLanes,l&1?e===Oa?Io++:(Io=0,Oa=e):Io=0,Un(),null}function Wr(){if(Pn!==null){var e=$f(ys),t=Et.transition,n=pe;try{if(Et.transition=null,pe=16>e?16:e,Pn===null)var r=!1;else{if(e=Pn,Pn=null,ys=0,ce&6)throw Error(M(331));var o=ce;for(ce|=4,W=e.current;W!==null;){var l=W,s=l.child;if(W.flags&16){var a=l.deletions;if(a!==null){for(var u=0;u<a.length;u++){var c=a[u];for(W=c;W!==null;){var f=W;switch(f.tag){case 0:case 11:case 15:Po(8,f,l)}var h=f.child;if(h!==null)h.return=f,W=h;else for(;W!==null;){f=W;var d=f.sibling,m=f.return;if(Qp(f),f===c){W=null;break}if(d!==null){d.return=m,W=d;break}W=m}}}var v=l.alternate;if(v!==null){var b=v.child;if(b!==null){v.child=null;do{var S=b.sibling;b.sibling=null,b=S}while(b!==null)}}W=l}}if(l.subtreeFlags&2064&&s!==null)s.return=l,W=s;else e:for(;W!==null;){if(l=W,l.flags&2048)switch(l.tag){case 0:case 11:case 15:Po(9,l,l.return)}var p=l.sibling;if(p!==null){p.return=l.return,W=p;break e}W=l.return}}var g=e.current;for(W=g;W!==null;){s=W;var y=s.child;if(s.subtreeFlags&2064&&y!==null)y.return=s,W=y;else e:for(s=g;W!==null;){if(a=W,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Ks(9,a)}}catch(k){Re(a,a.return,k)}if(a===s){W=null;break e}var x=a.sibling;if(x!==null){x.return=a.return,W=x;break e}W=a.return}}if(ce=o,Un(),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(Is,e)}catch{}r=!0}return r}finally{pe=n,Et.transition=t}}return!1}function ld(e,t,n){t=Zr(n,t),t=$p(e,t,1),e=Dn(e,t,1),t=qe(),e!==null&&(el(e,1,t),ut(e,t))}function Re(e,t,n){if(e.tag===3)ld(e,e,n);else for(;t!==null;){if(t.tag===3){ld(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(On===null||!On.has(r))){e=Zr(n,e),e=zp(t,e,1),t=Dn(t,e,1),e=qe(),t!==null&&(el(t,1,e),ut(t,e));break}}t=t.return}}function ky(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=qe(),e.pingedLanes|=e.suspendedLanes&n,He===e&&(Ve&n)===n&&(ze===4||ze===3&&(Ve&130023424)===Ve&&500>Ie()-Mu?rr(e,0):Ou|=n),ut(e,t)}function lh(e,t){t===0&&(e.mode&1?(t=pl,pl<<=1,!(pl&130023424)&&(pl=4194304)):t=1);var n=qe();e=fn(e,t),e!==null&&(el(e,t,n),ut(e,n))}function Ey(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),lh(e,n)}function jy(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(M(314))}r!==null&&r.delete(t),lh(e,n)}var sh;sh=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||it.current)st=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return st=!1,py(e,t,n);st=!!(e.flags&131072)}else st=!1,Se&&t.flags&1048576&&cp(t,as,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zl(e,t),e=t.pendingProps;var o=Gr(t,Xe.current);Hr(t,n),o=Pu(null,t,r,e,o,n);var l=_u();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,at(r)?(l=!0,ss(t)):l=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Eu(t),o.updater=zs,t.stateNode=o,o._reactInternals=t,ka(t,r,e,n),t=Ta(null,t,r,!0,l,n)):(t.tag=0,Se&&l&&xu(t),Ze(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Ny(r),e=_t(r,e),o){case 0:t=ja(null,t,r,e,n);break e;case 1:t=Qc(null,t,r,e,n);break e;case 11:t=Gc(null,t,r,e,n);break e;case 14:t=Yc(null,t,r,_t(r.type,e),n);break e}throw Error(M(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:_t(r,o),ja(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:_t(r,o),Qc(e,t,r,o,n);case 3:e:{if(Wp(t),e===null)throw Error(M(387));r=t.pendingProps,l=t.memoizedState,o=l.element,gp(e,t),ds(t,r,null,n);var s=t.memoizedState;if(r=s.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){o=Zr(Error(M(423)),t),t=Xc(e,t,r,n,o);break e}else if(r!==o){o=Zr(Error(M(424)),t),t=Xc(e,t,r,n,o);break e}else for(ft=Ln(t.stateNode.containerInfo.firstChild),pt=t,Se=!0,At=null,n=hp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Yr(),r===o){t=pn(e,t,n);break e}Ze(e,t,r,n)}t=t.child}return t;case 5:return yp(t),e===null&&wa(t),r=t.type,o=t.pendingProps,l=e!==null?e.memoizedProps:null,s=o.children,ga(r,o)?s=null:l!==null&&ga(r,l)&&(t.flags|=32),Hp(e,t),Ze(e,t,s,n),t.child;case 6:return e===null&&wa(t),null;case 13:return Bp(e,t,n);case 4:return ju(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Qr(t,null,r,n):Ze(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:_t(r,o),Gc(e,t,r,o,n);case 7:return Ze(e,t,t.pendingProps,n),t.child;case 8:return Ze(e,t,t.pendingProps.children,n),t.child;case 12:return Ze(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,l=t.memoizedProps,s=o.value,xe(us,r._currentValue),r._currentValue=s,l!==null)if(Ot(l.value,s)){if(l.children===o.children&&!it.current){t=pn(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var a=l.dependencies;if(a!==null){s=l.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(l.tag===1){u=sn(-1,n&-n),u.tag=2;var c=l.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?u.next=u:(u.next=f.next,f.next=u),c.pending=u}}l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),Sa(l.return,n,t),a.lanes|=n;break}u=u.next}}else if(l.tag===10)s=l.type===t.type?null:l.child;else if(l.tag===18){if(s=l.return,s===null)throw Error(M(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Sa(s,n,t),s=l.sibling}else s=l.child;if(s!==null)s.return=l;else for(s=l;s!==null;){if(s===t){s=null;break}if(l=s.sibling,l!==null){l.return=s.return,s=l;break}s=s.return}l=s}Ze(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Hr(t,n),o=Tt(o),r=r(o),t.flags|=1,Ze(e,t,r,n),t.child;case 14:return r=t.type,o=_t(r,t.pendingProps),o=_t(r.type,o),Yc(e,t,r,o,n);case 15:return Kp(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:_t(r,o),zl(e,t),t.tag=1,at(r)?(e=!0,ss(t)):e=!1,Hr(t,n),Mp(t,r,o),ka(t,r,o,n),Ta(null,t,r,!0,e,n);case 19:return Vp(e,t,n);case 22:return Fp(e,t,n)}throw Error(M(156,t.tag))};function ih(e,t){return Lf(e,t)}function Ty(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kt(e,t,n,r){return new Ty(e,t,n,r)}function Fu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ny(e){if(typeof e=="function")return Fu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===su)return 11;if(e===iu)return 14}return 2}function $n(e,t){var n=e.alternate;return n===null?(n=kt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Hl(e,t,n,r,o,l){var s=2;if(r=e,typeof e=="function")Fu(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case jr:return or(n.children,o,l,t);case lu:s=8,o|=8;break;case Yi:return e=kt(12,n,t,o|2),e.elementType=Yi,e.lanes=l,e;case Qi:return e=kt(13,n,t,o),e.elementType=Qi,e.lanes=l,e;case Xi:return e=kt(19,n,t,o),e.elementType=Xi,e.lanes=l,e;case yf:return Hs(n,o,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case mf:s=10;break e;case gf:s=9;break e;case su:s=11;break e;case iu:s=14;break e;case Cn:s=16,r=null;break e}throw Error(M(130,e==null?e:typeof e,""))}return t=kt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=l,t}function or(e,t,n,r){return e=kt(7,e,r,t),e.lanes=n,e}function Hs(e,t,n,r){return e=kt(22,e,r,t),e.elementType=yf,e.lanes=n,e.stateNode={isHidden:!1},e}function ki(e,t,n){return e=kt(6,e,null,t),e.lanes=n,e}function Ei(e,t,n){return t=kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ry(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=li(0),this.expirationTimes=li(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=li(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Hu(e,t,n,r,o,l,s,a,u){return e=new Ry(e,t,n,a,u),t===1?(t=1,l===!0&&(t|=8)):t=0,l=kt(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Eu(l),e}function Py(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Er,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function ah(e){if(!e)return Fn;e=e._reactInternals;e:{if(yr(e)!==e||e.tag!==1)throw Error(M(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(at(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(M(171))}if(e.tag===1){var n=e.type;if(at(n))return ap(e,n,t)}return t}function uh(e,t,n,r,o,l,s,a,u){return e=Hu(n,r,!0,e,o,l,s,a,u),e.context=ah(null),n=e.current,r=qe(),o=Mn(n),l=sn(r,o),l.callback=t??null,Dn(n,l,o),e.current.lanes=o,el(e,o,r),ut(e,r),e}function Ws(e,t,n,r){var o=t.current,l=qe(),s=Mn(o);return n=ah(n),t.context===null?t.context=n:t.pendingContext=n,t=sn(l,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Dn(o,t,s),e!==null&&(Dt(e,o,s,l),Ol(e,o,s)),s}function vs(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function sd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Wu(e,t){sd(e,t),(e=e.alternate)&&sd(e,t)}function _y(){return null}var ch=typeof reportError=="function"?reportError:function(e){console.error(e)};function Bu(e){this._internalRoot=e}Bs.prototype.render=Bu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(M(409));Ws(e,t,null,null)};Bs.prototype.unmount=Bu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cr(function(){Ws(null,e,null,null)}),t[dn]=null}};function Bs(e){this._internalRoot=e}Bs.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ff();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jn.length&&t!==0&&t<jn[n].priority;n++);jn.splice(n,0,e),n===0&&Wf(e)}};function Vu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Vs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function id(){}function Iy(e,t,n,r,o){if(o){if(typeof r=="function"){var l=r;r=function(){var c=vs(s);l.call(c)}}var s=uh(t,r,e,0,null,!1,!1,"",id);return e._reactRootContainer=s,e[dn]=s.current,Fo(e.nodeType===8?e.parentNode:e),cr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=vs(u);a.call(c)}}var u=Hu(e,0,!1,null,null,!1,!1,"",id);return e._reactRootContainer=u,e[dn]=u.current,Fo(e.nodeType===8?e.parentNode:e),cr(function(){Ws(t,u,n,r)}),u}function Us(e,t,n,r,o){var l=n._reactRootContainer;if(l){var s=l;if(typeof o=="function"){var a=o;o=function(){var u=vs(s);a.call(u)}}Ws(t,s,e,o)}else s=Iy(n,t,e,o,r);return vs(s)}zf=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=wo(t.pendingLanes);n!==0&&(cu(t,n|1),ut(t,Ie()),!(ce&6)&&(qr=Ie()+500,Un()))}break;case 13:cr(function(){var r=fn(e,1);if(r!==null){var o=qe();Dt(r,e,1,o)}}),Wu(e,1)}};du=function(e){if(e.tag===13){var t=fn(e,134217728);if(t!==null){var n=qe();Dt(t,e,134217728,n)}Wu(e,134217728)}};Kf=function(e){if(e.tag===13){var t=Mn(e),n=fn(e,t);if(n!==null){var r=qe();Dt(n,e,t,r)}Wu(e,t)}};Ff=function(){return pe};Hf=function(e,t){var n=pe;try{return pe=e,t()}finally{pe=n}};sa=function(e,t,n){switch(t){case"input":if(Ji(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Os(r);if(!o)throw Error(M(90));vf(r),Ji(r,o)}}}break;case"textarea":wf(e,n);break;case"select":t=n.value,t!=null&&$r(e,!!n.multiple,t,!1)}};Nf=$u;Rf=cr;var Ay={usingClientEntryPoint:!1,Events:[nl,Pr,Os,jf,Tf,$u]},go={findFiberByHostInstance:Jn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ly={bundleType:go.bundleType,version:go.version,rendererPackageName:go.rendererPackageName,rendererConfig:go.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:wn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=If(e),e===null?null:e.stateNode},findFiberByHostInstance:go.findFiberByHostInstance||_y,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var kl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kl.isDisabled&&kl.supportsFiber)try{Is=kl.inject(Ly),Ft=kl}catch{}}gt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ay;gt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Vu(t))throw Error(M(200));return Py(e,t,null,n)};gt.createRoot=function(e,t){if(!Vu(e))throw Error(M(299));var n=!1,r="",o=ch;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Hu(e,1,!1,null,null,n,!1,r,o),e[dn]=t.current,Fo(e.nodeType===8?e.parentNode:e),new Bu(t)};gt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(M(188)):(e=Object.keys(e).join(","),Error(M(268,e)));return e=If(t),e=e===null?null:e.stateNode,e};gt.flushSync=function(e){return cr(e)};gt.hydrate=function(e,t,n){if(!Vs(t))throw Error(M(200));return Us(null,e,t,!0,n)};gt.hydrateRoot=function(e,t,n){if(!Vu(e))throw Error(M(405));var r=n!=null&&n.hydratedSources||null,o=!1,l="",s=ch;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=uh(t,null,e,1,n??null,o,!1,l,s),e[dn]=t.current,Fo(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Bs(t)};gt.render=function(e,t,n){if(!Vs(t))throw Error(M(200));return Us(null,e,t,!1,n)};gt.unmountComponentAtNode=function(e){if(!Vs(e))throw Error(M(40));return e._reactRootContainer?(cr(function(){Us(null,null,e,!1,function(){e._reactRootContainer=null,e[dn]=null})}),!0):!1};gt.unstable_batchedUpdates=$u;gt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Vs(n))throw Error(M(200));if(e==null||e._reactInternals===void 0)throw Error(M(38));return Us(e,t,n,!1,r)};gt.version="18.3.1-next-f1338f8080-20240426";function dh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dh)}catch(e){console.error(e)}}dh(),df.exports=gt;var Uu=df.exports,ad=Uu;Ui.createRoot=ad.createRoot,Ui.hydrateRoot=ad.hydrateRoot;const Dy="modulepreload",Oy=function(e){return"/panel/"+e},ud={},My=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(u=>{if(u=Oy(u),u in ud)return;ud[u]=!0;const c=u.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":Dy,c||(h.as="script"),h.crossOrigin="",h.href=u,a&&h.setAttribute("nonce",a),document.head.appendChild(h),c)return new Promise((d,m)=>{h.addEventListener("load",d),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function l(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&l(a.reason);return t().catch(l)})};let zt=null,Xo=!1;const Wl=[],Bl=[],Vl=[];function $y(){return window.location.origin.replace(/^http/,"ws")}function fh(){if(zt)return;const e=$y();zt=new WebSocket(e),zt.addEventListener("open",()=>{Xo=!0,Nn({type:"REGISTER",role:"panel"});for(const t of Bl)t()}),zt.addEventListener("close",()=>{Xo=!1,zt=null;for(const t of Vl)t();setTimeout(()=>fh(),3e3)}),zt.addEventListener("message",t=>{try{const n=JSON.parse(t.data);for(const r of Wl)r(n)}catch(n){console.error("[tw-panel] Failed to parse message:",n)}}),zt.addEventListener("error",t=>{console.error("[tw-panel] WebSocket error:",t)})}function Nn(e){console.log("[panel-debug] WS send",{connected:Xo,hasSocket:!!zt,data:e}),Xo&&zt&&zt.send(JSON.stringify(e))}function fe(e,t){Nn({...t,to:e})}function bs(e){return Wl.push(e),()=>{const t=Wl.indexOf(e);t!==-1&&Wl.splice(t,1)}}function zy(e){return Bl.push(e),()=>{const t=Bl.indexOf(e);t!==-1&&Bl.splice(t,1)}}function Ky(e){return Vl.push(e),()=>{const t=Vl.indexOf(e);t!==-1&&Vl.splice(t,1)}}function Fy(){return Xo}const ph=[{name:"popover",label:"Popover",icon:i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1.5",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.3"}),i.jsx("rect",{x:"4",y:"4",width:"8",height:"6",rx:"1",fill:"currentColor"})]})},{name:"sidebar",label:"Sidebar",icon:i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1.5",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.3"}),i.jsx("rect",{x:"9",y:"1",width:"6",height:"14",rx:"1.5",fill:"currentColor",opacity:"0.85"})]})},{name:"modal",label:"Modal",icon:i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1.5",fill:"currentColor",opacity:"0.12"}),i.jsx("rect",{x:"3",y:"4",width:"10",height:"8",rx:"1",fill:"currentColor",opacity:"0.9"})]})},{name:"popup",label:"Popup",icon:i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1.5",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.3"}),i.jsx("rect",{x:"8",y:"8",width:"7",height:"7",rx:"1",fill:"currentColor",opacity:"0.85"})]})}],hh="tw-panel-container";function Hy(){try{const e=localStorage.getItem(hh);if(e&&ph.some(t=>t.name===e))return e}catch{}return"popover"}function El(){const[e,t]=w.useState(Hy),[n,r]=w.useState(!1),o=w.useRef(null);w.useEffect(()=>{function s(a){o.current&&!o.current.contains(a.target)&&r(!1)}return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]);function l(s){if(s!==e){try{localStorage.setItem(hh,s)}catch{}t(s),fe("overlay",{type:"SWITCH_CONTAINER",container:s})}r(!1)}return i.jsxs("div",{ref:o,className:"relative",children:[i.jsx("button",{title:"Change container",onClick:()=>r(s=>!s),className:"w-7 h-7 flex items-center justify-center rounded border border-transparent text-bv-text-mid bg-transparent cursor-pointer transition-colors hover:bg-bv-surface hover:border-bv-border hover:text-bv-text",children:i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("rect",{x:".5",y:"1.5",width:"15",height:"13",rx:"1.5",ry:"1.5"}),i.jsx("line",{x1:"8.5",y1:"1.5",x2:"8.5",y2:"14.5"}),i.jsx("line",{x1:"11",y1:"5",x2:"13",y2:"5"}),i.jsx("line",{x1:"11",y1:"8",x2:"13",y2:"8"}),i.jsx("line",{x1:"11",y1:"11",x2:"13",y2:"11"})]})}),n&&i.jsxs("div",{className:"absolute top-[calc(100%+4px)] right-0 bg-bv-surface border border-[#4f4f4f] rounded-lg shadow-[0_4px_16px_rgba(0,0,0,0.25)] p-1.5 flex flex-col gap-px min-w-[148px] z-50",children:[i.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.8px] text-bv-muted px-2 pt-1 pb-1.5",children:"Container"}),ph.map(s=>i.jsxs("button",{onClick:()=>l(s.name),className:`flex items-center gap-2 px-2 py-1.5 rounded text-[12px] cursor-pointer border-none w-full text-left transition-colors ${s.name===e?"bg-bv-teal/9 text-bv-teal":"bg-transparent text-bv-text-mid hover:bg-bv-surface hover:text-bv-text"}`,children:[s.icon,s.label]},s.name)),i.jsx("div",{className:"h-px bg-[#4f4f4f] mx-1 my-1"}),i.jsxs("button",{onClick:()=>{r(!1),fe("overlay",{type:"CLOSE_PANEL"})},className:"flex items-center gap-2 px-2 py-1.5 rounded text-[12px] cursor-pointer border-none w-full text-left transition-colors bg-transparent text-red-400 hover:bg-red-500/10 hover:text-red-300",children:[i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),i.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),"Close panel"]})]})]})}function Wy(e){const t={};for(const[n,r]of Object.entries(e)){if(!r||typeof r!="object")continue;const o=r,l=typeof o.control=="string"?o.control:typeof o.control=="object"&&o.control!==null?o.control.type??"text":"text";t[n]={control:l,options:Array.isArray(o.options)?o.options:void 0,description:typeof o.description=="string"?o.description:void 0,defaultValue:o.defaultValue}}return t}function By(e,t=!0){const[n,r]=w.useState(null),[o,l]=w.useState(!0),[s,a]=w.useState({}),[u,c]=w.useState({}),f=w.useRef(0),h=w.useRef(null),d=w.useRef(!1);return w.useEffect(()=>{if(!t)return;if(e.length===0){l(!1);return}d.current=!1,f.current=0;const m=document.createElement("iframe");Object.assign(m.style,{position:"fixed",left:"-99999px",top:"0",width:"800px",height:"600px",visibility:"hidden",pointerEvents:"none"}),h.current=m,document.body.appendChild(m);function v(g){if(g>=e.length){d.current||(d.current=!0,r(e[0]),a({}),c({}),l(!1));return}f.current=g,m.src=`/storybook/iframe.html?id=${e[g].id}&viewMode=story&vybit-ghost=1`}let b=null;function S(g){var k,C,j,E;if(d.current)return;let y=g.data;if(typeof y=="string")try{y=JSON.parse(y)}catch{return}const x=e[f.current];if((y==null?void 0:y.key)==="storybook-channel"&&((k=y==null?void 0:y.event)==null?void 0:k.type)==="storyPrepared"&&((E=(j=(C=y==null?void 0:y.event)==null?void 0:C.args)==null?void 0:j[0])==null?void 0:E.id)===(x==null?void 0:x.id)){const A=y.event.args[0].argTypes??{},_=y.event.args[0].initialArgs??y.event.args[0].args??{};if(Object.keys(A).length>0)d.current=!0,r(x),a(Wy(A)),c(_),l(!1);else{b&&clearTimeout(b);const L=f.current+1;b=setTimeout(()=>v(L),50)}}}window.addEventListener("message",S);function p(){b&&clearTimeout(b),b=setTimeout(()=>{!d.current&&f.current<e.length&&(v(f.current+1),p())},5e3)}return m.addEventListener("load",()=>{p()}),v(0),()=>{d.current=!0,window.removeEventListener("message",S),b&&clearTimeout(b),m.remove(),h.current=null}},[e,t]),{bestStory:n,probing:o,argTypes:s,defaultArgs:u}}const Vy=1;let ws=0;const mh=[];function gh(){return new Promise(e=>{const t=()=>{ws<Vy?(ws++,e(Uy)):mh.push(t)};t()})}function Uy(){ws=Math.max(0,ws-1);const e=mh.shift();e==null||e()}function Gy(e){const[t,n]=w.useState(!1),r=w.useRef(null),o=w.useRef(!1);w.useEffect(()=>{if(!e||o.current)return;o.current=!0;let s=!1;return gh().then(a=>{if(s){a();return}r.current=a,n(!0)}),()=>{s=!0,r.current&&(r.current(),r.current=null),n(!1),o.current=!1}},[e]);const l=w.useCallback(()=>{r.current&&(r.current(),r.current=null)},[]);return{canProbe:t,releaseProbeSlot:l}}function Yy(e){const[t,n]=w.useState(!1),r=w.useRef(null),o=w.useRef(!1);w.useEffect(()=>{if(!e||o.current)return;o.current=!0;let s=!1;return gh().then(a=>{if(s){a();return}r.current=a,n(!0)}),()=>{s=!0,r.current&&(r.current(),r.current=null)}},[e]);const l=w.useCallback(()=>{r.current&&(r.current(),r.current=null)},[]);return{canLoad:t,releaseSlot:l}}function cd(e,t={},n="/storybook"){const r=`${n}/iframe.html?id=${encodeURIComponent(e)}&viewMode=story&vybit-ghost=1`,o=Object.entries(t).filter(([,s])=>s!=null);if(o.length===0)return r;const l=o.map(([s,a])=>`${encodeURIComponent(s)}:${encodeURIComponent(String(a))}`).join(";");return`${r}&args=${l}`}function Qy({argTypes:e,args:t,onArgsChange:n}){const r=Object.entries(e);if(r.length===0)return null;function o(l,s){n({...t,[l]:s})}return i.jsx("div",{className:"flex flex-col gap-1.5 px-1",children:r.map(([l,s])=>i.jsx(Xy,{name:l,argType:s,value:t[l],onChange:a=>o(l,a)},l))})}function Xy({name:e,argType:t,value:n,onChange:r}){const o=typeof t.control=="string"?t.control:typeof t.control=="object"&&t.control!==null?t.control.type??"text":"text";return i.jsxs("label",{className:"flex items-center gap-2 text-[10px]",children:[i.jsx("span",{className:"text-bv-text-mid font-mono min-w-[60px] shrink-0",children:e}),o==="select"&&t.options?i.jsx("select",{className:"flex-1 bg-bv-surface border border-bv-border rounded px-1.5 py-0.5 text-[10px] text-bv-text",value:String(n??""),onChange:l=>r(l.target.value),children:t.options.map(l=>i.jsx("option",{value:l,children:l},l))}):o==="boolean"?i.jsx("input",{type:"checkbox",checked:!!n,onChange:l=>r(l.target.checked),className:"accent-bv-teal"}):o==="number"?i.jsx("input",{type:"number",className:"flex-1 bg-bv-surface border border-bv-border rounded px-1.5 py-0.5 text-[10px] text-bv-text",value:n!=null?String(n):"",onChange:l=>r(l.target.value===""?void 0:Number(l.target.value))}):i.jsx("input",{type:"text",className:"flex-1 bg-bv-surface border border-bv-border rounded px-1.5 py-0.5 text-[10px] text-bv-text",value:String(n??""),onChange:l=>r(l.target.value)})]})}function yh({ghostHtml:e,ghostCss:t,style:n,className:r}){const o=w.useRef(null);return w.useEffect(()=>{if(!o.current)return;const l=o.current.shadowRoot??o.current.attachShadow({mode:"open"}),s=":host{color:CanvasText;font-family:system-ui,sans-serif;font-size:16px;line-height:1.5}";l.innerHTML=`<style>${s}${t}</style><div style="pointer-events:none">${e}</div>`},[e,t]),i.jsx("div",{ref:o,style:n,className:r})}const ji=56,Ti=40,Zy=.15;function qy({phase:e,ghostHtml:t,ghostCss:n,naturalWidth:r,naturalHeight:o,storyBackground:l,onClick:s}){const a=e!=="idle",u=a&&!!t,c=a&&!u&&e!=="error",f=w.useRef(null),[h,d]=w.useState(null);if(w.useEffect(()=>{if(!u||!f.current||r>0&&o>0)return;const p=f.current.firstElementChild,g=p==null?void 0:p.shadowRoot,y=g==null?void 0:g.querySelector("div");if(!y)return;const x=y.style.width;y.style.width="max-content";const k=y.scrollWidth,C=y.scrollHeight;y.style.width=x,k>0&&C>0&&d({w:k,h:C})},[u,t,r,o]),!a||e==="idle")return i.jsx("div",{className:"w-14 h-10 rounded bg-bv-surface border border-dashed border-bv-border flex items-center justify-center text-[9px] font-mono text-bv-muted cursor-pointer shrink-0 hover:border-bv-teal hover:text-bv-teal transition-colors",onClick:s,children:"preview"});if(c)return i.jsx("div",{className:"w-14 h-10 rounded bg-bv-surface flex items-center justify-center shrink-0",children:i.jsx("div",{className:"w-3.5 h-3.5 border-2 border-bv-border border-t-bv-teal rounded-full animate-spin"})});if(e==="error")return i.jsx("div",{className:"w-14 h-10 rounded bg-bv-surface flex items-center justify-center shrink-0",children:i.jsx("span",{className:"text-[9px] text-bv-orange",children:"err"})});const m=r>0?r:(h==null?void 0:h.w)??0,v=o>0?o:(h==null?void 0:h.h)??0,b=m>0&&v>0?Math.min(ji/m,Ti/v,1):1,S=Math.max(b,Zy);return i.jsx("div",{className:"w-14 h-10 rounded bg-bv-surface overflow-hidden relative cursor-pointer shrink-0",style:l?{backgroundColor:l}:void 0,onClick:s,children:i.jsx("div",{ref:f,style:{position:"absolute",top:0,left:0,transformOrigin:"top left",transform:`scale(${S})`,width:S<1?`${ji/S}px`:`${ji}px`,height:S<1?`${Ti/S}px`:`${Ti}px`,display:"flex",alignItems:S>=.8?"center":"flex-start",justifyContent:S>=.8?"center":"flex-start",padding:S<.8?"4px":"2px",pointerEvents:"none"},children:n?i.jsx(yh,{ghostHtml:t,ghostCss:n}):i.jsx("div",{className:"pointer-events-none",dangerouslySetInnerHTML:{__html:t}})})})}const Jy={phase:"idle",bestStory:null,argTypes:{},defaultArgs:{},args:{},liveReady:!1,storyBackground:void 0,liveGhostHtml:null,liveGhostCss:null,naturalWidth:0,naturalHeight:0,error:null,pendingArgs:null,loadLiveRequested:!1};function ex(e,t){switch(t.type){case"BECOME_VISIBLE":return e.phase!=="idle"?e:{...e,phase:t.hasCachedGhost?"cached":"probing"};case"PROBE_COMPLETE":return e.phase!=="probing"&&e.phase!=="cached"?e:{...e,phase:"probe-done",bestStory:t.bestStory,argTypes:t.argTypes,defaultArgs:t.defaultArgs,args:t.defaultArgs};case"PROBE_FALLBACK":return e.phase!=="probing"&&e.phase!=="cached"?e:{...e,phase:"probe-done",bestStory:t.bestStory};case"SLOT_ACQUIRED":return e.phase!=="probe-done"?e:{...e,phase:"loading"};case"IFRAME_LOADED":return e.phase!=="loading"?e:{...e,phase:"ready",liveReady:!0};case"IFRAME_ERROR":return e.phase!=="loading"?e:{...e,phase:"error",error:t.message};case"GHOST_EXTRACTED":return e.phase!=="ready"&&e.phase!=="loading"?e:{...e,liveGhostHtml:t.ghostHtml,liveGhostCss:t.ghostCss,storyBackground:t.storyBackground??e.storyBackground,naturalWidth:t.naturalWidth??e.naturalWidth,naturalHeight:t.naturalHeight??e.naturalHeight};case"ARGS_CHANGED":return e.liveReady?{...e,args:t.args}:{...e,args:t.args,pendingArgs:t.args};case"CLEAR_PENDING_ARGS":return{...e,pendingArgs:null};case"REQUEST_LIVE_REFRESH":return e.phase==="cached"?{...e,phase:"probing",loadLiveRequested:!0}:e.phase==="error"?{...e,phase:"probing",error:null,loadLiveRequested:!0}:{...e,loadLiveRequested:!0}}return e}const tx=new Set(["color","font-family","font-size","font-weight","font-style","line-height","letter-spacing","text-align","text-transform","text-decoration"]);function nx(e){const t=e.ownerDocument.defaultView??window,n=e.ownerDocument,r=t.getComputedStyle(e),o=n.createElement(e.tagName.toLowerCase());o.style.position="absolute",o.style.visibility="hidden",o.style.pointerEvents="none",(n.body??n.documentElement).appendChild(o);const l=t.getComputedStyle(o),s={};for(let a=0;a<r.length;a++){const u=r[a],c=r.getPropertyValue(u);(tx.has(u)||c!==l.getPropertyValue(u))&&(s[u]=c)}return o.remove(),s}function rx(e,t,n){for(const[r,o]of Object.entries(t))if(!((r==="height"||r==="block-size")&&!(t.display??"").startsWith("inline"))){if((r==="width"||r==="inline-size")&&n!=null){const l=parseFloat(o);if(!isNaN(l)&&Math.abs(l-n)<1)continue}r==="perspective-origin"||r==="transform-origin"||e.style.setProperty(r,o)}}const ox=new Set(["perspective-origin","transform-origin"]);function lx(e,t){if(!e||!t)return;const n=e.ownerDocument.defaultView??window,r=e.ownerDocument,o=r.body??r.documentElement,l=new Map;function s(u){let c=l.get(u);if(c)return c;const f=r.createElement(u);f.style.position="absolute",f.style.visibility="hidden",f.style.pointerEvents="none",o.appendChild(f);const h=n.getComputedStyle(f);c=new Map;for(let d=0;d<h.length;d++){const m=h[d];c.set(m,h.getPropertyValue(m))}return f.remove(),l.set(u,c),c}function a(u,c){const f=n.getComputedStyle(u),h=c;if(h.style){const b=s(u.tagName.toLowerCase());for(let S=0;S<f.length;S++){const p=f[S];if(ox.has(p))continue;const g=f.getPropertyValue(p);g!==(b.get(p)??"")&&h.style.setProperty(p,g)}}const d=u.children,m=c.children,v=Math.min(d.length,m.length);for(let b=0;b<v;b++)a(d[b],m[b])}a(e,t)}function sx(e){return e.replace(/:root/g,":host").replace(/(^|[\s,{;])body(?=\s*[,{:])/gm,"$1:host")}function lb(e){return e.replace(/:host/g,":root")}function dd(e){const t=[];for(const n of e.styleSheets)try{for(const r of n.cssRules){const o=r.cssText;o.includes(".sb-")||o.includes("#storybook-")||o.includes("Nunito Sans")||t.push(o)}}catch{}return sx(t.join(`
|
|
41
|
+
`))}const en=class en extends HTMLElement{constructor(){super();ot(this,"shadow");ot(this,"ghostEl");ot(this,"hiddenIframe");ot(this,"loadTimeoutId",null);ot(this,"pollId",null);ot(this,"hasLoaded",!1);ot(this,"_loadedDispatched",!1);ot(this,"observer",null);ot(this,"_error",null);this.shadow=this.attachShadow({mode:"open"}),this.ghostEl=document.createElement("div"),this.ghostEl.setAttribute("part","ghost"),this.ghostEl.style.display="contents";const n=document.createElement("style");n.textContent=`
|
|
42
|
+
iframe {
|
|
43
|
+
position: absolute; inset: 0;
|
|
44
|
+
width: 100%; height: 100%;
|
|
45
|
+
border: none;
|
|
46
|
+
opacity: 0;
|
|
47
|
+
transition: opacity 0.2s ease-in;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
}
|
|
50
|
+
iframe.visible {
|
|
51
|
+
opacity: 1;
|
|
52
|
+
pointer-events: auto;
|
|
53
|
+
}
|
|
54
|
+
`,this.shadow.append(n,this.ghostEl),this.hiddenIframe=document.createElement("iframe"),Object.assign(this.hiddenIframe.style,{position:"fixed",left:"0",top:"0",width:"800px",height:"600px",opacity:"0",pointerEvents:"none",border:"none",zIndex:"-999999"}),this.hiddenIframe.addEventListener("load",()=>this.onIframeLoad()),this.hiddenIframe.addEventListener("error",()=>this.reportError("Failed to load iframe"))}connectedCallback(){document.body.appendChild(this.hiddenIframe),this.syncIframeWidth(),this.triggerLoad()}disconnectedCallback(){var n;(n=this.observer)==null||n.disconnect(),this.observer=null,this.pollId&&(clearInterval(this.pollId),this.pollId=null),this.hiddenIframe.remove()}attributeChangedCallback(){this.isConnected&&(this.syncIframeWidth(),this.triggerLoad())}syncIframeWidth(){const n=this.clientWidth;n>0&&(this.hiddenIframe.style.width=n+"px")}triggerLoad(){var o;(o=this.observer)==null||o.disconnect(),this.observer=null,this.loadTimeoutId&&clearTimeout(this.loadTimeoutId),this.pollId&&(clearInterval(this.pollId),this.pollId=null),this.hasLoaded=!1,this._loadedDispatched=!1;const n=this.getAttribute("src"),r=this.getAttribute("srcdoc");r!=null?this.hiddenIframe.srcdoc=r:n&&(this.hiddenIframe.src=n),this.loadTimeoutId=setTimeout(()=>{if(!this.hasLoaded){const l=this.getAttribute("src");this.reportError(`Story failed to load (${l||"unknown"}) — check that Storybook is running on port 6006+`)}},2e4)}onIframeLoad(){const n=this.getAttribute("src"),r=this.getAttribute("srcdoc");if(!n&&r==null)return;this.loadTimeoutId&&(clearTimeout(this.loadTimeoutId),this.loadTimeoutId=null),this.hasLoaded=!0;const o=this.hiddenIframe.contentDocument;if(!o){console.warn("[AdaptiveIframe] iframe loaded but contentDocument is null");return}const l=o.createElement("style");if(l.textContent="body,html{margin:0!important;padding:0!important}",o.head.appendChild(l),r!=null){this.extractAndApply(o);return}this.waitForStoryContent(o)}updateArgs(n,r){const o=this.hiddenIframe.contentWindow;o&&(o.postMessage(JSON.stringify({key:"storybook-channel",event:{type:"updateStoryArgs",args:[{storyId:n,updatedArgs:r}]}}),"*"),setTimeout(()=>{const l=this.hiddenIframe.contentDocument;l&&this.extractAndApply(l)},300))}waitForStoryContent(n){var h;(h=this.observer)==null||h.disconnect(),this.observer=null,this.pollId&&(clearInterval(this.pollId),this.pollId=null);let r=!1,o=0;const l=20,s=()=>this.findStoryRoot(n)?(r=!0,this.extractAndApply(n),this.observer&&(this.observer.disconnect(),this.observer=null),!0):!1;if(s())return;const a=n.querySelector("#storybook-root"),u=a??n.body;if(!u)return;const c=new MutationObserver(d=>{if(!r){if(o++,s()){this.pollId&&(clearInterval(this.pollId),this.pollId=null);return}o>=l&&(c.disconnect(),this.observer=null,this.pollId&&(clearInterval(this.pollId),this.pollId=null),console.error(`[AdaptiveIframe] gave up after ${o} mutations — story never appeared. src=${this.getAttribute("src")}`),this.reportError("Story did not render — component may not exist or Storybook story file has an error"))}});this.observer=c,c.observe(u,{childList:!0,subtree:!0,characterData:!0}),a&&n.body&&a!==n.body&&c.observe(n.body,{childList:!0});let f=0;this.pollId=setInterval(()=>{if(r){clearInterval(this.pollId),this.pollId=null;return}f++;const d=this.hiddenIframe.contentDocument;if(d&&this.findStoryRoot(d)){r=!0,this.extractAndApply(d),this.observer&&(this.observer.disconnect(),this.observer=null),clearInterval(this.pollId),this.pollId=null;return}f>=40&&(clearInterval(this.pollId),this.pollId=null)},1e3),setTimeout(()=>{!r&&this.observer===c&&(this.observer.disconnect(),this.observer=null,this.pollId&&(clearInterval(this.pollId),this.pollId=null),console.error(`[AdaptiveIframe] 40s timeout — story never rendered. src=${this.getAttribute("src")}`),this.reportError("Story did not render — component may not exist or Storybook story file has an error"))},4e4)}findStoryRoot(n){var o;const r=n.querySelector("#storybook-root");if(r){for(const s of r.children)if(!s.classList.contains("sb-loader")&&!(s.id&&(s.id.startsWith("storybook-")||s.id.startsWith("sb-"))))return s.children.length===0&&!((o=s.textContent)!=null&&o.trim())&&!s.className?null:s;const l=this.findPortalContent(n);return l||null}return n.body.firstElementChild}findPortalContent(n){var o;const r=n.defaultView??window;for(const l of n.body.children)if(!en.INFRA_TAGS.has(l.tagName)&&!(l.id&&en.INFRA_IDS.has(l.id))&&!(l.id&&(l.id.startsWith("storybook-")||l.id.startsWith("sb-")))&&!(l.className&&typeof l.className=="string"&&l.className.split(/\s+/).some(a=>en.INFRA_CLASS_PREFIXES.some(u=>a.startsWith(u))))){if(l instanceof HTMLElement){const s=r.getComputedStyle(l);if(s.display==="none"||s.visibility==="hidden")continue}if(!(!l.children.length&&!((o=l.textContent)!=null&&o.trim())))return l}return null}getComponentHtml(){const n=this.hiddenIframe.contentDocument;if(!n)return"";const r=this.findStoryRoot(n);return r?r.cloneNode(!0).outerHTML:this.ghostEl.innerHTML}getComponentCss(){const n=this.hiddenIframe.contentDocument;return n?dd(n):""}extractAndApply(n){const r=this.findStoryRoot(n);if(r&&r.ownerDocument.defaultView,!r)return;const o=nx(r);if(o.position==="fixed"||o.position==="absolute"){const S=["position","left","right","top","bottom","inset","inset-block","inset-block-start","inset-block-end","inset-inline","inset-inline-start","inset-inline-end","transform","translate","z-index","opacity","animation","animation-name","animation-duration","animation-delay","animation-fill-mode","animation-timing-function","transition","transition-property","transition-duration","transition-delay","transition-timing-function"];for(const p of S)delete o[p]}rx(this,o,parseInt(this.hiddenIframe.style.width)||800),this.ghostEl.innerHTML=r.innerHTML;const l=r.children,s=this.ghostEl.children,a=Math.min(l.length,s.length);for(let S=0;S<a;S++)lx(l[S],s[S]);this._loadedDispatched||(this._loadedDispatched=!0,this.dispatchEvent(new CustomEvent("iframe-loaded")));const u=this.getComponentHtml(),c=dd(n),f=getComputedStyle(n.body).backgroundColor,h=r,d=h.style.width,m=h.style.display;h.style.width="fit-content",m||(h.style.display="block");const v=h.scrollWidth,b=h.scrollHeight;h.style.width=d,h.style.display=m,this.dispatchEvent(new CustomEvent("ghost-extracted",{detail:{ghostHtml:u,ghostCss:c,hostStyles:o,storyBackground:f,naturalWidth:v,naturalHeight:b}}))}reportError(n){this._error=n,console.error(`[AdaptiveIframe] ${n}`),this.dispatchEvent(new CustomEvent("iframe-error",{detail:{message:n}}))}getError(){return this._error}clearError(){this._error=null}};ot(en,"observedAttributes",["src","srcdoc"]),ot(en,"INFRA_TAGS",new Set(["SCRIPT","STYLE","LINK","META","NOSCRIPT"])),ot(en,"INFRA_IDS",new Set(["storybook-root","storybook-docs","sb-addons-root"])),ot(en,"INFRA_CLASS_PREFIXES",["sb-"]);let za=en;customElements.get("adaptive-iframe")||customElements.define("adaptive-iframe",za);function ix({group:e,isArmed:t,onArm:n,onDisarm:r,cachedGhostHtml:o,cachedGhostCss:l,cachedHostStyles:s,cachedStoryBackground:a,cachedArgCount:u,onGhostExtracted:c,insertMode:f,hasPageSelection:h}){const[d,m]=w.useReducer(ex,{...Jy,storyBackground:a}),v=w.useRef(null),b=w.useRef(null),S=w.useRef(!1),[p,g]=w.useState(!1);w.useEffect(()=>{const z=v.current;if(!z)return;const he=new IntersectionObserver(([nt])=>{nt.isIntersecting&&(m({type:"BECOME_VISIBLE",hasCachedGhost:!!o}),he.disconnect())},{rootMargin:"200px"});return he.observe(z),()=>he.disconnect()},[o]);const y=d.phase!=="idle"&&(d.phase==="probing"||!o||p||d.loadLiveRequested)&&!(d.phase==="probe-done"||d.phase==="loading"||d.phase==="ready"||d.phase==="loaded"||d.phase==="error"),{canProbe:x,releaseProbeSlot:k}=Gy(y),C=y&&x,{bestStory:j,probing:E,argTypes:A,defaultArgs:_}=By(e.stories,C);w.useEffect(()=>{!E&&j&&(d.phase==="probing"||d.phase==="cached")&&(k(),Object.keys(A).length>0?m({type:"PROBE_COMPLETE",bestStory:j,argTypes:A,defaultArgs:_}):m({type:"PROBE_FALLBACK",bestStory:j}))},[E,j,A,_,d.phase]);const L=(d.phase==="probe-done"||d.phase==="loading")&&!!d.bestStory&&(!o||d.loadLiveRequested),{canLoad:B,releaseSlot:H}=Yy(L);w.useEffect(()=>{B&&d.phase==="probe-done"&&m({type:"SLOT_ACQUIRED"})},[B,d.phase]),w.useEffect(()=>{d.phase!=="loading"||!d.bestStory||!b.current||S.current||(S.current=!0,cd(d.bestStory.id,{}),b.current.setAttribute("src",cd(d.bestStory.id,{})))},[d.phase,d.bestStory]),w.useEffect(()=>{const z=b.current;if(!(z!=null&&z.addEventListener))return;const he=()=>{m({type:"IFRAME_LOADED"}),H(),d.pendingArgs&&d.bestStory&&(typeof z.updateArgs=="function"&&z.updateArgs(d.bestStory.id,d.pendingArgs),m({type:"CLEAR_PENDING_ARGS"}))},nt=vt=>{const rt=vt.detail.message;m({type:"IFRAME_ERROR",message:rt}),H()},xt=vt=>{const{ghostHtml:rt,ghostCss:bt,hostStyles:Gt,storyBackground:J,naturalWidth:le,naturalHeight:ie}=vt.detail;(J||rt)&&m({type:"GHOST_EXTRACTED",ghostHtml:rt,ghostCss:bt??"",storyBackground:J,naturalWidth:le,naturalHeight:ie}),d.bestStory&&(c==null||c({storyId:d.bestStory.id,args:{},ghostHtml:rt,ghostCss:bt??"",hostStyles:Gt,storyBackground:J,componentName:e.name,componentPath:e.componentPath,argCount:Object.keys(d.argTypes).length||void 0}))};return z.addEventListener("iframe-loaded",he),z.addEventListener("iframe-error",nt),z.addEventListener("ghost-extracted",xt),()=>{z.removeEventListener("iframe-loaded",he),z.removeEventListener("iframe-error",nt),z.removeEventListener("ghost-extracted",xt)}},[d.bestStory,d.pendingArgs,H,e.name,e.componentPath,c]);const D=w.useCallback(z=>{if(m({type:"ARGS_CHANGED",args:z}),!d.liveReady||!b.current||!d.bestStory){m({type:"REQUEST_LIVE_REFRESH"});return}const he=b.current;typeof he.updateArgs=="function"&&he.updateArgs(d.bestStory.id,z)},[d.bestStory,d.liveReady]),G=w.useCallback(z=>{var vt,rt;if(z.stopPropagation(),t){r();return}const he=b.current,nt=((vt=he==null?void 0:he.getComponentHtml)==null?void 0:vt.call(he))??o??"",xt=((rt=he==null?void 0:he.getComponentCss)==null?void 0:rt.call(he))??l??"";n(nt,xt,d.args),m({type:"REQUEST_LIVE_REFRESH"}),c&&nt&&d.bestStory&&c({storyId:d.bestStory.id,args:d.args,ghostHtml:nt,ghostCss:xt,hostStyles:s??{},storyBackground:d.storyBackground,componentName:e.name,componentPath:e.componentPath,argCount:Object.keys(d.argTypes).length||void 0})},[t,n,r,d.args,d.bestStory,d.storyBackground,o,l,s,e.name,e.componentPath,c]),Q=w.useCallback(z=>{z.stopPropagation(),g(he=>!he),!d.liveReady&&!d.loadLiveRequested&&m({type:"REQUEST_LIVE_REFRESH"})},[d.liveReady,d.loadLiveRequested]),q=Object.keys(d.argTypes).length>0?d.argTypes:e.argTypes??{},T=Object.keys(q).length>0||!!o,R=Object.keys(q).length||u||0,P=d.liveGhostHtml??o,Y=d.liveGhostCss??l,X=f==="replace"?"Replace":"Place",Ne=f==="replace"?"Replacing":"Placing",Pe=d.phase!=="idle",$=d.bestStory??j,ne=Pe&&!d.error&&!E&&$,me=t?"border-bv-orange text-white bg-bv-orange hover:bg-[#d94425]":h?"border-bv-teal text-bv-teal bg-bv-teal/10 hover:bg-bv-teal/20 hover:text-white":"border-bv-border text-bv-text-mid bg-bv-surface hover:border-[#555] hover:text-bv-text hover:bg-bv-surface-hi";return i.jsxs("li",{ref:v,className:"flex flex-col",children:[i.jsxs("div",{className:`flex items-center gap-2.5 px-2.5 py-2 rounded-md cursor-pointer transition-all ${t?"bg-bv-orange/10 border border-bv-orange":p?"bg-bv-surface border border-bv-border rounded-b-none":"border border-transparent hover:bg-bv-surface hover:border-bv-border"}`,onClick:Q,children:[i.jsx(qy,{phase:d.phase,ghostHtml:P,ghostCss:Y,naturalWidth:d.naturalWidth,naturalHeight:d.naturalHeight,storyBackground:d.storyBackground,onClick:Q}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"text-[12px] font-semibold text-bv-text leading-tight truncate",children:e.name}),i.jsx("div",{className:"text-[10px] text-bv-muted mt-0.5",children:d.phase==="loading"&&!P?i.jsx("span",{className:"text-bv-teal",children:"Loading preview…"}):R>0?`${R} props`:null})]}),i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[i.jsx("button",{type:"button",className:`h-5.5 rounded px-2 text-[10px] font-medium border transition-all cursor-pointer ${p?"border-[#555] text-bv-text bg-bv-surface-hi":"border-bv-border text-bv-text-mid bg-bv-surface hover:border-[#555] hover:text-bv-text hover:bg-bv-surface-hi"}`,onClick:Q,children:p?"▲ Collapse":"Customize"}),i.jsx("button",{type:"button",className:`h-5.5 rounded px-2 text-[10px] font-medium border transition-all cursor-pointer ${me}`,onClick:G,children:t?Ne:X})]})]}),p&&i.jsxs("div",{className:"border border-t-0 border-bv-border rounded-b-md bg-bv-surface overflow-hidden",children:[i.jsx("div",{className:"flex items-center justify-center min-h-20 p-4 border-b border-bv-border overflow-hidden",style:{contain:"paint",...d.storyBackground?{backgroundColor:d.storyBackground}:{}},children:P&&Y?i.jsx(yh,{ghostHtml:P,ghostCss:Y}):P?i.jsx("div",{className:"pointer-events-none",dangerouslySetInnerHTML:{__html:P}}):i.jsx("span",{className:"text-[10px] text-bv-muted",children:"Loading preview…"})}),T&&i.jsxs("div",{className:"px-2.5 py-2",onClick:z=>z.stopPropagation(),children:[i.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[i.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-wider text-bv-muted",children:"Props"}),i.jsx("span",{className:"text-[9px] text-bv-muted",children:"Changes re-render live"})]}),i.jsx(Qy,{argTypes:q,args:d.args,onArgsChange:D})]})]}),ne&&i.jsx("adaptive-iframe",{ref:z=>{b.current=z,z&&(z.style.setProperty("position","absolute","important"),z.style.setProperty("width","0","important"),z.style.setProperty("height","0","important"),z.style.setProperty("opacity","0","important"),z.style.setProperty("pointer-events","none","important"),z.style.setProperty("overflow","hidden","important"))}})]})}function xh(e){return!e||Object.keys(e).length===0?"":JSON.stringify(e,Object.keys(e).sort())}function fd(e,t){const n=xh(t);return n?`${e}::${n}`:e}function ax(){const[e,t]=w.useState(!1),n=w.useRef(new Map);w.useEffect(()=>{let l=!1;return fetch("/api/ghost-cache").then(s=>s.json()).then(s=>{if(l)return;const a=new Map;for(const u of s){const c=u.argsHash?`${u.storyId}::${u.argsHash}`:u.storyId;a.set(c,u)}n.current=a,t(!0)}).catch(()=>{l||t(!0)}),()=>{l=!0}},[]);const r=w.useCallback((l,s)=>{const a=fd(l,s),u=n.current.get(a);return u?{ghostHtml:u.ghostHtml,ghostCss:u.ghostCss,hostStyles:u.hostStyles,storyBackground:u.storyBackground,argCount:u.argCount}:null},[]),o=w.useCallback(l=>{const s=fd(l.storyId,l.args),a=n.current.get(s),u=!a||l.argCount!=null&&a.argCount==null;n.current.set(s,{storyId:l.storyId,argsHash:xh(l.args),ghostHtml:l.ghostHtml,ghostCss:l.ghostCss,hostStyles:l.hostStyles,storyBackground:l.storyBackground,componentName:l.componentName,componentPath:l.componentPath,argCount:l.argCount,extractedAt:Date.now()}),u&&fetch("/api/ghost-cache",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({storyId:l.storyId,args:l.args,ghostHtml:l.ghostHtml,ghostCss:l.ghostCss,hostStyles:l.hostStyles,storyBackground:l.storyBackground,componentName:l.componentName,componentPath:l.componentPath,argCount:l.argCount})}).catch(()=>{})},[]);return{getCachedGhost:r,submitToCache:o,loaded:e}}function jl({insertMode:e,hasPageSelection:t,onArmedChange:n}){const{groups:r,loading:o,error:l,refetch:s}=cx(),[a,u]=w.useState(null),[c,f]=w.useState(!1),{getCachedGhost:h,submitToCache:d}=ax(),m=w.useCallback((b,S,p,g)=>{var y;u(b.name),n==null||n(!0),fe("overlay",{type:"COMPONENT_ARM",componentName:b.name,storyId:((y=b.stories[0])==null?void 0:y.id)??"",ghostHtml:S,ghostCss:p,componentPath:b.componentPath,args:g,insertMode:e==="replace"?"replace":void 0})},[e,n]),v=w.useCallback(()=>{u(null),n==null||n(!1),fe("overlay",{type:"COMPONENT_DISARM"})},[n]);return w.useEffect(()=>bs(b=>{b.type==="COMPONENT_DISARMED"&&(u(null),f(!1),n==null||n(!1))}),[n]),w.useEffect(()=>{if(!a&&!c)return;const b=()=>{u(null),f(!1),n==null||n(!1),fe("overlay",{type:"COMPONENT_DISARM"})};return document.addEventListener("click",b),()=>document.removeEventListener("click",b)},[a,c,n]),i.jsxs("div",{className:"p-3 flex flex-col gap-3",children:[i.jsxs("button",{type:"button",onClick:b=>{if(b.stopPropagation(),c){f(!1),fe("overlay",{type:"COMPONENT_DISARM"});return}f(!0),fe("overlay",{type:"INSERT_DESIGN_CANVAS",insertMode:e==="replace"?"replace":"after"})},className:`flex items-center gap-2.5 px-3 py-2 rounded-md border transition-all cursor-pointer text-left ${c?"border-bv-teal bg-bv-teal/10 ring-1 ring-bv-teal":"border-bv-border bg-bv-surface hover:border-bv-teal hover:bg-bv-teal/5"}`,children:[i.jsx("div",{className:"w-8 h-8 rounded bg-bv-teal/10 text-bv-teal flex items-center justify-center shrink-0",children:i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[i.jsx("path",{d:"M15 1H1v14h14V1ZM0 0h16v16H0V0Z"}),i.jsx("path",{d:"M4 8h8M8 4v8",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})]})}),i.jsxs("div",{className:"flex flex-col min-w-0",children:[i.jsx("span",{className:"text-[11px] font-medium text-bv-text",children:"Draw / Screenshot Canvas"}),i.jsx("span",{className:"text-[10px] text-bv-muted",children:"Freehand drawing or annotate a screenshot"})]})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[o&&i.jsx("div",{className:"text-[11px] text-bv-muted",children:"Loading components…"}),!o&&l&&i.jsx(ux,{onConnected:s}),!o&&!l&&r.length===0&&i.jsx("div",{className:"text-[11px] text-bv-muted",children:"No stories found."}),!o&&!l&&r.length>0&&i.jsx("ul",{className:"flex flex-col gap-2",children:r.map(b=>{var g;const S=(g=b.stories[0])==null?void 0:g.id,p=S?h(S):null;return i.jsx(ix,{group:b,isArmed:a===b.name,onArm:(y,x,k)=>m(b,y,x,k),onDisarm:v,cachedGhostHtml:p==null?void 0:p.ghostHtml,cachedGhostCss:p==null?void 0:p.ghostCss,cachedHostStyles:p==null?void 0:p.hostStyles,cachedStoryBackground:p==null?void 0:p.storyBackground,cachedArgCount:p==null?void 0:p.argCount,onGhostExtracted:d,insertMode:e,hasPageSelection:t},b.name)})})]})]})}function ux({onConnected:e}){const[t,n]=w.useState(""),[r,o]=w.useState(!1),[l,s]=w.useState(!1),a=async u=>{o(!0),s(!1);try{const c=u!=null?{port:u}:{};(await(await fetch("/api/storybook-reconnect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json()).ok?e():s(!0)}catch{s(!0)}finally{o(!1)}};return i.jsxs("div",{className:"text-[11px] text-bv-text-mid leading-relaxed flex flex-col gap-2",children:[i.jsx("span",{children:"Storybook not detected."}),i.jsx("button",{onClick:()=>a(),disabled:r,className:"self-start px-2.5 py-1 rounded bg-bv-surface-hi text-bv-text text-[11px] border border-bv-border hover:border-bv-teal disabled:opacity-50 transition-colors",children:r?"Scanning…":"Scan for Storybook"}),i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"text-bv-muted",children:"or port:"}),i.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",placeholder:"6006",value:t,onChange:u=>{n(u.target.value),s(!1)},onKeyDown:u=>{u.key==="Enter"&&t&&a(Number(t))},className:"w-16 px-1.5 py-0.5 rounded bg-bv-surface text-bv-text text-[11px] border border-bv-border focus:border-bv-teal outline-none"}),i.jsx("button",{onClick:()=>t&&a(Number(t)),disabled:!t||r,className:"px-2 py-0.5 rounded bg-bv-surface-hi text-bv-text text-[11px] border border-bv-border hover:border-bv-teal disabled:opacity-50 transition-colors",children:"Connect"})]}),l&&i.jsxs("span",{className:"text-bv-orange text-[10px]",children:["No Storybook found",t?` on port ${t}`:"",". Is it running?"]})]})}function cx(){const[e,t]=w.useState([]),[n,r]=w.useState(!0),[o,l]=w.useState(!1),[s,a]=w.useState(0),u=w.useCallback(()=>{r(!0),l(!1),t([]),a(c=>c+1)},[]);return w.useEffect(()=>{let c=!1;return(async()=>{var f,h;try{const d=await fetch("/api/storybook-data").then(v=>v.json());if(!d.available){c||(l(!0),r(!1));return}const m=Object.values(((f=d.index)==null?void 0:f.entries)??((h=d.index)==null?void 0:h.stories)??{});c||t(dx(m,d.argTypes??{}))}catch{c||l(!0)}finally{c||r(!1)}})(),()=>{c=!0}},[s]),{groups:e,loading:n,error:o,refetch:u}}function dx(e,t={}){const n=new Map;for(const o of e){if(o.type==="docs"||o.id.endsWith("--docs"))continue;const l=o.title.split("/").at(-1)??o.title;n.has(l)||n.set(l,[]),n.get(l).push(o)}const r=Array.from(n.entries()).map(([o,l])=>{var a,u;const s=new Set;for(const c of l)for(const f of c.tags??[])s.add(f);return{name:o,fullTitle:((a=l[0])==null?void 0:a.title)??o,tags:Array.from(s),stories:l,argTypes:t[o]??fx(l),componentPath:(u=l[0])==null?void 0:u.componentPath}});return r.sort((o,l)=>{const s=o.tags.includes("design-system")?0:1,a=l.tags.includes("design-system")?0:1;return s!==a?s-a:o.name.localeCompare(l.name)}),r}function fx(e){const t={};for(const n of e)for(const[r,o]of Object.entries(n.argTypes??{}))r in t||(t[r]=o);return t}const Ni="w-[30px] h-7 rounded-[4px] border-none flex items-center justify-center cursor-pointer transition-all duration-[120ms] ease-out",px="bg-[#00464A] text-[#5fd4da] shadow-[0_1px_3px_rgba(0,0,0,0.3)]",hx="bg-[#F5532D]/15 text-[#F5532D] shadow-[0_1px_3px_rgba(0,0,0,0.3)]",pd="bg-transparent text-[#999] hover:text-[#b3b3b3]";function Ri(e,t,n){return e?t?hx:n?px:pd:pd}function Tl({mode:e,onModeChange:t,isPicking:n=!1,isEngaged:r=!1}){return i.jsxs("div",{className:"inline-flex items-center rounded-[6px] bg-[#1a1a1a] p-[2px] gap-[1px]",children:[i.jsx("button",{type:"button",onClick:()=>t("select"),className:`${Ni} ${Ri(e==="select",e==="select"&&n,e==="select"&&r)}`,"aria-pressed":e==="select",title:"Select an element",children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[i.jsx("path",{d:"M14,0H2C.895,0,0,.895,0,2V14c0,1.105,.895,2,2,2H6c.552,0,1-.448,1-1h0c0-.552-.448-1-1-1H2V2H14V6c0,.552,.448,1,1,1h0c.552,0,1-.448,1-1V2c0-1.105-.895-2-2-2Z"}),i.jsx("path",{d:"M12.043,10.629l2.578-.644c.268-.068,.43-.339,.362-.607-.043-.172-.175-.308-.345-.358l-7-2c-.175-.051-.363-.002-.492,.126-.128,.129-.177,.317-.126,.492l2,7c.061,.214,.257,.362,.48,.362h.009c.226-.004,.421-.16,.476-.379l.644-2.578,3.664,3.664c.397,.384,1.03,.373,1.414-.025,.374-.388,.374-1.002,0-1.389l-3.664-3.664Z"})]})}),i.jsx("button",{type:"button",onClick:()=>t("insert"),className:`${Ni} ${Ri(e==="insert",e==="insert"&&n,e==="insert"&&r)}`,"aria-pressed":e==="insert",title:"Insert to add content",children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"square",strokeLinejoin:"miter",children:[i.jsx("rect",{x:"4",y:"2",width:"16",height:"8",rx:"2"}),i.jsx("path",{d:"m17,14h1c1.105,0,2,.895,2,2"}),i.jsx("path",{d:"m4,16c0-1.105.895-2,2-2h1"}),i.jsx("path",{d:"m7,22h-1c-1.105,0-2-.895-2-2"}),i.jsx("path",{d:"m20,20c0,1.105-.895,2-2,2h-1"}),i.jsx("line",{x1:"13",y1:"14",x2:"11",y2:"14"}),i.jsx("line",{x1:"13",y1:"22",x2:"11",y2:"22"})]})}),i.jsx("button",{type:"button",onClick:()=>t("bug-report"),className:`${Ni} ${Ri(e==="bug-report",!1)}`,"aria-pressed":e==="bug-report",title:"Report a bug",children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[i.jsx("path",{d:"M11.5,6C11.5,4.067,9.933,2.5,8,2.5S4.5,4.067,4.5,6v1h7V6Z"}),i.jsx("rect",{x:"3",y:"8",width:"10",height:"6",rx:"2"}),i.jsx("path",{d:"M1,5.5h2.2C3.07,5.01,3,4.51,3,4h0V3.5H1c-.552,0-1,.448-1,1S.448,5.5,1,5.5Z"}),i.jsx("path",{d:"M15,3.5h-2c0,.51-.07,1.01-.2,1.5H15c.552,0,1-.448,1-1s-.448-1-1-1Z"}),i.jsx("path",{d:"M1,11.5h2.05c.232,.89,.62,1.71,1.13,2.5H1c-.552,0-1-.448-1-1s.448-1,1-1h0Z"}),i.jsx("path",{d:"M15,10.5h-2.05c-.232,.89-.62,1.71-1.13,2.5h3.18c.552,0,1-.448,1-1s-.448-1-1-1Z"}),i.jsx("path",{d:"M1,7.5h2v2H1c-.552,0-1-.448-1-1s.448-1,1-1Z"}),i.jsx("path",{d:"M13,7.5h2c.552,0,1,.448,1,1s-.448,1-1,1h-2v-2Z"}),i.jsx("rect",{x:"7",y:"9",width:"2",height:"4",rx:".5"})]})})]})}function mx(e){var c,f;const n=`<${((c=e.component)==null?void 0:c.name)??"component"}>`,r="insertMode"in e?e.insertMode:void 0,o="targetComponentName"in e&&e.targetComponentName||"parentComponent"in e&&((f=e.parentComponent)==null?void 0:f.name)||null,l=o||e.elementKey||null,s=o?`<${l}>`:l,a="targetPatchId"in e&&!!e.targetPatchId,u=s&&a?`new ${s}`:s;switch(r){case"after":return u?`Appended ${n} after ${u}`:`Appended ${n}`;case"before":return u?`Prepended ${n} before ${u}`:`Prepended ${n}`;case"last-child":return u?`Inserted ${n} bottom of ${u}`:`Inserted ${n}`;case"first-child":return u?`Inserted ${n} top of ${u}`:`Inserted ${n}`;default:return u?`Inserted ${n} in ${u}`:`Inserted ${n}`}}function hd(e,t){const n=e.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();return n.length>t?n.slice(0,t)+"…":n}function Nl({label:e,count:t,items:n,activeColor:r,dotColor:o,onCommit:l,onDiscard:s,onCommitAll:a,onDiscardAll:u}){const[c,f]=w.useState(!1),h=w.useRef(null),d=w.useRef(null),[m,v]=w.useState(void 0);w.useEffect(()=>{if(!c||!d.current)return;const g=d.current.getBoundingClientRect(),y=220,x=window.innerWidth,k=4;let C=g.left+g.width/2-y/2;C=Math.max(k,Math.min(C,x-y-k)),v(C-g.left)},[c]),w.useEffect(()=>{if(!c)return;function p(g){h.current&&!h.current.contains(g.target)&&f(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[c]),w.useEffect(()=>{if(!c)return;function p(g){g.key==="Escape"&&f(!1)}return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[c]);const b=t>0,S=l||s||a||u;return i.jsxs("div",{ref:h,className:"relative",children:[i.jsxs("button",{ref:d,className:`flex items-center gap-1 text-[11px] tabular-nums border-none bg-transparent cursor-pointer px-0 py-0 ${b?`${r} font-medium`:"text-bv-muted"} ${b?"hover:underline":""}`,onClick:()=>b&&f(!c),disabled:!b,type:"button",children:[o&&i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${o}`}),t," ",e]}),c&&i.jsxs("div",{className:"absolute bottom-full mb-1 min-w-[220px] max-w-[calc(100vw-24px)] w-max bg-bv-surface border border-bv-border rounded-lg shadow-lg overflow-hidden flex flex-col z-[9999]",style:m!==void 0?{left:`${m}px`}:void 0,children:[i.jsxs("div",{className:"px-3 py-1.5 border-b border-bv-border text-[11px] font-semibold text-bv-text-mid uppercase tracking-wide",children:[e," (",t,")"]}),i.jsx("div",{className:"flex-1 overflow-auto",children:n.length===0?i.jsx("div",{className:"px-3 py-2 text-[11px] text-bv-muted italic",children:"No patches"}):n.map(p=>{var j,E,A;const g="kind"in p&&p.kind==="message",y="kind"in p&&p.kind==="design",x="kind"in p&&p.kind==="component-drop",k="kind"in p&&p.kind==="text-change",C="kind"in p&&p.kind==="bug-report";return i.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-b border-bv-border last:border-b-0 group",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[!g&&!y&&!x&&!k&&!C&&((j=p.component)==null?void 0:j.name)&&i.jsx("div",{className:"text-[10px] text-bv-muted truncate",children:p.component.name}),C?i.jsxs("div",{className:"text-[11px] text-bv-text",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{children:"🐛"}),i.jsx("span",{className:"font-semibold",children:"Bug Report"})]}),"bugDescription"in p&&p.bugDescription&&i.jsx("div",{className:"text-[10px] text-bv-muted mt-0.5 whitespace-pre-wrap break-words line-clamp-3",children:p.bugDescription.slice(0,200)})]}):x?i.jsx("div",{className:"text-[11px] text-bv-text truncate",children:mx(p)}):y?i.jsxs("div",{className:"text-[11px] text-bv-text",children:[i.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[i.jsx("span",{children:"✏️"}),i.jsxs("span",{className:"truncate",children:["Drawing",(E=p.component)!=null&&E.name?` in ${p.component.name}`:""]})]}),"image"in p&&p.image&&i.jsx("img",{src:p.image,alt:"Design drawing",className:"max-w-full max-h-16 object-contain rounded border border-bv-border bg-white"})]}):g?i.jsxs("div",{className:"text-[11px] text-bv-text truncate",children:[i.jsx("span",{className:"mr-1",children:"💬"}),'"',"message"in p&&p.message||"",'"']}):k?i.jsxs("div",{className:"text-[11px] text-bv-text",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{children:"✏️"}),i.jsxs("span",{className:"truncate",children:["Text edit",(A=p.component)!=null&&A.name?` in ${p.component.name}`:""]})]}),"originalHtml"in p&&p.originalHtml&&"newHtml"in p&&p.newHtml&&i.jsxs("div",{className:"mt-0.5 text-[10px] font-mono text-bv-muted break-words",children:[i.jsx("span",{className:"line-through",children:hd(p.originalHtml,30)})," → ",i.jsx("span",{className:"text-bv-teal",children:hd(p.newHtml,30)})]})]}):i.jsx("div",{className:"text-[11px] font-mono text-bv-text truncate",children:p.originalClass?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"line-through text-bv-muted",children:p.originalClass})," → ",i.jsx("span",{className:"text-bv-teal",children:p.newClass})]}):i.jsxs("span",{className:"text-bv-teal",children:["+",p.newClass]})})]}),(l||s)&&i.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[l&&i.jsx("button",{className:"text-[10px] px-1.5 py-0.5 rounded border-none cursor-pointer bg-bv-teal text-white hover:bg-bv-teal-dark transition-colors",onClick:_=>{_.stopPropagation(),l(p.id)},title:"Commit to Agent",type:"button",children:"✓"}),s&&i.jsx("button",{className:"text-[10px] px-1.5 py-0.5 rounded border-none cursor-pointer bg-transparent text-bv-muted hover:text-bv-orange hover:bg-bv-surface-hi transition-colors",onClick:_=>{_.stopPropagation(),s(p.id)},title:"Discard",type:"button",children:"✕"})]})]},p.id)})}),S&&n.length>0&&(a||u)&&i.jsxs("div",{className:"flex gap-2 px-3 py-1.5 border-t border-bv-border",children:[a&&i.jsx("button",{className:"text-[10px] px-2 py-1 rounded border-none cursor-pointer font-semibold bg-bv-teal text-white hover:bg-bv-teal-dark transition-colors",onClick:()=>{a(),f(!1)},type:"button",children:"Commit All"}),u&&i.jsx("button",{className:"text-[10px] px-2 py-1 rounded cursor-pointer font-semibold bg-transparent border border-bv-border text-bv-text-mid hover:text-bv-orange hover:border-bv-orange transition-colors",onClick:()=>{u(),f(!1)},type:"button",children:"Discard All"})]})]})]})}function gx(e){return e==="click"||e==="navigation"||e==="page-load"||e==="error"}function md(e){const t=[];let n=null;for(const r of e)gx(r.trigger)?(n={primary:r,secondaries:gd(r),checked:!1},t.push(n)):n?yx(n,r):(n={primary:{...r,trigger:r.trigger},secondaries:gd(r),checked:!1},t.push(n));return t}function gd(e){const t=[];return e.trigger==="mutation"&&t.push({type:"mutations",label:"1 mutation",checked:!0,count:1}),e.isKeyframe&&t.push({type:"screenshot",label:"screenshot",checked:!0}),e.networkErrorCount>0&&t.push({type:"network",label:`${e.networkErrorCount} network error${e.networkErrorCount>1?"s":""}`,checked:!0,count:e.networkErrorCount}),e.consoleErrorCount>0&&t.push({type:"logs",label:`${e.consoleErrorCount} log${e.consoleErrorCount>1?"s":""} (${e.consoleErrorCount} error${e.consoleErrorCount>1?"s":""})`,checked:!0,count:e.consoleErrorCount,errorCount:e.consoleErrorCount}),t}function yx(e,t){const n=e.secondaries.find(r=>r.type==="mutations");if(t.trigger==="mutation"&&(n?(n.count=(n.count??0)+1,n.label=`${n.count} mutation${n.count>1?"s":""}`):e.secondaries.push({type:"mutations",label:"1 mutation",checked:!0,count:1})),t.isKeyframe&&!e.secondaries.some(r=>r.type==="screenshot")&&e.secondaries.push({type:"screenshot",label:"screenshot",checked:!0}),t.networkErrorCount>0){const r=e.secondaries.find(o=>o.type==="network");r?(r.count=(r.count??0)+t.networkErrorCount,r.label=`${r.count} network error${r.count>1?"s":""}`):e.secondaries.push({type:"network",label:`${t.networkErrorCount} network error${t.networkErrorCount>1?"s":""}`,checked:!0,count:t.networkErrorCount})}if(t.consoleErrorCount>0){const r=e.secondaries.find(o=>o.type==="logs");r?(r.count=(r.count??0)+t.consoleErrorCount,r.errorCount=(r.errorCount??0)+t.consoleErrorCount,r.label=`${r.count} log${r.count>1?"s":""} (${r.errorCount} error${r.errorCount>1?"s":""})`):e.secondaries.push({type:"logs",label:`${t.consoleErrorCount} log${t.consoleErrorCount>1?"s":""} (${t.consoleErrorCount} error${t.consoleErrorCount>1?"s":""})`,checked:!0,count:t.consoleErrorCount,errorCount:t.consoleErrorCount})}}function xx(e,t){const n=(new Date(t).getTime()-new Date(e).getTime())/1e3;if(Math.abs(n)<1)return"0s";const r=Math.round(Math.abs(n));return r>=120?`−${Math.round(r/60)}m`:`−${r}s`}function Pi(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}const yd={click:"bg-[rgba(0,132,139,0.15)] text-[#5fd4da]",navigation:"bg-[rgba(168,85,247,0.12)] text-[#c084fc]","page-load":"bg-[rgba(59,130,246,0.12)] text-[#60a5fa]",error:"bg-[rgba(239,68,68,0.12)] text-[#f87171]",mutation:"bg-[rgba(255,255,255,0.06)] text-[#999]"};function vx({trigger:e}){const t=yd[e]??yd.mutation;return i.jsx("span",{className:`text-[9px] px-1.5 rounded-[3px] font-semibold tracking-[0.2px] mr-1.5 shrink-0 leading-[1.4] ${t}`,children:e})}function bx({checked:e,onChange:t}){return i.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),t()},className:`w-4 h-4 rounded-[3px] border-[1.5px] flex items-center justify-center shrink-0 cursor-pointer transition-all duration-[120ms] mr-2 ${e?"border-[#00848B] bg-[rgba(0,132,139,0.12)] text-[#00848B]":"border-[#666] bg-transparent text-transparent"}`,children:e&&i.jsx("span",{className:"text-[9px]",children:"✓"})})}function wx({checked:e,visible:t,onChange:n}){return t?i.jsx("button",{type:"button",onClick:r=>{r.stopPropagation(),n()},className:`w-3.5 h-3.5 rounded-[3px] border-[1.5px] flex items-center justify-center shrink-0 cursor-pointer transition-all duration-[120ms] mr-1.5 ${e?"border-[#00848B] bg-[rgba(0,132,139,0.12)] text-[#00848B]":"border-[#666] bg-transparent text-transparent"}`,children:e&&i.jsx("span",{className:"text-[8px]",children:"✓"})}):i.jsx("div",{className:"w-3.5 h-3.5 mr-1.5 shrink-0"})}function Sx({onSubmit:e}){const[t,n]=w.useState([]),[r,o]=w.useState(""),[l,s]=w.useState(null),[a,u]=w.useState(!1),[c,f]=w.useState(!1),h=w.useRef(null),d=w.useRef(null);w.useEffect(()=>(fe("overlay",{type:"RECORDING_GET_HISTORY"}),bs(k=>{if(k.type==="RECORDING_HISTORY"){const C=md(k.snapshots),j=Math.max(0,C.length-3);for(let E=j;E<C.length;E++)C[E].checked=!0;n(C)}else k.type==="RECORDING_SNAPSHOT_META"?n(C=>{const j=Cx(C);return j.push(k.meta),md(j)}):k.type==="BUG_REPORT_ELEMENT_PICKED"?(s(k.element),u(!1)):k.type==="BUG_REPORT_PICK_CANCELLED"&&u(!1)})),[]),w.useEffect(()=>{h.current&&(h.current.scrollTop=h.current.scrollHeight)},[t.length]);const m=w.useCallback((x,k)=>{n(C=>{const j=C.map(E=>({...E,secondaries:E.secondaries.map(A=>({...A}))}));if(k&&d.current!==null){const E=Math.min(d.current,x),A=Math.max(d.current,x);for(let _=E;_<=A;_++)j[_].checked=!0,j[_].secondaries.forEach(L=>{L.checked=!0})}else j[x].checked=!j[x].checked,j[x].checked&&j[x].secondaries.forEach(E=>{E.checked=!0});return d.current=x,j})},[]),v=w.useCallback((x,k)=>{n(C=>{const j=C.map(E=>({...E,secondaries:E.secondaries.map(A=>({...A}))}));return j[x].secondaries[k].checked=!j[x].secondaries[k].checked,j})},[]),b=()=>{a?(fe("overlay",{type:"BUG_REPORT_PICK_CANCELLED"}),u(!1)):(fe("overlay",{type:"BUG_REPORT_PICK_ELEMENT"}),u(!0))},S=t.filter(x=>x.checked).length,p=S>0&&r.trim().length>0&&!c,g=async()=>{var G,Q,q;if(!p)return;f(!0);const x=t.filter(T=>T.checked).map(T=>T.primary.id);fe("overlay",{type:"RECORDING_GET_RANGE",ids:x});const C=await new Promise(T=>{const R=bs(P=>{P.type==="RECORDING_RANGE"&&(R(),T(P.snapshots))});setTimeout(()=>{R(),T([])},1e4)}),j=t.filter(T=>T.checked),E=j.some(T=>T.secondaries.some(R=>R.type==="screenshot"&&R.checked)),A=j.some(T=>T.secondaries.some(R=>R.type==="logs"&&R.checked)),_=j.some(T=>T.secondaries.some(R=>R.type==="network"&&R.checked)),L=[],B=[];for(const T of C){const R={timestamp:T.timestamp,trigger:T.trigger,url:T.url};A&&((G=T.consoleLogs)!=null&&G.length)&&(R.consoleLogs=T.consoleLogs),_&&((Q=T.networkErrors)!=null&&Q.length)&&(R.networkErrors=T.networkErrors),T.domSnapshot&&(R.domSnapshot=T.domSnapshot.slice(0,5e4)),T.domDiff&&(R.domDiff=T.domDiff.slice(0,1e4)),(q=T.domChanges)!=null&&q.length&&(R.domChanges=T.domChanges),E&&T.screenshot&&(B.push(T.screenshot),R.hasScreenshot=!0),T.elementInfo&&(R.elementInfo=T.elementInfo),T.navigationInfo&&(R.navigationInfo=T.navigationInfo),L.push(R)}const H=j.map(T=>T.primary.timestamp),D={start:H[0]??new Date().toISOString(),end:H[H.length-1]??new Date().toISOString()};e({bugDescription:r.trim(),bugScreenshots:E?B.slice(0,5):[],bugTimeline:L,bugTimeRange:D,bugElement:l}),o(""),s(null),n(T=>T.map(R=>({...R,checked:!1,secondaries:R.secondaries.map(P=>({...P,checked:!0}))}))),f(!1)},y=t.length>0?t[t.length-1].primary.timestamp:new Date().toISOString();return i.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[i.jsx("div",{ref:h,className:"flex-1 overflow-y-auto border-b border-bv-border",children:t.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 p-8 text-center",children:[i.jsx("div",{className:"text-[11px] text-bv-muted",children:"No recording events yet"}),i.jsx("div",{className:"text-[10px] text-bv-muted/60",children:"Interact with the page to start recording events."})]}):t.map((x,k)=>i.jsxs("div",{className:`border-b border-white/[0.03] ${x.checked?"bg-[rgba(0,132,139,0.12)] border-l-2 border-l-[#00848B]":""}`,children:[i.jsxs("div",{className:"flex items-center px-2.5 py-1.5 cursor-pointer hover:bg-white/[0.025] transition-colors duration-[120ms]",onClick:C=>m(k,C.shiftKey),children:[i.jsx("span",{className:"w-9 shrink-0 text-right pr-1.5 font-mono text-[10px] text-bv-muted font-medium",title:Pi(x.primary.timestamp),children:k===t.length-1?"0s":xx(x.primary.timestamp,y)}),i.jsx(bx,{checked:x.checked,onChange:()=>m(k,!1)}),i.jsx(vx,{trigger:x.primary.trigger}),i.jsxs("span",{className:"text-[11px] text-bv-text flex-1 min-w-0 truncate",children:[x.primary.trigger==="click"&&x.primary.elementInfo&&i.jsxs(i.Fragment,{children:["on ",i.jsxs("span",{className:"font-mono text-[10px] text-bv-text-mid",children:["<",x.primary.elementInfo.tag,">"]}),x.primary.elementInfo.componentName&&i.jsxs(i.Fragment,{children:[" ","in ",i.jsxs("span",{className:"font-mono text-[10px] text-bv-text-mid",children:["<",x.primary.elementInfo.componentName,">"]})]})]}),x.primary.trigger==="page-load"&&i.jsx("span",{className:"font-mono text-[10px] text-bv-text-mid",children:x.primary.url}),x.primary.trigger==="navigation"&&i.jsx("span",{className:"font-mono text-[10px] text-bv-text-mid",children:x.primary.url}),x.primary.trigger==="error"&&i.jsxs("span",{className:"text-[#f87171]",children:[x.primary.consoleErrorCount," error",x.primary.consoleErrorCount>1?"s":""]})]}),x.primary.isKeyframe&&i.jsx("span",{className:"text-[8px] text-[#00848B] font-bold ml-1 shrink-0",children:"◆"})]}),x.secondaries.map((C,j)=>i.jsxs("div",{className:`flex items-center px-2.5 py-0.5 transition-opacity duration-[120ms] ${x.checked&&!C.checked?"opacity-30":""} ${j===x.secondaries.length-1?"pb-[5px]":""}`,children:[i.jsx("span",{className:"w-9 shrink-0"}),i.jsx("span",{className:"w-3 shrink-0"}),i.jsx(wx,{checked:C.checked,visible:x.checked,onChange:()=>v(k,j)}),i.jsxs("span",{className:`text-[10px] text-bv-text-mid flex-1 min-w-0 truncate ${x.checked&&!C.checked?"line-through decoration-white/25":""}`,children:[C.type==="network"&&C.networkStatus&&i.jsxs("span",{className:`font-bold ${C.networkStatus>=400?"text-[#ef4444]":"text-[#2E7229]"}`,children:[C.networkStatus," "]}),C.type==="logs"&&C.errorCount&&C.errorCount>0&&i.jsxs("span",{className:"text-[#f87171] font-semibold",children:[C.errorCount," error",C.errorCount>1?"s":""," "]}),C.label]})]},`${x.primary.id}-${C.type}-${j}`))]},x.primary.id))}),i.jsxs("div",{className:"px-3 py-2.5 flex flex-col gap-2",children:[i.jsxs("div",{className:"text-[10px] text-bv-text-mid",children:[i.jsx("span",{className:"font-bold text-[#00848B]",children:S})," event",S!==1?"s":""," selected",S>0&&(()=>{const x=t.filter(j=>j.checked),k=Pi(x[0].primary.timestamp),C=Pi(x[x.length-1].primary.timestamp);return i.jsxs("span",{className:"text-bv-muted font-mono text-[9px] ml-1.5",children:[k," – ",C]})})()]}),i.jsx("textarea",{value:r,onChange:x=>o(x.target.value),placeholder:"Describe the bug…",className:"w-full min-h-[48px] max-h-[140px] px-2.5 py-2 rounded-md border border-bv-border bg-bv-surface text-bv-text text-[11px] leading-[1.5] resize-none outline-none transition-colors duration-[120ms] focus:border-[#00848B] placeholder:text-[#666] overflow-y-auto",style:{fieldSizing:"content"}}),i.jsx("div",{className:"flex items-center gap-1.5",children:l?i.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0 px-2 py-1 rounded bg-bv-surface border border-bv-border font-mono text-[10px] text-bv-text",children:[i.jsxs("span",{className:"text-[#00848B] font-semibold",children:["<",l.tag,">"]}),l.id&&i.jsxs("span",{className:"text-bv-muted",children:["#",l.id]}),l.componentName&&i.jsx("span",{className:"text-[9px] text-bv-text-mid bg-[rgba(0,132,139,0.1)] px-1 rounded-[2px] font-medium font-sans",children:l.componentName}),i.jsx("button",{type:"button",onClick:()=>s(null),className:"w-3.5 h-3.5 rounded-[3px] border-none bg-white/[0.08] text-bv-muted text-[9px] flex items-center justify-center cursor-pointer ml-auto hover:bg-white/15 hover:text-bv-text",children:"✕"})]}):i.jsxs("button",{type:"button",onClick:b,className:`flex items-center gap-[5px] px-2.5 py-[5px] rounded-md border border-dashed text-[10px] font-medium cursor-pointer transition-all duration-[120ms] whitespace-nowrap ${a?"border-[#00848B] text-[#00848B] bg-[rgba(0,132,139,0.12)]":"border-bv-border text-bv-text-mid bg-transparent hover:border-[#00848B] hover:text-[#00848B] hover:bg-[rgba(0,132,139,0.12)]"}`,children:[i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",className:"shrink-0",children:[i.jsx("path",{d:"M14,0H2C.895,0,0,.895,0,2V14c0,1.105,.895,2,2,2H6c.552,0,1-.448,1-1h0c0-.552-.448-1-1-1H2V2H14V6c0,.552,.448,1,1,1h0c.552,0,1-.448,1-1V2c0-1.105-.895-2-2-2Z"}),i.jsx("path",{d:"M12.043,10.629l2.578-.644c.268-.068,.43-.339,.362-.607-.043-.172-.175-.308-.345-.358l-7-2c-.175-.051-.363-.002-.492,.126-.128,.129-.177,.317-.126,.492l2,7c.061,.214,.257,.362,.48,.362h.009c.226-.004,.421-.16,.476-.379l.644-2.578,3.664,3.664c.397,.384,1.03,.373,1.414-.025,.374-.388,.374-1.002,0-1.389l-3.664-3.664Z"})]}),a?"Click an element…":"Pick Element"]})}),i.jsxs("button",{type:"button",onClick:g,disabled:!p,className:`flex items-center justify-center gap-1.5 w-full py-2 rounded-md border-none text-[11px] font-semibold cursor-pointer transition-all duration-[120ms] ${p?"bg-[#F5532D] text-white hover:bg-[#e04420]":"bg-bv-surface text-[#555] cursor-not-allowed"}`,children:[i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[i.jsx("path",{d:"M11.5,6C11.5,4.067,9.933,2.5,8,2.5S4.5,4.067,4.5,6v1h7V6Z"}),i.jsx("rect",{x:"3",y:"8",width:"10",height:"6",rx:"2"}),i.jsx("path",{d:"M1,7.5h2v2H1c-.552,0-1-.448-1-1s.448-1,1-1Z"}),i.jsx("path",{d:"M13,7.5h2c.552,0,1,.448,1,1s-.448,1-1,1h-2v-2Z"}),i.jsx("rect",{x:"7",y:"9",width:"2",height:"4",rx:".5"})]}),"Commit Bug Report"]})]})]})}function Cx(e){return e.map(t=>t.primary)}function xd({tabs:e,activeTab:t,onTabChange:n}){const[r,o]=w.useState(null);return i.jsx("div",{className:"relative flex border-b border-bv-border px-3",children:e.map(l=>{const s=l.id===t,a=l.disabled===!0;return i.jsxs("div",{className:"relative",onMouseEnter:()=>a&&l.tooltip&&o(l.id),onMouseLeave:()=>o(null),children:[i.jsxs("button",{type:"button",className:`relative px-3 py-2 text-[11px] font-medium font-[family-name:var(--font-ui)] border-none bg-transparent cursor-pointer transition-colors ${a?"text-bv-muted cursor-not-allowed":s?"text-bv-text":"text-bv-text-mid hover:text-bv-text"}`,disabled:a,onClick:()=>!a&&n(l.id),"aria-selected":s,role:"tab",children:[l.label,s&&i.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-bv-teal"})]}),r===l.id&&l.tooltip&&i.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 mt-1 px-2 py-1 text-[10px] text-white bg-bv-text rounded whitespace-nowrap z-[9999]",children:l.tooltip})]},l.id)})})}function kx(){const[e,t]=w.useState([]),[n,r]=w.useState({draft:0,committed:0,implementing:0,implemented:0,partial:0,error:0}),[o,l]=w.useState({draft:[],commits:[]}),[s,a]=w.useState(!1),u=w.useRef(e);u.current=e;const c=w.useRef(o);c.current=o;const f=w.useCallback((E,A)=>{fe("overlay",{type:"PATCH_PREVIEW",oldClass:E,newClass:A})},[]),h=w.useCallback(E=>{fe("overlay",{type:"PATCH_PREVIEW_BATCH",pairs:E})},[]),d=w.useCallback(()=>{fe("overlay",{type:"PATCH_REVERT"})},[]),m=w.useCallback((E,A,_,L)=>{if(L===_){t(H=>{const D=H.find(G=>G.kind==="class-change"&&G.elementKey===E&&G.property===A);return D&&D.kind==="class-change"&&D.newClass!==_?fe("overlay",{type:"PATCH_REVERT_STAGED",oldClass:D.newClass,newClass:_}):fe("overlay",{type:"PATCH_REVERT"}),H.filter(G=>!(G.kind==="class-change"&&G.elementKey===E&&G.property===A))});return}const B=crypto.randomUUID();t(H=>{const D=H.filter(Q=>!(Q.kind==="class-change"&&Q.elementKey===E&&Q.property===A)),G={id:B,kind:"class-change",elementKey:E,status:"staged",originalClass:_,newClass:L,property:A,timestamp:new Date().toISOString()};return[...D,G]}),fe("overlay",{type:"PATCH_STAGE",id:B,oldClass:_,newClass:L,property:A})},[]),v=w.useCallback((E,A,_)=>{const L=crypto.randomUUID(),B=_?{name:_}:void 0;t(H=>{const D={id:L,kind:"message",elementKey:A,status:"staged",originalClass:"",newClass:"",property:"",timestamp:new Date().toISOString(),message:E,component:B};return[...H,D]}),Nn(B?{type:"MESSAGE_STAGE",id:L,message:E,elementKey:A,component:B}:{type:"MESSAGE_STAGE",id:L,message:E,elementKey:A})},[]),b=w.useCallback(()=>{const E=c.current.draft.map(L=>L.id),A=u.current.filter(L=>L.status==="staged").map(L=>L.id),_=Array.from(new Set([...E,...A]));_.length!==0&&(Nn({type:"PATCH_COMMIT",ids:_}),t([]))},[]),S=w.useCallback(E=>{t(A=>A.filter(_=>_.id!==E)),Nn({type:"DISCARD_DRAFTS",ids:[E]}),fe("overlay",{type:"PATCH_REVERT"})},[]),p=w.useCallback(()=>{const E=c.current.draft.map(L=>L.id),A=u.current.filter(L=>L.status==="staged").map(L=>L.id),_=Array.from(new Set([...E,...A]));t([]),_.length>0&&Nn({type:"DISCARD_DRAFTS",ids:_}),fe("overlay",{type:"PATCH_REVERT"})},[]),g=w.useCallback(E=>{const A=c.current.commits.find(_=>_.status==="committed"&&_.patches.some(L=>L.id===E));A&&Nn({type:"DISCARD_COMMIT",commitId:A.id})},[]),y=w.useCallback(()=>{},[]),x=w.useCallback(E=>{r({draft:E.draftCount,committed:E.committedCount,implementing:E.implementingCount,implemented:E.implementedCount,partial:E.partialCount,error:E.errorCount}),l({draft:E.draft,commits:E.commits}),a(!!E.agentWaiting)},[]),k=w.useCallback(E=>{r({draft:E.staged,committed:E.committed,implementing:E.implementing,implemented:E.implemented,partial:0,error:0})},[]),C=e.filter(E=>E.status==="staged").length,j={draft:Math.max(C,n.draft),committed:n.committed,implementing:n.implementing,implemented:n.implemented,partial:n.partial,error:n.error};return{patches:e,counts:j,queueState:o,agentWaiting:s,preview:f,previewBatch:h,revertPreview:d,stage:m,stageMessage:v,commitAll:b,discard:S,discardAll:p,discardCommit:g,reset:y,handleQueueUpdate:x,handlePatchUpdate:k}}const Gu=["none","2xs","xs","sm","md","lg","xl","2xl"],vh=["none","2xs","xs","sm"],Ka=["0","1","2","4","8"],Yu=["none","2xs","xs","sm","md","lg"],Ss=new Set(Gu),Cs=new Set(vh),Jr=new Set(Ka),ks=new Set(Yu),Ex=["text-xs","text-sm","text-base","text-lg","text-xl","text-2xl","text-3xl","text-4xl","text-5xl","text-6xl","text-7xl","text-8xl","text-9xl"],jx=["font-thin","font-extralight","font-light","font-normal","font-medium","font-semibold","font-bold","font-extrabold","font-black"],Tx=["leading-none","leading-tight","leading-snug","leading-normal","leading-relaxed","leading-loose","leading-3","leading-4","leading-5","leading-6","leading-7","leading-8","leading-9","leading-10"],Nx=["tracking-tighter","tracking-tight","tracking-normal","tracking-wide","tracking-wider","tracking-widest"],Rx=Array.from({length:21},(e,t)=>`opacity-${t*5}`),bh=["none","sm","","md","lg","xl","2xl","3xl","full"],Fa=bh.map(e=>e?`rounded-${e}`:"rounded");function Px(e){return bh.map(t=>t?`${e}-${t}`:e)}const wh=["0","","2","3","4","5","6","8","10","12","16","20","24","32","40","48","56","64"],_x=["solid","dashed","dotted","double","hidden","none"],Ha=["0","px","0.5","1","1.5","2","2.5","3","3.5","4","5","6","7","8","9","10","11","12","14","16","20","24","28","32","36","40","44","48","52","56","60","64","72","80","96"],Ix=["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],Ax=["50","100","200","300","400","500","600","700","800","900","950"];function te(){return e=>e===""?{props:{}}:null}function De(e,t){const n=new Set(t);return r=>n.has(r)?{props:{[e]:r}}:null}function wt(e="color"){return t=>t!==""?{props:{[e]:t}}:null}function Z(e,t="scale"){return n=>n!==""?{props:{[t]:n,scaleName:e}}:null}const Lx=["t","r","b","l","x","y"],_i=["t","r","b","l","x","y","s","e","bs","be"];function _e(...e){return t=>{for(const n of e){const r=n(t);if(r)return r}return null}}function F(e,t){return{prefix:e,segment:t}}function Xt(e,t){return t.map(n=>({...n,section:e}))}function Ii(e,t,n=Lx){return[...n.map(o=>({prefix:e+o,segment:t,canonical:e,extraProps:{side:o}})),{prefix:e,segment:t}]}function Dx(e,t){const n=["tl","tr","br","bl"],r=["t","r","b","l"],o=n.map(s=>({prefix:e+"-"+s,segment:t,canonical:e,extraProps:{corner:s}})),l=r.map(s=>({prefix:e+"-"+s,segment:t,canonical:e,extraProps:{side:s}}));return[...o,...l,{prefix:e,segment:_e(te(),t)}]}function vd(e,t){const n=new Set(t);return{prefix:e,segment:te(),matches:r=>n.has(r)?{props:{value:r}}:null}}function Ox(e,t){for(const n of t){const{prefix:r,matches:o,segment:l,canonical:s,section:a,extraProps:u}=n;if(o){const h=o(e);if(!h)continue;const d={property:s??r,fullClass:e};if(a&&(d.section=a),u)for(const[m,v]of Object.entries(u))d[m]=v;for(const[m,v]of Object.entries(h.props))d[m]=v;return d}let c;if(e===r)c="";else if(e.startsWith(r+"-"))c=e.slice(r.length+1);else continue;const f=l(c);if(f){const h={property:s??r,fullClass:e};if(a&&(h.section=a),u)for(const[d,m]of Object.entries(u))h[d]=m;for(const[d,m]of Object.entries(f.props))h[d]=m;return h}return{property:s??r,fullClass:e,unknown:!0}}return null}function Mx(e,t){const n=e.trim().split(/\s+/).filter(Boolean),r=[];for(const o of n){const l=Ox(o,t);l&&r.push(l)}return r}const $x=["solid","dashed","dotted","double","none","hidden"],zx=["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],Kx=["xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"],Fx=["tighter","tight","normal","wide","wider","widest"],Hx=["left","center","right","justify","start","end"],Wx=["inline-block","inline-grid","inline-flex","inline","flow-root","block","flex","grid","contents","hidden","table-header-group","table-footer-group","table-row-group","table-column-group","table-caption","table-column","table-row","table-cell","table"],Bx=["static","relative","absolute","fixed","sticky"],Vx=["t","tr","r","br","b","bl","l","tl"],Ux=["start","end","end-safe","center","center-safe","between","around","evenly","stretch","baseline","normal"],Gx=["start","end","end-safe","center","center-safe","baseline","baseline-last","stretch"],Yx=["normal","start","end","center","between","around","evenly","baseline","stretch"],Qx=["start","end","center","stretch"],Xx=["auto","start","end","center","stretch","baseline"],Zx=[...Xt("spacing",[...Ii("m",Z("spacing"),_i),...Ii("-m",Z("spacing"),_i),...Ii("p",Z("spacing"),_i),F("gap-x",Z("spacing")),F("gap-y",Z("spacing")),F("gap",Z("spacing")),F("space-x-reverse",te()),F("space-y-reverse",te()),F("space-x",Z("spacing")),F("space-y",Z("spacing"))]),...Xt("sizing",[F("min-w",Z("spacing")),F("max-w",Z("spacing")),F("min-h",Z("spacing")),F("max-h",Z("spacing")),F("size",Z("spacing")),F("w",Z("spacing")),F("h",Z("spacing"))]),...Xt("typography",[F("font-sans",te()),F("font-serif",te()),F("font-mono",te()),F("font",De("scale",zx)),F("text-shadow",_e(De("size",Yu),wt())),F("text",_e(De("align",Hx),e=>Kx.includes(e)?{props:{size:e,scaleName:"fontSize"}}:null,wt())),F("leading",_e(De("scale",["none"]),Z("spacing"))),F("tracking",De("scale",Fx)),F("italic",te()),F("not-italic",te()),F("underline",te()),F("line-through",te()),F("overline",te()),F("no-underline",te()),F("uppercase",te()),F("lowercase",te()),F("capitalize",te()),F("normal-case",te()),F("truncate",te()),F("align-text-top",te()),F("align-text-bottom",te()),F("align-baseline",te()),F("align-top",te()),F("align-middle",te()),F("align-bottom",te()),F("align-sub",te()),F("align-super",te())]),...Xt("color",[F("bg-gradient-to",De("direction",Vx)),F("bg",wt()),F("from",wt()),F("via",wt()),F("to",wt()),F("ring",wt()),F("outline",_e(De("style",["solid","dashed","dotted","double","none"]),wt())),F("fill",wt()),F("stroke",wt()),F("decoration",wt())]),...Xt("borders",[{prefix:"border-bs",segment:_e(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"bs"}},{prefix:"border-be",segment:_e(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"be"}},{prefix:"border-x",segment:_e(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"x"}},{prefix:"border-y",segment:_e(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"y"}},{prefix:"border-s",segment:_e(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"s"}},{prefix:"border-e",segment:_e(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"e"}},{prefix:"border-t",segment:_e(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"t"}},{prefix:"border-r",segment:_e(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"r"}},{prefix:"border-b",segment:_e(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"b"}},{prefix:"border-l",segment:_e(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"l"}},F("border",_e(te(),De("style",$x),e=>/^\d+$/.test(e)||e==="px"?{props:{scale:e,scaleName:"borderWidth"}}:null,wt())),...Dx("rounded",Z("borderRadius"))]),...Xt("effects",[F("opacity",Z("opacity")),F("shadow",De("size",Gu))]),...Xt("layout",[vd("display",Wx),vd("position",Bx),{prefix:"inset-bs",segment:Z("spacing"),canonical:"inset",extraProps:{side:"bs"}},{prefix:"inset-be",segment:Z("spacing"),canonical:"inset",extraProps:{side:"be"}},{prefix:"inset-x",segment:Z("spacing"),canonical:"inset",extraProps:{side:"x"}},{prefix:"inset-y",segment:Z("spacing"),canonical:"inset",extraProps:{side:"y"}},{prefix:"inset-s",segment:Z("spacing"),canonical:"inset",extraProps:{side:"s"}},{prefix:"inset-e",segment:Z("spacing"),canonical:"inset",extraProps:{side:"e"}},{prefix:"top",segment:Z("spacing"),canonical:"inset",extraProps:{side:"top"}},{prefix:"right",segment:Z("spacing"),canonical:"inset",extraProps:{side:"right"}},{prefix:"bottom",segment:Z("spacing"),canonical:"inset",extraProps:{side:"bottom"}},{prefix:"left",segment:Z("spacing"),canonical:"inset",extraProps:{side:"left"}},{prefix:"start",segment:Z("spacing"),canonical:"inset",extraProps:{side:"start"}},{prefix:"end",segment:Z("spacing"),canonical:"inset",extraProps:{side:"end"}},F("inset",Z("spacing")),F("z",Z("zIndex"))]),...Xt("flexbox",[F("flex-row-reverse",te()),F("flex-col-reverse",te()),F("flex-wrap-reverse",te()),F("flex-row",te()),F("flex-col",te()),F("flex-wrap",te()),F("flex-nowrap",te()),F("flex",_e(te(),De("value",["auto","initial","none"]),Z("number"))),F("grow",_e(te(),Z("number"))),F("shrink",_e(te(),Z("number"))),F("justify-items",De("value",Qx)),F("justify",De("value",Ux)),F("items",De("value",Gx)),F("content",De("value",Yx)),F("self",De("value",Xx)),F("basis",Z("spacing")),F("grid-cols",_e(De("value",["none","subgrid"]),Z("gridCols"))),F("grid-rows",_e(De("value",["none","subgrid"]),Z("gridRows"))),F("col-span",Z("colSpan")),F("row-span",Z("rowSpan")),F("order",Z("order"))]),...Xt("overflow",[F("overflow-x",De("value",["auto","hidden","clip","visible","scroll"])),F("overflow-y",De("value",["auto","hidden","clip","visible","scroll"])),F("overflow",De("value",["auto","hidden","clip","visible","scroll"]))])],qx=[{id:"design",label:"Design"},{id:"replace",label:"Replace"}],Jx=[{id:"place",label:"Place"}];function ev(e,t){return e==="insert"?"place":t==="component"?"replace":"design"}function tv(e){return e==="insert"?Jx:qx}function nv(e,t,n,r){return t||e==="insert"&&!n&&r}const rv={mode:null,tabPreference:"design",selectModeActive:!1,insertBrowseActive:!1,textEditing:!1,elementData:null,selectionId:0,insertPoint:null};function Wa(e,t){switch(t.type){case"MODE_CHANGE":{let n=t.mode;const r=!!t.fromOverlay,o=[];if(n===e.mode){if(e.elementData||e.insertPoint)return Rl(e,r);(e.mode==="insert"&&e.insertBrowseActive||e.mode==="select"&&e.selectModeActive)&&(n=null)}const l={...e,elementData:null,selectionId:e.selectionId+1,textEditing:!1,insertPoint:null,mode:n};return n===null?(l.selectModeActive=!1,l.insertBrowseActive=!1,r||o.push({kind:"sendToOverlay",message:{type:"CANCEL_MODE"}}),{state:l,effects:o}):(n==="insert"?(l.tabPreference=e.tabPreference==="design"?"component":e.tabPreference,l.insertBrowseActive=!0):l.insertBrowseActive=!1,n==="select"&&e.mode!=="select"&&(l.tabPreference="design"),r||o.push({kind:"sendToOverlay",message:{type:"MODE_CHANGED",mode:n}}),l.selectModeActive=n==="select",{state:l,effects:o})}case"TAB_CHANGE":{const n=[],r={...e};return t.tab==="replace"||t.tab==="place"?r.tabPreference="component":t.tab==="design"&&(r.tabPreference="design"),t.fromOverlay||n.push({kind:"sendToOverlay",message:{type:"TAB_CHANGED",tab:t.tab}}),{state:r,effects:n}}case"DESELECT_AND_REENTER":return Rl(e,!!t.fromOverlay);case"ESCAPE":return e.elementData||e.insertPoint?Rl(e,!1):e.mode!==null?{state:{...e,mode:null,selectModeActive:!1,insertBrowseActive:!1,insertPoint:null},effects:[{kind:"sendToOverlay",message:{type:"CANCEL_MODE"}}]}:{state:e,effects:[]};case"WS_RESET_SELECTION":return{state:{...e,elementData:null,selectionId:e.selectionId+1,textEditing:!1,insertPoint:null,selectModeActive:!1,insertBrowseActive:!1,mode:null},effects:[]};case"WS_DESELECT_ELEMENT":return Rl(e,!0);case"WS_ELEMENT_SELECTED":return{state:{...e,elementData:t.elementData,selectionId:e.selectionId+1,selectModeActive:!1,mode:e.mode??"select"},effects:[]};case"WS_SELECT_MODE_CHANGED":return{state:{...e,selectModeActive:t.active},effects:[]};case"WS_MODE_CHANGED":return Wa(e,{type:"MODE_CHANGE",mode:t.mode,fromOverlay:!0});case"WS_TAB_CHANGED":return Wa(e,{type:"TAB_CHANGE",tab:t.tab,fromOverlay:!0});case"WS_TEXT_EDIT_ACTIVE":return{state:{...e,textEditing:!0},effects:[]};case"WS_TEXT_EDIT_DONE":return{state:{...e,textEditing:!1},effects:[]};case"WS_INSERT_POINT_LOCKED":return{state:{...e,insertPoint:{position:t.position,targetName:t.targetName},insertBrowseActive:!1},effects:[]};case"WS_COMPONENT_DISARMED":return{state:{...e,elementData:null,selectionId:e.selectionId+1,selectModeActive:!1,insertBrowseActive:!1,insertPoint:null},effects:[]};default:return{state:e,effects:[]}}}function Rl(e,t){const n=[],r={...e,elementData:null,selectionId:e.selectionId+1,textEditing:!1,insertPoint:null};return t||(n.push({kind:"sendToOverlay",message:{type:"CLEAR_HIGHLIGHTS",deselect:!0}}),e.mode==="select"?(r.selectModeActive=!0,n.push({kind:"sendToOverlay",message:{type:"TOGGLE_SELECT_MODE",active:!0}})):e.mode==="insert"&&(r.insertBrowseActive=!0,n.push({kind:"sendToOverlay",message:{type:"MODE_CHANGED",mode:"insert"}}))),{state:r,effects:n}}function bd(e){for(const t of e.current)t.kind==="sendToOverlay"&&fe("overlay",t.message);e.current=[]}function ov(){const e=w.useRef([]),t=w.useCallback((l,s)=>{const{state:a,effects:u}=Wa(l,s);return e.current=u,a},[]),[n,r]=w.useReducer(t,rv);w.useEffect(()=>{bd(e)});const o=w.useCallback(l=>{r(l),bd(e)},[r]);return{state:n,dispatch:o}}function lv(){const{state:e,dispatch:t}=ov();w.useEffect(()=>{const u=c=>{c.key==="Escape"&&t({type:"ESCAPE"})};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[t]);const n=w.useCallback((u,c=!1)=>{t({type:"MODE_CHANGE",mode:u,fromOverlay:c})},[t]),r=w.useCallback((u,c=!1)=>{t({type:"TAB_CHANGE",tab:u,fromOverlay:c})},[t]),o=w.useCallback(u=>{switch(u.type){case"RESET_SELECTION":return t({type:"WS_RESET_SELECTION"}),!0;case"DESELECT_ELEMENT":return t({type:"WS_DESELECT_ELEMENT"}),!0;case"ELEMENT_SELECTED":return t({type:"WS_ELEMENT_SELECTED",elementData:{componentName:u.componentName,instanceCount:u.instanceCount,classes:u.classes,parsedClasses:Mx(u.classes,Zx),tailwindConfig:u.tailwindConfig}}),!0;case"SELECT_MODE_CHANGED":return t({type:"WS_SELECT_MODE_CHANGED",active:!!u.active}),!0;case"MODE_CHANGED":return t({type:"WS_MODE_CHANGED",mode:u.mode}),!0;case"TAB_CHANGED":return t({type:"WS_TAB_CHANGED",tab:u.tab}),!0;case"TEXT_EDIT_ACTIVE":return t({type:"WS_TEXT_EDIT_ACTIVE"}),!0;case"TEXT_EDIT_DONE":return t({type:"WS_TEXT_EDIT_DONE"}),!0;case"INSERT_POINT_LOCKED":return t({type:"WS_INSERT_POINT_LOCKED",position:u.position,targetName:u.targetName}),!0;case"COMPONENT_DISARMED":return t({type:"WS_COMPONENT_DISARMED"}),!0;default:return!1}},[t]),l=w.useMemo(()=>tv(e.mode),[e.mode]),s=w.useMemo(()=>ev(e.mode,e.tabPreference),[e.mode,e.tabPreference]),a=w.useMemo(()=>nv(e.mode,e.selectModeActive,e.insertPoint,e.insertBrowseActive),[e.mode,e.selectModeActive,e.insertPoint,e.insertBrowseActive]);return{mode:e.mode,elementData:e.elementData,selectionId:e.selectionId,insertPoint:e.insertPoint,selectModeActive:e.selectModeActive,textEditing:e.textEditing,tabPreference:e.tabPreference,currentTabs:l,activeTab:s,isPicking:a,handleModeChange:n,handleTabChange:r,handleWsMessage:o}}function Gs(){return typeof window<"u"}function oo(e){return Qu(e)?(e.nodeName||"").toLowerCase():"#document"}function ht(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Vt(e){var t;return(t=(Qu(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qu(e){return Gs()?e instanceof Node||e instanceof ht(e).Node:!1}function Ae(e){return Gs()?e instanceof Element||e instanceof ht(e).Element:!1}function Ut(e){return Gs()?e instanceof HTMLElement||e instanceof ht(e).HTMLElement:!1}function Ba(e){return!Gs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ht(e).ShadowRoot}function ol(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function sv(e){return/^(table|td|th)$/.test(oo(e))}function Ys(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const iv=/transform|translate|scale|rotate|perspective|filter/,av=/paint|layout|strict|content/,Gn=e=>!!e&&e!=="none";let Ai;function Xu(e){const t=Ae(e)?Rt(e):e;return Gn(t.transform)||Gn(t.translate)||Gn(t.scale)||Gn(t.rotate)||Gn(t.perspective)||!Qs()&&(Gn(t.backdropFilter)||Gn(t.filter))||iv.test(t.willChange||"")||av.test(t.contain||"")}function uv(e){let t=hn(e);for(;Ut(t)&&!an(t);){if(Xu(t))return t;if(Ys(t))return null;t=hn(t)}return null}function Qs(){return Ai==null&&(Ai=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ai}function an(e){return/^(html|body|#document)$/.test(oo(e))}function Rt(e){return ht(e).getComputedStyle(e)}function Xs(e){return Ae(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hn(e){if(oo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ba(e)&&e.host||Vt(e);return Ba(t)?t.host:t}function Sh(e){const t=hn(e);return an(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ut(t)&&ol(t)?t:Sh(t)}function zn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Sh(e),l=o===((r=e.ownerDocument)==null?void 0:r.body),s=ht(o);if(l){const a=Va(s);return t.concat(s,s.visualViewport||[],ol(o)?o:[],a&&n?zn(a):[])}else return t.concat(o,zn(o,[],n))}function Va(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const eo=Math.min,dt=Math.max,Es=Math.round,Pl=Math.floor,Wt=e=>({x:e,y:e}),cv={left:"right",right:"left",bottom:"top",top:"bottom"};function wd(e,t,n){return dt(e,eo(t,n))}function ll(e,t){return typeof e=="function"?e(t):e}function Hn(e){return e.split("-")[0]}function sl(e){return e.split("-")[1]}function Ch(e){return e==="x"?"y":"x"}function kh(e){return e==="y"?"height":"width"}function ln(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Eh(e){return Ch(ln(e))}function dv(e,t,n){n===void 0&&(n=!1);const r=sl(e),o=Eh(e),l=kh(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(s=js(s)),[s,js(s)]}function fv(e){const t=js(e);return[Ua(e),t,Ua(t)]}function Ua(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Sd=["left","right"],Cd=["right","left"],pv=["top","bottom"],hv=["bottom","top"];function mv(e,t,n){switch(e){case"top":case"bottom":return n?t?Cd:Sd:t?Sd:Cd;case"left":case"right":return t?pv:hv;default:return[]}}function gv(e,t,n,r){const o=sl(e);let l=mv(Hn(e),n==="start",r);return o&&(l=l.map(s=>s+"-"+o),t&&(l=l.concat(l.map(Ua)))),l}function js(e){const t=Hn(e);return cv[t]+e.slice(t.length)}function yv(e){return{top:0,right:0,bottom:0,left:0,...e}}function xv(e){return typeof e!="number"?yv(e):{top:e,right:e,bottom:e,left:e}}function Ts(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}/*!
|
|
55
|
+
* tabbable 6.4.0
|
|
56
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
57
|
+
*/var vv=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Ga=vv.join(","),jh=typeof Element>"u",Zo=jh?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ns=!jh&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Rs=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),l=o===""||o==="true",s=l||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Rs(t.parentNode));return s},bv=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},wv=function(t,n,r){if(Rs(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Ga));return n&&Zo.call(t,Ga)&&o.unshift(t),o=o.filter(r),o},Ya=function(t,n,r){for(var o=[],l=Array.from(t);l.length;){var s=l.shift();if(!Rs(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),u=a.length?a:s.children,c=Ya(u,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:s,candidates:c})}else{var f=Zo.call(s,Ga);f&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var h=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),d=!Rs(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(h&&d){var m=Ya(h===!0?s.children:h.children,!0,r);r.flatten?o.push.apply(o,m):o.push({scopeParent:s,candidates:m})}else l.unshift.apply(l,s.children)}}return o},Th=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Nh=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||bv(t))&&!Th(t)?0:t.tabIndex},Sv=function(t,n){var r=Nh(t);return r<0&&n&&!Th(t)?0:r},Cv=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Rh=function(t){return t.tagName==="INPUT"},kv=function(t){return Rh(t)&&t.type==="hidden"},Ev=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},jv=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Tv=function(t){if(!t.name)return!0;var n=t.form||Ns(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var l=jv(o,t.form);return!l||l===t},Nv=function(t){return Rh(t)&&t.type==="radio"},Rv=function(t){return Nv(t)&&!Tv(t)},Pv=function(t){var n,r=t&&Ns(t),o=(n=r)===null||n===void 0?void 0:n.host,l=!1;if(r&&r!==t){var s,a,u;for(l=!!((s=o)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!l&&o;){var c,f,h;r=Ns(o),o=(c=r)===null||c===void 0?void 0:c.host,l=!!((f=o)!==null&&f!==void 0&&(h=f.ownerDocument)!==null&&h!==void 0&&h.contains(o))}}return l},kd=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},_v=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var l=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!l}if(getComputedStyle(t).visibility==="hidden")return!0;var s=Zo.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(Zo.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var u=t;t;){var c=t.parentElement,f=Ns(t);if(c&&!c.shadowRoot&&o(c)===!0)return kd(t);t.assignedSlot?t=t.assignedSlot:!c&&f!==t.ownerDocument?t=f.host:t=c}t=u}if(Pv(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return kd(t);return!1},Iv=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Zo.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Av=function(t,n){return!(n.disabled||kv(n)||_v(n,t)||Ev(n)||Iv(n))},Ed=function(t,n){return!(Rv(n)||Nh(n)<0||!Av(t,n))},Lv=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ph=function(t){var n=[],r=[];return t.forEach(function(o,l){var s=!!o.scopeParent,a=s?o.scopeParent:o,u=Sv(a,s),c=s?Ph(o.candidates):a;u===0?s?n.push.apply(n,c):n.push(a):r.push({documentOrder:l,tabIndex:u,item:o,isScope:s,content:c})}),r.sort(Cv).reduce(function(o,l){return l.isScope?o.push.apply(o,l.content):o.push(l.content),o},[]).concat(n)},_h=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Ya([t],n.includeContainer,{filter:Ed.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Lv}):r=wv(t,n.includeContainer,Ed.bind(null,n)),Ph(r)};function Dv(){return/apple/i.test(navigator.vendor)}function Ov(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Qa(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ba(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function yo(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Li(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Mv(e){return e.matches("html,body")}function qo(e){return(e==null?void 0:e.ownerDocument)||document}function Ul(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var l;return o.parentId===t&&(!n||((l=o.context)==null?void 0:l.open))}).flatMap(o=>[o,...Ul(e,o.id,n)])}function $v(e){return"nativeEvent"in e}var zv=typeof document<"u",Kv=function(){},lr=zv?w.useLayoutEffect:Kv;const Fv={...uf},Hv=Fv.useInsertionEffect,Wv=Hv||(e=>e());function kr(e){const t=w.useRef(()=>{});return Wv(()=>{t.current=e}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Ih=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Ah(e,t){const n=_h(e,Ih()),r=n.length;if(r===0)return;const o=Ov(qo(e)),l=n.indexOf(o),s=l===-1?t===1?0:r-1:l+t;return n[s]}function Bv(e){return Ah(qo(e).body,1)||e}function Vv(e){return Ah(qo(e).body,-1)||e}function Di(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Qa(n,r)}function Uv(e){_h(e,Ih()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function jd(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Td(e,t,n){let{reference:r,floating:o}=e;const l=ln(t),s=Eh(t),a=kh(s),u=Hn(t),c=l==="y",f=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let m;switch(u){case"top":m={x:f,y:r.y-o.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-o.width,y:h};break;default:m={x:r.x,y:r.y}}switch(sl(t)){case"start":m[s]-=d*(n&&c?-1:1);break;case"end":m[s]+=d*(n&&c?-1:1);break}return m}async function Gv(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:l,rects:s,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:d=!1,padding:m=0}=ll(t,e),v=xv(m),S=a[d?h==="floating"?"reference":"floating":h],p=Ts(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(S)))==null||n?S:S.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:u})),g=h==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(l.getOffsetParent==null?void 0:l.getOffsetParent(a.floating)),x=await(l.isElement==null?void 0:l.isElement(y))?await(l.getScale==null?void 0:l.getScale(y))||{x:1,y:1}:{x:1,y:1},k=Ts(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:y,strategy:u}):g);return{top:(p.top-k.top+v.top)/x.y,bottom:(k.bottom-p.bottom+v.bottom)/x.y,left:(p.left-k.left+v.left)/x.x,right:(k.right-p.right+v.right)/x.x}}const Yv=50,Qv=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:Gv},u=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=Td(c,r,u),d=r,m=0;const v={};for(let b=0;b<l.length;b++){const S=l[b];if(!S)continue;const{name:p,fn:g}=S,{x:y,y:x,data:k,reset:C}=await g({x:f,y:h,initialPlacement:r,placement:d,strategy:o,middlewareData:v,rects:c,platform:a,elements:{reference:e,floating:t}});f=y??f,h=x??h,v[p]={...v[p],...k},C&&m<Yv&&(m++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:f,y:h}=Td(c,d,u)),b=-1)}return{x:f,y:h,placement:d,strategy:o,middlewareData:v}},Xv=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:l,rects:s,initialPlacement:a,platform:u,elements:c}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...S}=ll(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const p=Hn(o),g=ln(a),y=Hn(a)===a,x=await(u.isRTL==null?void 0:u.isRTL(c.floating)),k=d||(y||!b?[js(a)]:fv(a)),C=v!=="none";!d&&C&&k.push(...gv(a,b,v,x));const j=[a,...k],E=await u.detectOverflow(t,S),A=[];let _=((r=l.flip)==null?void 0:r.overflows)||[];if(f&&A.push(E[p]),h){const D=dv(o,s,x);A.push(E[D[0]],E[D[1]])}if(_=[..._,{placement:o,overflows:A}],!A.every(D=>D<=0)){var L,B;const D=(((L=l.flip)==null?void 0:L.index)||0)+1,G=j[D];if(G&&(!(h==="alignment"?g!==ln(G):!1)||_.every(T=>ln(T.placement)===g?T.overflows[0]>0:!0)))return{data:{index:D,overflows:_},reset:{placement:G}};let Q=(B=_.filter(q=>q.overflows[0]<=0).sort((q,T)=>q.overflows[1]-T.overflows[1])[0])==null?void 0:B.placement;if(!Q)switch(m){case"bestFit":{var H;const q=(H=_.filter(T=>{if(C){const R=ln(T.placement);return R===g||R==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(R=>R>0).reduce((R,P)=>R+P,0)]).sort((T,R)=>T[1]-R[1])[0])==null?void 0:H[0];q&&(Q=q);break}case"initialPlacement":Q=a;break}if(o!==Q)return{reset:{placement:Q}}}return{}}}},Zv=new Set(["left","top"]);async function qv(e,t){const{placement:n,platform:r,elements:o}=e,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Hn(n),a=sl(n),u=ln(n)==="y",c=Zv.has(s)?-1:1,f=l&&u?-1:1,h=ll(t,e);let{mainAxis:d,crossAxis:m,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof v=="number"&&(m=a==="end"?v*-1:v),u?{x:m*f,y:d*c}:{x:d*c,y:m*f}}const Jv=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:l,placement:s,middlewareData:a}=t,u=await qv(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:l+u.y,data:{...u,placement:s}}}}},e0=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:l}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:u={fn:p=>{let{x:g,y}=p;return{x:g,y}}},...c}=ll(e,t),f={x:n,y:r},h=await l.detectOverflow(t,c),d=ln(Hn(o)),m=Ch(d);let v=f[m],b=f[d];if(s){const p=m==="y"?"top":"left",g=m==="y"?"bottom":"right",y=v+h[p],x=v-h[g];v=wd(y,v,x)}if(a){const p=d==="y"?"top":"left",g=d==="y"?"bottom":"right",y=b+h[p],x=b-h[g];b=wd(y,b,x)}const S=u.fn({...t,[m]:v,[d]:b});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[m]:s,[d]:a}}}}}},t0=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:l,platform:s,elements:a}=t,{apply:u=()=>{},...c}=ll(e,t),f=await s.detectOverflow(t,c),h=Hn(o),d=sl(o),m=ln(o)==="y",{width:v,height:b}=l.floating;let S,p;h==="top"||h==="bottom"?(S=h,p=d===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(p=h,S=d==="end"?"top":"bottom");const g=b-f.top-f.bottom,y=v-f.left-f.right,x=eo(b-f[S],g),k=eo(v-f[p],y),C=!t.middlewareData.shift;let j=x,E=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=g),C&&!d){const _=dt(f.left,0),L=dt(f.right,0),B=dt(f.top,0),H=dt(f.bottom,0);m?E=v-2*(_!==0||L!==0?_+L:dt(f.left,f.right)):j=b-2*(B!==0||H!==0?B+H:dt(f.top,f.bottom))}await u({...t,availableWidth:E,availableHeight:j});const A=await s.getDimensions(a.floating);return v!==A.width||b!==A.height?{reset:{rects:!0}}:{}}}};function Lh(e){const t=Rt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ut(e),l=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Es(n)!==l||Es(r)!==s;return a&&(n=l,r=s),{width:n,height:r,$:a}}function Zu(e){return Ae(e)?e:e.contextElement}function Br(e){const t=Zu(e);if(!Ut(t))return Wt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:l}=Lh(t);let s=(l?Es(n.width):n.width)/r,a=(l?Es(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const n0=Wt(0);function Dh(e){const t=ht(e);return!Qs()||!t.visualViewport?n0:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function r0(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ht(e)?!1:t}function dr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),l=Zu(e);let s=Wt(1);t&&(r?Ae(r)&&(s=Br(r)):s=Br(e));const a=r0(l,n,r)?Dh(l):Wt(0);let u=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,f=o.width/s.x,h=o.height/s.y;if(l){const d=ht(l),m=r&&Ae(r)?ht(r):r;let v=d,b=Va(v);for(;b&&r&&m!==v;){const S=Br(b),p=b.getBoundingClientRect(),g=Rt(b),y=p.left+(b.clientLeft+parseFloat(g.paddingLeft))*S.x,x=p.top+(b.clientTop+parseFloat(g.paddingTop))*S.y;u*=S.x,c*=S.y,f*=S.x,h*=S.y,u+=y,c+=x,v=ht(b),b=Va(v)}}return Ts({width:f,height:h,x:u,y:c})}function Zs(e,t){const n=Xs(e).scrollLeft;return t?t.left+n:dr(Vt(e)).left+n}function Oh(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Zs(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function o0(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const l=o==="fixed",s=Vt(r),a=t?Ys(t.floating):!1;if(r===s||a&&l)return n;let u={scrollLeft:0,scrollTop:0},c=Wt(1);const f=Wt(0),h=Ut(r);if((h||!h&&!l)&&((oo(r)!=="body"||ol(s))&&(u=Xs(r)),h)){const m=dr(r);c=Br(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const d=s&&!h&&!l?Oh(s,u):Wt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+d.x,y:n.y*c.y-u.scrollTop*c.y+f.y+d.y}}function l0(e){return Array.from(e.getClientRects())}function s0(e){const t=Vt(e),n=Xs(e),r=e.ownerDocument.body,o=dt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=dt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Zs(e);const a=-n.scrollTop;return Rt(r).direction==="rtl"&&(s+=dt(t.clientWidth,r.clientWidth)-o),{width:o,height:l,x:s,y:a}}const Nd=25;function i0(e,t){const n=ht(e),r=Vt(e),o=n.visualViewport;let l=r.clientWidth,s=r.clientHeight,a=0,u=0;if(o){l=o.width,s=o.height;const f=Qs();(!f||f&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}const c=Zs(r);if(c<=0){const f=r.ownerDocument,h=f.body,d=getComputedStyle(h),m=f.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,v=Math.abs(r.clientWidth-h.clientWidth-m);v<=Nd&&(l-=v)}else c<=Nd&&(l+=c);return{width:l,height:s,x:a,y:u}}function a0(e,t){const n=dr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,l=Ut(e)?Br(e):Wt(1),s=e.clientWidth*l.x,a=e.clientHeight*l.y,u=o*l.x,c=r*l.y;return{width:s,height:a,x:u,y:c}}function Rd(e,t,n){let r;if(t==="viewport")r=i0(e,n);else if(t==="document")r=s0(Vt(e));else if(Ae(t))r=a0(t,n);else{const o=Dh(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ts(r)}function Mh(e,t){const n=hn(e);return n===t||!Ae(n)||an(n)?!1:Rt(n).position==="fixed"||Mh(n,t)}function u0(e,t){const n=t.get(e);if(n)return n;let r=zn(e,[],!1).filter(a=>Ae(a)&&oo(a)!=="body"),o=null;const l=Rt(e).position==="fixed";let s=l?hn(e):e;for(;Ae(s)&&!an(s);){const a=Rt(s),u=Xu(s);!u&&a.position==="fixed"&&(o=null),(l?!u&&!o:!u&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||ol(s)&&!u&&Mh(e,s))?r=r.filter(f=>f!==s):o=a,s=hn(s)}return t.set(e,r),r}function c0(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Ys(t)?[]:u0(t,this._c):[].concat(n),r],a=Rd(t,s[0],o);let u=a.top,c=a.right,f=a.bottom,h=a.left;for(let d=1;d<s.length;d++){const m=Rd(t,s[d],o);u=dt(m.top,u),c=eo(m.right,c),f=eo(m.bottom,f),h=dt(m.left,h)}return{width:c-h,height:f-u,x:h,y:u}}function d0(e){const{width:t,height:n}=Lh(e);return{width:t,height:n}}function f0(e,t,n){const r=Ut(t),o=Vt(t),l=n==="fixed",s=dr(e,!0,l,t);let a={scrollLeft:0,scrollTop:0};const u=Wt(0);function c(){u.x=Zs(o)}if(r||!r&&!l)if((oo(t)!=="body"||ol(o))&&(a=Xs(t)),r){const m=dr(t,!0,l,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&c();l&&!r&&o&&c();const f=o&&!r&&!l?Oh(o,a):Wt(0),h=s.left+a.scrollLeft-u.x-f.x,d=s.top+a.scrollTop-u.y-f.y;return{x:h,y:d,width:s.width,height:s.height}}function Oi(e){return Rt(e).position==="static"}function Pd(e,t){if(!Ut(e)||Rt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Vt(e)===n&&(n=n.ownerDocument.body),n}function $h(e,t){const n=ht(e);if(Ys(e))return n;if(!Ut(e)){let o=hn(e);for(;o&&!an(o);){if(Ae(o)&&!Oi(o))return o;o=hn(o)}return n}let r=Pd(e,t);for(;r&&sv(r)&&Oi(r);)r=Pd(r,t);return r&&an(r)&&Oi(r)&&!Xu(r)?n:r||uv(e)||n}const p0=async function(e){const t=this.getOffsetParent||$h,n=this.getDimensions,r=await n(e.floating);return{reference:f0(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function h0(e){return Rt(e).direction==="rtl"}const m0={convertOffsetParentRelativeRectToViewportRelativeRect:o0,getDocumentElement:Vt,getClippingRect:c0,getOffsetParent:$h,getElementRects:p0,getClientRects:l0,getDimensions:d0,getScale:Br,isElement:Ae,isRTL:h0};function zh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function g0(e,t){let n=null,r;const o=Vt(e);function l(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),l();const c=e.getBoundingClientRect(),{left:f,top:h,width:d,height:m}=c;if(a||t(),!d||!m)return;const v=Pl(h),b=Pl(o.clientWidth-(f+d)),S=Pl(o.clientHeight-(h+m)),p=Pl(f),y={rootMargin:-v+"px "+-b+"px "+-S+"px "+-p+"px",threshold:dt(0,eo(1,u))||1};let x=!0;function k(C){const j=C[0].intersectionRatio;if(j!==u){if(!x)return s();j?s(!1,j):r=setTimeout(()=>{s(!1,1e-7)},1e3)}j===1&&!zh(c,e.getBoundingClientRect())&&s(),x=!1}try{n=new IntersectionObserver(k,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,y)}n.observe(e)}return s(!0),l}function mn(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=Zu(e),f=o||l?[...c?zn(c):[],...t?zn(t):[]]:[];f.forEach(p=>{o&&p.addEventListener("scroll",n,{passive:!0}),l&&p.addEventListener("resize",n)});const h=c&&a?g0(c,n):null;let d=-1,m=null;s&&(m=new ResizeObserver(p=>{let[g]=p;g&&g.target===c&&m&&t&&(m.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var y;(y=m)==null||y.observe(t)})),n()}),c&&!u&&m.observe(c),t&&m.observe(t));let v,b=u?dr(e):null;u&&S();function S(){const p=dr(e);b&&!zh(b,p)&&n(),b=p,v=requestAnimationFrame(S)}return n(),()=>{var p;f.forEach(g=>{o&&g.removeEventListener("scroll",n),l&&g.removeEventListener("resize",n)}),h==null||h(),(p=m)==null||p.disconnect(),m=null,u&&cancelAnimationFrame(v)}}const y0=Jv,x0=e0,v0=Xv,b0=t0,w0=(e,t,n)=>{const r=new Map,o={platform:m0,...n},l={...o.platform,_c:r};return Qv(e,t,{...o,platform:l})};var S0=typeof document<"u",C0=function(){},Gl=S0?w.useLayoutEffect:C0;function Ps(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 n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ps(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const l=o[r];if(!(l==="_owner"&&e.$$typeof)&&!Ps(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function Kh(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _d(e,t){const n=Kh(e);return Math.round(t*n)/n}function Mi(e){const t=w.useRef(e);return Gl(()=>{t.current=e}),t}function k0(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:s}={},transform:a=!0,whileElementsMounted:u,open:c}=e,[f,h]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,m]=w.useState(r);Ps(d,r)||m(r);const[v,b]=w.useState(null),[S,p]=w.useState(null),g=w.useCallback(T=>{T!==C.current&&(C.current=T,b(T))},[]),y=w.useCallback(T=>{T!==j.current&&(j.current=T,p(T))},[]),x=l||v,k=s||S,C=w.useRef(null),j=w.useRef(null),E=w.useRef(f),A=u!=null,_=Mi(u),L=Mi(o),B=Mi(c),H=w.useCallback(()=>{if(!C.current||!j.current)return;const T={placement:t,strategy:n,middleware:d};L.current&&(T.platform=L.current),w0(C.current,j.current,T).then(R=>{const P={...R,isPositioned:B.current!==!1};D.current&&!Ps(E.current,P)&&(E.current=P,Uu.flushSync(()=>{h(P)}))})},[d,t,n,L,B]);Gl(()=>{c===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,h(T=>({...T,isPositioned:!1})))},[c]);const D=w.useRef(!1);Gl(()=>(D.current=!0,()=>{D.current=!1}),[]),Gl(()=>{if(x&&(C.current=x),k&&(j.current=k),x&&k){if(_.current)return _.current(x,k,H);H()}},[x,k,H,_,A]);const G=w.useMemo(()=>({reference:C,floating:j,setReference:g,setFloating:y}),[g,y]),Q=w.useMemo(()=>({reference:x,floating:k}),[x,k]),q=w.useMemo(()=>{const T={position:n,left:0,top:0};if(!Q.floating)return T;const R=_d(Q.floating,f.x),P=_d(Q.floating,f.y);return a?{...T,transform:"translate("+R+"px, "+P+"px)",...Kh(Q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:R,top:P}},[n,a,Q.floating,f.x,f.y]);return w.useMemo(()=>({...f,update:H,refs:G,elements:Q,floatingStyles:q}),[f,H,G,Q,q])}const gn=(e,t)=>{const n=y0(e);return{name:n.name,fn:n.fn,options:[e,t]}},yn=(e,t)=>{const n=x0(e);return{name:n.name,fn:n.fn,options:[e,t]}},xn=(e,t)=>{const n=v0(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xa=(e,t)=>{const n=b0(e);return{name:n.name,fn:n.fn,options:[e,t]}},E0="data-floating-ui-focusable",Id="active",Ad="selected",j0={...uf};let Ld=!1,T0=0;const Dd=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+T0++;function N0(){const[e,t]=w.useState(()=>Ld?Dd():void 0);return lr(()=>{e==null&&t(Dd())},[]),w.useEffect(()=>{Ld=!0},[]),e}const R0=j0.useId,Fh=R0||N0;function P0(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const _0=w.createContext(null),I0=w.createContext(null),A0=()=>{var e;return((e=w.useContext(_0))==null?void 0:e.id)||null},Hh=()=>w.useContext(I0);function qu(e){return"data-floating-ui-"+e}const L0={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Od=w.forwardRef(function(t,n){const[r,o]=w.useState();lr(()=>{Dv()&&o("button")},[]);const l={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[qu("focus-guard")]:"",style:L0};return i.jsx("span",{...t,...l})}),D0={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Wh=w.createContext(null),Md=qu("portal");function O0(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Fh(),o=M0(),[l,s]=w.useState(null),a=w.useRef(null);return lr(()=>()=>{l==null||l.remove(),queueMicrotask(()=>{a.current=null})},[l]),lr(()=>{if(!r||a.current)return;const u=t?document.getElementById(t):null;if(!u)return;const c=document.createElement("div");c.id=r,c.setAttribute(Md,""),u.appendChild(c),a.current=c,s(c)},[t,r]),lr(()=>{if(n===null||!r||a.current)return;let u=n||(o==null?void 0:o.portalNode);u&&!Qu(u)&&(u=u.current),u=u||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,u.appendChild(c));const f=document.createElement("div");f.id=r,f.setAttribute(Md,""),u=c||u,u.appendChild(f),a.current=f,s(f)},[t,n,r,o]),l}function vn(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,l=O0({id:n,root:r}),[s,a]=w.useState(null),u=w.useRef(null),c=w.useRef(null),f=w.useRef(null),h=w.useRef(null),d=s==null?void 0:s.modal,m=s==null?void 0:s.open,v=!!s&&!s.modal&&s.open&&o&&!!(r||l);return w.useEffect(()=>{if(!l||!o||d)return;function b(S){l&&Di(S)&&(S.type==="focusin"?jd:Uv)(l)}return l.addEventListener("focusin",b,!0),l.addEventListener("focusout",b,!0),()=>{l.removeEventListener("focusin",b,!0),l.removeEventListener("focusout",b,!0)}},[l,o,d]),w.useEffect(()=>{l&&(m||jd(l))},[m,l]),i.jsxs(Wh.Provider,{value:w.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:u,afterOutsideRef:c,beforeInsideRef:f,afterInsideRef:h,portalNode:l,setFocusManagerState:a}),[o,l]),children:[v&&l&&i.jsx(Od,{"data-type":"outside",ref:u,onFocus:b=>{if(Di(b,l)){var S;(S=f.current)==null||S.focus()}else{const p=s?s.domReference:null,g=Vv(p);g==null||g.focus()}}}),v&&l&&i.jsx("span",{"aria-owns":l.id,style:D0}),l&&Uu.createPortal(t,l),v&&l&&i.jsx(Od,{"data-type":"outside",ref:c,onFocus:b=>{if(Di(b,l)){var S;(S=h.current)==null||S.focus()}else{const p=s?s.domReference:null,g=Bv(p);g==null||g.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,b.nativeEvent,"focus-out"))}}})]})}const M0=()=>w.useContext(Wh),$0={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},z0={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},$d=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function fr(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:l}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:u=!0,outsidePressEvent:c="pointerdown",referencePress:f=!1,referencePressEvent:h="pointerdown",ancestorScroll:d=!1,bubbles:m,capture:v}=t,b=Hh(),S=kr(typeof u=="function"?u:()=>!1),p=typeof u=="function"?S:u,g=w.useRef(!1),{escapeKey:y,outsidePress:x}=$d(m),{escapeKey:k,outsidePress:C}=$d(v),j=w.useRef(!1),E=kr(D=>{var G;if(!n||!s||!a||D.key!=="Escape"||j.current)return;const Q=(G=l.current.floatingContext)==null?void 0:G.nodeId,q=b?Ul(b.nodesRef.current,Q):[];if(!y&&(D.stopPropagation(),q.length>0)){let T=!0;if(q.forEach(R=>{var P;if((P=R.context)!=null&&P.open&&!R.context.dataRef.current.__escapeKeyBubbles){T=!1;return}}),!T)return}r(!1,$v(D)?D.nativeEvent:D,"escape-key")}),A=kr(D=>{var G;const Q=()=>{var q;E(D),(q=yo(D))==null||q.removeEventListener("keydown",Q)};(G=yo(D))==null||G.addEventListener("keydown",Q)}),_=kr(D=>{var G;const Q=l.current.insideReactTree;l.current.insideReactTree=!1;const q=g.current;if(g.current=!1,c==="click"&&q||Q||typeof p=="function"&&!p(D))return;const T=yo(D),R="["+qu("inert")+"]",P=qo(o.floating).querySelectorAll(R);let Y=Ae(T)?T:null;for(;Y&&!an(Y);){const $=hn(Y);if(an($)||!Ae($))break;Y=$}if(P.length&&Ae(T)&&!Mv(T)&&!Qa(T,o.floating)&&Array.from(P).every($=>!Qa(Y,$)))return;if(Ut(T)&&H){const $=an(T),ne=Rt(T),me=/auto|scroll/,z=$||me.test(ne.overflowX),he=$||me.test(ne.overflowY),nt=z&&T.clientWidth>0&&T.scrollWidth>T.clientWidth,xt=he&&T.clientHeight>0&&T.scrollHeight>T.clientHeight,vt=ne.direction==="rtl",rt=xt&&(vt?D.offsetX<=T.offsetWidth-T.clientWidth:D.offsetX>T.clientWidth),bt=nt&&D.offsetY>T.clientHeight;if(rt||bt)return}const X=(G=l.current.floatingContext)==null?void 0:G.nodeId,Ne=b&&Ul(b.nodesRef.current,X).some($=>{var ne;return Li(D,(ne=$.context)==null?void 0:ne.elements.floating)});if(Li(D,o.floating)||Li(D,o.domReference)||Ne)return;const Pe=b?Ul(b.nodesRef.current,X):[];if(Pe.length>0){let $=!0;if(Pe.forEach(ne=>{var me;if((me=ne.context)!=null&&me.open&&!ne.context.dataRef.current.__outsidePressBubbles){$=!1;return}}),!$)return}r(!1,D,"outside-press")}),L=kr(D=>{var G;const Q=()=>{var q;_(D),(q=yo(D))==null||q.removeEventListener(c,Q)};(G=yo(D))==null||G.addEventListener(c,Q)});w.useEffect(()=>{if(!n||!s)return;l.current.__escapeKeyBubbles=y,l.current.__outsidePressBubbles=x;let D=-1;function G(P){r(!1,P,"ancestor-scroll")}function Q(){window.clearTimeout(D),j.current=!0}function q(){D=window.setTimeout(()=>{j.current=!1},Qs()?5:0)}const T=qo(o.floating);a&&(T.addEventListener("keydown",k?A:E,k),T.addEventListener("compositionstart",Q),T.addEventListener("compositionend",q)),p&&T.addEventListener(c,C?L:_,C);let R=[];return d&&(Ae(o.domReference)&&(R=zn(o.domReference)),Ae(o.floating)&&(R=R.concat(zn(o.floating))),!Ae(o.reference)&&o.reference&&o.reference.contextElement&&(R=R.concat(zn(o.reference.contextElement)))),R=R.filter(P=>{var Y;return P!==((Y=T.defaultView)==null?void 0:Y.visualViewport)}),R.forEach(P=>{P.addEventListener("scroll",G,{passive:!0})}),()=>{a&&(T.removeEventListener("keydown",k?A:E,k),T.removeEventListener("compositionstart",Q),T.removeEventListener("compositionend",q)),p&&T.removeEventListener(c,C?L:_,C),R.forEach(P=>{P.removeEventListener("scroll",G)}),window.clearTimeout(D)}},[l,o,a,p,c,n,r,d,s,y,x,E,k,A,_,C,L]),w.useEffect(()=>{l.current.insideReactTree=!1},[l,p,c]);const B=w.useMemo(()=>({onKeyDown:E,...f&&{[$0[h]]:D=>{r(!1,D.nativeEvent,"reference-press")},...h!=="click"&&{onClick(D){r(!1,D.nativeEvent,"reference-press")}}}}),[E,r,f,h]),H=w.useMemo(()=>{function D(G){G.button===0&&(g.current=!0)}return{onKeyDown:E,onMouseDown:D,onMouseUp:D,[z0[c]]:()=>{l.current.insideReactTree=!0}}},[E,c,l]);return w.useMemo(()=>s?{reference:B,floating:H}:{},[s,B,H])}function K0(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Fh(),l=w.useRef({}),[s]=w.useState(()=>P0()),a=A0()!=null,[u,c]=w.useState(r.reference),f=kr((m,v,b)=>{l.current.openEvent=m?v:void 0,s.emit("openchange",{open:m,event:v,reason:b,nested:a}),n==null||n(m,v,b)}),h=w.useMemo(()=>({setPositionReference:c}),[]),d=w.useMemo(()=>({reference:u||r.reference||null,floating:r.floating||null,domReference:r.reference}),[u,r.reference,r.floating]);return w.useMemo(()=>({dataRef:l,open:t,onOpenChange:f,elements:d,events:s,floatingId:o,refs:h}),[t,f,d,s,o,h])}function bn(e){e===void 0&&(e={});const{nodeId:t}=e,n=K0({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[l,s]=w.useState(null),[a,u]=w.useState(null),f=(o==null?void 0:o.domReference)||l,h=w.useRef(null),d=Hh();lr(()=>{f&&(h.current=f)},[f]);const m=k0({...e,elements:{...o,...a&&{reference:a}}}),v=w.useCallback(y=>{const x=Ae(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),getClientRects:()=>y.getClientRects(),contextElement:y}:y;u(x),m.refs.setReference(x)},[m.refs]),b=w.useCallback(y=>{(Ae(y)||y===null)&&(h.current=y,s(y)),(Ae(m.refs.reference.current)||m.refs.reference.current===null||y!==null&&!Ae(y))&&m.refs.setReference(y)},[m.refs]),S=w.useMemo(()=>({...m.refs,setReference:b,setPositionReference:v,domReference:h}),[m.refs,b,v]),p=w.useMemo(()=>({...m.elements,domReference:f}),[m.elements,f]),g=w.useMemo(()=>({...m,...r,refs:S,elements:p,nodeId:t}),[m,S,p,t,r]);return lr(()=>{r.dataRef.current.floatingContext=g;const y=d==null?void 0:d.nodesRef.current.find(x=>x.id===t);y&&(y.context=g)}),w.useMemo(()=>({...m,context:g,refs:S,elements:p}),[m,S,p,g])}function $i(e,t,n){const r=new Map,o=n==="item";let l=e;if(o&&e){const{[Id]:s,[Ad]:a,...u}=e;l=u}return{...n==="floating"&&{tabIndex:-1,[E0]:""},...l,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(u=>{let[c,f]=u;if(!(o&&[Id,Ad].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof f=="function"){var h;(h=r.get(c))==null||h.push(f),s[c]=function(){for(var d,m=arguments.length,v=new Array(m),b=0;b<m;b++)v[b]=arguments[b];return(d=r.get(c))==null?void 0:d.map(S=>S(...v)).find(S=>S!==void 0)}}}else s[c]=f}),s),{})}}function pr(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=w.useCallback(a=>$i(a,e,"reference"),t),l=w.useCallback(a=>$i(a,e,"floating"),n),s=w.useCallback(a=>$i(a,e,"item"),r);return w.useMemo(()=>({getReferenceProps:o,getFloatingProps:l,getItemProps:s}),[o,l,s])}const hr={"m-":{category:"spacing",themeKey:"spacing",valueType:"scalar",renderMode:"boxmodel",isComposite:!0,compositeRelatedPrefixes:["m-","mx-","my-","mt-","mr-","mb-","ml-","ms-","me-","p-","px-","py-","pt-","pr-","pb-","pl-","ps-","pe-","space-x-","space-y-","border-","border-t-","border-r-","border-b-","border-l-","rounded-","rounded-t-","rounded-r-","rounded-b-","rounded-l-","rounded-tl-","rounded-tr-","rounded-br-","rounded-bl-"],compositeExactMatches:["border","rounded"]},"mx-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"my-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"mt-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"mr-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"mb-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"ml-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"ms-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"me-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"p-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"px-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"py-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"pt-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"pr-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"pb-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"pl-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"ps-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"pe-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"gap-":{category:"flexbox",themeKey:"spacing",valueType:"scalar",addable:!0,controlGroup:"flex-container",propertyKey:"gap"},"gap-x-":{category:"flexbox",themeKey:"spacing",valueType:"scalar",controlGroup:"flex-container",propertyKey:"gap-x"},"gap-y-":{category:"flexbox",themeKey:"spacing",valueType:"scalar",controlGroup:"flex-container",propertyKey:"gap-y"},"space-x-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"space-y-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"w-":{category:"sizing",themeKey:"spacing",valueType:"scalar",addable:!0,propertyKey:"width"},"h-":{category:"sizing",themeKey:"spacing",valueType:"scalar",addable:!0,propertyKey:"height"},"min-w-":{category:"sizing",themeKey:"spacing",valueType:"scalar",addable:!0,propertyKey:"min-width"},"max-w-":{category:"sizing",themeKey:"spacing",valueType:"scalar",addable:!0,propertyKey:"max-width"},"min-h-":{category:"sizing",themeKey:"spacing",valueType:"scalar",addable:!0,propertyKey:"min-height"},"max-h-":{category:"sizing",themeKey:"spacing",valueType:"scalar",addable:!0,propertyKey:"max-height"},"size-":{category:"sizing",themeKey:"spacing",valueType:"scalar",addable:!0,propertyKey:"size"},"font-":{category:"typography",themeKey:"fontWeight",valueType:"scalar",addable:!0},"text-":{category:"typography",themeKey:null,valueType:"enum"},"leading-":{category:"typography",themeKey:"lineHeight",valueType:"scalar",addable:!0},"tracking-":{category:"typography",themeKey:"letterSpacing",valueType:"scalar",addable:!0},"text-left":{category:"typography",themeKey:null,valueType:"enum",addable:!0,propertyKey:"text-align",enumAlts:["text-left","text-center","text-right","text-justify","text-start","text-end"]},"text-center":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-align",enumAlts:["text-left","text-center","text-right","text-justify","text-start","text-end"]},"text-right":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-align",enumAlts:["text-left","text-center","text-right","text-justify","text-start","text-end"]},"text-justify":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-align",enumAlts:["text-left","text-center","text-right","text-justify","text-start","text-end"]},"text-start":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-align",enumAlts:["text-left","text-center","text-right","text-justify","text-start","text-end"]},"text-end":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-align",enumAlts:["text-left","text-center","text-right","text-justify","text-start","text-end"]},italic:{category:"typography",themeKey:null,valueType:"enum",addable:!0,propertyKey:"font-style",enumAlts:["italic","not-italic"]},"not-italic":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"font-style",enumAlts:["italic","not-italic"]},underline:{category:"typography",themeKey:null,valueType:"enum",addable:!0,propertyKey:"text-decoration",enumAlts:["underline","line-through","overline","no-underline"]},"line-through":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-decoration",enumAlts:["underline","line-through","overline","no-underline"]},overline:{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-decoration",enumAlts:["underline","line-through","overline","no-underline"]},"no-underline":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-decoration",enumAlts:["underline","line-through","overline","no-underline"]},uppercase:{category:"typography",themeKey:null,valueType:"enum",addable:!0,propertyKey:"text-transform",enumAlts:["uppercase","lowercase","capitalize","normal-case"]},lowercase:{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-transform",enumAlts:["uppercase","lowercase","capitalize","normal-case"]},capitalize:{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-transform",enumAlts:["uppercase","lowercase","capitalize","normal-case"]},"normal-case":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-transform",enumAlts:["uppercase","lowercase","capitalize","normal-case"]},truncate:{category:"typography",themeKey:null,valueType:"enum"},"font-sans":{category:"typography",themeKey:null,valueType:"enum",addable:!0,propertyKey:"font-family",enumAlts:["font-sans","font-serif","font-mono"]},"font-serif":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"font-family",enumAlts:["font-sans","font-serif","font-mono"]},"font-mono":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"font-family",enumAlts:["font-sans","font-serif","font-mono"]},"align-baseline":{category:"typography",themeKey:null,valueType:"enum",addable:!0,propertyKey:"vertical-align",enumAlts:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"]},"align-top":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"vertical-align",enumAlts:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"]},"align-middle":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"vertical-align",enumAlts:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"]},"align-bottom":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"vertical-align",enumAlts:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"]},"align-text-top":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"vertical-align",enumAlts:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"]},"align-text-bottom":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"vertical-align",enumAlts:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"]},"align-sub":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"vertical-align",enumAlts:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"]},"align-super":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"vertical-align",enumAlts:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"]},"bg-":{category:"color",themeKey:"colors",valueType:"color",renderMode:"gradient-editor",isComposite:!0,compositeRelatedPrefixes:["bg-","bg-gradient-to-","from-","via-","to-"]},"bg-gradient-to-":{category:"gradient",themeKey:null,valueType:"enum"},"from-":{category:"gradient",themeKey:"colors",valueType:"color"},"via-":{category:"gradient",themeKey:"colors",valueType:"color"},"to-":{category:"gradient",themeKey:"colors",valueType:"color"},"ring-":{category:"color",themeKey:"colors",valueType:"color"},"outline-":{category:"color",themeKey:"colors",valueType:"color"},"fill-":{category:"color",themeKey:"colors",valueType:"color"},"stroke-":{category:"color",themeKey:"colors",valueType:"color"},"decoration-":{category:"color",themeKey:"colors",valueType:"color"},border:{category:"borders",themeKey:"borderWidth",valueType:"scalar"},"border-":{category:"borders",themeKey:"borderWidth",valueType:"scalar"},"border-t-":{category:"borders",themeKey:"borderWidth",valueType:"scalar"},"border-r-":{category:"borders",themeKey:"borderWidth",valueType:"scalar"},"border-b-":{category:"borders",themeKey:"borderWidth",valueType:"scalar"},"border-l-":{category:"borders",themeKey:"borderWidth",valueType:"scalar"},rounded:{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-t-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-r-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-b-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-l-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-tl-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-tr-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-br-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-bl-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"opacity-":{category:"effects",themeKey:"opacity",valueType:"scalar",addable:!0},"shadow-":{category:"effects",themeKey:null,valueType:"enum"},block:{category:"layout",themeKey:null,valueType:"enum",addable:!0,propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},"inline-block":{category:"layout",themeKey:null,valueType:"enum",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},inline:{category:"layout",themeKey:null,valueType:"enum",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},grid:{category:"layout",themeKey:null,valueType:"enum",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},"inline-grid":{category:"layout",themeKey:null,valueType:"enum",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},hidden:{category:"layout",themeKey:null,valueType:"enum",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},table:{category:"layout",themeKey:null,valueType:"enum",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},contents:{category:"layout",themeKey:null,valueType:"enum",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},static:{category:"layout",themeKey:null,valueType:"enum"},fixed:{category:"layout",themeKey:null,valueType:"enum"},absolute:{category:"layout",themeKey:null,valueType:"enum"},relative:{category:"layout",themeKey:null,valueType:"enum"},sticky:{category:"layout",themeKey:null,valueType:"enum"},"inset-":{category:"layout",themeKey:"spacing",valueType:"scalar"},"top-":{category:"layout",themeKey:"spacing",valueType:"scalar"},"right-":{category:"layout",themeKey:"spacing",valueType:"scalar"},"bottom-":{category:"layout",themeKey:"spacing",valueType:"scalar"},"left-":{category:"layout",themeKey:"spacing",valueType:"scalar"},"z-":{category:"layout",themeKey:null,valueType:"enum"},flex:{category:"layout",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},"inline-flex":{category:"layout",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},"flex-row":{category:"flexbox",themeKey:null,valueType:"enum",addable:!0,controlGroup:"flex-container",propertyKey:"flex-direction",enumAlts:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"]},"flex-col":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"flex-direction",enumAlts:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"]},"flex-row-reverse":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"flex-direction",enumAlts:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"]},"flex-col-reverse":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"flex-direction",enumAlts:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"]},"flex-wrap":{category:"flexbox",themeKey:null,valueType:"enum",addable:!0,controlGroup:"flex-container",propertyKey:"flex-wrap",enumAlts:["flex-wrap","flex-nowrap","flex-wrap-reverse"]},"flex-nowrap":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"flex-wrap",enumAlts:["flex-wrap","flex-nowrap","flex-wrap-reverse"]},"flex-wrap-reverse":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"flex-wrap",enumAlts:["flex-wrap","flex-nowrap","flex-wrap-reverse"]},"flex-1":{category:"flexbox",themeKey:null,valueType:"enum"},"flex-auto":{category:"flexbox",themeKey:null,valueType:"enum"},"flex-initial":{category:"flexbox",themeKey:null,valueType:"enum"},"flex-none":{category:"flexbox",themeKey:null,valueType:"enum"},grow:{category:"flexbox",themeKey:null,valueType:"enum"},"grow-0":{category:"flexbox",themeKey:null,valueType:"enum"},shrink:{category:"flexbox",themeKey:null,valueType:"enum"},"shrink-0":{category:"flexbox",themeKey:null,valueType:"enum"},"justify-start":{category:"flexbox",themeKey:null,valueType:"enum",addable:!0,controlGroup:"flex-container",propertyKey:"justify-content",enumAlts:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly","justify-stretch"]},"justify-end":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"justify-content",enumAlts:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly","justify-stretch"]},"justify-center":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"justify-content",enumAlts:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly","justify-stretch"]},"justify-between":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"justify-content",enumAlts:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly","justify-stretch"]},"justify-around":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"justify-content",enumAlts:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly","justify-stretch"]},"justify-evenly":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"justify-content",enumAlts:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly","justify-stretch"]},"justify-stretch":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"justify-content",enumAlts:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly","justify-stretch"]},"items-start":{category:"flexbox",themeKey:null,valueType:"enum",addable:!0,controlGroup:"flex-container",propertyKey:"align-items",enumAlts:["items-start","items-end","items-center","items-baseline","items-stretch"]},"items-end":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"align-items",enumAlts:["items-start","items-end","items-center","items-baseline","items-stretch"]},"items-center":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"align-items",enumAlts:["items-start","items-end","items-center","items-baseline","items-stretch"]},"items-baseline":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"align-items",enumAlts:["items-start","items-end","items-center","items-baseline","items-stretch"]},"items-stretch":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"align-items",enumAlts:["items-start","items-end","items-center","items-baseline","items-stretch"]},"content-normal":{category:"flexbox",themeKey:null,valueType:"enum",addable:!0,propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"content-start":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"content-end":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"content-center":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"content-between":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"content-around":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"content-evenly":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"content-baseline":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"content-stretch":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"justify-items-start":{category:"flexbox",themeKey:null,valueType:"enum",addable:!0,propertyKey:"justify-items",enumAlts:["justify-items-start","justify-items-end","justify-items-center","justify-items-stretch"]},"justify-items-end":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"justify-items",enumAlts:["justify-items-start","justify-items-end","justify-items-center","justify-items-stretch"]},"justify-items-center":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"justify-items",enumAlts:["justify-items-start","justify-items-end","justify-items-center","justify-items-stretch"]},"justify-items-stretch":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"justify-items",enumAlts:["justify-items-start","justify-items-end","justify-items-center","justify-items-stretch"]},"self-auto":{category:"flexbox",themeKey:null,valueType:"enum"},"self-start":{category:"flexbox",themeKey:null,valueType:"enum"},"self-end":{category:"flexbox",themeKey:null,valueType:"enum"},"self-center":{category:"flexbox",themeKey:null,valueType:"enum"},"self-stretch":{category:"flexbox",themeKey:null,valueType:"enum"},"self-baseline":{category:"flexbox",themeKey:null,valueType:"enum"},"basis-":{category:"flexbox",themeKey:"spacing",valueType:"scalar"},"grid-cols-":{category:"flexbox",themeKey:null,valueType:"enum"},"grid-rows-":{category:"flexbox",themeKey:null,valueType:"enum"},"col-span-":{category:"flexbox",themeKey:null,valueType:"enum"},"row-span-":{category:"flexbox",themeKey:null,valueType:"enum"},"order-":{category:"flexbox",themeKey:null,valueType:"enum"}},F0=(()=>{const e=new Map;for(const[t,n]of Object.entries(hr)){if(!n.controlGroup)continue;const r=n.propertyKey??t.replace(/-$/g,"");e.has(n.controlGroup)||e.set(n.controlGroup,new Set),e.get(n.controlGroup).add(r)}return e})(),H0=(()=>{const e=new Map;for(const[t,n]of Object.entries(hr))n.controlGroup&&(e.has(n.controlGroup)||e.set(n.controlGroup,new Set),e.get(n.controlGroup).add(t));return e})();function W0(){const e={};for(const[t,n]of Object.entries(hr))if(n.valueType==="enum"&&n.enumAlts){const r=n.propertyKey??t.replace(/-$/g,"");for(const o of n.enumAlts)e[o]||(e[o]={alternatives:n.enumAlts,propertyKey:r})}return e}function B0(){const e={spacing:[],sizing:[],typography:[],color:[],borders:[],effects:[],layout:[],flexbox:[],gradient:[]},t=new Set;for(const[n,r]of Object.entries(hr)){if(!r.addable)continue;const o=r.propertyKey??n.replace(/-$/g,"");if(t.has(o))continue;t.add(o);const l=o.replace(/-/g," ").replace(/\b\w/g,a=>a.toUpperCase()),s=r.enumAlts?r.enumAlts.slice(0,2).join("/")+(r.enumAlts.length>2?"/…":""):`${n}*`;e[r.category].push({name:l,prefixHint:s,prefix:n})}return e}function Yl({prefix:e,currentValue:t,colors:n,locked:r,lockedValue:o,onHover:l,onLeave:s,onClick:a,onRemove:u,onRemoveHover:c}){return i.jsxs("div",{className:"p-2 bg-bv-surface border border-bv-border rounded-md my-2",onMouseLeave:()=>{r||s()},children:[i.jsxs("div",{className:"flex items-center gap-0.5 mb-0.5",children:[i.jsx("span",{className:"w-[52px] text-[10px] text-bv-muted text-right pr-1.5 shrink-0"}),u&&i.jsx("div",{title:"Remove class",className:`w-5 h-5 rounded cursor-pointer border-2 shrink-0 transition-[border-color,transform] flex items-center justify-center ${t===""?"outline outline-2 outline-offset-2 outline-bv-orange border-transparent":"border-transparent hover:border-bv-orange hover:scale-110"}`,onMouseEnter:()=>{!r&&c&&c()},onClick:u,children:i.jsxs("svg",{viewBox:"0 0 10 10",width:"14",height:"14",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"}),i.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"})]})}),["black","white","transparent"].map(f=>n[f]!==void 0?i.jsx(zd,{prefix:e,colorName:f,colorValue:n[f],isCurrent:f===t,isLocked:o===`${e}${f}`,locked:r,onHover:l,onClick:a},f):null)]}),Ix.map(f=>{const h=n[f];return!h||typeof h!="object"?null:i.jsxs("div",{className:"flex items-center gap-0.5 mb-0.5",children:[i.jsx("span",{className:"w-[52px] text-[10px] text-bv-muted text-right pr-1.5 shrink-0",children:f}),Ax.map(d=>h[d]!==void 0?i.jsx(zd,{prefix:e,colorName:`${f}-${d}`,colorValue:h[d],isCurrent:`${f}-${d}`===t,isLocked:o===`${e}${f}-${d}`,locked:r,onHover:l,onClick:a},`${f}-${d}`):null)]},f)})]})}function zd({prefix:e,colorName:t,colorValue:n,isCurrent:r,isLocked:o,locked:l,onHover:s,onClick:a}){const u=`${e}${t}`,c=o?"outline outline-2 outline-offset-2 outline-bv-teal border-transparent":r?"outline outline-2 outline-offset-2 outline-bv-orange border-transparent":l?"border-transparent":"border-transparent hover:border-bv-text hover:scale-110 hover:z-10",f=t==="transparent"?{background:"repeating-conic-gradient(#808080 0% 25%, transparent 0% 50%) 50% / 8px 8px"}:{backgroundColor:n};return i.jsx("div",{title:u,className:`w-5 h-5 rounded cursor-pointer border-2 shrink-0 transition-[border-color,transform] ${c}`,style:f,onMouseEnter:()=>{l||s(u)},onClick:h=>{h.stopPropagation(),a(u)}})}const xr=w.forwardRef(function({onClose:t,children:n,...r},o){const l=w.useRef(null);return w.useEffect(()=>{var s;(s=l.current)==null||s.focus({preventScroll:!0})},[]),i.jsx("div",{ref:s=>{l.current=s,typeof o=="function"?o(s):o&&(o.current=s)},tabIndex:-1,onBlur:s=>{var a;(a=l.current)!=null&&a.contains(s.relatedTarget)||t()},onKeyDown:s=>{s.code==="Escape"&&t()},...r,children:n})}),V0=4,U0=10;function En({values:e,currentValue:t,lockedValue:n,locked:r,ghost:o,onStart:l,onHover:s,onLeave:a,onClick:u,onRemove:c,onRemoveHover:f}){const[h,d]=w.useState(!1),[m,v]=w.useState(null),b=w.useRef(null),S=w.useRef(null),p=w.useRef(null),g=w.useRef(null),{refs:y,floatingStyles:x}=bn({open:h,strategy:"fixed",placement:"bottom-start",middleware:[gn(2),xn(),yn({padding:4})],whileElementsMounted:mn}),k=n!==null&&e.includes(n),C=m!==null?e[m]:k?n:t;w.useEffect(()=>{var H,D;h&&g.current&&((D=(H=g.current).scrollIntoView)==null||D.call(H,{block:"nearest"}))},[h]);const j=r&&!k;function E(H){if(j)return;l==null||l();const D=k?n:t,G=e.indexOf(D);S.current={startX:H.clientX,startIndex:G>=0?G:0,didScrub:!1},H.currentTarget.setPointerCapture(H.pointerId),H.preventDefault()}function A(H){const D=S.current;if(!D)return;const G=H.clientX-D.startX;if(!D.didScrub&&Math.abs(G)>V0&&(D.didScrub=!0,d(!1)),D.didScrub){const Q=Math.round(G/U0),q=Math.max(0,Math.min(e.length-1,D.startIndex+Q));b.current=q,v(q),s(e[q])}}function _(){const H=S.current;if(!H)return;const D=b.current;H.didScrub&&D!==null?u(e[D]):H.didScrub||d(G=>(G&&a(),!G)),b.current=null,v(null),S.current=null}const L=m!==null,B=L?"bg-bv-teal/9 text-bv-teal ring-1 ring-bv-teal":k?"bg-bv-surface-hi text-bv-text ring-1 ring-bv-border hover:bg-bv-teal/9 hover:text-bv-teal hover:ring-bv-teal":h?"bg-bv-surface-hi text-bv-text ring-1 ring-bv-border":j?"bg-bv-surface text-bv-text-mid":o?"border border-dashed border-bv-border text-bv-muted bg-transparent hover:border-bv-teal hover:text-bv-teal":"bg-bv-surface text-bv-text-mid hover:bg-bv-surface-hi hover:text-bv-text";return i.jsxs("div",{ref:p,className:"relative inline-block",children:[i.jsxs("div",{ref:y.setReference,className:`group select-none px-2 py-0.5 rounded-md text-[11px] font-mono transition-colors ${j?"cursor-default":"cursor-ew-resize"} ${B}`,onPointerDown:E,onPointerMove:A,onPointerUp:_,children:[!j&&i.jsx("span",{className:`inline-block mr-0.5 text-[9px] transition-opacity ${L?"opacity-100":"opacity-0 group-hover:opacity-50"}`,children:"‹"}),C,!j&&i.jsx("span",{className:`inline-block ml-0.5 text-[9px] transition-opacity ${L?"opacity-100":"opacity-0 group-hover:opacity-50"}`,children:"›"})]}),h&&i.jsx(vn,{children:i.jsxs(xr,{ref:y.setFloating,style:x,className:"z-50 max-h-52 overflow-y-auto bg-bv-bg border border-bv-border rounded-md shadow-md min-w-[5rem]",onPointerDown:H=>H.stopPropagation(),onMouseLeave:a,onClose:()=>{d(!1),a()},children:[c&&i.jsxs("div",{className:`flex items-center gap-1.5 px-2.5 py-[3px] text-[11px] font-mono cursor-pointer border-b border-bv-border text-bv-muted hover:text-red-400 ${t===""||n===""?"text-bv-orange":""}`,onMouseEnter:f,onClick:H=>{H.stopPropagation(),c(),d(!1)},children:[i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 opacity-70",children:[i.jsx("circle",{cx:"6",cy:"6",r:"5.5"}),i.jsx("line",{x1:"4",y1:"4",x2:"8",y2:"8"}),i.jsx("line",{x1:"8",y1:"4",x2:"4",y2:"8"})]}),"remove"]}),e.map(H=>{const D=H===(n??t),G=D?"bg-bv-teal/9 text-bv-teal":"text-bv-text-mid hover:bg-bv-surface hover:text-bv-text";return i.jsx("div",{ref:D?g:void 0,className:`px-2.5 py-[3px] text-[11px] font-mono cursor-pointer ${G}`,onMouseEnter:()=>s(H),onClick:Q=>{Q.stopPropagation(),u(H),d(!1)},children:H},H)})]})})]})}const G0={px:.0625};function Mr(e){return isNaN(Number(e))?G0[e]??1/0:Number(e)}function wr(e,t,n){return t==="spacing"&&(n!=null&&n.spacing)?Object.keys(n.spacing).sort((o,l)=>Mr(o)-Mr(l)).map(o=>`${e}${o}`):t==="fontSize"?[...Ex]:t==="fontWeight"?[...jx]:t==="borderRadius"?Fa:t==="lineHeight"?[...Tx]:t==="letterSpacing"?[...Nx]:t==="opacity"?Rx:[]}const Y0=4,Q0=10;function Vr({placeholder:e,values:t,currentValue:n,displayValue:r,formatValue:o,axis:l="x",disabled:s,onHover:a,onLeave:u,onClick:c,onScrubStart:f,onScrubEnd:h,onOpen:d,onClose:m,onRemove:v,onRemoveHover:b}){const[S,p]=w.useState(!1),[g,y]=w.useState(null),x=w.useRef(null),k=w.useRef(null),C=w.useRef(null),{refs:j,floatingStyles:E}=bn({open:S,strategy:"fixed",placement:"bottom-start",middleware:[gn(4),xn(),yn({padding:4})],whileElementsMounted:mn}),A=n!=null,_=n?t.indexOf(n):-1,L=g!==null?t[g]:null,B=L?o?o(L):L:r??e;w.useEffect(()=>{var P,Y;S&&C.current&&((Y=(P=C.current).scrollIntoView)==null||Y.call(P,{block:"nearest"}))},[S]);function H(P){var X,Ne;if(s)return;P.preventDefault(),P.stopPropagation();const Y=_>=0?_:0;x.current={startX:P.clientX,startY:P.clientY,startIndex:Y,didScrub:!1},(Ne=(X=P.target).setPointerCapture)==null||Ne.call(X,P.pointerId)}function D(P){const Y=x.current;if(!Y)return;const X=l==="y"?-(P.clientY-Y.startY):P.clientX-Y.startX;if(!Y.didScrub&&Math.abs(X)>Y0&&(Y.didScrub=!0,p(!1),f==null||f()),Y.didScrub){const Ne=Math.round(X/Q0),Pe=Math.max(0,Math.min(t.length-1,Y.startIndex+Ne));y(Pe),a==null||a(t[Pe])}}function G(){const P=x.current;P&&(P.didScrub&&g!==null?(c==null||c(t[g]),y(null),x.current=null,h==null||h()):P.didScrub||(y(null),x.current=null,p(Y=>Y?(m==null||m(),u==null||u(),!1):(d==null||d(),!0))))}const Q=g!==null,T=["bm-slot",A||Q?"bm-has-val":"",Q?"bm-scrubbing":""].filter(Boolean).join(" "),R=s?"default":l==="y"?"ns-resize":"ew-resize";return i.jsxs("span",{ref:P=>{k.current=P,j.setReference(P)},className:T,style:{position:"relative",cursor:R},onPointerDown:H,onPointerMove:D,onPointerUp:G,role:"button",tabIndex:s?-1:0,children:[B,S&&i.jsx(vn,{children:i.jsxs(xr,{ref:j.setFloating,style:E,className:"bm-mini-dropdown",onClick:P=>P.stopPropagation(),onMouseLeave:()=>u==null?void 0:u(),onPointerDown:P=>P.stopPropagation(),onMouseDown:P=>{P.stopPropagation(),P.preventDefault()},onClose:()=>{p(!1),m==null||m(),u==null||u()},children:[v&&i.jsxs("div",{className:"bm-mini-dropdown-item bm-mini-dropdown-remove",tabIndex:-1,onMouseEnter:b,onMouseDown:P=>{P.preventDefault(),v(),p(!1),m==null||m()},children:[i.jsxs("svg",{viewBox:"0 0 10 10",width:"8",height:"8",xmlns:"http://www.w3.org/2000/svg",style:{display:"inline-block",flexShrink:0},children:[i.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"}),i.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"})]}),"remove"]}),t.map(P=>{const Y=P===n;return i.jsx("div",{ref:Y?C:void 0,tabIndex:-1,className:`bm-mini-dropdown-item${Y?" bm-active":""}`,onMouseEnter:()=>a==null?void 0:a(P),onMouseDown:X=>{X.preventDefault(),c==null||c(P),p(!1),m==null||m()},onClick:X=>{X.detail===0&&(X.stopPropagation(),c==null||c(P),p(!1),m==null||m())},onKeyDown:X=>{(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),c==null||c(P),p(!1),m==null||m())},children:P},P)})]})})]})}function Kd(e,t){const r={padding:"p",margin:"m",border:"border-",outline:"outline-"}[t];return e.startsWith(r)?e.slice(r.length):e}function X0({value:e,placeholder:t,layer:n,frozen:r,scaleValues:o,axis:l,onClick:s,onValueChange:a,onValueHover:u,onValueLeave:c,onScrubStart:f,onScrubEnd:h,onOpen:d,onClose:m,onValueRemove:v,onValueRemoveHover:b}){const S=e!=null,p=S?Kd(e,n):null;if(o&&o.length>0)return i.jsx(Vr,{placeholder:t,values:o,currentValue:e,displayValue:p,formatValue:y=>Kd(y,n),axis:l,disabled:r,onHover:u,onLeave:c,onClick:a,onScrubStart:f,onScrubEnd:h,onOpen:d,onClose:m,onRemove:v,onRemoveHover:b});const g=`bm-slot${S?" bm-has-val":""}`;return i.jsx("span",{className:g,onClick:r?void 0:y=>s==null?void 0:s(y.currentTarget),role:"button",tabIndex:r?-1:0,children:p??t})}const Z0={top:["y","t"],right:["r"],bottom:["b"],left:["x","l"],tr:["color"],bl:["style"],br:["offset"]},q0={margin:["top","right","bottom","left"],outline:["top","right","bottom","left","tr","bl","br"],border:["top","right","bottom","left","tr","bl"],padding:["top","right","bottom","left"]},J0={top:"y",bottom:"y",left:"x",right:"x",tr:"x",bl:"x",br:"x"};function e1({layer:e,classState:t,shorthandValue:n,shorthandScaleValues:r,slots:o,isHovered:l,frozen:s,onHoverChange:a,onSlotClick:u,onSlotChange:c,onSlotHover:f,onScrubStart:h,onScrubEnd:d,onSlotOpen:m,onSlotClose:v,onSlotRemove:b,onSlotRemoveHover:S,children:p}){const g=`bm-layer bm-${e}${l?" bm-hovered":""}`,[y,x]=w.useState(null),k=new Map(o.map(B=>[B.key,B])),C=(t==="shorthand"||t==="mixed")&&n,j=r&&r.length>0?i.jsx("span",{className:"bm-name bm-name-scrubber",children:i.jsx(Vr,{placeholder:e,values:r,currentValue:C?n:null,displayValue:C?n:null,formatValue:B=>B,axis:"x",disabled:s,onHover:B=>f==null?void 0:f("shorthand",B),onLeave:()=>f==null?void 0:f("shorthand",null),onClick:B=>c==null?void 0:c("shorthand",B),onScrubStart:()=>{h==null||h()},onScrubEnd:d,onOpen:()=>{x("__shorthand__"),m==null||m()},onClose:()=>{x(null),v==null||v()},onRemove:b?()=>b("shorthand"):void 0,onRemoveHover:S?()=>S("shorthand"):void 0})}):C?i.jsx("span",{className:"bm-name",children:i.jsx("span",{className:"bm-val",onClick:B=>u==null?void 0:u("shorthand",B.currentTarget),children:n})}):i.jsx("span",{className:"bm-name",children:e}),A=(q0[e]??[]).map(B=>{const D=(Z0[B]??[]).map(R=>k.get(R)).filter(R=>R!=null);if(D.length===0)return null;const G=D.some(R=>R.value!=null),q=`bm-slot-group bm-sg-${B}${G?" bm-has-values":""}${y===B?" bm-sg-active":""}`,T=J0[B];return i.jsx("div",{className:q,children:D.map(R=>i.jsx(X0,{slotKey:R.key,value:R.value,placeholder:R.placeholder,layer:e,isExpanded:l,frozen:s,scaleValues:R.scaleValues,axis:T,onClick:P=>u==null?void 0:u(R.key,P),onValueChange:c?P=>c(R.key,P):void 0,onValueHover:f?P=>f(R.key,P):void 0,onValueLeave:f?()=>f(R.key,null):void 0,onScrubStart:h,onScrubEnd:d,onOpen:()=>{x(B),m==null||m()},onClose:()=>{x(null),v==null||v()},onValueRemove:b?()=>b(R.key):void 0,onValueRemoveHover:S?()=>S(R.key):void 0},R.key))},B)}),_=B=>{B.stopPropagation(),s||a(!0)},L=B=>{const H=B.relatedTarget,D=B.currentTarget;H&&D.contains(H)||s||a(!1)};return i.jsxs("div",{className:g,onMouseOver:_,onMouseOut:L,"data-layer":e,children:[j,A,p]})}const Fd=["margin","outline","border","padding"];function t1({layers:e,frozen:t=!1,onSlotClick:n,onSlotChange:r,onSlotHover:o,onSlotRemove:l,onSlotRemoveHover:s,onEditStart:a}){const[u,c]=w.useState(null),[f,h]=w.useState(null),d=t||f!==null,m=new Map(e.map(y=>[y.layer,y])),v=(y,x)=>{d||c(x?y:null)},b=(y,x,k)=>{d||n==null||n(y,x,k)};let p=i.jsx("div",{className:"bm-content"});for(let y=Fd.length-1;y>=0;y--){const x=Fd[y],k=m.get(x);k&&(p=i.jsx(e1,{layer:k.layer,classState:k.classState,shorthandValue:k.shorthandValue,shorthandScaleValues:k.shorthandScaleValues,slots:k.slots,isHovered:u===x||f===x,frozen:d,onHoverChange:C=>v(x,C),onSlotClick:(C,j)=>b(x,C,j),onSlotChange:r?(C,j)=>r(x,C,j):void 0,onSlotHover:o?(C,j)=>o(x,C,j):void 0,onSlotRemove:l?C=>l(x,C):void 0,onSlotRemoveHover:s?C=>s(x,C):void 0,onScrubStart:()=>{h(x),a==null||a()},onScrubEnd:()=>h(null),onSlotOpen:()=>{h(x),a==null||a()},onSlotClose:()=>h(null),children:p}))}const g=`bm-root${d?" bm-frozen":""}`;return i.jsx("div",{className:g,children:p})}const n1={margin:{shorthand:"m",x:"mx",y:"my",t:"mt",r:"mr",b:"mb",l:"ml"},outline:{shorthand:"outline",x:"outline-x",y:"outline-y",t:"outline-t",r:"outline-r",b:"outline-b",l:"outline-l"},border:{shorthand:"border",x:"border-x",y:"border-y",t:"border-t",r:"border-r",b:"border-b",l:"border-l"},padding:{shorthand:"p",x:"px",y:"py",t:"pt",r:"pr",b:"pb",l:"pl"}},r1=["y","t","r","b","x","l"];function o1(e){const t=r1.map(n=>({key:n,placeholder:n}));return(e==="border"||e==="outline")&&t.push({key:"color",placeholder:"color"},{key:"style",placeholder:"style"}),e==="outline"&&t.push({key:"offset",placeholder:"offset"}),t}function l1(e,t){const n=n1[e],r=o1(e),o=t[n.shorthand]??null,l=o!=null?o===""?n.shorthand:`${n.shorthand}-${o}`:null,s=r.map(({key:d,placeholder:m})=>{let v;if(d==="color"){const p=e==="outline"?"outline-color":"border-color";v=p in t?p:void 0}else if(d==="style"){const p=e==="outline"?"outline-style":"border-style";v=p in t?p:void 0}else d==="offset"?v="outline-offset"in t?"outline-offset":void 0:v=n[d];const b=v?t[v]??null:null;let S;return(d==="color"||d==="style")&&b!=null?S=`${e==="outline"?"outline":"border"}-${b}`:S=b!=null&&v?`${v}-${b}`:null,{key:d,value:S,placeholder:m}}),a=l!=null,u=s.some(d=>(d.key==="x"||d.key==="y")&&d.value!=null),c=s.some(d=>(d.key==="t"||d.key==="r"||d.key==="b"||d.key==="l")&&d.value!=null),f=u||c;let h;return!a&&!f?h="none":a&&!f?h="shorthand":!a&&u&&!c?h="axis":a?h="mixed":h="individual",{layer:e,classState:h,shorthandValue:l,slots:s}}function s1(e,t,n){var s,a,u;if(t==="color")return[];if(t==="style"){const c=e==="outline"?"outline":"border";return _x.map(f=>`${c}-${f}`)}let r;e==="border"||e==="outline"?t==="offset"?r=(s=n==null?void 0:n.theme)!=null&&s.spacing?Object.keys(n.theme.spacing).sort((c,f)=>Mr(c)-Mr(f)):Ha:r=(a=n==null?void 0:n.theme)!=null&&a.borderWidth?Object.keys(n.theme.borderWidth):wh:r=(u=n==null?void 0:n.theme)!=null&&u.spacing?Object.keys(n.theme.spacing).sort((c,f)=>Mr(c)-Mr(f)):Ha;const l={margin:{shorthand:"m",t:"mt",r:"mr",b:"mb",l:"ml",x:"mx",y:"my"},padding:{shorthand:"p",t:"pt",r:"pr",b:"pb",l:"pl",x:"px",y:"py"},border:{t:"border-t",r:"border-r",b:"border-b",l:"border-l",x:"border-x",y:"border-y",offset:"outline-offset"},outline:{t:"outline-t",r:"outline-r",b:"outline-b",l:"outline-l",x:"outline-x",y:"outline-y",offset:"outline-offset"}}[e][t];return l?r.map(c=>c===""?l:`${l}-${c}`):[]}function Sr(e,t){const n={};for(const s of e){let a;s.color!==void 0?a=`${s.property}-color`:s.style!==void 0?a=`${s.property}-style`:s.side!==void 0?a=s.property.length<=2?s.property+s.side:`${s.property}-${s.side}`:a=s.property;const u=s.scale??s.color??s.style??s.align??s.size??s.value??"";n[a]=u}const r={margin:"m",padding:"p",border:"border",outline:"outline"},o={margin:!1,padding:!1,border:!0,outline:!1};return["margin","outline","border","padding"].map(s=>{var h,d;const a=l1(s,n),u=a.slots.map(m=>{const v=s1(s,m.key,t);return v.length>0?{...m,scaleValues:v}:m}),f=(o[s]?(h=t==null?void 0:t.theme)!=null&&h.borderWidth?Object.keys(t.theme.borderWidth):wh:(d=t==null?void 0:t.theme)!=null&&d.spacing?Object.keys(t.theme.spacing):Ha).map(m=>m===""?r[s]:`${r[s]}-${m}`);return{...a,slots:u,shorthandScaleValues:f}})}const i1={tl:[1,1],t:[1,2],tr:[1,3],l:[2,1],all:[2,2],r:[2,3],bl:[3,1],b:[3,2],br:[3,3]},a1={tl:"x",t:"x",tr:"x",l:"y",all:"x",r:"y",bl:"x",b:"x",br:"x"};function zi(e){return e==="rounded"?"—":e.replace(/^rounded-/,"").replace(/^(?:tl|tr|br|bl|[trbl])-/,"")}function u1({slot:e,frozen:t,isActive:n,onSlotClick:r,onSlotChange:o,onSlotHover:l,onSlotRemove:s,onSlotRemoveHover:a,onScrubStart:u,onScrubEnd:c,onOpen:f,onClose:h}){const[d,m]=i1[e.key],v=e.value!=null,b=`cm-slot${v?" cm-has-val":""}`,S=e.key==="all"?"cm-cell cm-cell-all cm-content":`cm-cell cm-cell-${e.key}`,p={gridRow:d,gridColumn:m},g=a1[e.key];return e.scaleValues&&e.scaleValues.length>0?i.jsx("div",{className:S,style:p,children:i.jsx(Vr,{placeholder:e.placeholder,values:e.scaleValues,currentValue:e.value,displayValue:v?zi(e.value):null,formatValue:zi,axis:g,disabled:t,onHover:y=>l(e.key,y),onLeave:()=>l(e.key,null),onClick:y=>o(e.key,y),onScrubStart:()=>u(e.key),onScrubEnd:c,onOpen:()=>f(e.key),onClose:h,onRemove:s?()=>s(e.key):void 0,onRemoveHover:a?()=>a(e.key):void 0})}):i.jsx("div",{className:S,style:p,children:i.jsx("span",{className:b,role:"button",tabIndex:t?-1:0,onClick:t?void 0:y=>r(e.key,y.currentTarget),children:v?zi(e.value):e.placeholder})})}function c1({state:e,frozen:t=!1,onSlotClick:n,onSlotChange:r,onSlotHover:o,onSlotRemove:l,onSlotRemoveHover:s,onEditStart:a}){const[u,c]=w.useState(null),f=t||u!==null,h=new Map(e.slots.map(b=>[b.key,b])),d=h.get("all")??{key:"all",value:e.shorthandValue,placeholder:"all",scaleValues:e.shorthandScaleValues},m=["tl","t","tr","l","all","r","bl","b","br"],v=`cm-root${f?" cm-frozen":""}${u?" cm-active":""}`;return i.jsx("div",{className:v,children:i.jsx("div",{className:"cm-grid",children:m.map(b=>{const S=b==="all"?d:h.get(b)??{key:b,value:null,placeholder:b,scaleValues:void 0};return i.jsx(u1,{slot:S,frozen:f,isActive:u===b,onSlotClick:(p,g)=>n==null?void 0:n(p,g),onSlotChange:(p,g)=>r==null?void 0:r(p,g),onSlotHover:(p,g)=>o==null?void 0:o(p,g),onSlotRemove:l,onSlotRemoveHover:s,onScrubStart:p=>{c(p),a==null||a()},onScrubEnd:()=>c(null),onOpen:p=>{c(p),a==null||a()},onClose:()=>c(null)},b)})})})}function Hd({label:e,availableProperties:t=[],onAddProperty:n,isEmpty:r=!1,classCount:o=0,children:l}){const[s,a]=w.useState(!1),[u,c]=w.useState(r),f=w.useRef(r),h=w.useRef(null);w.useEffect(()=>{f.current&&!r&&c(!1),f.current=r},[r]),w.useEffect(()=>{if(!s)return;function m(v){h.current&&!h.current.contains(v.target)&&a(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[s]);function d(m){n==null||n(m),a(!1)}return i.jsxs("div",{className:"px-4 py-3",children:[i.jsxs("div",{className:"group/sec flex items-center gap-1.5 cursor-pointer select-none",onClick:()=>c(m=>!m),children:[i.jsx("svg",{className:`w-3 h-3 text-bv-muted transition-transform ${u?"":"rotate-90"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})}),i.jsx("span",{className:"text-[10px] font-semibold text-bv-text",children:e}),u&&o>0&&i.jsx("span",{className:"ml-1 px-1.5 py-0.5 rounded-full text-[9px] font-semibold leading-none bg-bv-teal/20 text-bv-teal tabular-nums",children:o}),t.length>0&&i.jsxs("div",{ref:h,className:"relative ml-auto",children:[i.jsx("button",{type:"button","aria-label":`Add ${e} property`,className:`w-5 h-5 flex items-center justify-center rounded transition-all cursor-pointer border-none ${s?"text-bv-text bg-bv-surface-hi":"text-bv-muted bg-transparent opacity-75 group-hover/sec:opacity-100 hover:text-bv-text hover:bg-bv-surface-hi"}`,onClick:m=>{m.stopPropagation(),a(v=>!v)},children:i.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M12 5v14m-7-7h14"})})}),s&&i.jsx(xr,{className:"absolute z-50 top-[calc(100%+2px)] right-0 bg-bv-bg border border-bv-border rounded-md shadow-[0_4px_16px_rgba(0,0,0,0.10)] min-w-[180px] max-w-[calc(100vw-16px)] py-1",onClose:()=>a(!1),children:t.map(m=>i.jsxs("button",{type:"button",className:"w-full px-2.5 py-[5px] text-[11px] font-[family-name:var(--font-ui)] text-bv-text-mid flex items-center gap-1.5 transition-colors hover:bg-bv-teal/10 hover:text-bv-teal cursor-pointer border-none bg-transparent text-left whitespace-nowrap",onClick:()=>d(m.prefix),children:[m.name,i.jsx("span",{className:"font-mono text-[10px] text-bv-muted group-hover:text-bv-teal/60",children:m.prefixHint})]},m.prefix))})]})]}),i.jsx("div",{className:`overflow-hidden transition-[max-height,opacity] duration-200 ease-in-out ${u?"max-h-0 opacity-0":"max-h-[600px] opacity-100"}`,children:r?i.jsxs("div",{className:"text-[10px] text-bv-muted italic mt-2",children:["No ",e.toLowerCase()," classes — click + to add"]}):i.jsx("div",{className:"flex flex-wrap gap-1 mt-2.5",children:l})})]})}const d1=[{dir:"tl",arrow:"↖"},{dir:"t",arrow:"↑"},{dir:"tr",arrow:"↗"},{dir:"l",arrow:"←"},"center",{dir:"r",arrow:"→"},{dir:"bl",arrow:"↙"},{dir:"b",arrow:"↓"},{dir:"br",arrow:"↘"}];function f1({direction:e,mode:t,onHover:n,onLeave:r,onDirectionClick:o,onSolidClick:l,solidColorName:s}){const a=t==="solid";return i.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[i.jsx("div",{className:"grid grid-cols-3 gap-0.5",onMouseLeave:r,children:d1.map((u,c)=>{if(u==="center"){const h=a;return i.jsx("button",{type:"button",className:`w-5 h-5 rounded-[3px] flex items-center justify-center text-xs cursor-pointer transition-all duration-150
|
|
58
|
+
${h?"border-[1.5px] border-bv-teal bg-bv-teal text-white":"border-[1.5px] border-bv-border bg-bv-bg text-bv-muted hover:border-bv-teal hover:bg-bv-teal/9 hover:text-bv-teal"}`,title:"Solid color",onClick:l,children:"●"},"center")}const f=!a&&e===u.dir;return i.jsx("button",{type:"button",className:`w-5 h-5 rounded-[3px] flex items-center justify-center text-[10px] cursor-pointer transition-all duration-150
|
|
59
|
+
${a?"opacity-35 hover:opacity-100":""}
|
|
60
|
+
${f?"border-[1.5px] border-bv-teal bg-bv-teal text-white":"border-[1.5px] border-bv-border bg-bv-bg text-bv-muted hover:border-bv-teal hover:bg-bv-teal/9 hover:text-bv-teal"}`,onMouseEnter:()=>n(u.dir),onClick:()=>o(u.dir),children:u.arrow},u.dir)})}),i.jsx("div",{className:"text-[10px] font-mono text-bv-text-mid mt-0.75 max-w-[68px] truncate text-center",children:a?s?i.jsx("span",{className:"text-bv-text font-bold",children:s}):i.jsx("span",{className:"text-bv-muted italic",children:"none"}):i.jsxs("span",{children:["to-",i.jsx("span",{className:"text-bv-teal font-bold",children:e})]})})]})}function p1(e,t){const r=[...e].sort((o,l)=>(o.position??0)-(l.position??0)).map(o=>o.position!=null?`${o.hex} ${o.position}%`:o.hex);return`linear-gradient(${t}, ${r.join(", ")})`}function Ki(e){return Math.round(Math.max(0,Math.min(100,e))/5)*5}function h1({stop:e,isEndpoint:t,isSelected:n,onDragStart:r,onClick:o,onRemove:l}){const s=w.useRef(!1),a=w.useCallback(h=>{h.preventDefault(),h.stopPropagation(),s.current=!1,r(e.id,h.clientX);const d=()=>{s.current=!0},m=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",m)},[e.id,r]),u=w.useCallback(h=>{h.stopPropagation(),s.current||o(e.id,h.currentTarget)},[e.id,o]),c=w.useCallback(h=>{h.stopPropagation(),l(e.id)},[e.id,l]),f=e.position??0;return i.jsxs("div",{className:`absolute top-0 cursor-grab select-none z-10
|
|
61
|
+
hover:z-20
|
|
62
|
+
${n?"z-25":""}`,style:{left:`${f}%`,transform:"translateX(-50%)",width:22,height:26,filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.2))"},onMouseDown:a,onClick:u,title:`${e.role}-${e.colorName}${e.position!=null?` ${e.position}%`:""}`,children:[i.jsx("svg",{viewBox:"0 0 22 26",width:22,height:26,xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M2 1 L20 1 L20 16 L11 25 L2 16 Z",fill:e.hex,stroke:n?"#00848B":"white",strokeWidth:n?2:1.5,strokeLinejoin:"round"})}),!t&&i.jsx("div",{className:"absolute -top-1.5 -right-1.5 w-3.5 h-3.5 rounded-full bg-bv-orange text-white text-[9px] leading-3.5 text-center cursor-pointer z-40 hidden group-hover/handle:block hover:block!",style:{display:void 0},onClick:c,onMouseDown:h=>h.stopPropagation(),children:"×"})]})}function m1({stops:e,direction:t,onStopDrag:n,onStopDragEnd:r,onStopClick:o,onBarClick:l,onStopRemove:s,selectedStopId:a}){const u=w.useRef(null),c=w.useRef(null),f=[...e].sort((v,b)=>(v.position??0)-(b.position??0)),h=w.useCallback((v,b)=>{const S=e.find(y=>y.id===v);if(!S)return;c.current={stopId:v,startX:b,startPos:S.position??0};const p=y=>{const x=c.current;if(!x||!u.current)return;const k=u.current.getBoundingClientRect(),j=(y.clientX-x.startX)/k.width*100,E=Ki(x.startPos+j);n(x.stopId,E)},g=y=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",g);const x=c.current;if(x&&u.current){const k=u.current.getBoundingClientRect(),j=(y.clientX-x.startX)/k.width*100,E=Ki(x.startPos+j);r(x.stopId,E)}c.current=null};document.addEventListener("mousemove",p),document.addEventListener("mouseup",g)},[e,n,r]),d=w.useCallback(v=>{if(!u.current)return;const b=u.current.getBoundingClientRect(),S=(v.clientX-b.left)/b.width*100;l(Ki(S))},[l]),m=p1(f,t);return i.jsxs("div",{className:"relative flex-1 min-w-0",style:{paddingTop:28},children:[f.map((v,b)=>i.jsx(h1,{stop:v,isEndpoint:b===0||b===f.length-1,isSelected:v.id===a,onDragStart:h,onClick:o,onRemove:s},v.id)),i.jsx("div",{ref:u,className:"h-9 rounded-md cursor-pointer relative",style:{background:m,border:"1px solid rgba(0,0,0,0.08)",boxShadow:"inset 0 1px 2px rgba(0,0,0,0.06)"},onClick:d,children:i.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-lg font-bold text-white/0 hover:text-white/60 transition-colors pointer-events-none",children:"+"})})]})}const g1={t:"to top",tr:"to top right",r:"to right",br:"to bottom right",b:"to bottom",bl:"to bottom left",l:"to left",tl:"to top left"};function y1(e){var bt,Gt;const{direction:t,stops:n,mode:r,solidColorName:o,solidColorHex:l,onPreview:s,onPreviewBatch:a,onRevert:u,onStage:c}=e,[f,h]=w.useState(t),[d,m]=w.useState(n),[v,b]=w.useState(r),[S,p]=w.useState(o),[g,y]=w.useState(l),[x,k]=w.useState(null),[C,j]=w.useState(!1),[E,A]=w.useState(null),[_,L]=w.useState(null),B=w.useRef(n.length+1),H=w.useCallback(J=>{if(v==="gradient")s(`bg-gradient-to-${f}`,`bg-gradient-to-${J}`);else{const le=S??"slate-500",ie=S?`bg-${S}`:"";a([{oldClass:ie,newClass:`bg-gradient-to-${J}`},{oldClass:"",newClass:`from-${le}`},{oldClass:"",newClass:`to-${le}`}])}},[f,v,S,s,a]),D=w.useCallback(()=>{u()},[u]),G=w.useCallback(J=>{if(h(J),b("gradient"),v==="gradient"&&d.length>=2){const le=`bg-gradient-to-${f}`,ie=`bg-gradient-to-${J}`;c(le,ie)}else{const le=S??"slate-500",ie=g??nr(le,e.colors),N={id:"1",role:"from",colorName:le,hex:ie,position:0},O={id:"2",role:"to",colorName:le,hex:ie,position:100};B.current=3,m([N,O]);const K=S?`bg-${S}`:"";c(K,`bg-gradient-to-${J}`),c("",`from-${le}`),c("",`to-${le}`)}},[f,v,d,S,g,e.colors,c]),Q=w.useCallback(()=>{b("solid"),j(!1),k(null),A(null),d.length>0&&!S&&(p(d[0].colorName),y(d[0].hex))},[d,S]),q=w.useCallback((J,le)=>{m(N=>N.map(O=>O.id===J?{...O,position:le}:O));const ie=d.find(N=>N.id===J);if(ie){const N=ie.position!=null?`${ie.role}-${ie.position}%`:"",O=`${ie.role}-${le}%`;s(N,O)}},[d,s]),T=w.useCallback((J,le)=>{m(N=>N.map(O=>O.id===J?{...O,position:le}:O));const ie=d.find(N=>N.id===J);if(ie){const N=ie.position!=null?`${ie.role}-${ie.position}%`:"",O=`${ie.role}-${le}%`;c(N,O)}},[d,c]),R=w.useCallback((J,le)=>{x===J&&C?(k(null),j(!1),A(null),L(null)):(k(J),j(!0),A("stop"),L(le))},[x,C]),P=w.useCallback(J=>{const le=String(B.current++),ie=[...d].sort((K,ee)=>(K.position??0)-(ee.position??0));let N=ie[0];for(const K of ie)(K.position??0)<=J&&(N=K);const O={id:le,role:"via",colorName:(N==null?void 0:N.colorName)??"gray-500",hex:(N==null?void 0:N.hex)??"#6B7280",position:J};m(K=>[...K,O]),k(le),j(!0),A("stop")},[d]),Y=w.useCallback(J=>{const le=d.find(N=>N.id===J);if(!le)return;const ie=d.filter(N=>N.id!==J);if(k(null),j(!1),A(null),L(null),ie.length>=2)m(ie),c(`${le.role}-${le.colorName}`,"");else if(ie.length===1){const N=ie[0];m([]),b("solid"),p(N.colorName),y(N.hex),c(`bg-gradient-to-${f}`,""),d.forEach(O=>c(`${O.role}-${O.colorName}`,"")),c("",`bg-${N.colorName}`)}else m([]),b("none"),p(null),y(null),c(`bg-gradient-to-${f}`,""),d.forEach(N=>c(`${N.role}-${N.colorName}`,""))},[d,f,c]),X=w.useCallback(J=>{j(!0),A("solid"),k(null),L(J)},[]),Ne=w.useCallback(()=>{s(S?`bg-${S}`:"","")},[S,s]),Pe=w.useCallback(()=>{S&&c(`bg-${S}`,""),p(null),y(null),j(!1),A(null),L(null)},[S,c]),$=w.useCallback(J=>{if(E==="stop"&&x){const le=d.find(ie=>ie.id===x);le&&s(`${le.role}-${le.colorName}`,J)}else E==="solid"&&s(`bg-${S}`,J)},[E,x,d,S,s]),ne=w.useCallback(()=>{u()},[u]),me=w.useCallback(J=>{if(E==="stop"&&x){const le=d.find(ie=>ie.id===x);if(le){const ie=le.role+"-",N=J.startsWith(ie)?J.slice(ie.length):J;m(O=>O.map(K=>K.id===x?{...K,colorName:N,hex:nr(N,e.colors)}:K)),c(`${le.role}-${le.colorName}`,`${le.role}-${N}`),j(!1),k(null),A(null),L(null)}}else if(E==="solid"){const le="bg-",ie=J.startsWith(le)?J.slice(le.length):J,N=S?`bg-${S}`:"";p(ie),y(nr(ie,e.colors)),c(N,`bg-${ie}`),j(!1),A(null),L(null)}},[E,x,d,S,c,e.colors]),z=w.useCallback(()=>{j(!1),k(null),A(null),L(null),u()},[u]),he=E==="stop"&&x?(((bt=d.find(J=>J.id===x))==null?void 0:bt.role)??"from")+"-":"bg-",nt=E==="stop"&&x?((Gt=d.find(J=>J.id===x))==null?void 0:Gt.colorName)??"":S??"",xt=g1[f],rt=!!(x?d.find(J=>J.id===x):null);return{direction:f,stops:d,mode:v,solidColorName:S,solidColorHex:g,selectedStopId:x,colorPickerOpen:C,editingTarget:E,anchorEl:_,colorPrefix:he,colorPickerCurrentValue:nt,directionCSS:xt,selectedStopIsRemovable:rt,handleDirectionHover:H,handleDirectionLeave:D,handleDirectionClick:G,handleSolidToggle:Q,handleStopDrag:q,handleStopDragEnd:T,handleStopClick:R,handleBarClick:P,handleStopRemove:Y,handleSwatchClick:X,handleHoverRemoveSolid:Ne,handleRemoveSolid:Pe,handleColorHover:$,handleColorLeave:ne,handleColorClick:me,handleCloseColorPicker:z}}function nr(e,t){if(console.log(`[resolveColorHex] Looking up colorName="${e}", available top-level keys:`,Object.keys(t).join(", ")),typeof t[e]=="string")return console.log(`[resolveColorHex] Found direct match: colors["${e}"] = "${t[e]}"`),t[e];if(t[e]&&typeof t[e]=="object"&&typeof t[e].DEFAULT=="string")return console.log(`[resolveColorHex] Found DEFAULT match: colors["${e}"].DEFAULT = "${t[e].DEFAULT}"`),t[e].DEFAULT;const n=e.lastIndexOf("-");if(n>0){const r=e.slice(0,n),o=e.slice(n+1);if(console.log(`[resolveColorHex] Trying hue="${r}" shade="${o}", colors["${r}"] =`,typeof t[r],t[r]?Object.keys(t[r]).slice(0,5).join(", "):"undefined"),t[r]&&typeof t[r][o]=="string")return console.log(`[resolveColorHex] Found hue-shade match: colors["${r}"]["${o}"] = "${t[r][o]}"`),t[r][o]}return console.warn(`[resolveColorHex] FALLBACK #888888 for colorName="${e}" — color not found in config`),"#888888"}function x1(e){const t=y1(e),n=t.mode==="solid",{refs:r,floatingStyles:o,context:l}=bn({open:t.colorPickerOpen,onOpenChange:u=>{u||t.handleCloseColorPicker()},strategy:"fixed",placement:"bottom-start",middleware:[gn(4),xn(),yn({padding:8}),Xa({apply({availableHeight:u,elements:c}){Object.assign(c.floating.style,{maxHeight:`${u}px`})},padding:8})],whileElementsMounted:mn}),s=fr(l),{getFloatingProps:a}=pr([s]);return w.useEffect(()=>{t.anchorEl&&r.setReference(t.anchorEl)},[t.anchorEl]),i.jsxs("div",{className:"group",children:[i.jsxs("div",{className:"flex items-start gap-2.5 mb-2",children:[i.jsx(f1,{direction:t.direction,mode:t.mode,onHover:t.handleDirectionHover,onLeave:t.handleDirectionLeave,onDirectionClick:t.handleDirectionClick,onSolidClick:t.handleSolidToggle,solidColorName:t.solidColorName}),n?i.jsx("div",{className:"flex-1 min-w-0 self-stretch rounded-md cursor-pointer relative overflow-hidden",style:{background:t.solidColorHex??"transparent",border:"1px solid rgba(255,255,255,0.12)",boxShadow:"inset 0 1px 2px rgba(0,0,0,0.06)",minHeight:36},onClick:u=>t.handleSwatchClick(u.currentTarget),title:t.solidColorName?`bg-${t.solidColorName}`:"Click to pick color",children:!t.solidColorHex&&i.jsxs("svg",{className:"absolute inset-0 w-full h-full",viewBox:"0 0 100 100",preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("line",{x1:"4",y1:"4",x2:"96",y2:"96",stroke:"#F5532D",strokeWidth:"3",strokeLinecap:"round"}),i.jsx("line",{x1:"96",y1:"4",x2:"4",y2:"96",stroke:"#F5532D",strokeWidth:"3",strokeLinecap:"round"})]})}):i.jsx(m1,{stops:t.stops,direction:t.directionCSS,onStopDrag:t.handleStopDrag,onStopDragEnd:t.handleStopDragEnd,onStopClick:t.handleStopClick,onBarClick:t.handleBarClick,onStopRemove:t.handleStopRemove,selectedStopId:t.selectedStopId})]}),t.colorPickerOpen&&i.jsx(vn,{children:i.jsxs("div",{ref:r.setFloating,style:{...o,zIndex:9999,overflowY:"auto"},...a(),children:[i.jsx(Yl,{prefix:t.colorPrefix,currentValue:t.colorPickerCurrentValue,colors:e.colors,locked:!1,lockedValue:null,onHover:t.handleColorHover,onLeave:t.handleColorLeave,onClick:t.handleColorClick,onRemove:t.editingTarget==="solid"?t.handleRemoveSolid:void 0,onRemoveHover:t.editingTarget==="solid"?t.handleHoverRemoveSolid:void 0}),t.selectedStopIsRemovable&&i.jsx("button",{type:"button",className:"mt-1.5 w-full text-[10px] text-bv-orange border border-bv-orange/40 rounded px-2 py-0.5 cursor-pointer hover:bg-bv-orange hover:text-white transition-colors",onClick:()=>{t.selectedStopId&&t.handleStopRemove(t.selectedStopId)},children:"Remove stop"})]})}),i.jsx("div",{className:"min-h-[1rem] text-[10px] text-bv-muted italic opacity-0 invisible transition-opacity duration-150 group-hover:opacity-100 group-hover:visible group-focus-within:opacity-100 group-focus-within:visible",children:n?"Click the swatch to change color · Click a direction arrow for gradient":"Click handles to change color · Drag to reposition · Click bar to add stop"})]})}function v1(e,t,n){var y;const r=new Map;for(const x of e)r.set(x.fullClass,!0);if(n)for(const x of n)x.kind==="class-change"&&x.status==="staged"&&(x.originalClass&&r.delete(x.originalClass),x.newClass&&r.set(x.newClass,!0));const o=e.find(x=>x.property==="bg-gradient-to"),l=Array.from(r.keys()).find(x=>x.startsWith("bg-gradient-to-")),a=(l==null?void 0:l.replace("bg-gradient-to-",""))||(o==null?void 0:o.fullClass.slice(15))||"r",c=((y=Array.from(r.keys()).filter(x=>x.startsWith("bg-")&&!x.startsWith("bg-gradient-to-"))[0])==null?void 0:y.replace("bg-",""))??null,f=(c==null?void 0:c.split("/")[0])??null,h=f?nr(f,t):null,d=Array.from(r.keys()),m=d.filter(x=>x.startsWith("from-")),v=d.filter(x=>x.startsWith("via-")),b=d.filter(x=>x.startsWith("to-")),S=!!(l||m.length>0&&b.length>0),p=S?"gradient":"solid",g=[];if(S){let x=1;for(const k of m){const C=k.replace("from-",""),j=C.split("/")[0];g.push({id:String(x++),role:"from",colorName:C,hex:nr(j,t),position:null})}for(const k of v){const C=k.replace("via-",""),j=C.split("/")[0];g.push({id:String(x++),role:"via",colorName:C,hex:nr(j,t),position:null})}for(const k of b){const C=k.replace("to-",""),j=C.split("/")[0];g.push({id:String(x++),role:"to",colorName:C,hex:nr(j,t),position:null})}}return{direction:a,stops:g,mode:p,solidColorName:c,solidColorHex:h,colors:t}}const Ke="#00848B",mr="rgba(0,132,139,0.18)",b1="#F5532D",jt="#4a4a4a",Wn="#333333",Me="#999999",Je="'Roboto Mono', 'Menlo', ui-monospace, monospace",Bt={width:60,height:60,borderRadius:5,borderWidth:"1.5px",borderStyle:"solid",borderColor:jt,background:Wn,display:"flex",padding:4,overflow:"hidden",transition:"border-color 150ms ease-in-out, background-color 150ms ease-in-out, box-shadow 150ms ease-in-out",boxSizing:"border-box"},Za={background:Ke,opacity:.65,borderRadius:2,flexShrink:0,transition:"opacity 150ms ease-in-out"},Wd={...Za,opacity:.9},Bh={flexShrink:0,background:b1,opacity:.18,borderRadius:1,transition:"opacity 150ms ease-in-out"},w1={...Bh,opacity:.38};function Jt({label:e,isActive:t,containerStyle:n,onClick:r,onHover:o,children:l}){const[s,a]=w.useState(!1),u=t||s,c={...Bt,borderColor:u?Ke:jt,background:u?mr:Wn,boxShadow:t?"0 0 0 2px rgba(0,132,139,0.35)":"none",...n};return i.jsxs("div",{className:"cursor-pointer",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3},onMouseEnter:()=>{a(!0),o==null||o()},onMouseLeave:()=>a(!1),onClick:r,children:[i.jsx("div",{style:c,children:l(u)}),i.jsx("span",{style:{fontSize:9,fontFamily:Je,color:u?Ke:Me,fontWeight:u?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:e})]})}const Fi=[{value:"flex-row",label:"row",arrow:"→"},{value:"flex-col",label:"col",arrow:"↓"},{value:"flex-row-reverse",label:"row-reverse",arrow:"←"},{value:"flex-col-reverse",label:"col-reverse",arrow:"↑"}];function Vh({direction:e,color:t}){const n={stroke:t,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"};switch(e){case"flex-row":return i.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",children:[i.jsx("line",{x1:"5",y1:"15",x2:"25",y2:"15",...n}),i.jsx("polyline",{points:"19,9 25,15 19,21",...n})]});case"flex-col":return i.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",children:[i.jsx("line",{x1:"15",y1:"5",x2:"15",y2:"25",...n}),i.jsx("polyline",{points:"9,19 15,25 21,19",...n})]});case"flex-row-reverse":return i.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",children:[i.jsx("line",{x1:"25",y1:"15",x2:"5",y2:"15",...n}),i.jsx("polyline",{points:"11,9 5,15 11,21",...n})]});case"flex-col-reverse":return i.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",children:[i.jsx("line",{x1:"15",y1:"25",x2:"15",y2:"5",...n}),i.jsx("polyline",{points:"9,11 15,5 21,11",...n})]})}}function S1({currentValue:e,lockedValue:t,locked:n,onHover:r,onLeave:o,onClick:l}){const[s,a]=w.useState(!1),{refs:u,floatingStyles:c,context:f}=bn({open:s,onOpenChange:C=>{C||(a(!1),o())},strategy:"fixed",placement:"bottom-start",middleware:[gn(4),xn(),yn({padding:8})],whileElementsMounted:mn}),h=fr(f),{getReferenceProps:d,getFloatingProps:m}=pr([h]),v=t!==null&&Fi.some(C=>C.value===t),b=n&&!v,S=v?t:e??"",p=Fi.find(C=>C.value===S),g=!p;function y(){a(!1),o()}function x(){b||a(C=>(C&&o(),!C))}const k=g?{...Bt,borderStyle:"dashed",borderColor:s?Ke:jt,background:s?mr:"transparent",alignItems:"center",justifyContent:"center",cursor:b?"default":"pointer"}:{...Bt,borderColor:s?Ke:jt,background:s?mr:Wn,boxShadow:s?"0 0 0 2px rgba(0,132,139,0.18)":"none",alignItems:"center",justifyContent:"center",cursor:b?"default":"pointer"};return i.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:2},children:[i.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Me,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Direction"}),i.jsxs("div",{ref:u.setReference,role:"button",tabIndex:b?-1:0,"aria-label":"Direction",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3},onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&x()},onClick:x,...d(),children:[i.jsx("div",{style:k,children:p?i.jsx(Vh,{direction:p.value,color:s?Ke:Me}):i.jsx("span",{style:{fontSize:10,fontFamily:Je,color:Me},children:"—"})}),i.jsx("span",{style:{fontSize:9,fontFamily:Je,color:s?Ke:Me,fontWeight:s?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:(p==null?void 0:p.label)??"—"})]}),s&&i.jsx(vn,{children:i.jsx("div",{ref:u.setFloating,style:c,className:"z-[9999]",...m(),children:i.jsx(xr,{style:{background:"#1e1e1e",border:`1px solid ${jt}`,borderRadius:8,boxShadow:"0 4px 16px rgba(0,0,0,0.35)",padding:8},onMouseLeave:o,onClose:y,children:i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 60px)",gap:4},children:Fi.map(C=>{const j=C.value===S;return i.jsx(C1,{option:C,isActive:j,onHover:()=>r(C.value),onClick:()=>{l(C.value),y()}},C.value)})})})})})]})}function C1({option:e,isActive:t,onHover:n,onClick:r}){const[o,l]=w.useState(!1),s=t||o,a={...Bt,borderColor:s?Ke:jt,background:s?mr:Wn,boxShadow:t?"0 0 0 2px rgba(0,132,139,0.35)":"none",alignItems:"center",justifyContent:"center"};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3,cursor:"pointer"},onMouseEnter:()=>{l(!0),n()},onMouseLeave:()=>l(!1),onClick:r,children:[i.jsx("div",{style:a,children:i.jsx(Vh,{direction:e.value,color:s?Ke:Me})}),i.jsx("span",{style:{fontSize:9,fontFamily:Je,color:s?Ke:Me,fontWeight:s?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:e.label})]})}const Hi=[{value:"flex-nowrap",label:"no-wrap"},{value:"flex-wrap",label:"wrap"},{value:"flex-wrap-reverse",label:"wrap-reverse"}],k1=e=>({stroke:e,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"});function Uh({mode:e,color:t}){const n=k1(t),r={...n,strokeDasharray:"2 3"};return e==="flex-nowrap"?i.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[i.jsx("line",{x1:"3",y1:"7",x2:"37",y2:"7",...n}),i.jsx("polyline",{points:"31,1 37,7 31,13",...n})]}):e==="flex-wrap"?i.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[i.jsx("line",{x1:"3",y1:"7",x2:"37",y2:"7",...n}),i.jsx("line",{x1:"37",y1:"7",x2:"3",y2:"33",...r}),i.jsx("line",{x1:"3",y1:"33",x2:"37",y2:"33",...n}),i.jsx("polyline",{points:"31,27 37,33 31,39",...n})]}):i.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[i.jsx("line",{x1:"3",y1:"33",x2:"37",y2:"33",...n}),i.jsx("line",{x1:"37",y1:"33",x2:"3",y2:"7",...r}),i.jsx("line",{x1:"3",y1:"7",x2:"37",y2:"7",...n}),i.jsx("polyline",{points:"31,1 37,7 31,13",...n})]})}function E1({option:e,isActive:t,onHover:n,onClick:r}){const[o,l]=w.useState(!1),s=t||o,a={...Bt,borderColor:s?Ke:jt,background:s?mr:Wn,boxShadow:t?"0 0 0 2px rgba(0,132,139,0.35)":"none",alignItems:"center",justifyContent:"center"};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3,cursor:"pointer"},onMouseEnter:()=>{l(!0),n()},onMouseLeave:()=>l(!1),onClick:r,children:[i.jsx("div",{style:a,children:i.jsx(Uh,{mode:e.value,color:s?Ke:Me})}),i.jsx("span",{style:{fontSize:9,fontFamily:Je,color:s?Ke:Me,fontWeight:s?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:e.label})]})}function j1({currentValue:e,lockedValue:t,locked:n,onHover:r,onLeave:o,onClick:l}){const[s,a]=w.useState(!1),{refs:u,floatingStyles:c,context:f}=bn({open:s,onOpenChange:C=>{C||(a(!1),o())},strategy:"fixed",placement:"bottom-start",middleware:[gn(4),xn(),yn({padding:8})],whileElementsMounted:mn}),h=fr(f),{getReferenceProps:d,getFloatingProps:m}=pr([h]),v=t!==null&&Hi.some(C=>C.value===t),b=n&&!v,S=!v&&e===null,p=v?t:e??"",g=Hi.find(C=>C.value===p),y=(g==null?void 0:g.label)??"Wrap";function x(){a(!1),o()}function k(){b||a(C=>(C&&o(),!C))}return i.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:2},children:[i.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Me,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Wrap"}),i.jsxs("div",{ref:u.setReference,role:"button",tabIndex:b?-1:0,"aria-label":"Wrap",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3},onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&k()},onClick:k,...d(),children:[S?i.jsx("div",{style:{...Bt,borderStyle:"dashed",borderColor:s?Ke:jt,background:s?mr:"transparent",alignItems:"center",justifyContent:"center"},children:i.jsx("span",{style:{fontSize:10,fontFamily:Je,color:Me},children:"—"})}):i.jsx("div",{style:{...Bt,borderColor:s?Ke:jt,background:s?mr:Wn,boxShadow:s?"0 0 0 2px rgba(0,132,139,0.18)":"none",alignItems:"center",justifyContent:"center"},children:i.jsx(Uh,{mode:p,color:s?Ke:Me})}),i.jsx("span",{style:{fontSize:9,fontFamily:Je,color:s?Ke:Me,fontWeight:s?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:y})]}),s&&i.jsx(vn,{children:i.jsx("div",{ref:u.setFloating,style:c,className:"z-[9999]",...m(),children:i.jsx(xr,{style:{background:"#1e1e1e",border:`1px solid ${jt}`,borderRadius:8,boxShadow:"0 4px 16px rgba(0,0,0,0.35)",padding:8},onMouseLeave:o,onClose:x,children:i.jsx("div",{className:"grid gap-1",style:{gridTemplateColumns:"repeat(3, 60px)"},children:Hi.map(C=>{const j=C.value===p;return i.jsx(E1,{option:C,isActive:j,onHover:()=>r(C.value),onClick:()=>{l(C.value),x()}},C.value)})})})})})]})}function T1({flexDirection:e="row",activeValue:t,onSelect:n,onHover:r}){const o=e.startsWith("column"),l=e;function s(d,m){const v=m?Wd:Za;return o?{...v,width:"100%",height:d}:{...v,width:d,height:"100%"}}function a(d){const m=d?Wd:Za;return o?{...m,flex:1,width:"100%"}:{...m,flex:1,height:"100%"}}function u(d,m){return{...m?w1:Bh,flex:d}}const c=d=>t===d,f=d=>()=>n==null?void 0:n(d),h=d=>()=>r==null?void 0:r(d);return i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 60px)",gap:4},children:[i.jsx(Jt,{label:"start",isActive:c("justify-start"),onClick:f("justify-start"),onHover:h("justify-start"),containerStyle:{flexDirection:l,justifyContent:"flex-start",gap:2},children:d=>i.jsxs(i.Fragment,{children:[i.jsx("div",{style:s(10,d)}),i.jsx("div",{style:s(14,d)}),i.jsx("div",{style:s(8,d)})]})}),i.jsx(Jt,{label:"center",isActive:c("justify-center"),onClick:f("justify-center"),onHover:h("justify-center"),containerStyle:{flexDirection:l,justifyContent:"center",gap:2},children:d=>i.jsxs(i.Fragment,{children:[i.jsx("div",{style:s(10,d)}),i.jsx("div",{style:s(14,d)}),i.jsx("div",{style:s(8,d)})]})}),i.jsx(Jt,{label:"stretch",isActive:c("justify-stretch"),onClick:f("justify-stretch"),onHover:h("justify-stretch"),containerStyle:{flexDirection:l,gap:2},children:d=>i.jsxs(i.Fragment,{children:[i.jsx("div",{style:a(d)}),i.jsx("div",{style:a(d)}),i.jsx("div",{style:a(d)})]})}),i.jsx(Jt,{label:"between",isActive:c("justify-between"),onClick:f("justify-between"),onHover:h("justify-between"),containerStyle:{flexDirection:l},children:d=>i.jsxs(i.Fragment,{children:[i.jsx("div",{style:s(12,d)}),i.jsx("div",{style:u(1,d)}),i.jsx("div",{style:s(12,d)})]})}),i.jsx(Jt,{label:"around",isActive:c("justify-around"),onClick:f("justify-around"),onHover:h("justify-around"),containerStyle:{flexDirection:l},children:d=>i.jsxs(i.Fragment,{children:[i.jsx("div",{style:u(1,d)}),i.jsx("div",{style:s(12,d)}),i.jsx("div",{style:u(2,d)}),i.jsx("div",{style:s(12,d)}),i.jsx("div",{style:u(1,d)})]})}),i.jsx(Jt,{label:"evenly",isActive:c("justify-evenly"),onClick:f("justify-evenly"),onHover:h("justify-evenly"),containerStyle:{flexDirection:l},children:d=>i.jsxs(i.Fragment,{children:[i.jsx("div",{style:u(1,d)}),i.jsx("div",{style:s(12,d)}),i.jsx("div",{style:u(1,d)}),i.jsx("div",{style:s(12,d)}),i.jsx("div",{style:u(1,d)})]})}),i.jsx(Jt,{label:"end",isActive:c("justify-end"),onClick:f("justify-end"),onHover:h("justify-end"),containerStyle:{flexDirection:l,justifyContent:"flex-end",gap:2},children:d=>i.jsxs(i.Fragment,{children:[i.jsx("div",{style:s(10,d)}),i.jsx("div",{style:s(14,d)}),i.jsx("div",{style:s(8,d)})]})})]})}const un="bg-bv-teal/50 rounded-[2px] shrink-0 group-hover:bg-bv-teal/70 transition-colors duration-150",N1="bg-bv-orange/10 rounded-[2px]";function nn({isCol:e,main:t}){return i.jsx("div",{className:un,style:e?{height:t}:{width:t}})}function Yn({flex:e=1}){return i.jsx("div",{className:N1,style:{flex:e}})}function Zt({isCol:e,w:t,h:n}){return i.jsx("div",{className:un,style:e?{width:n,height:t}:{width:t,height:n}})}function Wi({isCol:e,w:t,h:n,pt:r}){return i.jsx("div",{className:`${un} text-[5px] text-white/80 leading-none overflow-hidden text-center`,style:e?{width:n,height:t,paddingLeft:r}:{width:t,height:n,paddingTop:r},children:"t"})}function Bi(e){return i.jsxs(i.Fragment,{children:[i.jsx(nn,{isCol:e,main:10}),i.jsx(nn,{isCol:e,main:14}),i.jsx(nn,{isCol:e,main:8})]})}const Bd=[{value:"justify-start",label:"start",getContainerStyle:e=>({flexDirection:e,justifyContent:"flex-start",gap:2}),renderItems:e=>Bi(e.startsWith("column"))},{value:"justify-center",label:"center",getContainerStyle:e=>({flexDirection:e,justifyContent:"center",gap:2}),renderItems:e=>Bi(e.startsWith("column"))},{value:"justify-stretch",label:"stretch",getContainerStyle:e=>({flexDirection:e,gap:2}),renderItems:()=>i.jsxs(i.Fragment,{children:[i.jsx("div",{className:`${un} flex-1`}),i.jsx("div",{className:`${un} flex-1`}),i.jsx("div",{className:`${un} flex-1`})]})},{value:"justify-between",label:"between",getContainerStyle:e=>({flexDirection:e}),renderItems:e=>{const t=e.startsWith("column");return i.jsxs(i.Fragment,{children:[i.jsx(nn,{isCol:t,main:12}),i.jsx(Yn,{}),i.jsx(nn,{isCol:t,main:12})]})}},{value:"justify-around",label:"around",getContainerStyle:e=>({flexDirection:e}),renderItems:e=>{const t=e.startsWith("column");return i.jsxs(i.Fragment,{children:[i.jsx(Yn,{flex:1}),i.jsx(nn,{isCol:t,main:12}),i.jsx(Yn,{flex:2}),i.jsx(nn,{isCol:t,main:12}),i.jsx(Yn,{flex:1})]})}},{value:"justify-evenly",label:"evenly",getContainerStyle:e=>({flexDirection:e}),renderItems:e=>{const t=e.startsWith("column");return i.jsxs(i.Fragment,{children:[i.jsx(Yn,{}),i.jsx(nn,{isCol:t,main:12}),i.jsx(Yn,{}),i.jsx(nn,{isCol:t,main:12}),i.jsx(Yn,{})]})}},{value:"justify-end",label:"end",getContainerStyle:e=>({flexDirection:e,justifyContent:"flex-end",gap:2}),renderItems:e=>Bi(e.startsWith("column"))}],Vi=[{value:"items-start",label:"start",getContainerStyle:e=>({flexDirection:e,alignItems:"flex-start",gap:3}),renderItems:e=>{const t=e.startsWith("column");return i.jsxs(i.Fragment,{children:[i.jsx(Zt,{isCol:t,w:13,h:22}),i.jsx(Zt,{isCol:t,w:15,h:42}),i.jsx(Zt,{isCol:t,w:11,h:14})]})}},{value:"items-center",label:"center",getContainerStyle:e=>({flexDirection:e,alignItems:"center",gap:3}),renderItems:e=>{const t=e.startsWith("column");return i.jsxs(i.Fragment,{children:[i.jsx(Zt,{isCol:t,w:13,h:22}),i.jsx(Zt,{isCol:t,w:15,h:42}),i.jsx(Zt,{isCol:t,w:11,h:14})]})}},{value:"items-baseline",label:"baseline",getContainerStyle:e=>({flexDirection:e,alignItems:"baseline",gap:3}),renderItems:e=>{const t=e.startsWith("column");return i.jsxs(i.Fragment,{children:[i.jsx(Wi,{isCol:t,w:13,h:38,pt:17}),i.jsx(Wi,{isCol:t,w:15,h:26,pt:3}),i.jsx(Wi,{isCol:t,w:11,h:32,pt:10})]})}},{value:"items-stretch",label:"stretch",getContainerStyle:e=>({flexDirection:e,alignItems:"stretch",gap:3}),renderItems:e=>{const t=e.startsWith("column");return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:un,style:t?{height:13}:{width:13}}),i.jsx("div",{className:un,style:t?{height:15}:{width:15}}),i.jsx("div",{className:un,style:t?{height:11}:{width:11}})]})}},{value:"items-end",label:"end",getContainerStyle:e=>({flexDirection:e,alignItems:"flex-end",gap:3}),renderItems:e=>{const t=e.startsWith("column");return i.jsxs(i.Fragment,{children:[i.jsx(Zt,{isCol:t,w:13,h:22}),i.jsx(Zt,{isCol:t,w:15,h:42}),i.jsx(Zt,{isCol:t,w:11,h:14})]})}}];function R1({currentValue:e,lockedValue:t,locked:n,flexDirection:r="row",onHover:o,onLeave:l,onClick:s,onRemove:a,onRemoveHover:u}){const[c,f]=w.useState(!1),{refs:h,floatingStyles:d,context:m}=bn({open:c,onOpenChange:_=>{_||(f(!1),l())},strategy:"fixed",placement:"bottom-start",middleware:[gn(4),xn(),yn({padding:8})],whileElementsMounted:mn}),v=fr(m),{getReferenceProps:b,getFloatingProps:S}=pr([v]),p=t!==null&&Bd.some(_=>_.value===t),g=n&&!p,y=!p&&(e===null||e===""),x=p?t:e??"",k=Bd.find(_=>_.value===x),C=(k==null?void 0:k.label)??"—";function j(){f(!1),l()}function E(){g||f(_=>(_&&l(),!_))}const A={...Bt,borderStyle:"dashed",alignItems:"center",justifyContent:"center"};return i.jsxs("div",{className:"flex flex-col items-start gap-1",children:[i.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Me,fontWeight:500},children:"JUSTIFY →"}),i.jsx("div",{ref:h.setReference,className:"cursor-pointer",role:"button",tabIndex:g?-1:0,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&E()},onClick:E,...b(),children:y?i.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[i.jsx("div",{style:A,children:i.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Me},children:"—"})}),i.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Me},children:"none"})]}):i.jsx(Jt,{label:C,isActive:c,containerStyle:(k==null?void 0:k.getContainerStyle(r))??{flexDirection:r},children:_=>(k==null?void 0:k.renderItems(r))??null})}),c&&i.jsx(vn,{children:i.jsx("div",{ref:h.setFloating,style:d,className:"z-[9999]",...S(),children:i.jsxs(xr,{className:"bg-bv-bg border border-bv-border rounded-lg shadow-lg p-2 flex flex-col gap-1",onMouseLeave:l,onClose:j,children:[a&&i.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 text-[10px] font-mono text-bv-muted border-b border-bv-border mb-1 pb-1.5 cursor-pointer transition-colors duration-150 hover:text-bv-orange",onMouseEnter:u,onMouseLeave:l,onClick:()=>{a(),j()},children:[i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",className:"shrink-0",children:[i.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),i.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),"remove"]}),i.jsx(T1,{flexDirection:r,activeValue:x,onSelect:_=>{s(_),j()},onHover:o})]})})})]})}function P1({currentValue:e,lockedValue:t,locked:n,flexDirection:r="row",onHover:o,onLeave:l,onClick:s,onRemove:a,onRemoveHover:u}){const[c,f]=w.useState(!1),{refs:h,floatingStyles:d,context:m}=bn({open:c,onOpenChange:L=>{L||(f(!1),l())},strategy:"fixed",placement:"bottom-start",middleware:[gn(4),xn(),yn({padding:8})],whileElementsMounted:mn}),v=fr(m),{getReferenceProps:b,getFloatingProps:S}=pr([v]),p=t!==null&&Vi.some(L=>L.value===t),g=n&&!p,y=!p&&(e===null||e===""),x=p?t:e??"",k=Vi.find(L=>L.value===x),C=(k==null?void 0:k.label)??"—",j=r;function E(){f(!1),l()}function A(){g||f(L=>(L&&l(),!L))}const _=y?{...Bt,borderStyle:"dashed",borderColor:jt,background:Wn,cursor:g?"default":"pointer",alignItems:"center",justifyContent:"center"}:{...Bt,borderColor:c?Ke:jt,background:c?"rgba(0,132,139,0.09)":Wn,cursor:g?"default":"pointer",...k?k.getContainerStyle(r):{}};return i.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:2},children:[i.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Me,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Align ↓"}),i.jsx("div",{ref:h.setReference,role:"button",tabIndex:g?-1:0,onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&A()},onClick:A,...b(),children:i.jsx("div",{style:_,children:y?i.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Me},children:"—"}):k==null?void 0:k.renderItems(r)})}),i.jsx("span",{style:{fontSize:9,fontFamily:Je,color:c?Ke:Me,fontWeight:c?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:y?"—":C}),c&&i.jsx(vn,{children:i.jsx("div",{ref:h.setFloating,style:d,className:"z-[9999]",...S(),children:i.jsxs(xr,{className:"bg-bv-bg border border-bv-border rounded-lg shadow-lg p-2 flex flex-col gap-1",onMouseLeave:l,onClose:E,children:[a&&i.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 text-[10px] font-mono text-bv-muted border-b border-bv-border mb-1 pb-1.5 cursor-pointer transition-colors duration-150 hover:text-bv-orange",onMouseEnter:u,onMouseLeave:l,onClick:()=>{a(),E()},children:[i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",className:"shrink-0",children:[i.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),i.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),"remove"]}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 60px)",gap:4},children:Vi.map(L=>i.jsx(Jt,{label:L.label,isActive:L.value===x,containerStyle:{flexDirection:j,...L.getContainerStyle(r)},onHover:()=>o(L.value),onClick:()=>{s(L.value),E()},children:B=>L.renderItems(r)},L.value))})]})})})]})}function Vd(e){return e.replace(/^gap-x-/,"x-")}function Ud(e){return e.replace(/^gap-y-/,"y-")}function _1({slots:e,onSlotChange:t,onSlotHover:n,onSlotRemove:r,onSlotRemoveHover:o}){const[l,s]=w.useState(null),[a,u]=w.useState(null),c=e.find(S=>S.key==="gap"),f=e.find(S=>S.key==="gap-x"),h=e.find(S=>S.key==="gap-y");function d(S,p){u(p!=null?S:null),n==null||n(S,p)}function m(S){u(S)}function v(){u(null)}const b=a==="gap-x"?"gm-active-x":a==="gap-y"?"gm-active-y":a==="gap"?"gm-active-gap":"";return i.jsx("div",{className:"gm-root",children:i.jsxs("div",{className:`gm-grid${b?` ${b}`:""}`,children:[i.jsx("div",{className:"gm-col-highlight",style:{gridArea:"1 / 2 / 4 / 3"}}),i.jsx("div",{className:"gm-row-highlight",style:{gridArea:"2 / 1 / 3 / 4"}}),i.jsx("div",{className:"gm-box gm-box-tl",style:{gridArea:"1 / 1"}}),i.jsx("div",{className:"gm-cell",style:{gridArea:"1 / 2"},onMouseEnter:()=>m("gap-x"),onMouseLeave:v,children:(f==null?void 0:f.scaleValues)&&i.jsx(Vr,{placeholder:"x",values:f.scaleValues,currentValue:f.value,displayValue:f.value?Vd(f.value):null,formatValue:Vd,axis:"x",disabled:l!==null&&l!=="gap-x",onHover:S=>d("gap-x",S),onLeave:()=>d("gap-x",null),onClick:S=>t==null?void 0:t("gap-x",S),onOpen:()=>s("gap-x"),onClose:()=>s(null),onScrubStart:()=>s("gap-x"),onScrubEnd:()=>s(null),onRemove:f.value?()=>r==null?void 0:r("gap-x"):void 0,onRemoveHover:f.value?()=>{u(null),o==null||o("gap-x")}:void 0})}),i.jsx("div",{className:"gm-box gm-box-tr",style:{gridArea:"1 / 3"}}),i.jsx("div",{className:"gm-cell",style:{gridArea:"2 / 1"},onMouseEnter:()=>m("gap-y"),onMouseLeave:v,children:(h==null?void 0:h.scaleValues)&&i.jsx(Vr,{placeholder:"y",values:h.scaleValues,currentValue:h.value,displayValue:h.value?Ud(h.value):null,formatValue:Ud,axis:"y",disabled:l!==null&&l!=="gap-y",onHover:S=>d("gap-y",S),onLeave:()=>d("gap-y",null),onClick:S=>t==null?void 0:t("gap-y",S),onOpen:()=>s("gap-y"),onClose:()=>s(null),onScrubStart:()=>s("gap-y"),onScrubEnd:()=>s(null),onRemove:h.value?()=>r==null?void 0:r("gap-y"):void 0,onRemoveHover:h.value?()=>{u(null),o==null||o("gap-y")}:void 0})}),i.jsx("div",{className:"gm-cell",style:{gridArea:"2 / 2"},onMouseEnter:()=>m("gap"),onMouseLeave:v,children:(c==null?void 0:c.scaleValues)&&i.jsx(Vr,{placeholder:"gap",values:c.scaleValues,currentValue:c.value,displayValue:c.value??null,axis:"x",disabled:l!==null&&l!=="gap",onHover:S=>d("gap",S),onLeave:()=>d("gap",null),onClick:S=>t==null?void 0:t("gap",S),onOpen:()=>s("gap"),onClose:()=>s(null),onScrubStart:()=>s("gap"),onScrubEnd:()=>s(null),onRemove:c.value?()=>r==null?void 0:r("gap"):void 0,onRemoveHover:c.value?()=>{u(null),o==null||o("gap")}:void 0})}),i.jsx("div",{className:"gm-box gm-box-bl",style:{gridArea:"3 / 1"}})]})})}const Gh={shadow:"Shadow","inset-shadow":"Inset Shadow",ring:"Ring","inset-ring":"Inset Ring","text-shadow":"Text Shadow"},Gd={shadow:"shadow-md","inset-shadow":"inset-shadow-sm",ring:"ring-2","inset-ring":"inset-ring-2","text-shadow":"text-shadow-md"};function I1(e){switch(e){case"shadow":return[...Gu];case"inset-shadow":return[...vh];case"ring":return[...Ka];case"inset-ring":return[...Ka];case"text-shadow":return[...Yu]}}function Yd(e,t){return`${e==="shadow"?"shadow-":e==="inset-shadow"?"inset-shadow-":e==="ring"?"ring-":e==="inset-ring"?"inset-ring-":"text-shadow-"}${t}`}function A1(e,t){const n=e==="shadow"?"shadow-":e==="inset-shadow"?"inset-shadow-":e==="ring"?"ring-":e==="inset-ring"?"inset-ring-":"text-shadow-";return t.startsWith(n)?t.slice(n.length):t}function L1(e){if(e.isNone||!e.sizeClass)return"none";const t=r=>{if(!e.colorHex)return r;if(e.opacity!==null&&e.opacity<100){const o=(e.opacity/100).toFixed(2),l=parseInt(e.colorHex.slice(1,3),16),s=parseInt(e.colorHex.slice(3,5),16),a=parseInt(e.colorHex.slice(5,7),16);return`rgba(${l},${s},${a},${o})`}return e.colorHex},n=e.colorHex?t(e.colorHex):void 0;switch(e.type){case"shadow":{const r=Co(e.sizeClass,"shadow-");return M1(r,n)}case"inset-shadow":{const r=Co(e.sizeClass,"inset-shadow-");return $1(r,n)}case"ring":{const r=Co(e.sizeClass,"ring-");return`0 0 0 ${r==="0"?0:Number(r)||1}px ${n??"rgba(99,102,241,0.5)"}`}case"inset-ring":{const r=Co(e.sizeClass,"inset-ring-");return`inset 0 0 0 ${r==="0"?0:Number(r)||1}px ${n??"rgba(99,102,241,0.5)"}`}case"text-shadow":return"none"}}function D1(e){if(e.isNone||!e.sizeClass)return"none";const t=o=>{if(!e.colorHex)return o;if(e.opacity!==null&&e.opacity<100){const l=(e.opacity/100).toFixed(2),s=parseInt(e.colorHex.slice(1,3),16),a=parseInt(e.colorHex.slice(3,5),16),u=parseInt(e.colorHex.slice(5,7),16);return`rgba(${s},${a},${u},${l})`}return e.colorHex},n=e.colorHex?t(e.colorHex):void 0,r=Co(e.sizeClass,"text-shadow-");return O1(r,n)}function O1(e,t){const n=t??"rgba(0,0,0,0.25)";return{"2xs":`0 1px 0 ${n}`,xs:`0 1px 1px ${n}`,sm:`0 1px 2px ${n}`,md:`0 2px 4px ${n}`,lg:`0 4px 6px ${n}`}[e]??"none"}function Co(e,t){return e.startsWith(t)?e.slice(t.length):e}function M1(e,t){const n=t??"rgba(0,0,0,0.15)";return{"2xs":`0 1px ${n}`,xs:`0 1px 2px 0 ${n}`,sm:`0 1px 3px 0 ${n}, 0 1px 2px -1px ${n}`,md:`0 4px 6px -1px ${n}, 0 2px 4px -2px ${n}`,lg:`0 10px 15px -3px ${n}, 0 4px 6px -4px ${n}`,xl:`0 20px 25px -5px ${n}, 0 8px 10px -6px ${n}`,"2xl":`0 25px 50px -12px ${n}`}[e]??"none"}function $1(e,t){const n=t??"rgba(0,0,0,0.05)";return{"2xs":`inset 0 0.5px ${n}`,xs:`inset 0 1px 1px ${n}`,sm:`inset 0 2px 4px ${n}`}[e]??"none"}const z1=Array.from({length:21},(e,t)=>`${t*5}%`);function K1({layer:e,onSizeHover:t,onSizeLeave:n,onSizeClick:r,onColorClick:o,onOpacityHover:l,onOpacityLeave:s,onOpacityClick:a,onRemove:u,onRemoveHover:c}){const[f,h]=w.useState(!1),d=w.useRef(),m={onMouseEnter:()=>{clearTimeout(d.current),h(!0)},onMouseLeave:()=>{d.current=setTimeout(()=>h(!1),60)}},v=I1(e.type),b=L1(e),S=e.type==="text-shadow"?D1(e):"none",p=e.isNone,g=e.sizeClass?A1(e.type,e.sizeClass):v[0],y=!!e.colorHex,x=e.opacity!==null?`${e.opacity}%`:"100%",k=e.colorHex??void 0;function C(E){t(Yd(e.type,E))}function j(E){r(Yd(e.type,E))}return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"flex items-center justify-center",...m,children:i.jsx("span",{className:"w-1 h-1 rounded-full bg-bv-orange"})}),i.jsx("span",{className:"flex items-center text-[9px] font-semibold uppercase tracking-[0.8px] text-bv-text-mid font-mono whitespace-nowrap",...m,children:Gh[e.type]}),i.jsx("span",{className:"flex items-center",...m,children:i.jsx(En,{values:v,currentValue:g,lockedValue:null,locked:!1,onHover:C,onLeave:n,onClick:j})}),i.jsx("button",{type:"button",className:`w-[26px] h-[26px] rounded-[5px] border shrink-0 cursor-pointer transition-[border-color] ${e.colorHex?"border-bv-border hover:border-bv-teal":"border-dashed border-bv-border hover:border-bv-teal"} ${p?"opacity-30 pointer-events-none":""}`,onClick:E=>o(E.currentTarget),title:e.colorClass?e.colorClass:"Default color — click to override",...m,children:e.colorHex?i.jsx("div",{className:"w-full h-full rounded-[4px]",style:{background:k,opacity:e.opacity!==null?e.opacity/100:1}}):i.jsx("div",{className:"w-full h-full rounded-[4px] flex items-center justify-center",children:i.jsx("span",{className:"w-2 h-2 rounded-full bg-bv-text-mid opacity-40"})})}),i.jsx("span",{className:`flex items-center ${p||!y?"opacity-30 pointer-events-none":""}`,...m,children:y&&!p?i.jsx(En,{values:z1,currentValue:x,lockedValue:null,locked:!1,onHover:l,onLeave:s,onClick:a}):i.jsx("span",{className:"flex items-center justify-center w-full h-[26px] bg-bv-surface border border-bv-border rounded-[5px]",children:i.jsx("span",{className:"font-mono text-[11px] text-bv-muted select-none",children:"—"})})}),i.jsx("span",{className:"ml-4 flex w-[26px] h-[26px] rounded-[5px] bg-bv-surface-hi border border-bv-border transition-[box-shadow] duration-200 items-center justify-center overflow-hidden",style:e.type==="text-shadow"?{}:{boxShadow:b},title:`Preview: ${e.sizeClass??""} ${e.colorClass??""}`.trim(),...m,children:e.type==="text-shadow"&&i.jsx("span",{className:"text-[11px] font-semibold text-bv-text select-none transition-[text-shadow] duration-200",style:{textShadow:S},children:"Aa"})}),i.jsx("button",{type:"button",className:`ml-4 w-[18px] h-[18px] rounded-[3px] border-none bg-transparent text-bv-muted text-xs cursor-pointer flex items-center justify-center transition-all hover:text-bv-orange hover:bg-bv-orange/10 ${f?"opacity-100":"opacity-0"}`,onClick:u,onMouseEnter:()=>{clearTimeout(d.current),h(!0),c()},onMouseLeave:()=>{d.current=setTimeout(()=>h(!1),60)},title:"Remove layer",children:"×"})]})}const F1=["shadow","inset-shadow","ring","inset-ring","text-shadow"];function H1({layers:e,onPreview:t,onRevert:n,onStage:r,onAdd:o,onRemove:l,onRemoveHover:s,onColorClick:a}){function u(f){const h=[];return f.sizeClass&&h.push(f.sizeClass),f.colorClass&&h.push(f.opacity!==null?`${f.colorClass}/${f.opacity}`:f.colorClass),h}const c=F1.map(f=>({type:f,layer:e.find(h=>h.type===f)}));return i.jsx("div",{className:"grid items-center gap-x-1.5 gap-y-1",style:{gridTemplateColumns:"16px auto 1fr 26px 1fr 26px 18px"},children:c.map(({type:f,layer:h},d)=>i.jsxs(w.Fragment,{children:[d>0&&i.jsx("div",{className:"h-px bg-bv-border opacity-50",style:{gridColumn:"1 / -1"}}),h?i.jsx(K1,{layer:h,onSizeHover:m=>t(h.sizeClass??"",m),onSizeLeave:n,onSizeClick:m=>r(h.sizeClass??"",m),onColorClick:m=>a==null?void 0:a(h,m),onOpacityHover:m=>{if(!h.colorClass)return;const v=h.colorClass.split("/")[0],b=parseInt(m),S=b===100?v:`${v}/${b}`,p=h.opacity!==null?`${v}/${h.opacity}`:v;t(p,S)},onOpacityLeave:n,onOpacityClick:m=>{if(!h.colorClass)return;const v=h.colorClass.split("/")[0],b=parseInt(m),S=b===100?v:`${v}/${b}`,p=h.opacity!==null?`${v}/${h.opacity}`:v;r(p,S)},onRemove:()=>l(u(h)),onRemoveHover:()=>s(u(h))}):i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"w-4 h-4 rounded-[3px] border border-dashed border-bv-border bg-transparent text-bv-muted text-[11px] cursor-pointer flex items-center justify-center transition-all hover:border-bv-teal hover:border-solid hover:text-bv-teal hover:bg-bv-teal/10",onClick:()=>o(Gd[f]),title:`Add ${Gd[f]}`,children:"+"}),i.jsx("div",{className:"flex items-center leading-none text-[9px] font-mono uppercase tracking-[0.6px] text-bv-muted whitespace-nowrap",children:Gh[f]})]})]},f))})}const Qd=[{prop:"shadow",prefix:"shadow-",sizeSet:Ss},{prop:"inset-shadow",prefix:"inset-shadow-",sizeSet:Cs},{prop:"ring",prefix:"ring-",sizeSet:Jr},{prop:"inset-ring",prefix:"inset-ring-",sizeSet:Jr},{prop:"text-shadow",prefix:"text-shadow-",sizeSet:ks}];function Cr(e,t,n,r,o){if(!t)return n?[...e,n]:e;if(e.includes(t))return n?e.map(c=>c===t?n:c):e.filter(c=>c!==t);if(e.length===0)return n?[n]:[];const l=t.startsWith(r)?t.slice(r.length).split("/")[0]:"",s=o.has(l);let a=!1;const u=e.flatMap(c=>{const f=c.startsWith(r)?c.slice(r.length).split("/")[0]:"";return o.has(f)===s&&!a?(a=!0,n?[n]:[]):[c]});return a?u:n?[...e,n]:e}function W1(e,t){if(!t)return null;const n=e.lastIndexOf("-");if(n===-1){const a=t[e];return typeof a=="string"?a:null}const r=e.slice(0,n),o=e.slice(n+1),l=t[r];if(!l)return null;if(typeof l=="string")return l;const s=l[o];return typeof s=="string"?s:null}function B1(e,t){const n=e.trim().split(/\s+/).filter(Boolean),r=t==null?void 0:t.colors,o=[{type:"shadow",prefix:"shadow-",sizeSet:Ss},{type:"inset-shadow",prefix:"inset-shadow-",sizeSet:Cs},{type:"ring",prefix:"ring-",sizeSet:Jr},{type:"inset-ring",prefix:"inset-ring-",sizeSet:Jr},{type:"text-shadow",prefix:"text-shadow-",sizeSet:ks}],l=[];for(const{type:s,prefix:a,sizeSet:u}of o){const c=n.filter(v=>v===a.slice(0,-1)||v.startsWith(a));if(c.length===0)continue;let f=null,h=null,d=null,m=null;for(const v of c){const S=v.slice(a.length).split("/")[0];if(u.has(S))f=v;else{h=v;const p=v.split("/");p.length===2&&(m=parseInt(p[1])),d=W1(S,r??null)}}l.push({type:s,sizeClass:f,colorClass:h,colorHex:d,opacity:m,isNone:f!==null&&(f.endsWith("-none")||f.endsWith("-0"))})}return l}function V1(e,t){const n=new Set(["shadow","inset-shadow","ring","inset-ring","text-shadow","shadow-size","shadow-color","inset-shadow-size","inset-shadow-color","ring-size","ring-color","inset-ring-size","inset-ring-color","text-shadow-size","text-shadow-color"]),r=t.filter(s=>n.has(s.property)),o=e.trim().split(/\s+/).filter(Boolean),l=o.filter(s=>!Qd.some(({prefix:a})=>s===a.slice(0,-1)||s.startsWith(a)));for(const{prop:s,prefix:a,sizeSet:u}of Qd){const c=r.find(v=>v.property===s),f=r.find(v=>v.property===`${s}-size`),h=r.find(v=>v.property===`${s}-color`),d=o.filter(v=>v===a.slice(0,-1)||v.startsWith(a));if(c){if(c.newClass)l.push(...Cr(d,c.originalClass,c.newClass,a,u));else{const v=c.originalClass.startsWith(a)?c.originalClass.slice(a.length).split("/")[0]:"";u.has(v)||!c.originalClass||l.push(...Cr(d,c.originalClass,c.newClass,a,u))}continue}let m=[...d];f&&(f.newClass?m=Cr(m,f.originalClass,f.newClass,a,u):f.originalClass&&(m=Cr(m,f.originalClass,"",a,u))),h&&(h.newClass?m=Cr(m,h.originalClass,h.newClass,a,u):h.originalClass&&(m=Cr(m,h.originalClass,"",a,u))),l.push(...m)}return l.join(" ")}const U1={spacing:"Spacing",sizing:"Sizing",typography:"Typography",color:"Backgrounds",borders:"Radius",effects:"Effects",layout:"Layout",flexbox:"Flexbox & Grid",overflow:"Overflow"},G1=["layout","borders","sizing","typography","color","flexbox","shadows","effects"];function Xd(e){const t=e.scale??e.color??e.style??e.align??e.size??e.value;return t?e.fullClass.slice(0,e.fullClass.length-t.length):e.property+"-"}function Y1(e){return e.section==="spacing"||e.property==="border"||e.property==="rounded"||e.property==="bg"||e.property==="bg-gradient-to"||e.property==="from"||e.property==="via"||e.property==="to"||e.property==="shadow"||e.property==="text-shadow"}function Qn(e){const t=e.filter(s=>s.property==="rounded"),n=[{prefix:/^rounded-tl(-|$)/,key:"tl"},{prefix:/^rounded-tr(-|$)/,key:"tr"},{prefix:/^rounded-br(-|$)/,key:"br"},{prefix:/^rounded-bl(-|$)/,key:"bl"},{prefix:/^rounded-t(-|$)/,key:"t"},{prefix:/^rounded-r(-|$)/,key:"r"},{prefix:/^rounded-b(-|$)/,key:"b"},{prefix:/^rounded-l(-|$)/,key:"l"}],r=new Map;let o=null;for(const s of t){const a=s.fullClass,u=n.find(c=>c.prefix.test(a));u?r.set(u.key,a):o=a}return{shorthandValue:o,shorthandScaleValues:Fa,slots:["all","t","r","b","l","tl","tr","br","bl"].map(s=>({key:s,value:s==="all"?o:r.get(s)??null,placeholder:s,scaleValues:s==="all"?Fa:Px(`rounded-${s}`)}))}}const Xn=W0(),Yh=B0(),Q1={"text-size":{scaleName:"fontSize",valueType:"scalar"},"text-color":{scaleName:null,valueType:"color"}};Yh.typography.unshift({name:"Font size",prefixHint:"text-sm/base/lg/…",prefix:"text-size"},{name:"Text color",prefixHint:"text-{color}",prefix:"text-color"});function Ql(e){const t=Q1[e];if(t)return{...t,stagingKey:e};const n=Object.entries(hr).find(([o,l])=>(l.propertyKey??o.replace(/-$/g,""))===e&&l.addable);if(n){const[o,l]=n;return{scaleName:l.themeKey,valueType:l.valueType,enumAlts:l.enumAlts,stagingKey:e}}const r=hr[e];return r?{scaleName:r.themeKey,valueType:r.valueType,enumAlts:r.enumAlts,stagingKey:e.replace(/-$/g,"")}:null}function X1(e,t,n,r){const o=new Set(t.map(s=>s.fullClass)),l=new Set(t.map(s=>s.property));return e.filter(s=>{if(n.has(s.prefix)||r!=null&&r.has(s.prefix))return!1;const a=Ql(s.prefix);if((a==null?void 0:a.valueType)==="enum"&&a.enumAlts)return!a.enumAlts.some(u=>o.has(u));if(a&&a.valueType!=="enum"){if(s.prefix==="text-size")return!t.some(u=>u.property==="text"&&u.scaleName==="fontSize");if(s.prefix==="text-color")return!t.some(u=>u.property==="text"&&u.color!==void 0)}return!l.has(s.prefix.replace(/-$/g,""))})}function Z1(e){const t=new Map;for(const n of e){const r=n.section??"unknown",o=t.get(r)||[];o.push(n),t.set(r,o)}return t}function q1({componentName:e,instanceCount:t,rawClasses:n,parsedClasses:r,tailwindConfig:o,patchManager:l}){var le,ie;const[s,a]=w.useState(null),[u,c]=w.useState(new Map),[f,h]=w.useState(new Map),[d,m]=w.useState(null),[v,b]=w.useState(null),[S,p]=w.useState(null),g=w.useRef(null),{refs:y,floatingStyles:x,context:k}=bn({open:d!==null,onOpenChange:N=>{N||(m(null),l.revertPreview())},strategy:"fixed",placement:"bottom-start",middleware:[gn(4),xn(),yn({padding:8}),Xa({apply({availableHeight:N,elements:O}){Object.assign(O.floating.style,{maxHeight:`${N}px`})},padding:8})],whileElementsMounted:mn}),C=fr(k),{getFloatingProps:j}=pr([C]);w.useEffect(()=>{d!=null&&d.anchorEl&&y.setReference(d.anchorEl)},[d==null?void 0:d.anchorEl]);const{refs:E,floatingStyles:A,context:_}=bn({open:v!==null||S!==null,onOpenChange:N=>{N||(b(null),p(null),l.revertPreview())},strategy:"fixed",placement:"bottom-start",middleware:[gn(4),xn(),yn({padding:8}),Xa({apply({availableHeight:N,elements:O}){Object.assign(O.floating.style,{maxHeight:`${N}px`})},padding:8})],whileElementsMounted:mn}),L=fr(_),{getFloatingProps:B}=pr([L]);w.useEffect(()=>{const N=(v==null?void 0:v.anchorEl)??(S==null?void 0:S.anchorEl);N&&E.setReference(N)},[v==null?void 0:v.anchorEl,S==null?void 0:S.anchorEl]);const[H,D]=w.useState(new Set),[G,Q]=w.useState(!1),q=w.useRef(r.map(N=>N.fullClass).join(" ")),T=r.map(N=>N.fullClass).join(" ");w.useEffect(()=>{q.current!==T&&(q.current=T,l.revertPreview(),c(new Map),h(new Map),m(null),b(null),D(new Set))});const R=e,P=l.patches.filter(N=>N.status==="staged"&&N.elementKey===R),Y=new Set(P.filter(N=>N.originalClass==="").map(N=>N.property));function X(N,O){const K=P.find(ve=>ve.property===N),ee=(O==null?void 0:O.fullClass)??(K==null?void 0:K.originalClass)??"",oe=(K==null?void 0:K.newClass)??(O==null?void 0:O.fullClass)??"";return{originalClass:ee,effectiveClass:oe,hasValue:oe!==""}}function Ne(N){return u.size===0?N:N.map(O=>{const K=u.get(`${O.layer}-shorthand`),ee=O.slots.map(ve=>{const Ce=u.get(`${O.layer}-${ve.key}`);return Ce!==void 0?{...ve,value:Ce}:ve}),oe=K??O.shorthandValue;let ge=O.classState;return K!==void 0&&(ge=ee.some(Ce=>Ce.value!=null)?"mixed":"shorthand"),{...O,shorthandValue:oe,classState:ge,slots:ee}})}function Pe(N){if(f.size===0)return N;const O=f.get("all");return{...N,shorthandValue:O===void 0?N.shorthandValue:O,slots:N.slots.map(K=>{const ee=f.get(K.key);return ee===void 0?K:{...K,value:ee}})}}const $=Z1(r);function ne(N,O){l.preview(N,O)}function me(){l.revertPreview()}function z(N,O,K){l.stage(R,N,O,K)}function he(N,O){const K=N||O,ee=K.startsWith("bg-gradient-to-")?"bg-gradient-to-":K.startsWith("from-")?"from-":K.startsWith("via-")?"via-":K.startsWith("to-")?"to-":"bg-";z(ee,N,O)}function nt(N,O){l.revertPreview(),fe("overlay",{type:"CLEAR_HIGHLIGHTS"}),N.color!==void 0&&O?(b(K=>(K==null?void 0:K.cls.fullClass)===N.fullClass?null:{cls:N,anchorEl:O}),a(null)):(b(null),a(N))}function xt(N,O){l.preview(N.fullClass,O)}function vt(N){l.revertPreview()}function rt(N){const O=hr[N];if(!((O==null?void 0:O.controlGroup)==="flex-container"&&(O==null?void 0:O.propertyKey)==="display")){if((O==null?void 0:O.controlGroup)==="flex-container"){const K=r.some(oe=>oe.fullClass==="flex"||oe.fullClass==="inline-flex"),ee=P.some(oe=>oe.property==="display"&&oe.originalClass===""&&(oe.newClass==="flex"||oe.newClass==="inline-flex"));!K&&!ee&&l.stage(R,"display","","flex")}}D(K=>new Set(K).add(N))}function bt(N,O){l.preview("",O)}function Gt(N){l.revertPreview()}function J(N,O){const K=Ql(N);l.stage(R,(K==null?void 0:K.stagingKey)??N,"",O),D(ee=>{const oe=new Set(ee);return oe.delete(N),oe})}return i.jsxs("div",{className:"divide-y divide-bv-border",children:[i.jsxs("div",{className:"px-4 py-3",children:[i.jsxs("div",{className:"flex items-center gap-1.5 cursor-pointer select-none",onClick:()=>Q(N=>!N),children:[i.jsx("svg",{className:`w-3 h-3 text-bv-muted transition-transform ${G?"":"rotate-90"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})}),i.jsx("span",{className:"text-[10px] font-semibold text-bv-text",children:"Box model"})]}),i.jsx("div",{className:`overflow-hidden transition-[max-height,opacity] duration-200 ease-in-out ${G?"max-h-0 opacity-0":"max-h-[600px] opacity-100"}`,children:i.jsxs("div",{className:"mt-3",children:[i.jsx(t1,{layers:Ne(Sr(r,o)),onEditStart:()=>{fe("overlay",{type:"CLEAR_HIGHLIGHTS"}),m(null)},onSlotClick:(N,O,K)=>{var Ce;if(O!=="color"||!K){m(null);return}const ee=Sr(r,o).find(Yt=>Yt.layer===N),oe=`${N}-color`,ge=u.get(oe)??((Ce=ee==null?void 0:ee.slots.find(Yt=>Yt.key==="color"))==null?void 0:Ce.value)??"",ve=N==="outline"?"outline-":"border-";m(Yt=>(Yt==null?void 0:Yt.layer)===N?null:{layer:N,prefix:ve,currentClass:ge,staged:!1,anchorEl:K})},onSlotHover:(N,O,K)=>{var ee;if(K===null)l.revertPreview();else{const oe=`${N}-${O}`,ge=Sr(r,o).find(Ce=>Ce.layer===N),ve=O==="shorthand"?u.get(oe)??(ge==null?void 0:ge.shorthandValue):u.get(oe)??((ee=ge==null?void 0:ge.slots.find(Ce=>Ce.key===O))==null?void 0:ee.value);l.preview(ve??"",K)}},onSlotChange:(N,O,K)=>{var ve;const ee=`${N}-${O}`,oe=Sr(r,o).find(Ce=>Ce.layer===N),ge=O==="shorthand"?u.get(ee)??(oe==null?void 0:oe.shorthandValue):u.get(ee)??((ve=oe==null?void 0:oe.slots.find(Ce=>Ce.key===O))==null?void 0:ve.value);z(`${N}-${O}`,ge??"",K),c(Ce=>new Map(Ce).set(ee,K))},onSlotRemoveHover:(N,O)=>{var ge;const K=`${N}-${O}`,ee=Sr(r,o).find(ve=>ve.layer===N),oe=O==="shorthand"?u.get(K)??(ee==null?void 0:ee.shorthandValue):u.get(K)??((ge=ee==null?void 0:ee.slots.find(ve=>ve.key===O))==null?void 0:ge.value);oe&&l.preview(oe,"")},onSlotRemove:(N,O)=>{var ge;const K=`${N}-${O}`,ee=Sr(r,o).find(ve=>ve.layer===N),oe=O==="shorthand"?u.get(K)??(ee==null?void 0:ee.shorthandValue):u.get(K)??((ge=ee==null?void 0:ee.slots.find(ve=>ve.key===O))==null?void 0:ge.value);oe&&(z(`${N}-${O}`,oe,""),c(ve=>{const Ce=new Map(ve);return Ce.delete(K),Ce}))}}),d&&i.jsx(vn,{children:i.jsx("div",{ref:y.setFloating,style:{...x,zIndex:9999,overflowY:"auto"},...j(),children:i.jsx(Yl,{prefix:d.prefix,currentValue:d.currentClass.startsWith(d.prefix)?d.currentClass.slice(d.prefix.length):"",colors:(o==null?void 0:o.colors)||{},locked:!1,lockedValue:((le=P.find(N=>N.property===d.prefix))==null?void 0:le.newClass)??null,onHover:N=>{g.current=N,l.preview(d.currentClass,N)},onLeave:()=>{d.staged&&g.current?(l.preview(g.current,d.currentClass),g.current=null):l.revertPreview()},onClick:N=>{const O=`${d.layer}-color`;z(d.prefix,d.currentClass,N),c(K=>new Map(K).set(O,N)),m(K=>K?{...K,currentClass:N,staged:!0}:null)}})})})]})})]}),(v||S)&&i.jsx(vn,{children:i.jsxs("div",{ref:E.setFloating,style:{...A,zIndex:9999,overflowY:"auto"},...B(),children:[v&&i.jsx(Yl,{prefix:Xd(v.cls),currentValue:v.cls.color??"",colors:(o==null?void 0:o.colors)||{},locked:!1,lockedValue:((ie=P.find(N=>N.property===v.cls.property))==null?void 0:ie.newClass)??null,onHover:N=>ne(v.cls.fullClass,N),onLeave:me,onClick:N=>z(v.cls.property,v.cls.fullClass,N),onRemoveHover:()=>ne(v.cls.fullClass,""),onRemove:()=>{z(v.cls.property,v.cls.fullClass,""),b(null)}}),S&&(()=>{const{layer:N}=S,O=N.type==="shadow"?"shadow-":N.type==="inset-shadow"?"inset-shadow-":N.type==="ring"?"ring-":N.type==="text-shadow"?"text-shadow-":"inset-ring-",K=N.colorClass??"",ee=K?K.slice(O.length).split("/")[0]:"";return i.jsx(Yl,{prefix:O,currentValue:ee,colors:(o==null?void 0:o.colors)||{},locked:!1,lockedValue:null,onHover:oe=>ne(K,oe),onLeave:me,onClick:oe=>{const ge=N.type==="shadow"?"shadow-color":N.type==="inset-shadow"?"inset-shadow-color":N.type==="ring"?"ring-color":N.type==="text-shadow"?"text-shadow-color":"inset-ring-color";l.stage(R,ge,K,oe),p(null)},onRemoveHover:()=>{K&&ne(K,"")},onRemove:()=>{if(K){const oe=N.type==="shadow"?"shadow-color":N.type==="inset-shadow"?"inset-shadow-color":N.type==="ring"?"ring-color":N.type==="text-shadow"?"text-shadow-color":"inset-ring-color";l.stage(R,oe,K,"")}p(null)}})})()]})}),G1.map(N=>{if(N==="shadows"){const I=V1(n,P),re=B1(I,o);return i.jsx(Hd,{label:"Shadows & Rings",onAddProperty:()=>{},isEmpty:!1,classCount:re.length,children:i.jsx(H1,{layers:re,onPreview:(V,U)=>l.preview(V,U),onRevert:()=>l.revertPreview(),onStage:(V,U)=>{const de=V||U,ae=Le=>{if(Le.startsWith("shadow-")){const We=Le.slice(7).split("/")[0];return Ss.has(We)}if(Le.startsWith("inset-shadow-")){const We=Le.slice(13).split("/")[0];return Cs.has(We)}if(Le.startsWith("ring-")||Le.startsWith("inset-ring-")){const We=Le.slice(Le.startsWith("ring-")?5:11).split("/")[0];return Jr.has(We)}if(Le.startsWith("text-shadow-")){const We=Le.slice(12).split("/")[0];return ks.has(We)}return!1},ke=de.startsWith("text-shadow")?"text-shadow":de.startsWith("inset-shadow")?"inset-shadow":de.startsWith("inset-ring")?"inset-ring":de.startsWith("ring")?"ring":"shadow",Qt=ae(V)||V===""&&ae(U)?`${ke}-size`:`${ke}-color`;l.stage(R,Qt,V,U)},onAdd:V=>{const U=V.startsWith("text-shadow")?"text-shadow-size":V.startsWith("inset-shadow")?"inset-shadow-size":V.startsWith("inset-ring")?"inset-ring-size":V.startsWith("ring")?"ring-size":"shadow-size";l.stage(R,U,"",V)},onRemove:V=>{const U=ae=>{if(ae.startsWith("shadow-")){const ke=ae.slice(7).split("/")[0];return Ss.has(ke)}if(ae.startsWith("inset-shadow-")){const ke=ae.slice(13).split("/")[0];return Cs.has(ke)}if(ae.startsWith("ring-")||ae.startsWith("inset-ring-")){const ke=ae.slice(ae.startsWith("ring-")?5:11).split("/")[0];return Jr.has(ke)}if(ae.startsWith("text-shadow-")){const ke=ae.slice(12).split("/")[0];return ks.has(ke)}return!1},de=[...V].reverse();for(const ae of de){const ke=ae.startsWith("text-shadow")?"text-shadow":ae.startsWith("inset-shadow")?"inset-shadow":ae.startsWith("inset-ring")?"inset-ring":ae.startsWith("ring")?"ring":"shadow",Qt=U(ae)?`${ke}-size`:`${ke}-color`;l.stage(R,Qt,ae,"")}},onRemoveHover:V=>{V.length===1?l.preview(V[0],""):V.length>1&&l.preview(V.join(" "),"")},onColorClick:(V,U)=>{b(null),p(de=>(de==null?void 0:de.layer.type)===V.type?null:{layer:V,anchorEl:U})}})},"shadows")}const K=($.get(N)||[]).filter(I=>!Y1(I)),ee=Yh[N]||[],oe=F0.get("flex-container")??new Set,ge=H0.get("flex-container")??new Set,ve=r.find(I=>I.fullClass==="flex"||I.fullClass==="inline-flex"),Ce=X("display",ve),Yt=Ce.effectiveClass==="flex"||Ce.effectiveClass==="inline-flex",Xh=r.some(I=>{if(I.fullClass==="flex"||I.fullClass==="inline-flex")return!1;const re=Xn[I.fullClass];return!!(re&&re.propertyKey!=="display"&&oe.has(re.propertyKey)||oe.has(I.property))}),Zh=[...ge].some(I=>H.has(I)||Y.has(I.replace(/-$/,""))),vr=N==="flexbox"&&(Yt||Xh||Zh),qh=vr?ee.filter(I=>!ge.has(I.prefix)):ee,Jh=X1(qh,K,H,Y),qs=ee.filter(I=>H.has(I.prefix)).map(I=>I.prefix),Js=ee.filter(I=>Y.has(I.prefix.replace(/-$/g,""))).map(I=>I.prefix),em=N==="color"||N==="flexbox"&&vr||N==="borders"?!1:K.length===0&&qs.length===0&&Js.length===0,tm=N==="borders"?Qn(r).slots.filter(I=>I.value!=null).length+(Qn(r).shorthandValue?1:0):K.length+qs.length+Js.length;return i.jsxs(Hd,{label:U1[N]??N,availableProperties:Jh,onAddProperty:rt,isEmpty:em,classCount:tm,children:[N==="borders"&&i.jsx(c1,{state:Pe(Qn(r)),onSlotHover:(I,re)=>{var ae;const V=Qn(r),de=(I==="all"?f.get("all")??V.shorthandValue:f.get(I)??((ae=V.slots.find(ke=>ke.key===I))==null?void 0:ae.value)??null)??"";re===null?l.revertPreview():l.preview(de,re)},onSlotChange:(I,re)=>{var de;const V=Qn(r),U=f.get(I)??(I==="all"?V.shorthandValue:(de=V.slots.find(ae=>ae.key===I))==null?void 0:de.value)??"";z(`rounded-${I}`,U,re),h(ae=>new Map(ae).set(I,re))},onSlotRemove:I=>{var V;const re=f.get(I)??((V=Qn(r).slots.find(U=>U.key===I))==null?void 0:V.value)??"";re&&(z(`rounded-${I}`,re,""),h(U=>new Map(U).set(I,null)))},onSlotRemoveHover:I=>{var V;const re=f.get(I)??((V=Qn(r).slots.find(U=>U.key===I))==null?void 0:V.value)??"";re&&l.preview(re,"")},onEditStart:()=>fe("overlay",{type:"CLEAR_HIGHLIGHTS"})}),N==="color"&&i.jsx(x1,{...v1(r,(o==null?void 0:o.colors)||{},P.filter(I=>I.elementKey===R)),onPreview:ne,onPreviewBatch:I=>l.previewBatch(I),onRevert:me,onStage:he}),N==="flexbox"&&vr&&(()=>{const I=r,re=I.find(se=>{const ye=Xn[se.fullClass];return(ye==null?void 0:ye.propertyKey)==="flex-direction"}),V=I.find(se=>{const ye=Xn[se.fullClass];return(ye==null?void 0:ye.propertyKey)==="justify-content"}),U=I.find(se=>{const ye=Xn[se.fullClass];return(ye==null?void 0:ye.propertyKey)==="align-items"}),de=I.find(se=>{const ye=Xn[se.fullClass];return(ye==null?void 0:ye.propertyKey)==="flex-wrap"}),ae={"flex-row":"row","flex-col":"column","flex-row-reverse":"row-reverse","flex-col-reverse":"column-reverse"},ke=X("flex-direction",re),il=ke.effectiveClass?ae[ke.effectiveClass]??"row":"row",Qt=X("flex-wrap",de),Le=X("justify-content",V),We=X("align-items",U),nm=r.find(se=>se.property==="gap"),rm=r.find(se=>se.property==="gap-x"),om=r.find(se=>se.property==="gap-y"),lo=X("gap",nm),so=X("gap-x",rm),io=X("gap-y",om),lm=[{key:"gap",value:lo.effectiveClass||null,scaleValues:wr("gap-","spacing",o)},{key:"gap-x",value:so.effectiveClass||null,scaleValues:wr("gap-x-","spacing",o)},{key:"gap-y",value:io.effectiveClass||null,scaleValues:wr("gap-y-","spacing",o)}];return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex justify-between items-start w-full",children:[i.jsx(S1,{currentValue:(re==null?void 0:re.fullClass)??null,lockedValue:ke.effectiveClass!==ke.originalClass?ke.effectiveClass:null,locked:!1,onHover:se=>ne(ke.effectiveClass,se),onLeave:me,onClick:se=>z("flex-direction",ke.originalClass,se)}),i.jsx(j1,{currentValue:(de==null?void 0:de.fullClass)??null,lockedValue:Qt.effectiveClass!==Qt.originalClass?Qt.effectiveClass:null,locked:!1,onHover:se=>ne(Qt.effectiveClass,se),onLeave:me,onClick:se=>z("flex-wrap",Qt.originalClass,se)}),i.jsx(R1,{currentValue:(V==null?void 0:V.fullClass)??null,lockedValue:Le.effectiveClass!==Le.originalClass?Le.effectiveClass:null,locked:!1,flexDirection:il,onHover:se=>ne(Le.effectiveClass,se),onLeave:me,onClick:se=>z("justify-content",Le.originalClass,se),onRemove:Le.hasValue?()=>z("justify-content",Le.originalClass,""):void 0,onRemoveHover:Le.hasValue?()=>ne(Le.effectiveClass,""):void 0}),i.jsx(P1,{currentValue:(U==null?void 0:U.fullClass)??null,lockedValue:We.effectiveClass!==We.originalClass?We.effectiveClass:null,locked:!1,flexDirection:il,onHover:se=>ne(We.effectiveClass,se),onLeave:me,onClick:se=>z("align-items",We.originalClass,se),onRemove:We.hasValue?()=>z("align-items",We.originalClass,""):void 0,onRemoveHover:We.hasValue?()=>ne(We.effectiveClass,""):void 0})]}),i.jsx("div",{className:"h-px w-full bg-bv-border opacity-50 my-2"}),i.jsx(_1,{slots:lm,onSlotHover:(se,ye)=>{const Ju=se==="gap"?lo:se==="gap-x"?so:io;ye===null?l.revertPreview():l.preview(Ju.effectiveClass,ye)},onSlotRemoveHover:se=>{const ye=se==="gap"?lo:se==="gap-x"?so:io;ye.hasValue&&l.preview(ye.effectiveClass,"")},onSlotChange:(se,ye)=>{z(se,(se==="gap"?lo:se==="gap-x"?so:io).originalClass,ye)},onSlotRemove:se=>{const ye=se==="gap"?lo:se==="gap-x"?so:io;ye.hasValue&&(l.preview(ye.effectiveClass,""),z(se,ye.originalClass,""))}})]})})(),K.map(I=>{var re,V;if(vr){const U=Xn[I.fullClass];if(U&&oe.has(U.propertyKey)||oe.has(I.property))return null}if(I.scaleName!==void 0){const U=wr(Xd(I),I.scaleName,o);if(U.length>0){const de=((re=P.find(ae=>ae.property===I.property))==null?void 0:re.newClass)??null;return i.jsx(En,{values:U,currentValue:I.fullClass,lockedValue:de,locked:!1,onStart:()=>fe("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:ae=>xt(I,ae),onLeave:()=>vt(),onClick:ae=>z(I.property,I.fullClass,ae),onRemoveHover:()=>l.preview(I.fullClass,""),onRemove:()=>z(I.property,I.fullClass,"")},I.fullClass)}}if(I.scaleName===void 0&&I.color===void 0){const U=Xn[I.fullClass];if(U){const de=((V=P.find(ae=>ae.property===U.propertyKey))==null?void 0:V.newClass)??null;return i.jsx(En,{values:U.alternatives,currentValue:I.fullClass,lockedValue:de,locked:!1,onStart:()=>fe("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:ae=>xt(I,ae),onLeave:()=>vt(),onClick:ae=>z(U.propertyKey,I.fullClass,ae),onRemoveHover:()=>l.preview(I.fullClass,""),onRemove:()=>z(U.propertyKey,I.fullClass,"")},I.fullClass)}}return i.jsxs("div",{className:`group flex items-center gap-1 px-2 py-0.5 rounded cursor-pointer text-[11px] font-mono border transition-colors ${(s==null?void 0:s.fullClass)===I.fullClass||(v==null?void 0:v.cls.fullClass)===I.fullClass?"border-bv-border bg-bv-surface-hi text-bv-text":"bg-bv-surface text-bv-text-mid border-transparent hover:border-bv-teal hover:text-bv-teal"}`,onClick:U=>nt(I,U.currentTarget),children:[I.fullClass,i.jsx("span",{className:"opacity-0 group-hover:opacity-60 hover:!opacity-100 ml-0.5 shrink-0",title:"Remove class",onClick:U=>{U.stopPropagation(),z(I.property,I.fullClass,"")},onMouseEnter:U=>{U.stopPropagation(),l.preview(I.fullClass,"")},onMouseLeave:U=>{U.stopPropagation(),l.revertPreview()},children:i.jsxs("svg",{viewBox:"0 0 10 10",width:"8",height:"8",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"}),i.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"})]})})]},I.fullClass)}),Js.filter(I=>!(vr&&ge.has(I))).map(I=>{const re=Ql(I);if(!re)return null;if(re.valueType==="scalar"){const V=wr(I,re.scaleName,o);if(V.length===0)return null;const U=P.find(de=>de.property===re.stagingKey);return i.jsx(En,{values:V,currentValue:(U==null?void 0:U.newClass)??V[Math.floor(V.length/2)],lockedValue:(U==null?void 0:U.newClass)??null,locked:!1,onStart:()=>fe("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:de=>bt(I,de),onLeave:()=>Gt(),onClick:de=>J(I,de)},`staged-${I}`)}if(re.valueType==="enum"&&re.enumAlts){const V=P.find(U=>U.property===re.stagingKey);return i.jsx(En,{values:re.enumAlts,currentValue:(V==null?void 0:V.newClass)??re.enumAlts[0],lockedValue:(V==null?void 0:V.newClass)??null,locked:!1,onStart:()=>fe("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:U=>bt(I,U),onLeave:()=>Gt(),onClick:U=>J(I,U)},`staged-${I}`)}return null}),qs.filter(I=>!(vr&&ge.has(I))).map(I=>{const re=Ql(I);if(!re)return null;if(re.valueType==="scalar"){const V=wr(I,re.scaleName,o);if(V.length>0)return i.jsx(En,{values:V,currentValue:V[Math.floor(V.length/2)],lockedValue:null,locked:!1,ghost:!0,onStart:()=>fe("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:U=>bt(I,U),onLeave:()=>Gt(),onClick:U=>J(I,U)},`pending-${I}`)}return re.valueType==="enum"&&re.enumAlts?i.jsx(En,{values:re.enumAlts,currentValue:re.enumAlts[0],lockedValue:null,locked:!1,ghost:!0,onStart:()=>fe("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:V=>bt(I,V),onLeave:()=>Gt(),onClick:V=>J(I,V)},`pending-${I}`):re.valueType==="color"?i.jsxs("div",{"data-testid":`pending-ghost-${I}`,className:"px-2 py-0.5 rounded cursor-pointer text-[11px] font-mono border border-dashed border-bv-border text-bv-muted hover:border-bv-teal hover:text-bv-teal transition-colors",onClick:V=>{b({cls:{property:"text",fullClass:"",section:"typography",color:""},anchorEl:V.currentTarget}),a(null)},children:[I==="text-color"?"text-":I,"color"]},`pending-${I}`):null})]},N)})]})}const J1=w.lazy(()=>My(()=>import("./DesignMode-DTled2fb.js"),[]).then(e=>({default:e.DesignMode}))),Qh=new URLSearchParams(window.location.search),eb=Qh.get("mode"),xo=Qh.get("embedded")==="storybook";function tb(e,t){const n=`<${t}>`;switch(e){case"before":return`Before ${n}`;case"after":return`After ${n}`;case"first-child":return`First in ${n}`;case"last-child":return`Last in ${n}`;default:return`${e} ${n}`}}function nb(){return eb==="design"?i.jsx(w.Suspense,{fallback:null,children:i.jsx(J1,{})}):i.jsx(rb,{})}function rb(){const[e,t]=w.useState(!1),n=kx(),[r,o]=w.useState(!1),[l,s]=w.useState(!1),{mode:a,elementData:u,selectionId:c,insertPoint:f,selectModeActive:h,textEditing:d,currentTabs:m,activeTab:v,isPicking:b,handleModeChange:S,handleTabChange:p,handleWsMessage:g}=lv(),y=b&&!l,x=!!u||!!f,k=w.useCallback($=>{s($)},[]);w.useEffect(()=>{s(!1)},[a]),w.useEffect(()=>{const $=zy(()=>{if(t(!0),!xo)try{const z=localStorage.getItem("tw-panel-container");z&&z!=="popover"&&fe("overlay",{type:"SWITCH_CONTAINER",container:z})}catch{}}),ne=Ky(()=>t(!1)),me=bs(z=>{g(z)||(z.type==="QUEUE_UPDATE"?n.handleQueueUpdate({draftCount:z.draftCount,committedCount:z.committedCount,implementingCount:z.implementingCount,implementedCount:z.implementedCount,partialCount:z.partialCount,errorCount:z.errorCount,draft:z.draft,commits:z.commits,agentWaiting:z.agentWaiting}):z.type==="PATCH_UPDATE"&&n.handlePatchUpdate({staged:z.staged,committed:z.committed,implementing:z.implementing,implemented:z.implemented,patches:z.patches}))});return fh(),t(Fy()),()=>{$(),ne(),me()}},[]);const{draft:C,committed:j,implementing:E,implemented:A,partial:_,error:L}=n.counts,B=(C>0||j>0)&&!n.agentWaiting&&E===0,H=new Map(n.patches.filter($=>$.status==="staged").map($=>[$.id,{id:$.id,kind:$.kind??"class-change",elementKey:$.elementKey,status:$.status,originalClass:$.originalClass,newClass:$.newClass,property:$.property,timestamp:$.timestamp,component:$.component,message:$.message,image:$.image}])),D=new Set(n.queueState.draft.map($=>$.id)),G=[...n.queueState.draft.map($=>H.get($.id)??$),...n.patches.filter($=>$.status==="staged"&&!D.has($.id)).map($=>H.get($.id))],Q=n.queueState.commits.filter($=>$.status==="committed"),q=n.queueState.commits.filter($=>$.status==="implementing"),T=n.queueState.commits.filter($=>$.status==="implemented"),R="Please implement the next change and continue implementing changes with VyBit.";async function P($){if(navigator.clipboard){try{if((await navigator.permissions.query({name:"clipboard-write"})).state==="denied"){X($);return}}catch{}navigator.clipboard.writeText($).catch(()=>X($))}else X($)}function Y(){P(R),o(!0),setTimeout(()=>o(!1),2e3)}function X($){const ne=document.createElement("textarea");ne.value=$,ne.style.position="fixed",ne.style.opacity="0",document.body.appendChild(ne),ne.select(),document.execCommand("copy"),document.body.removeChild(ne)}const Ne=i.jsxs("div",{className:"shrink-0",children:[!e&&i.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 bg-amber-950/40 border-t border-amber-800/40 text-amber-300 text-[10px] font-medium",children:[i.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-bv-orange animate-pulse shrink-0"}),i.jsxs("span",{className:"flex-1 leading-tight",children:["No agent listening —"," ",i.jsx("a",{href:"https://github.com/bitovi/vybit?tab=readme-ov-file#telling-your-agent-to-start-making-features",target:"_blank",rel:"noreferrer",className:"underline hover:text-amber-100",children:"ask your agent"})," ","to start!"]}),i.jsx("button",{onClick:Y,className:`shrink-0 px-1.5 py-0.5 rounded border font-semibold text-[9px] transition-colors ${r?"border-emerald-700/50 bg-emerald-900/40 text-emerald-300":"border-amber-700/50 bg-amber-900/40 hover:bg-amber-800/40 text-amber-300"}`,title:`Copy: "${R}"`,children:r?"Copied!":"Copy prompt"})]}),B&&i.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 bg-amber-950/40 border-t border-amber-800/40 text-amber-300 text-[10px] font-medium",children:[i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"currentColor",className:"shrink-0 text-amber-400",children:i.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.19-1.458-1.516-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),i.jsxs("span",{className:"flex-1 leading-tight",children:["No agent watching —"," ",i.jsx("a",{href:"https://github.com/bitovi/vybit?tab=readme-ov-file#telling-your-agent-to-start-making-features",target:"_blank",rel:"noreferrer",className:"underline hover:text-amber-100",children:"ask your agent"})," ","to start"]}),i.jsx("button",{onClick:Y,className:`shrink-0 px-1.5 py-0.5 rounded border font-semibold text-[9px] transition-colors ${r?"border-emerald-700/50 bg-emerald-900/40 text-emerald-300":"border-amber-700/50 bg-amber-900/40 hover:bg-amber-800/40 text-amber-300"}`,title:`Copy: "${R}"`,children:r?"Copied!":"Copy prompt"})]}),i.jsxs("div",{className:"flex items-center justify-center px-3 py-1.5 border-t border-bv-border gap-3 text-[10px]",children:[i.jsx(Nl,{label:"draft",count:C,items:G,activeColor:"text-amber-400",onDiscard:$=>n.discard($),onCommitAll:()=>n.commitAll(),onDiscardAll:()=>n.discardAll()}),i.jsx(Nl,{label:"committed",count:j,items:Q.flatMap($=>$.patches),activeColor:"text-bv-orange",onDiscard:$=>n.discardCommit($)}),i.jsx(Nl,{label:"implementing",count:E,items:q.flatMap($=>$.patches),activeColor:"text-blue-400"}),i.jsx(Nl,{label:"implemented",count:A,items:T.flatMap($=>$.patches),activeColor:"text-bv-teal"})]})]});if(!u)return a===null?i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx("div",{className:"px-3 pt-3 pb-2 border-b border-bv-border",children:i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx(Tl,{mode:a,onModeChange:S,isPicking:y,isEngaged:x}),!xo&&i.jsx(El,{})]})}),i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-6",children:[i.jsxs("button",{onClick:()=>S("select"),className:"w-full flex flex-col items-center gap-3 px-6 py-5 rounded-lg border border-bv-border bg-bv-surface hover:border-bv-teal hover:bg-bv-teal/5 transition-all cursor-pointer",children:[i.jsx("div",{className:"w-14 h-14 rounded-full bg-bv-teal/10 text-bv-teal flex items-center justify-center",children:i.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 64 64",fill:"currentColor",children:[i.jsx("path",{d:"M2,9C1.447,9,1,8.552,1,8V2c0-0.552,0.447-1,1-1h6c0.553,0,1,0.448,1,1S8.553,3,8,3H3v5C3,8.552,2.553,9,2,9z"}),i.jsx("path",{d:"M8,48H2c-0.553,0-1-0.448-1-1v-6c0-0.552,0.447-1,1-1s1,0.448,1,1v5h5c0.553,0,1,0.448,1,1S8.553,48,8,48z"}),i.jsx("path",{d:"M47,9c-0.553,0-1-0.448-1-1V3h-5c-0.553,0-1-0.448-1-1s0.447-1,1-1h6c0.553,0,1,0.448,1,1v6C48,8.552,47.553,9,47,9z"}),i.jsx("path",{d:"M21,3h-6c-0.553,0-1-0.448-1-1s0.447-1,1-1h6c0.553,0,1,0.448,1,1S21.553,3,21,3z"}),i.jsx("path",{d:"M2,22c-0.553,0-1-0.448-1-1v-6c0-0.552,0.447-1,1-1s1,0.448,1,1v6C3,21.552,2.553,22,2,22z"}),i.jsx("path",{d:"M2,35c-0.553,0-1-0.448-1-1v-6c0-0.552,0.447-1,1-1s1,0.448,1,1v6C3,34.552,2.553,35,2,35z"}),i.jsx("path",{d:"M47,22c-0.553,0-1-0.448-1-1v-6c0-0.552,0.447-1,1-1s1,0.448,1,1v6C48,21.552,47.553,22,47,22z"}),i.jsx("path",{d:"M47,31c-0.553,0-1-0.448-1-1v-2c0-0.552,0.447-1,1-1s1,0.448,1,1v2C48,30.552,47.553,31,47,31z"}),i.jsx("path",{d:"M34,3h-6c-0.553,0-1-0.448-1-1s0.447-1,1-1h6c0.553,0,1,0.448,1,1S34.553,3,34,3z"}),i.jsx("path",{d:"M21,48h-6c-0.553,0-1-0.448-1-1s0.447-1,1-1h6c0.553,0,1,0.448,1,1S21.553,48,21,48z"}),i.jsx("path",{d:"M30,48h-2c-0.553,0-1-0.448-1-1s0.447-1,1-1h2c0.553,0,1,0.448,1,1S30.553,48,30,48z"}),i.jsx("path",{d:"M62.707,57.293L51.688,46.274l10.759-5.379c0.368-0.184,0.586-0.575,0.549-0.985c-0.037-0.41-0.322-0.755-0.717-0.87l-31-9c-0.355-0.1-0.729-0.005-0.986,0.253c-0.258,0.258-0.355,0.636-0.253,0.986l9,31c0.114,0.396,0.46,0.68,0.869,0.717C39.94,62.999,39.971,63,40,63c0.376,0,0.724-0.212,0.895-0.553l5.38-10.759l11.019,11.019c0.391,0.391,1.023,0.391,1.414,0l4-4C63.098,58.316,63.098,57.684,62.707,57.293z"})]})}),i.jsx("span",{className:"text-[13px] text-bv-text font-medium",children:"Select an element"}),i.jsx("span",{className:"text-[11px] text-bv-text-mid text-center leading-relaxed",children:"to change its design, its text, or to replace it with something else"})]}),i.jsxs("button",{onClick:()=>S("insert"),className:"w-full flex flex-col items-center gap-3 px-6 py-4 rounded-lg border border-bv-border bg-bv-surface hover:border-bv-teal hover:bg-bv-teal/5 transition-all cursor-pointer",children:[i.jsx("div",{className:"w-14 h-14 rounded-full bg-bv-teal/10 text-bv-teal flex items-center justify-center",children:i.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"square",strokeLinejoin:"miter",children:[i.jsx("rect",{x:"4",y:"2",width:"16",height:"8",rx:"2"}),i.jsx("path",{d:"m17,14h1c1.105,0,2,.895,2,2"}),i.jsx("path",{d:"m4,16c0-1.105.895-2,2-2h1"}),i.jsx("path",{d:"m7,22h-1c-1.105,0-2-.895-2-2"}),i.jsx("path",{d:"m20,20c0,1.105-.895,2-2,2h-1"}),i.jsx("line",{x1:"13",y1:"14",x2:"11",y2:"14"}),i.jsx("line",{x1:"13",y1:"22",x2:"11",y2:"22"})]})}),i.jsx("span",{className:"text-[13px] text-bv-text font-medium",children:"Insert to add new content"})]}),i.jsxs("button",{onClick:()=>S("bug-report"),className:"w-full flex flex-col items-center gap-3 px-6 py-4 rounded-lg border border-bv-border bg-bv-surface hover:border-bv-teal hover:bg-bv-teal/5 transition-all cursor-pointer",children:[i.jsx("div",{className:"w-14 h-14 rounded-full bg-bv-teal/10 text-bv-teal flex items-center justify-center",children:i.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 16 16",fill:"currentColor",children:[i.jsx("path",{d:"M11.5,6C11.5,4.067,9.933,2.5,8,2.5S4.5,4.067,4.5,6v1h7V6Z"}),i.jsx("rect",{x:"3",y:"8",width:"10",height:"6",rx:"2"}),i.jsx("path",{d:"M1,5.5h2.2C3.07,5.01,3,4.51,3,4h0V3.5H1c-.552,0-1,.448-1,1S.448,5.5,1,5.5Z"}),i.jsx("path",{d:"M15,3.5h-2c0,.51-.07,1.01-.2,1.5H15c.552,0,1-.448,1-1s-.448-1-1-1Z"}),i.jsx("path",{d:"M1,11.5h2.05c.232,.89,.62,1.71,1.13,2.5H1c-.552,0-1-.448-1-1s.448-1,1-1h0Z"}),i.jsx("path",{d:"M15,10.5h-2.05c-.232,.89-.62,1.71-1.13,2.5h3.18c.552,0,1-.448,1-1s-.448-1-1-1Z"}),i.jsx("path",{d:"M1,7.5h2v2H1c-.552,0-1-.448-1-1s.448-1,1-1Z"}),i.jsx("path",{d:"M13,7.5h2c.552,0,1,.448,1,1s-.448,1-1,1h-2v-2Z"}),i.jsx("rect",{x:"7",y:"9",width:"2",height:"4",rx:".5"})]})}),i.jsx("span",{className:"text-[13px] text-bv-text font-medium",children:"Report a bug"}),i.jsx("span",{className:"text-[11px] text-bv-text-mid text-center leading-relaxed",children:"Select events from recording history and describe the issue"})]})]}),Ne]}):a==="bug-report"?i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx("div",{className:"px-3 pt-3 pb-2 border-b border-bv-border",children:i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx(Tl,{mode:a,onModeChange:S,isPicking:y,isEngaged:x}),i.jsx("div",{className:"flex-1 min-w-0",children:i.jsx("span",{className:"font-[family-name:var(--font-display)] font-bold text-[13px] text-bv-text leading-tight",children:"Bug Report"})}),!xo&&i.jsx(El,{})]})}),i.jsx(Sx,{onSubmit:$=>{var me;const ne={id:crypto.randomUUID(),kind:"bug-report",elementKey:((me=$.bugElement)==null?void 0:me.selectorPath)??"bug-report",status:"staged",originalClass:"",newClass:"",property:"bug-report",timestamp:new Date().toISOString(),bugDescription:$.bugDescription,bugScreenshots:$.bugScreenshots,bugTimeline:$.bugTimeline,bugTimeRange:$.bugTimeRange,bugElement:$.bugElement};Nn({type:"BUG_REPORT_STAGE",patch:ne})}}),Ne]}):i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx("div",{className:"px-3 pt-3 pb-2 border-b border-bv-border",children:i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx(Tl,{mode:a,onModeChange:S,isPicking:y,isEngaged:x}),i.jsx("div",{className:"flex-1 min-w-0",children:a==="insert"?i.jsx("span",{className:"text-[11px] text-bv-teal font-medium",children:f?tb(f.position,f.targetName):"Pick a placement on the page"}):h?i.jsx("span",{className:"text-[11px] text-bv-teal font-medium",children:"Click an element on the page"}):i.jsx("span",{className:"text-[12px] text-bv-muted",children:"No element selected"})}),!xo&&i.jsx(El,{})]})}),i.jsx(xd,{tabs:m,activeTab:v,onTabChange:p}),i.jsx("div",{className:"flex-1 overflow-auto",children:v==="replace"?i.jsx(jl,{insertMode:"replace",hasPageSelection:!!u||!!f,onArmedChange:k}):v==="place"?i.jsx(jl,{insertMode:"place",hasPageSelection:!!u||!!f,onArmedChange:k}):h?i.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 p-8",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-bv-teal text-white flex items-center justify-center",children:i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"currentColor",children:[i.jsx("path",{d:"M14,0H2C.895,0,0,.895,0,2V14c0,1.105,.895,2,2,2H6c.552,0,1-.448,1-1h0c0-.552-.448-1-1-1H2V2H14V6c0,.552,.448,1,1,1h0c.552,0,1-.448,1-1V2c0-1.105-.895-2-2-2Z"}),i.jsx("path",{d:"M12.043,10.629l2.578-.644c.268-.068,.43-.339,.362-.607-.043-.172-.175-.308-.345-.358l-7-2c-.175-.051-.363-.002-.492,.126-.128,.129-.177,.317-.126,.492l2,7c.061,.214,.257,.362,.48,.362h.009c.226-.004,.421-.16,.476-.379l.644-2.578,3.664,3.664c.397,.384,1.03,.373,1.414-.025,.374-.388,.374-1.002,0-1.389l-3.664-3.664Z"})]})}),i.jsx("span",{className:"text-[12px] text-bv-teal font-medium",children:"Selection mode active"}),i.jsxs("span",{className:"text-[12px] text-bv-muted text-center leading-relaxed",children:["Hover over elements on the page to preview, then click to select.",i.jsx("br",{}),"Press"," ",i.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded bg-white/6 border border-white/8 font-mono text-[10px] text-bv-text-mid leading-none",children:"Esc"})," ","to cancel."]})]}):i.jsx("div",{className:"flex flex-1 flex-col justify-center p-4",children:i.jsxs("button",{onClick:()=>{S("select")},className:"w-full flex flex-col items-center gap-3 px-6 py-5 rounded-lg border border-bv-border bg-bv-surface hover:border-bv-teal hover:bg-bv-teal/5 transition-all cursor-pointer",children:[i.jsx("div",{className:"w-14 h-14 rounded-full bg-bv-teal/10 text-bv-teal flex items-center justify-center",children:i.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 64 64",fill:"currentColor",children:[i.jsx("path",{d:"M2,9C1.447,9,1,8.552,1,8V2c0-0.552,0.447-1,1-1h6c0.553,0,1,0.448,1,1S8.553,3,8,3H3v5C3,8.552,2.553,9,2,9z"}),i.jsx("path",{d:"M8,48H2c-0.553,0-1-0.448-1-1v-6c0-0.552,0.447-1,1-1s1,0.448,1,1v5h5c0.553,0,1,0.448,1,1S8.553,48,8,48z"}),i.jsx("path",{d:"M47,9c-0.553,0-1-0.448-1-1V3h-5c-0.553,0-1-0.448-1-1s0.447-1,1-1h6c0.553,0,1,0.448,1,1v6C48,8.552,47.553,9,47,9z"}),i.jsx("path",{d:"M21,3h-6c-0.553,0-1-0.448-1-1s0.447-1,1-1h6c0.553,0,1,0.448,1,1S21.553,3,21,3z"}),i.jsx("path",{d:"M2,22c-0.553,0-1-0.448-1-1v-6c0-0.552,0.447-1,1-1s1,0.448,1,1v6C3,21.552,2.553,22,2,22z"}),i.jsx("path",{d:"M2,35c-0.553,0-1-0.448-1-1v-6c0-0.552,0.447-1,1-1s1,0.448,1,1v6C3,34.552,2.553,35,2,35z"}),i.jsx("path",{d:"M47,22c-0.553,0-1-0.448-1-1v-6c0-0.552,0.447-1,1-1s1,0.448,1,1v6C48,21.552,47.553,22,47,22z"}),i.jsx("path",{d:"M47,31c-0.553,0-1-0.448-1-1v-2c0-0.552,0.447-1,1-1s1,0.448,1,1v2C48,30.552,47.553,31,47,31z"}),i.jsx("path",{d:"M34,3h-6c-0.553,0-1-0.448-1-1s0.447-1,1-1h6c0.553,0,1,0.448,1,1S34.553,3,34,3z"}),i.jsx("path",{d:"M21,48h-6c-0.553,0-1-0.448-1-1s0.447-1,1-1h6c0.553,0,1,0.448,1,1S21.553,48,21,48z"}),i.jsx("path",{d:"M30,48h-2c-0.553,0-1-0.448-1-1s0.447-1,1-1h2c0.553,0,1,0.448,1,1S30.553,48,30,48z"}),i.jsx("path",{d:"M62.707,57.293L51.688,46.274l10.759-5.379c0.368-0.184,0.586-0.575,0.549-0.985c-0.037-0.41-0.322-0.755-0.717-0.87l-31-9c-0.355-0.1-0.729-0.005-0.986,0.253c-0.258,0.258-0.355,0.636-0.253,0.986l9,31c0.114,0.396,0.46,0.68,0.869,0.717C39.94,62.999,39.971,63,40,63c0.376,0,0.724-0.212,0.895-0.553l5.38-10.759l11.019,11.019c0.391,0.391,1.023,0.391,1.414,0l4-4C63.098,58.316,63.098,57.684,62.707,57.293z"})]})}),i.jsx("span",{className:"text-[12px] text-bv-text font-medium",children:"Select an element to inspect"}),i.jsxs("span",{className:"inline-flex items-center gap-1",children:[i.jsx("span",{className:"w-5 h-5 rounded flex items-center justify-center bg-white/6 border border-white/8 font-mono text-[10px] font-semibold text-bv-text-mid leading-none",children:"⌘"}),i.jsx("span",{className:"w-5 h-5 rounded flex items-center justify-center bg-white/6 border border-white/8 font-mono text-[10px] font-semibold text-bv-text-mid leading-none",children:"⇧"}),i.jsx("span",{className:"w-5 h-5 rounded flex items-center justify-center bg-white/6 border border-white/8 font-mono text-[10px] font-semibold text-bv-text-mid leading-none",children:"C"})]})]})})}),Ne]});const Pe=u.parsedClasses;return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx("div",{className:"px-3 pt-3 pb-2 border-b border-bv-border",children:i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsx(Tl,{mode:a,onModeChange:S,isPicking:y,isEngaged:x}),i.jsxs("div",{className:"font-[family-name:var(--font-display)] font-bold text-[13px] text-bv-text leading-tight truncate",children:[u.componentName," ",i.jsxs("span",{className:"font-[family-name:var(--font-ui)] font-normal text-bv-text-mid",children:["— ",u.instanceCount," instance",u.instanceCount!==1?"s":""]})]})]}),!xo&&i.jsx(El,{})]})}),i.jsx(xd,{tabs:m,activeTab:v,onTabChange:p}),d&&i.jsx("div",{className:"px-3 py-2 bg-bv-teal/10 border-b border-bv-teal/30 text-xs text-bv-teal font-medium",children:"Editing text in the page…"}),i.jsxs("div",{className:`flex-1 overflow-auto ${d?"opacity-40 pointer-events-none":""}`,children:[v==="design"&&i.jsx(q1,{componentName:u.componentName,instanceCount:u.instanceCount,rawClasses:u.classes,parsedClasses:Pe,tailwindConfig:u.tailwindConfig,patchManager:n},c),v==="replace"&&i.jsx(jl,{insertMode:"replace",hasPageSelection:!!u||!!f,onArmedChange:k}),v==="place"&&i.jsx(jl,{insertMode:"place",hasPageSelection:!!u||!!f,onArmedChange:k})]}),Ne]})}Ui.createRoot(document.getElementById("root")).render(i.jsx(af.StrictMode,{children:i.jsx(nb,{})}));export{yh as S,w as a,bs as b,fh as c,i as j,zy as o,lb as r,Nn as s};
|