@bitovi/vybit 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Um=Object.defineProperty;var Gm=(e,t,n)=>t in e?Um(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _t=(e,t,n)=>Gm(e,typeof t!="symbol"?t+"":t,n);function Ym(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 Qm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dd={exports:{}},Cs={},Md={exports:{}},ie={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ var Bm=Object.defineProperty;var Um=(e,t,n)=>t in e?Bm(e,t,{enumerable:!0,config
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Xo=Symbol.for("react.element"),
|
|
9
|
+
*/var Xo=Symbol.for("react.element"),Xm=Symbol.for("react.portal"),Zm=Symbol.for("react.fragment"),Jm=Symbol.for("react.strict_mode"),qm=Symbol.for("react.profiler"),eh=Symbol.for("react.provider"),th=Symbol.for("react.context"),nh=Symbol.for("react.forward_ref"),rh=Symbol.for("react.suspense"),oh=Symbol.for("react.memo"),lh=Symbol.for("react.lazy"),Fu=Symbol.iterator;function sh(e){return e===null||typeof e!="object"?null:(e=Fu&&e[Fu]||e["@@iterator"],typeof e=="function"?e:null)}var $d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zd=Object.assign,Kd={};function Xr(e,t,n){this.props=e,this.context=t,this.refs=Kd,this.updater=n||$d}Xr.prototype.isReactComponent={};Xr.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")};Xr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Fd(){}Fd.prototype=Xr.prototype;function za(e,t,n){this.props=e,this.context=t,this.refs=Kd,this.updater=n||$d}var Ka=za.prototype=new Fd;Ka.constructor=za;zd(Ka,Xr.prototype);Ka.isPureReactComponent=!0;var Wu=Array.isArray,Wd=Object.prototype.hasOwnProperty,Fa={current:null},Vd={key:!0,ref:!0,__self:!0,__source:!0};function Hd(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)Wd.call(t,r)&&!Vd.hasOwnProperty(r)&&(o[r]=t[r]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var u=Array(i),c=0;c<i;c++)u[c]=arguments[c+2];o.children=u}if(e&&e.defaultProps)for(r in i=e.defaultProps,i)o[r]===void 0&&(o[r]=i[r]);return{$$typeof:Xo,type:e,key:l,ref:s,props:o,_owner:Fa.current}}function ih(e,t){return{$$typeof:Xo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Wa(e){return typeof e=="object"&&e!==null&&e.$$typeof===Xo}function ah(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Vu=/\/+/g;function Gs(e,t){return typeof e=="object"&&e!==null&&e.key!=null?ah(""+e.key):t.toString(36)}function Cl(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 Xo:case Xm:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Gs(s,0):r,Wu(o)?(n="",e!=null&&(n=e.replace(Vu,"$&/")+"/"),Cl(o,t,n,"",function(c){return c})):o!=null&&(Wa(o)&&(o=ih(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Vu,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Wu(e))for(var i=0;i<e.length;i++){l=e[i];var u=r+Gs(l,i);s+=Cl(l,t,n,u,o)}else if(u=sh(e),typeof u=="function")for(e=u.call(e),i=0;!(l=e.next()).done;)l=l.value,u=r+Gs(l,i++),s+=Cl(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 ll(e,t,n){if(e==null)return e;var r=[],o=0;return Cl(e,r,"","",function(l){return t.call(n,l,o++)}),r}function uh(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 qe={current:null},jl={transition:null},ch={ReactCurrentDispatcher:qe,ReactCurrentBatchConfig:jl,ReactCurrentOwner:Fa};function Bd(){throw Error("act(...) is not supported in production builds of React.")}ie.Children={map:ll,forEach:function(e,t,n){ll(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ll(e,function(){t++}),t},toArray:function(e){return ll(e,function(t){return t})||[]},only:function(e){if(!Wa(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ie.Component=Xr;ie.Fragment=Zm;ie.Profiler=qm;ie.PureComponent=za;ie.StrictMode=Jm;ie.Suspense=rh;ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ch;ie.act=Bd;ie.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=zd({},e.props),o=e.key,l=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,s=Fa.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(u in t)Wd.call(t,u)&&!Vd.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&i!==void 0?i[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){i=Array(u);for(var c=0;c<u;c++)i[c]=arguments[c+2];r.children=i}return{$$typeof:Xo,type:e.type,key:o,ref:l,props:r,_owner:s}};ie.createContext=function(e){return e={$$typeof:th,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:eh,_context:e},e.Consumer=e};ie.createElement=Hd;ie.createFactory=function(e){var t=Hd.bind(null,e);return t.type=e,t};ie.createRef=function(){return{current:null}};ie.forwardRef=function(e){return{$$typeof:nh,render:e}};ie.isValidElement=Wa;ie.lazy=function(e){return{$$typeof:lh,_payload:{_status:-1,_result:e},_init:uh}};ie.memo=function(e,t){return{$$typeof:oh,type:e,compare:t===void 0?null:t}};ie.startTransition=function(e){var t=jl.transition;jl.transition={};try{e()}finally{jl.transition=t}};ie.unstable_act=Bd;ie.useCallback=function(e,t){return qe.current.useCallback(e,t)};ie.useContext=function(e){return qe.current.useContext(e)};ie.useDebugValue=function(){};ie.useDeferredValue=function(e){return qe.current.useDeferredValue(e)};ie.useEffect=function(e,t){return qe.current.useEffect(e,t)};ie.useId=function(){return qe.current.useId()};ie.useImperativeHandle=function(e,t,n){return qe.current.useImperativeHandle(e,t,n)};ie.useInsertionEffect=function(e,t){return qe.current.useInsertionEffect(e,t)};ie.useLayoutEffect=function(e,t){return qe.current.useLayoutEffect(e,t)};ie.useMemo=function(e,t){return qe.current.useMemo(e,t)};ie.useReducer=function(e,t,n){return qe.current.useReducer(e,t,n)};ie.useRef=function(e){return qe.current.useRef(e)};ie.useState=function(e){return qe.current.useState(e)};ie.useSyncExternalStore=function(e,t,n){return qe.current.useSyncExternalStore(e,t,n)};ie.useTransition=function(){return qe.current.useTransition()};ie.version="18.3.1";Md.exports=ie;var w=Md.exports;const Ud=Qm(w),Gd=Ym({__proto__:null,default:Ud},[w]);/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var Bm=Object.defineProperty;var Um=(e,t,n)=>t in e?Bm(e,t,{enumerable:!0,config
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var dh=w,fh=Symbol.for("react.element"),ph=Symbol.for("react.fragment"),mh=Object.prototype.hasOwnProperty,hh=dh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,gh={key:!0,ref:!0,__self:!0,__source:!0};function Yd(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)mh.call(t,r)&&!gh.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:fh,type:e,key:l,ref:s,props:o,_owner:hh.current}}Cs.Fragment=ph;Cs.jsx=Yd;Cs.jsxs=Yd;Dd.exports=Cs;var a=Dd.exports,Oi={},Qd={exports:{}},pt={},Xd={exports:{}},Zd={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var Bm=Object.defineProperty;var Um=(e,t,n)=>t in e?Bm(e,t,{enumerable:!0,config
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(R,L){var N=R.length;R.push(L);e:for(;0<N;){var z=N-1>>>1,V=R[z];if(0<o(V,L))R[z]=L,R[N]=V,N=z;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var L=R[0],N=R.pop();if(N!==L){R[0]=N;e:for(var z=0,V=R.length,me=V>>>1;z<me;){var be=2*(z+1)-1,ae=R[be],se=be+1,_e=R[se];if(0>o(ae,N))se<V&&0>o(_e,ae)?(R[z]=_e,R[se]=N,z=se):(R[z]=ae,R[be]=N,z=be);else if(se<V&&0>o(_e,N))R[z]=_e,R[se]=N,z=se;else break e}}return L}function o(R,L){var N=R.sortIndex-L.sortIndex;return N!==0?N:R.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var s=Date,i=s.now();e.unstable_now=function(){return s.now()-i}}var
|
|
25
|
+
*/(function(e){function t(R,L){var N=R.length;R.push(L);e:for(;0<N;){var z=N-1>>>1,V=R[z];if(0<o(V,L))R[z]=L,R[N]=V,N=z;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var L=R[0],N=R.pop();if(N!==L){R[0]=N;e:for(var z=0,V=R.length,me=V>>>1;z<me;){var be=2*(z+1)-1,ae=R[be],se=be+1,_e=R[se];if(0>o(ae,N))se<V&&0>o(_e,ae)?(R[z]=_e,R[se]=N,z=se):(R[z]=ae,R[be]=N,z=be);else if(se<V&&0>o(_e,N))R[z]=_e,R[se]=N,z=se;else break e}}return L}function o(R,L){var N=R.sortIndex-L.sortIndex;return N!==0?N:R.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var s=Date,i=s.now();e.unstable_now=function(){return s.now()-i}}var u=[],c=[],d=1,p=null,f=3,g=!1,x=!1,b=!1,S=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,h=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(R){for(var L=n(c);L!==null;){if(L.callback===null)r(c);else if(L.startTime<=R)r(c),L.sortIndex=L.expirationTime,t(u,L);else break;L=n(c)}}function v(R){if(b=!1,y(R),!x)if(n(u)!==null)x=!0,H(C);else{var L=n(c);L!==null&&ne(v,L.startTime-R)}}function C(R,L){x=!1,b&&(b=!1,m(T),T=-1),g=!0;var N=f;try{for(y(L),p=n(u);p!==null&&(!(p.expirationTime>L)||R&&!W());){var z=p.callback;if(typeof z=="function"){p.callback=null,f=p.priorityLevel;var V=z(p.expirationTime<=L);L=e.unstable_now(),typeof V=="function"?p.callback=V:p===n(u)&&r(u),y(L)}else r(u);p=n(u)}if(p!==null)var me=!0;else{var be=n(c);be!==null&&ne(v,be.startTime-L),me=!1}return me}finally{p=null,f=N,g=!1}}var k=!1,j=null,T=-1,$=5,_=-1;function W(){return!(e.unstable_now()-_<$)}function O(){if(j!==null){var R=e.unstable_now();_=R;var L=!0;try{L=j(!0,R)}finally{L?P():(k=!1,j=null)}}else k=!1}var P;if(typeof h=="function")P=function(){h(O)};else if(typeof MessageChannel<"u"){var A=new MessageChannel,X=A.port2;A.port1.onmessage=O,P=function(){X.postMessage(null)}}else P=function(){S(O,0)};function H(R){j=R,k||(k=!0,P())}function ne(R,L){T=S(function(){R(e.unstable_now())},L)}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(R){R.callback=null},e.unstable_continueExecution=function(){x||g||(x=!0,H(C))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(R){switch(f){case 1:case 2:case 3:var L=3;break;default:L=f}var N=f;f=L;try{return R()}finally{f=N}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,L){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var N=f;f=R;try{return L()}finally{f=N}},e.unstable_scheduleCallback=function(R,L,N){var z=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?z+N:z):N=z,R){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=N+V,R={id:d++,callback:L,priorityLevel:R,startTime:N,expirationTime:V,sortIndex:-1},N>z?(R.sortIndex=N,t(c,R),n(u)===null&&R===n(c)&&(b?(m(T),T=-1):b=!0,ne(v,N-z))):(R.sortIndex=V,t(u,R),x||g||(x=!0,H(C))),R},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(R){var L=f;return function(){var N=f;f=L;try{return R.apply(this,arguments)}finally{f=N}}}})(Zd);Xd.exports=Zd;var yh=Xd.exports;/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,14 +30,14 @@ var Bm=Object.defineProperty;var Um=(e,t,n)=>t in e?Bm(e,t,{enumerable:!0,config
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
33
|
+
*/var vh=w,ft=yh;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 Jd=new Set,_o={};function cr(e,t){Fr(e,t),Fr(e+"Capture",t)}function Fr(e,t){for(_o[e]=t,e=0;e<t.length;e++)Jd.add(t[e])}var rn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Di=Object.prototype.hasOwnProperty,xh=/^[: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]*$/,Hu={},Bu={};function wh(e){return Di.call(Bu,e)?!0:Di.call(Hu,e)?!1:xh.test(e)?Bu[e]=!0:(Hu[e]=!0,!1)}function bh(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 Sh(e,t,n,r){if(t===null||typeof t>"u"||bh(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 et(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 He={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){He[e]=new et(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];He[t]=new et(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){He[e]=new et(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){He[e]=new et(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){He[e]=new et(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){He[e]=new et(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){He[e]=new et(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){He[e]=new et(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){He[e]=new et(e,5,!1,e.toLowerCase(),null,!1,!1)});var Va=/[\-:]([a-z])/g;function Ha(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(Va,Ha);He[t]=new et(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(Va,Ha);He[t]=new et(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(Va,Ha);He[t]=new et(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){He[e]=new et(e,1,!1,e.toLowerCase(),null,!1,!1)});He.xlinkHref=new et("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){He[e]=new et(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ba(e,t,n,r){var o=He.hasOwnProperty(t)?He[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Sh(t,n,o,r)&&(n=null),r||o===null?wh(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 hn=vh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,sl=Symbol.for("react.element"),xr=Symbol.for("react.portal"),wr=Symbol.for("react.fragment"),Ua=Symbol.for("react.strict_mode"),Mi=Symbol.for("react.profiler"),qd=Symbol.for("react.provider"),ef=Symbol.for("react.context"),Ga=Symbol.for("react.forward_ref"),$i=Symbol.for("react.suspense"),zi=Symbol.for("react.suspense_list"),Ya=Symbol.for("react.memo"),yn=Symbol.for("react.lazy"),tf=Symbol.for("react.offscreen"),Uu=Symbol.iterator;function io(e){return e===null||typeof e!="object"?null:(e=Uu&&e[Uu]||e["@@iterator"],typeof e=="function"?e:null)}var je=Object.assign,Ys;function yo(e){if(Ys===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ys=t&&t[1]||""}return`
|
|
34
34
|
`+Ys+e}var Qs=!1;function Xs(e,t){if(!e||Qs)return"";Qs=!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
35
|
`),l=r.stack.split(`
|
|
36
|
-
`),s=o.length-1,i=l.length-1;1<=s&&0<=i&&o[s]!==l[i];)i--;for(;1<=s&&0<=i;s--,i--)if(o[s]!==l[i]){if(s!==1||i!==1)do if(s--,i--,0>i||o[s]!==l[i]){var
|
|
37
|
-
`+o[s].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=s&&0<=i);break}}}finally{Qs=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?yo(e):""}function Sh(e){switch(e.tag){case 5:return yo(e.type);case 16:return yo("Lazy");case 13:return yo("Suspense");case 19:return yo("SuspenseList");case 0:case 2:case 15:return e=Xs(e.type,!1),e;case 11:return e=Xs(e.type.render,!1),e;case 1:return e=Xs(e.type,!0),e;default:return""}}function Ki(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 wr:return"Fragment";case xr:return"Portal";case Mi:return"Profiler";case Ua:return"StrictMode";case $i:return"Suspense";case zi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qd:return(e.displayName||"Context")+".Consumer";case Jd:return(e._context.displayName||"Context")+".Provider";case Ga:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ya:return t=e.displayName||null,t!==null?t:Ki(e.type)||"Memo";case yn:t=e._payload,e=e._init;try{return Ki(e(t))}catch{}}return null}function kh(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 Ki(t);case 8:return t===Ua?"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 Ln(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ch(e){var t=tf(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 il(e){e._valueTracker||(e._valueTracker=Ch(e))}function nf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=tf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vl(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 Fi(e,t){var n=t.checked;return je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Gu(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ln(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 rf(e,t){t=t.checked,t!=null&&Ba(e,"checked",t,!1)}function Wi(e,t){rf(e,t);var n=Ln(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")?Vi(e,t.type,n):t.hasOwnProperty("defaultValue")&&Vi(e,t.type,Ln(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Yu(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 Vi(e,t,n){(t!=="number"||Vl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var vo=Array.isArray;function Lr(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=""+Ln(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 Hi(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(M(91));return je({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Qu(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(vo(n)){if(1<n.length)throw Error(M(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ln(n)}}function of(e,t){var n=Ln(t.value),r=Ln(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 Xu(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function lf(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 Bi(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?lf(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var al,sf=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(al=al||document.createElement("div"),al.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=al.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Io(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var So={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},jh=["Webkit","ms","Moz","O"];Object.keys(So).forEach(function(e){jh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),So[t]=So[e]})});function af(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||So.hasOwnProperty(e)&&So[e]?(""+t).trim():t+"px"}function uf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=af(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Eh=je({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 Ui(e,t){if(t){if(Eh[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 Gi(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 Yi=null;function Qa(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qi=null,Ar=null,Or=null;function Zu(e){if(e=qo(e)){if(typeof Qi!="function")throw Error(M(280));var t=e.stateNode;t&&(t=Rs(t),Qi(e.stateNode,e.type,t))}}function cf(e){Ar?Or?Or.push(e):Or=[e]:Ar=e}function df(){if(Ar){var e=Ar,t=Or;if(Or=Ar=null,Zu(e),t)for(e=0;e<t.length;e++)Zu(t[e])}}function ff(e,t){return e(t)}function pf(){}var Zs=!1;function mf(e,t,n){if(Zs)return e(t,n);Zs=!0;try{return ff(e,t,n)}finally{Zs=!1,(Ar!==null||Or!==null)&&(pf(),df())}}function Lo(e,t){var n=e.stateNode;if(n===null)return null;var r=Rs(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 Xi=!1;if(rn)try{var ao={};Object.defineProperty(ao,"passive",{get:function(){Xi=!0}}),window.addEventListener("test",ao,ao),window.removeEventListener("test",ao,ao)}catch{Xi=!1}function Th(e,t,n,r,o,l,s,i,a){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var ko=!1,Hl=null,Bl=!1,Zi=null,Nh={onError:function(e){ko=!0,Hl=e}};function Rh(e,t,n,r,o,l,s,i,a){ko=!1,Hl=null,Th.apply(Nh,arguments)}function Ph(e,t,n,r,o,l,s,i,a){if(Rh.apply(this,arguments),ko){if(ko){var c=Hl;ko=!1,Hl=null}else throw Error(M(198));Bl||(Bl=!0,Zi=c)}}function dr(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 hf(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 Ju(e){if(dr(e)!==e)throw Error(M(188))}function _h(e){var t=e.alternate;if(!t){if(t=dr(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 Ju(o),e;if(l===r)return Ju(o),t;l=l.sibling}throw Error(M(188))}if(n.return!==r.return)n=o,r=l;else{for(var s=!1,i=o.child;i;){if(i===n){s=!0,n=o,r=l;break}if(i===r){s=!0,r=o,n=l;break}i=i.sibling}if(!s){for(i=l.child;i;){if(i===n){s=!0,n=l,r=o;break}if(i===r){s=!0,r=l,n=o;break}i=i.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 gf(e){return e=_h(e),e!==null?yf(e):null}function yf(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=yf(e);if(t!==null)return t;e=e.sibling}return null}var vf=ft.unstable_scheduleCallback,qu=ft.unstable_cancelCallback,Ih=ft.unstable_shouldYield,Lh=ft.unstable_requestPaint,Re=ft.unstable_now,Ah=ft.unstable_getCurrentPriorityLevel,Xa=ft.unstable_ImmediatePriority,xf=ft.unstable_UserBlockingPriority,Ul=ft.unstable_NormalPriority,Oh=ft.unstable_LowPriority,wf=ft.unstable_IdlePriority,js=null,Ot=null;function Dh(e){if(Ot&&typeof Ot.onCommitFiberRoot=="function")try{Ot.onCommitFiberRoot(js,e,void 0,(e.current.flags&128)===128)}catch{}}var Nt=Math.clz32?Math.clz32:zh,Mh=Math.log,$h=Math.LN2;function zh(e){return e>>>=0,e===0?32:31-(Mh(e)/$h|0)|0}var ul=64,cl=4194304;function xo(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 Gl(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 i=s&~o;i!==0?r=xo(i):(l&=s,l!==0&&(r=xo(l)))}else s=n&~o,s!==0?r=xo(s):l!==0&&(r=xo(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-Nt(t),o=1<<n,r|=e[n],t&=~o;return r}function Kh(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 Fh(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,l=e.pendingLanes;0<l;){var s=31-Nt(l),i=1<<s,a=o[s];a===-1?(!(i&n)||i&r)&&(o[s]=Kh(i,t)):a<=t&&(e.expiredLanes|=i),l&=~i}}function Ji(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function bf(){var e=ul;return ul<<=1,!(ul&4194240)&&(ul=64),e}function Js(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Zo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Nt(t),e[t]=n}function Wh(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-Nt(n),l=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~l}}function Za(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Nt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var de=0;function Sf(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var kf,Ja,Cf,jf,Ef,qi=!1,dl=[],Cn=null,jn=null,En=null,Ao=new Map,Oo=new Map,wn=[],Vh="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 ec(e,t){switch(e){case"focusin":case"focusout":Cn=null;break;case"dragenter":case"dragleave":jn=null;break;case"mouseover":case"mouseout":En=null;break;case"pointerover":case"pointerout":Ao.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oo.delete(t.pointerId)}}function uo(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=qo(t),t!==null&&Ja(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Hh(e,t,n,r,o){switch(t){case"focusin":return Cn=uo(Cn,e,t,n,r,o),!0;case"dragenter":return jn=uo(jn,e,t,n,r,o),!0;case"mouseover":return En=uo(En,e,t,n,r,o),!0;case"pointerover":var l=o.pointerId;return Ao.set(l,uo(Ao.get(l)||null,e,t,n,r,o)),!0;case"gotpointercapture":return l=o.pointerId,Oo.set(l,uo(Oo.get(l)||null,e,t,n,r,o)),!0}return!1}function Tf(e){var t=Gn(e.target);if(t!==null){var n=dr(t);if(n!==null){if(t=n.tag,t===13){if(t=hf(n),t!==null){e.blockedOn=t,Ef(e.priority,function(){Cf(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 El(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ea(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Yi=r,n.target.dispatchEvent(r),Yi=null}else return t=qo(n),t!==null&&Ja(t),e.blockedOn=n,!1;t.shift()}return!0}function tc(e,t,n){El(e)&&n.delete(t)}function Bh(){qi=!1,Cn!==null&&El(Cn)&&(Cn=null),jn!==null&&El(jn)&&(jn=null),En!==null&&El(En)&&(En=null),Ao.forEach(tc),Oo.forEach(tc)}function co(e,t){e.blockedOn===t&&(e.blockedOn=null,qi||(qi=!0,ft.unstable_scheduleCallback(ft.unstable_NormalPriority,Bh)))}function Do(e){function t(o){return co(o,e)}if(0<dl.length){co(dl[0],e);for(var n=1;n<dl.length;n++){var r=dl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Cn!==null&&co(Cn,e),jn!==null&&co(jn,e),En!==null&&co(En,e),Ao.forEach(t),Oo.forEach(t),n=0;n<wn.length;n++)r=wn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<wn.length&&(n=wn[0],n.blockedOn===null);)Tf(n),n.blockedOn===null&&wn.shift()}var Dr=hn.ReactCurrentBatchConfig,Yl=!0;function Uh(e,t,n,r){var o=de,l=Dr.transition;Dr.transition=null;try{de=1,qa(e,t,n,r)}finally{de=o,Dr.transition=l}}function Gh(e,t,n,r){var o=de,l=Dr.transition;Dr.transition=null;try{de=4,qa(e,t,n,r)}finally{de=o,Dr.transition=l}}function qa(e,t,n,r){if(Yl){var o=ea(e,t,n,r);if(o===null)ai(e,t,r,Ql,n),ec(e,r);else if(Hh(o,e,t,n,r))r.stopPropagation();else if(ec(e,r),t&4&&-1<Vh.indexOf(e)){for(;o!==null;){var l=qo(o);if(l!==null&&kf(l),l=ea(e,t,n,r),l===null&&ai(e,t,r,Ql,n),l===o)break;o=l}o!==null&&r.stopPropagation()}else ai(e,t,r,null,n)}}var Ql=null;function ea(e,t,n,r){if(Ql=null,e=Qa(r),e=Gn(e),e!==null)if(t=dr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=hf(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 Ql=e,null}function Nf(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(Ah()){case Xa:return 1;case xf:return 4;case Ul:case Oh:return 16;case wf:return 536870912;default:return 16}default:return 16}}var Sn=null,eu=null,Tl=null;function Rf(){if(Tl)return Tl;var e,t=eu,n=t.length,r,o="value"in Sn?Sn.value:Sn.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 Tl=o.slice(e,1<r?1-r:void 0)}function Nl(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 fl(){return!0}function nc(){return!1}function mt(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 i in e)e.hasOwnProperty(i)&&(n=e[i],this[i]=n?n(l):l[i]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?fl:nc,this.isPropagationStopped=nc,this}return je(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=fl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=fl)},persist:function(){},isPersistent:fl}),t}var Zr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tu=mt(Zr),Jo=je({},Zr,{view:0,detail:0}),Yh=mt(Jo),qs,ei,fo,Es=je({},Jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nu,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!==fo&&(fo&&e.type==="mousemove"?(qs=e.screenX-fo.screenX,ei=e.screenY-fo.screenY):ei=qs=0,fo=e),qs)},movementY:function(e){return"movementY"in e?e.movementY:ei}}),rc=mt(Es),Qh=je({},Es,{dataTransfer:0}),Xh=mt(Qh),Zh=je({},Jo,{relatedTarget:0}),ti=mt(Zh),Jh=je({},Zr,{animationName:0,elapsedTime:0,pseudoElement:0}),qh=mt(Jh),eg=je({},Zr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),tg=mt(eg),ng=je({},Zr,{data:0}),oc=mt(ng),rg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},og={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"},lg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=lg[e])?!!t[e]:!1}function nu(){return sg}var ig=je({},Jo,{key:function(e){if(e.key){var t=rg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Nl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?og[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nu,charCode:function(e){return e.type==="keypress"?Nl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Nl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ag=mt(ig),ug=je({},Es,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lc=mt(ug),cg=je({},Jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nu}),dg=mt(cg),fg=je({},Zr,{propertyName:0,elapsedTime:0,pseudoElement:0}),pg=mt(fg),mg=je({},Es,{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}),hg=mt(mg),gg=[9,13,27,32],ru=rn&&"CompositionEvent"in window,Co=null;rn&&"documentMode"in document&&(Co=document.documentMode);var yg=rn&&"TextEvent"in window&&!Co,Pf=rn&&(!ru||Co&&8<Co&&11>=Co),sc=" ",ic=!1;function _f(e,t){switch(e){case"keyup":return gg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function If(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var br=!1;function vg(e,t){switch(e){case"compositionend":return If(t);case"keypress":return t.which!==32?null:(ic=!0,sc);case"textInput":return e=t.data,e===sc&&ic?null:e;default:return null}}function xg(e,t){if(br)return e==="compositionend"||!ru&&_f(e,t)?(e=Rf(),Tl=eu=Sn=null,br=!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 Pf&&t.locale!=="ko"?null:t.data;default:return null}}var wg={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 ac(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!wg[e.type]:t==="textarea"}function Lf(e,t,n,r){cf(r),t=Xl(t,"onChange"),0<t.length&&(n=new tu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var jo=null,Mo=null;function bg(e){Hf(e,0)}function Ts(e){var t=Cr(e);if(nf(t))return e}function Sg(e,t){if(e==="change")return t}var Af=!1;if(rn){var ni;if(rn){var ri="oninput"in document;if(!ri){var uc=document.createElement("div");uc.setAttribute("oninput","return;"),ri=typeof uc.oninput=="function"}ni=ri}else ni=!1;Af=ni&&(!document.documentMode||9<document.documentMode)}function cc(){jo&&(jo.detachEvent("onpropertychange",Of),Mo=jo=null)}function Of(e){if(e.propertyName==="value"&&Ts(Mo)){var t=[];Lf(t,Mo,e,Qa(e)),mf(bg,t)}}function kg(e,t,n){e==="focusin"?(cc(),jo=t,Mo=n,jo.attachEvent("onpropertychange",Of)):e==="focusout"&&cc()}function Cg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ts(Mo)}function jg(e,t){if(e==="click")return Ts(t)}function Eg(e,t){if(e==="input"||e==="change")return Ts(t)}function Tg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:Tg;function $o(e,t){if(Pt(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(!Di.call(t,o)||!Pt(e[o],t[o]))return!1}return!0}function dc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fc(e,t){var n=dc(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=dc(n)}}function Df(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Df(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mf(){for(var e=window,t=Vl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vl(e.document)}return t}function ou(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 Ng(e){var t=Mf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Df(n.ownerDocument.documentElement,n)){if(r!==null&&ou(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=fc(n,l);var s=fc(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 Rg=rn&&"documentMode"in document&&11>=document.documentMode,Sr=null,ta=null,Eo=null,na=!1;function pc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;na||Sr==null||Sr!==Vl(r)||(r=Sr,"selectionStart"in r&&ou(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}),Eo&&$o(Eo,r)||(Eo=r,r=Xl(ta,"onSelect"),0<r.length&&(t=new tu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Sr)))}function pl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var kr={animationend:pl("Animation","AnimationEnd"),animationiteration:pl("Animation","AnimationIteration"),animationstart:pl("Animation","AnimationStart"),transitionend:pl("Transition","TransitionEnd")},oi={},$f={};rn&&($f=document.createElement("div").style,"AnimationEvent"in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),"TransitionEvent"in window||delete kr.transitionend.transition);function Ns(e){if(oi[e])return oi[e];if(!kr[e])return e;var t=kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $f)return oi[e]=t[n];return e}var zf=Ns("animationend"),Kf=Ns("animationiteration"),Ff=Ns("animationstart"),Wf=Ns("transitionend"),Vf=new Map,mc="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 Mn(e,t){Vf.set(e,t),cr(t,[e])}for(var li=0;li<mc.length;li++){var si=mc[li],Pg=si.toLowerCase(),_g=si[0].toUpperCase()+si.slice(1);Mn(Pg,"on"+_g)}Mn(zf,"onAnimationEnd");Mn(Kf,"onAnimationIteration");Mn(Ff,"onAnimationStart");Mn("dblclick","onDoubleClick");Mn("focusin","onFocus");Mn("focusout","onBlur");Mn(Wf,"onTransitionEnd");Fr("onMouseEnter",["mouseout","mouseover"]);Fr("onMouseLeave",["mouseout","mouseover"]);Fr("onPointerEnter",["pointerout","pointerover"]);Fr("onPointerLeave",["pointerout","pointerover"]);cr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));cr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));cr("onBeforeInput",["compositionend","keypress","textInput","paste"]);cr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));cr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));cr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wo="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(" "),Ig=new Set("cancel close invalid load scroll toggle".split(" ").concat(wo));function hc(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Ph(r,t,void 0,e),e.currentTarget=null}function Hf(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 i=r[s],a=i.instance,c=i.currentTarget;if(i=i.listener,a!==l&&o.isPropagationStopped())break e;hc(o,i,c),l=a}else for(s=0;s<r.length;s++){if(i=r[s],a=i.instance,c=i.currentTarget,i=i.listener,a!==l&&o.isPropagationStopped())break e;hc(o,i,c),l=a}}}if(Bl)throw e=Zi,Bl=!1,Zi=null,e}function xe(e,t){var n=t[ia];n===void 0&&(n=t[ia]=new Set);var r=e+"__bubble";n.has(r)||(Bf(t,e,2,!1),n.add(r))}function ii(e,t,n){var r=0;t&&(r|=4),Bf(n,e,r,t)}var ml="_reactListening"+Math.random().toString(36).slice(2);function zo(e){if(!e[ml]){e[ml]=!0,Zd.forEach(function(n){n!=="selectionchange"&&(Ig.has(n)||ii(n,!1,e),ii(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ml]||(t[ml]=!0,ii("selectionchange",!1,t))}}function Bf(e,t,n,r){switch(Nf(t)){case 1:var o=Uh;break;case 4:o=Gh;break;default:o=qa}n=o.bind(null,t,n,e),o=void 0,!Xi||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 ai(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 i=r.stateNode.containerInfo;if(i===o||i.nodeType===8&&i.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var a=s.tag;if((a===3||a===4)&&(a=s.stateNode.containerInfo,a===o||a.nodeType===8&&a.parentNode===o))return;s=s.return}for(;i!==null;){if(s=Gn(i),s===null)return;if(a=s.tag,a===5||a===6){r=l=s;continue e}i=i.parentNode}}r=r.return}mf(function(){var c=l,d=Qa(n),p=[];e:{var f=Vf.get(e);if(f!==void 0){var g=tu,x=e;switch(e){case"keypress":if(Nl(n)===0)break e;case"keydown":case"keyup":g=ag;break;case"focusin":x="focus",g=ti;break;case"focusout":x="blur",g=ti;break;case"beforeblur":case"afterblur":g=ti;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":g=rc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=Xh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=dg;break;case zf:case Kf:case Ff:g=qh;break;case Wf:g=pg;break;case"scroll":g=Yh;break;case"wheel":g=hg;break;case"copy":case"cut":case"paste":g=tg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=lc}var b=(t&4)!==0,S=!b&&e==="scroll",m=b?f!==null?f+"Capture":null:f;b=[];for(var h=c,y;h!==null;){y=h;var v=y.stateNode;if(y.tag===5&&v!==null&&(y=v,m!==null&&(v=Lo(h,m),v!=null&&b.push(Ko(h,v,y)))),S)break;h=h.return}0<b.length&&(f=new g(f,x,null,n,d),p.push({event:f,listeners:b}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&n!==Yi&&(x=n.relatedTarget||n.fromElement)&&(Gn(x)||x[on]))break e;if((g||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,g?(x=n.relatedTarget||n.toElement,g=c,x=x?Gn(x):null,x!==null&&(S=dr(x),x!==S||x.tag!==5&&x.tag!==6)&&(x=null)):(g=null,x=c),g!==x)){if(b=rc,v="onMouseLeave",m="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(b=lc,v="onPointerLeave",m="onPointerEnter",h="pointer"),S=g==null?f:Cr(g),y=x==null?f:Cr(x),f=new b(v,h+"leave",g,n,d),f.target=S,f.relatedTarget=y,v=null,Gn(d)===c&&(b=new b(m,h+"enter",x,n,d),b.target=y,b.relatedTarget=S,v=b),S=v,g&&x)t:{for(b=g,m=x,h=0,y=b;y;y=mr(y))h++;for(y=0,v=m;v;v=mr(v))y++;for(;0<h-y;)b=mr(b),h--;for(;0<y-h;)m=mr(m),y--;for(;h--;){if(b===m||m!==null&&b===m.alternate)break t;b=mr(b),m=mr(m)}b=null}else b=null;g!==null&&gc(p,f,g,b,!1),x!==null&&S!==null&&gc(p,S,x,b,!0)}}e:{if(f=c?Cr(c):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var C=Sg;else if(ac(f))if(Af)C=Eg;else{C=Cg;var k=kg}else(g=f.nodeName)&&g.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(C=jg);if(C&&(C=C(e,c))){Lf(p,C,n,d);break e}k&&k(e,f,c),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&Vi(f,"number",f.value)}switch(k=c?Cr(c):window,e){case"focusin":(ac(k)||k.contentEditable==="true")&&(Sr=k,ta=c,Eo=null);break;case"focusout":Eo=ta=Sr=null;break;case"mousedown":na=!0;break;case"contextmenu":case"mouseup":case"dragend":na=!1,pc(p,n,d);break;case"selectionchange":if(Rg)break;case"keydown":case"keyup":pc(p,n,d)}var j;if(ru)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else br?_f(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(Pf&&n.locale!=="ko"&&(br||T!=="onCompositionStart"?T==="onCompositionEnd"&&br&&(j=Rf()):(Sn=d,eu="value"in Sn?Sn.value:Sn.textContent,br=!0)),k=Xl(c,T),0<k.length&&(T=new oc(T,e,null,n,d),p.push({event:T,listeners:k}),j?T.data=j:(j=If(n),j!==null&&(T.data=j)))),(j=yg?vg(e,n):xg(e,n))&&(c=Xl(c,"onBeforeInput"),0<c.length&&(d=new oc("onBeforeInput","beforeinput",null,n,d),p.push({event:d,listeners:c}),d.data=j))}Hf(p,t)})}function Ko(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Xl(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,l=o.stateNode;o.tag===5&&l!==null&&(o=l,l=Lo(e,n),l!=null&&r.unshift(Ko(e,l,o)),l=Lo(e,t),l!=null&&r.push(Ko(e,l,o))),e=e.return}return r}function mr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function gc(e,t,n,r,o){for(var l=t._reactName,s=[];n!==null&&n!==r;){var i=n,a=i.alternate,c=i.stateNode;if(a!==null&&a===r)break;i.tag===5&&c!==null&&(i=c,o?(a=Lo(n,l),a!=null&&s.unshift(Ko(n,a,i))):o||(a=Lo(n,l),a!=null&&s.push(Ko(n,a,i)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Lg=/\r\n?/g,Ag=/\u0000|\uFFFD/g;function yc(e){return(typeof e=="string"?e:""+e).replace(Lg,`
|
|
38
|
-
`).replace(Ag,"")}function hl(e,t,n){if(t=yc(t),yc(e)!==t&&n)throw Error(M(425))}function Zl(){}var ra=null,oa=null;function la(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 sa=typeof setTimeout=="function"?setTimeout:void 0,Og=typeof clearTimeout=="function"?clearTimeout:void 0,vc=typeof Promise=="function"?Promise:void 0,Dg=typeof queueMicrotask=="function"?queueMicrotask:typeof vc<"u"?function(e){return vc.resolve(null).then(e).catch(Mg)}:sa;function Mg(e){setTimeout(function(){throw e})}function ui(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),Do(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Do(t)}function Tn(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 xc(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 Jr=Math.random().toString(36).slice(2),At="__reactFiber$"+Jr,Fo="__reactProps$"+Jr,on="__reactContainer$"+Jr,ia="__reactEvents$"+Jr,$g="__reactListeners$"+Jr,zg="__reactHandles$"+Jr;function Gn(e){var t=e[At];if(t)return t;for(var n=e.parentNode;n;){if(t=n[on]||n[At]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xc(e);e!==null;){if(n=e[At])return n;e=xc(e)}return t}e=n,n=e.parentNode}return null}function qo(e){return e=e[At]||e[on],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Cr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(M(33))}function Rs(e){return e[Fo]||null}var aa=[],jr=-1;function $n(e){return{current:e}}function we(e){0>jr||(e.current=aa[jr],aa[jr]=null,jr--)}function ge(e,t){jr++,aa[jr]=e.current,e.current=t}var An={},Qe=$n(An),ot=$n(!1),er=An;function Wr(e,t){var n=e.type.contextTypes;if(!n)return An;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 lt(e){return e=e.childContextTypes,e!=null}function Jl(){we(ot),we(Qe)}function wc(e,t,n){if(Qe.current!==An)throw Error(M(168));ge(Qe,t),ge(ot,n)}function Uf(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,kh(e)||"Unknown",o));return je({},n,r)}function ql(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||An,er=Qe.current,ge(Qe,e),ge(ot,ot.current),!0}function bc(e,t,n){var r=e.stateNode;if(!r)throw Error(M(169));n?(e=Uf(e,t,er),r.__reactInternalMemoizedMergedChildContext=e,we(ot),we(Qe),ge(Qe,e)):we(ot),ge(ot,n)}var Qt=null,Ps=!1,ci=!1;function Gf(e){Qt===null?Qt=[e]:Qt.push(e)}function Kg(e){Ps=!0,Gf(e)}function zn(){if(!ci&&Qt!==null){ci=!0;var e=0,t=de;try{var n=Qt;for(de=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Qt=null,Ps=!1}catch(o){throw Qt!==null&&(Qt=Qt.slice(e+1)),vf(Xa,zn),o}finally{de=t,ci=!1}}return null}var Er=[],Tr=0,es=null,ts=0,gt=[],yt=0,tr=null,Zt=1,Jt="";function Bn(e,t){Er[Tr++]=ts,Er[Tr++]=es,es=e,ts=t}function Yf(e,t,n){gt[yt++]=Zt,gt[yt++]=Jt,gt[yt++]=tr,tr=e;var r=Zt;e=Jt;var o=32-Nt(r)-1;r&=~(1<<o),n+=1;var l=32-Nt(t)+o;if(30<l){var s=o-o%5;l=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Zt=1<<32-Nt(t)+o|n<<o|r,Jt=l+e}else Zt=1<<l|n<<o|r,Jt=e}function lu(e){e.return!==null&&(Bn(e,1),Yf(e,1,0))}function su(e){for(;e===es;)es=Er[--Tr],Er[Tr]=null,ts=Er[--Tr],Er[Tr]=null;for(;e===tr;)tr=gt[--yt],gt[yt]=null,Jt=gt[--yt],gt[yt]=null,Zt=gt[--yt],gt[yt]=null}var ct=null,ut=null,Se=!1,Tt=null;function Qf(e,t){var n=vt(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 Sc(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,ct=e,ut=Tn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ct=e,ut=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=tr!==null?{id:Zt,overflow:Jt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=vt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ct=e,ut=null,!0):!1;default:return!1}}function ua(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ca(e){if(Se){var t=ut;if(t){var n=t;if(!Sc(e,t)){if(ua(e))throw Error(M(418));t=Tn(n.nextSibling);var r=ct;t&&Sc(e,t)?Qf(r,n):(e.flags=e.flags&-4097|2,Se=!1,ct=e)}}else{if(ua(e))throw Error(M(418));e.flags=e.flags&-4097|2,Se=!1,ct=e}}}function kc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ct=e}function gl(e){if(e!==ct)return!1;if(!Se)return kc(e),Se=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!la(e.type,e.memoizedProps)),t&&(t=ut)){if(ua(e))throw Xf(),Error(M(418));for(;t;)Qf(e,t),t=Tn(t.nextSibling)}if(kc(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){ut=Tn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ut=null}}else ut=ct?Tn(e.stateNode.nextSibling):null;return!0}function Xf(){for(var e=ut;e;)e=Tn(e.nextSibling)}function Vr(){ut=ct=null,Se=!1}function iu(e){Tt===null?Tt=[e]:Tt.push(e)}var Fg=hn.ReactCurrentBatchConfig;function po(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 i=o.refs;s===null?delete i[l]:i[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 yl(e,t){throw e=Object.prototype.toString.call(t),Error(M(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Cc(e){var t=e._init;return t(e._payload)}function Zf(e){function t(m,h){if(e){var y=m.deletions;y===null?(m.deletions=[h],m.flags|=16):y.push(h)}}function n(m,h){if(!e)return null;for(;h!==null;)t(m,h),h=h.sibling;return null}function r(m,h){for(m=new Map;h!==null;)h.key!==null?m.set(h.key,h):m.set(h.index,h),h=h.sibling;return m}function o(m,h){return m=_n(m,h),m.index=0,m.sibling=null,m}function l(m,h,y){return m.index=y,e?(y=m.alternate,y!==null?(y=y.index,y<h?(m.flags|=2,h):y):(m.flags|=2,h)):(m.flags|=1048576,h)}function s(m){return e&&m.alternate===null&&(m.flags|=2),m}function i(m,h,y,v){return h===null||h.tag!==6?(h=yi(y,m.mode,v),h.return=m,h):(h=o(h,y),h.return=m,h)}function a(m,h,y,v){var C=y.type;return C===wr?d(m,h,y.props.children,v,y.key):h!==null&&(h.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===yn&&Cc(C)===h.type)?(v=o(h,y.props),v.ref=po(m,h,y),v.return=m,v):(v=Ol(y.type,y.key,y.props,null,m.mode,v),v.ref=po(m,h,y),v.return=m,v)}function c(m,h,y,v){return h===null||h.tag!==4||h.stateNode.containerInfo!==y.containerInfo||h.stateNode.implementation!==y.implementation?(h=vi(y,m.mode,v),h.return=m,h):(h=o(h,y.children||[]),h.return=m,h)}function d(m,h,y,v,C){return h===null||h.tag!==7?(h=Jn(y,m.mode,v,C),h.return=m,h):(h=o(h,y),h.return=m,h)}function p(m,h,y){if(typeof h=="string"&&h!==""||typeof h=="number")return h=yi(""+h,m.mode,y),h.return=m,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case sl:return y=Ol(h.type,h.key,h.props,null,m.mode,y),y.ref=po(m,null,h),y.return=m,y;case xr:return h=vi(h,m.mode,y),h.return=m,h;case yn:var v=h._init;return p(m,v(h._payload),y)}if(vo(h)||io(h))return h=Jn(h,m.mode,y,null),h.return=m,h;yl(m,h)}return null}function f(m,h,y,v){var C=h!==null?h.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return C!==null?null:i(m,h,""+y,v);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case sl:return y.key===C?a(m,h,y,v):null;case xr:return y.key===C?c(m,h,y,v):null;case yn:return C=y._init,f(m,h,C(y._payload),v)}if(vo(y)||io(y))return C!==null?null:d(m,h,y,v,null);yl(m,y)}return null}function g(m,h,y,v,C){if(typeof v=="string"&&v!==""||typeof v=="number")return m=m.get(y)||null,i(h,m,""+v,C);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case sl:return m=m.get(v.key===null?y:v.key)||null,a(h,m,v,C);case xr:return m=m.get(v.key===null?y:v.key)||null,c(h,m,v,C);case yn:var k=v._init;return g(m,h,y,k(v._payload),C)}if(vo(v)||io(v))return m=m.get(y)||null,d(h,m,v,C,null);yl(h,v)}return null}function x(m,h,y,v){for(var C=null,k=null,j=h,T=h=0,$=null;j!==null&&T<y.length;T++){j.index>T?($=j,j=null):$=j.sibling;var _=f(m,j,y[T],v);if(_===null){j===null&&(j=$);break}e&&j&&_.alternate===null&&t(m,j),h=l(_,h,T),k===null?C=_:k.sibling=_,k=_,j=$}if(T===y.length)return n(m,j),Se&&Bn(m,T),C;if(j===null){for(;T<y.length;T++)j=p(m,y[T],v),j!==null&&(h=l(j,h,T),k===null?C=j:k.sibling=j,k=j);return Se&&Bn(m,T),C}for(j=r(m,j);T<y.length;T++)$=g(j,m,T,y[T],v),$!==null&&(e&&$.alternate!==null&&j.delete($.key===null?T:$.key),h=l($,h,T),k===null?C=$:k.sibling=$,k=$);return e&&j.forEach(function(W){return t(m,W)}),Se&&Bn(m,T),C}function b(m,h,y,v){var C=io(y);if(typeof C!="function")throw Error(M(150));if(y=C.call(y),y==null)throw Error(M(151));for(var k=C=null,j=h,T=h=0,$=null,_=y.next();j!==null&&!_.done;T++,_=y.next()){j.index>T?($=j,j=null):$=j.sibling;var W=f(m,j,_.value,v);if(W===null){j===null&&(j=$);break}e&&j&&W.alternate===null&&t(m,j),h=l(W,h,T),k===null?C=W:k.sibling=W,k=W,j=$}if(_.done)return n(m,j),Se&&Bn(m,T),C;if(j===null){for(;!_.done;T++,_=y.next())_=p(m,_.value,v),_!==null&&(h=l(_,h,T),k===null?C=_:k.sibling=_,k=_);return Se&&Bn(m,T),C}for(j=r(m,j);!_.done;T++,_=y.next())_=g(j,m,T,_.value,v),_!==null&&(e&&_.alternate!==null&&j.delete(_.key===null?T:_.key),h=l(_,h,T),k===null?C=_:k.sibling=_,k=_);return e&&j.forEach(function(O){return t(m,O)}),Se&&Bn(m,T),C}function S(m,h,y,v){if(typeof y=="object"&&y!==null&&y.type===wr&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case sl:e:{for(var C=y.key,k=h;k!==null;){if(k.key===C){if(C=y.type,C===wr){if(k.tag===7){n(m,k.sibling),h=o(k,y.props.children),h.return=m,m=h;break e}}else if(k.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===yn&&Cc(C)===k.type){n(m,k.sibling),h=o(k,y.props),h.ref=po(m,k,y),h.return=m,m=h;break e}n(m,k);break}else t(m,k);k=k.sibling}y.type===wr?(h=Jn(y.props.children,m.mode,v,y.key),h.return=m,m=h):(v=Ol(y.type,y.key,y.props,null,m.mode,v),v.ref=po(m,h,y),v.return=m,m=v)}return s(m);case xr:e:{for(k=y.key;h!==null;){if(h.key===k)if(h.tag===4&&h.stateNode.containerInfo===y.containerInfo&&h.stateNode.implementation===y.implementation){n(m,h.sibling),h=o(h,y.children||[]),h.return=m,m=h;break e}else{n(m,h);break}else t(m,h);h=h.sibling}h=vi(y,m.mode,v),h.return=m,m=h}return s(m);case yn:return k=y._init,S(m,h,k(y._payload),v)}if(vo(y))return x(m,h,y,v);if(io(y))return b(m,h,y,v);yl(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,h!==null&&h.tag===6?(n(m,h.sibling),h=o(h,y),h.return=m,m=h):(n(m,h),h=yi(y,m.mode,v),h.return=m,m=h),s(m)):n(m,h)}return S}var Hr=Zf(!0),Jf=Zf(!1),ns=$n(null),rs=null,Nr=null,au=null;function uu(){au=Nr=rs=null}function cu(e){var t=ns.current;we(ns),e._currentValue=t}function da(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 Mr(e,t){rs=e,au=Nr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(rt=!0),e.firstContext=null)}function bt(e){var t=e._currentValue;if(au!==e)if(e={context:e,memoizedValue:t,next:null},Nr===null){if(rs===null)throw Error(M(308));Nr=e,rs.dependencies={lanes:0,firstContext:e}}else Nr=Nr.next=e;return t}var Yn=null;function du(e){Yn===null?Yn=[e]:Yn.push(e)}function qf(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,du(t)):(n.next=o.next,o.next=n),t.interleaved=n,ln(e,r)}function ln(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 vn=!1;function fu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ep(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 en(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Nn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ue&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,ln(e,n)}return o=r.interleaved,o===null?(t.next=t,du(r)):(t.next=o.next,o.next=t),r.interleaved=t,ln(e,n)}function Rl(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,Za(e,n)}}function jc(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 os(e,t,n,r){var o=e.updateQueue;vn=!1;var l=o.firstBaseUpdate,s=o.lastBaseUpdate,i=o.shared.pending;if(i!==null){o.shared.pending=null;var a=i,c=a.next;a.next=null,s===null?l=c:s.next=c,s=a;var d=e.alternate;d!==null&&(d=d.updateQueue,i=d.lastBaseUpdate,i!==s&&(i===null?d.firstBaseUpdate=c:i.next=c,d.lastBaseUpdate=a))}if(l!==null){var p=o.baseState;s=0,d=c=a=null,i=l;do{var f=i.lane,g=i.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:g,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var x=e,b=i;switch(f=t,g=n,b.tag){case 1:if(x=b.payload,typeof x=="function"){p=x.call(g,p,f);break e}p=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=b.payload,f=typeof x=="function"?x.call(g,p,f):x,f==null)break e;p=je({},p,f);break e;case 2:vn=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[i]:f.push(i))}else g={eventTime:g,lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},d===null?(c=d=g,a=p):d=d.next=g,s|=f;if(i=i.next,i===null){if(i=o.shared.pending,i===null)break;f=i,i=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(d===null&&(a=p),o.baseState=a,o.firstBaseUpdate=c,o.lastBaseUpdate=d,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);rr|=s,e.lanes=s,e.memoizedState=p}}function Ec(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 el={},Dt=$n(el),Wo=$n(el),Vo=$n(el);function Qn(e){if(e===el)throw Error(M(174));return e}function pu(e,t){switch(ge(Vo,t),ge(Wo,e),ge(Dt,el),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Bi(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Bi(t,e)}we(Dt),ge(Dt,t)}function Br(){we(Dt),we(Wo),we(Vo)}function tp(e){Qn(Vo.current);var t=Qn(Dt.current),n=Bi(t,e.type);t!==n&&(ge(Wo,e),ge(Dt,n))}function mu(e){Wo.current===e&&(we(Dt),we(Wo))}var ke=$n(0);function ls(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 di=[];function hu(){for(var e=0;e<di.length;e++)di[e]._workInProgressVersionPrimary=null;di.length=0}var Pl=hn.ReactCurrentDispatcher,fi=hn.ReactCurrentBatchConfig,nr=0,Ce=null,Oe=null,ze=null,ss=!1,To=!1,Ho=0,Wg=0;function Ue(){throw Error(M(321))}function gu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pt(e[n],t[n]))return!1;return!0}function yu(e,t,n,r,o,l){if(nr=l,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Pl.current=e===null||e.memoizedState===null?Ug:Gg,e=n(r,o),To){l=0;do{if(To=!1,Ho=0,25<=l)throw Error(M(301));l+=1,ze=Oe=null,t.updateQueue=null,Pl.current=Yg,e=n(r,o)}while(To)}if(Pl.current=is,t=Oe!==null&&Oe.next!==null,nr=0,ze=Oe=Ce=null,ss=!1,t)throw Error(M(300));return e}function vu(){var e=Ho!==0;return Ho=0,e}function Lt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ze===null?Ce.memoizedState=ze=e:ze=ze.next=e,ze}function St(){if(Oe===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=Oe.next;var t=ze===null?Ce.memoizedState:ze.next;if(t!==null)ze=t,Oe=e;else{if(e===null)throw Error(M(310));Oe=e,e={memoizedState:Oe.memoizedState,baseState:Oe.baseState,baseQueue:Oe.baseQueue,queue:Oe.queue,next:null},ze===null?Ce.memoizedState=ze=e:ze=ze.next=e}return ze}function Bo(e,t){return typeof t=="function"?t(e):t}function pi(e){var t=St(),n=t.queue;if(n===null)throw Error(M(311));n.lastRenderedReducer=e;var r=Oe,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 i=s=null,a=null,c=l;do{var d=c.lane;if((nr&d)===d)a!==null&&(a=a.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 p={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};a===null?(i=a=p,s=r):a=a.next=p,Ce.lanes|=d,rr|=d}c=c.next}while(c!==null&&c!==l);a===null?s=r:a.next=i,Pt(r,t.memoizedState)||(rt=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do l=o.lane,Ce.lanes|=l,rr|=l,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function mi(e){var t=St(),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);Pt(l,t.memoizedState)||(rt=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function np(){}function rp(e,t){var n=Ce,r=St(),o=t(),l=!Pt(r.memoizedState,o);if(l&&(r.memoizedState=o,rt=!0),r=r.queue,xu(sp.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||ze!==null&&ze.memoizedState.tag&1){if(n.flags|=2048,Uo(9,lp.bind(null,n,r,o,t),void 0,null),Ke===null)throw Error(M(349));nr&30||op(n,t,o)}return o}function op(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ce.updateQueue,t===null?(t={lastEffect:null,stores:null},Ce.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function lp(e,t,n,r){t.value=n,t.getSnapshot=r,ip(t)&&ap(e)}function sp(e,t,n){return n(function(){ip(t)&&ap(e)})}function ip(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pt(e,n)}catch{return!0}}function ap(e){var t=ln(e,1);t!==null&&Rt(t,e,1,-1)}function Tc(e){var t=Lt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:e},t.queue=e,e=e.dispatch=Bg.bind(null,Ce,e),[t.memoizedState,e]}function Uo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ce.updateQueue,t===null?(t={lastEffect:null,stores:null},Ce.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 up(){return St().memoizedState}function _l(e,t,n,r){var o=Lt();Ce.flags|=e,o.memoizedState=Uo(1|t,n,void 0,r===void 0?null:r)}function _s(e,t,n,r){var o=St();r=r===void 0?null:r;var l=void 0;if(Oe!==null){var s=Oe.memoizedState;if(l=s.destroy,r!==null&&gu(r,s.deps)){o.memoizedState=Uo(t,n,l,r);return}}Ce.flags|=e,o.memoizedState=Uo(1|t,n,l,r)}function Nc(e,t){return _l(8390656,8,e,t)}function xu(e,t){return _s(2048,8,e,t)}function cp(e,t){return _s(4,2,e,t)}function dp(e,t){return _s(4,4,e,t)}function fp(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 pp(e,t,n){return n=n!=null?n.concat([e]):null,_s(4,4,fp.bind(null,t,e),n)}function wu(){}function mp(e,t){var n=St();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&gu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hp(e,t){var n=St();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&gu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function gp(e,t,n){return nr&21?(Pt(n,t)||(n=bf(),Ce.lanes|=n,rr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,rt=!0),e.memoizedState=n)}function Vg(e,t){var n=de;de=n!==0&&4>n?n:4,e(!0);var r=fi.transition;fi.transition={};try{e(!1),t()}finally{de=n,fi.transition=r}}function yp(){return St().memoizedState}function Hg(e,t,n){var r=Pn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},vp(e))xp(t,n);else if(n=qf(e,t,n,r),n!==null){var o=Ze();Rt(n,e,r,o),wp(n,t,r)}}function Bg(e,t,n){var r=Pn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(vp(e))xp(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,i=l(s,n);if(o.hasEagerState=!0,o.eagerState=i,Pt(i,s)){var a=t.interleaved;a===null?(o.next=o,du(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=qf(e,t,o,r),n!==null&&(o=Ze(),Rt(n,e,r,o),wp(n,t,r))}}function vp(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function xp(e,t){To=ss=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function wp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Za(e,n)}}var is={readContext:bt,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},Ug={readContext:bt,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:bt,useEffect:Nc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_l(4194308,4,fp.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=Lt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Lt();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=Hg.bind(null,Ce,e),[r.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:Tc,useDebugValue:wu,useDeferredValue:function(e){return Lt().memoizedState=e},useTransition:function(){var e=Tc(!1),t=e[0];return e=Vg.bind(null,e[1]),Lt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ce,o=Lt();if(Se){if(n===void 0)throw Error(M(407));n=n()}else{if(n=t(),Ke===null)throw Error(M(349));nr&30||op(r,t,n)}o.memoizedState=n;var l={value:n,getSnapshot:t};return o.queue=l,Nc(sp.bind(null,r,l,e),[e]),r.flags|=2048,Uo(9,lp.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=Lt(),t=Ke.identifierPrefix;if(Se){var n=Jt,r=Zt;n=(r&~(1<<32-Nt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ho++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Wg++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Gg={readContext:bt,useCallback:mp,useContext:bt,useEffect:xu,useImperativeHandle:pp,useInsertionEffect:cp,useLayoutEffect:dp,useMemo:hp,useReducer:pi,useRef:up,useState:function(){return pi(Bo)},useDebugValue:wu,useDeferredValue:function(e){var t=St();return gp(t,Oe.memoizedState,e)},useTransition:function(){var e=pi(Bo)[0],t=St().memoizedState;return[e,t]},useMutableSource:np,useSyncExternalStore:rp,useId:yp,unstable_isNewReconciler:!1},Yg={readContext:bt,useCallback:mp,useContext:bt,useEffect:xu,useImperativeHandle:pp,useInsertionEffect:cp,useLayoutEffect:dp,useMemo:hp,useReducer:mi,useRef:up,useState:function(){return mi(Bo)},useDebugValue:wu,useDeferredValue:function(e){var t=St();return Oe===null?t.memoizedState=e:gp(t,Oe.memoizedState,e)},useTransition:function(){var e=mi(Bo)[0],t=St().memoizedState;return[e,t]},useMutableSource:np,useSyncExternalStore:rp,useId:yp,unstable_isNewReconciler:!1};function jt(e,t){if(e&&e.defaultProps){t=je({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function fa(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:je({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Is={isMounted:function(e){return(e=e._reactInternals)?dr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ze(),o=Pn(e),l=en(r,o);l.payload=t,n!=null&&(l.callback=n),t=Nn(e,l,o),t!==null&&(Rt(t,e,o,r),Rl(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ze(),o=Pn(e),l=en(r,o);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=Nn(e,l,o),t!==null&&(Rt(t,e,o,r),Rl(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ze(),r=Pn(e),o=en(n,r);o.tag=2,t!=null&&(o.callback=t),t=Nn(e,o,r),t!==null&&(Rt(t,e,r,n),Rl(t,e,r))}};function Rc(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?!$o(n,r)||!$o(o,l):!0}function bp(e,t,n){var r=!1,o=An,l=t.contextType;return typeof l=="object"&&l!==null?l=bt(l):(o=lt(t)?er:Qe.current,r=t.contextTypes,l=(r=r!=null)?Wr(e,o):An),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Is,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=l),t}function Pc(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&&Is.enqueueReplaceState(t,t.state,null)}function pa(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},fu(e);var l=t.contextType;typeof l=="object"&&l!==null?o.context=bt(l):(l=lt(t)?er:Qe.current,o.context=Wr(e,l)),o.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(fa(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&&Is.enqueueReplaceState(o,o.state,null),os(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ur(e,t){try{var n="",r=t;do n+=Sh(r),r=r.return;while(r);var o=n}catch(l){o=`
|
|
36
|
+
`),s=o.length-1,i=l.length-1;1<=s&&0<=i&&o[s]!==l[i];)i--;for(;1<=s&&0<=i;s--,i--)if(o[s]!==l[i]){if(s!==1||i!==1)do if(s--,i--,0>i||o[s]!==l[i]){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<=i);break}}}finally{Qs=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?yo(e):""}function kh(e){switch(e.tag){case 5:return yo(e.type);case 16:return yo("Lazy");case 13:return yo("Suspense");case 19:return yo("SuspenseList");case 0:case 2:case 15:return e=Xs(e.type,!1),e;case 11:return e=Xs(e.type.render,!1),e;case 1:return e=Xs(e.type,!0),e;default:return""}}function Ki(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 wr:return"Fragment";case xr:return"Portal";case Mi:return"Profiler";case Ua:return"StrictMode";case $i:return"Suspense";case zi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ef:return(e.displayName||"Context")+".Consumer";case qd:return(e._context.displayName||"Context")+".Provider";case Ga:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ya:return t=e.displayName||null,t!==null?t:Ki(e.type)||"Memo";case yn:t=e._payload,e=e._init;try{return Ki(e(t))}catch{}}return null}function Ch(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 Ki(t);case 8:return t===Ua?"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 Ln(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function nf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function jh(e){var t=nf(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 il(e){e._valueTracker||(e._valueTracker=jh(e))}function rf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=nf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vl(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 Fi(e,t){var n=t.checked;return je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Gu(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ln(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 of(e,t){t=t.checked,t!=null&&Ba(e,"checked",t,!1)}function Wi(e,t){of(e,t);var n=Ln(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")?Vi(e,t.type,n):t.hasOwnProperty("defaultValue")&&Vi(e,t.type,Ln(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Yu(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 Vi(e,t,n){(t!=="number"||Vl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var vo=Array.isArray;function Lr(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=""+Ln(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 Hi(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(M(91));return je({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Qu(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(vo(n)){if(1<n.length)throw Error(M(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ln(n)}}function lf(e,t){var n=Ln(t.value),r=Ln(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 Xu(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 Bi(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 al,af=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(al=al||document.createElement("div"),al.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=al.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Io(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var So={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},Eh=["Webkit","ms","Moz","O"];Object.keys(So).forEach(function(e){Eh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),So[t]=So[e]})});function uf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||So.hasOwnProperty(e)&&So[e]?(""+t).trim():t+"px"}function cf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=uf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Th=je({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 Ui(e,t){if(t){if(Th[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 Gi(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 Yi=null;function Qa(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qi=null,Ar=null,Or=null;function Zu(e){if(e=qo(e)){if(typeof Qi!="function")throw Error(M(280));var t=e.stateNode;t&&(t=Rs(t),Qi(e.stateNode,e.type,t))}}function df(e){Ar?Or?Or.push(e):Or=[e]:Ar=e}function ff(){if(Ar){var e=Ar,t=Or;if(Or=Ar=null,Zu(e),t)for(e=0;e<t.length;e++)Zu(t[e])}}function pf(e,t){return e(t)}function mf(){}var Zs=!1;function hf(e,t,n){if(Zs)return e(t,n);Zs=!0;try{return pf(e,t,n)}finally{Zs=!1,(Ar!==null||Or!==null)&&(mf(),ff())}}function Lo(e,t){var n=e.stateNode;if(n===null)return null;var r=Rs(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 Xi=!1;if(rn)try{var ao={};Object.defineProperty(ao,"passive",{get:function(){Xi=!0}}),window.addEventListener("test",ao,ao),window.removeEventListener("test",ao,ao)}catch{Xi=!1}function Nh(e,t,n,r,o,l,s,i,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var ko=!1,Hl=null,Bl=!1,Zi=null,Rh={onError:function(e){ko=!0,Hl=e}};function Ph(e,t,n,r,o,l,s,i,u){ko=!1,Hl=null,Nh.apply(Rh,arguments)}function _h(e,t,n,r,o,l,s,i,u){if(Ph.apply(this,arguments),ko){if(ko){var c=Hl;ko=!1,Hl=null}else throw Error(M(198));Bl||(Bl=!0,Zi=c)}}function dr(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 gf(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 Ju(e){if(dr(e)!==e)throw Error(M(188))}function Ih(e){var t=e.alternate;if(!t){if(t=dr(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 Ju(o),e;if(l===r)return Ju(o),t;l=l.sibling}throw Error(M(188))}if(n.return!==r.return)n=o,r=l;else{for(var s=!1,i=o.child;i;){if(i===n){s=!0,n=o,r=l;break}if(i===r){s=!0,r=o,n=l;break}i=i.sibling}if(!s){for(i=l.child;i;){if(i===n){s=!0,n=l,r=o;break}if(i===r){s=!0,r=l,n=o;break}i=i.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 yf(e){return e=Ih(e),e!==null?vf(e):null}function vf(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=vf(e);if(t!==null)return t;e=e.sibling}return null}var xf=ft.unstable_scheduleCallback,qu=ft.unstable_cancelCallback,Lh=ft.unstable_shouldYield,Ah=ft.unstable_requestPaint,Re=ft.unstable_now,Oh=ft.unstable_getCurrentPriorityLevel,Xa=ft.unstable_ImmediatePriority,wf=ft.unstable_UserBlockingPriority,Ul=ft.unstable_NormalPriority,Dh=ft.unstable_LowPriority,bf=ft.unstable_IdlePriority,js=null,Ot=null;function Mh(e){if(Ot&&typeof Ot.onCommitFiberRoot=="function")try{Ot.onCommitFiberRoot(js,e,void 0,(e.current.flags&128)===128)}catch{}}var Nt=Math.clz32?Math.clz32:Kh,$h=Math.log,zh=Math.LN2;function Kh(e){return e>>>=0,e===0?32:31-($h(e)/zh|0)|0}var ul=64,cl=4194304;function xo(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 Gl(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 i=s&~o;i!==0?r=xo(i):(l&=s,l!==0&&(r=xo(l)))}else s=n&~o,s!==0?r=xo(s):l!==0&&(r=xo(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-Nt(t),o=1<<n,r|=e[n],t&=~o;return r}function Fh(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 Wh(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,l=e.pendingLanes;0<l;){var s=31-Nt(l),i=1<<s,u=o[s];u===-1?(!(i&n)||i&r)&&(o[s]=Fh(i,t)):u<=t&&(e.expiredLanes|=i),l&=~i}}function Ji(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Sf(){var e=ul;return ul<<=1,!(ul&4194240)&&(ul=64),e}function Js(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Zo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Nt(t),e[t]=n}function Vh(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-Nt(n),l=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~l}}function Za(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Nt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var de=0;function kf(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Cf,Ja,jf,Ef,Tf,qi=!1,dl=[],Cn=null,jn=null,En=null,Ao=new Map,Oo=new Map,wn=[],Hh="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 ec(e,t){switch(e){case"focusin":case"focusout":Cn=null;break;case"dragenter":case"dragleave":jn=null;break;case"mouseover":case"mouseout":En=null;break;case"pointerover":case"pointerout":Ao.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oo.delete(t.pointerId)}}function uo(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=qo(t),t!==null&&Ja(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Bh(e,t,n,r,o){switch(t){case"focusin":return Cn=uo(Cn,e,t,n,r,o),!0;case"dragenter":return jn=uo(jn,e,t,n,r,o),!0;case"mouseover":return En=uo(En,e,t,n,r,o),!0;case"pointerover":var l=o.pointerId;return Ao.set(l,uo(Ao.get(l)||null,e,t,n,r,o)),!0;case"gotpointercapture":return l=o.pointerId,Oo.set(l,uo(Oo.get(l)||null,e,t,n,r,o)),!0}return!1}function Nf(e){var t=Gn(e.target);if(t!==null){var n=dr(t);if(n!==null){if(t=n.tag,t===13){if(t=gf(n),t!==null){e.blockedOn=t,Tf(e.priority,function(){jf(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 El(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ea(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Yi=r,n.target.dispatchEvent(r),Yi=null}else return t=qo(n),t!==null&&Ja(t),e.blockedOn=n,!1;t.shift()}return!0}function tc(e,t,n){El(e)&&n.delete(t)}function Uh(){qi=!1,Cn!==null&&El(Cn)&&(Cn=null),jn!==null&&El(jn)&&(jn=null),En!==null&&El(En)&&(En=null),Ao.forEach(tc),Oo.forEach(tc)}function co(e,t){e.blockedOn===t&&(e.blockedOn=null,qi||(qi=!0,ft.unstable_scheduleCallback(ft.unstable_NormalPriority,Uh)))}function Do(e){function t(o){return co(o,e)}if(0<dl.length){co(dl[0],e);for(var n=1;n<dl.length;n++){var r=dl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Cn!==null&&co(Cn,e),jn!==null&&co(jn,e),En!==null&&co(En,e),Ao.forEach(t),Oo.forEach(t),n=0;n<wn.length;n++)r=wn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<wn.length&&(n=wn[0],n.blockedOn===null);)Nf(n),n.blockedOn===null&&wn.shift()}var Dr=hn.ReactCurrentBatchConfig,Yl=!0;function Gh(e,t,n,r){var o=de,l=Dr.transition;Dr.transition=null;try{de=1,qa(e,t,n,r)}finally{de=o,Dr.transition=l}}function Yh(e,t,n,r){var o=de,l=Dr.transition;Dr.transition=null;try{de=4,qa(e,t,n,r)}finally{de=o,Dr.transition=l}}function qa(e,t,n,r){if(Yl){var o=ea(e,t,n,r);if(o===null)ai(e,t,r,Ql,n),ec(e,r);else if(Bh(o,e,t,n,r))r.stopPropagation();else if(ec(e,r),t&4&&-1<Hh.indexOf(e)){for(;o!==null;){var l=qo(o);if(l!==null&&Cf(l),l=ea(e,t,n,r),l===null&&ai(e,t,r,Ql,n),l===o)break;o=l}o!==null&&r.stopPropagation()}else ai(e,t,r,null,n)}}var Ql=null;function ea(e,t,n,r){if(Ql=null,e=Qa(r),e=Gn(e),e!==null)if(t=dr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=gf(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 Ql=e,null}function Rf(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(Oh()){case Xa:return 1;case wf:return 4;case Ul:case Dh:return 16;case bf:return 536870912;default:return 16}default:return 16}}var Sn=null,eu=null,Tl=null;function Pf(){if(Tl)return Tl;var e,t=eu,n=t.length,r,o="value"in Sn?Sn.value:Sn.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 Tl=o.slice(e,1<r?1-r:void 0)}function Nl(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 fl(){return!0}function nc(){return!1}function mt(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 i in e)e.hasOwnProperty(i)&&(n=e[i],this[i]=n?n(l):l[i]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?fl:nc,this.isPropagationStopped=nc,this}return je(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=fl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=fl)},persist:function(){},isPersistent:fl}),t}var Zr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tu=mt(Zr),Jo=je({},Zr,{view:0,detail:0}),Qh=mt(Jo),qs,ei,fo,Es=je({},Jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nu,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!==fo&&(fo&&e.type==="mousemove"?(qs=e.screenX-fo.screenX,ei=e.screenY-fo.screenY):ei=qs=0,fo=e),qs)},movementY:function(e){return"movementY"in e?e.movementY:ei}}),rc=mt(Es),Xh=je({},Es,{dataTransfer:0}),Zh=mt(Xh),Jh=je({},Jo,{relatedTarget:0}),ti=mt(Jh),qh=je({},Zr,{animationName:0,elapsedTime:0,pseudoElement:0}),eg=mt(qh),tg=je({},Zr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ng=mt(tg),rg=je({},Zr,{data:0}),oc=mt(rg),og={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lg={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"},sg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ig(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sg[e])?!!t[e]:!1}function nu(){return ig}var ag=je({},Jo,{key:function(e){if(e.key){var t=og[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Nl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?lg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nu,charCode:function(e){return e.type==="keypress"?Nl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Nl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ug=mt(ag),cg=je({},Es,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lc=mt(cg),dg=je({},Jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nu}),fg=mt(dg),pg=je({},Zr,{propertyName:0,elapsedTime:0,pseudoElement:0}),mg=mt(pg),hg=je({},Es,{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}),gg=mt(hg),yg=[9,13,27,32],ru=rn&&"CompositionEvent"in window,Co=null;rn&&"documentMode"in document&&(Co=document.documentMode);var vg=rn&&"TextEvent"in window&&!Co,_f=rn&&(!ru||Co&&8<Co&&11>=Co),sc=" ",ic=!1;function If(e,t){switch(e){case"keyup":return yg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var br=!1;function xg(e,t){switch(e){case"compositionend":return Lf(t);case"keypress":return t.which!==32?null:(ic=!0,sc);case"textInput":return e=t.data,e===sc&&ic?null:e;default:return null}}function wg(e,t){if(br)return e==="compositionend"||!ru&&If(e,t)?(e=Pf(),Tl=eu=Sn=null,br=!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 _f&&t.locale!=="ko"?null:t.data;default:return null}}var bg={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 ac(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!bg[e.type]:t==="textarea"}function Af(e,t,n,r){df(r),t=Xl(t,"onChange"),0<t.length&&(n=new tu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var jo=null,Mo=null;function Sg(e){Bf(e,0)}function Ts(e){var t=Cr(e);if(rf(t))return e}function kg(e,t){if(e==="change")return t}var Of=!1;if(rn){var ni;if(rn){var ri="oninput"in document;if(!ri){var uc=document.createElement("div");uc.setAttribute("oninput","return;"),ri=typeof uc.oninput=="function"}ni=ri}else ni=!1;Of=ni&&(!document.documentMode||9<document.documentMode)}function cc(){jo&&(jo.detachEvent("onpropertychange",Df),Mo=jo=null)}function Df(e){if(e.propertyName==="value"&&Ts(Mo)){var t=[];Af(t,Mo,e,Qa(e)),hf(Sg,t)}}function Cg(e,t,n){e==="focusin"?(cc(),jo=t,Mo=n,jo.attachEvent("onpropertychange",Df)):e==="focusout"&&cc()}function jg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ts(Mo)}function Eg(e,t){if(e==="click")return Ts(t)}function Tg(e,t){if(e==="input"||e==="change")return Ts(t)}function Ng(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:Ng;function $o(e,t){if(Pt(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(!Di.call(t,o)||!Pt(e[o],t[o]))return!1}return!0}function dc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fc(e,t){var n=dc(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=dc(n)}}function Mf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $f(){for(var e=window,t=Vl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vl(e.document)}return t}function ou(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 Rg(e){var t=$f(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Mf(n.ownerDocument.documentElement,n)){if(r!==null&&ou(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=fc(n,l);var s=fc(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 Pg=rn&&"documentMode"in document&&11>=document.documentMode,Sr=null,ta=null,Eo=null,na=!1;function pc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;na||Sr==null||Sr!==Vl(r)||(r=Sr,"selectionStart"in r&&ou(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}),Eo&&$o(Eo,r)||(Eo=r,r=Xl(ta,"onSelect"),0<r.length&&(t=new tu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Sr)))}function pl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var kr={animationend:pl("Animation","AnimationEnd"),animationiteration:pl("Animation","AnimationIteration"),animationstart:pl("Animation","AnimationStart"),transitionend:pl("Transition","TransitionEnd")},oi={},zf={};rn&&(zf=document.createElement("div").style,"AnimationEvent"in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),"TransitionEvent"in window||delete kr.transitionend.transition);function Ns(e){if(oi[e])return oi[e];if(!kr[e])return e;var t=kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zf)return oi[e]=t[n];return e}var Kf=Ns("animationend"),Ff=Ns("animationiteration"),Wf=Ns("animationstart"),Vf=Ns("transitionend"),Hf=new Map,mc="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 Mn(e,t){Hf.set(e,t),cr(t,[e])}for(var li=0;li<mc.length;li++){var si=mc[li],_g=si.toLowerCase(),Ig=si[0].toUpperCase()+si.slice(1);Mn(_g,"on"+Ig)}Mn(Kf,"onAnimationEnd");Mn(Ff,"onAnimationIteration");Mn(Wf,"onAnimationStart");Mn("dblclick","onDoubleClick");Mn("focusin","onFocus");Mn("focusout","onBlur");Mn(Vf,"onTransitionEnd");Fr("onMouseEnter",["mouseout","mouseover"]);Fr("onMouseLeave",["mouseout","mouseover"]);Fr("onPointerEnter",["pointerout","pointerover"]);Fr("onPointerLeave",["pointerout","pointerover"]);cr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));cr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));cr("onBeforeInput",["compositionend","keypress","textInput","paste"]);cr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));cr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));cr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wo="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(" "),Lg=new Set("cancel close invalid load scroll toggle".split(" ").concat(wo));function hc(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,_h(r,t,void 0,e),e.currentTarget=null}function Bf(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 i=r[s],u=i.instance,c=i.currentTarget;if(i=i.listener,u!==l&&o.isPropagationStopped())break e;hc(o,i,c),l=u}else for(s=0;s<r.length;s++){if(i=r[s],u=i.instance,c=i.currentTarget,i=i.listener,u!==l&&o.isPropagationStopped())break e;hc(o,i,c),l=u}}}if(Bl)throw e=Zi,Bl=!1,Zi=null,e}function xe(e,t){var n=t[ia];n===void 0&&(n=t[ia]=new Set);var r=e+"__bubble";n.has(r)||(Uf(t,e,2,!1),n.add(r))}function ii(e,t,n){var r=0;t&&(r|=4),Uf(n,e,r,t)}var ml="_reactListening"+Math.random().toString(36).slice(2);function zo(e){if(!e[ml]){e[ml]=!0,Jd.forEach(function(n){n!=="selectionchange"&&(Lg.has(n)||ii(n,!1,e),ii(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ml]||(t[ml]=!0,ii("selectionchange",!1,t))}}function Uf(e,t,n,r){switch(Rf(t)){case 1:var o=Gh;break;case 4:o=Yh;break;default:o=qa}n=o.bind(null,t,n,e),o=void 0,!Xi||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 ai(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 i=r.stateNode.containerInfo;if(i===o||i.nodeType===8&&i.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(;i!==null;){if(s=Gn(i),s===null)return;if(u=s.tag,u===5||u===6){r=l=s;continue e}i=i.parentNode}}r=r.return}hf(function(){var c=l,d=Qa(n),p=[];e:{var f=Hf.get(e);if(f!==void 0){var g=tu,x=e;switch(e){case"keypress":if(Nl(n)===0)break e;case"keydown":case"keyup":g=ug;break;case"focusin":x="focus",g=ti;break;case"focusout":x="blur",g=ti;break;case"beforeblur":case"afterblur":g=ti;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":g=rc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=Zh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=fg;break;case Kf:case Ff:case Wf:g=eg;break;case Vf:g=mg;break;case"scroll":g=Qh;break;case"wheel":g=gg;break;case"copy":case"cut":case"paste":g=ng;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=lc}var b=(t&4)!==0,S=!b&&e==="scroll",m=b?f!==null?f+"Capture":null:f;b=[];for(var h=c,y;h!==null;){y=h;var v=y.stateNode;if(y.tag===5&&v!==null&&(y=v,m!==null&&(v=Lo(h,m),v!=null&&b.push(Ko(h,v,y)))),S)break;h=h.return}0<b.length&&(f=new g(f,x,null,n,d),p.push({event:f,listeners:b}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&n!==Yi&&(x=n.relatedTarget||n.fromElement)&&(Gn(x)||x[on]))break e;if((g||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,g?(x=n.relatedTarget||n.toElement,g=c,x=x?Gn(x):null,x!==null&&(S=dr(x),x!==S||x.tag!==5&&x.tag!==6)&&(x=null)):(g=null,x=c),g!==x)){if(b=rc,v="onMouseLeave",m="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(b=lc,v="onPointerLeave",m="onPointerEnter",h="pointer"),S=g==null?f:Cr(g),y=x==null?f:Cr(x),f=new b(v,h+"leave",g,n,d),f.target=S,f.relatedTarget=y,v=null,Gn(d)===c&&(b=new b(m,h+"enter",x,n,d),b.target=y,b.relatedTarget=S,v=b),S=v,g&&x)t:{for(b=g,m=x,h=0,y=b;y;y=mr(y))h++;for(y=0,v=m;v;v=mr(v))y++;for(;0<h-y;)b=mr(b),h--;for(;0<y-h;)m=mr(m),y--;for(;h--;){if(b===m||m!==null&&b===m.alternate)break t;b=mr(b),m=mr(m)}b=null}else b=null;g!==null&&gc(p,f,g,b,!1),x!==null&&S!==null&&gc(p,S,x,b,!0)}}e:{if(f=c?Cr(c):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var C=kg;else if(ac(f))if(Of)C=Tg;else{C=jg;var k=Cg}else(g=f.nodeName)&&g.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(C=Eg);if(C&&(C=C(e,c))){Af(p,C,n,d);break e}k&&k(e,f,c),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&Vi(f,"number",f.value)}switch(k=c?Cr(c):window,e){case"focusin":(ac(k)||k.contentEditable==="true")&&(Sr=k,ta=c,Eo=null);break;case"focusout":Eo=ta=Sr=null;break;case"mousedown":na=!0;break;case"contextmenu":case"mouseup":case"dragend":na=!1,pc(p,n,d);break;case"selectionchange":if(Pg)break;case"keydown":case"keyup":pc(p,n,d)}var j;if(ru)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else br?If(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(_f&&n.locale!=="ko"&&(br||T!=="onCompositionStart"?T==="onCompositionEnd"&&br&&(j=Pf()):(Sn=d,eu="value"in Sn?Sn.value:Sn.textContent,br=!0)),k=Xl(c,T),0<k.length&&(T=new oc(T,e,null,n,d),p.push({event:T,listeners:k}),j?T.data=j:(j=Lf(n),j!==null&&(T.data=j)))),(j=vg?xg(e,n):wg(e,n))&&(c=Xl(c,"onBeforeInput"),0<c.length&&(d=new oc("onBeforeInput","beforeinput",null,n,d),p.push({event:d,listeners:c}),d.data=j))}Bf(p,t)})}function Ko(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Xl(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,l=o.stateNode;o.tag===5&&l!==null&&(o=l,l=Lo(e,n),l!=null&&r.unshift(Ko(e,l,o)),l=Lo(e,t),l!=null&&r.push(Ko(e,l,o))),e=e.return}return r}function mr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function gc(e,t,n,r,o){for(var l=t._reactName,s=[];n!==null&&n!==r;){var i=n,u=i.alternate,c=i.stateNode;if(u!==null&&u===r)break;i.tag===5&&c!==null&&(i=c,o?(u=Lo(n,l),u!=null&&s.unshift(Ko(n,u,i))):o||(u=Lo(n,l),u!=null&&s.push(Ko(n,u,i)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Ag=/\r\n?/g,Og=/\u0000|\uFFFD/g;function yc(e){return(typeof e=="string"?e:""+e).replace(Ag,`
|
|
38
|
+
`).replace(Og,"")}function hl(e,t,n){if(t=yc(t),yc(e)!==t&&n)throw Error(M(425))}function Zl(){}var ra=null,oa=null;function la(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 sa=typeof setTimeout=="function"?setTimeout:void 0,Dg=typeof clearTimeout=="function"?clearTimeout:void 0,vc=typeof Promise=="function"?Promise:void 0,Mg=typeof queueMicrotask=="function"?queueMicrotask:typeof vc<"u"?function(e){return vc.resolve(null).then(e).catch($g)}:sa;function $g(e){setTimeout(function(){throw e})}function ui(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),Do(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Do(t)}function Tn(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 xc(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 Jr=Math.random().toString(36).slice(2),At="__reactFiber$"+Jr,Fo="__reactProps$"+Jr,on="__reactContainer$"+Jr,ia="__reactEvents$"+Jr,zg="__reactListeners$"+Jr,Kg="__reactHandles$"+Jr;function Gn(e){var t=e[At];if(t)return t;for(var n=e.parentNode;n;){if(t=n[on]||n[At]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xc(e);e!==null;){if(n=e[At])return n;e=xc(e)}return t}e=n,n=e.parentNode}return null}function qo(e){return e=e[At]||e[on],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Cr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(M(33))}function Rs(e){return e[Fo]||null}var aa=[],jr=-1;function $n(e){return{current:e}}function we(e){0>jr||(e.current=aa[jr],aa[jr]=null,jr--)}function ge(e,t){jr++,aa[jr]=e.current,e.current=t}var An={},Qe=$n(An),ot=$n(!1),er=An;function Wr(e,t){var n=e.type.contextTypes;if(!n)return An;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 lt(e){return e=e.childContextTypes,e!=null}function Jl(){we(ot),we(Qe)}function wc(e,t,n){if(Qe.current!==An)throw Error(M(168));ge(Qe,t),ge(ot,n)}function Gf(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,Ch(e)||"Unknown",o));return je({},n,r)}function ql(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||An,er=Qe.current,ge(Qe,e),ge(ot,ot.current),!0}function bc(e,t,n){var r=e.stateNode;if(!r)throw Error(M(169));n?(e=Gf(e,t,er),r.__reactInternalMemoizedMergedChildContext=e,we(ot),we(Qe),ge(Qe,e)):we(ot),ge(ot,n)}var Qt=null,Ps=!1,ci=!1;function Yf(e){Qt===null?Qt=[e]:Qt.push(e)}function Fg(e){Ps=!0,Yf(e)}function zn(){if(!ci&&Qt!==null){ci=!0;var e=0,t=de;try{var n=Qt;for(de=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Qt=null,Ps=!1}catch(o){throw Qt!==null&&(Qt=Qt.slice(e+1)),xf(Xa,zn),o}finally{de=t,ci=!1}}return null}var Er=[],Tr=0,es=null,ts=0,gt=[],yt=0,tr=null,Zt=1,Jt="";function Bn(e,t){Er[Tr++]=ts,Er[Tr++]=es,es=e,ts=t}function Qf(e,t,n){gt[yt++]=Zt,gt[yt++]=Jt,gt[yt++]=tr,tr=e;var r=Zt;e=Jt;var o=32-Nt(r)-1;r&=~(1<<o),n+=1;var l=32-Nt(t)+o;if(30<l){var s=o-o%5;l=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Zt=1<<32-Nt(t)+o|n<<o|r,Jt=l+e}else Zt=1<<l|n<<o|r,Jt=e}function lu(e){e.return!==null&&(Bn(e,1),Qf(e,1,0))}function su(e){for(;e===es;)es=Er[--Tr],Er[Tr]=null,ts=Er[--Tr],Er[Tr]=null;for(;e===tr;)tr=gt[--yt],gt[yt]=null,Jt=gt[--yt],gt[yt]=null,Zt=gt[--yt],gt[yt]=null}var ct=null,ut=null,Se=!1,Tt=null;function Xf(e,t){var n=vt(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 Sc(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,ct=e,ut=Tn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ct=e,ut=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=tr!==null?{id:Zt,overflow:Jt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=vt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ct=e,ut=null,!0):!1;default:return!1}}function ua(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ca(e){if(Se){var t=ut;if(t){var n=t;if(!Sc(e,t)){if(ua(e))throw Error(M(418));t=Tn(n.nextSibling);var r=ct;t&&Sc(e,t)?Xf(r,n):(e.flags=e.flags&-4097|2,Se=!1,ct=e)}}else{if(ua(e))throw Error(M(418));e.flags=e.flags&-4097|2,Se=!1,ct=e}}}function kc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ct=e}function gl(e){if(e!==ct)return!1;if(!Se)return kc(e),Se=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!la(e.type,e.memoizedProps)),t&&(t=ut)){if(ua(e))throw Zf(),Error(M(418));for(;t;)Xf(e,t),t=Tn(t.nextSibling)}if(kc(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){ut=Tn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ut=null}}else ut=ct?Tn(e.stateNode.nextSibling):null;return!0}function Zf(){for(var e=ut;e;)e=Tn(e.nextSibling)}function Vr(){ut=ct=null,Se=!1}function iu(e){Tt===null?Tt=[e]:Tt.push(e)}var Wg=hn.ReactCurrentBatchConfig;function po(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 i=o.refs;s===null?delete i[l]:i[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 yl(e,t){throw e=Object.prototype.toString.call(t),Error(M(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Cc(e){var t=e._init;return t(e._payload)}function Jf(e){function t(m,h){if(e){var y=m.deletions;y===null?(m.deletions=[h],m.flags|=16):y.push(h)}}function n(m,h){if(!e)return null;for(;h!==null;)t(m,h),h=h.sibling;return null}function r(m,h){for(m=new Map;h!==null;)h.key!==null?m.set(h.key,h):m.set(h.index,h),h=h.sibling;return m}function o(m,h){return m=_n(m,h),m.index=0,m.sibling=null,m}function l(m,h,y){return m.index=y,e?(y=m.alternate,y!==null?(y=y.index,y<h?(m.flags|=2,h):y):(m.flags|=2,h)):(m.flags|=1048576,h)}function s(m){return e&&m.alternate===null&&(m.flags|=2),m}function i(m,h,y,v){return h===null||h.tag!==6?(h=yi(y,m.mode,v),h.return=m,h):(h=o(h,y),h.return=m,h)}function u(m,h,y,v){var C=y.type;return C===wr?d(m,h,y.props.children,v,y.key):h!==null&&(h.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===yn&&Cc(C)===h.type)?(v=o(h,y.props),v.ref=po(m,h,y),v.return=m,v):(v=Ol(y.type,y.key,y.props,null,m.mode,v),v.ref=po(m,h,y),v.return=m,v)}function c(m,h,y,v){return h===null||h.tag!==4||h.stateNode.containerInfo!==y.containerInfo||h.stateNode.implementation!==y.implementation?(h=vi(y,m.mode,v),h.return=m,h):(h=o(h,y.children||[]),h.return=m,h)}function d(m,h,y,v,C){return h===null||h.tag!==7?(h=Jn(y,m.mode,v,C),h.return=m,h):(h=o(h,y),h.return=m,h)}function p(m,h,y){if(typeof h=="string"&&h!==""||typeof h=="number")return h=yi(""+h,m.mode,y),h.return=m,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case sl:return y=Ol(h.type,h.key,h.props,null,m.mode,y),y.ref=po(m,null,h),y.return=m,y;case xr:return h=vi(h,m.mode,y),h.return=m,h;case yn:var v=h._init;return p(m,v(h._payload),y)}if(vo(h)||io(h))return h=Jn(h,m.mode,y,null),h.return=m,h;yl(m,h)}return null}function f(m,h,y,v){var C=h!==null?h.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return C!==null?null:i(m,h,""+y,v);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case sl:return y.key===C?u(m,h,y,v):null;case xr:return y.key===C?c(m,h,y,v):null;case yn:return C=y._init,f(m,h,C(y._payload),v)}if(vo(y)||io(y))return C!==null?null:d(m,h,y,v,null);yl(m,y)}return null}function g(m,h,y,v,C){if(typeof v=="string"&&v!==""||typeof v=="number")return m=m.get(y)||null,i(h,m,""+v,C);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case sl:return m=m.get(v.key===null?y:v.key)||null,u(h,m,v,C);case xr:return m=m.get(v.key===null?y:v.key)||null,c(h,m,v,C);case yn:var k=v._init;return g(m,h,y,k(v._payload),C)}if(vo(v)||io(v))return m=m.get(y)||null,d(h,m,v,C,null);yl(h,v)}return null}function x(m,h,y,v){for(var C=null,k=null,j=h,T=h=0,$=null;j!==null&&T<y.length;T++){j.index>T?($=j,j=null):$=j.sibling;var _=f(m,j,y[T],v);if(_===null){j===null&&(j=$);break}e&&j&&_.alternate===null&&t(m,j),h=l(_,h,T),k===null?C=_:k.sibling=_,k=_,j=$}if(T===y.length)return n(m,j),Se&&Bn(m,T),C;if(j===null){for(;T<y.length;T++)j=p(m,y[T],v),j!==null&&(h=l(j,h,T),k===null?C=j:k.sibling=j,k=j);return Se&&Bn(m,T),C}for(j=r(m,j);T<y.length;T++)$=g(j,m,T,y[T],v),$!==null&&(e&&$.alternate!==null&&j.delete($.key===null?T:$.key),h=l($,h,T),k===null?C=$:k.sibling=$,k=$);return e&&j.forEach(function(W){return t(m,W)}),Se&&Bn(m,T),C}function b(m,h,y,v){var C=io(y);if(typeof C!="function")throw Error(M(150));if(y=C.call(y),y==null)throw Error(M(151));for(var k=C=null,j=h,T=h=0,$=null,_=y.next();j!==null&&!_.done;T++,_=y.next()){j.index>T?($=j,j=null):$=j.sibling;var W=f(m,j,_.value,v);if(W===null){j===null&&(j=$);break}e&&j&&W.alternate===null&&t(m,j),h=l(W,h,T),k===null?C=W:k.sibling=W,k=W,j=$}if(_.done)return n(m,j),Se&&Bn(m,T),C;if(j===null){for(;!_.done;T++,_=y.next())_=p(m,_.value,v),_!==null&&(h=l(_,h,T),k===null?C=_:k.sibling=_,k=_);return Se&&Bn(m,T),C}for(j=r(m,j);!_.done;T++,_=y.next())_=g(j,m,T,_.value,v),_!==null&&(e&&_.alternate!==null&&j.delete(_.key===null?T:_.key),h=l(_,h,T),k===null?C=_:k.sibling=_,k=_);return e&&j.forEach(function(O){return t(m,O)}),Se&&Bn(m,T),C}function S(m,h,y,v){if(typeof y=="object"&&y!==null&&y.type===wr&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case sl:e:{for(var C=y.key,k=h;k!==null;){if(k.key===C){if(C=y.type,C===wr){if(k.tag===7){n(m,k.sibling),h=o(k,y.props.children),h.return=m,m=h;break e}}else if(k.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===yn&&Cc(C)===k.type){n(m,k.sibling),h=o(k,y.props),h.ref=po(m,k,y),h.return=m,m=h;break e}n(m,k);break}else t(m,k);k=k.sibling}y.type===wr?(h=Jn(y.props.children,m.mode,v,y.key),h.return=m,m=h):(v=Ol(y.type,y.key,y.props,null,m.mode,v),v.ref=po(m,h,y),v.return=m,m=v)}return s(m);case xr:e:{for(k=y.key;h!==null;){if(h.key===k)if(h.tag===4&&h.stateNode.containerInfo===y.containerInfo&&h.stateNode.implementation===y.implementation){n(m,h.sibling),h=o(h,y.children||[]),h.return=m,m=h;break e}else{n(m,h);break}else t(m,h);h=h.sibling}h=vi(y,m.mode,v),h.return=m,m=h}return s(m);case yn:return k=y._init,S(m,h,k(y._payload),v)}if(vo(y))return x(m,h,y,v);if(io(y))return b(m,h,y,v);yl(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,h!==null&&h.tag===6?(n(m,h.sibling),h=o(h,y),h.return=m,m=h):(n(m,h),h=yi(y,m.mode,v),h.return=m,m=h),s(m)):n(m,h)}return S}var Hr=Jf(!0),qf=Jf(!1),ns=$n(null),rs=null,Nr=null,au=null;function uu(){au=Nr=rs=null}function cu(e){var t=ns.current;we(ns),e._currentValue=t}function da(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 Mr(e,t){rs=e,au=Nr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(rt=!0),e.firstContext=null)}function bt(e){var t=e._currentValue;if(au!==e)if(e={context:e,memoizedValue:t,next:null},Nr===null){if(rs===null)throw Error(M(308));Nr=e,rs.dependencies={lanes:0,firstContext:e}}else Nr=Nr.next=e;return t}var Yn=null;function du(e){Yn===null?Yn=[e]:Yn.push(e)}function ep(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,du(t)):(n.next=o.next,o.next=n),t.interleaved=n,ln(e,r)}function ln(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 vn=!1;function fu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function tp(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 en(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Nn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ue&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,ln(e,n)}return o=r.interleaved,o===null?(t.next=t,du(r)):(t.next=o.next,o.next=t),r.interleaved=t,ln(e,n)}function Rl(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,Za(e,n)}}function jc(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 os(e,t,n,r){var o=e.updateQueue;vn=!1;var l=o.firstBaseUpdate,s=o.lastBaseUpdate,i=o.shared.pending;if(i!==null){o.shared.pending=null;var u=i,c=u.next;u.next=null,s===null?l=c:s.next=c,s=u;var d=e.alternate;d!==null&&(d=d.updateQueue,i=d.lastBaseUpdate,i!==s&&(i===null?d.firstBaseUpdate=c:i.next=c,d.lastBaseUpdate=u))}if(l!==null){var p=o.baseState;s=0,d=c=u=null,i=l;do{var f=i.lane,g=i.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:g,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var x=e,b=i;switch(f=t,g=n,b.tag){case 1:if(x=b.payload,typeof x=="function"){p=x.call(g,p,f);break e}p=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=b.payload,f=typeof x=="function"?x.call(g,p,f):x,f==null)break e;p=je({},p,f);break e;case 2:vn=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[i]:f.push(i))}else g={eventTime:g,lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},d===null?(c=d=g,u=p):d=d.next=g,s|=f;if(i=i.next,i===null){if(i=o.shared.pending,i===null)break;f=i,i=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(d===null&&(u=p),o.baseState=u,o.firstBaseUpdate=c,o.lastBaseUpdate=d,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);rr|=s,e.lanes=s,e.memoizedState=p}}function Ec(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 el={},Dt=$n(el),Wo=$n(el),Vo=$n(el);function Qn(e){if(e===el)throw Error(M(174));return e}function pu(e,t){switch(ge(Vo,t),ge(Wo,e),ge(Dt,el),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Bi(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Bi(t,e)}we(Dt),ge(Dt,t)}function Br(){we(Dt),we(Wo),we(Vo)}function np(e){Qn(Vo.current);var t=Qn(Dt.current),n=Bi(t,e.type);t!==n&&(ge(Wo,e),ge(Dt,n))}function mu(e){Wo.current===e&&(we(Dt),we(Wo))}var ke=$n(0);function ls(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 di=[];function hu(){for(var e=0;e<di.length;e++)di[e]._workInProgressVersionPrimary=null;di.length=0}var Pl=hn.ReactCurrentDispatcher,fi=hn.ReactCurrentBatchConfig,nr=0,Ce=null,Oe=null,ze=null,ss=!1,To=!1,Ho=0,Vg=0;function Ue(){throw Error(M(321))}function gu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pt(e[n],t[n]))return!1;return!0}function yu(e,t,n,r,o,l){if(nr=l,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Pl.current=e===null||e.memoizedState===null?Gg:Yg,e=n(r,o),To){l=0;do{if(To=!1,Ho=0,25<=l)throw Error(M(301));l+=1,ze=Oe=null,t.updateQueue=null,Pl.current=Qg,e=n(r,o)}while(To)}if(Pl.current=is,t=Oe!==null&&Oe.next!==null,nr=0,ze=Oe=Ce=null,ss=!1,t)throw Error(M(300));return e}function vu(){var e=Ho!==0;return Ho=0,e}function Lt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ze===null?Ce.memoizedState=ze=e:ze=ze.next=e,ze}function St(){if(Oe===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=Oe.next;var t=ze===null?Ce.memoizedState:ze.next;if(t!==null)ze=t,Oe=e;else{if(e===null)throw Error(M(310));Oe=e,e={memoizedState:Oe.memoizedState,baseState:Oe.baseState,baseQueue:Oe.baseQueue,queue:Oe.queue,next:null},ze===null?Ce.memoizedState=ze=e:ze=ze.next=e}return ze}function Bo(e,t){return typeof t=="function"?t(e):t}function pi(e){var t=St(),n=t.queue;if(n===null)throw Error(M(311));n.lastRenderedReducer=e;var r=Oe,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 i=s=null,u=null,c=l;do{var d=c.lane;if((nr&d)===d)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 p={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(i=u=p,s=r):u=u.next=p,Ce.lanes|=d,rr|=d}c=c.next}while(c!==null&&c!==l);u===null?s=r:u.next=i,Pt(r,t.memoizedState)||(rt=!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,Ce.lanes|=l,rr|=l,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function mi(e){var t=St(),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);Pt(l,t.memoizedState)||(rt=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function rp(){}function op(e,t){var n=Ce,r=St(),o=t(),l=!Pt(r.memoizedState,o);if(l&&(r.memoizedState=o,rt=!0),r=r.queue,xu(ip.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||ze!==null&&ze.memoizedState.tag&1){if(n.flags|=2048,Uo(9,sp.bind(null,n,r,o,t),void 0,null),Ke===null)throw Error(M(349));nr&30||lp(n,t,o)}return o}function lp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ce.updateQueue,t===null?(t={lastEffect:null,stores:null},Ce.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function sp(e,t,n,r){t.value=n,t.getSnapshot=r,ap(t)&&up(e)}function ip(e,t,n){return n(function(){ap(t)&&up(e)})}function ap(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pt(e,n)}catch{return!0}}function up(e){var t=ln(e,1);t!==null&&Rt(t,e,1,-1)}function Tc(e){var t=Lt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:e},t.queue=e,e=e.dispatch=Ug.bind(null,Ce,e),[t.memoizedState,e]}function Uo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ce.updateQueue,t===null?(t={lastEffect:null,stores:null},Ce.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 cp(){return St().memoizedState}function _l(e,t,n,r){var o=Lt();Ce.flags|=e,o.memoizedState=Uo(1|t,n,void 0,r===void 0?null:r)}function _s(e,t,n,r){var o=St();r=r===void 0?null:r;var l=void 0;if(Oe!==null){var s=Oe.memoizedState;if(l=s.destroy,r!==null&&gu(r,s.deps)){o.memoizedState=Uo(t,n,l,r);return}}Ce.flags|=e,o.memoizedState=Uo(1|t,n,l,r)}function Nc(e,t){return _l(8390656,8,e,t)}function xu(e,t){return _s(2048,8,e,t)}function dp(e,t){return _s(4,2,e,t)}function fp(e,t){return _s(4,4,e,t)}function pp(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 mp(e,t,n){return n=n!=null?n.concat([e]):null,_s(4,4,pp.bind(null,t,e),n)}function wu(){}function hp(e,t){var n=St();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&gu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gp(e,t){var n=St();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&gu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function yp(e,t,n){return nr&21?(Pt(n,t)||(n=Sf(),Ce.lanes|=n,rr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,rt=!0),e.memoizedState=n)}function Hg(e,t){var n=de;de=n!==0&&4>n?n:4,e(!0);var r=fi.transition;fi.transition={};try{e(!1),t()}finally{de=n,fi.transition=r}}function vp(){return St().memoizedState}function Bg(e,t,n){var r=Pn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},xp(e))wp(t,n);else if(n=ep(e,t,n,r),n!==null){var o=Ze();Rt(n,e,r,o),bp(n,t,r)}}function Ug(e,t,n){var r=Pn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(xp(e))wp(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,i=l(s,n);if(o.hasEagerState=!0,o.eagerState=i,Pt(i,s)){var u=t.interleaved;u===null?(o.next=o,du(t)):(o.next=u.next,u.next=o),t.interleaved=o;return}}catch{}finally{}n=ep(e,t,o,r),n!==null&&(o=Ze(),Rt(n,e,r,o),bp(n,t,r))}}function xp(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function wp(e,t){To=ss=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function bp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Za(e,n)}}var is={readContext:bt,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},Gg={readContext:bt,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:bt,useEffect:Nc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_l(4194308,4,pp.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=Lt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Lt();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=Bg.bind(null,Ce,e),[r.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:Tc,useDebugValue:wu,useDeferredValue:function(e){return Lt().memoizedState=e},useTransition:function(){var e=Tc(!1),t=e[0];return e=Hg.bind(null,e[1]),Lt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ce,o=Lt();if(Se){if(n===void 0)throw Error(M(407));n=n()}else{if(n=t(),Ke===null)throw Error(M(349));nr&30||lp(r,t,n)}o.memoizedState=n;var l={value:n,getSnapshot:t};return o.queue=l,Nc(ip.bind(null,r,l,e),[e]),r.flags|=2048,Uo(9,sp.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=Lt(),t=Ke.identifierPrefix;if(Se){var n=Jt,r=Zt;n=(r&~(1<<32-Nt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ho++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Vg++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Yg={readContext:bt,useCallback:hp,useContext:bt,useEffect:xu,useImperativeHandle:mp,useInsertionEffect:dp,useLayoutEffect:fp,useMemo:gp,useReducer:pi,useRef:cp,useState:function(){return pi(Bo)},useDebugValue:wu,useDeferredValue:function(e){var t=St();return yp(t,Oe.memoizedState,e)},useTransition:function(){var e=pi(Bo)[0],t=St().memoizedState;return[e,t]},useMutableSource:rp,useSyncExternalStore:op,useId:vp,unstable_isNewReconciler:!1},Qg={readContext:bt,useCallback:hp,useContext:bt,useEffect:xu,useImperativeHandle:mp,useInsertionEffect:dp,useLayoutEffect:fp,useMemo:gp,useReducer:mi,useRef:cp,useState:function(){return mi(Bo)},useDebugValue:wu,useDeferredValue:function(e){var t=St();return Oe===null?t.memoizedState=e:yp(t,Oe.memoizedState,e)},useTransition:function(){var e=mi(Bo)[0],t=St().memoizedState;return[e,t]},useMutableSource:rp,useSyncExternalStore:op,useId:vp,unstable_isNewReconciler:!1};function jt(e,t){if(e&&e.defaultProps){t=je({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function fa(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:je({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Is={isMounted:function(e){return(e=e._reactInternals)?dr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ze(),o=Pn(e),l=en(r,o);l.payload=t,n!=null&&(l.callback=n),t=Nn(e,l,o),t!==null&&(Rt(t,e,o,r),Rl(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ze(),o=Pn(e),l=en(r,o);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=Nn(e,l,o),t!==null&&(Rt(t,e,o,r),Rl(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ze(),r=Pn(e),o=en(n,r);o.tag=2,t!=null&&(o.callback=t),t=Nn(e,o,r),t!==null&&(Rt(t,e,r,n),Rl(t,e,r))}};function Rc(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?!$o(n,r)||!$o(o,l):!0}function Sp(e,t,n){var r=!1,o=An,l=t.contextType;return typeof l=="object"&&l!==null?l=bt(l):(o=lt(t)?er:Qe.current,r=t.contextTypes,l=(r=r!=null)?Wr(e,o):An),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Is,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=l),t}function Pc(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&&Is.enqueueReplaceState(t,t.state,null)}function pa(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},fu(e);var l=t.contextType;typeof l=="object"&&l!==null?o.context=bt(l):(l=lt(t)?er:Qe.current,o.context=Wr(e,l)),o.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(fa(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&&Is.enqueueReplaceState(o,o.state,null),os(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ur(e,t){try{var n="",r=t;do n+=kh(r),r=r.return;while(r);var o=n}catch(l){o=`
|
|
39
39
|
Error generating stack: `+l.message+`
|
|
40
|
-
`+l.stack}return{value:e,source:t,stack:o,digest:null}}function hi(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ma(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Qg=typeof WeakMap=="function"?WeakMap:Map;function Sp(e,t,n){n=en(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){us||(us=!0,Ca=r),ma(e,t)},n}function kp(e,t,n){n=en(-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(){ma(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){ma(e,t),typeof r!="function"&&(Rn===null?Rn=new Set([this]):Rn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function _c(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qg;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=uy.bind(null,e,t,n),t.then(e,e))}function Ic(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 Lc(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=en(-1,1),t.tag=2,Nn(n,t,1))),n.lanes|=1),e)}var Xg=hn.ReactCurrentOwner,rt=!1;function Xe(e,t,n,r){t.child=e===null?Jf(t,null,n,r):Hr(t,e.child,n,r)}function Ac(e,t,n,r,o){n=n.render;var l=t.ref;return Mr(t,o),r=yu(e,t,n,r,l,o),n=vu(),e!==null&&!rt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,sn(e,t,o)):(Se&&n&&lu(t),t.flags|=1,Xe(e,t,r,o),t.child)}function Oc(e,t,n,r,o){if(e===null){var l=n.type;return typeof l=="function"&&!Nu(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,Cp(e,t,l,r,o)):(e=Ol(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:$o,n(s,r)&&e.ref===t.ref)return sn(e,t,o)}return t.flags|=1,e=_n(l,r),e.ref=t.ref,e.return=t,t.child=e}function Cp(e,t,n,r,o){if(e!==null){var l=e.memoizedProps;if($o(l,r)&&e.ref===t.ref)if(rt=!1,t.pendingProps=r=l,(e.lanes&o)!==0)e.flags&131072&&(rt=!0);else return t.lanes=e.lanes,sn(e,t,o)}return ha(e,t,n,r,o)}function jp(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},ge(Pr,it),it|=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,ge(Pr,it),it|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,ge(Pr,it),it|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,ge(Pr,it),it|=r;return Xe(e,t,o,n),t.child}function Ep(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ha(e,t,n,r,o){var l=lt(n)?er:Qe.current;return l=Wr(t,l),Mr(t,o),n=yu(e,t,n,r,l,o),r=vu(),e!==null&&!rt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,sn(e,t,o)):(Se&&r&&lu(t),t.flags|=1,Xe(e,t,n,o),t.child)}function Dc(e,t,n,r,o){if(lt(n)){var l=!0;ql(t)}else l=!1;if(Mr(t,o),t.stateNode===null)Il(e,t),bp(t,n,r),pa(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,i=t.memoizedProps;s.props=i;var a=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=bt(c):(c=lt(n)?er:Qe.current,c=Wr(t,c));var d=n.getDerivedStateFromProps,p=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";p||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==r||a!==c)&&Pc(t,s,r,c),vn=!1;var f=t.memoizedState;s.state=f,os(t,r,s,o),a=t.memoizedState,i!==r||f!==a||ot.current||vn?(typeof d=="function"&&(fa(t,n,d,r),a=t.memoizedState),(i=vn||Rc(t,n,i,r,f,a,c))?(p||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=a),s.props=r,s.state=a,s.context=c,r=i):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,ep(e,t),i=t.memoizedProps,c=t.type===t.elementType?i:jt(t.type,i),s.props=c,p=t.pendingProps,f=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=bt(a):(a=lt(n)?er:Qe.current,a=Wr(t,a));var g=n.getDerivedStateFromProps;(d=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==p||f!==a)&&Pc(t,s,r,a),vn=!1,f=t.memoizedState,s.state=f,os(t,r,s,o);var x=t.memoizedState;i!==p||f!==x||ot.current||vn?(typeof g=="function"&&(fa(t,n,g,r),x=t.memoizedState),(c=vn||Rc(t,n,c,r,f,x,a)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,x,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,x,a)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),s.props=r,s.state=x,s.context=a,r=c):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return ga(e,t,n,r,l,o)}function ga(e,t,n,r,o,l){Ep(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&bc(t,n,!1),sn(e,t,l);r=t.stateNode,Xg.current=t;var i=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Hr(t,e.child,null,l),t.child=Hr(t,null,i,l)):Xe(e,t,i,l),t.memoizedState=r.state,o&&bc(t,n,!0),t.child}function Tp(e){var t=e.stateNode;t.pendingContext?wc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&wc(e,t.context,!1),pu(e,t.containerInfo)}function Mc(e,t,n,r,o){return Vr(),iu(o),t.flags|=256,Xe(e,t,n,r),t.child}var ya={dehydrated:null,treeContext:null,retryLane:0};function va(e){return{baseLanes:e,cachePool:null,transitions:null}}function Np(e,t,n){var r=t.pendingProps,o=ke.current,l=!1,s=(t.flags&128)!==0,i;if((i=s)||(i=e!==null&&e.memoizedState===null?!1:(o&2)!==0),i?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ge(ke,o&1),e===null)return ca(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=Os(s,r,0,null),e=Jn(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=va(n),t.memoizedState=ya,e):bu(t,s));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return Zg(e,t,s,r,i,o,n);if(l){l=r.fallback,s=t.mode,o=e.child,i=o.sibling;var a={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=_n(o,a),r.subtreeFlags=o.subtreeFlags&14680064),i!==null?l=_n(i,l):(l=Jn(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?va(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},l.memoizedState=s,l.childLanes=e.childLanes&~n,t.memoizedState=ya,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 bu(e,t){return t=Os({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function vl(e,t,n,r){return r!==null&&iu(r),Hr(t,e.child,null,n),e=bu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zg(e,t,n,r,o,l,s){if(n)return t.flags&256?(t.flags&=-257,r=hi(Error(M(422))),vl(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,o=t.mode,r=Os({mode:"visible",children:r.children},o,0,null),l=Jn(l,o,s,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,t.mode&1&&Hr(t,e.child,null,s),t.child.memoizedState=va(s),t.memoizedState=ya,l);if(!(t.mode&1))return vl(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var i=r.dgst;return r=i,l=Error(M(419)),r=hi(l,r,void 0),vl(e,t,s,r)}if(i=(s&e.childLanes)!==0,rt||i){if(r=Ke,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,ln(e,o),Rt(r,e,o,-1))}return Tu(),r=hi(Error(M(421))),vl(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=cy.bind(null,e),o._reactRetry=t,null):(e=l.treeContext,ut=Tn(o.nextSibling),ct=t,Se=!0,Tt=null,e!==null&&(gt[yt++]=Zt,gt[yt++]=Jt,gt[yt++]=tr,Zt=e.id,Jt=e.overflow,tr=t),t=bu(t,r.children),t.flags|=4096,t)}function $c(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),da(e.return,t,n)}function gi(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 Rp(e,t,n){var r=t.pendingProps,o=r.revealOrder,l=r.tail;if(Xe(e,t,r.children,n),r=ke.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&&$c(e,n,t);else if(e.tag===19)$c(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(ge(ke,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&&ls(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),gi(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&&ls(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}gi(t,!0,n,null,l);break;case"together":gi(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Il(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function sn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),rr|=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 Jg(e,t,n){switch(t.tag){case 3:Tp(t),Vr();break;case 5:tp(t);break;case 1:lt(t.type)&&ql(t);break;case 4:pu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ge(ns,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ge(ke,ke.current&1),t.flags|=128,null):n&t.child.childLanes?Np(e,t,n):(ge(ke,ke.current&1),e=sn(e,t,n),e!==null?e.sibling:null);ge(ke,ke.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Rp(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ge(ke,ke.current),r)break;return null;case 22:case 23:return t.lanes=0,jp(e,t,n)}return sn(e,t,n)}var Pp,xa,_p,Ip;Pp=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}};xa=function(){};_p=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Qn(Dt.current);var l=null;switch(n){case"input":o=Fi(e,o),r=Fi(e,r),l=[];break;case"select":o=je({},o,{value:void 0}),r=je({},r,{value:void 0}),l=[];break;case"textarea":o=Hi(e,o),r=Hi(e,r),l=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Zl)}Ui(n,r);var s;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var i=o[c];for(s in i)i.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(_o.hasOwnProperty(c)?l||(l=[]):(l=l||[]).push(c,null));for(c in r){var a=r[c];if(i=o!=null?o[c]:void 0,r.hasOwnProperty(c)&&a!==i&&(a!=null||i!=null))if(c==="style")if(i){for(s in i)!i.hasOwnProperty(s)||a&&a.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in a)a.hasOwnProperty(s)&&i[s]!==a[s]&&(n||(n={}),n[s]=a[s])}else n||(l||(l=[]),l.push(c,n)),n=a;else c==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,i=i?i.__html:void 0,a!=null&&i!==a&&(l=l||[]).push(c,a)):c==="children"?typeof a!="string"&&typeof a!="number"||(l=l||[]).push(c,""+a):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(_o.hasOwnProperty(c)?(a!=null&&c==="onScroll"&&xe("scroll",e),l||i===a||(l=[])):(l=l||[]).push(c,a))}n&&(l=l||[]).push("style",n);var c=l;(t.updateQueue=c)&&(t.flags|=4)}};Ip=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 Ge(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 qg(e,t,n){var r=t.pendingProps;switch(su(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ge(t),null;case 1:return lt(t.type)&&Jl(),Ge(t),null;case 3:return r=t.stateNode,Br(),we(ot),we(Qe),hu(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(gl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Tt!==null&&(Ta(Tt),Tt=null))),xa(e,t),Ge(t),null;case 5:mu(t);var o=Qn(Vo.current);if(n=t.type,e!==null&&t.stateNode!=null)_p(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 Ge(t),null}if(e=Qn(Dt.current),gl(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[At]=t,r[Fo]=l,e=(t.mode&1)!==0,n){case"dialog":xe("cancel",r),xe("close",r);break;case"iframe":case"object":case"embed":xe("load",r);break;case"video":case"audio":for(o=0;o<wo.length;o++)xe(wo[o],r);break;case"source":xe("error",r);break;case"img":case"image":case"link":xe("error",r),xe("load",r);break;case"details":xe("toggle",r);break;case"input":Gu(r,l),xe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},xe("invalid",r);break;case"textarea":Qu(r,l),xe("invalid",r)}Ui(n,l),o=null;for(var s in l)if(l.hasOwnProperty(s)){var i=l[s];s==="children"?typeof i=="string"?r.textContent!==i&&(l.suppressHydrationWarning!==!0&&hl(r.textContent,i,e),o=["children",i]):typeof i=="number"&&r.textContent!==""+i&&(l.suppressHydrationWarning!==!0&&hl(r.textContent,i,e),o=["children",""+i]):_o.hasOwnProperty(s)&&i!=null&&s==="onScroll"&&xe("scroll",r)}switch(n){case"input":il(r),Yu(r,l,!0);break;case"textarea":il(r),Xu(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=Zl)}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=lf(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[At]=t,e[Fo]=r,Pp(e,t,!1,!1),t.stateNode=e;e:{switch(s=Gi(n,r),n){case"dialog":xe("cancel",e),xe("close",e),o=r;break;case"iframe":case"object":case"embed":xe("load",e),o=r;break;case"video":case"audio":for(o=0;o<wo.length;o++)xe(wo[o],e);o=r;break;case"source":xe("error",e),o=r;break;case"img":case"image":case"link":xe("error",e),xe("load",e),o=r;break;case"details":xe("toggle",e),o=r;break;case"input":Gu(e,r),o=Fi(e,r),xe("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=je({},r,{value:void 0}),xe("invalid",e);break;case"textarea":Qu(e,r),o=Hi(e,r),xe("invalid",e);break;default:o=r}Ui(n,o),i=o;for(l in i)if(i.hasOwnProperty(l)){var a=i[l];l==="style"?uf(e,a):l==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&sf(e,a)):l==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Io(e,a):typeof a=="number"&&Io(e,""+a):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(_o.hasOwnProperty(l)?a!=null&&l==="onScroll"&&xe("scroll",e):a!=null&&Ba(e,l,a,s))}switch(n){case"input":il(e),Yu(e,r,!1);break;case"textarea":il(e),Xu(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ln(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?Lr(e,!!r.multiple,l,!1):r.defaultValue!=null&&Lr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Zl)}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 Ge(t),null;case 6:if(e&&t.stateNode!=null)Ip(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(M(166));if(n=Qn(Vo.current),Qn(Dt.current),gl(t)){if(r=t.stateNode,n=t.memoizedProps,r[At]=t,(l=r.nodeValue!==n)&&(e=ct,e!==null))switch(e.tag){case 3:hl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&hl(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[At]=t,t.stateNode=r}return Ge(t),null;case 13:if(we(ke),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Se&&ut!==null&&t.mode&1&&!(t.flags&128))Xf(),Vr(),t.flags|=98560,l=!1;else if(l=gl(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[At]=t}else Vr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ge(t),l=!1}else Tt!==null&&(Ta(Tt),Tt=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||ke.current&1?De===0&&(De=3):Tu())),t.updateQueue!==null&&(t.flags|=4),Ge(t),null);case 4:return Br(),xa(e,t),e===null&&zo(t.stateNode.containerInfo),Ge(t),null;case 10:return cu(t.type._context),Ge(t),null;case 17:return lt(t.type)&&Jl(),Ge(t),null;case 19:if(we(ke),l=t.memoizedState,l===null)return Ge(t),null;if(r=(t.flags&128)!==0,s=l.rendering,s===null)if(r)mo(l,!1);else{if(De!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=ls(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 ge(ke,ke.current&1|2),t.child}e=e.sibling}l.tail!==null&&Re()>Gr&&(t.flags|=128,r=!0,mo(l,!1),t.lanes=4194304)}else{if(!r)if(e=ls(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 Ge(t),null}else 2*Re()-l.renderingStartTime>Gr&&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=Re(),t.sibling=null,n=ke.current,ge(ke,r?n&1|2:n&1),t):(Ge(t),null);case 22:case 23:return Eu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?it&1073741824&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),null;case 24:return null;case 25:return null}throw Error(M(156,t.tag))}function ey(e,t){switch(su(t),t.tag){case 1:return lt(t.type)&&Jl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Br(),we(ot),we(Qe),hu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return mu(t),null;case 13:if(we(ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));Vr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return we(ke),null;case 4:return Br(),null;case 10:return cu(t.type._context),null;case 22:case 23:return Eu(),null;case 24:return null;default:return null}}var xl=!1,Ye=!1,ty=typeof WeakSet=="function"?WeakSet:Set,B=null;function Rr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Te(e,t,r)}else n.current=null}function wa(e,t,n){try{n()}catch(r){Te(e,t,r)}}var zc=!1;function ny(e,t){if(ra=Yl,e=Mf(),ou(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,i=-1,a=-1,c=0,d=0,p=e,f=null;t:for(;;){for(var g;p!==n||o!==0&&p.nodeType!==3||(i=s+o),p!==l||r!==0&&p.nodeType!==3||(a=s+r),p.nodeType===3&&(s+=p.nodeValue.length),(g=p.firstChild)!==null;)f=p,p=g;for(;;){if(p===e)break t;if(f===n&&++c===o&&(i=s),f===l&&++d===r&&(a=s),(g=p.nextSibling)!==null)break;p=f,f=p.parentNode}p=g}n=i===-1||a===-1?null:{start:i,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(oa={focusedElem:e,selectionRange:n},Yl=!1,B=t;B!==null;)if(t=B,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,B=e;else for(;B!==null;){t=B;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var b=x.memoizedProps,S=x.memoizedState,m=t.stateNode,h=m.getSnapshotBeforeUpdate(t.elementType===t.type?b:jt(t.type,b),S);m.__reactInternalSnapshotBeforeUpdate=h}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(v){Te(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,B=e;break}B=t.return}return x=zc,zc=!1,x}function No(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&&wa(t,n,l)}o=o.next}while(o!==r)}}function Ls(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 ba(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 Lp(e){var t=e.alternate;t!==null&&(e.alternate=null,Lp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[At],delete t[Fo],delete t[ia],delete t[$g],delete t[zg])),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 Ap(e){return e.tag===5||e.tag===3||e.tag===4}function Kc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ap(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 Sa(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=Zl));else if(r!==4&&(e=e.child,e!==null))for(Sa(e,t,n),e=e.sibling;e!==null;)Sa(e,t,n),e=e.sibling}function ka(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(ka(e,t,n),e=e.sibling;e!==null;)ka(e,t,n),e=e.sibling}var We=null,Et=!1;function gn(e,t,n){for(n=n.child;n!==null;)Op(e,t,n),n=n.sibling}function Op(e,t,n){if(Ot&&typeof Ot.onCommitFiberUnmount=="function")try{Ot.onCommitFiberUnmount(js,n)}catch{}switch(n.tag){case 5:Ye||Rr(n,t);case 6:var r=We,o=Et;We=null,gn(e,t,n),We=r,Et=o,We!==null&&(Et?(e=We,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):We.removeChild(n.stateNode));break;case 18:We!==null&&(Et?(e=We,n=n.stateNode,e.nodeType===8?ui(e.parentNode,n):e.nodeType===1&&ui(e,n),Do(e)):ui(We,n.stateNode));break;case 4:r=We,o=Et,We=n.stateNode.containerInfo,Et=!0,gn(e,t,n),We=r,Et=o;break;case 0:case 11:case 14:case 15:if(!Ye&&(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)&&wa(n,t,s),o=o.next}while(o!==r)}gn(e,t,n);break;case 1:if(!Ye&&(Rr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(i){Te(n,t,i)}gn(e,t,n);break;case 21:gn(e,t,n);break;case 22:n.mode&1?(Ye=(r=Ye)||n.memoizedState!==null,gn(e,t,n),Ye=r):gn(e,t,n);break;default:gn(e,t,n)}}function Fc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ty),t.forEach(function(r){var o=dy.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Ct(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,i=s;e:for(;i!==null;){switch(i.tag){case 5:We=i.stateNode,Et=!1;break e;case 3:We=i.stateNode.containerInfo,Et=!0;break e;case 4:We=i.stateNode.containerInfo,Et=!0;break e}i=i.return}if(We===null)throw Error(M(160));Op(l,s,o),We=null,Et=!1;var a=o.alternate;a!==null&&(a.return=null),o.return=null}catch(c){Te(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Dp(t,e),t=t.sibling}function Dp(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ct(t,e),It(e),r&4){try{No(3,e,e.return),Ls(3,e)}catch(b){Te(e,e.return,b)}try{No(5,e,e.return)}catch(b){Te(e,e.return,b)}}break;case 1:Ct(t,e),It(e),r&512&&n!==null&&Rr(n,n.return);break;case 5:if(Ct(t,e),It(e),r&512&&n!==null&&Rr(n,n.return),e.flags&32){var o=e.stateNode;try{Io(o,"")}catch(b){Te(e,e.return,b)}}if(r&4&&(o=e.stateNode,o!=null)){var l=e.memoizedProps,s=n!==null?n.memoizedProps:l,i=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{i==="input"&&l.type==="radio"&&l.name!=null&&rf(o,l),Gi(i,s);var c=Gi(i,l);for(s=0;s<a.length;s+=2){var d=a[s],p=a[s+1];d==="style"?uf(o,p):d==="dangerouslySetInnerHTML"?sf(o,p):d==="children"?Io(o,p):Ba(o,d,p,c)}switch(i){case"input":Wi(o,l);break;case"textarea":of(o,l);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!l.multiple;var g=l.value;g!=null?Lr(o,!!l.multiple,g,!1):f!==!!l.multiple&&(l.defaultValue!=null?Lr(o,!!l.multiple,l.defaultValue,!0):Lr(o,!!l.multiple,l.multiple?[]:"",!1))}o[Fo]=l}catch(b){Te(e,e.return,b)}}break;case 6:if(Ct(t,e),It(e),r&4){if(e.stateNode===null)throw Error(M(162));o=e.stateNode,l=e.memoizedProps;try{o.nodeValue=l}catch(b){Te(e,e.return,b)}}break;case 3:if(Ct(t,e),It(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Do(t.containerInfo)}catch(b){Te(e,e.return,b)}break;case 4:Ct(t,e),It(e);break;case 13:Ct(t,e),It(e),o=e.child,o.flags&8192&&(l=o.memoizedState!==null,o.stateNode.isHidden=l,!l||o.alternate!==null&&o.alternate.memoizedState!==null||(Cu=Re())),r&4&&Fc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Ye=(c=Ye)||d,Ct(t,e),Ye=c):Ct(t,e),It(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(B=e,d=e.child;d!==null;){for(p=B=d;B!==null;){switch(f=B,g=f.child,f.tag){case 0:case 11:case 14:case 15:No(4,f,f.return);break;case 1:Rr(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(b){Te(r,n,b)}}break;case 5:Rr(f,f.return);break;case 22:if(f.memoizedState!==null){Vc(p);continue}}g!==null?(g.return=f,B=g):Vc(p)}d=d.sibling}e:for(d=null,p=e;;){if(p.tag===5){if(d===null){d=p;try{o=p.stateNode,c?(l=o.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(i=p.stateNode,a=p.memoizedProps.style,s=a!=null&&a.hasOwnProperty("display")?a.display:null,i.style.display=af("display",s))}catch(b){Te(e,e.return,b)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=c?"":p.memoizedProps}catch(b){Te(e,e.return,b)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:Ct(t,e),It(e),r&4&&Fc(e);break;case 21:break;default:Ct(t,e),It(e)}}function It(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Ap(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&&(Io(o,""),r.flags&=-33);var l=Kc(e);ka(e,l,o);break;case 3:case 4:var s=r.stateNode.containerInfo,i=Kc(e);Sa(e,i,s);break;default:throw Error(M(161))}}catch(a){Te(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ry(e,t,n){B=e,Mp(e)}function Mp(e,t,n){for(var r=(e.mode&1)!==0;B!==null;){var o=B,l=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||xl;if(!s){var i=o.alternate,a=i!==null&&i.memoizedState!==null||Ye;i=xl;var c=Ye;if(xl=s,(Ye=a)&&!c)for(B=o;B!==null;)s=B,a=s.child,s.tag===22&&s.memoizedState!==null?Hc(o):a!==null?(a.return=s,B=a):Hc(o);for(;l!==null;)B=l,Mp(l),l=l.sibling;B=o,xl=i,Ye=c}Wc(e)}else o.subtreeFlags&8772&&l!==null?(l.return=o,B=l):Wc(e)}}function Wc(e){for(;B!==null;){var t=B;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ye||Ls(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ye)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:jt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&Ec(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}Ec(t,s,n)}break;case 5:var i=t.stateNode;if(n===null&&t.flags&4){n=i;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.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 d=c.memoizedState;if(d!==null){var p=d.dehydrated;p!==null&&Do(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(M(163))}Ye||t.flags&512&&ba(t)}catch(f){Te(t,t.return,f)}}if(t===e){B=null;break}if(n=t.sibling,n!==null){n.return=t.return,B=n;break}B=t.return}}function Vc(e){for(;B!==null;){var t=B;if(t===e){B=null;break}var n=t.sibling;if(n!==null){n.return=t.return,B=n;break}B=t.return}}function Hc(e){for(;B!==null;){var t=B;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ls(4,t)}catch(a){Te(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(a){Te(t,o,a)}}var l=t.return;try{ba(t)}catch(a){Te(t,l,a)}break;case 5:var s=t.return;try{ba(t)}catch(a){Te(t,s,a)}}}catch(a){Te(t,t.return,a)}if(t===e){B=null;break}var i=t.sibling;if(i!==null){i.return=t.return,B=i;break}B=t.return}}var oy=Math.ceil,as=hn.ReactCurrentDispatcher,Su=hn.ReactCurrentOwner,xt=hn.ReactCurrentBatchConfig,ue=0,Ke=null,Le=null,Ve=0,it=0,Pr=$n(0),De=0,Go=null,rr=0,As=0,ku=0,Ro=null,nt=null,Cu=0,Gr=1/0,Ut=null,us=!1,Ca=null,Rn=null,wl=!1,kn=null,cs=0,Po=0,ja=null,Ll=-1,Al=0;function Ze(){return ue&6?Re():Ll!==-1?Ll:Ll=Re()}function Pn(e){return e.mode&1?ue&2&&Ve!==0?Ve&-Ve:Fg.transition!==null?(Al===0&&(Al=bf()),Al):(e=de,e!==0||(e=window.event,e=e===void 0?16:Nf(e.type)),e):1}function Rt(e,t,n,r){if(50<Po)throw Po=0,ja=null,Error(M(185));Zo(e,n,r),(!(ue&2)||e!==Ke)&&(e===Ke&&(!(ue&2)&&(As|=n),De===4&&bn(e,Ve)),st(e,r),n===1&&ue===0&&!(t.mode&1)&&(Gr=Re()+500,Ps&&zn()))}function st(e,t){var n=e.callbackNode;Fh(e,t);var r=Gl(e,e===Ke?Ve:0);if(r===0)n!==null&&qu(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&qu(n),t===1)e.tag===0?Kg(Bc.bind(null,e)):Gf(Bc.bind(null,e)),Dg(function(){!(ue&6)&&zn()}),n=null;else{switch(Sf(r)){case 1:n=Xa;break;case 4:n=xf;break;case 16:n=Ul;break;case 536870912:n=wf;break;default:n=Ul}n=Bp(n,$p.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function $p(e,t){if(Ll=-1,Al=0,ue&6)throw Error(M(327));var n=e.callbackNode;if($r()&&e.callbackNode!==n)return null;var r=Gl(e,e===Ke?Ve:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ds(e,r);else{t=r;var o=ue;ue|=2;var l=Kp();(Ke!==e||Ve!==t)&&(Ut=null,Gr=Re()+500,Zn(e,t));do try{iy();break}catch(i){zp(e,i)}while(!0);uu(),as.current=l,ue=o,Le!==null?t=0:(Ke=null,Ve=0,t=De)}if(t!==0){if(t===2&&(o=Ji(e),o!==0&&(r=o,t=Ea(e,o))),t===1)throw n=Go,Zn(e,0),bn(e,r),st(e,Re()),n;if(t===6)bn(e,r);else{if(o=e.current.alternate,!(r&30)&&!ly(o)&&(t=ds(e,r),t===2&&(l=Ji(e),l!==0&&(r=l,t=Ea(e,l))),t===1))throw n=Go,Zn(e,0),bn(e,r),st(e,Re()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(M(345));case 2:Un(e,nt,Ut);break;case 3:if(bn(e,r),(r&130023424)===r&&(t=Cu+500-Re(),10<t)){if(Gl(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ze(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=sa(Un.bind(null,e,nt,Ut),t);break}Un(e,nt,Ut);break;case 4:if(bn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Nt(r);l=1<<s,s=t[s],s>o&&(o=s),r&=~l}if(r=o,r=Re()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*oy(r/1960))-r,10<r){e.timeoutHandle=sa(Un.bind(null,e,nt,Ut),r);break}Un(e,nt,Ut);break;case 5:Un(e,nt,Ut);break;default:throw Error(M(329))}}}return st(e,Re()),e.callbackNode===n?$p.bind(null,e):null}function Ea(e,t){var n=Ro;return e.current.memoizedState.isDehydrated&&(Zn(e,t).flags|=256),e=ds(e,t),e!==2&&(t=nt,nt=n,t!==null&&Ta(t)),e}function Ta(e){nt===null?nt=e:nt.push.apply(nt,e)}function ly(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(!Pt(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 bn(e,t){for(t&=~ku,t&=~As,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Nt(t),r=1<<n;e[n]=-1,t&=~r}}function Bc(e){if(ue&6)throw Error(M(327));$r();var t=Gl(e,0);if(!(t&1))return st(e,Re()),null;var n=ds(e,t);if(e.tag!==0&&n===2){var r=Ji(e);r!==0&&(t=r,n=Ea(e,r))}if(n===1)throw n=Go,Zn(e,0),bn(e,t),st(e,Re()),n;if(n===6)throw Error(M(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Un(e,nt,Ut),st(e,Re()),null}function ju(e,t){var n=ue;ue|=1;try{return e(t)}finally{ue=n,ue===0&&(Gr=Re()+500,Ps&&zn())}}function or(e){kn!==null&&kn.tag===0&&!(ue&6)&&$r();var t=ue;ue|=1;var n=xt.transition,r=de;try{if(xt.transition=null,de=1,e)return e()}finally{de=r,xt.transition=n,ue=t,!(ue&6)&&zn()}}function Eu(){it=Pr.current,we(Pr)}function Zn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Og(n)),Le!==null)for(n=Le.return;n!==null;){var r=n;switch(su(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Jl();break;case 3:Br(),we(ot),we(Qe),hu();break;case 5:mu(r);break;case 4:Br();break;case 13:we(ke);break;case 19:we(ke);break;case 10:cu(r.type._context);break;case 22:case 23:Eu()}n=n.return}if(Ke=e,Le=e=_n(e.current,null),Ve=it=t,De=0,Go=null,ku=As=rr=0,nt=Ro=null,Yn!==null){for(t=0;t<Yn.length;t++)if(n=Yn[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}Yn=null}return e}function zp(e,t){do{var n=Le;try{if(uu(),Pl.current=is,ss){for(var r=Ce.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ss=!1}if(nr=0,ze=Oe=Ce=null,To=!1,Ho=0,Su.current=null,n===null||n.return===null){De=1,Go=t,Le=null;break}e:{var l=e,s=n.return,i=n,a=t;if(t=Ve,i.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var c=a,d=i,p=d.tag;if(!(d.mode&1)&&(p===0||p===11||p===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var g=Ic(s);if(g!==null){g.flags&=-257,Lc(g,s,i,l,t),g.mode&1&&_c(l,c,t),t=g,a=c;var x=t.updateQueue;if(x===null){var b=new Set;b.add(a),t.updateQueue=b}else x.add(a);break e}else{if(!(t&1)){_c(l,c,t),Tu();break e}a=Error(M(426))}}else if(Se&&i.mode&1){var S=Ic(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),Lc(S,s,i,l,t),iu(Ur(a,i));break e}}l=a=Ur(a,i),De!==4&&(De=2),Ro===null?Ro=[l]:Ro.push(l),l=s;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var m=Sp(l,a,t);jc(l,m);break e;case 1:i=a;var h=l.type,y=l.stateNode;if(!(l.flags&128)&&(typeof h.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Rn===null||!Rn.has(y)))){l.flags|=65536,t&=-t,l.lanes|=t;var v=kp(l,i,t);jc(l,v);break e}}l=l.return}while(l!==null)}Wp(n)}catch(C){t=C,Le===n&&n!==null&&(Le=n=n.return);continue}break}while(!0)}function Kp(){var e=as.current;return as.current=is,e===null?is:e}function Tu(){(De===0||De===3||De===2)&&(De=4),Ke===null||!(rr&268435455)&&!(As&268435455)||bn(Ke,Ve)}function ds(e,t){var n=ue;ue|=2;var r=Kp();(Ke!==e||Ve!==t)&&(Ut=null,Zn(e,t));do try{sy();break}catch(o){zp(e,o)}while(!0);if(uu(),ue=n,as.current=r,Le!==null)throw Error(M(261));return Ke=null,Ve=0,De}function sy(){for(;Le!==null;)Fp(Le)}function iy(){for(;Le!==null&&!Ih();)Fp(Le)}function Fp(e){var t=Hp(e.alternate,e,it);e.memoizedProps=e.pendingProps,t===null?Wp(e):Le=t,Su.current=null}function Wp(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=ey(n,t),n!==null){n.flags&=32767,Le=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{De=6,Le=null;return}}else if(n=qg(n,t,it),n!==null){Le=n;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);De===0&&(De=5)}function Un(e,t,n){var r=de,o=xt.transition;try{xt.transition=null,de=1,ay(e,t,n,r)}finally{xt.transition=o,de=r}return null}function ay(e,t,n,r){do $r();while(kn!==null);if(ue&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(Wh(e,l),e===Ke&&(Le=Ke=null,Ve=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||wl||(wl=!0,Bp(Ul,function(){return $r(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=xt.transition,xt.transition=null;var s=de;de=1;var i=ue;ue|=4,Su.current=null,ny(e,n),Dp(n,e),Ng(oa),Yl=!!ra,oa=ra=null,e.current=n,ry(n),Lh(),ue=i,de=s,xt.transition=l}else e.current=n;if(wl&&(wl=!1,kn=e,cs=o),l=e.pendingLanes,l===0&&(Rn=null),Dh(n.stateNode),st(e,Re()),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(us)throw us=!1,e=Ca,Ca=null,e;return cs&1&&e.tag!==0&&$r(),l=e.pendingLanes,l&1?e===ja?Po++:(Po=0,ja=e):Po=0,zn(),null}function $r(){if(kn!==null){var e=Sf(cs),t=xt.transition,n=de;try{if(xt.transition=null,de=16>e?16:e,kn===null)var r=!1;else{if(e=kn,kn=null,cs=0,ue&6)throw Error(M(331));var o=ue;for(ue|=4,B=e.current;B!==null;){var l=B,s=l.child;if(B.flags&16){var i=l.deletions;if(i!==null){for(var a=0;a<i.length;a++){var c=i[a];for(B=c;B!==null;){var d=B;switch(d.tag){case 0:case 11:case 15:No(8,d,l)}var p=d.child;if(p!==null)p.return=d,B=p;else for(;B!==null;){d=B;var f=d.sibling,g=d.return;if(Lp(d),d===c){B=null;break}if(f!==null){f.return=g,B=f;break}B=g}}}var x=l.alternate;if(x!==null){var b=x.child;if(b!==null){x.child=null;do{var S=b.sibling;b.sibling=null,b=S}while(b!==null)}}B=l}}if(l.subtreeFlags&2064&&s!==null)s.return=l,B=s;else e:for(;B!==null;){if(l=B,l.flags&2048)switch(l.tag){case 0:case 11:case 15:No(9,l,l.return)}var m=l.sibling;if(m!==null){m.return=l.return,B=m;break e}B=l.return}}var h=e.current;for(B=h;B!==null;){s=B;var y=s.child;if(s.subtreeFlags&2064&&y!==null)y.return=s,B=y;else e:for(s=h;B!==null;){if(i=B,i.flags&2048)try{switch(i.tag){case 0:case 11:case 15:Ls(9,i)}}catch(C){Te(i,i.return,C)}if(i===s){B=null;break e}var v=i.sibling;if(v!==null){v.return=i.return,B=v;break e}B=i.return}}if(ue=o,zn(),Ot&&typeof Ot.onPostCommitFiberRoot=="function")try{Ot.onPostCommitFiberRoot(js,e)}catch{}r=!0}return r}finally{de=n,xt.transition=t}}return!1}function Uc(e,t,n){t=Ur(n,t),t=Sp(e,t,1),e=Nn(e,t,1),t=Ze(),e!==null&&(Zo(e,1,t),st(e,t))}function Te(e,t,n){if(e.tag===3)Uc(e,e,n);else for(;t!==null;){if(t.tag===3){Uc(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Rn===null||!Rn.has(r))){e=Ur(n,e),e=kp(t,e,1),t=Nn(t,e,1),e=Ze(),t!==null&&(Zo(t,1,e),st(t,e));break}}t=t.return}}function uy(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ze(),e.pingedLanes|=e.suspendedLanes&n,Ke===e&&(Ve&n)===n&&(De===4||De===3&&(Ve&130023424)===Ve&&500>Re()-Cu?Zn(e,0):ku|=n),st(e,t)}function Vp(e,t){t===0&&(e.mode&1?(t=cl,cl<<=1,!(cl&130023424)&&(cl=4194304)):t=1);var n=Ze();e=ln(e,t),e!==null&&(Zo(e,t,n),st(e,n))}function cy(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Vp(e,n)}function dy(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),Vp(e,n)}var Hp;Hp=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)rt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return rt=!1,Jg(e,t,n);rt=!!(e.flags&131072)}else rt=!1,Se&&t.flags&1048576&&Yf(t,ts,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Il(e,t),e=t.pendingProps;var o=Wr(t,Qe.current);Mr(t,n),o=yu(null,t,r,e,o,n);var l=vu();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,lt(r)?(l=!0,ql(t)):l=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,fu(t),o.updater=Is,t.stateNode=o,o._reactInternals=t,pa(t,r,e,n),t=ga(null,t,r,!0,l,n)):(t.tag=0,Se&&l&&lu(t),Xe(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Il(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=py(r),e=jt(r,e),o){case 0:t=ha(null,t,r,e,n);break e;case 1:t=Dc(null,t,r,e,n);break e;case 11:t=Ac(null,t,r,e,n);break e;case 14:t=Oc(null,t,r,jt(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:jt(r,o),ha(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),Dc(e,t,r,o,n);case 3:e:{if(Tp(t),e===null)throw Error(M(387));r=t.pendingProps,l=t.memoizedState,o=l.element,ep(e,t),os(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=Ur(Error(M(423)),t),t=Mc(e,t,r,n,o);break e}else if(r!==o){o=Ur(Error(M(424)),t),t=Mc(e,t,r,n,o);break e}else for(ut=Tn(t.stateNode.containerInfo.firstChild),ct=t,Se=!0,Tt=null,n=Jf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Vr(),r===o){t=sn(e,t,n);break e}Xe(e,t,r,n)}t=t.child}return t;case 5:return tp(t),e===null&&ca(t),r=t.type,o=t.pendingProps,l=e!==null?e.memoizedProps:null,s=o.children,la(r,o)?s=null:l!==null&&la(r,l)&&(t.flags|=32),Ep(e,t),Xe(e,t,s,n),t.child;case 6:return e===null&&ca(t),null;case 13:return Np(e,t,n);case 4:return pu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Hr(t,null,r,n):Xe(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),Ac(e,t,r,o,n);case 7:return Xe(e,t,t.pendingProps,n),t.child;case 8:return Xe(e,t,t.pendingProps.children,n),t.child;case 12:return Xe(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,ge(ns,r._currentValue),r._currentValue=s,l!==null)if(Pt(l.value,s)){if(l.children===o.children&&!ot.current){t=sn(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var i=l.dependencies;if(i!==null){s=l.child;for(var a=i.firstContext;a!==null;){if(a.context===r){if(l.tag===1){a=en(-1,n&-n),a.tag=2;var c=l.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?a.next=a:(a.next=d.next,d.next=a),c.pending=a}}l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),da(l.return,n,t),i.lanes|=n;break}a=a.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,i=s.alternate,i!==null&&(i.lanes|=n),da(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}Xe(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Mr(t,n),o=bt(o),r=r(o),t.flags|=1,Xe(e,t,r,n),t.child;case 14:return r=t.type,o=jt(r,t.pendingProps),o=jt(r.type,o),Oc(e,t,r,o,n);case 15:return Cp(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),Il(e,t),t.tag=1,lt(r)?(e=!0,ql(t)):e=!1,Mr(t,n),bp(t,r,o),pa(t,r,o,n),ga(null,t,r,!0,e,n);case 19:return Rp(e,t,n);case 22:return jp(e,t,n)}throw Error(M(156,t.tag))};function Bp(e,t){return vf(e,t)}function fy(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 vt(e,t,n,r){return new fy(e,t,n,r)}function Nu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function py(e){if(typeof e=="function")return Nu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ga)return 11;if(e===Ya)return 14}return 2}function _n(e,t){var n=e.alternate;return n===null?(n=vt(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 Ol(e,t,n,r,o,l){var s=2;if(r=e,typeof e=="function")Nu(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case wr:return Jn(n.children,o,l,t);case Ua:s=8,o|=8;break;case Mi:return e=vt(12,n,t,o|2),e.elementType=Mi,e.lanes=l,e;case $i:return e=vt(13,n,t,o),e.elementType=$i,e.lanes=l,e;case zi:return e=vt(19,n,t,o),e.elementType=zi,e.lanes=l,e;case ef:return Os(n,o,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Jd:s=10;break e;case qd:s=9;break e;case Ga:s=11;break e;case Ya:s=14;break e;case yn:s=16,r=null;break e}throw Error(M(130,e==null?e:typeof e,""))}return t=vt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=l,t}function Jn(e,t,n,r){return e=vt(7,e,r,t),e.lanes=n,e}function Os(e,t,n,r){return e=vt(22,e,r,t),e.elementType=ef,e.lanes=n,e.stateNode={isHidden:!1},e}function yi(e,t,n){return e=vt(6,e,null,t),e.lanes=n,e}function vi(e,t,n){return t=vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function my(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=Js(0),this.expirationTimes=Js(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Js(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Ru(e,t,n,r,o,l,s,i,a){return e=new my(e,t,n,i,a),t===1?(t=1,l===!0&&(t|=8)):t=0,l=vt(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},fu(l),e}function hy(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:xr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Up(e){if(!e)return An;e=e._reactInternals;e:{if(dr(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(lt(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(lt(n))return Uf(e,n,t)}return t}function Gp(e,t,n,r,o,l,s,i,a){return e=Ru(n,r,!0,e,o,l,s,i,a),e.context=Up(null),n=e.current,r=Ze(),o=Pn(n),l=en(r,o),l.callback=t??null,Nn(n,l,o),e.current.lanes=o,Zo(e,o,r),st(e,r),e}function Ds(e,t,n,r){var o=t.current,l=Ze(),s=Pn(o);return n=Up(n),t.context===null?t.context=n:t.pendingContext=n,t=en(l,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Nn(o,t,s),e!==null&&(Rt(e,o,s,l),Rl(e,o,s)),s}function fs(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 Gc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Pu(e,t){Gc(e,t),(e=e.alternate)&&Gc(e,t)}function gy(){return null}var Yp=typeof reportError=="function"?reportError:function(e){console.error(e)};function _u(e){this._internalRoot=e}Ms.prototype.render=_u.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(M(409));Ds(e,t,null,null)};Ms.prototype.unmount=_u.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;or(function(){Ds(null,e,null,null)}),t[on]=null}};function Ms(e){this._internalRoot=e}Ms.prototype.unstable_scheduleHydration=function(e){if(e){var t=jf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<wn.length&&t!==0&&t<wn[n].priority;n++);wn.splice(n,0,e),n===0&&Tf(e)}};function Iu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function $s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Yc(){}function yy(e,t,n,r,o){if(o){if(typeof r=="function"){var l=r;r=function(){var c=fs(s);l.call(c)}}var s=Gp(t,r,e,0,null,!1,!1,"",Yc);return e._reactRootContainer=s,e[on]=s.current,zo(e.nodeType===8?e.parentNode:e),or(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var i=r;r=function(){var c=fs(a);i.call(c)}}var a=Ru(e,0,!1,null,null,!1,!1,"",Yc);return e._reactRootContainer=a,e[on]=a.current,zo(e.nodeType===8?e.parentNode:e),or(function(){Ds(t,a,n,r)}),a}function zs(e,t,n,r,o){var l=n._reactRootContainer;if(l){var s=l;if(typeof o=="function"){var i=o;o=function(){var a=fs(s);i.call(a)}}Ds(t,s,e,o)}else s=yy(n,t,e,o,r);return fs(s)}kf=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=xo(t.pendingLanes);n!==0&&(Za(t,n|1),st(t,Re()),!(ue&6)&&(Gr=Re()+500,zn()))}break;case 13:or(function(){var r=ln(e,1);if(r!==null){var o=Ze();Rt(r,e,1,o)}}),Pu(e,1)}};Ja=function(e){if(e.tag===13){var t=ln(e,134217728);if(t!==null){var n=Ze();Rt(t,e,134217728,n)}Pu(e,134217728)}};Cf=function(e){if(e.tag===13){var t=Pn(e),n=ln(e,t);if(n!==null){var r=Ze();Rt(n,e,t,r)}Pu(e,t)}};jf=function(){return de};Ef=function(e,t){var n=de;try{return de=e,t()}finally{de=n}};Qi=function(e,t,n){switch(t){case"input":if(Wi(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=Rs(r);if(!o)throw Error(M(90));nf(r),Wi(r,o)}}}break;case"textarea":of(e,n);break;case"select":t=n.value,t!=null&&Lr(e,!!n.multiple,t,!1)}};ff=ju;pf=or;var vy={usingClientEntryPoint:!1,Events:[qo,Cr,Rs,cf,df,ju]},ho={findFiberByHostInstance:Gn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},xy={bundleType:ho.bundleType,version:ho.version,rendererPackageName:ho.rendererPackageName,rendererConfig:ho.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:hn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=gf(e),e===null?null:e.stateNode},findFiberByHostInstance:ho.findFiberByHostInstance||gy,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 bl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bl.isDisabled&&bl.supportsFiber)try{js=bl.inject(xy),Ot=bl}catch{}}pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vy;pt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Iu(t))throw Error(M(200));return hy(e,t,null,n)};pt.createRoot=function(e,t){if(!Iu(e))throw Error(M(299));var n=!1,r="",o=Yp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Ru(e,1,!1,null,null,n,!1,r,o),e[on]=t.current,zo(e.nodeType===8?e.parentNode:e),new _u(t)};pt.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=gf(t),e=e===null?null:e.stateNode,e};pt.flushSync=function(e){return or(e)};pt.hydrate=function(e,t,n){if(!$s(t))throw Error(M(200));return zs(null,e,t,!0,n)};pt.hydrateRoot=function(e,t,n){if(!Iu(e))throw Error(M(405));var r=n!=null&&n.hydratedSources||null,o=!1,l="",s=Yp;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Gp(t,null,e,1,n??null,o,!1,l,s),e[on]=t.current,zo(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 Ms(t)};pt.render=function(e,t,n){if(!$s(t))throw Error(M(200));return zs(null,e,t,!1,n)};pt.unmountComponentAtNode=function(e){if(!$s(e))throw Error(M(40));return e._reactRootContainer?(or(function(){zs(null,null,e,!1,function(){e._reactRootContainer=null,e[on]=null})}),!0):!1};pt.unstable_batchedUpdates=ju;pt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!$s(n))throw Error(M(200));if(e==null||e._reactInternals===void 0)throw Error(M(38));return zs(e,t,n,!1,r)};pt.version="18.3.1-next-f1338f8080-20240426";function Qp(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Qp)}catch(e){console.error(e)}}Qp(),Yd.exports=pt;var Lu=Yd.exports,Qc=Lu;Oi.createRoot=Qc.createRoot,Oi.hydrateRoot=Qc.hydrateRoot;const wy="modulepreload",by=function(e){return"/panel/"+e},Xc={},Sy=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),i=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(a=>{if(a=by(a),a in Xc)return;Xc[a]=!0;const c=a.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${d}`))return;const p=document.createElement("link");if(p.rel=c?"stylesheet":wy,c||(p.as="script"),p.crossOrigin="",p.href=a,i&&p.setAttribute("nonce",i),document.head.appendChild(p),c)return new Promise((f,g)=>{p.addEventListener("load",f),p.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${a}`)))})}))}function l(s){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=s,window.dispatchEvent(i),!i.defaultPrevented)throw s}return o.then(s=>{for(const i of s||[])i.status==="rejected"&&l(i.reason);return t().catch(l)})},Au=["none","2xs","xs","sm","md","lg","xl","2xl"],Xp=["none","2xs","xs","sm"],Na=["0","1","2","4","8"],Ou=["none","2xs","xs","sm","md","lg"],ps=new Set(Au),ms=new Set(Xp),Yr=new Set(Na),hs=new Set(Ou),ky=["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"],Cy=["font-thin","font-extralight","font-light","font-normal","font-medium","font-semibold","font-bold","font-extrabold","font-black"],jy=["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"],Ey=["tracking-tighter","tracking-tight","tracking-normal","tracking-wide","tracking-wider","tracking-widest"],Ty=Array.from({length:21},(e,t)=>`opacity-${t*5}`),Zp=["none","sm","","md","lg","xl","2xl","3xl","full"],Ra=Zp.map(e=>e?`rounded-${e}`:"rounded");function Ny(e){return Zp.map(t=>t?`${e}-${t}`:e)}const Jp=["0","","2","3","4","5","6","8","10","12","16","20","24","32","40","48","56","64"],Ry=["solid","dashed","dotted","double","hidden","none"],Pa=["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"],Py=["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],_y=["50","100","200","300","400","500","600","700","800","900","950"];function J(){return e=>e===""?{props:{}}:null}function Ie(e,t){const n=new Set(t);return r=>n.has(r)?{props:{[e]:r}}:null}function ht(e="color"){return t=>t!==""?{props:{[e]:t}}:null}function Y(e,t="scale"){return n=>n!==""?{props:{[t]:n,scaleName:e}}:null}const Iy=["t","r","b","l","x","y"],xi=["t","r","b","l","x","y","s","e","bs","be"];function Ne(...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 Ht(e,t){return t.map(n=>({...n,section:e}))}function wi(e,t,n=Iy){return[...n.map(o=>({prefix:e+o,segment:t,canonical:e,extraProps:{side:o}})),{prefix:e,segment:t}]}function Ly(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:Ne(J(),t)}]}function Zc(e,t){const n=new Set(t);return{prefix:e,segment:J(),matches:r=>n.has(r)?{props:{value:r}}:null}}function Ay(e,t){for(const n of t){const{prefix:r,matches:o,segment:l,canonical:s,section:i,extraProps:a}=n;if(o){const p=o(e);if(!p)continue;const f={property:s??r,fullClass:e};if(i&&(f.section=i),a)for(const[g,x]of Object.entries(a))f[g]=x;for(const[g,x]of Object.entries(p.props))f[g]=x;return f}let c;if(e===r)c="";else if(e.startsWith(r+"-"))c=e.slice(r.length+1);else continue;const d=l(c);if(d){const p={property:s??r,fullClass:e};if(i&&(p.section=i),a)for(const[f,g]of Object.entries(a))p[f]=g;for(const[f,g]of Object.entries(d.props))p[f]=g;return p}return{property:s??r,fullClass:e,unknown:!0}}return null}function Oy(e,t){const n=e.trim().split(/\s+/).filter(Boolean),r=[];for(const o of n){const l=Ay(o,t);l&&r.push(l)}return r}const Dy=["solid","dashed","dotted","double","none","hidden"],My=["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],$y=["xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"],zy=["tighter","tight","normal","wide","wider","widest"],Ky=["left","center","right","justify","start","end"],Fy=["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"],Wy=["static","relative","absolute","fixed","sticky"],Vy=["t","tr","r","br","b","bl","l","tl"],Hy=["start","end","end-safe","center","center-safe","between","around","evenly","stretch","baseline","normal"],By=["start","end","end-safe","center","center-safe","baseline","baseline-last","stretch"],Uy=["normal","start","end","center","between","around","evenly","baseline","stretch"],Gy=["start","end","center","stretch"],Yy=["auto","start","end","center","stretch","baseline"],Qy=[...Ht("spacing",[...wi("m",Y("spacing"),xi),...wi("-m",Y("spacing"),xi),...wi("p",Y("spacing"),xi),F("gap-x",Y("spacing")),F("gap-y",Y("spacing")),F("gap",Y("spacing")),F("space-x-reverse",J()),F("space-y-reverse",J()),F("space-x",Y("spacing")),F("space-y",Y("spacing"))]),...Ht("sizing",[F("min-w",Y("spacing")),F("max-w",Y("spacing")),F("min-h",Y("spacing")),F("max-h",Y("spacing")),F("size",Y("spacing")),F("w",Y("spacing")),F("h",Y("spacing"))]),...Ht("typography",[F("font-sans",J()),F("font-serif",J()),F("font-mono",J()),F("font",Ie("scale",My)),F("text-shadow",Ne(Ie("size",Ou),ht())),F("text",Ne(Ie("align",Ky),e=>$y.includes(e)?{props:{size:e,scaleName:"fontSize"}}:null,ht())),F("leading",Ne(Ie("scale",["none"]),Y("spacing"))),F("tracking",Ie("scale",zy)),F("italic",J()),F("not-italic",J()),F("underline",J()),F("line-through",J()),F("overline",J()),F("no-underline",J()),F("uppercase",J()),F("lowercase",J()),F("capitalize",J()),F("normal-case",J()),F("truncate",J()),F("align-text-top",J()),F("align-text-bottom",J()),F("align-baseline",J()),F("align-top",J()),F("align-middle",J()),F("align-bottom",J()),F("align-sub",J()),F("align-super",J())]),...Ht("color",[F("bg-gradient-to",Ie("direction",Vy)),F("bg",ht()),F("from",ht()),F("via",ht()),F("to",ht()),F("ring",ht()),F("outline",Ne(Ie("style",["solid","dashed","dotted","double","none"]),ht())),F("fill",ht()),F("stroke",ht()),F("decoration",ht())]),...Ht("borders",[{prefix:"border-bs",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"bs"}},{prefix:"border-be",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"be"}},{prefix:"border-x",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"x"}},{prefix:"border-y",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"y"}},{prefix:"border-s",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"s"}},{prefix:"border-e",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"e"}},{prefix:"border-t",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"t"}},{prefix:"border-r",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"r"}},{prefix:"border-b",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"b"}},{prefix:"border-l",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"l"}},F("border",Ne(J(),Ie("style",Dy),e=>/^\d+$/.test(e)||e==="px"?{props:{scale:e,scaleName:"borderWidth"}}:null,ht())),...Ly("rounded",Y("borderRadius"))]),...Ht("effects",[F("opacity",Y("opacity")),F("shadow",Ie("size",Au))]),...Ht("layout",[Zc("display",Fy),Zc("position",Wy),{prefix:"inset-bs",segment:Y("spacing"),canonical:"inset",extraProps:{side:"bs"}},{prefix:"inset-be",segment:Y("spacing"),canonical:"inset",extraProps:{side:"be"}},{prefix:"inset-x",segment:Y("spacing"),canonical:"inset",extraProps:{side:"x"}},{prefix:"inset-y",segment:Y("spacing"),canonical:"inset",extraProps:{side:"y"}},{prefix:"inset-s",segment:Y("spacing"),canonical:"inset",extraProps:{side:"s"}},{prefix:"inset-e",segment:Y("spacing"),canonical:"inset",extraProps:{side:"e"}},{prefix:"top",segment:Y("spacing"),canonical:"inset",extraProps:{side:"top"}},{prefix:"right",segment:Y("spacing"),canonical:"inset",extraProps:{side:"right"}},{prefix:"bottom",segment:Y("spacing"),canonical:"inset",extraProps:{side:"bottom"}},{prefix:"left",segment:Y("spacing"),canonical:"inset",extraProps:{side:"left"}},{prefix:"start",segment:Y("spacing"),canonical:"inset",extraProps:{side:"start"}},{prefix:"end",segment:Y("spacing"),canonical:"inset",extraProps:{side:"end"}},F("inset",Y("spacing")),F("z",Y("zIndex"))]),...Ht("flexbox",[F("flex-row-reverse",J()),F("flex-col-reverse",J()),F("flex-wrap-reverse",J()),F("flex-row",J()),F("flex-col",J()),F("flex-wrap",J()),F("flex-nowrap",J()),F("flex",Ne(J(),Ie("value",["auto","initial","none"]),Y("number"))),F("grow",Ne(J(),Y("number"))),F("shrink",Ne(J(),Y("number"))),F("justify-items",Ie("value",Gy)),F("justify",Ie("value",Hy)),F("items",Ie("value",By)),F("content",Ie("value",Uy)),F("self",Ie("value",Yy)),F("basis",Y("spacing")),F("grid-cols",Ne(Ie("value",["none","subgrid"]),Y("gridCols"))),F("grid-rows",Ne(Ie("value",["none","subgrid"]),Y("gridRows"))),F("col-span",Y("colSpan")),F("row-span",Y("rowSpan")),F("order",Y("order"))]),...Ht("overflow",[F("overflow-x",Ie("value",["auto","hidden","clip","visible","scroll"])),F("overflow-y",Ie("value",["auto","hidden","clip","visible","scroll"])),F("overflow",Ie("value",["auto","hidden","clip","visible","scroll"]))])];let Gt=null,gs=!1;const Dl=[],Ml=[],$l=[];function Xy(){return window.location.origin.replace(/^http/,"ws")}function qp(){if(Gt)return;const e=Xy();Gt=new WebSocket(e),Gt.addEventListener("open",()=>{gs=!0,_r({type:"REGISTER",role:"panel"});for(const t of Ml)t()}),Gt.addEventListener("close",()=>{gs=!1,Gt=null;for(const t of $l)t();setTimeout(()=>qp(),3e3)}),Gt.addEventListener("message",t=>{try{const n=JSON.parse(t.data);for(const r of Dl)r(n)}catch(n){console.error("[tw-panel] Failed to parse message:",n)}}),Gt.addEventListener("error",t=>{console.error("[tw-panel] WebSocket error:",t)})}function _r(e){gs&&Gt&&Gt.send(JSON.stringify(e))}function he(e,t){_r({...t,to:e})}function em(e){return Dl.push(e),()=>{const t=Dl.indexOf(e);t!==-1&&Dl.splice(t,1)}}function Zy(e){return Ml.push(e),()=>{const t=Ml.indexOf(e);t!==-1&&Ml.splice(t,1)}}function Jy(e){return $l.push(e),()=>{const t=$l.indexOf(e);t!==-1&&$l.splice(t,1)}}function qy(){return gs}const tm=[{name:"popover",label:"Popover",icon:u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[u.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1.5",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.3"}),u.jsx("rect",{x:"4",y:"4",width:"8",height:"6",rx:"1",fill:"currentColor"})]})},{name:"sidebar",label:"Sidebar",icon:u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[u.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1.5",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.3"}),u.jsx("rect",{x:"9",y:"1",width:"6",height:"14",rx:"1.5",fill:"currentColor",opacity:"0.85"})]})},{name:"modal",label:"Modal",icon:u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[u.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1.5",fill:"currentColor",opacity:"0.12"}),u.jsx("rect",{x:"3",y:"4",width:"10",height:"8",rx:"1",fill:"currentColor",opacity:"0.9"})]})},{name:"popup",label:"Popup",icon:u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[u.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1.5",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.3"}),u.jsx("rect",{x:"8",y:"8",width:"7",height:"7",rx:"1",fill:"currentColor",opacity:"0.85"})]})}],nm="tw-panel-container";function ev(){try{const e=localStorage.getItem(nm);if(e&&tm.some(t=>t.name===e))return e}catch{}return"popover"}function Jc(){const[e,t]=w.useState(ev),[n,r]=w.useState(!1),o=w.useRef(null);w.useEffect(()=>{function s(i){o.current&&!o.current.contains(i.target)&&r(!1)}return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]);function l(s){if(s!==e){try{localStorage.setItem(nm,s)}catch{}t(s),he("overlay",{type:"SWITCH_CONTAINER",container:s})}r(!1)}return u.jsxs("div",{ref:o,className:"relative",children:[u.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:u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("rect",{x:".5",y:"1.5",width:"15",height:"13",rx:"1.5",ry:"1.5"}),u.jsx("line",{x1:"8.5",y1:"1.5",x2:"8.5",y2:"14.5"}),u.jsx("line",{x1:"11",y1:"5",x2:"13",y2:"5"}),u.jsx("line",{x1:"11",y1:"8",x2:"13",y2:"8"}),u.jsx("line",{x1:"11",y1:"11",x2:"13",y2:"11"})]})}),n&&u.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:[u.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.8px] text-bv-muted px-2 pt-1 pb-1.5",children:"Container"}),tm.map(s=>u.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)),u.jsx("div",{className:"h-px bg-[#4f4f4f] mx-1 my-1"}),u.jsxs("button",{onClick:()=>{r(!1),he("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:[u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[u.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),u.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),"Close panel"]})]})]})}function tv(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 nv(e,t=!0){const[n,r]=w.useState(null),[o,l]=w.useState(!0),[s,i]=w.useState({}),[a,c]=w.useState({}),d=w.useRef(0),p=w.useRef(null),f=w.useRef(!1);return w.useEffect(()=>{var h;if(!t)return;if(e.length===0){l(!1);return}f.current=!1,d.current=0;const g=document.createElement("iframe");Object.assign(g.style,{position:"fixed",left:"-99999px",top:"-99999px",width:"800px",height:"600px",visibility:"hidden",pointerEvents:"none",border:"none"}),p.current=g,document.body.appendChild(g);function x(y){if(y>=e.length){f.current||(f.current=!0,r(e[0]),i({}),c({}),l(!1));return}d.current=y,console.log(`[useStoryProbe] loading iframe: /storybook/iframe.html?id=${e[y].id}`),g.src=`/storybook/iframe.html?id=${e[y].id}&viewMode=story`}let b=null;function S(y){var k,j,T,$;if(f.current)return;let v=y.data;if(typeof v=="string")try{v=JSON.parse(v)}catch{return}const C=e[d.current];if((v==null?void 0:v.key)==="storybook-channel"&&((k=v==null?void 0:v.event)==null?void 0:k.type)==="storyPrepared"&&(($=(T=(j=v==null?void 0:v.event)==null?void 0:j.args)==null?void 0:T[0])==null?void 0:$.id)===(C==null?void 0:C.id)){const _=v.event.args[0].argTypes??{},W=v.event.args[0].initialArgs??v.event.args[0].args??{};if(Object.keys(_).length>0)f.current=!0,r(C),i(tv(_)),c(W),l(!1);else{b&&clearTimeout(b);const O=d.current+1;b=setTimeout(()=>x(O),50)}}}window.addEventListener("message",S);function m(){b&&clearTimeout(b),b=setTimeout(()=>{!f.current&&d.current<e.length&&(x(d.current+1),m())},5e3)}return g.addEventListener("load",()=>{m()}),console.log(`[useStoryProbe] starting probe for ${(h=e[0])==null?void 0:h.id} (${e.length} stories)`),x(0),()=>{f.current=!0,window.removeEventListener("message",S),b&&clearTimeout(b),g.remove(),p.current=null}},[e,t]),{bestStory:n,probing:o,argTypes:s,defaultArgs:a}}let rv=2,ys=0;const rm=[];function ov(){return new Promise(e=>{const t=()=>{ys<rv?(ys++,e(lv)):rm.push(t)};t()})}function lv(){ys=Math.max(0,ys-1);const e=rm.shift();e==null||e()}function sv(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 ov().then(i=>{if(s){i();return}r.current=i,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 iv(e,t={},n="/storybook"){const r=`${n}/iframe.html?id=${encodeURIComponent(e)}&viewMode=story`,o=Object.entries(t).filter(([,s])=>s!=null);if(o.length===0)return r;const l=o.map(([s,i])=>`${encodeURIComponent(s)}:${encodeURIComponent(String(i))}`).join(";");return`${r}&args=${l}`}function av({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 u.jsx("div",{className:"flex flex-col gap-1.5 px-1",children:r.map(([l,s])=>u.jsx(uv,{name:l,argType:s,value:t[l],onChange:i=>o(l,i)},l))})}function uv({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 u.jsxs("label",{className:"flex items-center gap-2 text-[10px]",children:[u.jsx("span",{className:"text-bv-text-mid font-mono min-w-[60px] shrink-0",children:e}),o==="select"&&t.options?u.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=>u.jsx("option",{value:l,children:l},l))}):o==="boolean"?u.jsx("input",{type:"checkbox",checked:!!n,onChange:l=>r(l.target.checked),className:"accent-bv-teal"}):o==="number"?u.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))}):u.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)})]})}const cv=["display","position","float","clear","width","height","min-width","min-height","max-width","max-height","padding-top","padding-right","padding-bottom","padding-left","margin-top","margin-right","margin-bottom","margin-left","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color","box-sizing","background-color","background-image","background-size","background-position","background-repeat","color","font-family","font-size","font-weight","font-style","border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius","box-shadow","opacity","text-decoration","text-transform","line-height","letter-spacing","word-spacing","text-align"],om=["color","font-family","font-size","font-weight","font-style","line-height","background-color","background-image","border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius","padding-top","padding-right","padding-bottom","padding-left","margin-top","margin-right","margin-bottom","margin-left","display","box-shadow","text-decoration","text-transform","letter-spacing","text-align","opacity","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color"];function dv(e){const t=(e.ownerDocument.defaultView??window).getComputedStyle(e),n={};for(const r of cv)n[r]=t.getPropertyValue(r);return n}function fv(e,t,n){for(const[r,o]of Object.entries(t))if(r!=="height"){if(r==="width"&&n!=null){const l=parseFloat(o);if(!isNaN(l)&&Math.abs(l-n)<1)continue}e.style.setProperty(r,o)}}function lm(e,t){if(!e||!t)return;const n=(e.ownerDocument.defaultView??window).getComputedStyle(e),r=t;if(r.style)for(const i of om)r.style.setProperty(i,n.getPropertyValue(i));const o=e.children,l=t.children,s=Math.min(o.length,l.length);for(let i=0;i<s;i++)lm(o[i],l[i])}const sm=om;function im(e,t){const n=e.children,r=t.children,o=Math.min(n.length,r.length);for(let l=0;l<o;l++){const s=n[l],i=r[l],a=(s.ownerDocument.defaultView??window).getComputedStyle(s);if(i.style)for(const c of sm)i.style.setProperty(c,a.getPropertyValue(c));im(s,i)}}class am extends HTMLElement{constructor(){super();_t(this,"shadow");_t(this,"ghostEl");_t(this,"hiddenIframe");_t(this,"loadTimeoutId",null);_t(this,"hasLoaded",!1);_t(this,"_loadedDispatched",!1);_t(this,"observer",null);_t(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=`
|
|
40
|
+
`+l.stack}return{value:e,source:t,stack:o,digest:null}}function hi(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ma(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Xg=typeof WeakMap=="function"?WeakMap:Map;function kp(e,t,n){n=en(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){us||(us=!0,Ca=r),ma(e,t)},n}function Cp(e,t,n){n=en(-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(){ma(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){ma(e,t),typeof r!="function"&&(Rn===null?Rn=new Set([this]):Rn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function _c(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Xg;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=cy.bind(null,e,t,n),t.then(e,e))}function Ic(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 Lc(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=en(-1,1),t.tag=2,Nn(n,t,1))),n.lanes|=1),e)}var Zg=hn.ReactCurrentOwner,rt=!1;function Xe(e,t,n,r){t.child=e===null?qf(t,null,n,r):Hr(t,e.child,n,r)}function Ac(e,t,n,r,o){n=n.render;var l=t.ref;return Mr(t,o),r=yu(e,t,n,r,l,o),n=vu(),e!==null&&!rt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,sn(e,t,o)):(Se&&n&&lu(t),t.flags|=1,Xe(e,t,r,o),t.child)}function Oc(e,t,n,r,o){if(e===null){var l=n.type;return typeof l=="function"&&!Nu(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,jp(e,t,l,r,o)):(e=Ol(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:$o,n(s,r)&&e.ref===t.ref)return sn(e,t,o)}return t.flags|=1,e=_n(l,r),e.ref=t.ref,e.return=t,t.child=e}function jp(e,t,n,r,o){if(e!==null){var l=e.memoizedProps;if($o(l,r)&&e.ref===t.ref)if(rt=!1,t.pendingProps=r=l,(e.lanes&o)!==0)e.flags&131072&&(rt=!0);else return t.lanes=e.lanes,sn(e,t,o)}return ha(e,t,n,r,o)}function Ep(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},ge(Pr,it),it|=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,ge(Pr,it),it|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,ge(Pr,it),it|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,ge(Pr,it),it|=r;return Xe(e,t,o,n),t.child}function Tp(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ha(e,t,n,r,o){var l=lt(n)?er:Qe.current;return l=Wr(t,l),Mr(t,o),n=yu(e,t,n,r,l,o),r=vu(),e!==null&&!rt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,sn(e,t,o)):(Se&&r&&lu(t),t.flags|=1,Xe(e,t,n,o),t.child)}function Dc(e,t,n,r,o){if(lt(n)){var l=!0;ql(t)}else l=!1;if(Mr(t,o),t.stateNode===null)Il(e,t),Sp(t,n,r),pa(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,i=t.memoizedProps;s.props=i;var u=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=bt(c):(c=lt(n)?er:Qe.current,c=Wr(t,c));var d=n.getDerivedStateFromProps,p=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";p||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==r||u!==c)&&Pc(t,s,r,c),vn=!1;var f=t.memoizedState;s.state=f,os(t,r,s,o),u=t.memoizedState,i!==r||f!==u||ot.current||vn?(typeof d=="function"&&(fa(t,n,d,r),u=t.memoizedState),(i=vn||Rc(t,n,i,r,f,u,c))?(p||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=i):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,tp(e,t),i=t.memoizedProps,c=t.type===t.elementType?i:jt(t.type,i),s.props=c,p=t.pendingProps,f=s.context,u=n.contextType,typeof u=="object"&&u!==null?u=bt(u):(u=lt(n)?er:Qe.current,u=Wr(t,u));var g=n.getDerivedStateFromProps;(d=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==p||f!==u)&&Pc(t,s,r,u),vn=!1,f=t.memoizedState,s.state=f,os(t,r,s,o);var x=t.memoizedState;i!==p||f!==x||ot.current||vn?(typeof g=="function"&&(fa(t,n,g,r),x=t.memoizedState),(c=vn||Rc(t,n,c,r,f,x,u)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,x,u),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,x,u)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),s.props=r,s.state=x,s.context=u,r=c):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return ga(e,t,n,r,l,o)}function ga(e,t,n,r,o,l){Tp(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&bc(t,n,!1),sn(e,t,l);r=t.stateNode,Zg.current=t;var i=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Hr(t,e.child,null,l),t.child=Hr(t,null,i,l)):Xe(e,t,i,l),t.memoizedState=r.state,o&&bc(t,n,!0),t.child}function Np(e){var t=e.stateNode;t.pendingContext?wc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&wc(e,t.context,!1),pu(e,t.containerInfo)}function Mc(e,t,n,r,o){return Vr(),iu(o),t.flags|=256,Xe(e,t,n,r),t.child}var ya={dehydrated:null,treeContext:null,retryLane:0};function va(e){return{baseLanes:e,cachePool:null,transitions:null}}function Rp(e,t,n){var r=t.pendingProps,o=ke.current,l=!1,s=(t.flags&128)!==0,i;if((i=s)||(i=e!==null&&e.memoizedState===null?!1:(o&2)!==0),i?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ge(ke,o&1),e===null)return ca(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=Os(s,r,0,null),e=Jn(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=va(n),t.memoizedState=ya,e):bu(t,s));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return Jg(e,t,s,r,i,o,n);if(l){l=r.fallback,s=t.mode,o=e.child,i=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),i!==null?l=_n(i,l):(l=Jn(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?va(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},l.memoizedState=s,l.childLanes=e.childLanes&~n,t.memoizedState=ya,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 bu(e,t){return t=Os({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function vl(e,t,n,r){return r!==null&&iu(r),Hr(t,e.child,null,n),e=bu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Jg(e,t,n,r,o,l,s){if(n)return t.flags&256?(t.flags&=-257,r=hi(Error(M(422))),vl(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,o=t.mode,r=Os({mode:"visible",children:r.children},o,0,null),l=Jn(l,o,s,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,t.mode&1&&Hr(t,e.child,null,s),t.child.memoizedState=va(s),t.memoizedState=ya,l);if(!(t.mode&1))return vl(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var i=r.dgst;return r=i,l=Error(M(419)),r=hi(l,r,void 0),vl(e,t,s,r)}if(i=(s&e.childLanes)!==0,rt||i){if(r=Ke,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,ln(e,o),Rt(r,e,o,-1))}return Tu(),r=hi(Error(M(421))),vl(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=dy.bind(null,e),o._reactRetry=t,null):(e=l.treeContext,ut=Tn(o.nextSibling),ct=t,Se=!0,Tt=null,e!==null&&(gt[yt++]=Zt,gt[yt++]=Jt,gt[yt++]=tr,Zt=e.id,Jt=e.overflow,tr=t),t=bu(t,r.children),t.flags|=4096,t)}function $c(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),da(e.return,t,n)}function gi(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 Pp(e,t,n){var r=t.pendingProps,o=r.revealOrder,l=r.tail;if(Xe(e,t,r.children,n),r=ke.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&&$c(e,n,t);else if(e.tag===19)$c(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(ge(ke,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&&ls(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),gi(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&&ls(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}gi(t,!0,n,null,l);break;case"together":gi(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Il(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function sn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),rr|=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 qg(e,t,n){switch(t.tag){case 3:Np(t),Vr();break;case 5:np(t);break;case 1:lt(t.type)&&ql(t);break;case 4:pu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ge(ns,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ge(ke,ke.current&1),t.flags|=128,null):n&t.child.childLanes?Rp(e,t,n):(ge(ke,ke.current&1),e=sn(e,t,n),e!==null?e.sibling:null);ge(ke,ke.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Pp(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ge(ke,ke.current),r)break;return null;case 22:case 23:return t.lanes=0,Ep(e,t,n)}return sn(e,t,n)}var _p,xa,Ip,Lp;_p=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}};xa=function(){};Ip=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Qn(Dt.current);var l=null;switch(n){case"input":o=Fi(e,o),r=Fi(e,r),l=[];break;case"select":o=je({},o,{value:void 0}),r=je({},r,{value:void 0}),l=[];break;case"textarea":o=Hi(e,o),r=Hi(e,r),l=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Zl)}Ui(n,r);var s;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var i=o[c];for(s in i)i.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(_o.hasOwnProperty(c)?l||(l=[]):(l=l||[]).push(c,null));for(c in r){var u=r[c];if(i=o!=null?o[c]:void 0,r.hasOwnProperty(c)&&u!==i&&(u!=null||i!=null))if(c==="style")if(i){for(s in i)!i.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in u)u.hasOwnProperty(s)&&i[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,i=i?i.__html:void 0,u!=null&&i!==u&&(l=l||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(l=l||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(_o.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&xe("scroll",e),l||i===u||(l=[])):(l=l||[]).push(c,u))}n&&(l=l||[]).push("style",n);var c=l;(t.updateQueue=c)&&(t.flags|=4)}};Lp=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 Ge(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 ey(e,t,n){var r=t.pendingProps;switch(su(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ge(t),null;case 1:return lt(t.type)&&Jl(),Ge(t),null;case 3:return r=t.stateNode,Br(),we(ot),we(Qe),hu(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(gl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Tt!==null&&(Ta(Tt),Tt=null))),xa(e,t),Ge(t),null;case 5:mu(t);var o=Qn(Vo.current);if(n=t.type,e!==null&&t.stateNode!=null)Ip(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 Ge(t),null}if(e=Qn(Dt.current),gl(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[At]=t,r[Fo]=l,e=(t.mode&1)!==0,n){case"dialog":xe("cancel",r),xe("close",r);break;case"iframe":case"object":case"embed":xe("load",r);break;case"video":case"audio":for(o=0;o<wo.length;o++)xe(wo[o],r);break;case"source":xe("error",r);break;case"img":case"image":case"link":xe("error",r),xe("load",r);break;case"details":xe("toggle",r);break;case"input":Gu(r,l),xe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},xe("invalid",r);break;case"textarea":Qu(r,l),xe("invalid",r)}Ui(n,l),o=null;for(var s in l)if(l.hasOwnProperty(s)){var i=l[s];s==="children"?typeof i=="string"?r.textContent!==i&&(l.suppressHydrationWarning!==!0&&hl(r.textContent,i,e),o=["children",i]):typeof i=="number"&&r.textContent!==""+i&&(l.suppressHydrationWarning!==!0&&hl(r.textContent,i,e),o=["children",""+i]):_o.hasOwnProperty(s)&&i!=null&&s==="onScroll"&&xe("scroll",r)}switch(n){case"input":il(r),Yu(r,l,!0);break;case"textarea":il(r),Xu(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=Zl)}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[At]=t,e[Fo]=r,_p(e,t,!1,!1),t.stateNode=e;e:{switch(s=Gi(n,r),n){case"dialog":xe("cancel",e),xe("close",e),o=r;break;case"iframe":case"object":case"embed":xe("load",e),o=r;break;case"video":case"audio":for(o=0;o<wo.length;o++)xe(wo[o],e);o=r;break;case"source":xe("error",e),o=r;break;case"img":case"image":case"link":xe("error",e),xe("load",e),o=r;break;case"details":xe("toggle",e),o=r;break;case"input":Gu(e,r),o=Fi(e,r),xe("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=je({},r,{value:void 0}),xe("invalid",e);break;case"textarea":Qu(e,r),o=Hi(e,r),xe("invalid",e);break;default:o=r}Ui(n,o),i=o;for(l in i)if(i.hasOwnProperty(l)){var u=i[l];l==="style"?cf(e,u):l==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&af(e,u)):l==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Io(e,u):typeof u=="number"&&Io(e,""+u):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(_o.hasOwnProperty(l)?u!=null&&l==="onScroll"&&xe("scroll",e):u!=null&&Ba(e,l,u,s))}switch(n){case"input":il(e),Yu(e,r,!1);break;case"textarea":il(e),Xu(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ln(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?Lr(e,!!r.multiple,l,!1):r.defaultValue!=null&&Lr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Zl)}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 Ge(t),null;case 6:if(e&&t.stateNode!=null)Lp(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(M(166));if(n=Qn(Vo.current),Qn(Dt.current),gl(t)){if(r=t.stateNode,n=t.memoizedProps,r[At]=t,(l=r.nodeValue!==n)&&(e=ct,e!==null))switch(e.tag){case 3:hl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&hl(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[At]=t,t.stateNode=r}return Ge(t),null;case 13:if(we(ke),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Se&&ut!==null&&t.mode&1&&!(t.flags&128))Zf(),Vr(),t.flags|=98560,l=!1;else if(l=gl(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[At]=t}else Vr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ge(t),l=!1}else Tt!==null&&(Ta(Tt),Tt=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||ke.current&1?De===0&&(De=3):Tu())),t.updateQueue!==null&&(t.flags|=4),Ge(t),null);case 4:return Br(),xa(e,t),e===null&&zo(t.stateNode.containerInfo),Ge(t),null;case 10:return cu(t.type._context),Ge(t),null;case 17:return lt(t.type)&&Jl(),Ge(t),null;case 19:if(we(ke),l=t.memoizedState,l===null)return Ge(t),null;if(r=(t.flags&128)!==0,s=l.rendering,s===null)if(r)mo(l,!1);else{if(De!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=ls(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 ge(ke,ke.current&1|2),t.child}e=e.sibling}l.tail!==null&&Re()>Gr&&(t.flags|=128,r=!0,mo(l,!1),t.lanes=4194304)}else{if(!r)if(e=ls(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 Ge(t),null}else 2*Re()-l.renderingStartTime>Gr&&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=Re(),t.sibling=null,n=ke.current,ge(ke,r?n&1|2:n&1),t):(Ge(t),null);case 22:case 23:return Eu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?it&1073741824&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),null;case 24:return null;case 25:return null}throw Error(M(156,t.tag))}function ty(e,t){switch(su(t),t.tag){case 1:return lt(t.type)&&Jl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Br(),we(ot),we(Qe),hu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return mu(t),null;case 13:if(we(ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));Vr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return we(ke),null;case 4:return Br(),null;case 10:return cu(t.type._context),null;case 22:case 23:return Eu(),null;case 24:return null;default:return null}}var xl=!1,Ye=!1,ny=typeof WeakSet=="function"?WeakSet:Set,B=null;function Rr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Te(e,t,r)}else n.current=null}function wa(e,t,n){try{n()}catch(r){Te(e,t,r)}}var zc=!1;function ry(e,t){if(ra=Yl,e=$f(),ou(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,i=-1,u=-1,c=0,d=0,p=e,f=null;t:for(;;){for(var g;p!==n||o!==0&&p.nodeType!==3||(i=s+o),p!==l||r!==0&&p.nodeType!==3||(u=s+r),p.nodeType===3&&(s+=p.nodeValue.length),(g=p.firstChild)!==null;)f=p,p=g;for(;;){if(p===e)break t;if(f===n&&++c===o&&(i=s),f===l&&++d===r&&(u=s),(g=p.nextSibling)!==null)break;p=f,f=p.parentNode}p=g}n=i===-1||u===-1?null:{start:i,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(oa={focusedElem:e,selectionRange:n},Yl=!1,B=t;B!==null;)if(t=B,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,B=e;else for(;B!==null;){t=B;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var b=x.memoizedProps,S=x.memoizedState,m=t.stateNode,h=m.getSnapshotBeforeUpdate(t.elementType===t.type?b:jt(t.type,b),S);m.__reactInternalSnapshotBeforeUpdate=h}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(v){Te(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,B=e;break}B=t.return}return x=zc,zc=!1,x}function No(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&&wa(t,n,l)}o=o.next}while(o!==r)}}function Ls(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 ba(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 Ap(e){var t=e.alternate;t!==null&&(e.alternate=null,Ap(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[At],delete t[Fo],delete t[ia],delete t[zg],delete t[Kg])),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 Op(e){return e.tag===5||e.tag===3||e.tag===4}function Kc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Op(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 Sa(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=Zl));else if(r!==4&&(e=e.child,e!==null))for(Sa(e,t,n),e=e.sibling;e!==null;)Sa(e,t,n),e=e.sibling}function ka(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(ka(e,t,n),e=e.sibling;e!==null;)ka(e,t,n),e=e.sibling}var We=null,Et=!1;function gn(e,t,n){for(n=n.child;n!==null;)Dp(e,t,n),n=n.sibling}function Dp(e,t,n){if(Ot&&typeof Ot.onCommitFiberUnmount=="function")try{Ot.onCommitFiberUnmount(js,n)}catch{}switch(n.tag){case 5:Ye||Rr(n,t);case 6:var r=We,o=Et;We=null,gn(e,t,n),We=r,Et=o,We!==null&&(Et?(e=We,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):We.removeChild(n.stateNode));break;case 18:We!==null&&(Et?(e=We,n=n.stateNode,e.nodeType===8?ui(e.parentNode,n):e.nodeType===1&&ui(e,n),Do(e)):ui(We,n.stateNode));break;case 4:r=We,o=Et,We=n.stateNode.containerInfo,Et=!0,gn(e,t,n),We=r,Et=o;break;case 0:case 11:case 14:case 15:if(!Ye&&(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)&&wa(n,t,s),o=o.next}while(o!==r)}gn(e,t,n);break;case 1:if(!Ye&&(Rr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(i){Te(n,t,i)}gn(e,t,n);break;case 21:gn(e,t,n);break;case 22:n.mode&1?(Ye=(r=Ye)||n.memoizedState!==null,gn(e,t,n),Ye=r):gn(e,t,n);break;default:gn(e,t,n)}}function Fc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ny),t.forEach(function(r){var o=fy.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Ct(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,i=s;e:for(;i!==null;){switch(i.tag){case 5:We=i.stateNode,Et=!1;break e;case 3:We=i.stateNode.containerInfo,Et=!0;break e;case 4:We=i.stateNode.containerInfo,Et=!0;break e}i=i.return}if(We===null)throw Error(M(160));Dp(l,s,o),We=null,Et=!1;var u=o.alternate;u!==null&&(u.return=null),o.return=null}catch(c){Te(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Mp(t,e),t=t.sibling}function Mp(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ct(t,e),It(e),r&4){try{No(3,e,e.return),Ls(3,e)}catch(b){Te(e,e.return,b)}try{No(5,e,e.return)}catch(b){Te(e,e.return,b)}}break;case 1:Ct(t,e),It(e),r&512&&n!==null&&Rr(n,n.return);break;case 5:if(Ct(t,e),It(e),r&512&&n!==null&&Rr(n,n.return),e.flags&32){var o=e.stateNode;try{Io(o,"")}catch(b){Te(e,e.return,b)}}if(r&4&&(o=e.stateNode,o!=null)){var l=e.memoizedProps,s=n!==null?n.memoizedProps:l,i=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{i==="input"&&l.type==="radio"&&l.name!=null&&of(o,l),Gi(i,s);var c=Gi(i,l);for(s=0;s<u.length;s+=2){var d=u[s],p=u[s+1];d==="style"?cf(o,p):d==="dangerouslySetInnerHTML"?af(o,p):d==="children"?Io(o,p):Ba(o,d,p,c)}switch(i){case"input":Wi(o,l);break;case"textarea":lf(o,l);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!l.multiple;var g=l.value;g!=null?Lr(o,!!l.multiple,g,!1):f!==!!l.multiple&&(l.defaultValue!=null?Lr(o,!!l.multiple,l.defaultValue,!0):Lr(o,!!l.multiple,l.multiple?[]:"",!1))}o[Fo]=l}catch(b){Te(e,e.return,b)}}break;case 6:if(Ct(t,e),It(e),r&4){if(e.stateNode===null)throw Error(M(162));o=e.stateNode,l=e.memoizedProps;try{o.nodeValue=l}catch(b){Te(e,e.return,b)}}break;case 3:if(Ct(t,e),It(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Do(t.containerInfo)}catch(b){Te(e,e.return,b)}break;case 4:Ct(t,e),It(e);break;case 13:Ct(t,e),It(e),o=e.child,o.flags&8192&&(l=o.memoizedState!==null,o.stateNode.isHidden=l,!l||o.alternate!==null&&o.alternate.memoizedState!==null||(Cu=Re())),r&4&&Fc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Ye=(c=Ye)||d,Ct(t,e),Ye=c):Ct(t,e),It(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(B=e,d=e.child;d!==null;){for(p=B=d;B!==null;){switch(f=B,g=f.child,f.tag){case 0:case 11:case 14:case 15:No(4,f,f.return);break;case 1:Rr(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(b){Te(r,n,b)}}break;case 5:Rr(f,f.return);break;case 22:if(f.memoizedState!==null){Vc(p);continue}}g!==null?(g.return=f,B=g):Vc(p)}d=d.sibling}e:for(d=null,p=e;;){if(p.tag===5){if(d===null){d=p;try{o=p.stateNode,c?(l=o.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(i=p.stateNode,u=p.memoizedProps.style,s=u!=null&&u.hasOwnProperty("display")?u.display:null,i.style.display=uf("display",s))}catch(b){Te(e,e.return,b)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=c?"":p.memoizedProps}catch(b){Te(e,e.return,b)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:Ct(t,e),It(e),r&4&&Fc(e);break;case 21:break;default:Ct(t,e),It(e)}}function It(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Op(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&&(Io(o,""),r.flags&=-33);var l=Kc(e);ka(e,l,o);break;case 3:case 4:var s=r.stateNode.containerInfo,i=Kc(e);Sa(e,i,s);break;default:throw Error(M(161))}}catch(u){Te(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function oy(e,t,n){B=e,$p(e)}function $p(e,t,n){for(var r=(e.mode&1)!==0;B!==null;){var o=B,l=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||xl;if(!s){var i=o.alternate,u=i!==null&&i.memoizedState!==null||Ye;i=xl;var c=Ye;if(xl=s,(Ye=u)&&!c)for(B=o;B!==null;)s=B,u=s.child,s.tag===22&&s.memoizedState!==null?Hc(o):u!==null?(u.return=s,B=u):Hc(o);for(;l!==null;)B=l,$p(l),l=l.sibling;B=o,xl=i,Ye=c}Wc(e)}else o.subtreeFlags&8772&&l!==null?(l.return=o,B=l):Wc(e)}}function Wc(e){for(;B!==null;){var t=B;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ye||Ls(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ye)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:jt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&Ec(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}Ec(t,s,n)}break;case 5:var i=t.stateNode;if(n===null&&t.flags&4){n=i;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 d=c.memoizedState;if(d!==null){var p=d.dehydrated;p!==null&&Do(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(M(163))}Ye||t.flags&512&&ba(t)}catch(f){Te(t,t.return,f)}}if(t===e){B=null;break}if(n=t.sibling,n!==null){n.return=t.return,B=n;break}B=t.return}}function Vc(e){for(;B!==null;){var t=B;if(t===e){B=null;break}var n=t.sibling;if(n!==null){n.return=t.return,B=n;break}B=t.return}}function Hc(e){for(;B!==null;){var t=B;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ls(4,t)}catch(u){Te(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(u){Te(t,o,u)}}var l=t.return;try{ba(t)}catch(u){Te(t,l,u)}break;case 5:var s=t.return;try{ba(t)}catch(u){Te(t,s,u)}}}catch(u){Te(t,t.return,u)}if(t===e){B=null;break}var i=t.sibling;if(i!==null){i.return=t.return,B=i;break}B=t.return}}var ly=Math.ceil,as=hn.ReactCurrentDispatcher,Su=hn.ReactCurrentOwner,xt=hn.ReactCurrentBatchConfig,ue=0,Ke=null,Le=null,Ve=0,it=0,Pr=$n(0),De=0,Go=null,rr=0,As=0,ku=0,Ro=null,nt=null,Cu=0,Gr=1/0,Ut=null,us=!1,Ca=null,Rn=null,wl=!1,kn=null,cs=0,Po=0,ja=null,Ll=-1,Al=0;function Ze(){return ue&6?Re():Ll!==-1?Ll:Ll=Re()}function Pn(e){return e.mode&1?ue&2&&Ve!==0?Ve&-Ve:Wg.transition!==null?(Al===0&&(Al=Sf()),Al):(e=de,e!==0||(e=window.event,e=e===void 0?16:Rf(e.type)),e):1}function Rt(e,t,n,r){if(50<Po)throw Po=0,ja=null,Error(M(185));Zo(e,n,r),(!(ue&2)||e!==Ke)&&(e===Ke&&(!(ue&2)&&(As|=n),De===4&&bn(e,Ve)),st(e,r),n===1&&ue===0&&!(t.mode&1)&&(Gr=Re()+500,Ps&&zn()))}function st(e,t){var n=e.callbackNode;Wh(e,t);var r=Gl(e,e===Ke?Ve:0);if(r===0)n!==null&&qu(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&qu(n),t===1)e.tag===0?Fg(Bc.bind(null,e)):Yf(Bc.bind(null,e)),Mg(function(){!(ue&6)&&zn()}),n=null;else{switch(kf(r)){case 1:n=Xa;break;case 4:n=wf;break;case 16:n=Ul;break;case 536870912:n=bf;break;default:n=Ul}n=Up(n,zp.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function zp(e,t){if(Ll=-1,Al=0,ue&6)throw Error(M(327));var n=e.callbackNode;if($r()&&e.callbackNode!==n)return null;var r=Gl(e,e===Ke?Ve:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ds(e,r);else{t=r;var o=ue;ue|=2;var l=Fp();(Ke!==e||Ve!==t)&&(Ut=null,Gr=Re()+500,Zn(e,t));do try{ay();break}catch(i){Kp(e,i)}while(!0);uu(),as.current=l,ue=o,Le!==null?t=0:(Ke=null,Ve=0,t=De)}if(t!==0){if(t===2&&(o=Ji(e),o!==0&&(r=o,t=Ea(e,o))),t===1)throw n=Go,Zn(e,0),bn(e,r),st(e,Re()),n;if(t===6)bn(e,r);else{if(o=e.current.alternate,!(r&30)&&!sy(o)&&(t=ds(e,r),t===2&&(l=Ji(e),l!==0&&(r=l,t=Ea(e,l))),t===1))throw n=Go,Zn(e,0),bn(e,r),st(e,Re()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(M(345));case 2:Un(e,nt,Ut);break;case 3:if(bn(e,r),(r&130023424)===r&&(t=Cu+500-Re(),10<t)){if(Gl(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ze(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=sa(Un.bind(null,e,nt,Ut),t);break}Un(e,nt,Ut);break;case 4:if(bn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Nt(r);l=1<<s,s=t[s],s>o&&(o=s),r&=~l}if(r=o,r=Re()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ly(r/1960))-r,10<r){e.timeoutHandle=sa(Un.bind(null,e,nt,Ut),r);break}Un(e,nt,Ut);break;case 5:Un(e,nt,Ut);break;default:throw Error(M(329))}}}return st(e,Re()),e.callbackNode===n?zp.bind(null,e):null}function Ea(e,t){var n=Ro;return e.current.memoizedState.isDehydrated&&(Zn(e,t).flags|=256),e=ds(e,t),e!==2&&(t=nt,nt=n,t!==null&&Ta(t)),e}function Ta(e){nt===null?nt=e:nt.push.apply(nt,e)}function sy(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(!Pt(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 bn(e,t){for(t&=~ku,t&=~As,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Nt(t),r=1<<n;e[n]=-1,t&=~r}}function Bc(e){if(ue&6)throw Error(M(327));$r();var t=Gl(e,0);if(!(t&1))return st(e,Re()),null;var n=ds(e,t);if(e.tag!==0&&n===2){var r=Ji(e);r!==0&&(t=r,n=Ea(e,r))}if(n===1)throw n=Go,Zn(e,0),bn(e,t),st(e,Re()),n;if(n===6)throw Error(M(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Un(e,nt,Ut),st(e,Re()),null}function ju(e,t){var n=ue;ue|=1;try{return e(t)}finally{ue=n,ue===0&&(Gr=Re()+500,Ps&&zn())}}function or(e){kn!==null&&kn.tag===0&&!(ue&6)&&$r();var t=ue;ue|=1;var n=xt.transition,r=de;try{if(xt.transition=null,de=1,e)return e()}finally{de=r,xt.transition=n,ue=t,!(ue&6)&&zn()}}function Eu(){it=Pr.current,we(Pr)}function Zn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Dg(n)),Le!==null)for(n=Le.return;n!==null;){var r=n;switch(su(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Jl();break;case 3:Br(),we(ot),we(Qe),hu();break;case 5:mu(r);break;case 4:Br();break;case 13:we(ke);break;case 19:we(ke);break;case 10:cu(r.type._context);break;case 22:case 23:Eu()}n=n.return}if(Ke=e,Le=e=_n(e.current,null),Ve=it=t,De=0,Go=null,ku=As=rr=0,nt=Ro=null,Yn!==null){for(t=0;t<Yn.length;t++)if(n=Yn[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}Yn=null}return e}function Kp(e,t){do{var n=Le;try{if(uu(),Pl.current=is,ss){for(var r=Ce.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ss=!1}if(nr=0,ze=Oe=Ce=null,To=!1,Ho=0,Su.current=null,n===null||n.return===null){De=1,Go=t,Le=null;break}e:{var l=e,s=n.return,i=n,u=t;if(t=Ve,i.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,d=i,p=d.tag;if(!(d.mode&1)&&(p===0||p===11||p===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var g=Ic(s);if(g!==null){g.flags&=-257,Lc(g,s,i,l,t),g.mode&1&&_c(l,c,t),t=g,u=c;var x=t.updateQueue;if(x===null){var b=new Set;b.add(u),t.updateQueue=b}else x.add(u);break e}else{if(!(t&1)){_c(l,c,t),Tu();break e}u=Error(M(426))}}else if(Se&&i.mode&1){var S=Ic(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),Lc(S,s,i,l,t),iu(Ur(u,i));break e}}l=u=Ur(u,i),De!==4&&(De=2),Ro===null?Ro=[l]:Ro.push(l),l=s;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var m=kp(l,u,t);jc(l,m);break e;case 1:i=u;var h=l.type,y=l.stateNode;if(!(l.flags&128)&&(typeof h.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Rn===null||!Rn.has(y)))){l.flags|=65536,t&=-t,l.lanes|=t;var v=Cp(l,i,t);jc(l,v);break e}}l=l.return}while(l!==null)}Vp(n)}catch(C){t=C,Le===n&&n!==null&&(Le=n=n.return);continue}break}while(!0)}function Fp(){var e=as.current;return as.current=is,e===null?is:e}function Tu(){(De===0||De===3||De===2)&&(De=4),Ke===null||!(rr&268435455)&&!(As&268435455)||bn(Ke,Ve)}function ds(e,t){var n=ue;ue|=2;var r=Fp();(Ke!==e||Ve!==t)&&(Ut=null,Zn(e,t));do try{iy();break}catch(o){Kp(e,o)}while(!0);if(uu(),ue=n,as.current=r,Le!==null)throw Error(M(261));return Ke=null,Ve=0,De}function iy(){for(;Le!==null;)Wp(Le)}function ay(){for(;Le!==null&&!Lh();)Wp(Le)}function Wp(e){var t=Bp(e.alternate,e,it);e.memoizedProps=e.pendingProps,t===null?Vp(e):Le=t,Su.current=null}function Vp(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=ty(n,t),n!==null){n.flags&=32767,Le=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{De=6,Le=null;return}}else if(n=ey(n,t,it),n!==null){Le=n;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);De===0&&(De=5)}function Un(e,t,n){var r=de,o=xt.transition;try{xt.transition=null,de=1,uy(e,t,n,r)}finally{xt.transition=o,de=r}return null}function uy(e,t,n,r){do $r();while(kn!==null);if(ue&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(Vh(e,l),e===Ke&&(Le=Ke=null,Ve=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||wl||(wl=!0,Up(Ul,function(){return $r(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=xt.transition,xt.transition=null;var s=de;de=1;var i=ue;ue|=4,Su.current=null,ry(e,n),Mp(n,e),Rg(oa),Yl=!!ra,oa=ra=null,e.current=n,oy(n),Ah(),ue=i,de=s,xt.transition=l}else e.current=n;if(wl&&(wl=!1,kn=e,cs=o),l=e.pendingLanes,l===0&&(Rn=null),Mh(n.stateNode),st(e,Re()),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(us)throw us=!1,e=Ca,Ca=null,e;return cs&1&&e.tag!==0&&$r(),l=e.pendingLanes,l&1?e===ja?Po++:(Po=0,ja=e):Po=0,zn(),null}function $r(){if(kn!==null){var e=kf(cs),t=xt.transition,n=de;try{if(xt.transition=null,de=16>e?16:e,kn===null)var r=!1;else{if(e=kn,kn=null,cs=0,ue&6)throw Error(M(331));var o=ue;for(ue|=4,B=e.current;B!==null;){var l=B,s=l.child;if(B.flags&16){var i=l.deletions;if(i!==null){for(var u=0;u<i.length;u++){var c=i[u];for(B=c;B!==null;){var d=B;switch(d.tag){case 0:case 11:case 15:No(8,d,l)}var p=d.child;if(p!==null)p.return=d,B=p;else for(;B!==null;){d=B;var f=d.sibling,g=d.return;if(Ap(d),d===c){B=null;break}if(f!==null){f.return=g,B=f;break}B=g}}}var x=l.alternate;if(x!==null){var b=x.child;if(b!==null){x.child=null;do{var S=b.sibling;b.sibling=null,b=S}while(b!==null)}}B=l}}if(l.subtreeFlags&2064&&s!==null)s.return=l,B=s;else e:for(;B!==null;){if(l=B,l.flags&2048)switch(l.tag){case 0:case 11:case 15:No(9,l,l.return)}var m=l.sibling;if(m!==null){m.return=l.return,B=m;break e}B=l.return}}var h=e.current;for(B=h;B!==null;){s=B;var y=s.child;if(s.subtreeFlags&2064&&y!==null)y.return=s,B=y;else e:for(s=h;B!==null;){if(i=B,i.flags&2048)try{switch(i.tag){case 0:case 11:case 15:Ls(9,i)}}catch(C){Te(i,i.return,C)}if(i===s){B=null;break e}var v=i.sibling;if(v!==null){v.return=i.return,B=v;break e}B=i.return}}if(ue=o,zn(),Ot&&typeof Ot.onPostCommitFiberRoot=="function")try{Ot.onPostCommitFiberRoot(js,e)}catch{}r=!0}return r}finally{de=n,xt.transition=t}}return!1}function Uc(e,t,n){t=Ur(n,t),t=kp(e,t,1),e=Nn(e,t,1),t=Ze(),e!==null&&(Zo(e,1,t),st(e,t))}function Te(e,t,n){if(e.tag===3)Uc(e,e,n);else for(;t!==null;){if(t.tag===3){Uc(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Rn===null||!Rn.has(r))){e=Ur(n,e),e=Cp(t,e,1),t=Nn(t,e,1),e=Ze(),t!==null&&(Zo(t,1,e),st(t,e));break}}t=t.return}}function cy(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ze(),e.pingedLanes|=e.suspendedLanes&n,Ke===e&&(Ve&n)===n&&(De===4||De===3&&(Ve&130023424)===Ve&&500>Re()-Cu?Zn(e,0):ku|=n),st(e,t)}function Hp(e,t){t===0&&(e.mode&1?(t=cl,cl<<=1,!(cl&130023424)&&(cl=4194304)):t=1);var n=Ze();e=ln(e,t),e!==null&&(Zo(e,t,n),st(e,n))}function dy(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Hp(e,n)}function fy(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),Hp(e,n)}var Bp;Bp=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)rt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return rt=!1,qg(e,t,n);rt=!!(e.flags&131072)}else rt=!1,Se&&t.flags&1048576&&Qf(t,ts,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Il(e,t),e=t.pendingProps;var o=Wr(t,Qe.current);Mr(t,n),o=yu(null,t,r,e,o,n);var l=vu();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,lt(r)?(l=!0,ql(t)):l=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,fu(t),o.updater=Is,t.stateNode=o,o._reactInternals=t,pa(t,r,e,n),t=ga(null,t,r,!0,l,n)):(t.tag=0,Se&&l&&lu(t),Xe(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Il(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=my(r),e=jt(r,e),o){case 0:t=ha(null,t,r,e,n);break e;case 1:t=Dc(null,t,r,e,n);break e;case 11:t=Ac(null,t,r,e,n);break e;case 14:t=Oc(null,t,r,jt(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:jt(r,o),ha(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),Dc(e,t,r,o,n);case 3:e:{if(Np(t),e===null)throw Error(M(387));r=t.pendingProps,l=t.memoizedState,o=l.element,tp(e,t),os(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=Ur(Error(M(423)),t),t=Mc(e,t,r,n,o);break e}else if(r!==o){o=Ur(Error(M(424)),t),t=Mc(e,t,r,n,o);break e}else for(ut=Tn(t.stateNode.containerInfo.firstChild),ct=t,Se=!0,Tt=null,n=qf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Vr(),r===o){t=sn(e,t,n);break e}Xe(e,t,r,n)}t=t.child}return t;case 5:return np(t),e===null&&ca(t),r=t.type,o=t.pendingProps,l=e!==null?e.memoizedProps:null,s=o.children,la(r,o)?s=null:l!==null&&la(r,l)&&(t.flags|=32),Tp(e,t),Xe(e,t,s,n),t.child;case 6:return e===null&&ca(t),null;case 13:return Rp(e,t,n);case 4:return pu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Hr(t,null,r,n):Xe(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),Ac(e,t,r,o,n);case 7:return Xe(e,t,t.pendingProps,n),t.child;case 8:return Xe(e,t,t.pendingProps.children,n),t.child;case 12:return Xe(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,ge(ns,r._currentValue),r._currentValue=s,l!==null)if(Pt(l.value,s)){if(l.children===o.children&&!ot.current){t=sn(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var i=l.dependencies;if(i!==null){s=l.child;for(var u=i.firstContext;u!==null;){if(u.context===r){if(l.tag===1){u=en(-1,n&-n),u.tag=2;var c=l.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),da(l.return,n,t),i.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,i=s.alternate,i!==null&&(i.lanes|=n),da(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}Xe(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Mr(t,n),o=bt(o),r=r(o),t.flags|=1,Xe(e,t,r,n),t.child;case 14:return r=t.type,o=jt(r,t.pendingProps),o=jt(r.type,o),Oc(e,t,r,o,n);case 15:return jp(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),Il(e,t),t.tag=1,lt(r)?(e=!0,ql(t)):e=!1,Mr(t,n),Sp(t,r,o),pa(t,r,o,n),ga(null,t,r,!0,e,n);case 19:return Pp(e,t,n);case 22:return Ep(e,t,n)}throw Error(M(156,t.tag))};function Up(e,t){return xf(e,t)}function py(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 vt(e,t,n,r){return new py(e,t,n,r)}function Nu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function my(e){if(typeof e=="function")return Nu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ga)return 11;if(e===Ya)return 14}return 2}function _n(e,t){var n=e.alternate;return n===null?(n=vt(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 Ol(e,t,n,r,o,l){var s=2;if(r=e,typeof e=="function")Nu(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case wr:return Jn(n.children,o,l,t);case Ua:s=8,o|=8;break;case Mi:return e=vt(12,n,t,o|2),e.elementType=Mi,e.lanes=l,e;case $i:return e=vt(13,n,t,o),e.elementType=$i,e.lanes=l,e;case zi:return e=vt(19,n,t,o),e.elementType=zi,e.lanes=l,e;case tf:return Os(n,o,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case qd:s=10;break e;case ef:s=9;break e;case Ga:s=11;break e;case Ya:s=14;break e;case yn:s=16,r=null;break e}throw Error(M(130,e==null?e:typeof e,""))}return t=vt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=l,t}function Jn(e,t,n,r){return e=vt(7,e,r,t),e.lanes=n,e}function Os(e,t,n,r){return e=vt(22,e,r,t),e.elementType=tf,e.lanes=n,e.stateNode={isHidden:!1},e}function yi(e,t,n){return e=vt(6,e,null,t),e.lanes=n,e}function vi(e,t,n){return t=vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function hy(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=Js(0),this.expirationTimes=Js(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Js(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Ru(e,t,n,r,o,l,s,i,u){return e=new hy(e,t,n,i,u),t===1?(t=1,l===!0&&(t|=8)):t=0,l=vt(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},fu(l),e}function gy(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:xr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Gp(e){if(!e)return An;e=e._reactInternals;e:{if(dr(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(lt(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(lt(n))return Gf(e,n,t)}return t}function Yp(e,t,n,r,o,l,s,i,u){return e=Ru(n,r,!0,e,o,l,s,i,u),e.context=Gp(null),n=e.current,r=Ze(),o=Pn(n),l=en(r,o),l.callback=t??null,Nn(n,l,o),e.current.lanes=o,Zo(e,o,r),st(e,r),e}function Ds(e,t,n,r){var o=t.current,l=Ze(),s=Pn(o);return n=Gp(n),t.context===null?t.context=n:t.pendingContext=n,t=en(l,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Nn(o,t,s),e!==null&&(Rt(e,o,s,l),Rl(e,o,s)),s}function fs(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 Gc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Pu(e,t){Gc(e,t),(e=e.alternate)&&Gc(e,t)}function yy(){return null}var Qp=typeof reportError=="function"?reportError:function(e){console.error(e)};function _u(e){this._internalRoot=e}Ms.prototype.render=_u.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(M(409));Ds(e,t,null,null)};Ms.prototype.unmount=_u.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;or(function(){Ds(null,e,null,null)}),t[on]=null}};function Ms(e){this._internalRoot=e}Ms.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ef();e={blockedOn:null,target:e,priority:t};for(var n=0;n<wn.length&&t!==0&&t<wn[n].priority;n++);wn.splice(n,0,e),n===0&&Nf(e)}};function Iu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function $s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Yc(){}function vy(e,t,n,r,o){if(o){if(typeof r=="function"){var l=r;r=function(){var c=fs(s);l.call(c)}}var s=Yp(t,r,e,0,null,!1,!1,"",Yc);return e._reactRootContainer=s,e[on]=s.current,zo(e.nodeType===8?e.parentNode:e),or(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var i=r;r=function(){var c=fs(u);i.call(c)}}var u=Ru(e,0,!1,null,null,!1,!1,"",Yc);return e._reactRootContainer=u,e[on]=u.current,zo(e.nodeType===8?e.parentNode:e),or(function(){Ds(t,u,n,r)}),u}function zs(e,t,n,r,o){var l=n._reactRootContainer;if(l){var s=l;if(typeof o=="function"){var i=o;o=function(){var u=fs(s);i.call(u)}}Ds(t,s,e,o)}else s=vy(n,t,e,o,r);return fs(s)}Cf=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=xo(t.pendingLanes);n!==0&&(Za(t,n|1),st(t,Re()),!(ue&6)&&(Gr=Re()+500,zn()))}break;case 13:or(function(){var r=ln(e,1);if(r!==null){var o=Ze();Rt(r,e,1,o)}}),Pu(e,1)}};Ja=function(e){if(e.tag===13){var t=ln(e,134217728);if(t!==null){var n=Ze();Rt(t,e,134217728,n)}Pu(e,134217728)}};jf=function(e){if(e.tag===13){var t=Pn(e),n=ln(e,t);if(n!==null){var r=Ze();Rt(n,e,t,r)}Pu(e,t)}};Ef=function(){return de};Tf=function(e,t){var n=de;try{return de=e,t()}finally{de=n}};Qi=function(e,t,n){switch(t){case"input":if(Wi(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=Rs(r);if(!o)throw Error(M(90));rf(r),Wi(r,o)}}}break;case"textarea":lf(e,n);break;case"select":t=n.value,t!=null&&Lr(e,!!n.multiple,t,!1)}};pf=ju;mf=or;var xy={usingClientEntryPoint:!1,Events:[qo,Cr,Rs,df,ff,ju]},ho={findFiberByHostInstance:Gn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},wy={bundleType:ho.bundleType,version:ho.version,rendererPackageName:ho.rendererPackageName,rendererConfig:ho.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:hn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=yf(e),e===null?null:e.stateNode},findFiberByHostInstance:ho.findFiberByHostInstance||yy,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 bl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bl.isDisabled&&bl.supportsFiber)try{js=bl.inject(wy),Ot=bl}catch{}}pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xy;pt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Iu(t))throw Error(M(200));return gy(e,t,null,n)};pt.createRoot=function(e,t){if(!Iu(e))throw Error(M(299));var n=!1,r="",o=Qp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Ru(e,1,!1,null,null,n,!1,r,o),e[on]=t.current,zo(e.nodeType===8?e.parentNode:e),new _u(t)};pt.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=yf(t),e=e===null?null:e.stateNode,e};pt.flushSync=function(e){return or(e)};pt.hydrate=function(e,t,n){if(!$s(t))throw Error(M(200));return zs(null,e,t,!0,n)};pt.hydrateRoot=function(e,t,n){if(!Iu(e))throw Error(M(405));var r=n!=null&&n.hydratedSources||null,o=!1,l="",s=Qp;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Yp(t,null,e,1,n??null,o,!1,l,s),e[on]=t.current,zo(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 Ms(t)};pt.render=function(e,t,n){if(!$s(t))throw Error(M(200));return zs(null,e,t,!1,n)};pt.unmountComponentAtNode=function(e){if(!$s(e))throw Error(M(40));return e._reactRootContainer?(or(function(){zs(null,null,e,!1,function(){e._reactRootContainer=null,e[on]=null})}),!0):!1};pt.unstable_batchedUpdates=ju;pt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!$s(n))throw Error(M(200));if(e==null||e._reactInternals===void 0)throw Error(M(38));return zs(e,t,n,!1,r)};pt.version="18.3.1-next-f1338f8080-20240426";function Xp(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xp)}catch(e){console.error(e)}}Xp(),Qd.exports=pt;var Lu=Qd.exports,Qc=Lu;Oi.createRoot=Qc.createRoot,Oi.hydrateRoot=Qc.hydrateRoot;const by="modulepreload",Sy=function(e){return"/panel/"+e},Xc={},ky=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),i=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(u=>{if(u=Sy(u),u in Xc)return;Xc[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const p=document.createElement("link");if(p.rel=c?"stylesheet":by,c||(p.as="script"),p.crossOrigin="",p.href=u,i&&p.setAttribute("nonce",i),document.head.appendChild(p),c)return new Promise((f,g)=>{p.addEventListener("load",f),p.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function l(s){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=s,window.dispatchEvent(i),!i.defaultPrevented)throw s}return o.then(s=>{for(const i of s||[])i.status==="rejected"&&l(i.reason);return t().catch(l)})},Au=["none","2xs","xs","sm","md","lg","xl","2xl"],Zp=["none","2xs","xs","sm"],Na=["0","1","2","4","8"],Ou=["none","2xs","xs","sm","md","lg"],ps=new Set(Au),ms=new Set(Zp),Yr=new Set(Na),hs=new Set(Ou),Cy=["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"],jy=["font-thin","font-extralight","font-light","font-normal","font-medium","font-semibold","font-bold","font-extrabold","font-black"],Ey=["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"],Ty=["tracking-tighter","tracking-tight","tracking-normal","tracking-wide","tracking-wider","tracking-widest"],Ny=Array.from({length:21},(e,t)=>`opacity-${t*5}`),Jp=["none","sm","","md","lg","xl","2xl","3xl","full"],Ra=Jp.map(e=>e?`rounded-${e}`:"rounded");function Ry(e){return Jp.map(t=>t?`${e}-${t}`:e)}const qp=["0","","2","3","4","5","6","8","10","12","16","20","24","32","40","48","56","64"],Py=["solid","dashed","dotted","double","hidden","none"],Pa=["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"],_y=["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],Iy=["50","100","200","300","400","500","600","700","800","900","950"];function J(){return e=>e===""?{props:{}}:null}function Ie(e,t){const n=new Set(t);return r=>n.has(r)?{props:{[e]:r}}:null}function ht(e="color"){return t=>t!==""?{props:{[e]:t}}:null}function Y(e,t="scale"){return n=>n!==""?{props:{[t]:n,scaleName:e}}:null}const Ly=["t","r","b","l","x","y"],xi=["t","r","b","l","x","y","s","e","bs","be"];function Ne(...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 Ht(e,t){return t.map(n=>({...n,section:e}))}function wi(e,t,n=Ly){return[...n.map(o=>({prefix:e+o,segment:t,canonical:e,extraProps:{side:o}})),{prefix:e,segment:t}]}function Ay(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:Ne(J(),t)}]}function Zc(e,t){const n=new Set(t);return{prefix:e,segment:J(),matches:r=>n.has(r)?{props:{value:r}}:null}}function Oy(e,t){for(const n of t){const{prefix:r,matches:o,segment:l,canonical:s,section:i,extraProps:u}=n;if(o){const p=o(e);if(!p)continue;const f={property:s??r,fullClass:e};if(i&&(f.section=i),u)for(const[g,x]of Object.entries(u))f[g]=x;for(const[g,x]of Object.entries(p.props))f[g]=x;return f}let c;if(e===r)c="";else if(e.startsWith(r+"-"))c=e.slice(r.length+1);else continue;const d=l(c);if(d){const p={property:s??r,fullClass:e};if(i&&(p.section=i),u)for(const[f,g]of Object.entries(u))p[f]=g;for(const[f,g]of Object.entries(d.props))p[f]=g;return p}return{property:s??r,fullClass:e,unknown:!0}}return null}function Dy(e,t){const n=e.trim().split(/\s+/).filter(Boolean),r=[];for(const o of n){const l=Oy(o,t);l&&r.push(l)}return r}const My=["solid","dashed","dotted","double","none","hidden"],$y=["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],zy=["xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"],Ky=["tighter","tight","normal","wide","wider","widest"],Fy=["left","center","right","justify","start","end"],Wy=["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"],Vy=["static","relative","absolute","fixed","sticky"],Hy=["t","tr","r","br","b","bl","l","tl"],By=["start","end","end-safe","center","center-safe","between","around","evenly","stretch","baseline","normal"],Uy=["start","end","end-safe","center","center-safe","baseline","baseline-last","stretch"],Gy=["normal","start","end","center","between","around","evenly","baseline","stretch"],Yy=["start","end","center","stretch"],Qy=["auto","start","end","center","stretch","baseline"],Xy=[...Ht("spacing",[...wi("m",Y("spacing"),xi),...wi("-m",Y("spacing"),xi),...wi("p",Y("spacing"),xi),F("gap-x",Y("spacing")),F("gap-y",Y("spacing")),F("gap",Y("spacing")),F("space-x-reverse",J()),F("space-y-reverse",J()),F("space-x",Y("spacing")),F("space-y",Y("spacing"))]),...Ht("sizing",[F("min-w",Y("spacing")),F("max-w",Y("spacing")),F("min-h",Y("spacing")),F("max-h",Y("spacing")),F("size",Y("spacing")),F("w",Y("spacing")),F("h",Y("spacing"))]),...Ht("typography",[F("font-sans",J()),F("font-serif",J()),F("font-mono",J()),F("font",Ie("scale",$y)),F("text-shadow",Ne(Ie("size",Ou),ht())),F("text",Ne(Ie("align",Fy),e=>zy.includes(e)?{props:{size:e,scaleName:"fontSize"}}:null,ht())),F("leading",Ne(Ie("scale",["none"]),Y("spacing"))),F("tracking",Ie("scale",Ky)),F("italic",J()),F("not-italic",J()),F("underline",J()),F("line-through",J()),F("overline",J()),F("no-underline",J()),F("uppercase",J()),F("lowercase",J()),F("capitalize",J()),F("normal-case",J()),F("truncate",J()),F("align-text-top",J()),F("align-text-bottom",J()),F("align-baseline",J()),F("align-top",J()),F("align-middle",J()),F("align-bottom",J()),F("align-sub",J()),F("align-super",J())]),...Ht("color",[F("bg-gradient-to",Ie("direction",Hy)),F("bg",ht()),F("from",ht()),F("via",ht()),F("to",ht()),F("ring",ht()),F("outline",Ne(Ie("style",["solid","dashed","dotted","double","none"]),ht())),F("fill",ht()),F("stroke",ht()),F("decoration",ht())]),...Ht("borders",[{prefix:"border-bs",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"bs"}},{prefix:"border-be",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"be"}},{prefix:"border-x",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"x"}},{prefix:"border-y",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"y"}},{prefix:"border-s",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"s"}},{prefix:"border-e",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"e"}},{prefix:"border-t",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"t"}},{prefix:"border-r",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"r"}},{prefix:"border-b",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"b"}},{prefix:"border-l",segment:Ne(J(),Y("borderWidth")),canonical:"border",extraProps:{side:"l"}},F("border",Ne(J(),Ie("style",My),e=>/^\d+$/.test(e)||e==="px"?{props:{scale:e,scaleName:"borderWidth"}}:null,ht())),...Ay("rounded",Y("borderRadius"))]),...Ht("effects",[F("opacity",Y("opacity")),F("shadow",Ie("size",Au))]),...Ht("layout",[Zc("display",Wy),Zc("position",Vy),{prefix:"inset-bs",segment:Y("spacing"),canonical:"inset",extraProps:{side:"bs"}},{prefix:"inset-be",segment:Y("spacing"),canonical:"inset",extraProps:{side:"be"}},{prefix:"inset-x",segment:Y("spacing"),canonical:"inset",extraProps:{side:"x"}},{prefix:"inset-y",segment:Y("spacing"),canonical:"inset",extraProps:{side:"y"}},{prefix:"inset-s",segment:Y("spacing"),canonical:"inset",extraProps:{side:"s"}},{prefix:"inset-e",segment:Y("spacing"),canonical:"inset",extraProps:{side:"e"}},{prefix:"top",segment:Y("spacing"),canonical:"inset",extraProps:{side:"top"}},{prefix:"right",segment:Y("spacing"),canonical:"inset",extraProps:{side:"right"}},{prefix:"bottom",segment:Y("spacing"),canonical:"inset",extraProps:{side:"bottom"}},{prefix:"left",segment:Y("spacing"),canonical:"inset",extraProps:{side:"left"}},{prefix:"start",segment:Y("spacing"),canonical:"inset",extraProps:{side:"start"}},{prefix:"end",segment:Y("spacing"),canonical:"inset",extraProps:{side:"end"}},F("inset",Y("spacing")),F("z",Y("zIndex"))]),...Ht("flexbox",[F("flex-row-reverse",J()),F("flex-col-reverse",J()),F("flex-wrap-reverse",J()),F("flex-row",J()),F("flex-col",J()),F("flex-wrap",J()),F("flex-nowrap",J()),F("flex",Ne(J(),Ie("value",["auto","initial","none"]),Y("number"))),F("grow",Ne(J(),Y("number"))),F("shrink",Ne(J(),Y("number"))),F("justify-items",Ie("value",Yy)),F("justify",Ie("value",By)),F("items",Ie("value",Uy)),F("content",Ie("value",Gy)),F("self",Ie("value",Qy)),F("basis",Y("spacing")),F("grid-cols",Ne(Ie("value",["none","subgrid"]),Y("gridCols"))),F("grid-rows",Ne(Ie("value",["none","subgrid"]),Y("gridRows"))),F("col-span",Y("colSpan")),F("row-span",Y("rowSpan")),F("order",Y("order"))]),...Ht("overflow",[F("overflow-x",Ie("value",["auto","hidden","clip","visible","scroll"])),F("overflow-y",Ie("value",["auto","hidden","clip","visible","scroll"])),F("overflow",Ie("value",["auto","hidden","clip","visible","scroll"]))])];let Gt=null,gs=!1;const Dl=[],Ml=[],$l=[];function Zy(){return window.location.origin.replace(/^http/,"ws")}function em(){if(Gt)return;const e=Zy();Gt=new WebSocket(e),Gt.addEventListener("open",()=>{gs=!0,_r({type:"REGISTER",role:"panel"});for(const t of Ml)t()}),Gt.addEventListener("close",()=>{gs=!1,Gt=null;for(const t of $l)t();setTimeout(()=>em(),3e3)}),Gt.addEventListener("message",t=>{try{const n=JSON.parse(t.data);for(const r of Dl)r(n)}catch(n){console.error("[tw-panel] Failed to parse message:",n)}}),Gt.addEventListener("error",t=>{console.error("[tw-panel] WebSocket error:",t)})}function _r(e){gs&&Gt&&Gt.send(JSON.stringify(e))}function he(e,t){_r({...t,to:e})}function tm(e){return Dl.push(e),()=>{const t=Dl.indexOf(e);t!==-1&&Dl.splice(t,1)}}function Jy(e){return Ml.push(e),()=>{const t=Ml.indexOf(e);t!==-1&&Ml.splice(t,1)}}function qy(e){return $l.push(e),()=>{const t=$l.indexOf(e);t!==-1&&$l.splice(t,1)}}function ev(){return gs}const nm=[{name:"popover",label:"Popover",icon:a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[a.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1.5",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.3"}),a.jsx("rect",{x:"4",y:"4",width:"8",height:"6",rx:"1",fill:"currentColor"})]})},{name:"sidebar",label:"Sidebar",icon:a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[a.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1.5",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.3"}),a.jsx("rect",{x:"9",y:"1",width:"6",height:"14",rx:"1.5",fill:"currentColor",opacity:"0.85"})]})},{name:"modal",label:"Modal",icon:a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[a.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1.5",fill:"currentColor",opacity:"0.12"}),a.jsx("rect",{x:"3",y:"4",width:"10",height:"8",rx:"1",fill:"currentColor",opacity:"0.9"})]})},{name:"popup",label:"Popup",icon:a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[a.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1.5",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.3"}),a.jsx("rect",{x:"8",y:"8",width:"7",height:"7",rx:"1",fill:"currentColor",opacity:"0.85"})]})}],rm="tw-panel-container";function tv(){try{const e=localStorage.getItem(rm);if(e&&nm.some(t=>t.name===e))return e}catch{}return"popover"}function Jc(){const[e,t]=w.useState(tv),[n,r]=w.useState(!1),o=w.useRef(null);w.useEffect(()=>{function s(i){o.current&&!o.current.contains(i.target)&&r(!1)}return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]);function l(s){if(s!==e){try{localStorage.setItem(rm,s)}catch{}t(s),he("overlay",{type:"SWITCH_CONTAINER",container:s})}r(!1)}return a.jsxs("div",{ref:o,className:"relative",children:[a.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:a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:".5",y:"1.5",width:"15",height:"13",rx:"1.5",ry:"1.5"}),a.jsx("line",{x1:"8.5",y1:"1.5",x2:"8.5",y2:"14.5"}),a.jsx("line",{x1:"11",y1:"5",x2:"13",y2:"5"}),a.jsx("line",{x1:"11",y1:"8",x2:"13",y2:"8"}),a.jsx("line",{x1:"11",y1:"11",x2:"13",y2:"11"})]})}),n&&a.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:[a.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.8px] text-bv-muted px-2 pt-1 pb-1.5",children:"Container"}),nm.map(s=>a.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)),a.jsx("div",{className:"h-px bg-[#4f4f4f] mx-1 my-1"}),a.jsxs("button",{onClick:()=>{r(!1),he("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:[a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[a.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),"Close panel"]})]})]})}function nv(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 rv(e,t=!0){const[n,r]=w.useState(null),[o,l]=w.useState(!0),[s,i]=w.useState({}),[u,c]=w.useState({}),d=w.useRef(0),p=w.useRef(null),f=w.useRef(!1);return w.useEffect(()=>{var h;if(!t)return;if(e.length===0){l(!1);return}f.current=!1,d.current=0;const g=document.createElement("iframe");Object.assign(g.style,{position:"fixed",left:"-99999px",top:"-99999px",width:"800px",height:"600px",visibility:"hidden",pointerEvents:"none",border:"none"}),p.current=g,document.body.appendChild(g);function x(y){if(y>=e.length){f.current||(f.current=!0,r(e[0]),i({}),c({}),l(!1));return}d.current=y,console.log(`[useStoryProbe] loading iframe: /storybook/iframe.html?id=${e[y].id}`),g.src=`/storybook/iframe.html?id=${e[y].id}&viewMode=story`}let b=null;function S(y){var k,j,T,$;if(f.current)return;let v=y.data;if(typeof v=="string")try{v=JSON.parse(v)}catch{return}const C=e[d.current];if((v==null?void 0:v.key)==="storybook-channel"&&((k=v==null?void 0:v.event)==null?void 0:k.type)==="storyPrepared"&&(($=(T=(j=v==null?void 0:v.event)==null?void 0:j.args)==null?void 0:T[0])==null?void 0:$.id)===(C==null?void 0:C.id)){const _=v.event.args[0].argTypes??{},W=v.event.args[0].initialArgs??v.event.args[0].args??{};if(Object.keys(_).length>0)f.current=!0,r(C),i(nv(_)),c(W),l(!1);else{b&&clearTimeout(b);const O=d.current+1;b=setTimeout(()=>x(O),50)}}}window.addEventListener("message",S);function m(){b&&clearTimeout(b),b=setTimeout(()=>{!f.current&&d.current<e.length&&(x(d.current+1),m())},5e3)}return g.addEventListener("load",()=>{m()}),console.log(`[useStoryProbe] starting probe for ${(h=e[0])==null?void 0:h.id} (${e.length} stories)`),x(0),()=>{f.current=!0,window.removeEventListener("message",S),b&&clearTimeout(b),g.remove(),p.current=null}},[e,t]),{bestStory:n,probing:o,argTypes:s,defaultArgs:u}}let ov=2,ys=0;const om=[];function lv(){return new Promise(e=>{const t=()=>{ys<ov?(ys++,e(sv)):om.push(t)};t()})}function sv(){ys=Math.max(0,ys-1);const e=om.shift();e==null||e()}function iv(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 lv().then(i=>{if(s){i();return}r.current=i,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 av(e,t={},n="/storybook"){const r=`${n}/iframe.html?id=${encodeURIComponent(e)}&viewMode=story`,o=Object.entries(t).filter(([,s])=>s!=null);if(o.length===0)return r;const l=o.map(([s,i])=>`${encodeURIComponent(s)}:${encodeURIComponent(String(i))}`).join(";");return`${r}&args=${l}`}function uv({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 a.jsx("div",{className:"flex flex-col gap-1.5 px-1",children:r.map(([l,s])=>a.jsx(cv,{name:l,argType:s,value:t[l],onChange:i=>o(l,i)},l))})}function cv({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 a.jsxs("label",{className:"flex items-center gap-2 text-[10px]",children:[a.jsx("span",{className:"text-bv-text-mid font-mono min-w-[60px] shrink-0",children:e}),o==="select"&&t.options?a.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=>a.jsx("option",{value:l,children:l},l))}):o==="boolean"?a.jsx("input",{type:"checkbox",checked:!!n,onChange:l=>r(l.target.checked),className:"accent-bv-teal"}):o==="number"?a.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))}):a.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)})]})}const dv=["display","position","float","clear","width","height","min-width","min-height","max-width","max-height","padding-top","padding-right","padding-bottom","padding-left","margin-top","margin-right","margin-bottom","margin-left","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color","box-sizing","background-color","background-image","background-size","background-position","background-repeat","color","font-family","font-size","font-weight","font-style","border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius","box-shadow","opacity","text-decoration","text-transform","line-height","letter-spacing","word-spacing","text-align"],lm=["color","font-family","font-size","font-weight","font-style","line-height","background-color","background-image","border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius","padding-top","padding-right","padding-bottom","padding-left","margin-top","margin-right","margin-bottom","margin-left","display","box-shadow","text-decoration","text-transform","letter-spacing","text-align","opacity","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color"];function fv(e){const t=(e.ownerDocument.defaultView??window).getComputedStyle(e),n={};for(const r of dv)n[r]=t.getPropertyValue(r);return n}function pv(e,t,n){for(const[r,o]of Object.entries(t))if(r!=="height"){if(r==="width"&&n!=null){const l=parseFloat(o);if(!isNaN(l)&&Math.abs(l-n)<1)continue}e.style.setProperty(r,o)}}function sm(e,t){if(!e||!t)return;const n=(e.ownerDocument.defaultView??window).getComputedStyle(e),r=t;if(r.style)for(const i of lm)r.style.setProperty(i,n.getPropertyValue(i));const o=e.children,l=t.children,s=Math.min(o.length,l.length);for(let i=0;i<s;i++)sm(o[i],l[i])}const im=lm;function am(e,t){const n=e.children,r=t.children,o=Math.min(n.length,r.length);for(let l=0;l<o;l++){const s=n[l],i=r[l],u=(s.ownerDocument.defaultView??window).getComputedStyle(s);if(i.style)for(const c of im)i.style.setProperty(c,u.getPropertyValue(c));am(s,i)}}class um extends HTMLElement{constructor(){super();_t(this,"shadow");_t(this,"ghostEl");_t(this,"hiddenIframe");_t(this,"loadTimeoutId",null);_t(this,"hasLoaded",!1);_t(this,"_loadedDispatched",!1);_t(this,"observer",null);_t(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=`
|
|
41
41
|
iframe {
|
|
42
42
|
position: absolute; inset: 0;
|
|
43
43
|
width: 100%; height: 100%;
|
|
@@ -50,13 +50,13 @@ Error generating stack: `+l.message+`
|
|
|
50
50
|
opacity: 1;
|
|
51
51
|
pointer-events: auto;
|
|
52
52
|
}
|
|
53
|
-
`,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.triggerLoad()}disconnectedCallback(){var n;(n=this.observer)==null||n.disconnect(),this.observer=null,this.hiddenIframe.remove()}attributeChangedCallback(){this.isConnected&&this.triggerLoad()}triggerLoad(){var o;(o=this.observer)==null||o.disconnect(),this.observer=null,this.loadTimeoutId&&clearTimeout(this.loadTimeoutId),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(){this.loadTimeoutId&&(clearTimeout(this.loadTimeoutId),this.loadTimeoutId=null),this.hasLoaded=!0;const n=this.hiddenIframe.contentDocument;if(!n)return;const r=n.createElement("style");if(r.textContent="body,html{margin:0!important;padding:0!important}",n.head.appendChild(r),this.getAttribute("srcdoc")!=null){this.extractAndApply(n);return}this.waitForStoryContent(n)}updateArgs(n,r){const o=this.hiddenIframe.contentWindow;o&&o.postMessage(JSON.stringify({key:"storybook-channel",event:{type:"updateStoryArgs",args:[{storyId:n,updatedArgs:r}]}}),"*")}waitForStoryContent(n){var a;(a=this.observer)==null||a.disconnect();let r=!1,o=null;const l=()=>this.findStoryRoot(n)?(r=!0,this.extractAndApply(n),!0):!1;l();const s=n.querySelector("#storybook-root")??n.body;if(!s)return;const i=new MutationObserver(()=>{const c=this.findStoryRoot(n);if(!r)l();else{o&&clearTimeout(o);const d=c?parseFloat((c.ownerDocument.defaultView??window).getComputedStyle(c).transitionDuration)*1e3:0,p=Math.ceil(d)+50;o=setTimeout(()=>l(),p)}});this.observer=i,i.observe(s,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),setTimeout(()=>{!r&&this.observer===i&&(this.observer.disconnect(),this.observer=null,this.reportError("Story did not render — component may not exist or Storybook story file has an error"))},2e4)}findStoryRoot(n){const r=n.querySelector("#storybook-root");if(r){for(const o of r.children)if(!o.classList.contains("sb-loader"))return o;return null}return n.body.firstElementChild}getComponentHtml(){const n=this.hiddenIframe.contentDocument;if(!n)return"";const r=this.findStoryRoot(n);if(!r)return this.ghostEl.innerHTML;const o=r.cloneNode(!0),l=getComputedStyle(r);for(const s of sm)o.style.setProperty(s,l.getPropertyValue(s));return im(r,o),o.outerHTML}extractAndApply(n){const r=this.findStoryRoot(n);if(r&&r.ownerDocument.defaultView,!r)return;const o=this.clientWidth||800;this.hiddenIframe.style.width=o+"px";const l=dv(r);fv(this,l,o),this.ghostEl.innerHTML=r.innerHTML;const s=r.children,i=this.ghostEl.children,a=Math.min(s.length,i.length);for(let p=0;p<a;p++)lm(s[p],i[p]);this._loadedDispatched||(this._loadedDispatched=!0,this.dispatchEvent(new CustomEvent("iframe-loaded")));const c=this.getComponentHtml(),d=getComputedStyle(n.body).backgroundColor;this.dispatchEvent(new CustomEvent("ghost-extracted",{detail:{ghostHtml:c,hostStyles:l,storyBackground:d}}))}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}}_t(am,"observedAttributes",["src","srcdoc"]);customElements.get("adaptive-iframe")||customElements.define("adaptive-iframe",am);function pv({group:e,isArmed:t,onArm:n,onDisarm:r,cachedGhostHtml:o,cachedHostStyles:l,cachedStoryBackground:s,onGhostExtracted:i}){const[a,c]=w.useState(!1),d=w.useRef(null),[p,f]=w.useState(!1),[g,x]=w.useState(s),[b,S]=w.useState(!1),[m,h]=w.useState(!1);w.useEffect(()=>{const N=d.current;if(!N)return;const z=new IntersectionObserver(([V])=>{V.isIntersecting&&(c(!0),z.disconnect())},{rootMargin:"200px"});return z.observe(N),()=>z.disconnect()},[]);const y=a&&(!o||m||b);console.log(`[ComponentGroupItem] ${e.name} isVisible=${a} cachedGhostHtml=${!!o} probeEnabled=${y}`);const{bestStory:v,probing:C,argTypes:k,defaultArgs:j}=nv(e.stories,y),[T,$]=w.useState({}),[_,W]=w.useState(null),O=w.useRef(null),P=w.useRef(!1),A=w.useRef(null),{canLoad:X,releaseSlot:H}=sv(a&&!!v&&!C&&(!o||b));w.useEffect(()=>{!C&&j&&$(j)},[C,j]),w.useEffect(()=>{var me,be;const N=ae=>{W(ae.detail.message),H()},z=()=>{if(f(!0),H(),A.current){const ae=O.current;typeof(ae==null?void 0:ae.updateArgs)=="function"&&v&&ae.updateArgs(v.id,A.current),A.current=null}},V=O.current;return(me=V==null?void 0:V.addEventListener)==null||me.call(V,"iframe-error",N),(be=V==null?void 0:V.addEventListener)==null||be.call(V,"iframe-loaded",z),()=>{var ae,se;(ae=V==null?void 0:V.removeEventListener)==null||ae.call(V,"iframe-error",N),(se=V==null?void 0:V.removeEventListener)==null||se.call(V,"iframe-loaded",z)}},[v,H]),w.useEffect(()=>{var V;if(!v)return;const N=me=>{const{ghostHtml:be,hostStyles:ae,storyBackground:se}=me.detail;se&&x(se),i==null||i({storyId:v.id,args:{},ghostHtml:be,hostStyles:ae,storyBackground:se,componentName:e.name,componentPath:e.componentPath})},z=O.current;return(V=z==null?void 0:z.addEventListener)==null||V.call(z,"ghost-extracted",N),()=>{var me;(me=z==null?void 0:z.removeEventListener)==null||me.call(z,"ghost-extracted",N)}},[v,e.name,e.componentPath,i]),w.useEffect(()=>{if(!O.current||!v||!X||P.current)return;P.current=!0;const N=iv(v.id,{});O.current.setAttribute("src",N)},[v,X]);const ne=w.useCallback(N=>{if($(N),!O.current||!v||!p){A.current=N,S(!0);return}const z=O.current;typeof z.updateArgs=="function"&&z.updateArgs(v.id,N)},[v,p]),R=w.useCallback(N=>{var me;if(N.stopPropagation(),t){r();return}const z=O.current,V=((me=z==null?void 0:z.getComponentHtml)==null?void 0:me.call(z))??o??"";if(n(V,T),S(!0),i&&V&&v){const be=l??{};i({storyId:v.id,args:T,ghostHtml:V,hostStyles:be,storyBackground:g,componentName:e.name,componentPath:e.componentPath})}},[t,n,r,T,o,l,v,e.name,e.componentPath,i]),L=Object.keys(k).length>0||Object.keys(e.argTypes??{}).length>0||!!o;return u.jsxs("li",{ref:d,className:`group rounded border overflow-hidden cursor-pointer transition-[border-color,box-shadow] ${t?"border-bv-teal shadow-[0_0_0_2px_var(--color-bv-teal),0_0_12px_rgba(0,132,139,0.2)]":"border-bv-border hover:border-[#555]"}`,onClick:R,children:[u.jsxs("div",{className:`flex items-center justify-center min-h-14 overflow-hidden ${t?"bg-[rgba(0,132,139,0.06)]":""}`,style:!t&&g?{backgroundColor:g}:void 0,children:[!a&&u.jsx("span",{className:"text-[10px] text-bv-muted",children:" "}),a&&_&&u.jsx("span",{className:"text-[10px] text-bv-orange px-2 py-1 text-center leading-tight",children:_}),a&&!_&&!o&&!p&&(C||!!v)&&u.jsx("span",{className:"text-[10px] text-bv-muted",children:"Loading preview…"}),a&&!_&&o&&!p&&u.jsx("div",{className:"pointer-events-none",dangerouslySetInnerHTML:{__html:o}}),a&&!_&&!C&&v&&u.jsx("adaptive-iframe",{ref:O,style:{pointerEvents:"none"}}),a&&!_&&!C&&!v&&!o&&u.jsx("span",{className:"text-[10px] text-bv-muted",children:"No stories found."})]}),u.jsxs("div",{className:"flex items-center justify-between px-2.5 py-1.5 border-t border-bv-border bg-bv-bg",children:[t?u.jsx("span",{className:"text-[11px] font-medium text-bv-teal",children:"Click the page to place"}):e.stories[0]?u.jsx("a",{href:`/storybook/?path=/story/${e.stories[0].id}`,target:"_blank",rel:"noopener noreferrer",className:"text-[11px] font-semibold text-bv-text hover:text-bv-orange hover:underline transition-colors",onClick:N=>{N.stopPropagation()},children:e.name}):u.jsx("span",{className:"text-[11px] font-semibold text-bv-text",children:e.name}),L&&u.jsx("button",{className:`w-5.5 h-5.5 rounded flex items-center justify-center transition-colors opacity-0 group-hover:opacity-100 ${m?"opacity-100 bg-bv-surface-hi text-bv-text":"text-bv-muted hover:bg-bv-surface-hi hover:text-bv-text"}`,title:"Customize props",onClick:N=>{N.stopPropagation(),h(z=>!z)},children:u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[u.jsx("circle",{cx:"12",cy:"12",r:"3"}),u.jsx("path",{d:"M12 1v2m0 18v2M4.22 4.22l1.42 1.42m12.72 12.72 1.42 1.42M1 12h2m18 0h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"})]})})]}),m&&L&&u.jsxs("div",{className:"px-2.5 py-2 border-t border-bv-border bg-bv-surface",onClick:N=>N.stopPropagation(),children:[u.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-wider text-bv-muted mb-1.5",children:"Props"}),u.jsx(av,{argTypes:Object.keys(k).length>0?k:e.argTypes??{},args:T,onArgsChange:ne})]})]})}function um(e){return!e||Object.keys(e).length===0?"":JSON.stringify(e,Object.keys(e).sort())}function qc(e,t){const n=um(t);return n?`${e}::${n}`:e}function mv(){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 i=new Map;for(const a of s){const c=a.argsHash?`${a.storyId}::${a.argsHash}`:a.storyId;i.set(c,a)}n.current=i,t(!0)}).catch(()=>{l||t(!0)}),()=>{l=!0}},[]);const r=w.useCallback((l,s)=>{const i=qc(l,s),a=n.current.get(i);return a?{ghostHtml:a.ghostHtml,hostStyles:a.hostStyles,storyBackground:a.storyBackground}:null},[]),o=w.useCallback(l=>{const s=qc(l.storyId,l.args),i=n.current.has(s);n.current.set(s,{storyId:l.storyId,argsHash:um(l.args),ghostHtml:l.ghostHtml,hostStyles:l.hostStyles,storyBackground:l.storyBackground,componentName:l.componentName,componentPath:l.componentPath,extractedAt:Date.now()}),!i&&fetch("/api/ghost-cache",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({storyId:l.storyId,args:l.args,ghostHtml:l.ghostHtml,hostStyles:l.hostStyles,storyBackground:l.storyBackground,componentName:l.componentName,componentPath:l.componentPath})}).catch(()=>{})},[]);return{getCachedGhost:r,submitToCache:o,loaded:e}}function ed(){const{groups:e,loading:t,error:n}=hv(),[r,o]=w.useState(null),{getCachedGhost:l,submitToCache:s}=mv(),i=w.useCallback((c,d,p)=>{var f;o(c.name),he("overlay",{type:"COMPONENT_ARM",componentName:c.name,storyId:((f=c.stories[0])==null?void 0:f.id)??"",ghostHtml:d,componentPath:c.componentPath,args:p})},[]),a=w.useCallback(()=>{o(null),he("overlay",{type:"COMPONENT_DISARM"})},[]);return w.useEffect(()=>em(c=>{c.type==="COMPONENT_DISARMED"&&o(null)}),[]),w.useEffect(()=>{if(!r)return;const c=()=>{o(null),he("overlay",{type:"COMPONENT_DISARM"})};return document.addEventListener("click",c),()=>document.removeEventListener("click",c)},[r]),u.jsx("div",{className:"p-3 flex flex-col gap-3",children:u.jsxs("div",{className:"flex flex-col gap-1.5",children:[t&&u.jsx("div",{className:"text-[11px] text-bv-muted",children:"Loading components…"}),!t&&n&&u.jsxs("div",{className:"text-[11px] text-bv-text-mid leading-relaxed",children:[u.jsx("span",{className:"block mb-0.5",children:"Storybook not detected."}),u.jsx("span",{className:"text-bv-muted",children:"Start Storybook on port 6006–6010 to browse components."})]}),!t&&!n&&e.length===0&&u.jsx("div",{className:"text-[11px] text-bv-muted",children:"No stories found."}),!t&&!n&&e.length>0&&u.jsx("ul",{className:"flex flex-col gap-2",children:e.map(c=>{var f;const d=(f=c.stories[0])==null?void 0:f.id,p=d?l(d):null;return u.jsx(pv,{group:c,isArmed:r===c.name,onArm:(g,x)=>i(c,g,x),onDisarm:a,cachedGhostHtml:p==null?void 0:p.ghostHtml,cachedHostStyles:p==null?void 0:p.hostStyles,cachedStoryBackground:p==null?void 0:p.storyBackground,onGhostExtracted:s},c.name)})})]})})}function hv(){const[e,t]=w.useState([]),[n,r]=w.useState(!0),[o,l]=w.useState(!1);return w.useEffect(()=>{let s=!1;return(async()=>{var i,a;try{const c=await fetch("/api/storybook-data").then(p=>p.json());if(!c.available){s||(l(!0),r(!1));return}const d=Object.values(((i=c.index)==null?void 0:i.entries)??((a=c.index)==null?void 0:a.stories)??{});s||t(gv(d,c.argTypes??{}))}catch{s||l(!0)}finally{s||r(!1)}})(),()=>{s=!0}},[]),{groups:e,loading:n,error:o}}function gv(e,t={}){const n=new Map;for(const r of e){if(r.type==="docs"||r.id.endsWith("--docs"))continue;const o=r.title.split("/").at(-1)??r.title;n.has(o)||n.set(o,[]),n.get(o).push(r)}return Array.from(n.entries()).map(([r,o])=>{var l;return{name:r,stories:o,argTypes:t[r]??yv(o),componentPath:(l=o[0])==null?void 0:l.componentPath}})}function yv(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 bi=typeof window<"u"?window.SpeechRecognition??window.webkitSpeechRecognition??null:null;function td({draft:e,currentElementKey:t,onAddMessage:n,onDiscard:r}){const[o,l]=w.useState(""),[s,i]=w.useState(!1),[a,c]=w.useState(null),d=w.useRef(null),p=w.useRef(null),f=w.useRef("");w.useEffect(()=>{var h;(h=d.current)==null||h.focus()},[]);const g=e.filter(h=>h.kind==="message"),x=!!o.trim()&&!!t;function b(){var y;const h=o.trim();!h||!t||(n(h,t),l(""),(y=d.current)==null||y.focus())}function S(){var y;if(s){(y=p.current)==null||y.stop();return}if(!bi)return;f.current=o;const h=new bi;h.continuous=!1,h.interimResults=!0,h.lang="en-US",h.onresult=v=>{let C="";for(let j=0;j<v.results.length;j++)C+=v.results[j][0].transcript;const k=f.current.trimEnd();l(k?`${k} ${C}`:C)},h.onend=()=>i(!1),h.onerror=v=>{console.error("[mic] SpeechRecognition error:",v.error,v.message),i(!1),v.error==="not-allowed"&&c("Microphone blocked — allow access in your browser's address bar, then reload.")},p.current=h;try{h.start(),i(!0),console.log("[mic] recognition started")}catch(v){console.error("[mic] recognition.start() threw:",v)}}function m(h){(h.metaKey||h.ctrlKey)&&h.key==="Enter"&&(h.preventDefault(),b())}return u.jsxs("div",{className:"p-3 flex flex-col gap-3",children:[u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx("textarea",{ref:d,className:"w-full min-h-[80px] p-2 bg-bv-bg border border-bv-border rounded text-[13px] font-[family-name:var(--font-ui)] text-bv-text placeholder:text-bv-muted resize-y focus:outline-none focus:border-bv-teal",placeholder:t?"Add context for the AI agent…":"Select an element to add contextual message…",value:o,onChange:h=>l(h.target.value),onKeyDown:m,disabled:!t}),u.jsxs("div",{className:"flex items-center justify-between",children:[bi?u.jsx("button",{type:"button",title:s?"Stop recording":"Record voice message",onClick:S,className:`flex items-center justify-center w-7 h-7 rounded-full border-none cursor-pointer transition-colors ${s?"bg-bv-orange text-white":a?"bg-bv-surface text-bv-orange hover:bg-bv-surface-hi":"bg-bv-surface text-bv-text-mid hover:text-bv-teal hover:bg-bv-surface-hi"}`,children:s?u.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-white animate-pulse"}):u.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor",children:u.jsx("path",{d:"M12 1a4 4 0 0 1 4 4v7a4 4 0 0 1-8 0V5a4 4 0 0 1 4-4zm-1.5 4v7a1.5 1.5 0 0 0 3 0V5a1.5 1.5 0 0 0-3 0zM6 11a1 1 0 0 1 1 1 5 5 0 0 0 10 0 1 1 0 1 1 2 0 7 7 0 0 1-6 6.93V21h2a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2h2v-2.07A7 7 0 0 1 5 12a1 1 0 0 1 1-1z"})})}):u.jsx("span",{}),u.jsx("button",{type:"button",className:"px-3 py-1 text-[11px] font-semibold rounded bg-bv-teal text-white border-none cursor-pointer hover:opacity-90 transition-opacity disabled:opacity-50 disabled:cursor-not-allowed",disabled:!x,onClick:b,children:"Add Message"})]}),a&&u.jsx("p",{className:"text-[11px] text-bv-orange mt-1",children:a})]}),g.length>0&&u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"w-[5px] h-[5px] rounded-full bg-bv-teal opacity-50 shrink-0"}),u.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-[1px] text-bv-text-mid",children:"Staged Messages"})]}),g.map(h=>{var y;return u.jsxs("div",{className:"flex items-start gap-2 p-2 bg-bv-surface rounded border border-bv-border group",children:[u.jsx("span",{className:"text-[12px] shrink-0 mt-0.5",children:"💬"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"text-[12px] font-[family-name:var(--font-ui)] text-bv-text break-words",children:['"',h.message,'"']}),h.elementKey&&u.jsx("div",{className:"text-[11px] text-bv-text-mid mt-0.5",children:((y=h.component)==null?void 0:y.name)||h.elementKey})]}),u.jsx("button",{type:"button",className:"shrink-0 text-[10px] px-1 py-0.5 rounded border-none cursor-pointer bg-transparent text-bv-muted hover:text-bv-orange transition-colors opacity-0 group-hover:opacity-100",onClick:()=>r(h.id),title:"Discard",children:"✕"})]},h.id)})]})]})}function vv(e){var c,d;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&&((d=e.parentComponent)==null?void 0:d.name)||null,l=o||e.elementKey||null,s=o?`<${l}>`:l,i="targetPatchId"in e&&!!e.targetPatchId,a=s&&i?`new ${s}`:s;switch(r){case"after":return a?`Appended ${n} after ${a}`:`Appended ${n}`;case"before":return a?`Prepended ${n} before ${a}`:`Prepended ${n}`;case"last-child":return a?`Inserted ${n} bottom of ${a}`:`Inserted ${n}`;case"first-child":return a?`Inserted ${n} top of ${a}`:`Inserted ${n}`;default:return a?`Inserted ${n} in ${a}`:`Inserted ${n}`}}function Sl({label:e,count:t,items:n,activeColor:r,dotColor:o,onCommit:l,onDiscard:s,onCommitAll:i,onDiscardAll:a}){const[c,d]=w.useState(!1),p=w.useRef(null),f=w.useRef(null),[g,x]=w.useState(void 0);w.useEffect(()=>{if(!c||!f.current)return;const h=f.current.getBoundingClientRect(),y=220,v=window.innerWidth,C=4;let k=h.left+h.width/2-y/2;k=Math.max(C,Math.min(k,v-y-C)),x(k-h.left)},[c]),w.useEffect(()=>{if(!c)return;function m(h){p.current&&!p.current.contains(h.target)&&d(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[c]),w.useEffect(()=>{if(!c)return;function m(h){h.key==="Escape"&&d(!1)}return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[c]);const b=t>0,S=l||s||i||a;return u.jsxs("div",{ref:p,className:"relative",children:[u.jsxs("button",{ref:f,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&&d(!c),disabled:!b,type:"button",children:[o&&u.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${o}`}),t," ",e]}),c&&u.jsxs("div",{className:"absolute bottom-full mb-1 min-w-[220px] bg-bv-surface border border-bv-border rounded-lg shadow-lg overflow-hidden flex flex-col z-[9999]",style:g!==void 0?{left:`${g}px`}:void 0,children:[u.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,")"]}),u.jsx("div",{className:"flex-1 overflow-auto",children:n.length===0?u.jsx("div",{className:"px-3 py-2 text-[11px] text-bv-muted italic",children:"No patches"}):n.map(m=>{var C,k;const h="kind"in m&&m.kind==="message",y="kind"in m&&m.kind==="design",v="kind"in m&&m.kind==="component-drop";return u.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:[u.jsxs("div",{className:"flex-1 min-w-0",children:[!h&&!y&&!v&&((C=m.component)==null?void 0:C.name)&&u.jsx("div",{className:"text-[10px] text-bv-muted truncate",children:m.component.name}),v?u.jsx("div",{className:"text-[11px] text-bv-text truncate",children:vv(m)}):y?u.jsxs("div",{className:"text-[11px] text-bv-text",children:[u.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[u.jsx("span",{children:"✏️"}),u.jsxs("span",{className:"truncate",children:["Drawing",(k=m.component)!=null&&k.name?` in ${m.component.name}`:""]})]}),"image"in m&&m.image&&u.jsx("img",{src:m.image,alt:"Design drawing",className:"w-full max-h-16 object-contain rounded border border-bv-border bg-white"})]}):h?u.jsxs("div",{className:"text-[11px] text-bv-text truncate",children:[u.jsx("span",{className:"mr-1",children:"💬"}),'"',"message"in m&&m.message||"",'"']}):u.jsx("div",{className:"text-[11px] font-mono text-bv-text truncate",children:m.originalClass?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"line-through text-bv-muted",children:m.originalClass})," → ",u.jsx("span",{className:"text-bv-teal",children:m.newClass})]}):u.jsxs("span",{className:"text-bv-teal",children:["+",m.newClass]})})]}),(l||s)&&u.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[l&&u.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:j=>{j.stopPropagation(),l(m.id)},title:"Commit to Agent",type:"button",children:"✓"}),s&&u.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:j=>{j.stopPropagation(),s(m.id)},title:"Discard",type:"button",children:"✕"})]})]},m.id)})}),S&&n.length>0&&(i||a)&&u.jsxs("div",{className:"flex gap-2 px-3 py-1.5 border-t border-bv-border",children:[i&&u.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:()=>{i(),d(!1)},type:"button",children:"Commit All"}),a&&u.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:()=>{a(),d(!1)},type:"button",children:"Discard All"})]})]})]})}function nd({tabs:e,activeTab:t,onTabChange:n}){const[r,o]=w.useState(null);return u.jsx("div",{className:"relative flex border-b border-bv-border px-3",children:e.map(l=>{const s=l.id===t,i=l.disabled===!0;return u.jsxs("div",{className:"relative",onMouseEnter:()=>i&&l.tooltip&&o(l.id),onMouseLeave:()=>o(null),children:[u.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 ${i?"text-bv-muted cursor-not-allowed":s?"text-bv-text":"text-bv-text-mid hover:text-bv-text"}`,disabled:i,onClick:()=>!i&&n(l.id),"aria-selected":s,role:"tab",children:[l.label,s&&u.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-bv-teal"})]}),r===l.id&&l.tooltip&&u.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 xv(){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,i]=w.useState(!1),a=w.useRef(e);a.current=e;const c=w.useRef(o);c.current=o;const d=w.useCallback((j,T)=>{he("overlay",{type:"PATCH_PREVIEW",oldClass:j,newClass:T})},[]),p=w.useCallback(j=>{he("overlay",{type:"PATCH_PREVIEW_BATCH",pairs:j})},[]),f=w.useCallback(()=>{he("overlay",{type:"PATCH_REVERT"})},[]),g=w.useCallback((j,T,$,_)=>{if(_===$){t(O=>{const P=O.find(A=>A.kind==="class-change"&&A.elementKey===j&&A.property===T);return P&&P.kind==="class-change"&&P.newClass!==$?he("overlay",{type:"PATCH_REVERT_STAGED",oldClass:P.newClass,newClass:$}):he("overlay",{type:"PATCH_REVERT"}),O.filter(A=>!(A.kind==="class-change"&&A.elementKey===j&&A.property===T))});return}const W=crypto.randomUUID();t(O=>{const P=O.filter(X=>!(X.kind==="class-change"&&X.elementKey===j&&X.property===T)),A={id:W,kind:"class-change",elementKey:j,status:"staged",originalClass:$,newClass:_,property:T,timestamp:new Date().toISOString()};return[...P,A]}),he("overlay",{type:"PATCH_STAGE",id:W,oldClass:$,newClass:_,property:T})},[]),x=w.useCallback((j,T,$)=>{const _=crypto.randomUUID(),W=$?{name:$}:void 0;t(O=>{const P={id:_,kind:"message",elementKey:T,status:"staged",originalClass:"",newClass:"",property:"",timestamp:new Date().toISOString(),message:j,component:W};return[...O,P]}),_r(W?{type:"MESSAGE_STAGE",id:_,message:j,elementKey:T,component:W}:{type:"MESSAGE_STAGE",id:_,message:j,elementKey:T})},[]),b=w.useCallback(()=>{const j=c.current.draft.map(_=>_.id),T=a.current.filter(_=>_.status==="staged").map(_=>_.id),$=Array.from(new Set([...j,...T]));$.length!==0&&(_r({type:"PATCH_COMMIT",ids:$}),t([]))},[]),S=w.useCallback(j=>{t(T=>T.filter($=>$.id!==j)),_r({type:"DISCARD_DRAFTS",ids:[j]}),he("overlay",{type:"PATCH_REVERT"})},[]),m=w.useCallback(()=>{const j=c.current.draft.map(_=>_.id),T=a.current.filter(_=>_.status==="staged").map(_=>_.id),$=Array.from(new Set([...j,...T]));t([]),$.length>0&&_r({type:"DISCARD_DRAFTS",ids:$}),he("overlay",{type:"PATCH_REVERT"})},[]),h=w.useCallback(()=>{},[]),y=w.useCallback(j=>{r({draft:j.draftCount,committed:j.committedCount,implementing:j.implementingCount,implemented:j.implementedCount,partial:j.partialCount,error:j.errorCount}),l({draft:j.draft,commits:j.commits}),i(!!j.agentWaiting)},[]),v=w.useCallback(j=>{r({draft:j.staged,committed:j.committed,implementing:j.implementing,implemented:j.implemented,partial:0,error:0})},[]),C=e.filter(j=>j.status==="staged").length,k={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:k,queueState:o,agentWaiting:s,preview:d,previewBatch:p,revertPreview:f,stage:g,stageMessage:x,commitAll:b,discard:S,discardAll:m,reset:h,handleQueueUpdate:y,handlePatchUpdate:v}}function Ks(){return typeof window<"u"}function qr(e){return Du(e)?(e.nodeName||"").toLowerCase():"#document"}function dt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zt(e){var t;return(t=(Du(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Du(e){return Ks()?e instanceof Node||e instanceof dt(e).Node:!1}function Pe(e){return Ks()?e instanceof Element||e instanceof dt(e).Element:!1}function Kt(e){return Ks()?e instanceof HTMLElement||e instanceof dt(e).HTMLElement:!1}function _a(e){return!Ks()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof dt(e).ShadowRoot}function tl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=kt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function wv(e){return/^(table|td|th)$/.test(qr(e))}function Fs(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const bv=/transform|translate|scale|rotate|perspective|filter/,Sv=/paint|layout|strict|content/,Fn=e=>!!e&&e!=="none";let Si;function Mu(e){const t=Pe(e)?kt(e):e;return Fn(t.transform)||Fn(t.translate)||Fn(t.scale)||Fn(t.rotate)||Fn(t.perspective)||!Ws()&&(Fn(t.backdropFilter)||Fn(t.filter))||bv.test(t.willChange||"")||Sv.test(t.contain||"")}function kv(e){let t=an(e);for(;Kt(t)&&!tn(t);){if(Mu(t))return t;if(Fs(t))return null;t=an(t)}return null}function Ws(){return Si==null&&(Si=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Si}function tn(e){return/^(html|body|#document)$/.test(qr(e))}function kt(e){return dt(e).getComputedStyle(e)}function Vs(e){return Pe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function an(e){if(qr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_a(e)&&e.host||zt(e);return _a(t)?t.host:t}function cm(e){const t=an(e);return tn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kt(t)&&tl(t)?t:cm(t)}function In(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=cm(e),l=o===((r=e.ownerDocument)==null?void 0:r.body),s=dt(o);if(l){const i=Ia(s);return t.concat(s,s.visualViewport||[],tl(o)?o:[],i&&n?In(i):[])}else return t.concat(o,In(o,[],n))}function Ia(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Qr=Math.min,at=Math.max,vs=Math.round,kl=Math.floor,Mt=e=>({x:e,y:e}),Cv={left:"right",right:"left",bottom:"top",top:"bottom"};function rd(e,t,n){return at(e,Qr(t,n))}function nl(e,t){return typeof e=="function"?e(t):e}function On(e){return e.split("-")[0]}function rl(e){return e.split("-")[1]}function dm(e){return e==="x"?"y":"x"}function fm(e){return e==="y"?"height":"width"}function qt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function pm(e){return dm(qt(e))}function jv(e,t,n){n===void 0&&(n=!1);const r=rl(e),o=pm(e),l=fm(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(s=xs(s)),[s,xs(s)]}function Ev(e){const t=xs(e);return[La(e),t,La(t)]}function La(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const od=["left","right"],ld=["right","left"],Tv=["top","bottom"],Nv=["bottom","top"];function Rv(e,t,n){switch(e){case"top":case"bottom":return n?t?ld:od:t?od:ld;case"left":case"right":return t?Tv:Nv;default:return[]}}function Pv(e,t,n,r){const o=rl(e);let l=Rv(On(e),n==="start",r);return o&&(l=l.map(s=>s+"-"+o),t&&(l=l.concat(l.map(La)))),l}function xs(e){const t=On(e);return Cv[t]+e.slice(t.length)}function _v(e){return{top:0,right:0,bottom:0,left:0,...e}}function Iv(e){return typeof e!="number"?_v(e):{top:e,right:e,bottom:e,left:e}}function ws(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}}/*!
|
|
53
|
+
`,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.triggerLoad()}disconnectedCallback(){var n;(n=this.observer)==null||n.disconnect(),this.observer=null,this.hiddenIframe.remove()}attributeChangedCallback(){this.isConnected&&this.triggerLoad()}triggerLoad(){var o;(o=this.observer)==null||o.disconnect(),this.observer=null,this.loadTimeoutId&&clearTimeout(this.loadTimeoutId),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(){this.loadTimeoutId&&(clearTimeout(this.loadTimeoutId),this.loadTimeoutId=null),this.hasLoaded=!0;const n=this.hiddenIframe.contentDocument;if(!n)return;const r=n.createElement("style");if(r.textContent="body,html{margin:0!important;padding:0!important}",n.head.appendChild(r),this.getAttribute("srcdoc")!=null){this.extractAndApply(n);return}this.waitForStoryContent(n)}updateArgs(n,r){const o=this.hiddenIframe.contentWindow;o&&o.postMessage(JSON.stringify({key:"storybook-channel",event:{type:"updateStoryArgs",args:[{storyId:n,updatedArgs:r}]}}),"*")}waitForStoryContent(n){var u;(u=this.observer)==null||u.disconnect();let r=!1,o=null;const l=()=>this.findStoryRoot(n)?(r=!0,this.extractAndApply(n),!0):!1;l();const s=n.querySelector("#storybook-root")??n.body;if(!s)return;const i=new MutationObserver(()=>{const c=this.findStoryRoot(n);if(!r)l();else{o&&clearTimeout(o);const d=c?parseFloat((c.ownerDocument.defaultView??window).getComputedStyle(c).transitionDuration)*1e3:0,p=Math.ceil(d)+50;o=setTimeout(()=>l(),p)}});this.observer=i,i.observe(s,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),setTimeout(()=>{!r&&this.observer===i&&(this.observer.disconnect(),this.observer=null,this.reportError("Story did not render — component may not exist or Storybook story file has an error"))},2e4)}findStoryRoot(n){const r=n.querySelector("#storybook-root");if(r){for(const o of r.children)if(!o.classList.contains("sb-loader"))return o;return null}return n.body.firstElementChild}getComponentHtml(){const n=this.hiddenIframe.contentDocument;if(!n)return"";const r=this.findStoryRoot(n);if(!r)return this.ghostEl.innerHTML;const o=r.cloneNode(!0),l=getComputedStyle(r);for(const s of im)o.style.setProperty(s,l.getPropertyValue(s));return am(r,o),o.outerHTML}extractAndApply(n){const r=this.findStoryRoot(n);if(r&&r.ownerDocument.defaultView,!r)return;const o=this.clientWidth||800;this.hiddenIframe.style.width=o+"px";const l=fv(r);pv(this,l,o),this.ghostEl.innerHTML=r.innerHTML;const s=r.children,i=this.ghostEl.children,u=Math.min(s.length,i.length);for(let p=0;p<u;p++)sm(s[p],i[p]);this._loadedDispatched||(this._loadedDispatched=!0,this.dispatchEvent(new CustomEvent("iframe-loaded")));const c=this.getComponentHtml(),d=getComputedStyle(n.body).backgroundColor;this.dispatchEvent(new CustomEvent("ghost-extracted",{detail:{ghostHtml:c,hostStyles:l,storyBackground:d}}))}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}}_t(um,"observedAttributes",["src","srcdoc"]);customElements.get("adaptive-iframe")||customElements.define("adaptive-iframe",um);function mv({group:e,isArmed:t,onArm:n,onDisarm:r,cachedGhostHtml:o,cachedHostStyles:l,cachedStoryBackground:s,onGhostExtracted:i}){const[u,c]=w.useState(!1),d=w.useRef(null),[p,f]=w.useState(!1),[g,x]=w.useState(s),[b,S]=w.useState(!1),[m,h]=w.useState(!1);w.useEffect(()=>{const N=d.current;if(!N)return;const z=new IntersectionObserver(([V])=>{V.isIntersecting&&(c(!0),z.disconnect())},{rootMargin:"200px"});return z.observe(N),()=>z.disconnect()},[]);const y=u&&(!o||m||b);console.log(`[ComponentGroupItem] ${e.name} isVisible=${u} cachedGhostHtml=${!!o} probeEnabled=${y}`);const{bestStory:v,probing:C,argTypes:k,defaultArgs:j}=rv(e.stories,y),[T,$]=w.useState({}),[_,W]=w.useState(null),O=w.useRef(null),P=w.useRef(!1),A=w.useRef(null),{canLoad:X,releaseSlot:H}=iv(u&&!!v&&!C&&(!o||b));w.useEffect(()=>{!C&&j&&$(j)},[C,j]),w.useEffect(()=>{var me,be;const N=ae=>{W(ae.detail.message),H()},z=()=>{if(f(!0),H(),A.current){const ae=O.current;typeof(ae==null?void 0:ae.updateArgs)=="function"&&v&&ae.updateArgs(v.id,A.current),A.current=null}},V=O.current;return(me=V==null?void 0:V.addEventListener)==null||me.call(V,"iframe-error",N),(be=V==null?void 0:V.addEventListener)==null||be.call(V,"iframe-loaded",z),()=>{var ae,se;(ae=V==null?void 0:V.removeEventListener)==null||ae.call(V,"iframe-error",N),(se=V==null?void 0:V.removeEventListener)==null||se.call(V,"iframe-loaded",z)}},[v,H]),w.useEffect(()=>{var V;if(!v)return;const N=me=>{const{ghostHtml:be,hostStyles:ae,storyBackground:se}=me.detail;se&&x(se),i==null||i({storyId:v.id,args:{},ghostHtml:be,hostStyles:ae,storyBackground:se,componentName:e.name,componentPath:e.componentPath})},z=O.current;return(V=z==null?void 0:z.addEventListener)==null||V.call(z,"ghost-extracted",N),()=>{var me;(me=z==null?void 0:z.removeEventListener)==null||me.call(z,"ghost-extracted",N)}},[v,e.name,e.componentPath,i]),w.useEffect(()=>{if(!O.current||!v||!X||P.current)return;P.current=!0;const N=av(v.id,{});O.current.setAttribute("src",N)},[v,X]);const ne=w.useCallback(N=>{if($(N),!O.current||!v||!p){A.current=N,S(!0);return}const z=O.current;typeof z.updateArgs=="function"&&z.updateArgs(v.id,N)},[v,p]),R=w.useCallback(N=>{var me;if(N.stopPropagation(),t){r();return}const z=O.current,V=((me=z==null?void 0:z.getComponentHtml)==null?void 0:me.call(z))??o??"";if(n(V,T),S(!0),i&&V&&v){const be=l??{};i({storyId:v.id,args:T,ghostHtml:V,hostStyles:be,storyBackground:g,componentName:e.name,componentPath:e.componentPath})}},[t,n,r,T,o,l,v,e.name,e.componentPath,i]),L=Object.keys(k).length>0||Object.keys(e.argTypes??{}).length>0||!!o;return a.jsxs("li",{ref:d,className:`group rounded border overflow-hidden cursor-pointer transition-[border-color,box-shadow] ${t?"border-bv-teal shadow-[0_0_0_2px_var(--color-bv-teal),0_0_12px_rgba(0,132,139,0.2)]":"border-bv-border hover:border-[#555]"}`,onClick:R,children:[a.jsxs("div",{className:`flex items-center justify-center min-h-14 overflow-hidden ${t?"bg-[rgba(0,132,139,0.06)]":""}`,style:!t&&g?{backgroundColor:g}:void 0,children:[!u&&a.jsx("span",{className:"text-[10px] text-bv-muted",children:" "}),u&&_&&a.jsx("span",{className:"text-[10px] text-bv-orange px-2 py-1 text-center leading-tight",children:_}),u&&!_&&!o&&!p&&(C||!!v)&&a.jsx("span",{className:"text-[10px] text-bv-muted",children:"Loading preview…"}),u&&!_&&o&&!p&&a.jsx("div",{className:"pointer-events-none",dangerouslySetInnerHTML:{__html:o}}),u&&!_&&!C&&v&&a.jsx("adaptive-iframe",{ref:O,style:{pointerEvents:"none"}}),u&&!_&&!C&&!v&&!o&&a.jsx("span",{className:"text-[10px] text-bv-muted",children:"No stories found."})]}),a.jsxs("div",{className:"flex items-center justify-between px-2.5 py-1.5 border-t border-bv-border bg-bv-bg",children:[t?a.jsx("span",{className:"text-[11px] font-medium text-bv-teal",children:"Click the page to place"}):e.stories[0]?a.jsx("a",{href:`/storybook/?path=/story/${e.stories[0].id}`,target:"_blank",rel:"noopener noreferrer",className:"text-[11px] text-bv-text hover:text-bv-orange hover:underline transition-colors",onClick:N=>{N.stopPropagation()},children:a.jsx(qc,{fullTitle:e.fullTitle})}):a.jsx("span",{className:"text-[11px] text-bv-text",children:a.jsx(qc,{fullTitle:e.fullTitle})}),L&&a.jsx("button",{className:`w-5.5 h-5.5 rounded flex items-center justify-center transition-colors opacity-0 group-hover:opacity-100 ${m?"opacity-100 bg-bv-surface-hi text-bv-text":"text-bv-muted hover:bg-bv-surface-hi hover:text-bv-text"}`,title:"Customize props",onClick:N=>{N.stopPropagation(),h(z=>!z)},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"12",cy:"12",r:"3"}),a.jsx("path",{d:"M12 1v2m0 18v2M4.22 4.22l1.42 1.42m12.72 12.72 1.42 1.42M1 12h2m18 0h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"})]})})]}),m&&L&&a.jsxs("div",{className:"px-2.5 py-2 border-t border-bv-border bg-bv-surface",onClick:N=>N.stopPropagation(),children:[a.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-wider text-bv-muted mb-1.5",children:"Props"}),a.jsx(uv,{argTypes:Object.keys(k).length>0?k:e.argTypes??{},args:T,onArgsChange:ne})]})]})}function qc({fullTitle:e}){const t=e.split("/");if(t.length===1)return a.jsx("span",{className:"font-semibold",children:t[0]});const n=t.slice(0,-1),r=t.at(-1);return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-bv-muted font-normal",children:n.join(" / ")}),a.jsx("span",{className:"text-bv-muted font-normal",children:" / "}),a.jsx("span",{className:"font-semibold",children:r})]})}function cm(e){return!e||Object.keys(e).length===0?"":JSON.stringify(e,Object.keys(e).sort())}function ed(e,t){const n=cm(t);return n?`${e}::${n}`:e}function hv(){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 i=new Map;for(const u of s){const c=u.argsHash?`${u.storyId}::${u.argsHash}`:u.storyId;i.set(c,u)}n.current=i,t(!0)}).catch(()=>{l||t(!0)}),()=>{l=!0}},[]);const r=w.useCallback((l,s)=>{const i=ed(l,s),u=n.current.get(i);return u?{ghostHtml:u.ghostHtml,hostStyles:u.hostStyles,storyBackground:u.storyBackground}:null},[]),o=w.useCallback(l=>{const s=ed(l.storyId,l.args),i=n.current.has(s);n.current.set(s,{storyId:l.storyId,argsHash:cm(l.args),ghostHtml:l.ghostHtml,hostStyles:l.hostStyles,storyBackground:l.storyBackground,componentName:l.componentName,componentPath:l.componentPath,extractedAt:Date.now()}),!i&&fetch("/api/ghost-cache",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({storyId:l.storyId,args:l.args,ghostHtml:l.ghostHtml,hostStyles:l.hostStyles,storyBackground:l.storyBackground,componentName:l.componentName,componentPath:l.componentPath})}).catch(()=>{})},[]);return{getCachedGhost:r,submitToCache:o,loaded:e}}function td(){const{groups:e,loading:t,error:n}=gv(),[r,o]=w.useState(null),{getCachedGhost:l,submitToCache:s}=hv(),i=w.useCallback((c,d,p)=>{var f;o(c.name),he("overlay",{type:"COMPONENT_ARM",componentName:c.name,storyId:((f=c.stories[0])==null?void 0:f.id)??"",ghostHtml:d,componentPath:c.componentPath,args:p})},[]),u=w.useCallback(()=>{o(null),he("overlay",{type:"COMPONENT_DISARM"})},[]);return w.useEffect(()=>tm(c=>{c.type==="COMPONENT_DISARMED"&&o(null)}),[]),w.useEffect(()=>{if(!r)return;const c=()=>{o(null),he("overlay",{type:"COMPONENT_DISARM"})};return document.addEventListener("click",c),()=>document.removeEventListener("click",c)},[r]),a.jsx("div",{className:"p-3 flex flex-col gap-3",children:a.jsxs("div",{className:"flex flex-col gap-1.5",children:[t&&a.jsx("div",{className:"text-[11px] text-bv-muted",children:"Loading components…"}),!t&&n&&a.jsxs("div",{className:"text-[11px] text-bv-text-mid leading-relaxed",children:[a.jsx("span",{className:"block mb-0.5",children:"Storybook not detected."}),a.jsx("span",{className:"text-bv-muted",children:"Start Storybook on port 6006–6010 to browse components."})]}),!t&&!n&&e.length===0&&a.jsx("div",{className:"text-[11px] text-bv-muted",children:"No stories found."}),!t&&!n&&e.length>0&&a.jsx("ul",{className:"flex flex-col gap-2",children:e.map(c=>{var f;const d=(f=c.stories[0])==null?void 0:f.id,p=d?l(d):null;return a.jsx(mv,{group:c,isArmed:r===c.name,onArm:(g,x)=>i(c,g,x),onDisarm:u,cachedGhostHtml:p==null?void 0:p.ghostHtml,cachedHostStyles:p==null?void 0:p.hostStyles,cachedStoryBackground:p==null?void 0:p.storyBackground,onGhostExtracted:s},c.name)})})]})})}function gv(){const[e,t]=w.useState([]),[n,r]=w.useState(!0),[o,l]=w.useState(!1);return w.useEffect(()=>{let s=!1;return(async()=>{var i,u;try{const c=await fetch("/api/storybook-data").then(p=>p.json());if(!c.available){s||(l(!0),r(!1));return}const d=Object.values(((i=c.index)==null?void 0:i.entries)??((u=c.index)==null?void 0:u.stories)??{});s||t(yv(d,c.argTypes??{}))}catch{s||l(!0)}finally{s||r(!1)}})(),()=>{s=!0}},[]),{groups:e,loading:n,error:o}}function yv(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 i,u;const s=new Set;for(const c of l)for(const d of c.tags??[])s.add(d);return{name:o,fullTitle:((i=l[0])==null?void 0:i.title)??o,tags:Array.from(s),stories:l,argTypes:t[o]??vv(l),componentPath:(u=l[0])==null?void 0:u.componentPath}});return r.sort((o,l)=>{const s=o.tags.includes("design-system")?0:1,i=l.tags.includes("design-system")?0:1;return s!==i?s-i:o.name.localeCompare(l.name)}),r}function vv(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 bi=typeof window<"u"?window.SpeechRecognition??window.webkitSpeechRecognition??null:null;function nd({draft:e,currentElementKey:t,onAddMessage:n,onDiscard:r}){const[o,l]=w.useState(""),[s,i]=w.useState(!1),[u,c]=w.useState(null),d=w.useRef(null),p=w.useRef(null),f=w.useRef("");w.useEffect(()=>{var h;(h=d.current)==null||h.focus()},[]);const g=e.filter(h=>h.kind==="message"),x=!!o.trim()&&!!t;function b(){var y;const h=o.trim();!h||!t||(n(h,t),l(""),(y=d.current)==null||y.focus())}function S(){var y;if(s){(y=p.current)==null||y.stop();return}if(!bi)return;f.current=o;const h=new bi;h.continuous=!1,h.interimResults=!0,h.lang="en-US",h.onresult=v=>{let C="";for(let j=0;j<v.results.length;j++)C+=v.results[j][0].transcript;const k=f.current.trimEnd();l(k?`${k} ${C}`:C)},h.onend=()=>i(!1),h.onerror=v=>{console.error("[mic] SpeechRecognition error:",v.error,v.message),i(!1),v.error==="not-allowed"&&c("Microphone blocked — allow access in your browser's address bar, then reload.")},p.current=h;try{h.start(),i(!0),console.log("[mic] recognition started")}catch(v){console.error("[mic] recognition.start() threw:",v)}}function m(h){(h.metaKey||h.ctrlKey)&&h.key==="Enter"&&(h.preventDefault(),b())}return a.jsxs("div",{className:"p-3 flex flex-col gap-3",children:[a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("textarea",{ref:d,className:"w-full min-h-[80px] p-2 bg-bv-bg border border-bv-border rounded text-[13px] font-[family-name:var(--font-ui)] text-bv-text placeholder:text-bv-muted resize-y focus:outline-none focus:border-bv-teal",placeholder:t?"Add context for the AI agent…":"Select an element to add contextual message…",value:o,onChange:h=>l(h.target.value),onKeyDown:m,disabled:!t}),a.jsxs("div",{className:"flex items-center justify-between",children:[bi?a.jsx("button",{type:"button",title:s?"Stop recording":"Record voice message",onClick:S,className:`flex items-center justify-center w-7 h-7 rounded-full border-none cursor-pointer transition-colors ${s?"bg-bv-orange text-white":u?"bg-bv-surface text-bv-orange hover:bg-bv-surface-hi":"bg-bv-surface text-bv-text-mid hover:text-bv-teal hover:bg-bv-surface-hi"}`,children:s?a.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-white animate-pulse"}):a.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 1a4 4 0 0 1 4 4v7a4 4 0 0 1-8 0V5a4 4 0 0 1 4-4zm-1.5 4v7a1.5 1.5 0 0 0 3 0V5a1.5 1.5 0 0 0-3 0zM6 11a1 1 0 0 1 1 1 5 5 0 0 0 10 0 1 1 0 1 1 2 0 7 7 0 0 1-6 6.93V21h2a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2h2v-2.07A7 7 0 0 1 5 12a1 1 0 0 1 1-1z"})})}):a.jsx("span",{}),a.jsx("button",{type:"button",className:"px-3 py-1 text-[11px] font-semibold rounded bg-bv-teal text-white border-none cursor-pointer hover:opacity-90 transition-opacity disabled:opacity-50 disabled:cursor-not-allowed",disabled:!x,onClick:b,children:"Add Message"})]}),u&&a.jsx("p",{className:"text-[11px] text-bv-orange mt-1",children:u})]}),g.length>0&&a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-[5px] h-[5px] rounded-full bg-bv-teal opacity-50 shrink-0"}),a.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-[1px] text-bv-text-mid",children:"Staged Messages"})]}),g.map(h=>{var y;return a.jsxs("div",{className:"flex items-start gap-2 p-2 bg-bv-surface rounded border border-bv-border group",children:[a.jsx("span",{className:"text-[12px] shrink-0 mt-0.5",children:"💬"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"text-[12px] font-[family-name:var(--font-ui)] text-bv-text break-words",children:['"',h.message,'"']}),h.elementKey&&a.jsx("div",{className:"text-[11px] text-bv-text-mid mt-0.5",children:((y=h.component)==null?void 0:y.name)||h.elementKey})]}),a.jsx("button",{type:"button",className:"shrink-0 text-[10px] px-1 py-0.5 rounded border-none cursor-pointer bg-transparent text-bv-muted hover:text-bv-orange transition-colors opacity-0 group-hover:opacity-100",onClick:()=>r(h.id),title:"Discard",children:"✕"})]},h.id)})]})]})}function xv(e){var c,d;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&&((d=e.parentComponent)==null?void 0:d.name)||null,l=o||e.elementKey||null,s=o?`<${l}>`:l,i="targetPatchId"in e&&!!e.targetPatchId,u=s&&i?`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 Sl({label:e,count:t,items:n,activeColor:r,dotColor:o,onCommit:l,onDiscard:s,onCommitAll:i,onDiscardAll:u}){const[c,d]=w.useState(!1),p=w.useRef(null),f=w.useRef(null),[g,x]=w.useState(void 0);w.useEffect(()=>{if(!c||!f.current)return;const h=f.current.getBoundingClientRect(),y=220,v=window.innerWidth,C=4;let k=h.left+h.width/2-y/2;k=Math.max(C,Math.min(k,v-y-C)),x(k-h.left)},[c]),w.useEffect(()=>{if(!c)return;function m(h){p.current&&!p.current.contains(h.target)&&d(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[c]),w.useEffect(()=>{if(!c)return;function m(h){h.key==="Escape"&&d(!1)}return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[c]);const b=t>0,S=l||s||i||u;return a.jsxs("div",{ref:p,className:"relative",children:[a.jsxs("button",{ref:f,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&&d(!c),disabled:!b,type:"button",children:[o&&a.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${o}`}),t," ",e]}),c&&a.jsxs("div",{className:"absolute bottom-full mb-1 min-w-[220px] bg-bv-surface border border-bv-border rounded-lg shadow-lg overflow-hidden flex flex-col z-[9999]",style:g!==void 0?{left:`${g}px`}:void 0,children:[a.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,")"]}),a.jsx("div",{className:"flex-1 overflow-auto",children:n.length===0?a.jsx("div",{className:"px-3 py-2 text-[11px] text-bv-muted italic",children:"No patches"}):n.map(m=>{var C,k;const h="kind"in m&&m.kind==="message",y="kind"in m&&m.kind==="design",v="kind"in m&&m.kind==="component-drop";return a.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:[a.jsxs("div",{className:"flex-1 min-w-0",children:[!h&&!y&&!v&&((C=m.component)==null?void 0:C.name)&&a.jsx("div",{className:"text-[10px] text-bv-muted truncate",children:m.component.name}),v?a.jsx("div",{className:"text-[11px] text-bv-text truncate",children:xv(m)}):y?a.jsxs("div",{className:"text-[11px] text-bv-text",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[a.jsx("span",{children:"✏️"}),a.jsxs("span",{className:"truncate",children:["Drawing",(k=m.component)!=null&&k.name?` in ${m.component.name}`:""]})]}),"image"in m&&m.image&&a.jsx("img",{src:m.image,alt:"Design drawing",className:"w-full max-h-16 object-contain rounded border border-bv-border bg-white"})]}):h?a.jsxs("div",{className:"text-[11px] text-bv-text truncate",children:[a.jsx("span",{className:"mr-1",children:"💬"}),'"',"message"in m&&m.message||"",'"']}):a.jsx("div",{className:"text-[11px] font-mono text-bv-text truncate",children:m.originalClass?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"line-through text-bv-muted",children:m.originalClass})," → ",a.jsx("span",{className:"text-bv-teal",children:m.newClass})]}):a.jsxs("span",{className:"text-bv-teal",children:["+",m.newClass]})})]}),(l||s)&&a.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[l&&a.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:j=>{j.stopPropagation(),l(m.id)},title:"Commit to Agent",type:"button",children:"✓"}),s&&a.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:j=>{j.stopPropagation(),s(m.id)},title:"Discard",type:"button",children:"✕"})]})]},m.id)})}),S&&n.length>0&&(i||u)&&a.jsxs("div",{className:"flex gap-2 px-3 py-1.5 border-t border-bv-border",children:[i&&a.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:()=>{i(),d(!1)},type:"button",children:"Commit All"}),u&&a.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(),d(!1)},type:"button",children:"Discard All"})]})]})]})}function rd({tabs:e,activeTab:t,onTabChange:n}){const[r,o]=w.useState(null);return a.jsx("div",{className:"relative flex border-b border-bv-border px-3",children:e.map(l=>{const s=l.id===t,i=l.disabled===!0;return a.jsxs("div",{className:"relative",onMouseEnter:()=>i&&l.tooltip&&o(l.id),onMouseLeave:()=>o(null),children:[a.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 ${i?"text-bv-muted cursor-not-allowed":s?"text-bv-text":"text-bv-text-mid hover:text-bv-text"}`,disabled:i,onClick:()=>!i&&n(l.id),"aria-selected":s,role:"tab",children:[l.label,s&&a.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-bv-teal"})]}),r===l.id&&l.tooltip&&a.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 wv(){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,i]=w.useState(!1),u=w.useRef(e);u.current=e;const c=w.useRef(o);c.current=o;const d=w.useCallback((j,T)=>{he("overlay",{type:"PATCH_PREVIEW",oldClass:j,newClass:T})},[]),p=w.useCallback(j=>{he("overlay",{type:"PATCH_PREVIEW_BATCH",pairs:j})},[]),f=w.useCallback(()=>{he("overlay",{type:"PATCH_REVERT"})},[]),g=w.useCallback((j,T,$,_)=>{if(_===$){t(O=>{const P=O.find(A=>A.kind==="class-change"&&A.elementKey===j&&A.property===T);return P&&P.kind==="class-change"&&P.newClass!==$?he("overlay",{type:"PATCH_REVERT_STAGED",oldClass:P.newClass,newClass:$}):he("overlay",{type:"PATCH_REVERT"}),O.filter(A=>!(A.kind==="class-change"&&A.elementKey===j&&A.property===T))});return}const W=crypto.randomUUID();t(O=>{const P=O.filter(X=>!(X.kind==="class-change"&&X.elementKey===j&&X.property===T)),A={id:W,kind:"class-change",elementKey:j,status:"staged",originalClass:$,newClass:_,property:T,timestamp:new Date().toISOString()};return[...P,A]}),he("overlay",{type:"PATCH_STAGE",id:W,oldClass:$,newClass:_,property:T})},[]),x=w.useCallback((j,T,$)=>{const _=crypto.randomUUID(),W=$?{name:$}:void 0;t(O=>{const P={id:_,kind:"message",elementKey:T,status:"staged",originalClass:"",newClass:"",property:"",timestamp:new Date().toISOString(),message:j,component:W};return[...O,P]}),_r(W?{type:"MESSAGE_STAGE",id:_,message:j,elementKey:T,component:W}:{type:"MESSAGE_STAGE",id:_,message:j,elementKey:T})},[]),b=w.useCallback(()=>{const j=c.current.draft.map(_=>_.id),T=u.current.filter(_=>_.status==="staged").map(_=>_.id),$=Array.from(new Set([...j,...T]));$.length!==0&&(_r({type:"PATCH_COMMIT",ids:$}),t([]))},[]),S=w.useCallback(j=>{t(T=>T.filter($=>$.id!==j)),_r({type:"DISCARD_DRAFTS",ids:[j]}),he("overlay",{type:"PATCH_REVERT"})},[]),m=w.useCallback(()=>{const j=c.current.draft.map(_=>_.id),T=u.current.filter(_=>_.status==="staged").map(_=>_.id),$=Array.from(new Set([...j,...T]));t([]),$.length>0&&_r({type:"DISCARD_DRAFTS",ids:$}),he("overlay",{type:"PATCH_REVERT"})},[]),h=w.useCallback(()=>{},[]),y=w.useCallback(j=>{r({draft:j.draftCount,committed:j.committedCount,implementing:j.implementingCount,implemented:j.implementedCount,partial:j.partialCount,error:j.errorCount}),l({draft:j.draft,commits:j.commits}),i(!!j.agentWaiting)},[]),v=w.useCallback(j=>{r({draft:j.staged,committed:j.committed,implementing:j.implementing,implemented:j.implemented,partial:0,error:0})},[]),C=e.filter(j=>j.status==="staged").length,k={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:k,queueState:o,agentWaiting:s,preview:d,previewBatch:p,revertPreview:f,stage:g,stageMessage:x,commitAll:b,discard:S,discardAll:m,reset:h,handleQueueUpdate:y,handlePatchUpdate:v}}function Ks(){return typeof window<"u"}function qr(e){return Du(e)?(e.nodeName||"").toLowerCase():"#document"}function dt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zt(e){var t;return(t=(Du(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Du(e){return Ks()?e instanceof Node||e instanceof dt(e).Node:!1}function Pe(e){return Ks()?e instanceof Element||e instanceof dt(e).Element:!1}function Kt(e){return Ks()?e instanceof HTMLElement||e instanceof dt(e).HTMLElement:!1}function _a(e){return!Ks()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof dt(e).ShadowRoot}function tl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=kt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function bv(e){return/^(table|td|th)$/.test(qr(e))}function Fs(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Sv=/transform|translate|scale|rotate|perspective|filter/,kv=/paint|layout|strict|content/,Fn=e=>!!e&&e!=="none";let Si;function Mu(e){const t=Pe(e)?kt(e):e;return Fn(t.transform)||Fn(t.translate)||Fn(t.scale)||Fn(t.rotate)||Fn(t.perspective)||!Ws()&&(Fn(t.backdropFilter)||Fn(t.filter))||Sv.test(t.willChange||"")||kv.test(t.contain||"")}function Cv(e){let t=an(e);for(;Kt(t)&&!tn(t);){if(Mu(t))return t;if(Fs(t))return null;t=an(t)}return null}function Ws(){return Si==null&&(Si=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Si}function tn(e){return/^(html|body|#document)$/.test(qr(e))}function kt(e){return dt(e).getComputedStyle(e)}function Vs(e){return Pe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function an(e){if(qr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_a(e)&&e.host||zt(e);return _a(t)?t.host:t}function dm(e){const t=an(e);return tn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kt(t)&&tl(t)?t:dm(t)}function In(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=dm(e),l=o===((r=e.ownerDocument)==null?void 0:r.body),s=dt(o);if(l){const i=Ia(s);return t.concat(s,s.visualViewport||[],tl(o)?o:[],i&&n?In(i):[])}else return t.concat(o,In(o,[],n))}function Ia(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Qr=Math.min,at=Math.max,vs=Math.round,kl=Math.floor,Mt=e=>({x:e,y:e}),jv={left:"right",right:"left",bottom:"top",top:"bottom"};function od(e,t,n){return at(e,Qr(t,n))}function nl(e,t){return typeof e=="function"?e(t):e}function On(e){return e.split("-")[0]}function rl(e){return e.split("-")[1]}function fm(e){return e==="x"?"y":"x"}function pm(e){return e==="y"?"height":"width"}function qt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function mm(e){return fm(qt(e))}function Ev(e,t,n){n===void 0&&(n=!1);const r=rl(e),o=mm(e),l=pm(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(s=xs(s)),[s,xs(s)]}function Tv(e){const t=xs(e);return[La(e),t,La(t)]}function La(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const ld=["left","right"],sd=["right","left"],Nv=["top","bottom"],Rv=["bottom","top"];function Pv(e,t,n){switch(e){case"top":case"bottom":return n?t?sd:ld:t?ld:sd;case"left":case"right":return t?Nv:Rv;default:return[]}}function _v(e,t,n,r){const o=rl(e);let l=Pv(On(e),n==="start",r);return o&&(l=l.map(s=>s+"-"+o),t&&(l=l.concat(l.map(La)))),l}function xs(e){const t=On(e);return jv[t]+e.slice(t.length)}function Iv(e){return{top:0,right:0,bottom:0,left:0,...e}}function Lv(e){return typeof e!="number"?Iv(e):{top:e,right:e,bottom:e,left:e}}function ws(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}}/*!
|
|
54
54
|
* tabbable 6.4.0
|
|
55
55
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
56
|
-
*/var Lv=["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] *)"],Aa=Lv.join(","),mm=typeof Element>"u",Yo=mm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,bs=!mm&&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},Ss=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]"):Ss(t.parentNode));return s},Av=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Ov=function(t,n,r){if(Ss(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Aa));return n&&Yo.call(t,Aa)&&o.unshift(t),o=o.filter(r),o},Oa=function(t,n,r){for(var o=[],l=Array.from(t);l.length;){var s=l.shift();if(!Ss(s,!1))if(s.tagName==="SLOT"){var i=s.assignedElements(),a=i.length?i:s.children,c=Oa(a,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:s,candidates:c})}else{var d=Yo.call(s,Aa);d&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var p=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),f=!Ss(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(p&&f){var g=Oa(p===!0?s.children:p.children,!0,r);r.flatten?o.push.apply(o,g):o.push({scopeParent:s,candidates:g})}else l.unshift.apply(l,s.children)}}return o},hm=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},gm=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Av(t))&&!hm(t)?0:t.tabIndex},Dv=function(t,n){var r=gm(t);return r<0&&n&&!hm(t)?0:r},Mv=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ym=function(t){return t.tagName==="INPUT"},$v=function(t){return ym(t)&&t.type==="hidden"},zv=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Kv=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Fv=function(t){if(!t.name)return!0;var n=t.form||bs(t),r=function(i){return n.querySelectorAll('input[type="radio"][name="'+i+'"]')},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=Kv(o,t.form);return!l||l===t},Wv=function(t){return ym(t)&&t.type==="radio"},Vv=function(t){return Wv(t)&&!Fv(t)},Hv=function(t){var n,r=t&&bs(t),o=(n=r)===null||n===void 0?void 0:n.host,l=!1;if(r&&r!==t){var s,i,a;for(l=!!((s=o)!==null&&s!==void 0&&(i=s.ownerDocument)!==null&&i!==void 0&&i.contains(o)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!l&&o;){var c,d,p;r=bs(o),o=(c=r)===null||c===void 0?void 0:c.host,l=!!((d=o)!==null&&d!==void 0&&(p=d.ownerDocument)!==null&&p!==void 0&&p.contains(o))}}return l},sd=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},Bv=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=Yo.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(Yo.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var c=t.parentElement,d=bs(t);if(c&&!c.shadowRoot&&o(c)===!0)return sd(t);t.assignedSlot?t=t.assignedSlot:!c&&d!==t.ownerDocument?t=d.host:t=c}t=a}if(Hv(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return sd(t);return!1},Uv=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 Yo.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Gv=function(t,n){return!(n.disabled||$v(n)||Bv(n,t)||zv(n)||Uv(n))},id=function(t,n){return!(Vv(n)||gm(n)<0||!Gv(t,n))},Yv=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},vm=function(t){var n=[],r=[];return t.forEach(function(o,l){var s=!!o.scopeParent,i=s?o.scopeParent:o,a=Dv(i,s),c=s?vm(o.candidates):i;a===0?s?n.push.apply(n,c):n.push(i):r.push({documentOrder:l,tabIndex:a,item:o,isScope:s,content:c})}),r.sort(Mv).reduce(function(o,l){return l.isScope?o.push.apply(o,l.content):o.push(l.content),o},[]).concat(n)},xm=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Oa([t],n.includeContainer,{filter:id.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Yv}):r=Ov(t,n.includeContainer,id.bind(null,n)),vm(r)};function Qv(){return/apple/i.test(navigator.vendor)}function Xv(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 Da(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&_a(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function go(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ki(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 Zv(e){return e.matches("html,body")}function Qo(e){return(e==null?void 0:e.ownerDocument)||document}function zl(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,...zl(e,o.id,n)])}function Jv(e){return"nativeEvent"in e}var qv=typeof document<"u",ex=function(){},qn=qv?w.useLayoutEffect:ex;const tx={...Ud},nx=tx.useInsertionEffect,rx=nx||(e=>e());function vr(e){const t=w.useRef(()=>{});return rx(()=>{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 wm=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function bm(e,t){const n=xm(e,wm()),r=n.length;if(r===0)return;const o=Xv(Qo(e)),l=n.indexOf(o),s=l===-1?t===1?0:r-1:l+t;return n[s]}function ox(e){return bm(Qo(e).body,1)||e}function lx(e){return bm(Qo(e).body,-1)||e}function Ci(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Da(n,r)}function sx(e){xm(e,wm()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ad(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 ud(e,t,n){let{reference:r,floating:o}=e;const l=qt(t),s=pm(t),i=fm(s),a=On(t),c=l==="y",d=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,f=r[i]/2-o[i]/2;let g;switch(a){case"top":g={x:d,y:r.y-o.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-o.width,y:p};break;default:g={x:r.x,y:r.y}}switch(rl(t)){case"start":g[s]-=f*(n&&c?-1:1);break;case"end":g[s]+=f*(n&&c?-1:1);break}return g}async function ix(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:l,rects:s,elements:i,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:f=!1,padding:g=0}=nl(t,e),x=Iv(g),S=i[f?p==="floating"?"reference":"floating":p],m=ws(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(i.floating)),boundary:c,rootBoundary:d,strategy:a})),h=p==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(l.getOffsetParent==null?void 0:l.getOffsetParent(i.floating)),v=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},C=ws(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:h,offsetParent:y,strategy:a}):h);return{top:(m.top-C.top+x.top)/v.y,bottom:(C.bottom-m.bottom+x.bottom)/v.y,left:(m.left-C.left+x.left)/v.x,right:(C.right-m.right+x.right)/v.x}}const ax=50,ux=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:s}=n,i=s.detectOverflow?s:{...s,detectOverflow:ix},a=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:p}=ud(c,r,a),f=r,g=0;const x={};for(let b=0;b<l.length;b++){const S=l[b];if(!S)continue;const{name:m,fn:h}=S,{x:y,y:v,data:C,reset:k}=await h({x:d,y:p,initialPlacement:r,placement:f,strategy:o,middlewareData:x,rects:c,platform:i,elements:{reference:e,floating:t}});d=y??d,p=v??p,x[m]={...x[m],...C},k&&g<ax&&(g++,typeof k=="object"&&(k.placement&&(f=k.placement),k.rects&&(c=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:d,y:p}=ud(c,f,a)),b=-1)}return{x:d,y:p,placement:f,strategy:o,middlewareData:x}},cx=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:i,platform:a,elements:c}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:b=!0,...S}=nl(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const m=On(o),h=qt(i),y=On(i)===i,v=await(a.isRTL==null?void 0:a.isRTL(c.floating)),C=f||(y||!b?[xs(i)]:Ev(i)),k=x!=="none";!f&&k&&C.push(...Pv(i,b,x,v));const j=[i,...C],T=await a.detectOverflow(t,S),$=[];let _=((r=l.flip)==null?void 0:r.overflows)||[];if(d&&$.push(T[m]),p){const A=jv(o,s,v);$.push(T[A[0]],T[A[1]])}if(_=[..._,{placement:o,overflows:$}],!$.every(A=>A<=0)){var W,O;const A=(((W=l.flip)==null?void 0:W.index)||0)+1,X=j[A];if(X&&(!(p==="alignment"?h!==qt(X):!1)||_.every(R=>qt(R.placement)===h?R.overflows[0]>0:!0)))return{data:{index:A,overflows:_},reset:{placement:X}};let H=(O=_.filter(ne=>ne.overflows[0]<=0).sort((ne,R)=>ne.overflows[1]-R.overflows[1])[0])==null?void 0:O.placement;if(!H)switch(g){case"bestFit":{var P;const ne=(P=_.filter(R=>{if(k){const L=qt(R.placement);return L===h||L==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(L=>L>0).reduce((L,N)=>L+N,0)]).sort((R,L)=>R[1]-L[1])[0])==null?void 0:P[0];ne&&(H=ne);break}case"initialPlacement":H=i;break}if(o!==H)return{reset:{placement:H}}}return{}}}},dx=new Set(["left","top"]);async function fx(e,t){const{placement:n,platform:r,elements:o}=e,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=On(n),i=rl(n),a=qt(n)==="y",c=dx.has(s)?-1:1,d=l&&a?-1:1,p=nl(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return i&&typeof x=="number"&&(g=i==="end"?x*-1:x),a?{x:g*d,y:f*c}:{x:f*c,y:g*d}}const px=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:i}=t,a=await fx(t,e);return s===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:l+a.y,data:{...a,placement:s}}}}},mx=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:i=!1,limiter:a={fn:m=>{let{x:h,y}=m;return{x:h,y}}},...c}=nl(e,t),d={x:n,y:r},p=await l.detectOverflow(t,c),f=qt(On(o)),g=dm(f);let x=d[g],b=d[f];if(s){const m=g==="y"?"top":"left",h=g==="y"?"bottom":"right",y=x+p[m],v=x-p[h];x=rd(y,x,v)}if(i){const m=f==="y"?"top":"left",h=f==="y"?"bottom":"right",y=b+p[m],v=b-p[h];b=rd(y,b,v)}const S=a.fn({...t,[g]:x,[f]:b});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[g]:s,[f]:i}}}}}},hx=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:i}=t,{apply:a=()=>{},...c}=nl(e,t),d=await s.detectOverflow(t,c),p=On(o),f=rl(o),g=qt(o)==="y",{width:x,height:b}=l.floating;let S,m;p==="top"||p==="bottom"?(S=p,m=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(m=p,S=f==="end"?"top":"bottom");const h=b-d.top-d.bottom,y=x-d.left-d.right,v=Qr(b-d[S],h),C=Qr(x-d[m],y),k=!t.middlewareData.shift;let j=v,T=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=h),k&&!f){const _=at(d.left,0),W=at(d.right,0),O=at(d.top,0),P=at(d.bottom,0);g?T=x-2*(_!==0||W!==0?_+W:at(d.left,d.right)):j=b-2*(O!==0||P!==0?O+P:at(d.top,d.bottom))}await a({...t,availableWidth:T,availableHeight:j});const $=await s.getDimensions(i.floating);return x!==$.width||b!==$.height?{reset:{rects:!0}}:{}}}};function Sm(e){const t=kt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Kt(e),l=o?e.offsetWidth:n,s=o?e.offsetHeight:r,i=vs(n)!==l||vs(r)!==s;return i&&(n=l,r=s),{width:n,height:r,$:i}}function $u(e){return Pe(e)?e:e.contextElement}function zr(e){const t=$u(e);if(!Kt(t))return Mt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:l}=Sm(t);let s=(l?vs(n.width):n.width)/r,i=(l?vs(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}const gx=Mt(0);function km(e){const t=dt(e);return!Ws()||!t.visualViewport?gx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yx(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==dt(e)?!1:t}function lr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),l=$u(e);let s=Mt(1);t&&(r?Pe(r)&&(s=zr(r)):s=zr(e));const i=yx(l,n,r)?km(l):Mt(0);let a=(o.left+i.x)/s.x,c=(o.top+i.y)/s.y,d=o.width/s.x,p=o.height/s.y;if(l){const f=dt(l),g=r&&Pe(r)?dt(r):r;let x=f,b=Ia(x);for(;b&&r&&g!==x;){const S=zr(b),m=b.getBoundingClientRect(),h=kt(b),y=m.left+(b.clientLeft+parseFloat(h.paddingLeft))*S.x,v=m.top+(b.clientTop+parseFloat(h.paddingTop))*S.y;a*=S.x,c*=S.y,d*=S.x,p*=S.y,a+=y,c+=v,x=dt(b),b=Ia(x)}}return ws({width:d,height:p,x:a,y:c})}function Hs(e,t){const n=Vs(e).scrollLeft;return t?t.left+n:lr(zt(e)).left+n}function Cm(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Hs(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function vx(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const l=o==="fixed",s=zt(r),i=t?Fs(t.floating):!1;if(r===s||i&&l)return n;let a={scrollLeft:0,scrollTop:0},c=Mt(1);const d=Mt(0),p=Kt(r);if((p||!p&&!l)&&((qr(r)!=="body"||tl(s))&&(a=Vs(r)),p)){const g=lr(r);c=zr(r),d.x=g.x+r.clientLeft,d.y=g.y+r.clientTop}const f=s&&!p&&!l?Cm(s,a):Mt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-a.scrollTop*c.y+d.y+f.y}}function xx(e){return Array.from(e.getClientRects())}function wx(e){const t=zt(e),n=Vs(e),r=e.ownerDocument.body,o=at(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=at(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Hs(e);const i=-n.scrollTop;return kt(r).direction==="rtl"&&(s+=at(t.clientWidth,r.clientWidth)-o),{width:o,height:l,x:s,y:i}}const cd=25;function bx(e,t){const n=dt(e),r=zt(e),o=n.visualViewport;let l=r.clientWidth,s=r.clientHeight,i=0,a=0;if(o){l=o.width,s=o.height;const d=Ws();(!d||d&&t==="fixed")&&(i=o.offsetLeft,a=o.offsetTop)}const c=Hs(r);if(c<=0){const d=r.ownerDocument,p=d.body,f=getComputedStyle(p),g=d.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,x=Math.abs(r.clientWidth-p.clientWidth-g);x<=cd&&(l-=x)}else c<=cd&&(l+=c);return{width:l,height:s,x:i,y:a}}function Sx(e,t){const n=lr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,l=Kt(e)?zr(e):Mt(1),s=e.clientWidth*l.x,i=e.clientHeight*l.y,a=o*l.x,c=r*l.y;return{width:s,height:i,x:a,y:c}}function dd(e,t,n){let r;if(t==="viewport")r=bx(e,n);else if(t==="document")r=wx(zt(e));else if(Pe(t))r=Sx(t,n);else{const o=km(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ws(r)}function jm(e,t){const n=an(e);return n===t||!Pe(n)||tn(n)?!1:kt(n).position==="fixed"||jm(n,t)}function kx(e,t){const n=t.get(e);if(n)return n;let r=In(e,[],!1).filter(i=>Pe(i)&&qr(i)!=="body"),o=null;const l=kt(e).position==="fixed";let s=l?an(e):e;for(;Pe(s)&&!tn(s);){const i=kt(s),a=Mu(s);!a&&i.position==="fixed"&&(o=null),(l?!a&&!o:!a&&i.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||tl(s)&&!a&&jm(e,s))?r=r.filter(d=>d!==s):o=i,s=an(s)}return t.set(e,r),r}function Cx(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Fs(t)?[]:kx(t,this._c):[].concat(n),r],i=dd(t,s[0],o);let a=i.top,c=i.right,d=i.bottom,p=i.left;for(let f=1;f<s.length;f++){const g=dd(t,s[f],o);a=at(g.top,a),c=Qr(g.right,c),d=Qr(g.bottom,d),p=at(g.left,p)}return{width:c-p,height:d-a,x:p,y:a}}function jx(e){const{width:t,height:n}=Sm(e);return{width:t,height:n}}function Ex(e,t,n){const r=Kt(t),o=zt(t),l=n==="fixed",s=lr(e,!0,l,t);let i={scrollLeft:0,scrollTop:0};const a=Mt(0);function c(){a.x=Hs(o)}if(r||!r&&!l)if((qr(t)!=="body"||tl(o))&&(i=Vs(t)),r){const g=lr(t,!0,l,t);a.x=g.x+t.clientLeft,a.y=g.y+t.clientTop}else o&&c();l&&!r&&o&&c();const d=o&&!r&&!l?Cm(o,i):Mt(0),p=s.left+i.scrollLeft-a.x-d.x,f=s.top+i.scrollTop-a.y-d.y;return{x:p,y:f,width:s.width,height:s.height}}function ji(e){return kt(e).position==="static"}function fd(e,t){if(!Kt(e)||kt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return zt(e)===n&&(n=n.ownerDocument.body),n}function Em(e,t){const n=dt(e);if(Fs(e))return n;if(!Kt(e)){let o=an(e);for(;o&&!tn(o);){if(Pe(o)&&!ji(o))return o;o=an(o)}return n}let r=fd(e,t);for(;r&&wv(r)&&ji(r);)r=fd(r,t);return r&&tn(r)&&ji(r)&&!Mu(r)?n:r||kv(e)||n}const Tx=async function(e){const t=this.getOffsetParent||Em,n=this.getDimensions,r=await n(e.floating);return{reference:Ex(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Nx(e){return kt(e).direction==="rtl"}const Rx={convertOffsetParentRelativeRectToViewportRelativeRect:vx,getDocumentElement:zt,getClippingRect:Cx,getOffsetParent:Em,getElementRects:Tx,getClientRects:xx,getDimensions:jx,getScale:zr,isElement:Pe,isRTL:Nx};function Tm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Px(e,t){let n=null,r;const o=zt(e);function l(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function s(i,a){i===void 0&&(i=!1),a===void 0&&(a=1),l();const c=e.getBoundingClientRect(),{left:d,top:p,width:f,height:g}=c;if(i||t(),!f||!g)return;const x=kl(p),b=kl(o.clientWidth-(d+f)),S=kl(o.clientHeight-(p+g)),m=kl(d),y={rootMargin:-x+"px "+-b+"px "+-S+"px "+-m+"px",threshold:at(0,Qr(1,a))||1};let v=!0;function C(k){const j=k[0].intersectionRatio;if(j!==a){if(!v)return s();j?s(!1,j):r=setTimeout(()=>{s(!1,1e-7)},1e3)}j===1&&!Tm(c,e.getBoundingClientRect())&&s(),v=!1}try{n=new IntersectionObserver(C,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,y)}n.observe(e)}return s(!0),l}function un(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,c=$u(e),d=o||l?[...c?In(c):[],...t?In(t):[]]:[];d.forEach(m=>{o&&m.addEventListener("scroll",n,{passive:!0}),l&&m.addEventListener("resize",n)});const p=c&&i?Px(c,n):null;let f=-1,g=null;s&&(g=new ResizeObserver(m=>{let[h]=m;h&&h.target===c&&g&&t&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=g)==null||y.observe(t)})),n()}),c&&!a&&g.observe(c),t&&g.observe(t));let x,b=a?lr(e):null;a&&S();function S(){const m=lr(e);b&&!Tm(b,m)&&n(),b=m,x=requestAnimationFrame(S)}return n(),()=>{var m;d.forEach(h=>{o&&h.removeEventListener("scroll",n),l&&h.removeEventListener("resize",n)}),p==null||p(),(m=g)==null||m.disconnect(),g=null,a&&cancelAnimationFrame(x)}}const _x=px,Ix=mx,Lx=cx,Ax=hx,Ox=(e,t,n)=>{const r=new Map,o={platform:Rx,...n},l={...o.platform,_c:r};return ux(e,t,{...o,platform:l})};var Dx=typeof document<"u",Mx=function(){},Kl=Dx?w.useLayoutEffect:Mx;function ks(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(!ks(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)&&!ks(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function Nm(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pd(e,t){const n=Nm(e);return Math.round(t*n)/n}function Ei(e){const t=w.useRef(e);return Kl(()=>{t.current=e}),t}function $x(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:s}={},transform:i=!0,whileElementsMounted:a,open:c}=e,[d,p]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=w.useState(r);ks(f,r)||g(r);const[x,b]=w.useState(null),[S,m]=w.useState(null),h=w.useCallback(R=>{R!==k.current&&(k.current=R,b(R))},[]),y=w.useCallback(R=>{R!==j.current&&(j.current=R,m(R))},[]),v=l||x,C=s||S,k=w.useRef(null),j=w.useRef(null),T=w.useRef(d),$=a!=null,_=Ei(a),W=Ei(o),O=Ei(c),P=w.useCallback(()=>{if(!k.current||!j.current)return;const R={placement:t,strategy:n,middleware:f};W.current&&(R.platform=W.current),Ox(k.current,j.current,R).then(L=>{const N={...L,isPositioned:O.current!==!1};A.current&&!ks(T.current,N)&&(T.current=N,Lu.flushSync(()=>{p(N)}))})},[f,t,n,W,O]);Kl(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,p(R=>({...R,isPositioned:!1})))},[c]);const A=w.useRef(!1);Kl(()=>(A.current=!0,()=>{A.current=!1}),[]),Kl(()=>{if(v&&(k.current=v),C&&(j.current=C),v&&C){if(_.current)return _.current(v,C,P);P()}},[v,C,P,_,$]);const X=w.useMemo(()=>({reference:k,floating:j,setReference:h,setFloating:y}),[h,y]),H=w.useMemo(()=>({reference:v,floating:C}),[v,C]),ne=w.useMemo(()=>{const R={position:n,left:0,top:0};if(!H.floating)return R;const L=pd(H.floating,d.x),N=pd(H.floating,d.y);return i?{...R,transform:"translate("+L+"px, "+N+"px)",...Nm(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:N}},[n,i,H.floating,d.x,d.y]);return w.useMemo(()=>({...d,update:P,refs:X,elements:H,floatingStyles:ne}),[d,P,X,H,ne])}const cn=(e,t)=>{const n=_x(e);return{name:n.name,fn:n.fn,options:[e,t]}},dn=(e,t)=>{const n=Ix(e);return{name:n.name,fn:n.fn,options:[e,t]}},fn=(e,t)=>{const n=Lx(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ma=(e,t)=>{const n=Ax(e);return{name:n.name,fn:n.fn,options:[e,t]}},zx="data-floating-ui-focusable",md="active",hd="selected",Kx={...Ud};let gd=!1,Fx=0;const yd=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Fx++;function Wx(){const[e,t]=w.useState(()=>gd?yd():void 0);return qn(()=>{e==null&&t(yd())},[]),w.useEffect(()=>{gd=!0},[]),e}const Vx=Kx.useId,Rm=Vx||Wx;function Hx(){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 Bx=w.createContext(null),Ux=w.createContext(null),Gx=()=>{var e;return((e=w.useContext(Bx))==null?void 0:e.id)||null},Pm=()=>w.useContext(Ux);function zu(e){return"data-floating-ui-"+e}const Yx={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},vd=w.forwardRef(function(t,n){const[r,o]=w.useState();qn(()=>{Qv()&&o("button")},[]);const l={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[zu("focus-guard")]:"",style:Yx};return u.jsx("span",{...t,...l})}),Qx={clipPath:"inset(50%)",position:"fixed",top:0,left:0},_m=w.createContext(null),xd=zu("portal");function Xx(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Rm(),o=Zx(),[l,s]=w.useState(null),i=w.useRef(null);return qn(()=>()=>{l==null||l.remove(),queueMicrotask(()=>{i.current=null})},[l]),qn(()=>{if(!r||i.current)return;const a=t?document.getElementById(t):null;if(!a)return;const c=document.createElement("div");c.id=r,c.setAttribute(xd,""),a.appendChild(c),i.current=c,s(c)},[t,r]),qn(()=>{if(n===null||!r||i.current)return;let a=n||(o==null?void 0:o.portalNode);a&&!Du(a)&&(a=a.current),a=a||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,a.appendChild(c));const d=document.createElement("div");d.id=r,d.setAttribute(xd,""),a=c||a,a.appendChild(d),i.current=d,s(d)},[t,n,r,o]),l}function pn(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,l=Xx({id:n,root:r}),[s,i]=w.useState(null),a=w.useRef(null),c=w.useRef(null),d=w.useRef(null),p=w.useRef(null),f=s==null?void 0:s.modal,g=s==null?void 0:s.open,x=!!s&&!s.modal&&s.open&&o&&!!(r||l);return w.useEffect(()=>{if(!l||!o||f)return;function b(S){l&&Ci(S)&&(S.type==="focusin"?ad:sx)(l)}return l.addEventListener("focusin",b,!0),l.addEventListener("focusout",b,!0),()=>{l.removeEventListener("focusin",b,!0),l.removeEventListener("focusout",b,!0)}},[l,o,f]),w.useEffect(()=>{l&&(g||ad(l))},[g,l]),u.jsxs(_m.Provider,{value:w.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:p,portalNode:l,setFocusManagerState:i}),[o,l]),children:[x&&l&&u.jsx(vd,{"data-type":"outside",ref:a,onFocus:b=>{if(Ci(b,l)){var S;(S=d.current)==null||S.focus()}else{const m=s?s.domReference:null,h=lx(m);h==null||h.focus()}}}),x&&l&&u.jsx("span",{"aria-owns":l.id,style:Qx}),l&&Lu.createPortal(t,l),x&&l&&u.jsx(vd,{"data-type":"outside",ref:c,onFocus:b=>{if(Ci(b,l)){var S;(S=p.current)==null||S.focus()}else{const m=s?s.domReference:null,h=ox(m);h==null||h.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,b.nativeEvent,"focus-out"))}}})]})}const Zx=()=>w.useContext(_m),Jx={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},qx={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},wd=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 sr(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:l}=e,{enabled:s=!0,escapeKey:i=!0,outsidePress:a=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:p="pointerdown",ancestorScroll:f=!1,bubbles:g,capture:x}=t,b=Pm(),S=vr(typeof a=="function"?a:()=>!1),m=typeof a=="function"?S:a,h=w.useRef(!1),{escapeKey:y,outsidePress:v}=wd(g),{escapeKey:C,outsidePress:k}=wd(x),j=w.useRef(!1),T=vr(A=>{var X;if(!n||!s||!i||A.key!=="Escape"||j.current)return;const H=(X=l.current.floatingContext)==null?void 0:X.nodeId,ne=b?zl(b.nodesRef.current,H):[];if(!y&&(A.stopPropagation(),ne.length>0)){let R=!0;if(ne.forEach(L=>{var N;if((N=L.context)!=null&&N.open&&!L.context.dataRef.current.__escapeKeyBubbles){R=!1;return}}),!R)return}r(!1,Jv(A)?A.nativeEvent:A,"escape-key")}),$=vr(A=>{var X;const H=()=>{var ne;T(A),(ne=go(A))==null||ne.removeEventListener("keydown",H)};(X=go(A))==null||X.addEventListener("keydown",H)}),_=vr(A=>{var X;const H=l.current.insideReactTree;l.current.insideReactTree=!1;const ne=h.current;if(h.current=!1,c==="click"&&ne||H||typeof m=="function"&&!m(A))return;const R=go(A),L="["+zu("inert")+"]",N=Qo(o.floating).querySelectorAll(L);let z=Pe(R)?R:null;for(;z&&!tn(z);){const ae=an(z);if(tn(ae)||!Pe(ae))break;z=ae}if(N.length&&Pe(R)&&!Zv(R)&&!Da(R,o.floating)&&Array.from(N).every(ae=>!Da(z,ae)))return;if(Kt(R)&&P){const ae=tn(R),se=kt(R),_e=/auto|scroll/,ye=ae||_e.test(se.overflowX),eo=ae||_e.test(se.overflowY),to=ye&&R.clientWidth>0&&R.scrollWidth>R.clientWidth,pr=eo&&R.clientHeight>0&&R.scrollHeight>R.clientHeight,no=se.direction==="rtl",ro=pr&&(no?A.offsetX<=R.offsetWidth-R.clientWidth:A.offsetX>R.clientWidth),Ft=to&&A.offsetY>R.clientHeight;if(ro||Ft)return}const V=(X=l.current.floatingContext)==null?void 0:X.nodeId,me=b&&zl(b.nodesRef.current,V).some(ae=>{var se;return ki(A,(se=ae.context)==null?void 0:se.elements.floating)});if(ki(A,o.floating)||ki(A,o.domReference)||me)return;const be=b?zl(b.nodesRef.current,V):[];if(be.length>0){let ae=!0;if(be.forEach(se=>{var _e;if((_e=se.context)!=null&&_e.open&&!se.context.dataRef.current.__outsidePressBubbles){ae=!1;return}}),!ae)return}r(!1,A,"outside-press")}),W=vr(A=>{var X;const H=()=>{var ne;_(A),(ne=go(A))==null||ne.removeEventListener(c,H)};(X=go(A))==null||X.addEventListener(c,H)});w.useEffect(()=>{if(!n||!s)return;l.current.__escapeKeyBubbles=y,l.current.__outsidePressBubbles=v;let A=-1;function X(N){r(!1,N,"ancestor-scroll")}function H(){window.clearTimeout(A),j.current=!0}function ne(){A=window.setTimeout(()=>{j.current=!1},Ws()?5:0)}const R=Qo(o.floating);i&&(R.addEventListener("keydown",C?$:T,C),R.addEventListener("compositionstart",H),R.addEventListener("compositionend",ne)),m&&R.addEventListener(c,k?W:_,k);let L=[];return f&&(Pe(o.domReference)&&(L=In(o.domReference)),Pe(o.floating)&&(L=L.concat(In(o.floating))),!Pe(o.reference)&&o.reference&&o.reference.contextElement&&(L=L.concat(In(o.reference.contextElement)))),L=L.filter(N=>{var z;return N!==((z=R.defaultView)==null?void 0:z.visualViewport)}),L.forEach(N=>{N.addEventListener("scroll",X,{passive:!0})}),()=>{i&&(R.removeEventListener("keydown",C?$:T,C),R.removeEventListener("compositionstart",H),R.removeEventListener("compositionend",ne)),m&&R.removeEventListener(c,k?W:_,k),L.forEach(N=>{N.removeEventListener("scroll",X)}),window.clearTimeout(A)}},[l,o,i,m,c,n,r,f,s,y,v,T,C,$,_,k,W]),w.useEffect(()=>{l.current.insideReactTree=!1},[l,m,c]);const O=w.useMemo(()=>({onKeyDown:T,...d&&{[Jx[p]]:A=>{r(!1,A.nativeEvent,"reference-press")},...p!=="click"&&{onClick(A){r(!1,A.nativeEvent,"reference-press")}}}}),[T,r,d,p]),P=w.useMemo(()=>{function A(X){X.button===0&&(h.current=!0)}return{onKeyDown:T,onMouseDown:A,onMouseUp:A,[qx[c]]:()=>{l.current.insideReactTree=!0}}},[T,c,l]);return w.useMemo(()=>s?{reference:O,floating:P}:{},[s,O,P])}function e0(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Rm(),l=w.useRef({}),[s]=w.useState(()=>Hx()),i=Gx()!=null,[a,c]=w.useState(r.reference),d=vr((g,x,b)=>{l.current.openEvent=g?x:void 0,s.emit("openchange",{open:g,event:x,reason:b,nested:i}),n==null||n(g,x,b)}),p=w.useMemo(()=>({setPositionReference:c}),[]),f=w.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return w.useMemo(()=>({dataRef:l,open:t,onOpenChange:d,elements:f,events:s,floatingId:o,refs:p}),[t,d,f,s,o,p])}function mn(e){e===void 0&&(e={});const{nodeId:t}=e,n=e0({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[l,s]=w.useState(null),[i,a]=w.useState(null),d=(o==null?void 0:o.domReference)||l,p=w.useRef(null),f=Pm();qn(()=>{d&&(p.current=d)},[d]);const g=$x({...e,elements:{...o,...i&&{reference:i}}}),x=w.useCallback(y=>{const v=Pe(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),getClientRects:()=>y.getClientRects(),contextElement:y}:y;a(v),g.refs.setReference(v)},[g.refs]),b=w.useCallback(y=>{(Pe(y)||y===null)&&(p.current=y,s(y)),(Pe(g.refs.reference.current)||g.refs.reference.current===null||y!==null&&!Pe(y))&&g.refs.setReference(y)},[g.refs]),S=w.useMemo(()=>({...g.refs,setReference:b,setPositionReference:x,domReference:p}),[g.refs,b,x]),m=w.useMemo(()=>({...g.elements,domReference:d}),[g.elements,d]),h=w.useMemo(()=>({...g,...r,refs:S,elements:m,nodeId:t}),[g,S,m,t,r]);return qn(()=>{r.dataRef.current.floatingContext=h;const y=f==null?void 0:f.nodesRef.current.find(v=>v.id===t);y&&(y.context=h)}),w.useMemo(()=>({...g,context:h,refs:S,elements:m}),[g,S,m,h])}function Ti(e,t,n){const r=new Map,o=n==="item";let l=e;if(o&&e){const{[md]:s,[hd]:i,...a}=e;l=a}return{...n==="floating"&&{tabIndex:-1,[zx]:""},...l,...t.map(s=>{const i=s?s[n]:null;return typeof i=="function"?e?i(e):null:i}).concat(e).reduce((s,i)=>(i&&Object.entries(i).forEach(a=>{let[c,d]=a;if(!(o&&[md,hd].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof d=="function"){var p;(p=r.get(c))==null||p.push(d),s[c]=function(){for(var f,g=arguments.length,x=new Array(g),b=0;b<g;b++)x[b]=arguments[b];return(f=r.get(c))==null?void 0:f.map(S=>S(...x)).find(S=>S!==void 0)}}}else s[c]=d}),s),{})}}function ir(e){e===void 0&&(e=[]);const t=e.map(i=>i==null?void 0:i.reference),n=e.map(i=>i==null?void 0:i.floating),r=e.map(i=>i==null?void 0:i.item),o=w.useCallback(i=>Ti(i,e,"reference"),t),l=w.useCallback(i=>Ti(i,e,"floating"),n),s=w.useCallback(i=>Ti(i,e,"item"),r);return w.useMemo(()=>({getReferenceProps:o,getFloatingProps:l,getItemProps:s}),[o,l,s])}const ar={"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"}},t0=(()=>{const e=new Map;for(const[t,n]of Object.entries(ar)){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})(),n0=(()=>{const e=new Map;for(const[t,n]of Object.entries(ar))n.controlGroup&&(e.has(n.controlGroup)||e.set(n.controlGroup,new Set),e.get(n.controlGroup).add(t));return e})();function r0(){const e={};for(const[t,n]of Object.entries(ar))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 o0(){const e={spacing:[],sizing:[],typography:[],color:[],borders:[],effects:[],layout:[],flexbox:[],gradient:[]},t=new Set;for(const[n,r]of Object.entries(ar)){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,i=>i.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 Fl({prefix:e,currentValue:t,colors:n,locked:r,lockedValue:o,onHover:l,onLeave:s,onClick:i,onRemove:a,onRemoveHover:c}){return u.jsxs("div",{className:"p-2 bg-bv-surface border border-bv-border rounded-md my-2",onMouseLeave:()=>{r||s()},children:[u.jsxs("div",{className:"flex items-center gap-0.5 mb-0.5",children:[u.jsx("span",{className:"w-[52px] text-[10px] text-bv-muted text-right pr-1.5 shrink-0"}),a&&u.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:a,children:u.jsxs("svg",{viewBox:"0 0 10 10",width:"14",height:"14",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"}),u.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"})]})}),["black","white","transparent"].map(d=>n[d]!==void 0?u.jsx(bd,{prefix:e,colorName:d,colorValue:n[d],isCurrent:d===t,isLocked:o===`${e}${d}`,locked:r,onHover:l,onClick:i},d):null)]}),Py.map(d=>{const p=n[d];return!p||typeof p!="object"?null:u.jsxs("div",{className:"flex items-center gap-0.5 mb-0.5",children:[u.jsx("span",{className:"w-[52px] text-[10px] text-bv-muted text-right pr-1.5 shrink-0",children:d}),_y.map(f=>p[f]!==void 0?u.jsx(bd,{prefix:e,colorName:`${d}-${f}`,colorValue:p[f],isCurrent:`${d}-${f}`===t,isLocked:o===`${e}${d}-${f}`,locked:r,onHover:l,onClick:i},`${d}-${f}`):null)]},d)})]})}function bd({prefix:e,colorName:t,colorValue:n,isCurrent:r,isLocked:o,locked:l,onHover:s,onClick:i}){const a=`${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",d=t==="transparent"?{background:"repeating-conic-gradient(#808080 0% 25%, transparent 0% 50%) 50% / 8px 8px"}:{backgroundColor:n};return u.jsx("div",{title:a,className:`w-5 h-5 rounded cursor-pointer border-2 shrink-0 transition-[border-color,transform] ${c}`,style:d,onMouseEnter:()=>{l||s(a)},onClick:p=>{p.stopPropagation(),i(a)}})}const fr=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})},[]),u.jsx("div",{ref:s=>{l.current=s,typeof o=="function"?o(s):o&&(o.current=s)},tabIndex:-1,onBlur:s=>{var i;(i=l.current)!=null&&i.contains(s.relatedTarget)||t()},onKeyDown:s=>{s.code==="Escape"&&t()},...r,children:n})}),l0=4,s0=10;function xn({values:e,currentValue:t,lockedValue:n,locked:r,ghost:o,onStart:l,onHover:s,onLeave:i,onClick:a,onRemove:c,onRemoveHover:d}){const[p,f]=w.useState(!1),[g,x]=w.useState(null),b=w.useRef(null),S=w.useRef(null),m=w.useRef(null),{refs:h,floatingStyles:y}=mn({open:p,strategy:"fixed",placement:"bottom-start",middleware:[cn(2),fn(),dn({padding:4})],whileElementsMounted:un}),v=n!==null&&e.includes(n),C=g!==null?e[g]:v?n:t;w.useEffect(()=>{var O,P;p&&m.current&&((P=(O=m.current).scrollIntoView)==null||P.call(O,{block:"nearest"}))},[p]);const k=r&&!v;function j(O){if(k)return;l==null||l();const P=v?n:t,A=e.indexOf(P);b.current={startX:O.clientX,startIndex:A>=0?A:0,didScrub:!1},O.currentTarget.setPointerCapture(O.pointerId),O.preventDefault()}function T(O){const P=b.current;if(!P)return;const A=O.clientX-P.startX;if(!P.didScrub&&Math.abs(A)>l0&&(P.didScrub=!0,f(!1)),P.didScrub){const X=Math.round(A/s0),H=Math.max(0,Math.min(e.length-1,P.startIndex+X));x(H),s(e[H])}}function $(){const O=b.current;O&&(O.didScrub&&g!==null?a(e[g]):O.didScrub||f(P=>(P&&i(),!P)),x(null),b.current=null)}const _=g!==null,W=_?"bg-bv-teal/9 text-bv-teal ring-1 ring-bv-teal":v?"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":p?"bg-bv-surface-hi text-bv-text ring-1 ring-bv-border":k?"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 u.jsxs("div",{ref:S,className:"relative inline-block",children:[u.jsxs("div",{ref:h.setReference,className:`group select-none px-2 py-0.5 rounded-md text-[11px] font-mono transition-colors ${k?"cursor-default":"cursor-ew-resize"} ${W}`,onPointerDown:j,onPointerMove:T,onPointerUp:$,children:[!k&&u.jsx("span",{className:`inline-block mr-0.5 text-[9px] transition-opacity ${_?"opacity-100":"opacity-0 group-hover:opacity-50"}`,children:"‹"}),C,!k&&u.jsx("span",{className:`inline-block ml-0.5 text-[9px] transition-opacity ${_?"opacity-100":"opacity-0 group-hover:opacity-50"}`,children:"›"})]}),p&&u.jsx(pn,{children:u.jsxs(fr,{ref:h.setFloating,style:y,className:"z-50 max-h-52 overflow-y-auto bg-bv-bg border border-bv-border rounded-md shadow-md min-w-[5rem]",onPointerDown:O=>O.stopPropagation(),onMouseLeave:i,onClose:()=>{f(!1),i()},children:[c&&u.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:d,onClick:O=>{O.stopPropagation(),c(),f(!1)},children:[u.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:[u.jsx("circle",{cx:"6",cy:"6",r:"5.5"}),u.jsx("line",{x1:"4",y1:"4",x2:"8",y2:"8"}),u.jsx("line",{x1:"8",y1:"4",x2:"4",y2:"8"})]}),"remove"]}),e.map(O=>{const P=O===(n??t),A=P?"bg-bv-teal/9 text-bv-teal":"text-bv-text-mid hover:bg-bv-surface hover:text-bv-text";return u.jsx("div",{ref:P?m:void 0,className:`px-2.5 py-[3px] text-[11px] font-mono cursor-pointer ${A}`,onMouseEnter:()=>s(O),onClick:X=>{X.stopPropagation(),a(O),f(!1)},children:O},O)})]})})]})}const i0={px:.0625};function Ir(e){return isNaN(Number(e))?i0[e]??1/0:Number(e)}function hr(e,t,n){return t==="spacing"&&(n!=null&&n.spacing)?Object.keys(n.spacing).sort((o,l)=>Ir(o)-Ir(l)).map(o=>`${e}${o}`):t==="fontSize"?[...ky]:t==="fontWeight"?[...Cy]:t==="borderRadius"?Ra:t==="lineHeight"?[...jy]:t==="letterSpacing"?[...Ey]:t==="opacity"?Ty:[]}const a0=4,u0=10;function Kr({placeholder:e,values:t,currentValue:n,displayValue:r,formatValue:o,axis:l="x",disabled:s,onHover:i,onLeave:a,onClick:c,onScrubStart:d,onScrubEnd:p,onOpen:f,onClose:g,onRemove:x,onRemoveHover:b}){const[S,m]=w.useState(!1),[h,y]=w.useState(null),v=w.useRef(null),C=w.useRef(null),k=w.useRef(null),{refs:j,floatingStyles:T}=mn({open:S,strategy:"fixed",placement:"bottom-start",middleware:[cn(4),fn(),dn({padding:4})],whileElementsMounted:un}),$=n!=null,_=n?t.indexOf(n):-1,W=h!==null?t[h]:null,O=W?o?o(W):W:r??e;w.useEffect(()=>{var N,z;S&&k.current&&((z=(N=k.current).scrollIntoView)==null||z.call(N,{block:"nearest"}))},[S]);function P(N){var V,me;if(s)return;N.preventDefault(),N.stopPropagation();const z=_>=0?_:0;v.current={startX:N.clientX,startY:N.clientY,startIndex:z,didScrub:!1},(me=(V=N.target).setPointerCapture)==null||me.call(V,N.pointerId)}function A(N){const z=v.current;if(!z)return;const V=l==="y"?-(N.clientY-z.startY):N.clientX-z.startX;if(!z.didScrub&&Math.abs(V)>a0&&(z.didScrub=!0,m(!1),d==null||d()),z.didScrub){const me=Math.round(V/u0),be=Math.max(0,Math.min(t.length-1,z.startIndex+me));y(be),i==null||i(t[be])}}function X(){const N=v.current;N&&(N.didScrub&&h!==null?(c==null||c(t[h]),y(null),v.current=null,p==null||p()):N.didScrub||(y(null),v.current=null,m(z=>z?(g==null||g(),a==null||a(),!1):(f==null||f(),!0))))}const H=h!==null,R=["bm-slot",$||H?"bm-has-val":"",H?"bm-scrubbing":""].filter(Boolean).join(" "),L=s?"default":l==="y"?"ns-resize":"ew-resize";return u.jsxs("span",{ref:N=>{C.current=N,j.setReference(N)},className:R,style:{position:"relative",cursor:L},onPointerDown:P,onPointerMove:A,onPointerUp:X,role:"button",tabIndex:s?-1:0,children:[O,S&&u.jsx(pn,{children:u.jsxs(fr,{ref:j.setFloating,style:T,className:"bm-mini-dropdown",onClick:N=>N.stopPropagation(),onMouseLeave:()=>a==null?void 0:a(),onPointerDown:N=>N.stopPropagation(),onMouseDown:N=>{N.stopPropagation(),N.preventDefault()},onClose:()=>{m(!1),g==null||g(),a==null||a()},children:[x&&u.jsxs("div",{className:"bm-mini-dropdown-item bm-mini-dropdown-remove",tabIndex:-1,onMouseEnter:b,onMouseDown:N=>{N.preventDefault(),x(),m(!1),g==null||g()},children:[u.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:[u.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"}),u.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"})]}),"remove"]}),t.map(N=>{const z=N===n;return u.jsx("div",{ref:z?k:void 0,tabIndex:-1,className:`bm-mini-dropdown-item${z?" bm-active":""}`,onMouseEnter:()=>i==null?void 0:i(N),onMouseDown:V=>{V.preventDefault(),c==null||c(N),m(!1),g==null||g()},onClick:V=>{V.detail===0&&(V.stopPropagation(),c==null||c(N),m(!1),g==null||g())},onKeyDown:V=>{(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),c==null||c(N),m(!1),g==null||g())},children:N},N)})]})})]})}function Sd(e,t){const r={padding:"p",margin:"m",border:"border-",outline:"outline-"}[t];return e.startsWith(r)?e.slice(r.length):e}function c0({value:e,placeholder:t,layer:n,frozen:r,scaleValues:o,axis:l,onClick:s,onValueChange:i,onValueHover:a,onValueLeave:c,onScrubStart:d,onScrubEnd:p,onOpen:f,onClose:g,onValueRemove:x,onValueRemoveHover:b}){const S=e!=null,m=S?Sd(e,n):null;if(o&&o.length>0)return u.jsx(Kr,{placeholder:t,values:o,currentValue:e,displayValue:m,formatValue:y=>Sd(y,n),axis:l,disabled:r,onHover:a,onLeave:c,onClick:i,onScrubStart:d,onScrubEnd:p,onOpen:f,onClose:g,onRemove:x,onRemoveHover:b});const h=`bm-slot${S?" bm-has-val":""}`;return u.jsx("span",{className:h,onClick:r?void 0:y=>s==null?void 0:s(y.currentTarget),role:"button",tabIndex:r?-1:0,children:m??t})}const d0={top:["y","t"],right:["r"],bottom:["b"],left:["x","l"],tr:["color"],bl:["style"],br:["offset"]},f0={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"]},p0={top:"y",bottom:"y",left:"x",right:"x",tr:"x",bl:"x",br:"x"};function m0({layer:e,classState:t,shorthandValue:n,shorthandScaleValues:r,slots:o,isHovered:l,frozen:s,onHoverChange:i,onSlotClick:a,onSlotChange:c,onSlotHover:d,onScrubStart:p,onScrubEnd:f,onSlotOpen:g,onSlotClose:x,onSlotRemove:b,onSlotRemoveHover:S,children:m}){const h=`bm-layer bm-${e}${l?" bm-hovered":""}`,[y,v]=w.useState(null),C=new Map(o.map(O=>[O.key,O])),k=(t==="shorthand"||t==="mixed")&&n,j=r&&r.length>0?u.jsx("span",{className:"bm-name bm-name-scrubber",children:u.jsx(Kr,{placeholder:e,values:r,currentValue:k?n:null,displayValue:k?n:null,formatValue:O=>O,axis:"x",disabled:s,onHover:O=>d==null?void 0:d("shorthand",O),onLeave:()=>d==null?void 0:d("shorthand",null),onClick:O=>c==null?void 0:c("shorthand",O),onScrubStart:()=>{p==null||p()},onScrubEnd:f,onOpen:()=>{v("__shorthand__"),g==null||g()},onClose:()=>{v(null),x==null||x()},onRemove:b?()=>b("shorthand"):void 0,onRemoveHover:S?()=>S("shorthand"):void 0})}):k?u.jsx("span",{className:"bm-name",children:u.jsx("span",{className:"bm-val",onClick:O=>a==null?void 0:a("shorthand",O.currentTarget),children:n})}):u.jsx("span",{className:"bm-name",children:e}),$=(f0[e]??[]).map(O=>{const A=(d0[O]??[]).map(L=>C.get(L)).filter(L=>L!=null);if(A.length===0)return null;const X=A.some(L=>L.value!=null),ne=`bm-slot-group bm-sg-${O}${X?" bm-has-values":""}${y===O?" bm-sg-active":""}`,R=p0[O];return u.jsx("div",{className:ne,children:A.map(L=>u.jsx(c0,{slotKey:L.key,value:L.value,placeholder:L.placeholder,layer:e,isExpanded:l,frozen:s,scaleValues:L.scaleValues,axis:R,onClick:N=>a==null?void 0:a(L.key,N),onValueChange:c?N=>c(L.key,N):void 0,onValueHover:d?N=>d(L.key,N):void 0,onValueLeave:d?()=>d(L.key,null):void 0,onScrubStart:p,onScrubEnd:f,onOpen:()=>{v(O),g==null||g()},onClose:()=>{v(null),x==null||x()},onValueRemove:b?()=>b(L.key):void 0,onValueRemoveHover:S?()=>S(L.key):void 0},L.key))},O)}),_=O=>{O.stopPropagation(),s||i(!0)},W=O=>{const P=O.relatedTarget,A=O.currentTarget;P&&A.contains(P)||s||i(!1)};return u.jsxs("div",{className:h,onMouseOver:_,onMouseOut:W,"data-layer":e,children:[j,$,m]})}const kd=["margin","outline","border","padding"];function h0({layers:e,frozen:t=!1,onSlotClick:n,onSlotChange:r,onSlotHover:o,onSlotRemove:l,onSlotRemoveHover:s,onEditStart:i}){const[a,c]=w.useState(null),[d,p]=w.useState(null),f=t||d!==null,g=new Map(e.map(y=>[y.layer,y])),x=(y,v)=>{f||c(v?y:null)},b=(y,v,C)=>{f||n==null||n(y,v,C)};let m=u.jsx("div",{className:"bm-content"});for(let y=kd.length-1;y>=0;y--){const v=kd[y],C=g.get(v);C&&(m=u.jsx(m0,{layer:C.layer,classState:C.classState,shorthandValue:C.shorthandValue,shorthandScaleValues:C.shorthandScaleValues,slots:C.slots,isHovered:a===v||d===v,frozen:f,onHoverChange:k=>x(v,k),onSlotClick:(k,j)=>b(v,k,j),onSlotChange:r?(k,j)=>r(v,k,j):void 0,onSlotHover:o?(k,j)=>o(v,k,j):void 0,onSlotRemove:l?k=>l(v,k):void 0,onSlotRemoveHover:s?k=>s(v,k):void 0,onScrubStart:()=>{p(v),i==null||i()},onScrubEnd:()=>p(null),onSlotOpen:()=>{p(v),i==null||i()},onSlotClose:()=>p(null),children:m}))}const h=`bm-root${f?" bm-frozen":""}`;return u.jsx("div",{className:h,children:m})}const g0={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"}},y0=["y","t","r","b","x","l"];function v0(e){const t=y0.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 x0(e,t){const n=g0[e],r=v0(e),o=t[n.shorthand]??null,l=o!=null?o===""?n.shorthand:`${n.shorthand}-${o}`:null,s=r.map(({key:f,placeholder:g})=>{let x;if(f==="color"){const m=e==="outline"?"outline-color":"border-color";x=m in t?m:void 0}else if(f==="style"){const m=e==="outline"?"outline-style":"border-style";x=m in t?m:void 0}else f==="offset"?x="outline-offset"in t?"outline-offset":void 0:x=n[f];const b=x?t[x]??null:null;let S;return(f==="color"||f==="style")&&b!=null?S=`${e==="outline"?"outline":"border"}-${b}`:S=b!=null&&x?`${x}-${b}`:null,{key:f,value:S,placeholder:g}}),i=l!=null,a=s.some(f=>(f.key==="x"||f.key==="y")&&f.value!=null),c=s.some(f=>(f.key==="t"||f.key==="r"||f.key==="b"||f.key==="l")&&f.value!=null),d=a||c;let p;return!i&&!d?p="none":i&&!d?p="shorthand":!i&&a&&!c?p="axis":i?p="mixed":p="individual",{layer:e,classState:p,shorthandValue:l,slots:s}}function w0(e,t,n){var s,i,a;if(t==="color")return[];if(t==="style"){const c=e==="outline"?"outline":"border";return Ry.map(d=>`${c}-${d}`)}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,d)=>Ir(c)-Ir(d)):Pa:r=(i=n==null?void 0:n.theme)!=null&&i.borderWidth?Object.keys(n.theme.borderWidth):Jp:r=(a=n==null?void 0:n.theme)!=null&&a.spacing?Object.keys(n.theme.spacing).sort((c,d)=>Ir(c)-Ir(d)):Pa;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 gr(e,t){const n={};for(const s of e){let i;s.color!==void 0?i=`${s.property}-color`:s.style!==void 0?i=`${s.property}-style`:s.side!==void 0?i=s.property.length<=2?s.property+s.side:`${s.property}-${s.side}`:i=s.property;const a=s.scale??s.color??s.style??s.align??s.size??s.value??"";n[i]=a}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 p,f;const i=x0(s,n),a=i.slots.map(g=>{const x=w0(s,g.key,t);return x.length>0?{...g,scaleValues:x}:g}),d=(o[s]?(p=t==null?void 0:t.theme)!=null&&p.borderWidth?Object.keys(t.theme.borderWidth):Jp:(f=t==null?void 0:t.theme)!=null&&f.spacing?Object.keys(t.theme.spacing):Pa).map(g=>g===""?r[s]:`${r[s]}-${g}`);return{...i,slots:a,shorthandScaleValues:d}})}const b0={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]},S0={tl:"x",t:"x",tr:"x",l:"y",all:"x",r:"y",bl:"x",b:"x",br:"x"};function Ni(e){return e==="rounded"?"—":e.replace(/^rounded-/,"").replace(/^(?:tl|tr|br|bl|[trbl])-/,"")}function k0({slot:e,frozen:t,isActive:n,onSlotClick:r,onSlotChange:o,onSlotHover:l,onSlotRemove:s,onSlotRemoveHover:i,onScrubStart:a,onScrubEnd:c,onOpen:d,onClose:p}){const[f,g]=b0[e.key],x=e.value!=null,b=`cm-slot${x?" cm-has-val":""}`,S=e.key==="all"?"cm-cell cm-cell-all cm-content":`cm-cell cm-cell-${e.key}`,m={gridRow:f,gridColumn:g},h=S0[e.key];return e.scaleValues&&e.scaleValues.length>0?u.jsx("div",{className:S,style:m,children:u.jsx(Kr,{placeholder:e.placeholder,values:e.scaleValues,currentValue:e.value,displayValue:x?Ni(e.value):null,formatValue:Ni,axis:h,disabled:t,onHover:y=>l(e.key,y),onLeave:()=>l(e.key,null),onClick:y=>o(e.key,y),onScrubStart:()=>a(e.key),onScrubEnd:c,onOpen:()=>d(e.key),onClose:p,onRemove:s?()=>s(e.key):void 0,onRemoveHover:i?()=>i(e.key):void 0})}):u.jsx("div",{className:S,style:m,children:u.jsx("span",{className:b,role:"button",tabIndex:t?-1:0,onClick:t?void 0:y=>r(e.key,y.currentTarget),children:x?Ni(e.value):e.placeholder})})}function C0({state:e,frozen:t=!1,onSlotClick:n,onSlotChange:r,onSlotHover:o,onSlotRemove:l,onSlotRemoveHover:s,onEditStart:i}){const[a,c]=w.useState(null),d=t||a!==null,p=new Map(e.slots.map(b=>[b.key,b])),f=p.get("all")??{key:"all",value:e.shorthandValue,placeholder:"all",scaleValues:e.shorthandScaleValues},g=["tl","t","tr","l","all","r","bl","b","br"],x=`cm-root${d?" cm-frozen":""}${a?" cm-active":""}`;return u.jsx("div",{className:x,children:u.jsx("div",{className:"cm-grid",children:g.map(b=>{const S=b==="all"?f:p.get(b)??{key:b,value:null,placeholder:b,scaleValues:void 0};return u.jsx(k0,{slot:S,frozen:d,isActive:a===b,onSlotClick:(m,h)=>n==null?void 0:n(m,h),onSlotChange:(m,h)=>r==null?void 0:r(m,h),onSlotHover:(m,h)=>o==null?void 0:o(m,h),onSlotRemove:l,onSlotRemoveHover:s,onScrubStart:m=>{c(m),i==null||i()},onScrubEnd:()=>c(null),onOpen:m=>{c(m),i==null||i()},onClose:()=>c(null)},b)})})})}function Cd({label:e,availableProperties:t=[],onAddProperty:n,isEmpty:r=!1,classCount:o=0,children:l}){const[s,i]=w.useState(!1),[a,c]=w.useState(r),d=w.useRef(r),p=w.useRef(null);w.useEffect(()=>{d.current&&!r&&c(!1),d.current=r},[r]),w.useEffect(()=>{if(!s)return;function g(x){p.current&&!p.current.contains(x.target)&&i(!1)}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[s]);function f(g){n==null||n(g),i(!1)}return u.jsxs("div",{className:"px-4 py-3",children:[u.jsxs("div",{className:"group/sec flex items-center gap-1.5 cursor-pointer select-none",onClick:()=>c(g=>!g),children:[u.jsx("svg",{className:`w-3 h-3 text-bv-muted transition-transform ${a?"":"rotate-90"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})}),u.jsx("span",{className:"text-[10px] font-semibold text-bv-text",children:e}),a&&o>0&&u.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&&u.jsxs("div",{ref:p,className:"relative ml-auto",children:[u.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:g=>{g.stopPropagation(),i(x=>!x)},children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M12 5v14m-7-7h14"})})}),s&&u.jsx(fr,{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:()=>i(!1),children:t.map(g=>u.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:()=>f(g.prefix),children:[g.name,u.jsx("span",{className:"font-mono text-[10px] text-bv-muted group-hover:text-bv-teal/60",children:g.prefixHint})]},g.prefix))})]})]}),u.jsx("div",{className:`overflow-hidden transition-[max-height,opacity] duration-200 ease-in-out ${a?"max-h-0 opacity-0":"max-h-[600px] opacity-100"}`,children:r?u.jsxs("div",{className:"text-[10px] text-bv-muted italic mt-2",children:["No ",e.toLowerCase()," classes — click + to add"]}):u.jsx("div",{className:"flex flex-wrap gap-1 mt-2.5",children:l})})]})}const j0=[{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 E0({direction:e,mode:t,onHover:n,onLeave:r,onDirectionClick:o,onSolidClick:l,solidColorName:s}){const i=t==="solid";return u.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[u.jsx("div",{className:"grid grid-cols-3 gap-0.5",onMouseLeave:r,children:j0.map((a,c)=>{if(a==="center"){const p=i;return u.jsx("button",{type:"button",className:`w-5 h-5 rounded-[3px] flex items-center justify-center text-xs cursor-pointer transition-all duration-150
|
|
57
|
-
${p?"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 d=!i&&e===
|
|
56
|
+
*/var Av=["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] *)"],Aa=Av.join(","),hm=typeof Element>"u",Yo=hm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,bs=!hm&&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},Ss=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]"):Ss(t.parentNode));return s},Ov=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Dv=function(t,n,r){if(Ss(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Aa));return n&&Yo.call(t,Aa)&&o.unshift(t),o=o.filter(r),o},Oa=function(t,n,r){for(var o=[],l=Array.from(t);l.length;){var s=l.shift();if(!Ss(s,!1))if(s.tagName==="SLOT"){var i=s.assignedElements(),u=i.length?i:s.children,c=Oa(u,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:s,candidates:c})}else{var d=Yo.call(s,Aa);d&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var p=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),f=!Ss(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(p&&f){var g=Oa(p===!0?s.children:p.children,!0,r);r.flatten?o.push.apply(o,g):o.push({scopeParent:s,candidates:g})}else l.unshift.apply(l,s.children)}}return o},gm=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ym=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Ov(t))&&!gm(t)?0:t.tabIndex},Mv=function(t,n){var r=ym(t);return r<0&&n&&!gm(t)?0:r},$v=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},vm=function(t){return t.tagName==="INPUT"},zv=function(t){return vm(t)&&t.type==="hidden"},Kv=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Fv=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Wv=function(t){if(!t.name)return!0;var n=t.form||bs(t),r=function(i){return n.querySelectorAll('input[type="radio"][name="'+i+'"]')},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=Fv(o,t.form);return!l||l===t},Vv=function(t){return vm(t)&&t.type==="radio"},Hv=function(t){return Vv(t)&&!Wv(t)},Bv=function(t){var n,r=t&&bs(t),o=(n=r)===null||n===void 0?void 0:n.host,l=!1;if(r&&r!==t){var s,i,u;for(l=!!((s=o)!==null&&s!==void 0&&(i=s.ownerDocument)!==null&&i!==void 0&&i.contains(o)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!l&&o;){var c,d,p;r=bs(o),o=(c=r)===null||c===void 0?void 0:c.host,l=!!((d=o)!==null&&d!==void 0&&(p=d.ownerDocument)!==null&&p!==void 0&&p.contains(o))}}return l},id=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},Uv=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=Yo.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(Yo.call(i,"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,d=bs(t);if(c&&!c.shadowRoot&&o(c)===!0)return id(t);t.assignedSlot?t=t.assignedSlot:!c&&d!==t.ownerDocument?t=d.host:t=c}t=u}if(Bv(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return id(t);return!1},Gv=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 Yo.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Yv=function(t,n){return!(n.disabled||zv(n)||Uv(n,t)||Kv(n)||Gv(n))},ad=function(t,n){return!(Hv(n)||ym(n)<0||!Yv(t,n))},Qv=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},xm=function(t){var n=[],r=[];return t.forEach(function(o,l){var s=!!o.scopeParent,i=s?o.scopeParent:o,u=Mv(i,s),c=s?xm(o.candidates):i;u===0?s?n.push.apply(n,c):n.push(i):r.push({documentOrder:l,tabIndex:u,item:o,isScope:s,content:c})}),r.sort($v).reduce(function(o,l){return l.isScope?o.push.apply(o,l.content):o.push(l.content),o},[]).concat(n)},wm=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Oa([t],n.includeContainer,{filter:ad.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Qv}):r=Dv(t,n.includeContainer,ad.bind(null,n)),xm(r)};function Xv(){return/apple/i.test(navigator.vendor)}function Zv(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 Da(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&_a(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function go(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ki(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 Jv(e){return e.matches("html,body")}function Qo(e){return(e==null?void 0:e.ownerDocument)||document}function zl(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,...zl(e,o.id,n)])}function qv(e){return"nativeEvent"in e}var ex=typeof document<"u",tx=function(){},qn=ex?w.useLayoutEffect:tx;const nx={...Gd},rx=nx.useInsertionEffect,ox=rx||(e=>e());function vr(e){const t=w.useRef(()=>{});return ox(()=>{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 bm=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Sm(e,t){const n=wm(e,bm()),r=n.length;if(r===0)return;const o=Zv(Qo(e)),l=n.indexOf(o),s=l===-1?t===1?0:r-1:l+t;return n[s]}function lx(e){return Sm(Qo(e).body,1)||e}function sx(e){return Sm(Qo(e).body,-1)||e}function Ci(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Da(n,r)}function ix(e){wm(e,bm()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ud(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 cd(e,t,n){let{reference:r,floating:o}=e;const l=qt(t),s=mm(t),i=pm(s),u=On(t),c=l==="y",d=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,f=r[i]/2-o[i]/2;let g;switch(u){case"top":g={x:d,y:r.y-o.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-o.width,y:p};break;default:g={x:r.x,y:r.y}}switch(rl(t)){case"start":g[s]-=f*(n&&c?-1:1);break;case"end":g[s]+=f*(n&&c?-1:1);break}return g}async function ax(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:l,rects:s,elements:i,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:f=!1,padding:g=0}=nl(t,e),x=Lv(g),S=i[f?p==="floating"?"reference":"floating":p],m=ws(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(i.floating)),boundary:c,rootBoundary:d,strategy:u})),h=p==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(l.getOffsetParent==null?void 0:l.getOffsetParent(i.floating)),v=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},C=ws(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:h,offsetParent:y,strategy:u}):h);return{top:(m.top-C.top+x.top)/v.y,bottom:(C.bottom-m.bottom+x.bottom)/v.y,left:(m.left-C.left+x.left)/v.x,right:(C.right-m.right+x.right)/v.x}}const ux=50,cx=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:s}=n,i=s.detectOverflow?s:{...s,detectOverflow:ax},u=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:p}=cd(c,r,u),f=r,g=0;const x={};for(let b=0;b<l.length;b++){const S=l[b];if(!S)continue;const{name:m,fn:h}=S,{x:y,y:v,data:C,reset:k}=await h({x:d,y:p,initialPlacement:r,placement:f,strategy:o,middlewareData:x,rects:c,platform:i,elements:{reference:e,floating:t}});d=y??d,p=v??p,x[m]={...x[m],...C},k&&g<ux&&(g++,typeof k=="object"&&(k.placement&&(f=k.placement),k.rects&&(c=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:d,y:p}=cd(c,f,u)),b=-1)}return{x:d,y:p,placement:f,strategy:o,middlewareData:x}},dx=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:i,platform:u,elements:c}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:b=!0,...S}=nl(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const m=On(o),h=qt(i),y=On(i)===i,v=await(u.isRTL==null?void 0:u.isRTL(c.floating)),C=f||(y||!b?[xs(i)]:Tv(i)),k=x!=="none";!f&&k&&C.push(..._v(i,b,x,v));const j=[i,...C],T=await u.detectOverflow(t,S),$=[];let _=((r=l.flip)==null?void 0:r.overflows)||[];if(d&&$.push(T[m]),p){const A=Ev(o,s,v);$.push(T[A[0]],T[A[1]])}if(_=[..._,{placement:o,overflows:$}],!$.every(A=>A<=0)){var W,O;const A=(((W=l.flip)==null?void 0:W.index)||0)+1,X=j[A];if(X&&(!(p==="alignment"?h!==qt(X):!1)||_.every(R=>qt(R.placement)===h?R.overflows[0]>0:!0)))return{data:{index:A,overflows:_},reset:{placement:X}};let H=(O=_.filter(ne=>ne.overflows[0]<=0).sort((ne,R)=>ne.overflows[1]-R.overflows[1])[0])==null?void 0:O.placement;if(!H)switch(g){case"bestFit":{var P;const ne=(P=_.filter(R=>{if(k){const L=qt(R.placement);return L===h||L==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(L=>L>0).reduce((L,N)=>L+N,0)]).sort((R,L)=>R[1]-L[1])[0])==null?void 0:P[0];ne&&(H=ne);break}case"initialPlacement":H=i;break}if(o!==H)return{reset:{placement:H}}}return{}}}},fx=new Set(["left","top"]);async function px(e,t){const{placement:n,platform:r,elements:o}=e,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=On(n),i=rl(n),u=qt(n)==="y",c=fx.has(s)?-1:1,d=l&&u?-1:1,p=nl(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return i&&typeof x=="number"&&(g=i==="end"?x*-1:x),u?{x:g*d,y:f*c}:{x:f*c,y:g*d}}const mx=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:i}=t,u=await px(t,e);return s===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:l+u.y,data:{...u,placement:s}}}}},hx=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:i=!1,limiter:u={fn:m=>{let{x:h,y}=m;return{x:h,y}}},...c}=nl(e,t),d={x:n,y:r},p=await l.detectOverflow(t,c),f=qt(On(o)),g=fm(f);let x=d[g],b=d[f];if(s){const m=g==="y"?"top":"left",h=g==="y"?"bottom":"right",y=x+p[m],v=x-p[h];x=od(y,x,v)}if(i){const m=f==="y"?"top":"left",h=f==="y"?"bottom":"right",y=b+p[m],v=b-p[h];b=od(y,b,v)}const S=u.fn({...t,[g]:x,[f]:b});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[g]:s,[f]:i}}}}}},gx=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:i}=t,{apply:u=()=>{},...c}=nl(e,t),d=await s.detectOverflow(t,c),p=On(o),f=rl(o),g=qt(o)==="y",{width:x,height:b}=l.floating;let S,m;p==="top"||p==="bottom"?(S=p,m=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(m=p,S=f==="end"?"top":"bottom");const h=b-d.top-d.bottom,y=x-d.left-d.right,v=Qr(b-d[S],h),C=Qr(x-d[m],y),k=!t.middlewareData.shift;let j=v,T=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=h),k&&!f){const _=at(d.left,0),W=at(d.right,0),O=at(d.top,0),P=at(d.bottom,0);g?T=x-2*(_!==0||W!==0?_+W:at(d.left,d.right)):j=b-2*(O!==0||P!==0?O+P:at(d.top,d.bottom))}await u({...t,availableWidth:T,availableHeight:j});const $=await s.getDimensions(i.floating);return x!==$.width||b!==$.height?{reset:{rects:!0}}:{}}}};function km(e){const t=kt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Kt(e),l=o?e.offsetWidth:n,s=o?e.offsetHeight:r,i=vs(n)!==l||vs(r)!==s;return i&&(n=l,r=s),{width:n,height:r,$:i}}function $u(e){return Pe(e)?e:e.contextElement}function zr(e){const t=$u(e);if(!Kt(t))return Mt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:l}=km(t);let s=(l?vs(n.width):n.width)/r,i=(l?vs(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}const yx=Mt(0);function Cm(e){const t=dt(e);return!Ws()||!t.visualViewport?yx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vx(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==dt(e)?!1:t}function lr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),l=$u(e);let s=Mt(1);t&&(r?Pe(r)&&(s=zr(r)):s=zr(e));const i=vx(l,n,r)?Cm(l):Mt(0);let u=(o.left+i.x)/s.x,c=(o.top+i.y)/s.y,d=o.width/s.x,p=o.height/s.y;if(l){const f=dt(l),g=r&&Pe(r)?dt(r):r;let x=f,b=Ia(x);for(;b&&r&&g!==x;){const S=zr(b),m=b.getBoundingClientRect(),h=kt(b),y=m.left+(b.clientLeft+parseFloat(h.paddingLeft))*S.x,v=m.top+(b.clientTop+parseFloat(h.paddingTop))*S.y;u*=S.x,c*=S.y,d*=S.x,p*=S.y,u+=y,c+=v,x=dt(b),b=Ia(x)}}return ws({width:d,height:p,x:u,y:c})}function Hs(e,t){const n=Vs(e).scrollLeft;return t?t.left+n:lr(zt(e)).left+n}function jm(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Hs(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function xx(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const l=o==="fixed",s=zt(r),i=t?Fs(t.floating):!1;if(r===s||i&&l)return n;let u={scrollLeft:0,scrollTop:0},c=Mt(1);const d=Mt(0),p=Kt(r);if((p||!p&&!l)&&((qr(r)!=="body"||tl(s))&&(u=Vs(r)),p)){const g=lr(r);c=zr(r),d.x=g.x+r.clientLeft,d.y=g.y+r.clientTop}const f=s&&!p&&!l?jm(s,u):Mt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-u.scrollTop*c.y+d.y+f.y}}function wx(e){return Array.from(e.getClientRects())}function bx(e){const t=zt(e),n=Vs(e),r=e.ownerDocument.body,o=at(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=at(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Hs(e);const i=-n.scrollTop;return kt(r).direction==="rtl"&&(s+=at(t.clientWidth,r.clientWidth)-o),{width:o,height:l,x:s,y:i}}const dd=25;function Sx(e,t){const n=dt(e),r=zt(e),o=n.visualViewport;let l=r.clientWidth,s=r.clientHeight,i=0,u=0;if(o){l=o.width,s=o.height;const d=Ws();(!d||d&&t==="fixed")&&(i=o.offsetLeft,u=o.offsetTop)}const c=Hs(r);if(c<=0){const d=r.ownerDocument,p=d.body,f=getComputedStyle(p),g=d.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,x=Math.abs(r.clientWidth-p.clientWidth-g);x<=dd&&(l-=x)}else c<=dd&&(l+=c);return{width:l,height:s,x:i,y:u}}function kx(e,t){const n=lr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,l=Kt(e)?zr(e):Mt(1),s=e.clientWidth*l.x,i=e.clientHeight*l.y,u=o*l.x,c=r*l.y;return{width:s,height:i,x:u,y:c}}function fd(e,t,n){let r;if(t==="viewport")r=Sx(e,n);else if(t==="document")r=bx(zt(e));else if(Pe(t))r=kx(t,n);else{const o=Cm(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ws(r)}function Em(e,t){const n=an(e);return n===t||!Pe(n)||tn(n)?!1:kt(n).position==="fixed"||Em(n,t)}function Cx(e,t){const n=t.get(e);if(n)return n;let r=In(e,[],!1).filter(i=>Pe(i)&&qr(i)!=="body"),o=null;const l=kt(e).position==="fixed";let s=l?an(e):e;for(;Pe(s)&&!tn(s);){const i=kt(s),u=Mu(s);!u&&i.position==="fixed"&&(o=null),(l?!u&&!o:!u&&i.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||tl(s)&&!u&&Em(e,s))?r=r.filter(d=>d!==s):o=i,s=an(s)}return t.set(e,r),r}function jx(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Fs(t)?[]:Cx(t,this._c):[].concat(n),r],i=fd(t,s[0],o);let u=i.top,c=i.right,d=i.bottom,p=i.left;for(let f=1;f<s.length;f++){const g=fd(t,s[f],o);u=at(g.top,u),c=Qr(g.right,c),d=Qr(g.bottom,d),p=at(g.left,p)}return{width:c-p,height:d-u,x:p,y:u}}function Ex(e){const{width:t,height:n}=km(e);return{width:t,height:n}}function Tx(e,t,n){const r=Kt(t),o=zt(t),l=n==="fixed",s=lr(e,!0,l,t);let i={scrollLeft:0,scrollTop:0};const u=Mt(0);function c(){u.x=Hs(o)}if(r||!r&&!l)if((qr(t)!=="body"||tl(o))&&(i=Vs(t)),r){const g=lr(t,!0,l,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}else o&&c();l&&!r&&o&&c();const d=o&&!r&&!l?jm(o,i):Mt(0),p=s.left+i.scrollLeft-u.x-d.x,f=s.top+i.scrollTop-u.y-d.y;return{x:p,y:f,width:s.width,height:s.height}}function ji(e){return kt(e).position==="static"}function pd(e,t){if(!Kt(e)||kt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return zt(e)===n&&(n=n.ownerDocument.body),n}function Tm(e,t){const n=dt(e);if(Fs(e))return n;if(!Kt(e)){let o=an(e);for(;o&&!tn(o);){if(Pe(o)&&!ji(o))return o;o=an(o)}return n}let r=pd(e,t);for(;r&&bv(r)&&ji(r);)r=pd(r,t);return r&&tn(r)&&ji(r)&&!Mu(r)?n:r||Cv(e)||n}const Nx=async function(e){const t=this.getOffsetParent||Tm,n=this.getDimensions,r=await n(e.floating);return{reference:Tx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Rx(e){return kt(e).direction==="rtl"}const Px={convertOffsetParentRelativeRectToViewportRelativeRect:xx,getDocumentElement:zt,getClippingRect:jx,getOffsetParent:Tm,getElementRects:Nx,getClientRects:wx,getDimensions:Ex,getScale:zr,isElement:Pe,isRTL:Rx};function Nm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _x(e,t){let n=null,r;const o=zt(e);function l(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function s(i,u){i===void 0&&(i=!1),u===void 0&&(u=1),l();const c=e.getBoundingClientRect(),{left:d,top:p,width:f,height:g}=c;if(i||t(),!f||!g)return;const x=kl(p),b=kl(o.clientWidth-(d+f)),S=kl(o.clientHeight-(p+g)),m=kl(d),y={rootMargin:-x+"px "+-b+"px "+-S+"px "+-m+"px",threshold:at(0,Qr(1,u))||1};let v=!0;function C(k){const j=k[0].intersectionRatio;if(j!==u){if(!v)return s();j?s(!1,j):r=setTimeout(()=>{s(!1,1e-7)},1e3)}j===1&&!Nm(c,e.getBoundingClientRect())&&s(),v=!1}try{n=new IntersectionObserver(C,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,y)}n.observe(e)}return s(!0),l}function un(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=$u(e),d=o||l?[...c?In(c):[],...t?In(t):[]]:[];d.forEach(m=>{o&&m.addEventListener("scroll",n,{passive:!0}),l&&m.addEventListener("resize",n)});const p=c&&i?_x(c,n):null;let f=-1,g=null;s&&(g=new ResizeObserver(m=>{let[h]=m;h&&h.target===c&&g&&t&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=g)==null||y.observe(t)})),n()}),c&&!u&&g.observe(c),t&&g.observe(t));let x,b=u?lr(e):null;u&&S();function S(){const m=lr(e);b&&!Nm(b,m)&&n(),b=m,x=requestAnimationFrame(S)}return n(),()=>{var m;d.forEach(h=>{o&&h.removeEventListener("scroll",n),l&&h.removeEventListener("resize",n)}),p==null||p(),(m=g)==null||m.disconnect(),g=null,u&&cancelAnimationFrame(x)}}const Ix=mx,Lx=hx,Ax=dx,Ox=gx,Dx=(e,t,n)=>{const r=new Map,o={platform:Px,...n},l={...o.platform,_c:r};return cx(e,t,{...o,platform:l})};var Mx=typeof document<"u",$x=function(){},Kl=Mx?w.useLayoutEffect:$x;function ks(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(!ks(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)&&!ks(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function Rm(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function md(e,t){const n=Rm(e);return Math.round(t*n)/n}function Ei(e){const t=w.useRef(e);return Kl(()=>{t.current=e}),t}function zx(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:s}={},transform:i=!0,whileElementsMounted:u,open:c}=e,[d,p]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=w.useState(r);ks(f,r)||g(r);const[x,b]=w.useState(null),[S,m]=w.useState(null),h=w.useCallback(R=>{R!==k.current&&(k.current=R,b(R))},[]),y=w.useCallback(R=>{R!==j.current&&(j.current=R,m(R))},[]),v=l||x,C=s||S,k=w.useRef(null),j=w.useRef(null),T=w.useRef(d),$=u!=null,_=Ei(u),W=Ei(o),O=Ei(c),P=w.useCallback(()=>{if(!k.current||!j.current)return;const R={placement:t,strategy:n,middleware:f};W.current&&(R.platform=W.current),Dx(k.current,j.current,R).then(L=>{const N={...L,isPositioned:O.current!==!1};A.current&&!ks(T.current,N)&&(T.current=N,Lu.flushSync(()=>{p(N)}))})},[f,t,n,W,O]);Kl(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,p(R=>({...R,isPositioned:!1})))},[c]);const A=w.useRef(!1);Kl(()=>(A.current=!0,()=>{A.current=!1}),[]),Kl(()=>{if(v&&(k.current=v),C&&(j.current=C),v&&C){if(_.current)return _.current(v,C,P);P()}},[v,C,P,_,$]);const X=w.useMemo(()=>({reference:k,floating:j,setReference:h,setFloating:y}),[h,y]),H=w.useMemo(()=>({reference:v,floating:C}),[v,C]),ne=w.useMemo(()=>{const R={position:n,left:0,top:0};if(!H.floating)return R;const L=md(H.floating,d.x),N=md(H.floating,d.y);return i?{...R,transform:"translate("+L+"px, "+N+"px)",...Rm(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:N}},[n,i,H.floating,d.x,d.y]);return w.useMemo(()=>({...d,update:P,refs:X,elements:H,floatingStyles:ne}),[d,P,X,H,ne])}const cn=(e,t)=>{const n=Ix(e);return{name:n.name,fn:n.fn,options:[e,t]}},dn=(e,t)=>{const n=Lx(e);return{name:n.name,fn:n.fn,options:[e,t]}},fn=(e,t)=>{const n=Ax(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ma=(e,t)=>{const n=Ox(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kx="data-floating-ui-focusable",hd="active",gd="selected",Fx={...Gd};let yd=!1,Wx=0;const vd=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Wx++;function Vx(){const[e,t]=w.useState(()=>yd?vd():void 0);return qn(()=>{e==null&&t(vd())},[]),w.useEffect(()=>{yd=!0},[]),e}const Hx=Fx.useId,Pm=Hx||Vx;function Bx(){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 Ux=w.createContext(null),Gx=w.createContext(null),Yx=()=>{var e;return((e=w.useContext(Ux))==null?void 0:e.id)||null},_m=()=>w.useContext(Gx);function zu(e){return"data-floating-ui-"+e}const Qx={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},xd=w.forwardRef(function(t,n){const[r,o]=w.useState();qn(()=>{Xv()&&o("button")},[]);const l={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[zu("focus-guard")]:"",style:Qx};return a.jsx("span",{...t,...l})}),Xx={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Im=w.createContext(null),wd=zu("portal");function Zx(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Pm(),o=Jx(),[l,s]=w.useState(null),i=w.useRef(null);return qn(()=>()=>{l==null||l.remove(),queueMicrotask(()=>{i.current=null})},[l]),qn(()=>{if(!r||i.current)return;const u=t?document.getElementById(t):null;if(!u)return;const c=document.createElement("div");c.id=r,c.setAttribute(wd,""),u.appendChild(c),i.current=c,s(c)},[t,r]),qn(()=>{if(n===null||!r||i.current)return;let u=n||(o==null?void 0:o.portalNode);u&&!Du(u)&&(u=u.current),u=u||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,u.appendChild(c));const d=document.createElement("div");d.id=r,d.setAttribute(wd,""),u=c||u,u.appendChild(d),i.current=d,s(d)},[t,n,r,o]),l}function pn(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,l=Zx({id:n,root:r}),[s,i]=w.useState(null),u=w.useRef(null),c=w.useRef(null),d=w.useRef(null),p=w.useRef(null),f=s==null?void 0:s.modal,g=s==null?void 0:s.open,x=!!s&&!s.modal&&s.open&&o&&!!(r||l);return w.useEffect(()=>{if(!l||!o||f)return;function b(S){l&&Ci(S)&&(S.type==="focusin"?ud:ix)(l)}return l.addEventListener("focusin",b,!0),l.addEventListener("focusout",b,!0),()=>{l.removeEventListener("focusin",b,!0),l.removeEventListener("focusout",b,!0)}},[l,o,f]),w.useEffect(()=>{l&&(g||ud(l))},[g,l]),a.jsxs(Im.Provider,{value:w.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:u,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:p,portalNode:l,setFocusManagerState:i}),[o,l]),children:[x&&l&&a.jsx(xd,{"data-type":"outside",ref:u,onFocus:b=>{if(Ci(b,l)){var S;(S=d.current)==null||S.focus()}else{const m=s?s.domReference:null,h=sx(m);h==null||h.focus()}}}),x&&l&&a.jsx("span",{"aria-owns":l.id,style:Xx}),l&&Lu.createPortal(t,l),x&&l&&a.jsx(xd,{"data-type":"outside",ref:c,onFocus:b=>{if(Ci(b,l)){var S;(S=p.current)==null||S.focus()}else{const m=s?s.domReference:null,h=lx(m);h==null||h.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,b.nativeEvent,"focus-out"))}}})]})}const Jx=()=>w.useContext(Im),qx={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},e0={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},bd=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 sr(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:l}=e,{enabled:s=!0,escapeKey:i=!0,outsidePress:u=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:p="pointerdown",ancestorScroll:f=!1,bubbles:g,capture:x}=t,b=_m(),S=vr(typeof u=="function"?u:()=>!1),m=typeof u=="function"?S:u,h=w.useRef(!1),{escapeKey:y,outsidePress:v}=bd(g),{escapeKey:C,outsidePress:k}=bd(x),j=w.useRef(!1),T=vr(A=>{var X;if(!n||!s||!i||A.key!=="Escape"||j.current)return;const H=(X=l.current.floatingContext)==null?void 0:X.nodeId,ne=b?zl(b.nodesRef.current,H):[];if(!y&&(A.stopPropagation(),ne.length>0)){let R=!0;if(ne.forEach(L=>{var N;if((N=L.context)!=null&&N.open&&!L.context.dataRef.current.__escapeKeyBubbles){R=!1;return}}),!R)return}r(!1,qv(A)?A.nativeEvent:A,"escape-key")}),$=vr(A=>{var X;const H=()=>{var ne;T(A),(ne=go(A))==null||ne.removeEventListener("keydown",H)};(X=go(A))==null||X.addEventListener("keydown",H)}),_=vr(A=>{var X;const H=l.current.insideReactTree;l.current.insideReactTree=!1;const ne=h.current;if(h.current=!1,c==="click"&&ne||H||typeof m=="function"&&!m(A))return;const R=go(A),L="["+zu("inert")+"]",N=Qo(o.floating).querySelectorAll(L);let z=Pe(R)?R:null;for(;z&&!tn(z);){const ae=an(z);if(tn(ae)||!Pe(ae))break;z=ae}if(N.length&&Pe(R)&&!Jv(R)&&!Da(R,o.floating)&&Array.from(N).every(ae=>!Da(z,ae)))return;if(Kt(R)&&P){const ae=tn(R),se=kt(R),_e=/auto|scroll/,ye=ae||_e.test(se.overflowX),eo=ae||_e.test(se.overflowY),to=ye&&R.clientWidth>0&&R.scrollWidth>R.clientWidth,pr=eo&&R.clientHeight>0&&R.scrollHeight>R.clientHeight,no=se.direction==="rtl",ro=pr&&(no?A.offsetX<=R.offsetWidth-R.clientWidth:A.offsetX>R.clientWidth),Ft=to&&A.offsetY>R.clientHeight;if(ro||Ft)return}const V=(X=l.current.floatingContext)==null?void 0:X.nodeId,me=b&&zl(b.nodesRef.current,V).some(ae=>{var se;return ki(A,(se=ae.context)==null?void 0:se.elements.floating)});if(ki(A,o.floating)||ki(A,o.domReference)||me)return;const be=b?zl(b.nodesRef.current,V):[];if(be.length>0){let ae=!0;if(be.forEach(se=>{var _e;if((_e=se.context)!=null&&_e.open&&!se.context.dataRef.current.__outsidePressBubbles){ae=!1;return}}),!ae)return}r(!1,A,"outside-press")}),W=vr(A=>{var X;const H=()=>{var ne;_(A),(ne=go(A))==null||ne.removeEventListener(c,H)};(X=go(A))==null||X.addEventListener(c,H)});w.useEffect(()=>{if(!n||!s)return;l.current.__escapeKeyBubbles=y,l.current.__outsidePressBubbles=v;let A=-1;function X(N){r(!1,N,"ancestor-scroll")}function H(){window.clearTimeout(A),j.current=!0}function ne(){A=window.setTimeout(()=>{j.current=!1},Ws()?5:0)}const R=Qo(o.floating);i&&(R.addEventListener("keydown",C?$:T,C),R.addEventListener("compositionstart",H),R.addEventListener("compositionend",ne)),m&&R.addEventListener(c,k?W:_,k);let L=[];return f&&(Pe(o.domReference)&&(L=In(o.domReference)),Pe(o.floating)&&(L=L.concat(In(o.floating))),!Pe(o.reference)&&o.reference&&o.reference.contextElement&&(L=L.concat(In(o.reference.contextElement)))),L=L.filter(N=>{var z;return N!==((z=R.defaultView)==null?void 0:z.visualViewport)}),L.forEach(N=>{N.addEventListener("scroll",X,{passive:!0})}),()=>{i&&(R.removeEventListener("keydown",C?$:T,C),R.removeEventListener("compositionstart",H),R.removeEventListener("compositionend",ne)),m&&R.removeEventListener(c,k?W:_,k),L.forEach(N=>{N.removeEventListener("scroll",X)}),window.clearTimeout(A)}},[l,o,i,m,c,n,r,f,s,y,v,T,C,$,_,k,W]),w.useEffect(()=>{l.current.insideReactTree=!1},[l,m,c]);const O=w.useMemo(()=>({onKeyDown:T,...d&&{[qx[p]]:A=>{r(!1,A.nativeEvent,"reference-press")},...p!=="click"&&{onClick(A){r(!1,A.nativeEvent,"reference-press")}}}}),[T,r,d,p]),P=w.useMemo(()=>{function A(X){X.button===0&&(h.current=!0)}return{onKeyDown:T,onMouseDown:A,onMouseUp:A,[e0[c]]:()=>{l.current.insideReactTree=!0}}},[T,c,l]);return w.useMemo(()=>s?{reference:O,floating:P}:{},[s,O,P])}function t0(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Pm(),l=w.useRef({}),[s]=w.useState(()=>Bx()),i=Yx()!=null,[u,c]=w.useState(r.reference),d=vr((g,x,b)=>{l.current.openEvent=g?x:void 0,s.emit("openchange",{open:g,event:x,reason:b,nested:i}),n==null||n(g,x,b)}),p=w.useMemo(()=>({setPositionReference:c}),[]),f=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:d,elements:f,events:s,floatingId:o,refs:p}),[t,d,f,s,o,p])}function mn(e){e===void 0&&(e={});const{nodeId:t}=e,n=t0({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[l,s]=w.useState(null),[i,u]=w.useState(null),d=(o==null?void 0:o.domReference)||l,p=w.useRef(null),f=_m();qn(()=>{d&&(p.current=d)},[d]);const g=zx({...e,elements:{...o,...i&&{reference:i}}}),x=w.useCallback(y=>{const v=Pe(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),getClientRects:()=>y.getClientRects(),contextElement:y}:y;u(v),g.refs.setReference(v)},[g.refs]),b=w.useCallback(y=>{(Pe(y)||y===null)&&(p.current=y,s(y)),(Pe(g.refs.reference.current)||g.refs.reference.current===null||y!==null&&!Pe(y))&&g.refs.setReference(y)},[g.refs]),S=w.useMemo(()=>({...g.refs,setReference:b,setPositionReference:x,domReference:p}),[g.refs,b,x]),m=w.useMemo(()=>({...g.elements,domReference:d}),[g.elements,d]),h=w.useMemo(()=>({...g,...r,refs:S,elements:m,nodeId:t}),[g,S,m,t,r]);return qn(()=>{r.dataRef.current.floatingContext=h;const y=f==null?void 0:f.nodesRef.current.find(v=>v.id===t);y&&(y.context=h)}),w.useMemo(()=>({...g,context:h,refs:S,elements:m}),[g,S,m,h])}function Ti(e,t,n){const r=new Map,o=n==="item";let l=e;if(o&&e){const{[hd]:s,[gd]:i,...u}=e;l=u}return{...n==="floating"&&{tabIndex:-1,[Kx]:""},...l,...t.map(s=>{const i=s?s[n]:null;return typeof i=="function"?e?i(e):null:i}).concat(e).reduce((s,i)=>(i&&Object.entries(i).forEach(u=>{let[c,d]=u;if(!(o&&[hd,gd].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof d=="function"){var p;(p=r.get(c))==null||p.push(d),s[c]=function(){for(var f,g=arguments.length,x=new Array(g),b=0;b<g;b++)x[b]=arguments[b];return(f=r.get(c))==null?void 0:f.map(S=>S(...x)).find(S=>S!==void 0)}}}else s[c]=d}),s),{})}}function ir(e){e===void 0&&(e=[]);const t=e.map(i=>i==null?void 0:i.reference),n=e.map(i=>i==null?void 0:i.floating),r=e.map(i=>i==null?void 0:i.item),o=w.useCallback(i=>Ti(i,e,"reference"),t),l=w.useCallback(i=>Ti(i,e,"floating"),n),s=w.useCallback(i=>Ti(i,e,"item"),r);return w.useMemo(()=>({getReferenceProps:o,getFloatingProps:l,getItemProps:s}),[o,l,s])}const ar={"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"}},n0=(()=>{const e=new Map;for(const[t,n]of Object.entries(ar)){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})(),r0=(()=>{const e=new Map;for(const[t,n]of Object.entries(ar))n.controlGroup&&(e.has(n.controlGroup)||e.set(n.controlGroup,new Set),e.get(n.controlGroup).add(t));return e})();function o0(){const e={};for(const[t,n]of Object.entries(ar))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 l0(){const e={spacing:[],sizing:[],typography:[],color:[],borders:[],effects:[],layout:[],flexbox:[],gradient:[]},t=new Set;for(const[n,r]of Object.entries(ar)){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,i=>i.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 Fl({prefix:e,currentValue:t,colors:n,locked:r,lockedValue:o,onHover:l,onLeave:s,onClick:i,onRemove:u,onRemoveHover:c}){return a.jsxs("div",{className:"p-2 bg-bv-surface border border-bv-border rounded-md my-2",onMouseLeave:()=>{r||s()},children:[a.jsxs("div",{className:"flex items-center gap-0.5 mb-0.5",children:[a.jsx("span",{className:"w-[52px] text-[10px] text-bv-muted text-right pr-1.5 shrink-0"}),u&&a.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:a.jsxs("svg",{viewBox:"0 0 10 10",width:"14",height:"14",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"}),a.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"})]})}),["black","white","transparent"].map(d=>n[d]!==void 0?a.jsx(Sd,{prefix:e,colorName:d,colorValue:n[d],isCurrent:d===t,isLocked:o===`${e}${d}`,locked:r,onHover:l,onClick:i},d):null)]}),_y.map(d=>{const p=n[d];return!p||typeof p!="object"?null:a.jsxs("div",{className:"flex items-center gap-0.5 mb-0.5",children:[a.jsx("span",{className:"w-[52px] text-[10px] text-bv-muted text-right pr-1.5 shrink-0",children:d}),Iy.map(f=>p[f]!==void 0?a.jsx(Sd,{prefix:e,colorName:`${d}-${f}`,colorValue:p[f],isCurrent:`${d}-${f}`===t,isLocked:o===`${e}${d}-${f}`,locked:r,onHover:l,onClick:i},`${d}-${f}`):null)]},d)})]})}function Sd({prefix:e,colorName:t,colorValue:n,isCurrent:r,isLocked:o,locked:l,onHover:s,onClick:i}){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",d=t==="transparent"?{background:"repeating-conic-gradient(#808080 0% 25%, transparent 0% 50%) 50% / 8px 8px"}:{backgroundColor:n};return a.jsx("div",{title:u,className:`w-5 h-5 rounded cursor-pointer border-2 shrink-0 transition-[border-color,transform] ${c}`,style:d,onMouseEnter:()=>{l||s(u)},onClick:p=>{p.stopPropagation(),i(u)}})}const fr=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})},[]),a.jsx("div",{ref:s=>{l.current=s,typeof o=="function"?o(s):o&&(o.current=s)},tabIndex:-1,onBlur:s=>{var i;(i=l.current)!=null&&i.contains(s.relatedTarget)||t()},onKeyDown:s=>{s.code==="Escape"&&t()},...r,children:n})}),s0=4,i0=10;function xn({values:e,currentValue:t,lockedValue:n,locked:r,ghost:o,onStart:l,onHover:s,onLeave:i,onClick:u,onRemove:c,onRemoveHover:d}){const[p,f]=w.useState(!1),[g,x]=w.useState(null),b=w.useRef(null),S=w.useRef(null),m=w.useRef(null),{refs:h,floatingStyles:y}=mn({open:p,strategy:"fixed",placement:"bottom-start",middleware:[cn(2),fn(),dn({padding:4})],whileElementsMounted:un}),v=n!==null&&e.includes(n),C=g!==null?e[g]:v?n:t;w.useEffect(()=>{var O,P;p&&m.current&&((P=(O=m.current).scrollIntoView)==null||P.call(O,{block:"nearest"}))},[p]);const k=r&&!v;function j(O){if(k)return;l==null||l();const P=v?n:t,A=e.indexOf(P);b.current={startX:O.clientX,startIndex:A>=0?A:0,didScrub:!1},O.currentTarget.setPointerCapture(O.pointerId),O.preventDefault()}function T(O){const P=b.current;if(!P)return;const A=O.clientX-P.startX;if(!P.didScrub&&Math.abs(A)>s0&&(P.didScrub=!0,f(!1)),P.didScrub){const X=Math.round(A/i0),H=Math.max(0,Math.min(e.length-1,P.startIndex+X));x(H),s(e[H])}}function $(){const O=b.current;O&&(O.didScrub&&g!==null?u(e[g]):O.didScrub||f(P=>(P&&i(),!P)),x(null),b.current=null)}const _=g!==null,W=_?"bg-bv-teal/9 text-bv-teal ring-1 ring-bv-teal":v?"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":p?"bg-bv-surface-hi text-bv-text ring-1 ring-bv-border":k?"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 a.jsxs("div",{ref:S,className:"relative inline-block",children:[a.jsxs("div",{ref:h.setReference,className:`group select-none px-2 py-0.5 rounded-md text-[11px] font-mono transition-colors ${k?"cursor-default":"cursor-ew-resize"} ${W}`,onPointerDown:j,onPointerMove:T,onPointerUp:$,children:[!k&&a.jsx("span",{className:`inline-block mr-0.5 text-[9px] transition-opacity ${_?"opacity-100":"opacity-0 group-hover:opacity-50"}`,children:"‹"}),C,!k&&a.jsx("span",{className:`inline-block ml-0.5 text-[9px] transition-opacity ${_?"opacity-100":"opacity-0 group-hover:opacity-50"}`,children:"›"})]}),p&&a.jsx(pn,{children:a.jsxs(fr,{ref:h.setFloating,style:y,className:"z-50 max-h-52 overflow-y-auto bg-bv-bg border border-bv-border rounded-md shadow-md min-w-[5rem]",onPointerDown:O=>O.stopPropagation(),onMouseLeave:i,onClose:()=>{f(!1),i()},children:[c&&a.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:d,onClick:O=>{O.stopPropagation(),c(),f(!1)},children:[a.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:[a.jsx("circle",{cx:"6",cy:"6",r:"5.5"}),a.jsx("line",{x1:"4",y1:"4",x2:"8",y2:"8"}),a.jsx("line",{x1:"8",y1:"4",x2:"4",y2:"8"})]}),"remove"]}),e.map(O=>{const P=O===(n??t),A=P?"bg-bv-teal/9 text-bv-teal":"text-bv-text-mid hover:bg-bv-surface hover:text-bv-text";return a.jsx("div",{ref:P?m:void 0,className:`px-2.5 py-[3px] text-[11px] font-mono cursor-pointer ${A}`,onMouseEnter:()=>s(O),onClick:X=>{X.stopPropagation(),u(O),f(!1)},children:O},O)})]})})]})}const a0={px:.0625};function Ir(e){return isNaN(Number(e))?a0[e]??1/0:Number(e)}function hr(e,t,n){return t==="spacing"&&(n!=null&&n.spacing)?Object.keys(n.spacing).sort((o,l)=>Ir(o)-Ir(l)).map(o=>`${e}${o}`):t==="fontSize"?[...Cy]:t==="fontWeight"?[...jy]:t==="borderRadius"?Ra:t==="lineHeight"?[...Ey]:t==="letterSpacing"?[...Ty]:t==="opacity"?Ny:[]}const u0=4,c0=10;function Kr({placeholder:e,values:t,currentValue:n,displayValue:r,formatValue:o,axis:l="x",disabled:s,onHover:i,onLeave:u,onClick:c,onScrubStart:d,onScrubEnd:p,onOpen:f,onClose:g,onRemove:x,onRemoveHover:b}){const[S,m]=w.useState(!1),[h,y]=w.useState(null),v=w.useRef(null),C=w.useRef(null),k=w.useRef(null),{refs:j,floatingStyles:T}=mn({open:S,strategy:"fixed",placement:"bottom-start",middleware:[cn(4),fn(),dn({padding:4})],whileElementsMounted:un}),$=n!=null,_=n?t.indexOf(n):-1,W=h!==null?t[h]:null,O=W?o?o(W):W:r??e;w.useEffect(()=>{var N,z;S&&k.current&&((z=(N=k.current).scrollIntoView)==null||z.call(N,{block:"nearest"}))},[S]);function P(N){var V,me;if(s)return;N.preventDefault(),N.stopPropagation();const z=_>=0?_:0;v.current={startX:N.clientX,startY:N.clientY,startIndex:z,didScrub:!1},(me=(V=N.target).setPointerCapture)==null||me.call(V,N.pointerId)}function A(N){const z=v.current;if(!z)return;const V=l==="y"?-(N.clientY-z.startY):N.clientX-z.startX;if(!z.didScrub&&Math.abs(V)>u0&&(z.didScrub=!0,m(!1),d==null||d()),z.didScrub){const me=Math.round(V/c0),be=Math.max(0,Math.min(t.length-1,z.startIndex+me));y(be),i==null||i(t[be])}}function X(){const N=v.current;N&&(N.didScrub&&h!==null?(c==null||c(t[h]),y(null),v.current=null,p==null||p()):N.didScrub||(y(null),v.current=null,m(z=>z?(g==null||g(),u==null||u(),!1):(f==null||f(),!0))))}const H=h!==null,R=["bm-slot",$||H?"bm-has-val":"",H?"bm-scrubbing":""].filter(Boolean).join(" "),L=s?"default":l==="y"?"ns-resize":"ew-resize";return a.jsxs("span",{ref:N=>{C.current=N,j.setReference(N)},className:R,style:{position:"relative",cursor:L},onPointerDown:P,onPointerMove:A,onPointerUp:X,role:"button",tabIndex:s?-1:0,children:[O,S&&a.jsx(pn,{children:a.jsxs(fr,{ref:j.setFloating,style:T,className:"bm-mini-dropdown",onClick:N=>N.stopPropagation(),onMouseLeave:()=>u==null?void 0:u(),onPointerDown:N=>N.stopPropagation(),onMouseDown:N=>{N.stopPropagation(),N.preventDefault()},onClose:()=>{m(!1),g==null||g(),u==null||u()},children:[x&&a.jsxs("div",{className:"bm-mini-dropdown-item bm-mini-dropdown-remove",tabIndex:-1,onMouseEnter:b,onMouseDown:N=>{N.preventDefault(),x(),m(!1),g==null||g()},children:[a.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:[a.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"}),a.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"})]}),"remove"]}),t.map(N=>{const z=N===n;return a.jsx("div",{ref:z?k:void 0,tabIndex:-1,className:`bm-mini-dropdown-item${z?" bm-active":""}`,onMouseEnter:()=>i==null?void 0:i(N),onMouseDown:V=>{V.preventDefault(),c==null||c(N),m(!1),g==null||g()},onClick:V=>{V.detail===0&&(V.stopPropagation(),c==null||c(N),m(!1),g==null||g())},onKeyDown:V=>{(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),c==null||c(N),m(!1),g==null||g())},children:N},N)})]})})]})}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 d0({value:e,placeholder:t,layer:n,frozen:r,scaleValues:o,axis:l,onClick:s,onValueChange:i,onValueHover:u,onValueLeave:c,onScrubStart:d,onScrubEnd:p,onOpen:f,onClose:g,onValueRemove:x,onValueRemoveHover:b}){const S=e!=null,m=S?kd(e,n):null;if(o&&o.length>0)return a.jsx(Kr,{placeholder:t,values:o,currentValue:e,displayValue:m,formatValue:y=>kd(y,n),axis:l,disabled:r,onHover:u,onLeave:c,onClick:i,onScrubStart:d,onScrubEnd:p,onOpen:f,onClose:g,onRemove:x,onRemoveHover:b});const h=`bm-slot${S?" bm-has-val":""}`;return a.jsx("span",{className:h,onClick:r?void 0:y=>s==null?void 0:s(y.currentTarget),role:"button",tabIndex:r?-1:0,children:m??t})}const f0={top:["y","t"],right:["r"],bottom:["b"],left:["x","l"],tr:["color"],bl:["style"],br:["offset"]},p0={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"]},m0={top:"y",bottom:"y",left:"x",right:"x",tr:"x",bl:"x",br:"x"};function h0({layer:e,classState:t,shorthandValue:n,shorthandScaleValues:r,slots:o,isHovered:l,frozen:s,onHoverChange:i,onSlotClick:u,onSlotChange:c,onSlotHover:d,onScrubStart:p,onScrubEnd:f,onSlotOpen:g,onSlotClose:x,onSlotRemove:b,onSlotRemoveHover:S,children:m}){const h=`bm-layer bm-${e}${l?" bm-hovered":""}`,[y,v]=w.useState(null),C=new Map(o.map(O=>[O.key,O])),k=(t==="shorthand"||t==="mixed")&&n,j=r&&r.length>0?a.jsx("span",{className:"bm-name bm-name-scrubber",children:a.jsx(Kr,{placeholder:e,values:r,currentValue:k?n:null,displayValue:k?n:null,formatValue:O=>O,axis:"x",disabled:s,onHover:O=>d==null?void 0:d("shorthand",O),onLeave:()=>d==null?void 0:d("shorthand",null),onClick:O=>c==null?void 0:c("shorthand",O),onScrubStart:()=>{p==null||p()},onScrubEnd:f,onOpen:()=>{v("__shorthand__"),g==null||g()},onClose:()=>{v(null),x==null||x()},onRemove:b?()=>b("shorthand"):void 0,onRemoveHover:S?()=>S("shorthand"):void 0})}):k?a.jsx("span",{className:"bm-name",children:a.jsx("span",{className:"bm-val",onClick:O=>u==null?void 0:u("shorthand",O.currentTarget),children:n})}):a.jsx("span",{className:"bm-name",children:e}),$=(p0[e]??[]).map(O=>{const A=(f0[O]??[]).map(L=>C.get(L)).filter(L=>L!=null);if(A.length===0)return null;const X=A.some(L=>L.value!=null),ne=`bm-slot-group bm-sg-${O}${X?" bm-has-values":""}${y===O?" bm-sg-active":""}`,R=m0[O];return a.jsx("div",{className:ne,children:A.map(L=>a.jsx(d0,{slotKey:L.key,value:L.value,placeholder:L.placeholder,layer:e,isExpanded:l,frozen:s,scaleValues:L.scaleValues,axis:R,onClick:N=>u==null?void 0:u(L.key,N),onValueChange:c?N=>c(L.key,N):void 0,onValueHover:d?N=>d(L.key,N):void 0,onValueLeave:d?()=>d(L.key,null):void 0,onScrubStart:p,onScrubEnd:f,onOpen:()=>{v(O),g==null||g()},onClose:()=>{v(null),x==null||x()},onValueRemove:b?()=>b(L.key):void 0,onValueRemoveHover:S?()=>S(L.key):void 0},L.key))},O)}),_=O=>{O.stopPropagation(),s||i(!0)},W=O=>{const P=O.relatedTarget,A=O.currentTarget;P&&A.contains(P)||s||i(!1)};return a.jsxs("div",{className:h,onMouseOver:_,onMouseOut:W,"data-layer":e,children:[j,$,m]})}const Cd=["margin","outline","border","padding"];function g0({layers:e,frozen:t=!1,onSlotClick:n,onSlotChange:r,onSlotHover:o,onSlotRemove:l,onSlotRemoveHover:s,onEditStart:i}){const[u,c]=w.useState(null),[d,p]=w.useState(null),f=t||d!==null,g=new Map(e.map(y=>[y.layer,y])),x=(y,v)=>{f||c(v?y:null)},b=(y,v,C)=>{f||n==null||n(y,v,C)};let m=a.jsx("div",{className:"bm-content"});for(let y=Cd.length-1;y>=0;y--){const v=Cd[y],C=g.get(v);C&&(m=a.jsx(h0,{layer:C.layer,classState:C.classState,shorthandValue:C.shorthandValue,shorthandScaleValues:C.shorthandScaleValues,slots:C.slots,isHovered:u===v||d===v,frozen:f,onHoverChange:k=>x(v,k),onSlotClick:(k,j)=>b(v,k,j),onSlotChange:r?(k,j)=>r(v,k,j):void 0,onSlotHover:o?(k,j)=>o(v,k,j):void 0,onSlotRemove:l?k=>l(v,k):void 0,onSlotRemoveHover:s?k=>s(v,k):void 0,onScrubStart:()=>{p(v),i==null||i()},onScrubEnd:()=>p(null),onSlotOpen:()=>{p(v),i==null||i()},onSlotClose:()=>p(null),children:m}))}const h=`bm-root${f?" bm-frozen":""}`;return a.jsx("div",{className:h,children:m})}const y0={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"}},v0=["y","t","r","b","x","l"];function x0(e){const t=v0.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 w0(e,t){const n=y0[e],r=x0(e),o=t[n.shorthand]??null,l=o!=null?o===""?n.shorthand:`${n.shorthand}-${o}`:null,s=r.map(({key:f,placeholder:g})=>{let x;if(f==="color"){const m=e==="outline"?"outline-color":"border-color";x=m in t?m:void 0}else if(f==="style"){const m=e==="outline"?"outline-style":"border-style";x=m in t?m:void 0}else f==="offset"?x="outline-offset"in t?"outline-offset":void 0:x=n[f];const b=x?t[x]??null:null;let S;return(f==="color"||f==="style")&&b!=null?S=`${e==="outline"?"outline":"border"}-${b}`:S=b!=null&&x?`${x}-${b}`:null,{key:f,value:S,placeholder:g}}),i=l!=null,u=s.some(f=>(f.key==="x"||f.key==="y")&&f.value!=null),c=s.some(f=>(f.key==="t"||f.key==="r"||f.key==="b"||f.key==="l")&&f.value!=null),d=u||c;let p;return!i&&!d?p="none":i&&!d?p="shorthand":!i&&u&&!c?p="axis":i?p="mixed":p="individual",{layer:e,classState:p,shorthandValue:l,slots:s}}function b0(e,t,n){var s,i,u;if(t==="color")return[];if(t==="style"){const c=e==="outline"?"outline":"border";return Py.map(d=>`${c}-${d}`)}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,d)=>Ir(c)-Ir(d)):Pa:r=(i=n==null?void 0:n.theme)!=null&&i.borderWidth?Object.keys(n.theme.borderWidth):qp:r=(u=n==null?void 0:n.theme)!=null&&u.spacing?Object.keys(n.theme.spacing).sort((c,d)=>Ir(c)-Ir(d)):Pa;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 gr(e,t){const n={};for(const s of e){let i;s.color!==void 0?i=`${s.property}-color`:s.style!==void 0?i=`${s.property}-style`:s.side!==void 0?i=s.property.length<=2?s.property+s.side:`${s.property}-${s.side}`:i=s.property;const u=s.scale??s.color??s.style??s.align??s.size??s.value??"";n[i]=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 p,f;const i=w0(s,n),u=i.slots.map(g=>{const x=b0(s,g.key,t);return x.length>0?{...g,scaleValues:x}:g}),d=(o[s]?(p=t==null?void 0:t.theme)!=null&&p.borderWidth?Object.keys(t.theme.borderWidth):qp:(f=t==null?void 0:t.theme)!=null&&f.spacing?Object.keys(t.theme.spacing):Pa).map(g=>g===""?r[s]:`${r[s]}-${g}`);return{...i,slots:u,shorthandScaleValues:d}})}const S0={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]},k0={tl:"x",t:"x",tr:"x",l:"y",all:"x",r:"y",bl:"x",b:"x",br:"x"};function Ni(e){return e==="rounded"?"—":e.replace(/^rounded-/,"").replace(/^(?:tl|tr|br|bl|[trbl])-/,"")}function C0({slot:e,frozen:t,isActive:n,onSlotClick:r,onSlotChange:o,onSlotHover:l,onSlotRemove:s,onSlotRemoveHover:i,onScrubStart:u,onScrubEnd:c,onOpen:d,onClose:p}){const[f,g]=S0[e.key],x=e.value!=null,b=`cm-slot${x?" cm-has-val":""}`,S=e.key==="all"?"cm-cell cm-cell-all cm-content":`cm-cell cm-cell-${e.key}`,m={gridRow:f,gridColumn:g},h=k0[e.key];return e.scaleValues&&e.scaleValues.length>0?a.jsx("div",{className:S,style:m,children:a.jsx(Kr,{placeholder:e.placeholder,values:e.scaleValues,currentValue:e.value,displayValue:x?Ni(e.value):null,formatValue:Ni,axis:h,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:()=>d(e.key),onClose:p,onRemove:s?()=>s(e.key):void 0,onRemoveHover:i?()=>i(e.key):void 0})}):a.jsx("div",{className:S,style:m,children:a.jsx("span",{className:b,role:"button",tabIndex:t?-1:0,onClick:t?void 0:y=>r(e.key,y.currentTarget),children:x?Ni(e.value):e.placeholder})})}function j0({state:e,frozen:t=!1,onSlotClick:n,onSlotChange:r,onSlotHover:o,onSlotRemove:l,onSlotRemoveHover:s,onEditStart:i}){const[u,c]=w.useState(null),d=t||u!==null,p=new Map(e.slots.map(b=>[b.key,b])),f=p.get("all")??{key:"all",value:e.shorthandValue,placeholder:"all",scaleValues:e.shorthandScaleValues},g=["tl","t","tr","l","all","r","bl","b","br"],x=`cm-root${d?" cm-frozen":""}${u?" cm-active":""}`;return a.jsx("div",{className:x,children:a.jsx("div",{className:"cm-grid",children:g.map(b=>{const S=b==="all"?f:p.get(b)??{key:b,value:null,placeholder:b,scaleValues:void 0};return a.jsx(C0,{slot:S,frozen:d,isActive:u===b,onSlotClick:(m,h)=>n==null?void 0:n(m,h),onSlotChange:(m,h)=>r==null?void 0:r(m,h),onSlotHover:(m,h)=>o==null?void 0:o(m,h),onSlotRemove:l,onSlotRemoveHover:s,onScrubStart:m=>{c(m),i==null||i()},onScrubEnd:()=>c(null),onOpen:m=>{c(m),i==null||i()},onClose:()=>c(null)},b)})})})}function jd({label:e,availableProperties:t=[],onAddProperty:n,isEmpty:r=!1,classCount:o=0,children:l}){const[s,i]=w.useState(!1),[u,c]=w.useState(r),d=w.useRef(r),p=w.useRef(null);w.useEffect(()=>{d.current&&!r&&c(!1),d.current=r},[r]),w.useEffect(()=>{if(!s)return;function g(x){p.current&&!p.current.contains(x.target)&&i(!1)}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[s]);function f(g){n==null||n(g),i(!1)}return a.jsxs("div",{className:"px-4 py-3",children:[a.jsxs("div",{className:"group/sec flex items-center gap-1.5 cursor-pointer select-none",onClick:()=>c(g=>!g),children:[a.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:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})}),a.jsx("span",{className:"text-[10px] font-semibold text-bv-text",children:e}),u&&o>0&&a.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&&a.jsxs("div",{ref:p,className:"relative ml-auto",children:[a.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:g=>{g.stopPropagation(),i(x=>!x)},children:a.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M12 5v14m-7-7h14"})})}),s&&a.jsx(fr,{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:()=>i(!1),children:t.map(g=>a.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:()=>f(g.prefix),children:[g.name,a.jsx("span",{className:"font-mono text-[10px] text-bv-muted group-hover:text-bv-teal/60",children:g.prefixHint})]},g.prefix))})]})]}),a.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?a.jsxs("div",{className:"text-[10px] text-bv-muted italic mt-2",children:["No ",e.toLowerCase()," classes — click + to add"]}):a.jsx("div",{className:"flex flex-wrap gap-1 mt-2.5",children:l})})]})}const E0=[{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 T0({direction:e,mode:t,onHover:n,onLeave:r,onDirectionClick:o,onSolidClick:l,solidColorName:s}){const i=t==="solid";return a.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[a.jsx("div",{className:"grid grid-cols-3 gap-0.5",onMouseLeave:r,children:E0.map((u,c)=>{if(u==="center"){const p=i;return a.jsx("button",{type:"button",className:`w-5 h-5 rounded-[3px] flex items-center justify-center text-xs cursor-pointer transition-all duration-150
|
|
57
|
+
${p?"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 d=!i&&e===u.dir;return a.jsx("button",{type:"button",className:`w-5 h-5 rounded-[3px] flex items-center justify-center text-[10px] cursor-pointer transition-all duration-150
|
|
58
58
|
${i?"opacity-35 hover:opacity-100":""}
|
|
59
|
-
${d?"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(
|
|
59
|
+
${d?"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)})}),a.jsx("div",{className:"text-[10px] font-mono text-bv-text-mid mt-0.75 max-w-[68px] truncate text-center",children:i?s?a.jsx("span",{className:"text-bv-text font-bold",children:s}):a.jsx("span",{className:"text-bv-muted italic",children:"none"}):a.jsxs("span",{children:["to-",a.jsx("span",{className:"text-bv-teal font-bold",children:e})]})})]})}function N0(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 Ri(e){return Math.round(Math.max(0,Math.min(100,e))/5)*5}function R0({stop:e,isEndpoint:t,isSelected:n,onDragStart:r,onClick:o,onRemove:l}){const s=w.useRef(!1),i=w.useCallback(p=>{p.preventDefault(),p.stopPropagation(),s.current=!1,r(e.id,p.clientX);const f=()=>{s.current=!0},g=()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",g)};document.addEventListener("mousemove",f),document.addEventListener("mouseup",g)},[e.id,r]),u=w.useCallback(p=>{p.stopPropagation(),s.current||o(e.id,p.currentTarget)},[e.id,o]),c=w.useCallback(p=>{p.stopPropagation(),l(e.id)},[e.id,l]),d=e.position??0;return a.jsxs("div",{className:`absolute top-0 cursor-grab select-none z-10
|
|
60
60
|
hover:z-20
|
|
61
|
-
${n?"z-25":""}`,style:{left:`${d}%`,transform:"translateX(-50%)",width:22,height:26,filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.2))"},onMouseDown:i,onClick:a,title:`${e.role}-${e.colorName}${e.position!=null?` ${e.position}%`:""}`,children:[u.jsx("svg",{viewBox:"0 0 22 26",width:22,height:26,xmlns:"http://www.w3.org/2000/svg",children:u.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&&u.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:p=>p.stopPropagation(),children:"×"})]})}function R0({stops:e,direction:t,onStopDrag:n,onStopDragEnd:r,onStopClick:o,onBarClick:l,onStopRemove:s,selectedStopId:i}){const a=w.useRef(null),c=w.useRef(null),d=[...e].sort((x,b)=>(x.position??0)-(b.position??0)),p=w.useCallback((x,b)=>{const S=e.find(y=>y.id===x);if(!S)return;c.current={stopId:x,startX:b,startPos:S.position??0};const m=y=>{const v=c.current;if(!v||!a.current)return;const C=a.current.getBoundingClientRect(),j=(y.clientX-v.startX)/C.width*100,T=Ri(v.startPos+j);n(v.stopId,T)},h=y=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",h);const v=c.current;if(v&&a.current){const C=a.current.getBoundingClientRect(),j=(y.clientX-v.startX)/C.width*100,T=Ri(v.startPos+j);r(v.stopId,T)}c.current=null};document.addEventListener("mousemove",m),document.addEventListener("mouseup",h)},[e,n,r]),f=w.useCallback(x=>{if(!a.current)return;const b=a.current.getBoundingClientRect(),S=(x.clientX-b.left)/b.width*100;l(Ri(S))},[l]),g=T0(d,t);return u.jsxs("div",{className:"relative flex-1 min-w-0",style:{paddingTop:28},children:[d.map((x,b)=>u.jsx(N0,{stop:x,isEndpoint:b===0||b===d.length-1,isSelected:x.id===i,onDragStart:p,onClick:o,onRemove:s},x.id)),u.jsx("div",{ref:a,className:"h-9 rounded-md cursor-pointer relative",style:{background:g,border:"1px solid rgba(0,0,0,0.08)",boxShadow:"inset 0 1px 2px rgba(0,0,0,0.06)"},onClick:f,children:u.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 P0={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 _0(e){var Ft,Kn;const{direction:t,stops:n,mode:r,solidColorName:o,solidColorHex:l,onPreview:s,onPreviewBatch:i,onRevert:a,onStage:c}=e,[d,p]=w.useState(t),[f,g]=w.useState(n),[x,b]=w.useState(r),[S,m]=w.useState(o),[h,y]=w.useState(l),[v,C]=w.useState(null),[k,j]=w.useState(!1),[T,$]=w.useState(null),[_,W]=w.useState(null),O=w.useRef(n.length+1),P=w.useCallback(q=>{if(x==="gradient")s(`bg-gradient-to-${d}`,`bg-gradient-to-${q}`);else{const re=S??"slate-500",le=S?`bg-${S}`:"";i([{oldClass:le,newClass:`bg-gradient-to-${q}`},{oldClass:"",newClass:`from-${re}`},{oldClass:"",newClass:`to-${re}`}])}},[d,x,S,s,i]),A=w.useCallback(()=>{a()},[a]),X=w.useCallback(q=>{if(p(q),b("gradient"),x==="gradient"&&f.length>=2){const re=`bg-gradient-to-${d}`,le=`bg-gradient-to-${q}`;c(re,le)}else{const re=S??"slate-500",le=h??Xn(re,e.colors),E={id:"1",role:"from",colorName:re,hex:le,position:0},D={id:"2",role:"to",colorName:re,hex:le,position:100};O.current=3,g([E,D]);const K=S?`bg-${S}`:"";c(K,`bg-gradient-to-${q}`),c("",`from-${re}`),c("",`to-${re}`)}},[d,x,f,S,h,e.colors,c]),H=w.useCallback(()=>{b("solid"),j(!1),C(null),$(null),f.length>0&&!S&&(m(f[0].colorName),y(f[0].hex))},[f,S]),ne=w.useCallback((q,re)=>{g(E=>E.map(D=>D.id===q?{...D,position:re}:D));const le=f.find(E=>E.id===q);if(le){const E=le.position!=null?`${le.role}-${le.position}%`:"",D=`${le.role}-${re}%`;s(E,D)}},[f,s]),R=w.useCallback((q,re)=>{g(E=>E.map(D=>D.id===q?{...D,position:re}:D));const le=f.find(E=>E.id===q);if(le){const E=le.position!=null?`${le.role}-${le.position}%`:"",D=`${le.role}-${re}%`;c(E,D)}},[f,c]),L=w.useCallback((q,re)=>{v===q&&k?(C(null),j(!1),$(null),W(null)):(C(q),j(!0),$("stop"),W(re))},[v,k]),N=w.useCallback(q=>{const re=String(O.current++),le=[...f].sort((K,Z)=>(K.position??0)-(Z.position??0));let E=le[0];for(const K of le)(K.position??0)<=q&&(E=K);const D={id:re,role:"via",colorName:(E==null?void 0:E.colorName)??"gray-500",hex:(E==null?void 0:E.hex)??"#6B7280",position:q};g(K=>[...K,D]),C(re),j(!0),$("stop")},[f]),z=w.useCallback(q=>{const re=f.find(E=>E.id===q);if(!re)return;const le=f.filter(E=>E.id!==q);if(C(null),j(!1),$(null),W(null),le.length>=2)g(le),c(`${re.role}-${re.colorName}`,"");else if(le.length===1){const E=le[0];g([]),b("solid"),m(E.colorName),y(E.hex),c(`bg-gradient-to-${d}`,""),f.forEach(D=>c(`${D.role}-${D.colorName}`,"")),c("",`bg-${E.colorName}`)}else g([]),b("none"),m(null),y(null),c(`bg-gradient-to-${d}`,""),f.forEach(E=>c(`${E.role}-${E.colorName}`,""))},[f,d,c]),V=w.useCallback(q=>{j(!0),$("solid"),C(null),W(q)},[]),me=w.useCallback(()=>{s(S?`bg-${S}`:"","")},[S,s]),be=w.useCallback(()=>{S&&c(`bg-${S}`,""),m(null),y(null),j(!1),$(null),W(null)},[S,c]),ae=w.useCallback(q=>{if(T==="stop"&&v){const re=f.find(le=>le.id===v);re&&s(`${re.role}-${re.colorName}`,q)}else T==="solid"&&s(`bg-${S}`,q)},[T,v,f,S,s]),se=w.useCallback(()=>{a()},[a]),_e=w.useCallback(q=>{if(T==="stop"&&v){const re=f.find(le=>le.id===v);if(re){const le=re.role+"-",E=q.startsWith(le)?q.slice(le.length):q;g(D=>D.map(K=>K.id===v?{...K,colorName:E,hex:Xn(E,e.colors)}:K)),c(`${re.role}-${re.colorName}`,`${re.role}-${E}`),j(!1),C(null),$(null),W(null)}}else if(T==="solid"){const re="bg-",le=q.startsWith(re)?q.slice(re.length):q,E=S?`bg-${S}`:"";m(le),y(Xn(le,e.colors)),c(E,`bg-${le}`),j(!1),$(null),W(null)}},[T,v,f,S,c,e.colors]),ye=w.useCallback(()=>{j(!1),C(null),$(null),W(null),a()},[a]),eo=T==="stop"&&v?(((Ft=f.find(q=>q.id===v))==null?void 0:Ft.role)??"from")+"-":"bg-",to=T==="stop"&&v?((Kn=f.find(q=>q.id===v))==null?void 0:Kn.colorName)??"":S??"",pr=P0[d],ro=!!(v?f.find(q=>q.id===v):null);return{direction:d,stops:f,mode:x,solidColorName:S,solidColorHex:h,selectedStopId:v,colorPickerOpen:k,editingTarget:T,anchorEl:_,colorPrefix:eo,colorPickerCurrentValue:to,directionCSS:pr,selectedStopIsRemovable:ro,handleDirectionHover:P,handleDirectionLeave:A,handleDirectionClick:X,handleSolidToggle:H,handleStopDrag:ne,handleStopDragEnd:R,handleStopClick:L,handleBarClick:N,handleStopRemove:z,handleSwatchClick:V,handleHoverRemoveSolid:me,handleRemoveSolid:be,handleColorHover:ae,handleColorLeave:se,handleColorClick:_e,handleCloseColorPicker:ye}}function Xn(e,t){if(typeof t[e]=="string")return t[e];const n=e.lastIndexOf("-");if(n>0){const r=e.slice(0,n),o=e.slice(n+1);if(t[r]&&typeof t[r][o]=="string")return t[r][o]}return"#888888"}function I0(e){const t=_0(e),n=t.mode==="solid",{refs:r,floatingStyles:o,context:l}=mn({open:t.colorPickerOpen,onOpenChange:a=>{a||t.handleCloseColorPicker()},strategy:"fixed",placement:"bottom-start",middleware:[cn(4),fn(),dn({padding:8}),Ma({apply({availableHeight:a,elements:c}){Object.assign(c.floating.style,{maxHeight:`${a}px`})},padding:8})],whileElementsMounted:un}),s=sr(l),{getFloatingProps:i}=ir([s]);return w.useEffect(()=>{t.anchorEl&&r.setReference(t.anchorEl)},[t.anchorEl]),u.jsxs("div",{className:"group",children:[u.jsxs("div",{className:"flex items-start gap-2.5 mb-2",children:[u.jsx(E0,{direction:t.direction,mode:t.mode,onHover:t.handleDirectionHover,onLeave:t.handleDirectionLeave,onDirectionClick:t.handleDirectionClick,onSolidClick:t.handleSolidToggle,solidColorName:t.solidColorName}),n?u.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:a=>t.handleSwatchClick(a.currentTarget),title:t.solidColorName?`bg-${t.solidColorName}`:"Click to pick color",children:!t.solidColorHex&&u.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:[u.jsx("line",{x1:"4",y1:"4",x2:"96",y2:"96",stroke:"#F5532D",strokeWidth:"3",strokeLinecap:"round"}),u.jsx("line",{x1:"96",y1:"4",x2:"4",y2:"96",stroke:"#F5532D",strokeWidth:"3",strokeLinecap:"round"})]})}):u.jsx(R0,{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&&u.jsx(pn,{children:u.jsxs("div",{ref:r.setFloating,style:{...o,zIndex:9999,overflowY:"auto"},...i(),children:[u.jsx(Fl,{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&&u.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"})]})}),u.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 L0(e,t,n){var y;const r=new Map;for(const v of e)r.set(v.fullClass,!0);if(n)for(const v of n)v.kind==="class-change"&&v.status==="staged"&&(v.originalClass&&r.delete(v.originalClass),v.newClass&&r.set(v.newClass,!0));const o=e.find(v=>v.property==="bg-gradient-to"),l=Array.from(r.keys()).find(v=>v.startsWith("bg-gradient-to-")),i=(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(v=>v.startsWith("bg-")&&!v.startsWith("bg-gradient-to-"))[0])==null?void 0:y.replace("bg-",""))??null,d=(c==null?void 0:c.split("/")[0])??null,p=d?Xn(d,t):null,f=Array.from(r.keys()),g=f.filter(v=>v.startsWith("from-")),x=f.filter(v=>v.startsWith("via-")),b=f.filter(v=>v.startsWith("to-")),S=!!(l||g.length>0&&b.length>0),m=S?"gradient":"solid",h=[];if(S){let v=1;for(const C of g){const k=C.replace("from-",""),j=k.split("/")[0];h.push({id:String(v++),role:"from",colorName:k,hex:Xn(j,t),position:null})}for(const C of x){const k=C.replace("via-",""),j=k.split("/")[0];h.push({id:String(v++),role:"via",colorName:k,hex:Xn(j,t),position:null})}for(const C of b){const k=C.replace("to-",""),j=k.split("/")[0];h.push({id:String(v++),role:"to",colorName:k,hex:Xn(j,t),position:null})}}return{direction:i,stops:h,mode:m,solidColorName:c,solidColorHex:p,colors:t}}const Me="#00848B",ur="rgba(0,132,139,0.18)",A0="#F5532D",wt="#4a4a4a",Dn="#333333",Ae="#999999",Je="'Roboto Mono', 'Menlo', ui-monospace, monospace",$t={width:60,height:60,borderRadius:5,borderWidth:"1.5px",borderStyle:"solid",borderColor:wt,background:Dn,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"},$a={background:Me,opacity:.65,borderRadius:2,flexShrink:0,transition:"opacity 150ms ease-in-out"},jd={...$a,opacity:.9},Im={flexShrink:0,background:A0,opacity:.18,borderRadius:1,transition:"opacity 150ms ease-in-out"},O0={...Im,opacity:.38};function Yt({label:e,isActive:t,containerStyle:n,onClick:r,onHover:o,children:l}){const[s,i]=w.useState(!1),a=t||s,c={...$t,borderColor:a?Me:wt,background:a?ur:Dn,boxShadow:t?"0 0 0 2px rgba(0,132,139,0.35)":"none",...n};return u.jsxs("div",{className:"cursor-pointer",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3},onMouseEnter:()=>{i(!0),o==null||o()},onMouseLeave:()=>i(!1),onClick:r,children:[u.jsx("div",{style:c,children:l(a)}),u.jsx("span",{style:{fontSize:9,fontFamily:Je,color:a?Me:Ae,fontWeight:a?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:e})]})}const Pi=[{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 Lm({direction:e,color:t}){const n={stroke:t,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"};switch(e){case"flex-row":return u.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",children:[u.jsx("line",{x1:"5",y1:"15",x2:"25",y2:"15",...n}),u.jsx("polyline",{points:"19,9 25,15 19,21",...n})]});case"flex-col":return u.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",children:[u.jsx("line",{x1:"15",y1:"5",x2:"15",y2:"25",...n}),u.jsx("polyline",{points:"9,19 15,25 21,19",...n})]});case"flex-row-reverse":return u.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",children:[u.jsx("line",{x1:"25",y1:"15",x2:"5",y2:"15",...n}),u.jsx("polyline",{points:"11,9 5,15 11,21",...n})]});case"flex-col-reverse":return u.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",children:[u.jsx("line",{x1:"15",y1:"25",x2:"15",y2:"5",...n}),u.jsx("polyline",{points:"9,11 15,5 21,11",...n})]})}}function D0({currentValue:e,lockedValue:t,locked:n,onHover:r,onLeave:o,onClick:l}){const[s,i]=w.useState(!1),{refs:a,floatingStyles:c,context:d}=mn({open:s,onOpenChange:k=>{k||(i(!1),o())},strategy:"fixed",placement:"bottom-start",middleware:[cn(4),fn(),dn({padding:8})],whileElementsMounted:un}),p=sr(d),{getReferenceProps:f,getFloatingProps:g}=ir([p]),x=t!==null&&Pi.some(k=>k.value===t),b=n&&!x,S=x?t:e??"",m=Pi.find(k=>k.value===S),h=!m;function y(){i(!1),o()}function v(){b||i(k=>(k&&o(),!k))}const C=h?{...$t,borderStyle:"dashed",borderColor:s?Me:wt,background:s?ur:"transparent",alignItems:"center",justifyContent:"center",cursor:b?"default":"pointer"}:{...$t,borderColor:s?Me:wt,background:s?ur:Dn,boxShadow:s?"0 0 0 2px rgba(0,132,139,0.18)":"none",alignItems:"center",justifyContent:"center",cursor:b?"default":"pointer"};return u.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:2},children:[u.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Ae,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Direction"}),u.jsxs("div",{ref:a.setReference,role:"button",tabIndex:b?-1:0,"aria-label":"Direction",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&v()},onClick:v,...f(),children:[u.jsx("div",{style:C,children:m?u.jsx(Lm,{direction:m.value,color:s?Me:Ae}):u.jsx("span",{style:{fontSize:10,fontFamily:Je,color:Ae},children:"—"})}),u.jsx("span",{style:{fontSize:9,fontFamily:Je,color:s?Me:Ae,fontWeight:s?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:(m==null?void 0:m.label)??"—"})]}),s&&u.jsx(pn,{children:u.jsx("div",{ref:a.setFloating,style:c,className:"z-[9999]",...g(),children:u.jsx(fr,{style:{background:"#1e1e1e",border:`1px solid ${wt}`,borderRadius:8,boxShadow:"0 4px 16px rgba(0,0,0,0.35)",padding:8},onMouseLeave:o,onClose:y,children:u.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 60px)",gap:4},children:Pi.map(k=>{const j=k.value===S;return u.jsx(M0,{option:k,isActive:j,onHover:()=>r(k.value),onClick:()=>{l(k.value),y()}},k.value)})})})})})]})}function M0({option:e,isActive:t,onHover:n,onClick:r}){const[o,l]=w.useState(!1),s=t||o,i={...$t,borderColor:s?Me:wt,background:s?ur:Dn,boxShadow:t?"0 0 0 2px rgba(0,132,139,0.35)":"none",alignItems:"center",justifyContent:"center"};return u.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3,cursor:"pointer"},onMouseEnter:()=>{l(!0),n()},onMouseLeave:()=>l(!1),onClick:r,children:[u.jsx("div",{style:i,children:u.jsx(Lm,{direction:e.value,color:s?Me:Ae})}),u.jsx("span",{style:{fontSize:9,fontFamily:Je,color:s?Me:Ae,fontWeight:s?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:e.label})]})}const _i=[{value:"flex-nowrap",label:"no-wrap"},{value:"flex-wrap",label:"wrap"},{value:"flex-wrap-reverse",label:"wrap-reverse"}],$0=e=>({stroke:e,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"});function Am({mode:e,color:t}){const n=$0(t),r={...n,strokeDasharray:"2 3"};return e==="flex-nowrap"?u.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[u.jsx("line",{x1:"3",y1:"7",x2:"37",y2:"7",...n}),u.jsx("polyline",{points:"31,1 37,7 31,13",...n})]}):e==="flex-wrap"?u.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[u.jsx("line",{x1:"3",y1:"7",x2:"37",y2:"7",...n}),u.jsx("line",{x1:"37",y1:"7",x2:"3",y2:"33",...r}),u.jsx("line",{x1:"3",y1:"33",x2:"37",y2:"33",...n}),u.jsx("polyline",{points:"31,27 37,33 31,39",...n})]}):u.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[u.jsx("line",{x1:"3",y1:"33",x2:"37",y2:"33",...n}),u.jsx("line",{x1:"37",y1:"33",x2:"3",y2:"7",...r}),u.jsx("line",{x1:"3",y1:"7",x2:"37",y2:"7",...n}),u.jsx("polyline",{points:"31,1 37,7 31,13",...n})]})}function z0({option:e,isActive:t,onHover:n,onClick:r}){const[o,l]=w.useState(!1),s=t||o,i={...$t,borderColor:s?Me:wt,background:s?ur:Dn,boxShadow:t?"0 0 0 2px rgba(0,132,139,0.35)":"none",alignItems:"center",justifyContent:"center"};return u.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3,cursor:"pointer"},onMouseEnter:()=>{l(!0),n()},onMouseLeave:()=>l(!1),onClick:r,children:[u.jsx("div",{style:i,children:u.jsx(Am,{mode:e.value,color:s?Me:Ae})}),u.jsx("span",{style:{fontSize:9,fontFamily:Je,color:s?Me:Ae,fontWeight:s?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:e.label})]})}function K0({currentValue:e,lockedValue:t,locked:n,onHover:r,onLeave:o,onClick:l}){const[s,i]=w.useState(!1),{refs:a,floatingStyles:c,context:d}=mn({open:s,onOpenChange:k=>{k||(i(!1),o())},strategy:"fixed",placement:"bottom-start",middleware:[cn(4),fn(),dn({padding:8})],whileElementsMounted:un}),p=sr(d),{getReferenceProps:f,getFloatingProps:g}=ir([p]),x=t!==null&&_i.some(k=>k.value===t),b=n&&!x,S=!x&&e===null,m=x?t:e??"",h=_i.find(k=>k.value===m),y=(h==null?void 0:h.label)??"Wrap";function v(){i(!1),o()}function C(){b||i(k=>(k&&o(),!k))}return u.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:2},children:[u.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Ae,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Wrap"}),u.jsxs("div",{ref:a.setReference,role:"button",tabIndex:b?-1:0,"aria-label":"Wrap",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&C()},onClick:C,...f(),children:[S?u.jsx("div",{style:{...$t,borderStyle:"dashed",borderColor:s?Me:wt,background:s?ur:"transparent",alignItems:"center",justifyContent:"center"},children:u.jsx("span",{style:{fontSize:10,fontFamily:Je,color:Ae},children:"—"})}):u.jsx("div",{style:{...$t,borderColor:s?Me:wt,background:s?ur:Dn,boxShadow:s?"0 0 0 2px rgba(0,132,139,0.18)":"none",alignItems:"center",justifyContent:"center"},children:u.jsx(Am,{mode:m,color:s?Me:Ae})}),u.jsx("span",{style:{fontSize:9,fontFamily:Je,color:s?Me:Ae,fontWeight:s?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:y})]}),s&&u.jsx(pn,{children:u.jsx("div",{ref:a.setFloating,style:c,className:"z-[9999]",...g(),children:u.jsx(fr,{style:{background:"#1e1e1e",border:`1px solid ${wt}`,borderRadius:8,boxShadow:"0 4px 16px rgba(0,0,0,0.35)",padding:8},onMouseLeave:o,onClose:v,children:u.jsx("div",{className:"grid gap-1",style:{gridTemplateColumns:"repeat(3, 60px)"},children:_i.map(k=>{const j=k.value===m;return u.jsx(z0,{option:k,isActive:j,onHover:()=>r(k.value),onClick:()=>{l(k.value),v()}},k.value)})})})})})]})}function F0({flexDirection:e="row",activeValue:t,onSelect:n,onHover:r}){const o=e.startsWith("column"),l=e;function s(f,g){const x=g?jd:$a;return o?{...x,width:"100%",height:f}:{...x,width:f,height:"100%"}}function i(f){const g=f?jd:$a;return o?{...g,flex:1,width:"100%"}:{...g,flex:1,height:"100%"}}function a(f,g){return{...g?O0:Im,flex:f}}const c=f=>t===f,d=f=>()=>n==null?void 0:n(f),p=f=>()=>r==null?void 0:r(f);return u.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 60px)",gap:4},children:[u.jsx(Yt,{label:"start",isActive:c("justify-start"),onClick:d("justify-start"),onHover:p("justify-start"),containerStyle:{flexDirection:l,justifyContent:"flex-start",gap:2},children:f=>u.jsxs(u.Fragment,{children:[u.jsx("div",{style:s(10,f)}),u.jsx("div",{style:s(14,f)}),u.jsx("div",{style:s(8,f)})]})}),u.jsx(Yt,{label:"center",isActive:c("justify-center"),onClick:d("justify-center"),onHover:p("justify-center"),containerStyle:{flexDirection:l,justifyContent:"center",gap:2},children:f=>u.jsxs(u.Fragment,{children:[u.jsx("div",{style:s(10,f)}),u.jsx("div",{style:s(14,f)}),u.jsx("div",{style:s(8,f)})]})}),u.jsx(Yt,{label:"stretch",isActive:c("justify-stretch"),onClick:d("justify-stretch"),onHover:p("justify-stretch"),containerStyle:{flexDirection:l,gap:2},children:f=>u.jsxs(u.Fragment,{children:[u.jsx("div",{style:i(f)}),u.jsx("div",{style:i(f)}),u.jsx("div",{style:i(f)})]})}),u.jsx(Yt,{label:"between",isActive:c("justify-between"),onClick:d("justify-between"),onHover:p("justify-between"),containerStyle:{flexDirection:l},children:f=>u.jsxs(u.Fragment,{children:[u.jsx("div",{style:s(12,f)}),u.jsx("div",{style:a(1,f)}),u.jsx("div",{style:s(12,f)})]})}),u.jsx(Yt,{label:"around",isActive:c("justify-around"),onClick:d("justify-around"),onHover:p("justify-around"),containerStyle:{flexDirection:l},children:f=>u.jsxs(u.Fragment,{children:[u.jsx("div",{style:a(1,f)}),u.jsx("div",{style:s(12,f)}),u.jsx("div",{style:a(2,f)}),u.jsx("div",{style:s(12,f)}),u.jsx("div",{style:a(1,f)})]})}),u.jsx(Yt,{label:"evenly",isActive:c("justify-evenly"),onClick:d("justify-evenly"),onHover:p("justify-evenly"),containerStyle:{flexDirection:l},children:f=>u.jsxs(u.Fragment,{children:[u.jsx("div",{style:a(1,f)}),u.jsx("div",{style:s(12,f)}),u.jsx("div",{style:a(1,f)}),u.jsx("div",{style:s(12,f)}),u.jsx("div",{style:a(1,f)})]})}),u.jsx(Yt,{label:"end",isActive:c("justify-end"),onClick:d("justify-end"),onHover:p("justify-end"),containerStyle:{flexDirection:l,justifyContent:"flex-end",gap:2},children:f=>u.jsxs(u.Fragment,{children:[u.jsx("div",{style:s(10,f)}),u.jsx("div",{style:s(14,f)}),u.jsx("div",{style:s(8,f)})]})})]})}const nn="bg-bv-teal/50 rounded-[2px] shrink-0 group-hover:bg-bv-teal/70 transition-colors duration-150",W0="bg-bv-orange/10 rounded-[2px]";function Xt({isCol:e,main:t}){return u.jsx("div",{className:nn,style:e?{height:t}:{width:t}})}function Wn({flex:e=1}){return u.jsx("div",{className:W0,style:{flex:e}})}function Bt({isCol:e,w:t,h:n}){return u.jsx("div",{className:nn,style:e?{width:n,height:t}:{width:t,height:n}})}function Ii({isCol:e,w:t,h:n,pt:r}){return u.jsx("div",{className:`${nn} 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 Li(e){return u.jsxs(u.Fragment,{children:[u.jsx(Xt,{isCol:e,main:10}),u.jsx(Xt,{isCol:e,main:14}),u.jsx(Xt,{isCol:e,main:8})]})}const Ed=[{value:"justify-start",label:"start",getContainerStyle:e=>({flexDirection:e,justifyContent:"flex-start",gap:2}),renderItems:e=>Li(e.startsWith("column"))},{value:"justify-center",label:"center",getContainerStyle:e=>({flexDirection:e,justifyContent:"center",gap:2}),renderItems:e=>Li(e.startsWith("column"))},{value:"justify-stretch",label:"stretch",getContainerStyle:e=>({flexDirection:e,gap:2}),renderItems:()=>u.jsxs(u.Fragment,{children:[u.jsx("div",{className:`${nn} flex-1`}),u.jsx("div",{className:`${nn} flex-1`}),u.jsx("div",{className:`${nn} flex-1`})]})},{value:"justify-between",label:"between",getContainerStyle:e=>({flexDirection:e}),renderItems:e=>{const t=e.startsWith("column");return u.jsxs(u.Fragment,{children:[u.jsx(Xt,{isCol:t,main:12}),u.jsx(Wn,{}),u.jsx(Xt,{isCol:t,main:12})]})}},{value:"justify-around",label:"around",getContainerStyle:e=>({flexDirection:e}),renderItems:e=>{const t=e.startsWith("column");return u.jsxs(u.Fragment,{children:[u.jsx(Wn,{flex:1}),u.jsx(Xt,{isCol:t,main:12}),u.jsx(Wn,{flex:2}),u.jsx(Xt,{isCol:t,main:12}),u.jsx(Wn,{flex:1})]})}},{value:"justify-evenly",label:"evenly",getContainerStyle:e=>({flexDirection:e}),renderItems:e=>{const t=e.startsWith("column");return u.jsxs(u.Fragment,{children:[u.jsx(Wn,{}),u.jsx(Xt,{isCol:t,main:12}),u.jsx(Wn,{}),u.jsx(Xt,{isCol:t,main:12}),u.jsx(Wn,{})]})}},{value:"justify-end",label:"end",getContainerStyle:e=>({flexDirection:e,justifyContent:"flex-end",gap:2}),renderItems:e=>Li(e.startsWith("column"))}],Ai=[{value:"items-start",label:"start",getContainerStyle:e=>({flexDirection:e,alignItems:"flex-start",gap:3}),renderItems:e=>{const t=e.startsWith("column");return u.jsxs(u.Fragment,{children:[u.jsx(Bt,{isCol:t,w:13,h:22}),u.jsx(Bt,{isCol:t,w:15,h:42}),u.jsx(Bt,{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 u.jsxs(u.Fragment,{children:[u.jsx(Bt,{isCol:t,w:13,h:22}),u.jsx(Bt,{isCol:t,w:15,h:42}),u.jsx(Bt,{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 u.jsxs(u.Fragment,{children:[u.jsx(Ii,{isCol:t,w:13,h:38,pt:17}),u.jsx(Ii,{isCol:t,w:15,h:26,pt:3}),u.jsx(Ii,{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 u.jsxs(u.Fragment,{children:[u.jsx("div",{className:nn,style:t?{height:13}:{width:13}}),u.jsx("div",{className:nn,style:t?{height:15}:{width:15}}),u.jsx("div",{className:nn,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 u.jsxs(u.Fragment,{children:[u.jsx(Bt,{isCol:t,w:13,h:22}),u.jsx(Bt,{isCol:t,w:15,h:42}),u.jsx(Bt,{isCol:t,w:11,h:14})]})}}];function V0({currentValue:e,lockedValue:t,locked:n,flexDirection:r="row",onHover:o,onLeave:l,onClick:s,onRemove:i,onRemoveHover:a}){const[c,d]=w.useState(!1),{refs:p,floatingStyles:f,context:g}=mn({open:c,onOpenChange:_=>{_||(d(!1),l())},strategy:"fixed",placement:"bottom-start",middleware:[cn(4),fn(),dn({padding:8})],whileElementsMounted:un}),x=sr(g),{getReferenceProps:b,getFloatingProps:S}=ir([x]),m=t!==null&&Ed.some(_=>_.value===t),h=n&&!m,y=!m&&(e===null||e===""),v=m?t:e??"",C=Ed.find(_=>_.value===v),k=(C==null?void 0:C.label)??"—";function j(){d(!1),l()}function T(){h||d(_=>(_&&l(),!_))}const $={...$t,borderStyle:"dashed",alignItems:"center",justifyContent:"center"};return u.jsxs("div",{className:"flex flex-col items-start gap-1",children:[u.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Ae,fontWeight:500},children:"JUSTIFY →"}),u.jsx("div",{ref:p.setReference,className:"cursor-pointer",role:"button",tabIndex:h?-1:0,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&T()},onClick:T,...b(),children:y?u.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[u.jsx("div",{style:$,children:u.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Ae},children:"—"})}),u.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Ae},children:"none"})]}):u.jsx(Yt,{label:k,isActive:c,containerStyle:(C==null?void 0:C.getContainerStyle(r))??{flexDirection:r},children:_=>(C==null?void 0:C.renderItems(r))??null})}),c&&u.jsx(pn,{children:u.jsx("div",{ref:p.setFloating,style:f,className:"z-[9999]",...S(),children:u.jsxs(fr,{className:"bg-bv-bg border border-bv-border rounded-lg shadow-lg p-2 flex flex-col gap-1",onMouseLeave:l,onClose:j,children:[i&&u.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:a,onMouseLeave:l,onClick:()=>{i(),j()},children:[u.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",className:"shrink-0",children:[u.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),u.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),"remove"]}),u.jsx(F0,{flexDirection:r,activeValue:v,onSelect:_=>{s(_),j()},onHover:o})]})})})]})}function H0({currentValue:e,lockedValue:t,locked:n,flexDirection:r="row",onHover:o,onLeave:l,onClick:s,onRemove:i,onRemoveHover:a}){const[c,d]=w.useState(!1),{refs:p,floatingStyles:f,context:g}=mn({open:c,onOpenChange:W=>{W||(d(!1),l())},strategy:"fixed",placement:"bottom-start",middleware:[cn(4),fn(),dn({padding:8})],whileElementsMounted:un}),x=sr(g),{getReferenceProps:b,getFloatingProps:S}=ir([x]),m=t!==null&&Ai.some(W=>W.value===t),h=n&&!m,y=!m&&(e===null||e===""),v=m?t:e??"",C=Ai.find(W=>W.value===v),k=(C==null?void 0:C.label)??"—",j=r;function T(){d(!1),l()}function $(){h||d(W=>(W&&l(),!W))}const _=y?{...$t,borderStyle:"dashed",borderColor:wt,background:Dn,cursor:h?"default":"pointer",alignItems:"center",justifyContent:"center"}:{...$t,borderColor:c?Me:wt,background:c?"rgba(0,132,139,0.09)":Dn,cursor:h?"default":"pointer",...C?C.getContainerStyle(r):{}};return u.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:2},children:[u.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Ae,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Align ↓"}),u.jsx("div",{ref:p.setReference,role:"button",tabIndex:h?-1:0,onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&$()},onClick:$,...b(),children:u.jsx("div",{style:_,children:y?u.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Ae},children:"—"}):C==null?void 0:C.renderItems(r)})}),u.jsx("span",{style:{fontSize:9,fontFamily:Je,color:c?Me:Ae,fontWeight:c?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:y?"—":k}),c&&u.jsx(pn,{children:u.jsx("div",{ref:p.setFloating,style:f,className:"z-[9999]",...S(),children:u.jsxs(fr,{className:"bg-bv-bg border border-bv-border rounded-lg shadow-lg p-2 flex flex-col gap-1",onMouseLeave:l,onClose:T,children:[i&&u.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:a,onMouseLeave:l,onClick:()=>{i(),T()},children:[u.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",className:"shrink-0",children:[u.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),u.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),"remove"]}),u.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 60px)",gap:4},children:Ai.map(W=>u.jsx(Yt,{label:W.label,isActive:W.value===v,containerStyle:{flexDirection:j,...W.getContainerStyle(r)},onHover:()=>o(W.value),onClick:()=>{s(W.value),T()},children:O=>W.renderItems(r)},W.value))})]})})})]})}function Td(e){return e.replace(/^gap-x-/,"x-")}function Nd(e){return e.replace(/^gap-y-/,"y-")}function B0({slots:e,onSlotChange:t,onSlotHover:n,onSlotRemove:r,onSlotRemoveHover:o}){const[l,s]=w.useState(null),[i,a]=w.useState(null),c=e.find(S=>S.key==="gap"),d=e.find(S=>S.key==="gap-x"),p=e.find(S=>S.key==="gap-y");function f(S,m){a(m!=null?S:null),n==null||n(S,m)}function g(S){a(S)}function x(){a(null)}const b=i==="gap-x"?"gm-active-x":i==="gap-y"?"gm-active-y":i==="gap"?"gm-active-gap":"";return u.jsx("div",{className:"gm-root",children:u.jsxs("div",{className:`gm-grid${b?` ${b}`:""}`,children:[u.jsx("div",{className:"gm-col-highlight",style:{gridArea:"1 / 2 / 4 / 3"}}),u.jsx("div",{className:"gm-row-highlight",style:{gridArea:"2 / 1 / 3 / 4"}}),u.jsx("div",{className:"gm-box gm-box-tl",style:{gridArea:"1 / 1"}}),u.jsx("div",{className:"gm-cell",style:{gridArea:"1 / 2"},onMouseEnter:()=>g("gap-x"),onMouseLeave:x,children:(d==null?void 0:d.scaleValues)&&u.jsx(Kr,{placeholder:"x",values:d.scaleValues,currentValue:d.value,displayValue:d.value?Td(d.value):null,formatValue:Td,axis:"x",disabled:l!==null&&l!=="gap-x",onHover:S=>f("gap-x",S),onLeave:()=>f("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:d.value?()=>r==null?void 0:r("gap-x"):void 0,onRemoveHover:d.value?()=>{a(null),o==null||o("gap-x")}:void 0})}),u.jsx("div",{className:"gm-box gm-box-tr",style:{gridArea:"1 / 3"}}),u.jsx("div",{className:"gm-cell",style:{gridArea:"2 / 1"},onMouseEnter:()=>g("gap-y"),onMouseLeave:x,children:(p==null?void 0:p.scaleValues)&&u.jsx(Kr,{placeholder:"y",values:p.scaleValues,currentValue:p.value,displayValue:p.value?Nd(p.value):null,formatValue:Nd,axis:"y",disabled:l!==null&&l!=="gap-y",onHover:S=>f("gap-y",S),onLeave:()=>f("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:p.value?()=>r==null?void 0:r("gap-y"):void 0,onRemoveHover:p.value?()=>{a(null),o==null||o("gap-y")}:void 0})}),u.jsx("div",{className:"gm-cell",style:{gridArea:"2 / 2"},onMouseEnter:()=>g("gap"),onMouseLeave:x,children:(c==null?void 0:c.scaleValues)&&u.jsx(Kr,{placeholder:"gap",values:c.scaleValues,currentValue:c.value,displayValue:c.value??null,axis:"x",disabled:l!==null&&l!=="gap",onHover:S=>f("gap",S),onLeave:()=>f("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?()=>{a(null),o==null||o("gap")}:void 0})}),u.jsx("div",{className:"gm-box gm-box-bl",style:{gridArea:"3 / 1"}})]})})}const Om={shadow:"Shadow","inset-shadow":"Inset Shadow",ring:"Ring","inset-ring":"Inset Ring","text-shadow":"Text Shadow"},Rd={shadow:"shadow-md","inset-shadow":"inset-shadow-sm",ring:"ring-2","inset-ring":"inset-ring-2","text-shadow":"text-shadow-md"};function U0(e){switch(e){case"shadow":return[...Au];case"inset-shadow":return[...Xp];case"ring":return[...Na];case"inset-ring":return[...Na];case"text-shadow":return[...Ou]}}function Pd(e,t){return`${e==="shadow"?"shadow-":e==="inset-shadow"?"inset-shadow-":e==="ring"?"ring-":e==="inset-ring"?"inset-ring-":"text-shadow-"}${t}`}function G0(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 Y0(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),i=parseInt(e.colorHex.slice(5,7),16);return`rgba(${l},${s},${i},${o})`}return e.colorHex},n=e.colorHex?t(e.colorHex):void 0;switch(e.type){case"shadow":{const r=bo(e.sizeClass,"shadow-");return Z0(r,n)}case"inset-shadow":{const r=bo(e.sizeClass,"inset-shadow-");return J0(r,n)}case"ring":{const r=bo(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=bo(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 Q0(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),i=parseInt(e.colorHex.slice(3,5),16),a=parseInt(e.colorHex.slice(5,7),16);return`rgba(${s},${i},${a},${l})`}return e.colorHex},n=e.colorHex?t(e.colorHex):void 0,r=bo(e.sizeClass,"text-shadow-");return X0(r,n)}function X0(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 bo(e,t){return e.startsWith(t)?e.slice(t.length):e}function Z0(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 J0(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 q0=Array.from({length:21},(e,t)=>`${t*5}%`);function e1({layer:e,onSizeHover:t,onSizeLeave:n,onSizeClick:r,onColorClick:o,onOpacityHover:l,onOpacityLeave:s,onOpacityClick:i,onRemove:a,onRemoveHover:c}){const[d,p]=w.useState(!1),f=w.useRef(),g={onMouseEnter:()=>{clearTimeout(f.current),p(!0)},onMouseLeave:()=>{f.current=setTimeout(()=>p(!1),60)}},x=U0(e.type),b=Y0(e),S=e.type==="text-shadow"?Q0(e):"none",m=e.isNone,h=e.sizeClass?G0(e.type,e.sizeClass):x[0],y=!!e.colorHex,v=e.opacity!==null?`${e.opacity}%`:"100%",C=e.colorHex??void 0;function k(T){t(Pd(e.type,T))}function j(T){r(Pd(e.type,T))}return u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"flex items-center justify-center",...g,children:u.jsx("span",{className:"w-1 h-1 rounded-full bg-bv-orange"})}),u.jsx("span",{className:"flex items-center text-[9px] font-semibold uppercase tracking-[0.8px] text-bv-text-mid font-mono whitespace-nowrap",...g,children:Om[e.type]}),u.jsx("span",{className:"flex items-center",...g,children:u.jsx(xn,{values:x,currentValue:h,lockedValue:null,locked:!1,onHover:k,onLeave:n,onClick:j})}),u.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"} ${m?"opacity-30 pointer-events-none":""}`,onClick:T=>o(T.currentTarget),title:e.colorClass?e.colorClass:"Default color — click to override",...g,children:e.colorHex?u.jsx("div",{className:"w-full h-full rounded-[4px]",style:{background:C,opacity:e.opacity!==null?e.opacity/100:1}}):u.jsx("div",{className:"w-full h-full rounded-[4px] flex items-center justify-center",children:u.jsx("span",{className:"w-2 h-2 rounded-full bg-bv-text-mid opacity-40"})})}),u.jsx("span",{className:`flex items-center ${m||!y?"opacity-30 pointer-events-none":""}`,...g,children:y&&!m?u.jsx(xn,{values:q0,currentValue:v,lockedValue:null,locked:!1,onHover:l,onLeave:s,onClick:i}):u.jsx("span",{className:"flex items-center justify-center w-full h-[26px] bg-bv-surface border border-bv-border rounded-[5px]",children:u.jsx("span",{className:"font-mono text-[11px] text-bv-muted select-none",children:"—"})})}),u.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(),...g,children:e.type==="text-shadow"&&u.jsx("span",{className:"text-[11px] font-semibold text-bv-text select-none transition-[text-shadow] duration-200",style:{textShadow:S},children:"Aa"})}),u.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 ${d?"opacity-100":"opacity-0"}`,onClick:a,onMouseEnter:()=>{clearTimeout(f.current),p(!0),c()},onMouseLeave:()=>{f.current=setTimeout(()=>p(!1),60)},title:"Remove layer",children:"×"})]})}const t1=["shadow","inset-shadow","ring","inset-ring","text-shadow"];function n1({layers:e,onPreview:t,onRevert:n,onStage:r,onAdd:o,onRemove:l,onRemoveHover:s,onColorClick:i}){function a(d){const p=[];return d.sizeClass&&p.push(d.sizeClass),d.colorClass&&p.push(d.opacity!==null?`${d.colorClass}/${d.opacity}`:d.colorClass),p}const c=t1.map(d=>({type:d,layer:e.find(p=>p.type===d)}));return u.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:d,layer:p},f)=>u.jsxs(w.Fragment,{children:[f>0&&u.jsx("div",{className:"h-px bg-bv-border opacity-50",style:{gridColumn:"1 / -1"}}),p?u.jsx(e1,{layer:p,onSizeHover:g=>t(p.sizeClass??"",g),onSizeLeave:n,onSizeClick:g=>r(p.sizeClass??"",g),onColorClick:g=>i==null?void 0:i(p,g),onOpacityHover:g=>{if(!p.colorClass)return;const x=p.colorClass.split("/")[0],b=parseInt(g),S=b===100?x:`${x}/${b}`,m=p.opacity!==null?`${x}/${p.opacity}`:x;t(m,S)},onOpacityLeave:n,onOpacityClick:g=>{if(!p.colorClass)return;const x=p.colorClass.split("/")[0],b=parseInt(g),S=b===100?x:`${x}/${b}`,m=p.opacity!==null?`${x}/${p.opacity}`:x;r(m,S)},onRemove:()=>l(a(p)),onRemoveHover:()=>s(a(p))}):u.jsxs(u.Fragment,{children:[u.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(Rd[d]),title:`Add ${Rd[d]}`,children:"+"}),u.jsx("div",{className:"flex items-center leading-none text-[9px] font-mono uppercase tracking-[0.6px] text-bv-muted whitespace-nowrap",children:Om[d]})]})]},d))})}const _d=[{prop:"shadow",prefix:"shadow-",sizeSet:ps},{prop:"inset-shadow",prefix:"inset-shadow-",sizeSet:ms},{prop:"ring",prefix:"ring-",sizeSet:Yr},{prop:"inset-ring",prefix:"inset-ring-",sizeSet:Yr},{prop:"text-shadow",prefix:"text-shadow-",sizeSet:hs}];function yr(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 i=!1;const a=e.flatMap(c=>{const d=c.startsWith(r)?c.slice(r.length).split("/")[0]:"";return o.has(d)===s&&!i?(i=!0,n?[n]:[]):[c]});return i?a:n?[...e,n]:e}function r1(e,t){if(!t)return null;const n=e.lastIndexOf("-");if(n===-1){const i=t[e];return typeof i=="string"?i: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 o1(e,t){const n=e.trim().split(/\s+/).filter(Boolean),r=t==null?void 0:t.colors,o=[{type:"shadow",prefix:"shadow-",sizeSet:ps},{type:"inset-shadow",prefix:"inset-shadow-",sizeSet:ms},{type:"ring",prefix:"ring-",sizeSet:Yr},{type:"inset-ring",prefix:"inset-ring-",sizeSet:Yr},{type:"text-shadow",prefix:"text-shadow-",sizeSet:hs}],l=[];for(const{type:s,prefix:i,sizeSet:a}of o){const c=n.filter(x=>x===i.slice(0,-1)||x.startsWith(i));if(c.length===0)continue;let d=null,p=null,f=null,g=null;for(const x of c){const S=x.slice(i.length).split("/")[0];if(a.has(S))d=x;else{p=x;const m=x.split("/");m.length===2&&(g=parseInt(m[1])),f=r1(S,r??null)}}l.push({type:s,sizeClass:d,colorClass:p,colorHex:f,opacity:g,isNone:d!==null&&(d.endsWith("-none")||d.endsWith("-0"))})}return l}function l1(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=>!_d.some(({prefix:i})=>s===i.slice(0,-1)||s.startsWith(i)));for(const{prop:s,prefix:i,sizeSet:a}of _d){const c=r.find(x=>x.property===s),d=r.find(x=>x.property===`${s}-size`),p=r.find(x=>x.property===`${s}-color`),f=o.filter(x=>x===i.slice(0,-1)||x.startsWith(i));if(c){if(c.newClass)l.push(...yr(f,c.originalClass,c.newClass,i,a));else{const x=c.originalClass.startsWith(i)?c.originalClass.slice(i.length).split("/")[0]:"";a.has(x)||!c.originalClass||l.push(...yr(f,c.originalClass,c.newClass,i,a))}continue}let g=[...f];d&&(d.newClass?g=yr(g,d.originalClass,d.newClass,i,a):d.originalClass&&(g=yr(g,d.originalClass,"",i,a))),p&&(p.newClass?g=yr(g,p.originalClass,p.newClass,i,a):p.originalClass&&(g=yr(g,p.originalClass,"",i,a))),l.push(...g)}return l.join(" ")}const s1={spacing:"Spacing",sizing:"Sizing",typography:"Typography",color:"Backgrounds",borders:"Radius",effects:"Effects",layout:"Layout",flexbox:"Flexbox & Grid",overflow:"Overflow"},i1=["layout","borders","sizing","typography","color","flexbox","shadows","effects"];function Id(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 a1(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 Vn(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 i=s.fullClass,a=n.find(c=>c.prefix.test(i));a?r.set(a.key,i):o=i}return{shorthandValue:o,shorthandScaleValues:Ra,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"?Ra:Ny(`rounded-${s}`)}))}}const Hn=r0(),Dm=o0(),u1={"text-size":{scaleName:"fontSize",valueType:"scalar"},"text-color":{scaleName:null,valueType:"color"}};Dm.typography.unshift({name:"Font size",prefixHint:"text-sm/base/lg/…",prefix:"text-size"},{name:"Text color",prefixHint:"text-{color}",prefix:"text-color"});function Wl(e){const t=u1[e];if(t)return{...t,stagingKey:e};const n=Object.entries(ar).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=ar[e];return r?{scaleName:r.themeKey,valueType:r.valueType,enumAlts:r.enumAlts,stagingKey:e.replace(/-$/g,"")}:null}function c1(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 i=Wl(s.prefix);if((i==null?void 0:i.valueType)==="enum"&&i.enumAlts)return!i.enumAlts.some(a=>o.has(a));if(i&&i.valueType!=="enum"){if(s.prefix==="text-size")return!t.some(a=>a.property==="text"&&a.scaleName==="fontSize");if(s.prefix==="text-color")return!t.some(a=>a.property==="text"&&a.color!==void 0)}return!l.has(s.prefix.replace(/-$/g,""))})}function d1(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 f1({componentName:e,instanceCount:t,rawClasses:n,parsedClasses:r,tailwindConfig:o,patchManager:l}){var re,le;const[s,i]=w.useState(null),[a,c]=w.useState(new Map),[d,p]=w.useState(new Map),[f,g]=w.useState(null),[x,b]=w.useState(null),[S,m]=w.useState(null),h=w.useRef(null),{refs:y,floatingStyles:v,context:C}=mn({open:f!==null,onOpenChange:E=>{E||(g(null),l.revertPreview())},strategy:"fixed",placement:"bottom-start",middleware:[cn(4),fn(),dn({padding:8}),Ma({apply({availableHeight:E,elements:D}){Object.assign(D.floating.style,{maxHeight:`${E}px`})},padding:8})],whileElementsMounted:un}),k=sr(C),{getFloatingProps:j}=ir([k]);w.useEffect(()=>{f!=null&&f.anchorEl&&y.setReference(f.anchorEl)},[f==null?void 0:f.anchorEl]);const{refs:T,floatingStyles:$,context:_}=mn({open:x!==null||S!==null,onOpenChange:E=>{E||(b(null),m(null),l.revertPreview())},strategy:"fixed",placement:"bottom-start",middleware:[cn(4),fn(),dn({padding:8}),Ma({apply({availableHeight:E,elements:D}){Object.assign(D.floating.style,{maxHeight:`${E}px`})},padding:8})],whileElementsMounted:un}),W=sr(_),{getFloatingProps:O}=ir([W]);w.useEffect(()=>{const E=(x==null?void 0:x.anchorEl)??(S==null?void 0:S.anchorEl);E&&T.setReference(E)},[x==null?void 0:x.anchorEl,S==null?void 0:S.anchorEl]);const[P,A]=w.useState(new Set),[X,H]=w.useState(!1),ne=w.useRef(r.map(E=>E.fullClass).join(" ")),R=r.map(E=>E.fullClass).join(" ");w.useEffect(()=>{ne.current!==R&&(ne.current=R,l.revertPreview(),c(new Map),p(new Map),g(null),b(null),A(new Set))});const L=e,N=l.patches.filter(E=>E.status==="staged"&&E.elementKey===L),z=new Set(N.filter(E=>E.originalClass==="").map(E=>E.property));function V(E,D){const K=N.find(ve=>ve.property===E),Z=(D==null?void 0:D.fullClass)??(K==null?void 0:K.originalClass)??"",ee=(K==null?void 0:K.newClass)??(D==null?void 0:D.fullClass)??"";return{originalClass:Z,effectiveClass:ee,hasValue:ee!==""}}function me(E){return a.size===0?E:E.map(D=>{const K=a.get(`${D.layer}-shorthand`),Z=D.slots.map(ve=>{const Ee=a.get(`${D.layer}-${ve.key}`);return Ee!==void 0?{...ve,value:Ee}:ve}),ee=K??D.shorthandValue;let fe=D.classState;return K!==void 0&&(fe=Z.some(Ee=>Ee.value!=null)?"mixed":"shorthand"),{...D,shorthandValue:ee,classState:fe,slots:Z}})}function be(E){if(d.size===0)return E;const D=d.get("all");return{...E,shorthandValue:D===void 0?E.shorthandValue:D,slots:E.slots.map(K=>{const Z=d.get(K.key);return Z===void 0?K:{...K,value:Z}})}}const ae=d1(r);function se(E,D){l.preview(E,D)}function _e(){l.revertPreview()}function ye(E,D,K){l.stage(L,E,D,K)}function eo(E,D){const K=E||D,Z=K.startsWith("bg-gradient-to-")?"bg-gradient-to-":K.startsWith("from-")?"from-":K.startsWith("via-")?"via-":K.startsWith("to-")?"to-":"bg-";ye(Z,E,D)}function to(E,D){l.revertPreview(),he("overlay",{type:"CLEAR_HIGHLIGHTS"}),E.color!==void 0&&D?(b(K=>(K==null?void 0:K.cls.fullClass)===E.fullClass?null:{cls:E,anchorEl:D}),i(null)):(b(null),i(E))}function pr(E,D){l.preview(E.fullClass,D)}function no(E){l.revertPreview()}function ro(E){const D=ar[E];if(!((D==null?void 0:D.controlGroup)==="flex-container"&&(D==null?void 0:D.propertyKey)==="display")){if((D==null?void 0:D.controlGroup)==="flex-container"){const K=r.some(ee=>ee.fullClass==="flex"||ee.fullClass==="inline-flex"),Z=N.some(ee=>ee.property==="display"&&ee.originalClass===""&&(ee.newClass==="flex"||ee.newClass==="inline-flex"));!K&&!Z&&l.stage(L,"display","","flex")}}A(K=>new Set(K).add(E))}function Ft(E,D){l.preview("",D)}function Kn(E){l.revertPreview()}function q(E,D){const K=Wl(E);l.stage(L,(K==null?void 0:K.stagingKey)??E,"",D),A(Z=>{const ee=new Set(Z);return ee.delete(E),ee})}return u.jsxs("div",{className:"divide-y divide-bv-border",children:[u.jsxs("div",{className:"px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-1.5 cursor-pointer select-none",onClick:()=>H(E=>!E),children:[u.jsx("svg",{className:`w-3 h-3 text-bv-muted transition-transform ${X?"":"rotate-90"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})}),u.jsx("span",{className:"text-[10px] font-semibold text-bv-text",children:"Box model"})]}),u.jsx("div",{className:`overflow-hidden transition-[max-height,opacity] duration-200 ease-in-out ${X?"max-h-0 opacity-0":"max-h-[600px] opacity-100"}`,children:u.jsxs("div",{className:"mt-3",children:[u.jsx(h0,{layers:me(gr(r,o)),onEditStart:()=>{he("overlay",{type:"CLEAR_HIGHLIGHTS"}),g(null)},onSlotClick:(E,D,K)=>{var Ee;if(D!=="color"||!K){g(null);return}const Z=gr(r,o).find(tt=>tt.layer===E),ee=`${E}-color`,fe=a.get(ee)??((Ee=Z==null?void 0:Z.slots.find(tt=>tt.key==="color"))==null?void 0:Ee.value)??"",ve=E==="outline"?"outline-":"border-";g(tt=>(tt==null?void 0:tt.layer)===E?null:{layer:E,prefix:ve,currentClass:fe,staged:!1,anchorEl:K})},onSlotHover:(E,D,K)=>{var Z;if(K===null)l.revertPreview();else{const ee=`${E}-${D}`,fe=gr(r,o).find(Ee=>Ee.layer===E),ve=D==="shorthand"?a.get(ee)??(fe==null?void 0:fe.shorthandValue):a.get(ee)??((Z=fe==null?void 0:fe.slots.find(Ee=>Ee.key===D))==null?void 0:Z.value);l.preview(ve??"",K)}},onSlotChange:(E,D,K)=>{var ve;const Z=`${E}-${D}`,ee=gr(r,o).find(Ee=>Ee.layer===E),fe=D==="shorthand"?a.get(Z)??(ee==null?void 0:ee.shorthandValue):a.get(Z)??((ve=ee==null?void 0:ee.slots.find(Ee=>Ee.key===D))==null?void 0:ve.value);ye(`${E}-${D}`,fe??"",K),c(Ee=>new Map(Ee).set(Z,K))},onSlotRemoveHover:(E,D)=>{var fe;const K=`${E}-${D}`,Z=gr(r,o).find(ve=>ve.layer===E),ee=D==="shorthand"?a.get(K)??(Z==null?void 0:Z.shorthandValue):a.get(K)??((fe=Z==null?void 0:Z.slots.find(ve=>ve.key===D))==null?void 0:fe.value);ee&&l.preview(ee,"")},onSlotRemove:(E,D)=>{var fe;const K=`${E}-${D}`,Z=gr(r,o).find(ve=>ve.layer===E),ee=D==="shorthand"?a.get(K)??(Z==null?void 0:Z.shorthandValue):a.get(K)??((fe=Z==null?void 0:Z.slots.find(ve=>ve.key===D))==null?void 0:fe.value);ee&&(ye(`${E}-${D}`,ee,""),c(ve=>{const Ee=new Map(ve);return Ee.delete(K),Ee}))}}),f&&u.jsx(pn,{children:u.jsx("div",{ref:y.setFloating,style:{...v,zIndex:9999,overflowY:"auto"},...j(),children:u.jsx(Fl,{prefix:f.prefix,currentValue:f.currentClass.startsWith(f.prefix)?f.currentClass.slice(f.prefix.length):"",colors:(o==null?void 0:o.colors)||{},locked:!1,lockedValue:((re=N.find(E=>E.property===f.prefix))==null?void 0:re.newClass)??null,onHover:E=>{h.current=E,l.preview(f.currentClass,E)},onLeave:()=>{f.staged&&h.current?(l.preview(h.current,f.currentClass),h.current=null):l.revertPreview()},onClick:E=>{const D=`${f.layer}-color`;ye(f.prefix,f.currentClass,E),c(K=>new Map(K).set(D,E)),g(K=>K?{...K,currentClass:E,staged:!0}:null)}})})})]})})]}),(x||S)&&u.jsx(pn,{children:u.jsxs("div",{ref:T.setFloating,style:{...$,zIndex:9999,overflowY:"auto"},...O(),children:[x&&u.jsx(Fl,{prefix:Id(x.cls),currentValue:x.cls.color??"",colors:(o==null?void 0:o.colors)||{},locked:!1,lockedValue:((le=N.find(E=>E.property===x.cls.property))==null?void 0:le.newClass)??null,onHover:E=>se(x.cls.fullClass,E),onLeave:_e,onClick:E=>ye(x.cls.property,x.cls.fullClass,E),onRemoveHover:()=>se(x.cls.fullClass,""),onRemove:()=>{ye(x.cls.property,x.cls.fullClass,""),b(null)}}),S&&(()=>{const{layer:E}=S,D=E.type==="shadow"?"shadow-":E.type==="inset-shadow"?"inset-shadow-":E.type==="ring"?"ring-":E.type==="text-shadow"?"text-shadow-":"inset-ring-",K=E.colorClass??"",Z=K?K.slice(D.length).split("/")[0]:"";return u.jsx(Fl,{prefix:D,currentValue:Z,colors:(o==null?void 0:o.colors)||{},locked:!1,lockedValue:null,onHover:ee=>se(K,ee),onLeave:_e,onClick:ee=>{const fe=E.type==="shadow"?"shadow-color":E.type==="inset-shadow"?"inset-shadow-color":E.type==="ring"?"ring-color":E.type==="text-shadow"?"text-shadow-color":"inset-ring-color";l.stage(L,fe,K,ee),m(null)},onRemoveHover:()=>{K&&se(K,"")},onRemove:()=>{if(K){const ee=E.type==="shadow"?"shadow-color":E.type==="inset-shadow"?"inset-shadow-color":E.type==="ring"?"ring-color":E.type==="text-shadow"?"text-shadow-color":"inset-ring-color";l.stage(L,ee,K,"")}m(null)}})})()]})}),i1.map(E=>{if(E==="shadows"){const I=l1(n,N),Q=o1(I,o);return u.jsx(Cd,{label:"Shadows & Rings",onAddProperty:()=>{},isEmpty:!1,classCount:Q.length,children:u.jsx(n1,{layers:Q,onPreview:(U,G)=>l.preview(U,G),onRevert:()=>l.revertPreview(),onStage:(U,G)=>{const ce=U||G,oe=Be=>{if(Be.startsWith("shadow-")){const Fe=Be.slice(7).split("/")[0];return ps.has(Fe)}if(Be.startsWith("inset-shadow-")){const Fe=Be.slice(13).split("/")[0];return ms.has(Fe)}if(Be.startsWith("ring-")||Be.startsWith("inset-ring-")){const Fe=Be.slice(Be.startsWith("ring-")?5:11).split("/")[0];return Yr.has(Fe)}if(Be.startsWith("text-shadow-")){const Fe=Be.slice(12).split("/")[0];return hs.has(Fe)}return!1},$e=ce.startsWith("text-shadow")?"text-shadow":ce.startsWith("inset-shadow")?"inset-shadow":ce.startsWith("inset-ring")?"inset-ring":ce.startsWith("ring")?"ring":"shadow",Wt=oe(U)||U===""&&oe(G)?`${$e}-size`:`${$e}-color`;l.stage(L,Wt,U,G)},onAdd:U=>{const G=U.startsWith("text-shadow")?"text-shadow-size":U.startsWith("inset-shadow")?"inset-shadow-size":U.startsWith("inset-ring")?"inset-ring-size":U.startsWith("ring")?"ring-size":"shadow-size";l.stage(L,G,"",U)},onRemove:U=>{const G=oe=>{if(oe.startsWith("shadow-")){const $e=oe.slice(7).split("/")[0];return ps.has($e)}if(oe.startsWith("inset-shadow-")){const $e=oe.slice(13).split("/")[0];return ms.has($e)}if(oe.startsWith("ring-")||oe.startsWith("inset-ring-")){const $e=oe.slice(oe.startsWith("ring-")?5:11).split("/")[0];return Yr.has($e)}if(oe.startsWith("text-shadow-")){const $e=oe.slice(12).split("/")[0];return hs.has($e)}return!1},ce=[...U].reverse();for(const oe of ce){const $e=oe.startsWith("text-shadow")?"text-shadow":oe.startsWith("inset-shadow")?"inset-shadow":oe.startsWith("inset-ring")?"inset-ring":oe.startsWith("ring")?"ring":"shadow",Wt=G(oe)?`${$e}-size`:`${$e}-color`;l.stage(L,Wt,oe,"")}},onRemoveHover:U=>{U.length===1?l.preview(U[0],""):U.length>1&&l.preview(U.join(" "),"")},onColorClick:(U,G)=>{b(null),m(ce=>(ce==null?void 0:ce.layer.type)===U.type?null:{layer:U,anchorEl:G})}})},"shadows")}const K=(ae.get(E)||[]).filter(I=>!a1(I)),Z=Dm[E]||[],ee=t0.get("flex-container")??new Set,fe=n0.get("flex-container")??new Set,ve=r.some(I=>{if(I.fullClass==="flex"||I.fullClass==="inline-flex")return!0;const Q=Hn[I.fullClass];return!!(Q&&Q.propertyKey!=="display"&&ee.has(Q.propertyKey)||ee.has(I.property))}),Ee=[...fe].some(I=>P.has(I)||z.has(I.replace(/-$/,""))),tt=E==="flexbox"&&(ve||Ee),Mm=tt?Z.filter(I=>!fe.has(I.prefix)):Z,$m=c1(Mm,K,P,z),Bs=Z.filter(I=>P.has(I.prefix)).map(I=>I.prefix),Us=Z.filter(I=>z.has(I.prefix.replace(/-$/g,""))).map(I=>I.prefix),zm=E==="color"||E==="flexbox"&&tt||E==="borders"?!1:K.length===0&&Bs.length===0&&Us.length===0,Km=E==="borders"?Vn(r).slots.filter(I=>I.value!=null).length+(Vn(r).shorthandValue?1:0):K.length+Bs.length+Us.length;return u.jsxs(Cd,{label:s1[E]??E,availableProperties:$m,onAddProperty:ro,isEmpty:zm,classCount:Km,children:[E==="borders"&&u.jsx(C0,{state:be(Vn(r)),onSlotHover:(I,Q)=>{var oe;const U=Vn(r),ce=(I==="all"?d.get("all")??U.shorthandValue:d.get(I)??((oe=U.slots.find($e=>$e.key===I))==null?void 0:oe.value)??null)??"";Q===null?l.revertPreview():l.preview(ce,Q)},onSlotChange:(I,Q)=>{var ce;const U=Vn(r),G=d.get(I)??(I==="all"?U.shorthandValue:(ce=U.slots.find(oe=>oe.key===I))==null?void 0:ce.value)??"";ye(`rounded-${I}`,G,Q),p(oe=>new Map(oe).set(I,Q))},onSlotRemove:I=>{var U;const Q=d.get(I)??((U=Vn(r).slots.find(G=>G.key===I))==null?void 0:U.value)??"";Q&&(ye(`rounded-${I}`,Q,""),p(G=>new Map(G).set(I,null)))},onSlotRemoveHover:I=>{var U;const Q=d.get(I)??((U=Vn(r).slots.find(G=>G.key===I))==null?void 0:U.value)??"";Q&&l.preview(Q,"")},onEditStart:()=>he("overlay",{type:"CLEAR_HIGHLIGHTS"})}),E==="color"&&u.jsx(I0,{...L0(r,(o==null?void 0:o.colors)||{},N.filter(I=>I.elementKey===L)),onPreview:se,onPreviewBatch:I=>l.previewBatch(I),onRevert:_e,onStage:eo}),E==="flexbox"&&tt&&(()=>{const I=r,Q=I.find(te=>{const pe=Hn[te.fullClass];return(pe==null?void 0:pe.propertyKey)==="flex-direction"}),U=I.find(te=>{const pe=Hn[te.fullClass];return(pe==null?void 0:pe.propertyKey)==="justify-content"}),G=I.find(te=>{const pe=Hn[te.fullClass];return(pe==null?void 0:pe.propertyKey)==="align-items"}),ce=I.find(te=>{const pe=Hn[te.fullClass];return(pe==null?void 0:pe.propertyKey)==="flex-wrap"}),oe={"flex-row":"row","flex-col":"column","flex-row-reverse":"row-reverse","flex-col-reverse":"column-reverse"},$e=(Q==null?void 0:Q.fullClass)??null,ol=$e?oe[$e]??"row":"row",Wt=V("flex-direction",Q),Be=V("flex-wrap",ce),Fe=V("justify-content",U),Vt=V("align-items",G),Fm=r.find(te=>te.property==="gap"),Wm=r.find(te=>te.property==="gap-x"),Vm=r.find(te=>te.property==="gap-y"),oo=V("gap",Fm),lo=V("gap-x",Wm),so=V("gap-y",Vm),Hm=[{key:"gap",value:oo.effectiveClass||null,scaleValues:hr("gap-","spacing",o)},{key:"gap-x",value:lo.effectiveClass||null,scaleValues:hr("gap-x-","spacing",o)},{key:"gap-y",value:so.effectiveClass||null,scaleValues:hr("gap-y-","spacing",o)}];return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex justify-between items-start w-full",children:[u.jsx(D0,{currentValue:(Q==null?void 0:Q.fullClass)??null,lockedValue:Wt.effectiveClass!==Wt.originalClass?Wt.effectiveClass:null,locked:!1,onHover:te=>se(Wt.effectiveClass,te),onLeave:_e,onClick:te=>ye("flex-direction",Wt.originalClass,te)}),u.jsx(K0,{currentValue:(ce==null?void 0:ce.fullClass)??null,lockedValue:Be.effectiveClass!==Be.originalClass?Be.effectiveClass:null,locked:!1,onHover:te=>se(Be.effectiveClass,te),onLeave:_e,onClick:te=>ye("flex-wrap",Be.originalClass,te)}),u.jsx(V0,{currentValue:(U==null?void 0:U.fullClass)??null,lockedValue:Fe.effectiveClass!==Fe.originalClass?Fe.effectiveClass:null,locked:!1,flexDirection:ol,onHover:te=>se(Fe.effectiveClass,te),onLeave:_e,onClick:te=>ye("justify-content",Fe.originalClass,te),onRemove:Fe.hasValue?()=>ye("justify-content",Fe.originalClass,""):void 0,onRemoveHover:Fe.hasValue?()=>se(Fe.effectiveClass,""):void 0}),u.jsx(H0,{currentValue:(G==null?void 0:G.fullClass)??null,lockedValue:Vt.effectiveClass!==Vt.originalClass?Vt.effectiveClass:null,locked:!1,flexDirection:ol,onHover:te=>se(Vt.effectiveClass,te),onLeave:_e,onClick:te=>ye("align-items",Vt.originalClass,te),onRemove:Vt.hasValue?()=>ye("align-items",Vt.originalClass,""):void 0,onRemoveHover:Vt.hasValue?()=>se(Vt.effectiveClass,""):void 0})]}),u.jsx("div",{className:"h-px w-full bg-bv-border opacity-50 my-2"}),u.jsx(B0,{slots:Hm,onSlotHover:(te,pe)=>{const Ku=te==="gap"?oo:te==="gap-x"?lo:so;pe===null?l.revertPreview():l.preview(Ku.effectiveClass,pe)},onSlotRemoveHover:te=>{const pe=te==="gap"?oo:te==="gap-x"?lo:so;pe.hasValue&&l.preview(pe.effectiveClass,"")},onSlotChange:(te,pe)=>{ye(te,(te==="gap"?oo:te==="gap-x"?lo:so).originalClass,pe)},onSlotRemove:te=>{const pe=te==="gap"?oo:te==="gap-x"?lo:so;pe.hasValue&&(l.preview(pe.effectiveClass,""),ye(te,pe.originalClass,""))}})]})})(),K.map(I=>{var Q,U;if(tt){const G=Hn[I.fullClass];if(G&&ee.has(G.propertyKey)||ee.has(I.property))return null}if(I.scaleName!==void 0){const G=hr(Id(I),I.scaleName,o);if(G.length>0){const ce=((Q=N.find(oe=>oe.property===I.property))==null?void 0:Q.newClass)??null;return u.jsx(xn,{values:G,currentValue:I.fullClass,lockedValue:ce,locked:!1,onStart:()=>he("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:oe=>pr(I,oe),onLeave:()=>no(),onClick:oe=>ye(I.property,I.fullClass,oe),onRemoveHover:()=>l.preview(I.fullClass,""),onRemove:()=>ye(I.property,I.fullClass,"")},I.fullClass)}}if(I.scaleName===void 0&&I.color===void 0){const G=Hn[I.fullClass];if(G){const ce=((U=N.find(oe=>oe.property===G.propertyKey))==null?void 0:U.newClass)??null;return u.jsx(xn,{values:G.alternatives,currentValue:I.fullClass,lockedValue:ce,locked:!1,onStart:()=>he("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:oe=>pr(I,oe),onLeave:()=>no(),onClick:oe=>ye(G.propertyKey,I.fullClass,oe),onRemoveHover:()=>l.preview(I.fullClass,""),onRemove:()=>ye(G.propertyKey,I.fullClass,"")},I.fullClass)}}return u.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||(x==null?void 0:x.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:G=>to(I,G.currentTarget),children:[I.fullClass,u.jsx("span",{className:"opacity-0 group-hover:opacity-60 hover:!opacity-100 ml-0.5 shrink-0",title:"Remove class",onClick:G=>{G.stopPropagation(),ye(I.property,I.fullClass,"")},onMouseEnter:G=>{G.stopPropagation(),l.preview(I.fullClass,"")},onMouseLeave:G=>{G.stopPropagation(),l.revertPreview()},children:u.jsxs("svg",{viewBox:"0 0 10 10",width:"8",height:"8",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"}),u.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"})]})})]},I.fullClass)}),Us.filter(I=>!(tt&&fe.has(I))).map(I=>{const Q=Wl(I);if(!Q)return null;if(Q.valueType==="scalar"){const U=hr(I,Q.scaleName,o);if(U.length===0)return null;const G=N.find(ce=>ce.property===Q.stagingKey);return u.jsx(xn,{values:U,currentValue:(G==null?void 0:G.newClass)??U[Math.floor(U.length/2)],lockedValue:(G==null?void 0:G.newClass)??null,locked:!1,onStart:()=>he("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:ce=>Ft(I,ce),onLeave:()=>Kn(),onClick:ce=>q(I,ce)},`staged-${I}`)}if(Q.valueType==="enum"&&Q.enumAlts){const U=N.find(G=>G.property===Q.stagingKey);return u.jsx(xn,{values:Q.enumAlts,currentValue:(U==null?void 0:U.newClass)??Q.enumAlts[0],lockedValue:(U==null?void 0:U.newClass)??null,locked:!1,onStart:()=>he("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:G=>Ft(I,G),onLeave:()=>Kn(),onClick:G=>q(I,G)},`staged-${I}`)}return null}),Bs.filter(I=>!(tt&&fe.has(I))).map(I=>{const Q=Wl(I);if(!Q)return null;if(Q.valueType==="scalar"){const U=hr(I,Q.scaleName,o);if(U.length>0)return u.jsx(xn,{values:U,currentValue:U[Math.floor(U.length/2)],lockedValue:null,locked:!1,ghost:!0,onStart:()=>he("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:G=>Ft(I,G),onLeave:()=>Kn(),onClick:G=>q(I,G)},`pending-${I}`)}return Q.valueType==="enum"&&Q.enumAlts?u.jsx(xn,{values:Q.enumAlts,currentValue:Q.enumAlts[0],lockedValue:null,locked:!1,ghost:!0,onStart:()=>he("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:U=>Ft(I,U),onLeave:()=>Kn(),onClick:U=>q(I,U)},`pending-${I}`):Q.valueType==="color"?u.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:U=>{b({cls:{property:"text",fullClass:"",section:"typography",color:""},anchorEl:U.currentTarget}),i(null)},children:[I==="text-color"?"text-":I,"color"]},`pending-${I}`):null})]},E)})]})}const p1=w.lazy(()=>Sy(()=>import("./DesignMode-D6tjMRjM.js"),[]).then(e=>({default:e.DesignMode}))),m1=new URLSearchParams(window.location.search),h1=m1.get("mode"),Ld=[{id:"design",label:"Design"},{id:"draw",label:"Draw"},{id:"message",label:"Message"}];function g1(){return h1==="design"?u.jsx(w.Suspense,{fallback:null,children:u.jsx(p1,{})}):u.jsx(y1,{})}function y1(){const[e,t]=w.useState(!1),[n,r]=w.useState(null),[o,l]=w.useState(0),[s,i]=w.useState("design"),[a,c]=w.useState(!1),d=xv();w.useEffect(()=>{const P=Zy(()=>{t(!0);try{const H=localStorage.getItem("tw-panel-container");H&&H!=="popover"&&he("overlay",{type:"SWITCH_CONTAINER",container:H})}catch{}}),A=Jy(()=>t(!1)),X=em(H=>{H.type==="RESET_SELECTION"?(r(null),l(ne=>ne+1)):H.type==="ELEMENT_SELECTED"?(r({componentName:H.componentName,instanceCount:H.instanceCount,classes:H.classes,parsedClasses:Oy(H.classes,Qy),tailwindConfig:H.tailwindConfig}),l(ne=>ne+1),c(!1)):H.type==="SELECT_MODE_CHANGED"?c(!!H.active):H.type==="QUEUE_UPDATE"?d.handleQueueUpdate({draftCount:H.draftCount,committedCount:H.committedCount,implementingCount:H.implementingCount,implementedCount:H.implementedCount,partialCount:H.partialCount,errorCount:H.errorCount,draft:H.draft,commits:H.commits,agentWaiting:H.agentWaiting}):H.type==="PATCH_UPDATE"&&d.handlePatchUpdate({staged:H.staged,committed:H.committed,implementing:H.implementing,implemented:H.implemented,patches:H.patches})});return qp(),t(qy()),()=>{P(),A(),X()}},[]);const{draft:p,committed:f,implementing:g,implemented:x,partial:b,error:S}=d.counts,m=f>0&&!d.agentWaiting&&g===0,h=new Map(d.patches.filter(P=>P.status==="staged").map(P=>[P.id,{id:P.id,kind:P.kind??"class-change",elementKey:P.elementKey,status:P.status,originalClass:P.originalClass,newClass:P.newClass,property:P.property,timestamp:P.timestamp,component:P.component,message:P.message,image:P.image}])),y=new Set(d.queueState.draft.map(P=>P.id)),v=[...d.queueState.draft.map(P=>h.get(P.id)??P),...d.patches.filter(P=>P.status==="staged"&&!y.has(P.id)).map(P=>h.get(P.id))],C=d.queueState.commits.filter(P=>P.status==="committed"),k=d.queueState.commits.filter(P=>P.status==="implementing"),j=d.queueState.commits.filter(P=>P.status==="implemented"),T="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"){_(P);return}}catch{}navigator.clipboard.writeText(P).catch(()=>_(P))}else _(P)}function _(P){const A=document.createElement("textarea");A.value=P,A.style.position="fixed",A.style.opacity="0",document.body.appendChild(A),A.select(),document.execCommand("copy"),document.body.removeChild(A)}const W=u.jsxs("div",{className:"shrink-0",children:[!e&&u.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:[u.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-bv-orange animate-pulse shrink-0"}),u.jsxs("span",{className:"flex-1 leading-tight",children:["No agent listening —"," ",u.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!"]}),u.jsx("button",{onClick:()=>$(T),className:"shrink-0 px-1.5 py-0.5 rounded border border-amber-700/50 bg-amber-900/40 hover:bg-amber-800/40 text-amber-300 font-semibold text-[9px] transition-colors",title:`Copy: "${T}"`,children:"Copy prompt"})]}),m&&u.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:[u.jsx("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"currentColor",className:"shrink-0 text-amber-400",children:u.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"})}),u.jsxs("span",{className:"flex-1 leading-tight",children:["No agent watching —"," ",u.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"]}),u.jsx("button",{onClick:()=>$(T),className:"shrink-0 px-1.5 py-0.5 rounded border border-amber-700/50 bg-amber-900/40 hover:bg-amber-800/40 text-amber-300 font-semibold text-[9px] transition-colors",title:`Copy: "${T}"`,children:"Copy prompt"})]}),u.jsxs("div",{className:"flex items-center justify-center px-3 py-1.5 border-t border-bv-border gap-3 text-[10px]",children:[u.jsx(Sl,{label:"draft",count:p,items:v,activeColor:"text-amber-400",onDiscard:P=>d.discard(P),onCommitAll:()=>d.commitAll(),onDiscardAll:()=>d.discardAll()}),u.jsx(Sl,{label:"committed",count:f,items:C.flatMap(P=>P.patches),activeColor:"text-bv-orange"}),u.jsx(Sl,{label:"implementing",count:g,items:k.flatMap(P=>P.patches),activeColor:"text-blue-400"}),u.jsx(Sl,{label:"implemented",count:x,items:j.flatMap(P=>P.patches),activeColor:"text-bv-teal"})]})]});if(!n)return u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx("div",{className:"px-3 pt-3 pb-2 border-b border-bv-border",children:u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx(Ad,{active:a,onToggle:()=>{const P=!a;c(P),he("overlay",{type:"TOGGLE_SELECT_MODE",active:P})}}),u.jsx("div",{className:"flex-1 min-w-0",children:a?u.jsx("span",{className:"text-[11px] text-bv-teal font-medium",children:"● Selecting… click an element on the page"}):u.jsx("span",{className:"text-[12px] text-bv-muted",children:"No element selected"})}),u.jsx(Jc,{})]})}),u.jsx(nd,{tabs:Ld,activeTab:s,onTabChange:i}),u.jsx("div",{className:"flex-1 overflow-auto",children:s==="draw"?u.jsx(ed,{}):s==="message"?u.jsx(td,{draft:v,currentElementKey:"",onAddMessage:(P,A)=>d.stageMessage(P,A),onDiscard:P=>d.discard(P)}):a?u.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 p-8",children:[u.jsx("div",{className:"w-10 h-10 rounded-full bg-bv-teal text-white flex items-center justify-center",children:u.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"currentColor",children:[u.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"}),u.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"})]})}),u.jsx("span",{className:"text-[12px] text-bv-teal font-medium",children:"Selection mode active"}),u.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.",u.jsx("br",{}),"Press"," ",u.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."]})]}):u.jsx("div",{className:"flex flex-1 flex-col justify-center p-4",children:u.jsxs("button",{onClick:()=>{c(!0),he("overlay",{type:"TOGGLE_SELECT_MODE",active:!0})},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:[u.jsx("div",{className:"w-14 h-14 rounded-full bg-bv-teal/10 text-bv-teal flex items-center justify-center",children:u.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 64 64",fill:"currentColor",children:[u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"})]})}),u.jsx("span",{className:"text-[12px] text-bv-text font-medium",children:"Select an element to inspect"}),u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.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:"⌘"}),u.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:"⇧"}),u.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"})]})]})})}),W]});const O=n.parsedClasses;return u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx("div",{className:"px-3 pt-3 pb-2 border-b border-bv-border",children:u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u.jsx(Ad,{active:a,onToggle:()=>{const P=!a;c(P),he("overlay",{type:"TOGGLE_SELECT_MODE",active:P})}}),u.jsxs("div",{className:"font-[family-name:var(--font-display)] font-bold text-[13px] text-bv-text leading-tight truncate",children:[n.componentName," ",u.jsxs("span",{className:"font-[family-name:var(--font-ui)] font-normal text-bv-text-mid",children:["— ",n.instanceCount," instance",n.instanceCount!==1?"s":""]})]})]}),u.jsx(Jc,{})]})}),u.jsx(nd,{tabs:Ld,activeTab:s,onTabChange:i}),u.jsxs("div",{className:"flex-1 overflow-auto",children:[s==="design"&&u.jsx(f1,{componentName:n.componentName,instanceCount:n.instanceCount,rawClasses:n.classes,parsedClasses:O,tailwindConfig:n.tailwindConfig,patchManager:d},o),s==="draw"&&u.jsx(ed,{}),s==="message"&&u.jsx(td,{draft:v,currentElementKey:n.componentName,onAddMessage:(P,A)=>d.stageMessage(P,A,n.componentName),onDiscard:P=>d.discard(P)})]}),W]})}function Ad({active:e,onToggle:t}){return u.jsx("button",{onClick:t,title:`${e?"Stop selecting":"Select an element"} (⌘⇧C)`,className:`w-7 h-7 rounded flex items-center justify-center shrink-0 border transition-all
|
|
62
|
-
${e?"bg-bv-teal border-bv-teal text-white":"bg-transparent border-bv-border text-bv-text-mid hover:border-bv-teal hover:text-bv-teal hover:bg-bv-teal/10"}`,children:
|
|
61
|
+
${n?"z-25":""}`,style:{left:`${d}%`,transform:"translateX(-50%)",width:22,height:26,filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.2))"},onMouseDown:i,onClick:u,title:`${e.role}-${e.colorName}${e.position!=null?` ${e.position}%`:""}`,children:[a.jsx("svg",{viewBox:"0 0 22 26",width:22,height:26,xmlns:"http://www.w3.org/2000/svg",children:a.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&&a.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:p=>p.stopPropagation(),children:"×"})]})}function P0({stops:e,direction:t,onStopDrag:n,onStopDragEnd:r,onStopClick:o,onBarClick:l,onStopRemove:s,selectedStopId:i}){const u=w.useRef(null),c=w.useRef(null),d=[...e].sort((x,b)=>(x.position??0)-(b.position??0)),p=w.useCallback((x,b)=>{const S=e.find(y=>y.id===x);if(!S)return;c.current={stopId:x,startX:b,startPos:S.position??0};const m=y=>{const v=c.current;if(!v||!u.current)return;const C=u.current.getBoundingClientRect(),j=(y.clientX-v.startX)/C.width*100,T=Ri(v.startPos+j);n(v.stopId,T)},h=y=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",h);const v=c.current;if(v&&u.current){const C=u.current.getBoundingClientRect(),j=(y.clientX-v.startX)/C.width*100,T=Ri(v.startPos+j);r(v.stopId,T)}c.current=null};document.addEventListener("mousemove",m),document.addEventListener("mouseup",h)},[e,n,r]),f=w.useCallback(x=>{if(!u.current)return;const b=u.current.getBoundingClientRect(),S=(x.clientX-b.left)/b.width*100;l(Ri(S))},[l]),g=N0(d,t);return a.jsxs("div",{className:"relative flex-1 min-w-0",style:{paddingTop:28},children:[d.map((x,b)=>a.jsx(R0,{stop:x,isEndpoint:b===0||b===d.length-1,isSelected:x.id===i,onDragStart:p,onClick:o,onRemove:s},x.id)),a.jsx("div",{ref:u,className:"h-9 rounded-md cursor-pointer relative",style:{background:g,border:"1px solid rgba(0,0,0,0.08)",boxShadow:"inset 0 1px 2px rgba(0,0,0,0.06)"},onClick:f,children:a.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 _0={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 I0(e){var Ft,Kn;const{direction:t,stops:n,mode:r,solidColorName:o,solidColorHex:l,onPreview:s,onPreviewBatch:i,onRevert:u,onStage:c}=e,[d,p]=w.useState(t),[f,g]=w.useState(n),[x,b]=w.useState(r),[S,m]=w.useState(o),[h,y]=w.useState(l),[v,C]=w.useState(null),[k,j]=w.useState(!1),[T,$]=w.useState(null),[_,W]=w.useState(null),O=w.useRef(n.length+1),P=w.useCallback(q=>{if(x==="gradient")s(`bg-gradient-to-${d}`,`bg-gradient-to-${q}`);else{const re=S??"slate-500",le=S?`bg-${S}`:"";i([{oldClass:le,newClass:`bg-gradient-to-${q}`},{oldClass:"",newClass:`from-${re}`},{oldClass:"",newClass:`to-${re}`}])}},[d,x,S,s,i]),A=w.useCallback(()=>{u()},[u]),X=w.useCallback(q=>{if(p(q),b("gradient"),x==="gradient"&&f.length>=2){const re=`bg-gradient-to-${d}`,le=`bg-gradient-to-${q}`;c(re,le)}else{const re=S??"slate-500",le=h??Xn(re,e.colors),E={id:"1",role:"from",colorName:re,hex:le,position:0},D={id:"2",role:"to",colorName:re,hex:le,position:100};O.current=3,g([E,D]);const K=S?`bg-${S}`:"";c(K,`bg-gradient-to-${q}`),c("",`from-${re}`),c("",`to-${re}`)}},[d,x,f,S,h,e.colors,c]),H=w.useCallback(()=>{b("solid"),j(!1),C(null),$(null),f.length>0&&!S&&(m(f[0].colorName),y(f[0].hex))},[f,S]),ne=w.useCallback((q,re)=>{g(E=>E.map(D=>D.id===q?{...D,position:re}:D));const le=f.find(E=>E.id===q);if(le){const E=le.position!=null?`${le.role}-${le.position}%`:"",D=`${le.role}-${re}%`;s(E,D)}},[f,s]),R=w.useCallback((q,re)=>{g(E=>E.map(D=>D.id===q?{...D,position:re}:D));const le=f.find(E=>E.id===q);if(le){const E=le.position!=null?`${le.role}-${le.position}%`:"",D=`${le.role}-${re}%`;c(E,D)}},[f,c]),L=w.useCallback((q,re)=>{v===q&&k?(C(null),j(!1),$(null),W(null)):(C(q),j(!0),$("stop"),W(re))},[v,k]),N=w.useCallback(q=>{const re=String(O.current++),le=[...f].sort((K,Z)=>(K.position??0)-(Z.position??0));let E=le[0];for(const K of le)(K.position??0)<=q&&(E=K);const D={id:re,role:"via",colorName:(E==null?void 0:E.colorName)??"gray-500",hex:(E==null?void 0:E.hex)??"#6B7280",position:q};g(K=>[...K,D]),C(re),j(!0),$("stop")},[f]),z=w.useCallback(q=>{const re=f.find(E=>E.id===q);if(!re)return;const le=f.filter(E=>E.id!==q);if(C(null),j(!1),$(null),W(null),le.length>=2)g(le),c(`${re.role}-${re.colorName}`,"");else if(le.length===1){const E=le[0];g([]),b("solid"),m(E.colorName),y(E.hex),c(`bg-gradient-to-${d}`,""),f.forEach(D=>c(`${D.role}-${D.colorName}`,"")),c("",`bg-${E.colorName}`)}else g([]),b("none"),m(null),y(null),c(`bg-gradient-to-${d}`,""),f.forEach(E=>c(`${E.role}-${E.colorName}`,""))},[f,d,c]),V=w.useCallback(q=>{j(!0),$("solid"),C(null),W(q)},[]),me=w.useCallback(()=>{s(S?`bg-${S}`:"","")},[S,s]),be=w.useCallback(()=>{S&&c(`bg-${S}`,""),m(null),y(null),j(!1),$(null),W(null)},[S,c]),ae=w.useCallback(q=>{if(T==="stop"&&v){const re=f.find(le=>le.id===v);re&&s(`${re.role}-${re.colorName}`,q)}else T==="solid"&&s(`bg-${S}`,q)},[T,v,f,S,s]),se=w.useCallback(()=>{u()},[u]),_e=w.useCallback(q=>{if(T==="stop"&&v){const re=f.find(le=>le.id===v);if(re){const le=re.role+"-",E=q.startsWith(le)?q.slice(le.length):q;g(D=>D.map(K=>K.id===v?{...K,colorName:E,hex:Xn(E,e.colors)}:K)),c(`${re.role}-${re.colorName}`,`${re.role}-${E}`),j(!1),C(null),$(null),W(null)}}else if(T==="solid"){const re="bg-",le=q.startsWith(re)?q.slice(re.length):q,E=S?`bg-${S}`:"";m(le),y(Xn(le,e.colors)),c(E,`bg-${le}`),j(!1),$(null),W(null)}},[T,v,f,S,c,e.colors]),ye=w.useCallback(()=>{j(!1),C(null),$(null),W(null),u()},[u]),eo=T==="stop"&&v?(((Ft=f.find(q=>q.id===v))==null?void 0:Ft.role)??"from")+"-":"bg-",to=T==="stop"&&v?((Kn=f.find(q=>q.id===v))==null?void 0:Kn.colorName)??"":S??"",pr=_0[d],ro=!!(v?f.find(q=>q.id===v):null);return{direction:d,stops:f,mode:x,solidColorName:S,solidColorHex:h,selectedStopId:v,colorPickerOpen:k,editingTarget:T,anchorEl:_,colorPrefix:eo,colorPickerCurrentValue:to,directionCSS:pr,selectedStopIsRemovable:ro,handleDirectionHover:P,handleDirectionLeave:A,handleDirectionClick:X,handleSolidToggle:H,handleStopDrag:ne,handleStopDragEnd:R,handleStopClick:L,handleBarClick:N,handleStopRemove:z,handleSwatchClick:V,handleHoverRemoveSolid:me,handleRemoveSolid:be,handleColorHover:ae,handleColorLeave:se,handleColorClick:_e,handleCloseColorPicker:ye}}function Xn(e,t){if(typeof t[e]=="string")return t[e];const n=e.lastIndexOf("-");if(n>0){const r=e.slice(0,n),o=e.slice(n+1);if(t[r]&&typeof t[r][o]=="string")return t[r][o]}return"#888888"}function L0(e){const t=I0(e),n=t.mode==="solid",{refs:r,floatingStyles:o,context:l}=mn({open:t.colorPickerOpen,onOpenChange:u=>{u||t.handleCloseColorPicker()},strategy:"fixed",placement:"bottom-start",middleware:[cn(4),fn(),dn({padding:8}),Ma({apply({availableHeight:u,elements:c}){Object.assign(c.floating.style,{maxHeight:`${u}px`})},padding:8})],whileElementsMounted:un}),s=sr(l),{getFloatingProps:i}=ir([s]);return w.useEffect(()=>{t.anchorEl&&r.setReference(t.anchorEl)},[t.anchorEl]),a.jsxs("div",{className:"group",children:[a.jsxs("div",{className:"flex items-start gap-2.5 mb-2",children:[a.jsx(T0,{direction:t.direction,mode:t.mode,onHover:t.handleDirectionHover,onLeave:t.handleDirectionLeave,onDirectionClick:t.handleDirectionClick,onSolidClick:t.handleSolidToggle,solidColorName:t.solidColorName}),n?a.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&&a.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:[a.jsx("line",{x1:"4",y1:"4",x2:"96",y2:"96",stroke:"#F5532D",strokeWidth:"3",strokeLinecap:"round"}),a.jsx("line",{x1:"96",y1:"4",x2:"4",y2:"96",stroke:"#F5532D",strokeWidth:"3",strokeLinecap:"round"})]})}):a.jsx(P0,{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&&a.jsx(pn,{children:a.jsxs("div",{ref:r.setFloating,style:{...o,zIndex:9999,overflowY:"auto"},...i(),children:[a.jsx(Fl,{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&&a.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"})]})}),a.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 A0(e,t,n){var y;const r=new Map;for(const v of e)r.set(v.fullClass,!0);if(n)for(const v of n)v.kind==="class-change"&&v.status==="staged"&&(v.originalClass&&r.delete(v.originalClass),v.newClass&&r.set(v.newClass,!0));const o=e.find(v=>v.property==="bg-gradient-to"),l=Array.from(r.keys()).find(v=>v.startsWith("bg-gradient-to-")),i=(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(v=>v.startsWith("bg-")&&!v.startsWith("bg-gradient-to-"))[0])==null?void 0:y.replace("bg-",""))??null,d=(c==null?void 0:c.split("/")[0])??null,p=d?Xn(d,t):null,f=Array.from(r.keys()),g=f.filter(v=>v.startsWith("from-")),x=f.filter(v=>v.startsWith("via-")),b=f.filter(v=>v.startsWith("to-")),S=!!(l||g.length>0&&b.length>0),m=S?"gradient":"solid",h=[];if(S){let v=1;for(const C of g){const k=C.replace("from-",""),j=k.split("/")[0];h.push({id:String(v++),role:"from",colorName:k,hex:Xn(j,t),position:null})}for(const C of x){const k=C.replace("via-",""),j=k.split("/")[0];h.push({id:String(v++),role:"via",colorName:k,hex:Xn(j,t),position:null})}for(const C of b){const k=C.replace("to-",""),j=k.split("/")[0];h.push({id:String(v++),role:"to",colorName:k,hex:Xn(j,t),position:null})}}return{direction:i,stops:h,mode:m,solidColorName:c,solidColorHex:p,colors:t}}const Me="#00848B",ur="rgba(0,132,139,0.18)",O0="#F5532D",wt="#4a4a4a",Dn="#333333",Ae="#999999",Je="'Roboto Mono', 'Menlo', ui-monospace, monospace",$t={width:60,height:60,borderRadius:5,borderWidth:"1.5px",borderStyle:"solid",borderColor:wt,background:Dn,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"},$a={background:Me,opacity:.65,borderRadius:2,flexShrink:0,transition:"opacity 150ms ease-in-out"},Ed={...$a,opacity:.9},Lm={flexShrink:0,background:O0,opacity:.18,borderRadius:1,transition:"opacity 150ms ease-in-out"},D0={...Lm,opacity:.38};function Yt({label:e,isActive:t,containerStyle:n,onClick:r,onHover:o,children:l}){const[s,i]=w.useState(!1),u=t||s,c={...$t,borderColor:u?Me:wt,background:u?ur:Dn,boxShadow:t?"0 0 0 2px rgba(0,132,139,0.35)":"none",...n};return a.jsxs("div",{className:"cursor-pointer",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3},onMouseEnter:()=>{i(!0),o==null||o()},onMouseLeave:()=>i(!1),onClick:r,children:[a.jsx("div",{style:c,children:l(u)}),a.jsx("span",{style:{fontSize:9,fontFamily:Je,color:u?Me:Ae,fontWeight:u?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:e})]})}const Pi=[{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 Am({direction:e,color:t}){const n={stroke:t,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"};switch(e){case"flex-row":return a.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",children:[a.jsx("line",{x1:"5",y1:"15",x2:"25",y2:"15",...n}),a.jsx("polyline",{points:"19,9 25,15 19,21",...n})]});case"flex-col":return a.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",children:[a.jsx("line",{x1:"15",y1:"5",x2:"15",y2:"25",...n}),a.jsx("polyline",{points:"9,19 15,25 21,19",...n})]});case"flex-row-reverse":return a.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",children:[a.jsx("line",{x1:"25",y1:"15",x2:"5",y2:"15",...n}),a.jsx("polyline",{points:"11,9 5,15 11,21",...n})]});case"flex-col-reverse":return a.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",children:[a.jsx("line",{x1:"15",y1:"25",x2:"15",y2:"5",...n}),a.jsx("polyline",{points:"9,11 15,5 21,11",...n})]})}}function M0({currentValue:e,lockedValue:t,locked:n,onHover:r,onLeave:o,onClick:l}){const[s,i]=w.useState(!1),{refs:u,floatingStyles:c,context:d}=mn({open:s,onOpenChange:k=>{k||(i(!1),o())},strategy:"fixed",placement:"bottom-start",middleware:[cn(4),fn(),dn({padding:8})],whileElementsMounted:un}),p=sr(d),{getReferenceProps:f,getFloatingProps:g}=ir([p]),x=t!==null&&Pi.some(k=>k.value===t),b=n&&!x,S=x?t:e??"",m=Pi.find(k=>k.value===S),h=!m;function y(){i(!1),o()}function v(){b||i(k=>(k&&o(),!k))}const C=h?{...$t,borderStyle:"dashed",borderColor:s?Me:wt,background:s?ur:"transparent",alignItems:"center",justifyContent:"center",cursor:b?"default":"pointer"}:{...$t,borderColor:s?Me:wt,background:s?ur:Dn,boxShadow:s?"0 0 0 2px rgba(0,132,139,0.18)":"none",alignItems:"center",justifyContent:"center",cursor:b?"default":"pointer"};return a.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:2},children:[a.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Ae,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Direction"}),a.jsxs("div",{ref:u.setReference,role:"button",tabIndex:b?-1:0,"aria-label":"Direction",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&v()},onClick:v,...f(),children:[a.jsx("div",{style:C,children:m?a.jsx(Am,{direction:m.value,color:s?Me:Ae}):a.jsx("span",{style:{fontSize:10,fontFamily:Je,color:Ae},children:"—"})}),a.jsx("span",{style:{fontSize:9,fontFamily:Je,color:s?Me:Ae,fontWeight:s?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:(m==null?void 0:m.label)??"—"})]}),s&&a.jsx(pn,{children:a.jsx("div",{ref:u.setFloating,style:c,className:"z-[9999]",...g(),children:a.jsx(fr,{style:{background:"#1e1e1e",border:`1px solid ${wt}`,borderRadius:8,boxShadow:"0 4px 16px rgba(0,0,0,0.35)",padding:8},onMouseLeave:o,onClose:y,children:a.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 60px)",gap:4},children:Pi.map(k=>{const j=k.value===S;return a.jsx($0,{option:k,isActive:j,onHover:()=>r(k.value),onClick:()=>{l(k.value),y()}},k.value)})})})})})]})}function $0({option:e,isActive:t,onHover:n,onClick:r}){const[o,l]=w.useState(!1),s=t||o,i={...$t,borderColor:s?Me:wt,background:s?ur:Dn,boxShadow:t?"0 0 0 2px rgba(0,132,139,0.35)":"none",alignItems:"center",justifyContent:"center"};return a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3,cursor:"pointer"},onMouseEnter:()=>{l(!0),n()},onMouseLeave:()=>l(!1),onClick:r,children:[a.jsx("div",{style:i,children:a.jsx(Am,{direction:e.value,color:s?Me:Ae})}),a.jsx("span",{style:{fontSize:9,fontFamily:Je,color:s?Me:Ae,fontWeight:s?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:e.label})]})}const _i=[{value:"flex-nowrap",label:"no-wrap"},{value:"flex-wrap",label:"wrap"},{value:"flex-wrap-reverse",label:"wrap-reverse"}],z0=e=>({stroke:e,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"});function Om({mode:e,color:t}){const n=z0(t),r={...n,strokeDasharray:"2 3"};return e==="flex-nowrap"?a.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[a.jsx("line",{x1:"3",y1:"7",x2:"37",y2:"7",...n}),a.jsx("polyline",{points:"31,1 37,7 31,13",...n})]}):e==="flex-wrap"?a.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[a.jsx("line",{x1:"3",y1:"7",x2:"37",y2:"7",...n}),a.jsx("line",{x1:"37",y1:"7",x2:"3",y2:"33",...r}),a.jsx("line",{x1:"3",y1:"33",x2:"37",y2:"33",...n}),a.jsx("polyline",{points:"31,27 37,33 31,39",...n})]}):a.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[a.jsx("line",{x1:"3",y1:"33",x2:"37",y2:"33",...n}),a.jsx("line",{x1:"37",y1:"33",x2:"3",y2:"7",...r}),a.jsx("line",{x1:"3",y1:"7",x2:"37",y2:"7",...n}),a.jsx("polyline",{points:"31,1 37,7 31,13",...n})]})}function K0({option:e,isActive:t,onHover:n,onClick:r}){const[o,l]=w.useState(!1),s=t||o,i={...$t,borderColor:s?Me:wt,background:s?ur:Dn,boxShadow:t?"0 0 0 2px rgba(0,132,139,0.35)":"none",alignItems:"center",justifyContent:"center"};return a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3,cursor:"pointer"},onMouseEnter:()=>{l(!0),n()},onMouseLeave:()=>l(!1),onClick:r,children:[a.jsx("div",{style:i,children:a.jsx(Om,{mode:e.value,color:s?Me:Ae})}),a.jsx("span",{style:{fontSize:9,fontFamily:Je,color:s?Me:Ae,fontWeight:s?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:e.label})]})}function F0({currentValue:e,lockedValue:t,locked:n,onHover:r,onLeave:o,onClick:l}){const[s,i]=w.useState(!1),{refs:u,floatingStyles:c,context:d}=mn({open:s,onOpenChange:k=>{k||(i(!1),o())},strategy:"fixed",placement:"bottom-start",middleware:[cn(4),fn(),dn({padding:8})],whileElementsMounted:un}),p=sr(d),{getReferenceProps:f,getFloatingProps:g}=ir([p]),x=t!==null&&_i.some(k=>k.value===t),b=n&&!x,S=!x&&e===null,m=x?t:e??"",h=_i.find(k=>k.value===m),y=(h==null?void 0:h.label)??"Wrap";function v(){i(!1),o()}function C(){b||i(k=>(k&&o(),!k))}return a.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:2},children:[a.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Ae,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Wrap"}),a.jsxs("div",{ref:u.setReference,role:"button",tabIndex:b?-1:0,"aria-label":"Wrap",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&C()},onClick:C,...f(),children:[S?a.jsx("div",{style:{...$t,borderStyle:"dashed",borderColor:s?Me:wt,background:s?ur:"transparent",alignItems:"center",justifyContent:"center"},children:a.jsx("span",{style:{fontSize:10,fontFamily:Je,color:Ae},children:"—"})}):a.jsx("div",{style:{...$t,borderColor:s?Me:wt,background:s?ur:Dn,boxShadow:s?"0 0 0 2px rgba(0,132,139,0.18)":"none",alignItems:"center",justifyContent:"center"},children:a.jsx(Om,{mode:m,color:s?Me:Ae})}),a.jsx("span",{style:{fontSize:9,fontFamily:Je,color:s?Me:Ae,fontWeight:s?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:y})]}),s&&a.jsx(pn,{children:a.jsx("div",{ref:u.setFloating,style:c,className:"z-[9999]",...g(),children:a.jsx(fr,{style:{background:"#1e1e1e",border:`1px solid ${wt}`,borderRadius:8,boxShadow:"0 4px 16px rgba(0,0,0,0.35)",padding:8},onMouseLeave:o,onClose:v,children:a.jsx("div",{className:"grid gap-1",style:{gridTemplateColumns:"repeat(3, 60px)"},children:_i.map(k=>{const j=k.value===m;return a.jsx(K0,{option:k,isActive:j,onHover:()=>r(k.value),onClick:()=>{l(k.value),v()}},k.value)})})})})})]})}function W0({flexDirection:e="row",activeValue:t,onSelect:n,onHover:r}){const o=e.startsWith("column"),l=e;function s(f,g){const x=g?Ed:$a;return o?{...x,width:"100%",height:f}:{...x,width:f,height:"100%"}}function i(f){const g=f?Ed:$a;return o?{...g,flex:1,width:"100%"}:{...g,flex:1,height:"100%"}}function u(f,g){return{...g?D0:Lm,flex:f}}const c=f=>t===f,d=f=>()=>n==null?void 0:n(f),p=f=>()=>r==null?void 0:r(f);return a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 60px)",gap:4},children:[a.jsx(Yt,{label:"start",isActive:c("justify-start"),onClick:d("justify-start"),onHover:p("justify-start"),containerStyle:{flexDirection:l,justifyContent:"flex-start",gap:2},children:f=>a.jsxs(a.Fragment,{children:[a.jsx("div",{style:s(10,f)}),a.jsx("div",{style:s(14,f)}),a.jsx("div",{style:s(8,f)})]})}),a.jsx(Yt,{label:"center",isActive:c("justify-center"),onClick:d("justify-center"),onHover:p("justify-center"),containerStyle:{flexDirection:l,justifyContent:"center",gap:2},children:f=>a.jsxs(a.Fragment,{children:[a.jsx("div",{style:s(10,f)}),a.jsx("div",{style:s(14,f)}),a.jsx("div",{style:s(8,f)})]})}),a.jsx(Yt,{label:"stretch",isActive:c("justify-stretch"),onClick:d("justify-stretch"),onHover:p("justify-stretch"),containerStyle:{flexDirection:l,gap:2},children:f=>a.jsxs(a.Fragment,{children:[a.jsx("div",{style:i(f)}),a.jsx("div",{style:i(f)}),a.jsx("div",{style:i(f)})]})}),a.jsx(Yt,{label:"between",isActive:c("justify-between"),onClick:d("justify-between"),onHover:p("justify-between"),containerStyle:{flexDirection:l},children:f=>a.jsxs(a.Fragment,{children:[a.jsx("div",{style:s(12,f)}),a.jsx("div",{style:u(1,f)}),a.jsx("div",{style:s(12,f)})]})}),a.jsx(Yt,{label:"around",isActive:c("justify-around"),onClick:d("justify-around"),onHover:p("justify-around"),containerStyle:{flexDirection:l},children:f=>a.jsxs(a.Fragment,{children:[a.jsx("div",{style:u(1,f)}),a.jsx("div",{style:s(12,f)}),a.jsx("div",{style:u(2,f)}),a.jsx("div",{style:s(12,f)}),a.jsx("div",{style:u(1,f)})]})}),a.jsx(Yt,{label:"evenly",isActive:c("justify-evenly"),onClick:d("justify-evenly"),onHover:p("justify-evenly"),containerStyle:{flexDirection:l},children:f=>a.jsxs(a.Fragment,{children:[a.jsx("div",{style:u(1,f)}),a.jsx("div",{style:s(12,f)}),a.jsx("div",{style:u(1,f)}),a.jsx("div",{style:s(12,f)}),a.jsx("div",{style:u(1,f)})]})}),a.jsx(Yt,{label:"end",isActive:c("justify-end"),onClick:d("justify-end"),onHover:p("justify-end"),containerStyle:{flexDirection:l,justifyContent:"flex-end",gap:2},children:f=>a.jsxs(a.Fragment,{children:[a.jsx("div",{style:s(10,f)}),a.jsx("div",{style:s(14,f)}),a.jsx("div",{style:s(8,f)})]})})]})}const nn="bg-bv-teal/50 rounded-[2px] shrink-0 group-hover:bg-bv-teal/70 transition-colors duration-150",V0="bg-bv-orange/10 rounded-[2px]";function Xt({isCol:e,main:t}){return a.jsx("div",{className:nn,style:e?{height:t}:{width:t}})}function Wn({flex:e=1}){return a.jsx("div",{className:V0,style:{flex:e}})}function Bt({isCol:e,w:t,h:n}){return a.jsx("div",{className:nn,style:e?{width:n,height:t}:{width:t,height:n}})}function Ii({isCol:e,w:t,h:n,pt:r}){return a.jsx("div",{className:`${nn} 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 Li(e){return a.jsxs(a.Fragment,{children:[a.jsx(Xt,{isCol:e,main:10}),a.jsx(Xt,{isCol:e,main:14}),a.jsx(Xt,{isCol:e,main:8})]})}const Td=[{value:"justify-start",label:"start",getContainerStyle:e=>({flexDirection:e,justifyContent:"flex-start",gap:2}),renderItems:e=>Li(e.startsWith("column"))},{value:"justify-center",label:"center",getContainerStyle:e=>({flexDirection:e,justifyContent:"center",gap:2}),renderItems:e=>Li(e.startsWith("column"))},{value:"justify-stretch",label:"stretch",getContainerStyle:e=>({flexDirection:e,gap:2}),renderItems:()=>a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`${nn} flex-1`}),a.jsx("div",{className:`${nn} flex-1`}),a.jsx("div",{className:`${nn} flex-1`})]})},{value:"justify-between",label:"between",getContainerStyle:e=>({flexDirection:e}),renderItems:e=>{const t=e.startsWith("column");return a.jsxs(a.Fragment,{children:[a.jsx(Xt,{isCol:t,main:12}),a.jsx(Wn,{}),a.jsx(Xt,{isCol:t,main:12})]})}},{value:"justify-around",label:"around",getContainerStyle:e=>({flexDirection:e}),renderItems:e=>{const t=e.startsWith("column");return a.jsxs(a.Fragment,{children:[a.jsx(Wn,{flex:1}),a.jsx(Xt,{isCol:t,main:12}),a.jsx(Wn,{flex:2}),a.jsx(Xt,{isCol:t,main:12}),a.jsx(Wn,{flex:1})]})}},{value:"justify-evenly",label:"evenly",getContainerStyle:e=>({flexDirection:e}),renderItems:e=>{const t=e.startsWith("column");return a.jsxs(a.Fragment,{children:[a.jsx(Wn,{}),a.jsx(Xt,{isCol:t,main:12}),a.jsx(Wn,{}),a.jsx(Xt,{isCol:t,main:12}),a.jsx(Wn,{})]})}},{value:"justify-end",label:"end",getContainerStyle:e=>({flexDirection:e,justifyContent:"flex-end",gap:2}),renderItems:e=>Li(e.startsWith("column"))}],Ai=[{value:"items-start",label:"start",getContainerStyle:e=>({flexDirection:e,alignItems:"flex-start",gap:3}),renderItems:e=>{const t=e.startsWith("column");return a.jsxs(a.Fragment,{children:[a.jsx(Bt,{isCol:t,w:13,h:22}),a.jsx(Bt,{isCol:t,w:15,h:42}),a.jsx(Bt,{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 a.jsxs(a.Fragment,{children:[a.jsx(Bt,{isCol:t,w:13,h:22}),a.jsx(Bt,{isCol:t,w:15,h:42}),a.jsx(Bt,{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 a.jsxs(a.Fragment,{children:[a.jsx(Ii,{isCol:t,w:13,h:38,pt:17}),a.jsx(Ii,{isCol:t,w:15,h:26,pt:3}),a.jsx(Ii,{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 a.jsxs(a.Fragment,{children:[a.jsx("div",{className:nn,style:t?{height:13}:{width:13}}),a.jsx("div",{className:nn,style:t?{height:15}:{width:15}}),a.jsx("div",{className:nn,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 a.jsxs(a.Fragment,{children:[a.jsx(Bt,{isCol:t,w:13,h:22}),a.jsx(Bt,{isCol:t,w:15,h:42}),a.jsx(Bt,{isCol:t,w:11,h:14})]})}}];function H0({currentValue:e,lockedValue:t,locked:n,flexDirection:r="row",onHover:o,onLeave:l,onClick:s,onRemove:i,onRemoveHover:u}){const[c,d]=w.useState(!1),{refs:p,floatingStyles:f,context:g}=mn({open:c,onOpenChange:_=>{_||(d(!1),l())},strategy:"fixed",placement:"bottom-start",middleware:[cn(4),fn(),dn({padding:8})],whileElementsMounted:un}),x=sr(g),{getReferenceProps:b,getFloatingProps:S}=ir([x]),m=t!==null&&Td.some(_=>_.value===t),h=n&&!m,y=!m&&(e===null||e===""),v=m?t:e??"",C=Td.find(_=>_.value===v),k=(C==null?void 0:C.label)??"—";function j(){d(!1),l()}function T(){h||d(_=>(_&&l(),!_))}const $={...$t,borderStyle:"dashed",alignItems:"center",justifyContent:"center"};return a.jsxs("div",{className:"flex flex-col items-start gap-1",children:[a.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Ae,fontWeight:500},children:"JUSTIFY →"}),a.jsx("div",{ref:p.setReference,className:"cursor-pointer",role:"button",tabIndex:h?-1:0,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&T()},onClick:T,...b(),children:y?a.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[a.jsx("div",{style:$,children:a.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Ae},children:"—"})}),a.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Ae},children:"none"})]}):a.jsx(Yt,{label:k,isActive:c,containerStyle:(C==null?void 0:C.getContainerStyle(r))??{flexDirection:r},children:_=>(C==null?void 0:C.renderItems(r))??null})}),c&&a.jsx(pn,{children:a.jsx("div",{ref:p.setFloating,style:f,className:"z-[9999]",...S(),children:a.jsxs(fr,{className:"bg-bv-bg border border-bv-border rounded-lg shadow-lg p-2 flex flex-col gap-1",onMouseLeave:l,onClose:j,children:[i&&a.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:()=>{i(),j()},children:[a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",className:"shrink-0",children:[a.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),a.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),"remove"]}),a.jsx(W0,{flexDirection:r,activeValue:v,onSelect:_=>{s(_),j()},onHover:o})]})})})]})}function B0({currentValue:e,lockedValue:t,locked:n,flexDirection:r="row",onHover:o,onLeave:l,onClick:s,onRemove:i,onRemoveHover:u}){const[c,d]=w.useState(!1),{refs:p,floatingStyles:f,context:g}=mn({open:c,onOpenChange:W=>{W||(d(!1),l())},strategy:"fixed",placement:"bottom-start",middleware:[cn(4),fn(),dn({padding:8})],whileElementsMounted:un}),x=sr(g),{getReferenceProps:b,getFloatingProps:S}=ir([x]),m=t!==null&&Ai.some(W=>W.value===t),h=n&&!m,y=!m&&(e===null||e===""),v=m?t:e??"",C=Ai.find(W=>W.value===v),k=(C==null?void 0:C.label)??"—",j=r;function T(){d(!1),l()}function $(){h||d(W=>(W&&l(),!W))}const _=y?{...$t,borderStyle:"dashed",borderColor:wt,background:Dn,cursor:h?"default":"pointer",alignItems:"center",justifyContent:"center"}:{...$t,borderColor:c?Me:wt,background:c?"rgba(0,132,139,0.09)":Dn,cursor:h?"default":"pointer",...C?C.getContainerStyle(r):{}};return a.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:2},children:[a.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Ae,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Align ↓"}),a.jsx("div",{ref:p.setReference,role:"button",tabIndex:h?-1:0,onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&$()},onClick:$,...b(),children:a.jsx("div",{style:_,children:y?a.jsx("span",{style:{fontSize:9,fontFamily:Je,color:Ae},children:"—"}):C==null?void 0:C.renderItems(r)})}),a.jsx("span",{style:{fontSize:9,fontFamily:Je,color:c?Me:Ae,fontWeight:c?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:y?"—":k}),c&&a.jsx(pn,{children:a.jsx("div",{ref:p.setFloating,style:f,className:"z-[9999]",...S(),children:a.jsxs(fr,{className:"bg-bv-bg border border-bv-border rounded-lg shadow-lg p-2 flex flex-col gap-1",onMouseLeave:l,onClose:T,children:[i&&a.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:()=>{i(),T()},children:[a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",className:"shrink-0",children:[a.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),a.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),"remove"]}),a.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 60px)",gap:4},children:Ai.map(W=>a.jsx(Yt,{label:W.label,isActive:W.value===v,containerStyle:{flexDirection:j,...W.getContainerStyle(r)},onHover:()=>o(W.value),onClick:()=>{s(W.value),T()},children:O=>W.renderItems(r)},W.value))})]})})})]})}function Nd(e){return e.replace(/^gap-x-/,"x-")}function Rd(e){return e.replace(/^gap-y-/,"y-")}function U0({slots:e,onSlotChange:t,onSlotHover:n,onSlotRemove:r,onSlotRemoveHover:o}){const[l,s]=w.useState(null),[i,u]=w.useState(null),c=e.find(S=>S.key==="gap"),d=e.find(S=>S.key==="gap-x"),p=e.find(S=>S.key==="gap-y");function f(S,m){u(m!=null?S:null),n==null||n(S,m)}function g(S){u(S)}function x(){u(null)}const b=i==="gap-x"?"gm-active-x":i==="gap-y"?"gm-active-y":i==="gap"?"gm-active-gap":"";return a.jsx("div",{className:"gm-root",children:a.jsxs("div",{className:`gm-grid${b?` ${b}`:""}`,children:[a.jsx("div",{className:"gm-col-highlight",style:{gridArea:"1 / 2 / 4 / 3"}}),a.jsx("div",{className:"gm-row-highlight",style:{gridArea:"2 / 1 / 3 / 4"}}),a.jsx("div",{className:"gm-box gm-box-tl",style:{gridArea:"1 / 1"}}),a.jsx("div",{className:"gm-cell",style:{gridArea:"1 / 2"},onMouseEnter:()=>g("gap-x"),onMouseLeave:x,children:(d==null?void 0:d.scaleValues)&&a.jsx(Kr,{placeholder:"x",values:d.scaleValues,currentValue:d.value,displayValue:d.value?Nd(d.value):null,formatValue:Nd,axis:"x",disabled:l!==null&&l!=="gap-x",onHover:S=>f("gap-x",S),onLeave:()=>f("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:d.value?()=>r==null?void 0:r("gap-x"):void 0,onRemoveHover:d.value?()=>{u(null),o==null||o("gap-x")}:void 0})}),a.jsx("div",{className:"gm-box gm-box-tr",style:{gridArea:"1 / 3"}}),a.jsx("div",{className:"gm-cell",style:{gridArea:"2 / 1"},onMouseEnter:()=>g("gap-y"),onMouseLeave:x,children:(p==null?void 0:p.scaleValues)&&a.jsx(Kr,{placeholder:"y",values:p.scaleValues,currentValue:p.value,displayValue:p.value?Rd(p.value):null,formatValue:Rd,axis:"y",disabled:l!==null&&l!=="gap-y",onHover:S=>f("gap-y",S),onLeave:()=>f("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:p.value?()=>r==null?void 0:r("gap-y"):void 0,onRemoveHover:p.value?()=>{u(null),o==null||o("gap-y")}:void 0})}),a.jsx("div",{className:"gm-cell",style:{gridArea:"2 / 2"},onMouseEnter:()=>g("gap"),onMouseLeave:x,children:(c==null?void 0:c.scaleValues)&&a.jsx(Kr,{placeholder:"gap",values:c.scaleValues,currentValue:c.value,displayValue:c.value??null,axis:"x",disabled:l!==null&&l!=="gap",onHover:S=>f("gap",S),onLeave:()=>f("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})}),a.jsx("div",{className:"gm-box gm-box-bl",style:{gridArea:"3 / 1"}})]})})}const Dm={shadow:"Shadow","inset-shadow":"Inset Shadow",ring:"Ring","inset-ring":"Inset Ring","text-shadow":"Text Shadow"},Pd={shadow:"shadow-md","inset-shadow":"inset-shadow-sm",ring:"ring-2","inset-ring":"inset-ring-2","text-shadow":"text-shadow-md"};function G0(e){switch(e){case"shadow":return[...Au];case"inset-shadow":return[...Zp];case"ring":return[...Na];case"inset-ring":return[...Na];case"text-shadow":return[...Ou]}}function _d(e,t){return`${e==="shadow"?"shadow-":e==="inset-shadow"?"inset-shadow-":e==="ring"?"ring-":e==="inset-ring"?"inset-ring-":"text-shadow-"}${t}`}function Y0(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 Q0(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),i=parseInt(e.colorHex.slice(5,7),16);return`rgba(${l},${s},${i},${o})`}return e.colorHex},n=e.colorHex?t(e.colorHex):void 0;switch(e.type){case"shadow":{const r=bo(e.sizeClass,"shadow-");return J0(r,n)}case"inset-shadow":{const r=bo(e.sizeClass,"inset-shadow-");return q0(r,n)}case"ring":{const r=bo(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=bo(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 X0(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),i=parseInt(e.colorHex.slice(3,5),16),u=parseInt(e.colorHex.slice(5,7),16);return`rgba(${s},${i},${u},${l})`}return e.colorHex},n=e.colorHex?t(e.colorHex):void 0,r=bo(e.sizeClass,"text-shadow-");return Z0(r,n)}function Z0(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 bo(e,t){return e.startsWith(t)?e.slice(t.length):e}function J0(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 q0(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 e1=Array.from({length:21},(e,t)=>`${t*5}%`);function t1({layer:e,onSizeHover:t,onSizeLeave:n,onSizeClick:r,onColorClick:o,onOpacityHover:l,onOpacityLeave:s,onOpacityClick:i,onRemove:u,onRemoveHover:c}){const[d,p]=w.useState(!1),f=w.useRef(),g={onMouseEnter:()=>{clearTimeout(f.current),p(!0)},onMouseLeave:()=>{f.current=setTimeout(()=>p(!1),60)}},x=G0(e.type),b=Q0(e),S=e.type==="text-shadow"?X0(e):"none",m=e.isNone,h=e.sizeClass?Y0(e.type,e.sizeClass):x[0],y=!!e.colorHex,v=e.opacity!==null?`${e.opacity}%`:"100%",C=e.colorHex??void 0;function k(T){t(_d(e.type,T))}function j(T){r(_d(e.type,T))}return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"flex items-center justify-center",...g,children:a.jsx("span",{className:"w-1 h-1 rounded-full bg-bv-orange"})}),a.jsx("span",{className:"flex items-center text-[9px] font-semibold uppercase tracking-[0.8px] text-bv-text-mid font-mono whitespace-nowrap",...g,children:Dm[e.type]}),a.jsx("span",{className:"flex items-center",...g,children:a.jsx(xn,{values:x,currentValue:h,lockedValue:null,locked:!1,onHover:k,onLeave:n,onClick:j})}),a.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"} ${m?"opacity-30 pointer-events-none":""}`,onClick:T=>o(T.currentTarget),title:e.colorClass?e.colorClass:"Default color — click to override",...g,children:e.colorHex?a.jsx("div",{className:"w-full h-full rounded-[4px]",style:{background:C,opacity:e.opacity!==null?e.opacity/100:1}}):a.jsx("div",{className:"w-full h-full rounded-[4px] flex items-center justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full bg-bv-text-mid opacity-40"})})}),a.jsx("span",{className:`flex items-center ${m||!y?"opacity-30 pointer-events-none":""}`,...g,children:y&&!m?a.jsx(xn,{values:e1,currentValue:v,lockedValue:null,locked:!1,onHover:l,onLeave:s,onClick:i}):a.jsx("span",{className:"flex items-center justify-center w-full h-[26px] bg-bv-surface border border-bv-border rounded-[5px]",children:a.jsx("span",{className:"font-mono text-[11px] text-bv-muted select-none",children:"—"})})}),a.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(),...g,children:e.type==="text-shadow"&&a.jsx("span",{className:"text-[11px] font-semibold text-bv-text select-none transition-[text-shadow] duration-200",style:{textShadow:S},children:"Aa"})}),a.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 ${d?"opacity-100":"opacity-0"}`,onClick:u,onMouseEnter:()=>{clearTimeout(f.current),p(!0),c()},onMouseLeave:()=>{f.current=setTimeout(()=>p(!1),60)},title:"Remove layer",children:"×"})]})}const n1=["shadow","inset-shadow","ring","inset-ring","text-shadow"];function r1({layers:e,onPreview:t,onRevert:n,onStage:r,onAdd:o,onRemove:l,onRemoveHover:s,onColorClick:i}){function u(d){const p=[];return d.sizeClass&&p.push(d.sizeClass),d.colorClass&&p.push(d.opacity!==null?`${d.colorClass}/${d.opacity}`:d.colorClass),p}const c=n1.map(d=>({type:d,layer:e.find(p=>p.type===d)}));return a.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:d,layer:p},f)=>a.jsxs(w.Fragment,{children:[f>0&&a.jsx("div",{className:"h-px bg-bv-border opacity-50",style:{gridColumn:"1 / -1"}}),p?a.jsx(t1,{layer:p,onSizeHover:g=>t(p.sizeClass??"",g),onSizeLeave:n,onSizeClick:g=>r(p.sizeClass??"",g),onColorClick:g=>i==null?void 0:i(p,g),onOpacityHover:g=>{if(!p.colorClass)return;const x=p.colorClass.split("/")[0],b=parseInt(g),S=b===100?x:`${x}/${b}`,m=p.opacity!==null?`${x}/${p.opacity}`:x;t(m,S)},onOpacityLeave:n,onOpacityClick:g=>{if(!p.colorClass)return;const x=p.colorClass.split("/")[0],b=parseInt(g),S=b===100?x:`${x}/${b}`,m=p.opacity!==null?`${x}/${p.opacity}`:x;r(m,S)},onRemove:()=>l(u(p)),onRemoveHover:()=>s(u(p))}):a.jsxs(a.Fragment,{children:[a.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(Pd[d]),title:`Add ${Pd[d]}`,children:"+"}),a.jsx("div",{className:"flex items-center leading-none text-[9px] font-mono uppercase tracking-[0.6px] text-bv-muted whitespace-nowrap",children:Dm[d]})]})]},d))})}const Id=[{prop:"shadow",prefix:"shadow-",sizeSet:ps},{prop:"inset-shadow",prefix:"inset-shadow-",sizeSet:ms},{prop:"ring",prefix:"ring-",sizeSet:Yr},{prop:"inset-ring",prefix:"inset-ring-",sizeSet:Yr},{prop:"text-shadow",prefix:"text-shadow-",sizeSet:hs}];function yr(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 i=!1;const u=e.flatMap(c=>{const d=c.startsWith(r)?c.slice(r.length).split("/")[0]:"";return o.has(d)===s&&!i?(i=!0,n?[n]:[]):[c]});return i?u:n?[...e,n]:e}function o1(e,t){if(!t)return null;const n=e.lastIndexOf("-");if(n===-1){const i=t[e];return typeof i=="string"?i: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 l1(e,t){const n=e.trim().split(/\s+/).filter(Boolean),r=t==null?void 0:t.colors,o=[{type:"shadow",prefix:"shadow-",sizeSet:ps},{type:"inset-shadow",prefix:"inset-shadow-",sizeSet:ms},{type:"ring",prefix:"ring-",sizeSet:Yr},{type:"inset-ring",prefix:"inset-ring-",sizeSet:Yr},{type:"text-shadow",prefix:"text-shadow-",sizeSet:hs}],l=[];for(const{type:s,prefix:i,sizeSet:u}of o){const c=n.filter(x=>x===i.slice(0,-1)||x.startsWith(i));if(c.length===0)continue;let d=null,p=null,f=null,g=null;for(const x of c){const S=x.slice(i.length).split("/")[0];if(u.has(S))d=x;else{p=x;const m=x.split("/");m.length===2&&(g=parseInt(m[1])),f=o1(S,r??null)}}l.push({type:s,sizeClass:d,colorClass:p,colorHex:f,opacity:g,isNone:d!==null&&(d.endsWith("-none")||d.endsWith("-0"))})}return l}function s1(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=>!Id.some(({prefix:i})=>s===i.slice(0,-1)||s.startsWith(i)));for(const{prop:s,prefix:i,sizeSet:u}of Id){const c=r.find(x=>x.property===s),d=r.find(x=>x.property===`${s}-size`),p=r.find(x=>x.property===`${s}-color`),f=o.filter(x=>x===i.slice(0,-1)||x.startsWith(i));if(c){if(c.newClass)l.push(...yr(f,c.originalClass,c.newClass,i,u));else{const x=c.originalClass.startsWith(i)?c.originalClass.slice(i.length).split("/")[0]:"";u.has(x)||!c.originalClass||l.push(...yr(f,c.originalClass,c.newClass,i,u))}continue}let g=[...f];d&&(d.newClass?g=yr(g,d.originalClass,d.newClass,i,u):d.originalClass&&(g=yr(g,d.originalClass,"",i,u))),p&&(p.newClass?g=yr(g,p.originalClass,p.newClass,i,u):p.originalClass&&(g=yr(g,p.originalClass,"",i,u))),l.push(...g)}return l.join(" ")}const i1={spacing:"Spacing",sizing:"Sizing",typography:"Typography",color:"Backgrounds",borders:"Radius",effects:"Effects",layout:"Layout",flexbox:"Flexbox & Grid",overflow:"Overflow"},a1=["layout","borders","sizing","typography","color","flexbox","shadows","effects"];function Ld(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 u1(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 Vn(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 i=s.fullClass,u=n.find(c=>c.prefix.test(i));u?r.set(u.key,i):o=i}return{shorthandValue:o,shorthandScaleValues:Ra,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"?Ra:Ry(`rounded-${s}`)}))}}const Hn=o0(),Mm=l0(),c1={"text-size":{scaleName:"fontSize",valueType:"scalar"},"text-color":{scaleName:null,valueType:"color"}};Mm.typography.unshift({name:"Font size",prefixHint:"text-sm/base/lg/…",prefix:"text-size"},{name:"Text color",prefixHint:"text-{color}",prefix:"text-color"});function Wl(e){const t=c1[e];if(t)return{...t,stagingKey:e};const n=Object.entries(ar).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=ar[e];return r?{scaleName:r.themeKey,valueType:r.valueType,enumAlts:r.enumAlts,stagingKey:e.replace(/-$/g,"")}:null}function d1(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 i=Wl(s.prefix);if((i==null?void 0:i.valueType)==="enum"&&i.enumAlts)return!i.enumAlts.some(u=>o.has(u));if(i&&i.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 f1(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 p1({componentName:e,instanceCount:t,rawClasses:n,parsedClasses:r,tailwindConfig:o,patchManager:l}){var re,le;const[s,i]=w.useState(null),[u,c]=w.useState(new Map),[d,p]=w.useState(new Map),[f,g]=w.useState(null),[x,b]=w.useState(null),[S,m]=w.useState(null),h=w.useRef(null),{refs:y,floatingStyles:v,context:C}=mn({open:f!==null,onOpenChange:E=>{E||(g(null),l.revertPreview())},strategy:"fixed",placement:"bottom-start",middleware:[cn(4),fn(),dn({padding:8}),Ma({apply({availableHeight:E,elements:D}){Object.assign(D.floating.style,{maxHeight:`${E}px`})},padding:8})],whileElementsMounted:un}),k=sr(C),{getFloatingProps:j}=ir([k]);w.useEffect(()=>{f!=null&&f.anchorEl&&y.setReference(f.anchorEl)},[f==null?void 0:f.anchorEl]);const{refs:T,floatingStyles:$,context:_}=mn({open:x!==null||S!==null,onOpenChange:E=>{E||(b(null),m(null),l.revertPreview())},strategy:"fixed",placement:"bottom-start",middleware:[cn(4),fn(),dn({padding:8}),Ma({apply({availableHeight:E,elements:D}){Object.assign(D.floating.style,{maxHeight:`${E}px`})},padding:8})],whileElementsMounted:un}),W=sr(_),{getFloatingProps:O}=ir([W]);w.useEffect(()=>{const E=(x==null?void 0:x.anchorEl)??(S==null?void 0:S.anchorEl);E&&T.setReference(E)},[x==null?void 0:x.anchorEl,S==null?void 0:S.anchorEl]);const[P,A]=w.useState(new Set),[X,H]=w.useState(!1),ne=w.useRef(r.map(E=>E.fullClass).join(" ")),R=r.map(E=>E.fullClass).join(" ");w.useEffect(()=>{ne.current!==R&&(ne.current=R,l.revertPreview(),c(new Map),p(new Map),g(null),b(null),A(new Set))});const L=e,N=l.patches.filter(E=>E.status==="staged"&&E.elementKey===L),z=new Set(N.filter(E=>E.originalClass==="").map(E=>E.property));function V(E,D){const K=N.find(ve=>ve.property===E),Z=(D==null?void 0:D.fullClass)??(K==null?void 0:K.originalClass)??"",ee=(K==null?void 0:K.newClass)??(D==null?void 0:D.fullClass)??"";return{originalClass:Z,effectiveClass:ee,hasValue:ee!==""}}function me(E){return u.size===0?E:E.map(D=>{const K=u.get(`${D.layer}-shorthand`),Z=D.slots.map(ve=>{const Ee=u.get(`${D.layer}-${ve.key}`);return Ee!==void 0?{...ve,value:Ee}:ve}),ee=K??D.shorthandValue;let fe=D.classState;return K!==void 0&&(fe=Z.some(Ee=>Ee.value!=null)?"mixed":"shorthand"),{...D,shorthandValue:ee,classState:fe,slots:Z}})}function be(E){if(d.size===0)return E;const D=d.get("all");return{...E,shorthandValue:D===void 0?E.shorthandValue:D,slots:E.slots.map(K=>{const Z=d.get(K.key);return Z===void 0?K:{...K,value:Z}})}}const ae=f1(r);function se(E,D){l.preview(E,D)}function _e(){l.revertPreview()}function ye(E,D,K){l.stage(L,E,D,K)}function eo(E,D){const K=E||D,Z=K.startsWith("bg-gradient-to-")?"bg-gradient-to-":K.startsWith("from-")?"from-":K.startsWith("via-")?"via-":K.startsWith("to-")?"to-":"bg-";ye(Z,E,D)}function to(E,D){l.revertPreview(),he("overlay",{type:"CLEAR_HIGHLIGHTS"}),E.color!==void 0&&D?(b(K=>(K==null?void 0:K.cls.fullClass)===E.fullClass?null:{cls:E,anchorEl:D}),i(null)):(b(null),i(E))}function pr(E,D){l.preview(E.fullClass,D)}function no(E){l.revertPreview()}function ro(E){const D=ar[E];if(!((D==null?void 0:D.controlGroup)==="flex-container"&&(D==null?void 0:D.propertyKey)==="display")){if((D==null?void 0:D.controlGroup)==="flex-container"){const K=r.some(ee=>ee.fullClass==="flex"||ee.fullClass==="inline-flex"),Z=N.some(ee=>ee.property==="display"&&ee.originalClass===""&&(ee.newClass==="flex"||ee.newClass==="inline-flex"));!K&&!Z&&l.stage(L,"display","","flex")}}A(K=>new Set(K).add(E))}function Ft(E,D){l.preview("",D)}function Kn(E){l.revertPreview()}function q(E,D){const K=Wl(E);l.stage(L,(K==null?void 0:K.stagingKey)??E,"",D),A(Z=>{const ee=new Set(Z);return ee.delete(E),ee})}return a.jsxs("div",{className:"divide-y divide-bv-border",children:[a.jsxs("div",{className:"px-4 py-3",children:[a.jsxs("div",{className:"flex items-center gap-1.5 cursor-pointer select-none",onClick:()=>H(E=>!E),children:[a.jsx("svg",{className:`w-3 h-3 text-bv-muted transition-transform ${X?"":"rotate-90"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})}),a.jsx("span",{className:"text-[10px] font-semibold text-bv-text",children:"Box model"})]}),a.jsx("div",{className:`overflow-hidden transition-[max-height,opacity] duration-200 ease-in-out ${X?"max-h-0 opacity-0":"max-h-[600px] opacity-100"}`,children:a.jsxs("div",{className:"mt-3",children:[a.jsx(g0,{layers:me(gr(r,o)),onEditStart:()=>{he("overlay",{type:"CLEAR_HIGHLIGHTS"}),g(null)},onSlotClick:(E,D,K)=>{var Ee;if(D!=="color"||!K){g(null);return}const Z=gr(r,o).find(tt=>tt.layer===E),ee=`${E}-color`,fe=u.get(ee)??((Ee=Z==null?void 0:Z.slots.find(tt=>tt.key==="color"))==null?void 0:Ee.value)??"",ve=E==="outline"?"outline-":"border-";g(tt=>(tt==null?void 0:tt.layer)===E?null:{layer:E,prefix:ve,currentClass:fe,staged:!1,anchorEl:K})},onSlotHover:(E,D,K)=>{var Z;if(K===null)l.revertPreview();else{const ee=`${E}-${D}`,fe=gr(r,o).find(Ee=>Ee.layer===E),ve=D==="shorthand"?u.get(ee)??(fe==null?void 0:fe.shorthandValue):u.get(ee)??((Z=fe==null?void 0:fe.slots.find(Ee=>Ee.key===D))==null?void 0:Z.value);l.preview(ve??"",K)}},onSlotChange:(E,D,K)=>{var ve;const Z=`${E}-${D}`,ee=gr(r,o).find(Ee=>Ee.layer===E),fe=D==="shorthand"?u.get(Z)??(ee==null?void 0:ee.shorthandValue):u.get(Z)??((ve=ee==null?void 0:ee.slots.find(Ee=>Ee.key===D))==null?void 0:ve.value);ye(`${E}-${D}`,fe??"",K),c(Ee=>new Map(Ee).set(Z,K))},onSlotRemoveHover:(E,D)=>{var fe;const K=`${E}-${D}`,Z=gr(r,o).find(ve=>ve.layer===E),ee=D==="shorthand"?u.get(K)??(Z==null?void 0:Z.shorthandValue):u.get(K)??((fe=Z==null?void 0:Z.slots.find(ve=>ve.key===D))==null?void 0:fe.value);ee&&l.preview(ee,"")},onSlotRemove:(E,D)=>{var fe;const K=`${E}-${D}`,Z=gr(r,o).find(ve=>ve.layer===E),ee=D==="shorthand"?u.get(K)??(Z==null?void 0:Z.shorthandValue):u.get(K)??((fe=Z==null?void 0:Z.slots.find(ve=>ve.key===D))==null?void 0:fe.value);ee&&(ye(`${E}-${D}`,ee,""),c(ve=>{const Ee=new Map(ve);return Ee.delete(K),Ee}))}}),f&&a.jsx(pn,{children:a.jsx("div",{ref:y.setFloating,style:{...v,zIndex:9999,overflowY:"auto"},...j(),children:a.jsx(Fl,{prefix:f.prefix,currentValue:f.currentClass.startsWith(f.prefix)?f.currentClass.slice(f.prefix.length):"",colors:(o==null?void 0:o.colors)||{},locked:!1,lockedValue:((re=N.find(E=>E.property===f.prefix))==null?void 0:re.newClass)??null,onHover:E=>{h.current=E,l.preview(f.currentClass,E)},onLeave:()=>{f.staged&&h.current?(l.preview(h.current,f.currentClass),h.current=null):l.revertPreview()},onClick:E=>{const D=`${f.layer}-color`;ye(f.prefix,f.currentClass,E),c(K=>new Map(K).set(D,E)),g(K=>K?{...K,currentClass:E,staged:!0}:null)}})})})]})})]}),(x||S)&&a.jsx(pn,{children:a.jsxs("div",{ref:T.setFloating,style:{...$,zIndex:9999,overflowY:"auto"},...O(),children:[x&&a.jsx(Fl,{prefix:Ld(x.cls),currentValue:x.cls.color??"",colors:(o==null?void 0:o.colors)||{},locked:!1,lockedValue:((le=N.find(E=>E.property===x.cls.property))==null?void 0:le.newClass)??null,onHover:E=>se(x.cls.fullClass,E),onLeave:_e,onClick:E=>ye(x.cls.property,x.cls.fullClass,E),onRemoveHover:()=>se(x.cls.fullClass,""),onRemove:()=>{ye(x.cls.property,x.cls.fullClass,""),b(null)}}),S&&(()=>{const{layer:E}=S,D=E.type==="shadow"?"shadow-":E.type==="inset-shadow"?"inset-shadow-":E.type==="ring"?"ring-":E.type==="text-shadow"?"text-shadow-":"inset-ring-",K=E.colorClass??"",Z=K?K.slice(D.length).split("/")[0]:"";return a.jsx(Fl,{prefix:D,currentValue:Z,colors:(o==null?void 0:o.colors)||{},locked:!1,lockedValue:null,onHover:ee=>se(K,ee),onLeave:_e,onClick:ee=>{const fe=E.type==="shadow"?"shadow-color":E.type==="inset-shadow"?"inset-shadow-color":E.type==="ring"?"ring-color":E.type==="text-shadow"?"text-shadow-color":"inset-ring-color";l.stage(L,fe,K,ee),m(null)},onRemoveHover:()=>{K&&se(K,"")},onRemove:()=>{if(K){const ee=E.type==="shadow"?"shadow-color":E.type==="inset-shadow"?"inset-shadow-color":E.type==="ring"?"ring-color":E.type==="text-shadow"?"text-shadow-color":"inset-ring-color";l.stage(L,ee,K,"")}m(null)}})})()]})}),a1.map(E=>{if(E==="shadows"){const I=s1(n,N),Q=l1(I,o);return a.jsx(jd,{label:"Shadows & Rings",onAddProperty:()=>{},isEmpty:!1,classCount:Q.length,children:a.jsx(r1,{layers:Q,onPreview:(U,G)=>l.preview(U,G),onRevert:()=>l.revertPreview(),onStage:(U,G)=>{const ce=U||G,oe=Be=>{if(Be.startsWith("shadow-")){const Fe=Be.slice(7).split("/")[0];return ps.has(Fe)}if(Be.startsWith("inset-shadow-")){const Fe=Be.slice(13).split("/")[0];return ms.has(Fe)}if(Be.startsWith("ring-")||Be.startsWith("inset-ring-")){const Fe=Be.slice(Be.startsWith("ring-")?5:11).split("/")[0];return Yr.has(Fe)}if(Be.startsWith("text-shadow-")){const Fe=Be.slice(12).split("/")[0];return hs.has(Fe)}return!1},$e=ce.startsWith("text-shadow")?"text-shadow":ce.startsWith("inset-shadow")?"inset-shadow":ce.startsWith("inset-ring")?"inset-ring":ce.startsWith("ring")?"ring":"shadow",Wt=oe(U)||U===""&&oe(G)?`${$e}-size`:`${$e}-color`;l.stage(L,Wt,U,G)},onAdd:U=>{const G=U.startsWith("text-shadow")?"text-shadow-size":U.startsWith("inset-shadow")?"inset-shadow-size":U.startsWith("inset-ring")?"inset-ring-size":U.startsWith("ring")?"ring-size":"shadow-size";l.stage(L,G,"",U)},onRemove:U=>{const G=oe=>{if(oe.startsWith("shadow-")){const $e=oe.slice(7).split("/")[0];return ps.has($e)}if(oe.startsWith("inset-shadow-")){const $e=oe.slice(13).split("/")[0];return ms.has($e)}if(oe.startsWith("ring-")||oe.startsWith("inset-ring-")){const $e=oe.slice(oe.startsWith("ring-")?5:11).split("/")[0];return Yr.has($e)}if(oe.startsWith("text-shadow-")){const $e=oe.slice(12).split("/")[0];return hs.has($e)}return!1},ce=[...U].reverse();for(const oe of ce){const $e=oe.startsWith("text-shadow")?"text-shadow":oe.startsWith("inset-shadow")?"inset-shadow":oe.startsWith("inset-ring")?"inset-ring":oe.startsWith("ring")?"ring":"shadow",Wt=G(oe)?`${$e}-size`:`${$e}-color`;l.stage(L,Wt,oe,"")}},onRemoveHover:U=>{U.length===1?l.preview(U[0],""):U.length>1&&l.preview(U.join(" "),"")},onColorClick:(U,G)=>{b(null),m(ce=>(ce==null?void 0:ce.layer.type)===U.type?null:{layer:U,anchorEl:G})}})},"shadows")}const K=(ae.get(E)||[]).filter(I=>!u1(I)),Z=Mm[E]||[],ee=n0.get("flex-container")??new Set,fe=r0.get("flex-container")??new Set,ve=r.some(I=>{if(I.fullClass==="flex"||I.fullClass==="inline-flex")return!0;const Q=Hn[I.fullClass];return!!(Q&&Q.propertyKey!=="display"&&ee.has(Q.propertyKey)||ee.has(I.property))}),Ee=[...fe].some(I=>P.has(I)||z.has(I.replace(/-$/,""))),tt=E==="flexbox"&&(ve||Ee),$m=tt?Z.filter(I=>!fe.has(I.prefix)):Z,zm=d1($m,K,P,z),Bs=Z.filter(I=>P.has(I.prefix)).map(I=>I.prefix),Us=Z.filter(I=>z.has(I.prefix.replace(/-$/g,""))).map(I=>I.prefix),Km=E==="color"||E==="flexbox"&&tt||E==="borders"?!1:K.length===0&&Bs.length===0&&Us.length===0,Fm=E==="borders"?Vn(r).slots.filter(I=>I.value!=null).length+(Vn(r).shorthandValue?1:0):K.length+Bs.length+Us.length;return a.jsxs(jd,{label:i1[E]??E,availableProperties:zm,onAddProperty:ro,isEmpty:Km,classCount:Fm,children:[E==="borders"&&a.jsx(j0,{state:be(Vn(r)),onSlotHover:(I,Q)=>{var oe;const U=Vn(r),ce=(I==="all"?d.get("all")??U.shorthandValue:d.get(I)??((oe=U.slots.find($e=>$e.key===I))==null?void 0:oe.value)??null)??"";Q===null?l.revertPreview():l.preview(ce,Q)},onSlotChange:(I,Q)=>{var ce;const U=Vn(r),G=d.get(I)??(I==="all"?U.shorthandValue:(ce=U.slots.find(oe=>oe.key===I))==null?void 0:ce.value)??"";ye(`rounded-${I}`,G,Q),p(oe=>new Map(oe).set(I,Q))},onSlotRemove:I=>{var U;const Q=d.get(I)??((U=Vn(r).slots.find(G=>G.key===I))==null?void 0:U.value)??"";Q&&(ye(`rounded-${I}`,Q,""),p(G=>new Map(G).set(I,null)))},onSlotRemoveHover:I=>{var U;const Q=d.get(I)??((U=Vn(r).slots.find(G=>G.key===I))==null?void 0:U.value)??"";Q&&l.preview(Q,"")},onEditStart:()=>he("overlay",{type:"CLEAR_HIGHLIGHTS"})}),E==="color"&&a.jsx(L0,{...A0(r,(o==null?void 0:o.colors)||{},N.filter(I=>I.elementKey===L)),onPreview:se,onPreviewBatch:I=>l.previewBatch(I),onRevert:_e,onStage:eo}),E==="flexbox"&&tt&&(()=>{const I=r,Q=I.find(te=>{const pe=Hn[te.fullClass];return(pe==null?void 0:pe.propertyKey)==="flex-direction"}),U=I.find(te=>{const pe=Hn[te.fullClass];return(pe==null?void 0:pe.propertyKey)==="justify-content"}),G=I.find(te=>{const pe=Hn[te.fullClass];return(pe==null?void 0:pe.propertyKey)==="align-items"}),ce=I.find(te=>{const pe=Hn[te.fullClass];return(pe==null?void 0:pe.propertyKey)==="flex-wrap"}),oe={"flex-row":"row","flex-col":"column","flex-row-reverse":"row-reverse","flex-col-reverse":"column-reverse"},$e=(Q==null?void 0:Q.fullClass)??null,ol=$e?oe[$e]??"row":"row",Wt=V("flex-direction",Q),Be=V("flex-wrap",ce),Fe=V("justify-content",U),Vt=V("align-items",G),Wm=r.find(te=>te.property==="gap"),Vm=r.find(te=>te.property==="gap-x"),Hm=r.find(te=>te.property==="gap-y"),oo=V("gap",Wm),lo=V("gap-x",Vm),so=V("gap-y",Hm),Bm=[{key:"gap",value:oo.effectiveClass||null,scaleValues:hr("gap-","spacing",o)},{key:"gap-x",value:lo.effectiveClass||null,scaleValues:hr("gap-x-","spacing",o)},{key:"gap-y",value:so.effectiveClass||null,scaleValues:hr("gap-y-","spacing",o)}];return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex justify-between items-start w-full",children:[a.jsx(M0,{currentValue:(Q==null?void 0:Q.fullClass)??null,lockedValue:Wt.effectiveClass!==Wt.originalClass?Wt.effectiveClass:null,locked:!1,onHover:te=>se(Wt.effectiveClass,te),onLeave:_e,onClick:te=>ye("flex-direction",Wt.originalClass,te)}),a.jsx(F0,{currentValue:(ce==null?void 0:ce.fullClass)??null,lockedValue:Be.effectiveClass!==Be.originalClass?Be.effectiveClass:null,locked:!1,onHover:te=>se(Be.effectiveClass,te),onLeave:_e,onClick:te=>ye("flex-wrap",Be.originalClass,te)}),a.jsx(H0,{currentValue:(U==null?void 0:U.fullClass)??null,lockedValue:Fe.effectiveClass!==Fe.originalClass?Fe.effectiveClass:null,locked:!1,flexDirection:ol,onHover:te=>se(Fe.effectiveClass,te),onLeave:_e,onClick:te=>ye("justify-content",Fe.originalClass,te),onRemove:Fe.hasValue?()=>ye("justify-content",Fe.originalClass,""):void 0,onRemoveHover:Fe.hasValue?()=>se(Fe.effectiveClass,""):void 0}),a.jsx(B0,{currentValue:(G==null?void 0:G.fullClass)??null,lockedValue:Vt.effectiveClass!==Vt.originalClass?Vt.effectiveClass:null,locked:!1,flexDirection:ol,onHover:te=>se(Vt.effectiveClass,te),onLeave:_e,onClick:te=>ye("align-items",Vt.originalClass,te),onRemove:Vt.hasValue?()=>ye("align-items",Vt.originalClass,""):void 0,onRemoveHover:Vt.hasValue?()=>se(Vt.effectiveClass,""):void 0})]}),a.jsx("div",{className:"h-px w-full bg-bv-border opacity-50 my-2"}),a.jsx(U0,{slots:Bm,onSlotHover:(te,pe)=>{const Ku=te==="gap"?oo:te==="gap-x"?lo:so;pe===null?l.revertPreview():l.preview(Ku.effectiveClass,pe)},onSlotRemoveHover:te=>{const pe=te==="gap"?oo:te==="gap-x"?lo:so;pe.hasValue&&l.preview(pe.effectiveClass,"")},onSlotChange:(te,pe)=>{ye(te,(te==="gap"?oo:te==="gap-x"?lo:so).originalClass,pe)},onSlotRemove:te=>{const pe=te==="gap"?oo:te==="gap-x"?lo:so;pe.hasValue&&(l.preview(pe.effectiveClass,""),ye(te,pe.originalClass,""))}})]})})(),K.map(I=>{var Q,U;if(tt){const G=Hn[I.fullClass];if(G&&ee.has(G.propertyKey)||ee.has(I.property))return null}if(I.scaleName!==void 0){const G=hr(Ld(I),I.scaleName,o);if(G.length>0){const ce=((Q=N.find(oe=>oe.property===I.property))==null?void 0:Q.newClass)??null;return a.jsx(xn,{values:G,currentValue:I.fullClass,lockedValue:ce,locked:!1,onStart:()=>he("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:oe=>pr(I,oe),onLeave:()=>no(),onClick:oe=>ye(I.property,I.fullClass,oe),onRemoveHover:()=>l.preview(I.fullClass,""),onRemove:()=>ye(I.property,I.fullClass,"")},I.fullClass)}}if(I.scaleName===void 0&&I.color===void 0){const G=Hn[I.fullClass];if(G){const ce=((U=N.find(oe=>oe.property===G.propertyKey))==null?void 0:U.newClass)??null;return a.jsx(xn,{values:G.alternatives,currentValue:I.fullClass,lockedValue:ce,locked:!1,onStart:()=>he("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:oe=>pr(I,oe),onLeave:()=>no(),onClick:oe=>ye(G.propertyKey,I.fullClass,oe),onRemoveHover:()=>l.preview(I.fullClass,""),onRemove:()=>ye(G.propertyKey,I.fullClass,"")},I.fullClass)}}return a.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||(x==null?void 0:x.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:G=>to(I,G.currentTarget),children:[I.fullClass,a.jsx("span",{className:"opacity-0 group-hover:opacity-60 hover:!opacity-100 ml-0.5 shrink-0",title:"Remove class",onClick:G=>{G.stopPropagation(),ye(I.property,I.fullClass,"")},onMouseEnter:G=>{G.stopPropagation(),l.preview(I.fullClass,"")},onMouseLeave:G=>{G.stopPropagation(),l.revertPreview()},children:a.jsxs("svg",{viewBox:"0 0 10 10",width:"8",height:"8",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"}),a.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"})]})})]},I.fullClass)}),Us.filter(I=>!(tt&&fe.has(I))).map(I=>{const Q=Wl(I);if(!Q)return null;if(Q.valueType==="scalar"){const U=hr(I,Q.scaleName,o);if(U.length===0)return null;const G=N.find(ce=>ce.property===Q.stagingKey);return a.jsx(xn,{values:U,currentValue:(G==null?void 0:G.newClass)??U[Math.floor(U.length/2)],lockedValue:(G==null?void 0:G.newClass)??null,locked:!1,onStart:()=>he("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:ce=>Ft(I,ce),onLeave:()=>Kn(),onClick:ce=>q(I,ce)},`staged-${I}`)}if(Q.valueType==="enum"&&Q.enumAlts){const U=N.find(G=>G.property===Q.stagingKey);return a.jsx(xn,{values:Q.enumAlts,currentValue:(U==null?void 0:U.newClass)??Q.enumAlts[0],lockedValue:(U==null?void 0:U.newClass)??null,locked:!1,onStart:()=>he("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:G=>Ft(I,G),onLeave:()=>Kn(),onClick:G=>q(I,G)},`staged-${I}`)}return null}),Bs.filter(I=>!(tt&&fe.has(I))).map(I=>{const Q=Wl(I);if(!Q)return null;if(Q.valueType==="scalar"){const U=hr(I,Q.scaleName,o);if(U.length>0)return a.jsx(xn,{values:U,currentValue:U[Math.floor(U.length/2)],lockedValue:null,locked:!1,ghost:!0,onStart:()=>he("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:G=>Ft(I,G),onLeave:()=>Kn(),onClick:G=>q(I,G)},`pending-${I}`)}return Q.valueType==="enum"&&Q.enumAlts?a.jsx(xn,{values:Q.enumAlts,currentValue:Q.enumAlts[0],lockedValue:null,locked:!1,ghost:!0,onStart:()=>he("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:U=>Ft(I,U),onLeave:()=>Kn(),onClick:U=>q(I,U)},`pending-${I}`):Q.valueType==="color"?a.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:U=>{b({cls:{property:"text",fullClass:"",section:"typography",color:""},anchorEl:U.currentTarget}),i(null)},children:[I==="text-color"?"text-":I,"color"]},`pending-${I}`):null})]},E)})]})}const m1=w.lazy(()=>ky(()=>import("./DesignMode-B-h8ycdz.js"),[]).then(e=>({default:e.DesignMode}))),h1=new URLSearchParams(window.location.search),g1=h1.get("mode"),Ad=[{id:"design",label:"Design"},{id:"draw",label:"Draw"},{id:"message",label:"Message"}];function y1(){return g1==="design"?a.jsx(w.Suspense,{fallback:null,children:a.jsx(m1,{})}):a.jsx(v1,{})}function v1(){const[e,t]=w.useState(!1),[n,r]=w.useState(null),[o,l]=w.useState(0),[s,i]=w.useState("design"),[u,c]=w.useState(!1),d=wv();w.useEffect(()=>{const P=Jy(()=>{t(!0);try{const H=localStorage.getItem("tw-panel-container");H&&H!=="popover"&&he("overlay",{type:"SWITCH_CONTAINER",container:H})}catch{}}),A=qy(()=>t(!1)),X=tm(H=>{H.type==="RESET_SELECTION"?(r(null),l(ne=>ne+1)):H.type==="ELEMENT_SELECTED"?(r({componentName:H.componentName,instanceCount:H.instanceCount,classes:H.classes,parsedClasses:Dy(H.classes,Xy),tailwindConfig:H.tailwindConfig}),l(ne=>ne+1),c(!1)):H.type==="SELECT_MODE_CHANGED"?c(!!H.active):H.type==="QUEUE_UPDATE"?d.handleQueueUpdate({draftCount:H.draftCount,committedCount:H.committedCount,implementingCount:H.implementingCount,implementedCount:H.implementedCount,partialCount:H.partialCount,errorCount:H.errorCount,draft:H.draft,commits:H.commits,agentWaiting:H.agentWaiting}):H.type==="PATCH_UPDATE"&&d.handlePatchUpdate({staged:H.staged,committed:H.committed,implementing:H.implementing,implemented:H.implemented,patches:H.patches})});return em(),t(ev()),()=>{P(),A(),X()}},[]);const{draft:p,committed:f,implementing:g,implemented:x,partial:b,error:S}=d.counts,m=f>0&&!d.agentWaiting&&g===0,h=new Map(d.patches.filter(P=>P.status==="staged").map(P=>[P.id,{id:P.id,kind:P.kind??"class-change",elementKey:P.elementKey,status:P.status,originalClass:P.originalClass,newClass:P.newClass,property:P.property,timestamp:P.timestamp,component:P.component,message:P.message,image:P.image}])),y=new Set(d.queueState.draft.map(P=>P.id)),v=[...d.queueState.draft.map(P=>h.get(P.id)??P),...d.patches.filter(P=>P.status==="staged"&&!y.has(P.id)).map(P=>h.get(P.id))],C=d.queueState.commits.filter(P=>P.status==="committed"),k=d.queueState.commits.filter(P=>P.status==="implementing"),j=d.queueState.commits.filter(P=>P.status==="implemented"),T="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"){_(P);return}}catch{}navigator.clipboard.writeText(P).catch(()=>_(P))}else _(P)}function _(P){const A=document.createElement("textarea");A.value=P,A.style.position="fixed",A.style.opacity="0",document.body.appendChild(A),A.select(),document.execCommand("copy"),document.body.removeChild(A)}const W=a.jsxs("div",{className:"shrink-0",children:[!e&&a.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:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-bv-orange animate-pulse shrink-0"}),a.jsxs("span",{className:"flex-1 leading-tight",children:["No agent listening —"," ",a.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!"]}),a.jsx("button",{onClick:()=>$(T),className:"shrink-0 px-1.5 py-0.5 rounded border border-amber-700/50 bg-amber-900/40 hover:bg-amber-800/40 text-amber-300 font-semibold text-[9px] transition-colors",title:`Copy: "${T}"`,children:"Copy prompt"})]}),m&&a.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:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"currentColor",className:"shrink-0 text-amber-400",children:a.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"})}),a.jsxs("span",{className:"flex-1 leading-tight",children:["No agent watching —"," ",a.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"]}),a.jsx("button",{onClick:()=>$(T),className:"shrink-0 px-1.5 py-0.5 rounded border border-amber-700/50 bg-amber-900/40 hover:bg-amber-800/40 text-amber-300 font-semibold text-[9px] transition-colors",title:`Copy: "${T}"`,children:"Copy prompt"})]}),a.jsxs("div",{className:"flex items-center justify-center px-3 py-1.5 border-t border-bv-border gap-3 text-[10px]",children:[a.jsx(Sl,{label:"draft",count:p,items:v,activeColor:"text-amber-400",onDiscard:P=>d.discard(P),onCommitAll:()=>d.commitAll(),onDiscardAll:()=>d.discardAll()}),a.jsx(Sl,{label:"committed",count:f,items:C.flatMap(P=>P.patches),activeColor:"text-bv-orange"}),a.jsx(Sl,{label:"implementing",count:g,items:k.flatMap(P=>P.patches),activeColor:"text-blue-400"}),a.jsx(Sl,{label:"implemented",count:x,items:j.flatMap(P=>P.patches),activeColor:"text-bv-teal"})]})]});if(!n)return a.jsxs("div",{className:"h-full flex flex-col",children:[a.jsx("div",{className:"px-3 pt-3 pb-2 border-b border-bv-border",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(Od,{active:u,onToggle:()=>{const P=!u;c(P),he("overlay",{type:"TOGGLE_SELECT_MODE",active:P})}}),a.jsx("div",{className:"flex-1 min-w-0",children:u?a.jsx("span",{className:"text-[11px] text-bv-teal font-medium",children:"● Selecting… click an element on the page"}):a.jsx("span",{className:"text-[12px] text-bv-muted",children:"No element selected"})}),a.jsx(Jc,{})]})}),a.jsx(rd,{tabs:Ad,activeTab:s,onTabChange:i}),a.jsx("div",{className:"flex-1 overflow-auto",children:s==="draw"?a.jsx(td,{}):s==="message"?a.jsx(nd,{draft:v,currentElementKey:"",onAddMessage:(P,A)=>d.stageMessage(P,A),onDiscard:P=>d.discard(P)}):u?a.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 p-8",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-bv-teal text-white flex items-center justify-center",children:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"currentColor",children:[a.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"}),a.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.jsx("span",{className:"text-[12px] text-bv-teal font-medium",children:"Selection mode active"}),a.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.",a.jsx("br",{}),"Press"," ",a.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."]})]}):a.jsx("div",{className:"flex flex-1 flex-col justify-center p-4",children:a.jsxs("button",{onClick:()=>{c(!0),he("overlay",{type:"TOGGLE_SELECT_MODE",active:!0})},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:[a.jsx("div",{className:"w-14 h-14 rounded-full bg-bv-teal/10 text-bv-teal flex items-center justify-center",children:a.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 64 64",fill:"currentColor",children:[a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"})]})}),a.jsx("span",{className:"text-[12px] text-bv-text font-medium",children:"Select an element to inspect"}),a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.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:"⌘"}),a.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:"⇧"}),a.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"})]})]})})}),W]});const O=n.parsedClasses;return a.jsxs("div",{className:"h-full flex flex-col",children:[a.jsx("div",{className:"px-3 pt-3 pb-2 border-b border-bv-border",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx(Od,{active:u,onToggle:()=>{const P=!u;c(P),he("overlay",{type:"TOGGLE_SELECT_MODE",active:P})}}),a.jsxs("div",{className:"font-[family-name:var(--font-display)] font-bold text-[13px] text-bv-text leading-tight truncate",children:[n.componentName," ",a.jsxs("span",{className:"font-[family-name:var(--font-ui)] font-normal text-bv-text-mid",children:["— ",n.instanceCount," instance",n.instanceCount!==1?"s":""]})]})]}),a.jsx(Jc,{})]})}),a.jsx(rd,{tabs:Ad,activeTab:s,onTabChange:i}),a.jsxs("div",{className:"flex-1 overflow-auto",children:[s==="design"&&a.jsx(p1,{componentName:n.componentName,instanceCount:n.instanceCount,rawClasses:n.classes,parsedClasses:O,tailwindConfig:n.tailwindConfig,patchManager:d},o),s==="draw"&&a.jsx(td,{}),s==="message"&&a.jsx(nd,{draft:v,currentElementKey:n.componentName,onAddMessage:(P,A)=>d.stageMessage(P,A,n.componentName),onDiscard:P=>d.discard(P)})]}),W]})}function Od({active:e,onToggle:t}){return a.jsx("button",{onClick:t,title:`${e?"Stop selecting":"Select an element"} (⌘⇧C)`,className:`w-7 h-7 rounded flex items-center justify-center shrink-0 border transition-all
|
|
62
|
+
${e?"bg-bv-teal border-bv-teal text-white":"bg-transparent border-bv-border text-bv-text-mid hover:border-bv-teal hover:text-bv-teal hover:bg-bv-teal/10"}`,children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[a.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"}),a.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"})]})})}Oi.createRoot(document.getElementById("root")).render(a.jsx(Ud.StrictMode,{children:a.jsx(y1,{})}));export{tm as a,em as c,a as j,Jy as o,w as r,_r as s};
|