easel-canvas 0.2.1 → 0.3.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.
@@ -0,0 +1,70 @@
1
+ var Ab=Object.defineProperty;var Ob=(a,i,r)=>i in a?Ab(a,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[i]=r;var Dp=(a,i,r)=>Ob(a,typeof i!="symbol"?i+"":i,r);(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))f(h);new MutationObserver(h=>{for(const p of h)if(p.type==="childList")for(const y of p.addedNodes)y.tagName==="LINK"&&y.rel==="modulepreload"&&f(y)}).observe(document,{childList:!0,subtree:!0});function r(h){const p={};return h.integrity&&(p.integrity=h.integrity),h.referrerPolicy&&(p.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?p.credentials="include":h.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function f(h){if(h.ep)return;h.ep=!0;const p=r(h);fetch(h.href,p)}})();var Of={exports:{}},uc={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Rp;function Db(){if(Rp)return uc;Rp=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(f,h,p){var y=null;if(p!==void 0&&(y=""+p),h.key!==void 0&&(y=""+h.key),"key"in h){p={};for(var N in h)N!=="key"&&(p[N]=h[N])}else p=h;return h=p.ref,{$$typeof:a,type:f,key:y,ref:h!==void 0?h:null,props:p}}return uc.Fragment=i,uc.jsx=r,uc.jsxs=r,uc}var $p;function Rb(){return $p||($p=1,Of.exports=Db()),Of.exports}var o=Rb(),Df={exports:{}},Ye={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Bp;function $b(){if(Bp)return Ye;Bp=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),y=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),T=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),C=Symbol.for("react.view_transition"),O=Symbol.iterator;function X(D){return D===null||typeof D!="object"?null:(D=O&&D[O]||D["@@iterator"],typeof D=="function"?D:null)}var ee={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,$={};function J(D,G,oe){this.props=D,this.context=G,this.refs=$,this.updater=oe||ee}J.prototype.isReactComponent={},J.prototype.setState=function(D,G){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,G,"setState")},J.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function Q(){}Q.prototype=J.prototype;function q(D,G,oe){this.props=D,this.context=G,this.refs=$,this.updater=oe||ee}var I=q.prototype=new Q;I.constructor=q,k(I,J.prototype),I.isPureReactComponent=!0;var ce=Array.isArray;function se(){}var P={H:null,A:null,T:null,S:null},re=Object.prototype.hasOwnProperty;function Se(D,G,oe){var _=oe.ref;return{$$typeof:a,type:D,key:G,ref:_!==void 0?_:null,props:oe}}function Ne(D,G){return Se(D.type,G,D.props)}function mt(D){return typeof D=="object"&&D!==null&&D.$$typeof===a}function Ct(D){var G={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(oe){return G[oe]})}var _t=/\/+/g;function st(D,G){return typeof D=="object"&&D!==null&&D.key!=null?Ct(""+D.key):G.toString(36)}function fe(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(se,se):(D.status="pending",D.then(function(G){D.status==="pending"&&(D.status="fulfilled",D.value=G)},function(G){D.status==="pending"&&(D.status="rejected",D.reason=G)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function ye(D,G,oe,_,ge){var je=typeof D;(je==="undefined"||je==="boolean")&&(D=null);var He=!1;if(D===null)He=!0;else switch(je){case"bigint":case"string":case"number":He=!0;break;case"object":switch(D.$$typeof){case a:case i:He=!0;break;case v:return He=D._init,ye(He(D._payload),G,oe,_,ge)}}if(He)return ge=ge(D),He=_===""?"."+st(D,0):_,ce(ge)?(oe="",He!=null&&(oe=He.replace(_t,"$&/")+"/"),ye(ge,G,oe,"",function(rt){return rt})):ge!=null&&(mt(ge)&&(ge=Ne(ge,oe+(ge.key==null||D&&D.key===ge.key?"":(""+ge.key).replace(_t,"$&/")+"/")+He)),G.push(ge)),1;He=0;var me=_===""?".":_+":";if(ce(D))for(var ve=0;ve<D.length;ve++)_=D[ve],je=me+st(_,ve),He+=ye(_,G,oe,je,ge);else if(ve=X(D),typeof ve=="function")for(D=ve.call(D),ve=0;!(_=D.next()).done;)_=_.value,je=me+st(_,ve++),He+=ye(_,G,oe,je,ge);else if(je==="object"){if(typeof D.then=="function")return ye(fe(D),G,oe,_,ge);throw G=String(D),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return He}function xe(D,G,oe){if(D==null)return D;var _=[],ge=0;return ye(D,_,"","",function(je){return G.call(oe,je,ge++)}),_}function _e(D){if(D._status===-1){var G=D._result,oe=G();oe.then(function(_){(D._status===0||D._status===-1)&&(D._status=1,D._result=_,oe.status===void 0&&(oe.status="fulfilled",oe.value=_))},function(_){(D._status===0||D._status===-1)&&(D._status=2,D._result=_,oe.status===void 0&&(oe.status="rejected",oe.reason=_))}),D._status===-1&&(D._status=0,D._result=oe)}if(D._status===1)return D._result.default;throw D._result}var ke=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)};function xt(D){var G=P.T,oe={};oe.types=G!==null?G.types:null,P.T=oe;try{var _=D(),ge=P.S;ge!==null&&ge(oe,_),typeof _=="object"&&_!==null&&typeof _.then=="function"&&_.then(se,ke)}catch(je){ke(je)}finally{G!==null&&oe.types!==null&&(G.types=oe.types),P.T=G}}function Ke(D){var G=P.T;if(G!==null){var oe=G.types;oe===null?G.types=[D]:oe.indexOf(D)===-1&&oe.push(D)}else xt(Ke.bind(null,D))}var Pe={map:xe,forEach:function(D,G,oe){xe(D,function(){G.apply(this,arguments)},oe)},count:function(D){var G=0;return xe(D,function(){G++}),G},toArray:function(D){return xe(D,function(G){return G})||[]},only:function(D){if(!mt(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Ye.Activity=x,Ye.Children=Pe,Ye.Component=J,Ye.Fragment=r,Ye.Profiler=h,Ye.PureComponent=q,Ye.StrictMode=f,Ye.Suspense=S,Ye.ViewTransition=C,Ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,Ye.__COMPILER_RUNTIME={__proto__:null,c:function(D){return P.H.useMemoCache(D)}},Ye.addTransitionType=Ke,Ye.cache=function(D){return function(){return D.apply(null,arguments)}},Ye.cacheSignal=function(){return null},Ye.cloneElement=function(D,G,oe){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var _=k({},D.props),ge=D.key;if(G!=null)for(je in G.key!==void 0&&(ge=""+G.key),G)!re.call(G,je)||je==="key"||je==="__self"||je==="__source"||je==="ref"&&G.ref===void 0||(_[je]=G[je]);var je=arguments.length-2;if(je===1)_.children=oe;else if(1<je){for(var He=Array(je),me=0;me<je;me++)He[me]=arguments[me+2];_.children=He}return Se(D.type,ge,_)},Ye.createContext=function(D){return D={$$typeof:y,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:p,_context:D},D},Ye.createElement=function(D,G,oe){var _,ge={},je=null;if(G!=null)for(_ in G.key!==void 0&&(je=""+G.key),G)re.call(G,_)&&_!=="key"&&_!=="__self"&&_!=="__source"&&(ge[_]=G[_]);var He=arguments.length-2;if(He===1)ge.children=oe;else if(1<He){for(var me=Array(He),ve=0;ve<He;ve++)me[ve]=arguments[ve+2];ge.children=me}if(D&&D.defaultProps)for(_ in He=D.defaultProps,He)ge[_]===void 0&&(ge[_]=He[_]);return Se(D,je,ge)},Ye.createRef=function(){return{current:null}},Ye.forwardRef=function(D){return{$$typeof:N,render:D}},Ye.isValidElement=mt,Ye.lazy=function(D){return{$$typeof:v,_payload:{_status:-1,_result:D},_init:_e}},Ye.memo=function(D,G){return{$$typeof:T,type:D,compare:G===void 0?null:G}},Ye.startTransition=xt,Ye.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},Ye.use=function(D){return P.H.use(D)},Ye.useActionState=function(D,G,oe){return P.H.useActionState(D,G,oe)},Ye.useCallback=function(D,G){return P.H.useCallback(D,G)},Ye.useContext=function(D){return P.H.useContext(D)},Ye.useDebugValue=function(){},Ye.useDeferredValue=function(D,G){return P.H.useDeferredValue(D,G)},Ye.useEffect=function(D,G){return P.H.useEffect(D,G)},Ye.useEffectEvent=function(D){return P.H.useEffectEvent(D)},Ye.useId=function(){return P.H.useId()},Ye.useImperativeHandle=function(D,G,oe){return P.H.useImperativeHandle(D,G,oe)},Ye.useInsertionEffect=function(D,G){return P.H.useInsertionEffect(D,G)},Ye.useLayoutEffect=function(D,G){return P.H.useLayoutEffect(D,G)},Ye.useMemo=function(D,G){return P.H.useMemo(D,G)},Ye.useOptimistic=function(D,G){return P.H.useOptimistic(D,G)},Ye.useReducer=function(D,G,oe){return P.H.useReducer(D,G,oe)},Ye.useRef=function(D){return P.H.useRef(D)},Ye.useState=function(D){return P.H.useState(D)},Ye.useSyncExternalStore=function(D,G,oe){return P.H.useSyncExternalStore(D,G,oe)},Ye.useTransition=function(){return P.H.useTransition()},Ye.version="19.3.0",Ye}var _p;function ch(){return _p||(_p=1,Df.exports=$b()),Df.exports}var w=ch(),Rf={exports:{}},dc={},$f={exports:{}},Bf={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Hp;function Bb(){return Hp||(Hp=1,(function(a){function i(fe,ye){var xe=fe.length;fe.push(ye);e:for(;0<xe;){var _e=xe-1>>>1,ke=fe[_e];if(0<h(ke,ye))fe[_e]=ye,fe[xe]=ke,xe=_e;else break e}}function r(fe){return fe.length===0?null:fe[0]}function f(fe){if(fe.length===0)return null;var ye=fe[0],xe=fe.pop();if(xe!==ye){fe[0]=xe;e:for(var _e=0,ke=fe.length,xt=ke>>>1;_e<xt;){var Ke=2*(_e+1)-1,Pe=fe[Ke],D=Ke+1,G=fe[D];if(0>h(Pe,xe))D<ke&&0>h(G,Pe)?(fe[_e]=G,fe[D]=xe,_e=D):(fe[_e]=Pe,fe[Ke]=xe,_e=Ke);else if(D<ke&&0>h(G,xe))fe[_e]=G,fe[D]=xe,_e=D;else break e}}return ye}function h(fe,ye){var xe=fe.sortIndex-ye.sortIndex;return xe!==0?xe:fe.id-ye.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;a.unstable_now=function(){return p.now()}}else{var y=Date,N=y.now();a.unstable_now=function(){return y.now()-N}}var S=[],T=[],v=1,x=null,C=3,O=!1,X=!1,ee=!1,k=!1,$=typeof setTimeout=="function"?setTimeout:null,J=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function q(fe){for(var ye=r(T);ye!==null;){if(ye.callback===null)f(T);else if(ye.startTime<=fe)f(T),ye.sortIndex=ye.expirationTime,i(S,ye);else break;ye=r(T)}}function I(fe){if(ee=!1,q(fe),!X)if(r(S)!==null)X=!0,ce||(ce=!0,mt());else{var ye=r(T);ye!==null&&st(I,ye.startTime-fe)}}var ce=!1,se=-1,P=5,re=-1;function Se(){return k?!0:!(a.unstable_now()-re<P)}function Ne(){if(k=!1,ce){var fe=a.unstable_now();re=fe;var ye=!0;try{e:{X=!1,ee&&(ee=!1,J(se),se=-1),O=!0;var xe=C;try{t:{for(q(fe),x=r(S);x!==null&&!(x.expirationTime>fe&&Se());){var _e=x.callback;if(typeof _e=="function"){x.callback=null,C=x.priorityLevel;var ke=_e(x.expirationTime<=fe);if(fe=a.unstable_now(),typeof ke=="function"){x.callback=ke,q(fe),ye=!0;break t}x===r(S)&&f(S),q(fe)}else f(S);x=r(S)}if(x!==null)ye=!0;else{var xt=r(T);xt!==null&&st(I,xt.startTime-fe),ye=!1}}break e}finally{x=null,C=xe,O=!1}ye=void 0}}finally{ye?mt():ce=!1}}}var mt;if(typeof Q=="function")mt=function(){Q(Ne)};else if(typeof MessageChannel<"u"){var Ct=new MessageChannel,_t=Ct.port2;Ct.port1.onmessage=Ne,mt=function(){_t.postMessage(null)}}else mt=function(){$(Ne,0)};function st(fe,ye){se=$(function(){fe(a.unstable_now())},ye)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(fe){fe.callback=null},a.unstable_forceFrameRate=function(fe){0>fe||125<fe?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<fe?Math.floor(1e3/fe):5},a.unstable_getCurrentPriorityLevel=function(){return C},a.unstable_next=function(fe){switch(C){case 1:case 2:case 3:var ye=3;break;default:ye=C}var xe=C;C=ye;try{return fe()}finally{C=xe}},a.unstable_requestPaint=function(){k=!0},a.unstable_runWithPriority=function(fe,ye){switch(fe){case 1:case 2:case 3:case 4:case 5:break;default:fe=3}var xe=C;C=fe;try{return ye()}finally{C=xe}},a.unstable_scheduleCallback=function(fe,ye,xe){var _e=a.unstable_now();switch(typeof xe=="object"&&xe!==null?(xe=xe.delay,xe=typeof xe=="number"&&0<xe?_e+xe:_e):xe=_e,fe){case 1:var ke=-1;break;case 2:ke=250;break;case 5:ke=1073741823;break;case 4:ke=1e4;break;default:ke=5e3}return ke=xe+ke,fe={id:v++,callback:ye,priorityLevel:fe,startTime:xe,expirationTime:ke,sortIndex:-1},xe>_e?(fe.sortIndex=xe,i(T,fe),r(S)===null&&fe===r(T)&&(ee?(J(se),se=-1):ee=!0,st(I,xe-_e))):(fe.sortIndex=ke,i(S,fe),X||O||(X=!0,ce||(ce=!0,mt()))),fe},a.unstable_shouldYield=Se,a.unstable_wrapCallback=function(fe){var ye=C;return function(){var xe=C;C=ye;try{return fe.apply(this,arguments)}finally{C=xe}}}})(Bf)),Bf}var Up;function _b(){return Up||(Up=1,$f.exports=Bb()),$f.exports}var _f={exports:{}},_n={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Lp;function Hb(){if(Lp)return _n;Lp=1;var a=ch();function i(v){var x="https://react.dev/errors/"+v;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)x+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+v+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var f={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},h=Symbol.for("react.portal"),p=Symbol.for("react.recoverable"),y=Symbol.for("react.optimistic_key");function N(v,x,C){var O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:O==null?null:O===y?y:""+O,children:v,containerInfo:x,implementation:C}}var S=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function T(v,x){if(v==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return _n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=f,_n.browser=function(v){return{$$typeof:p,_reason:v}},_n.createPortal=function(v,x){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(i(299));return N(v,x,null,C)},_n.flushSync=function(v){var x=S.T,C=f.p;try{if(S.T=null,f.p=2,v)return v()}finally{S.T=x,f.p=C,f.d.f()}},_n.preconnect=function(v,x){typeof v=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,f.d.C(v,x))},_n.prefetchDNS=function(v){typeof v=="string"&&f.d.D(v)},_n.preinit=function(v,x){if(typeof v=="string"&&x&&typeof x.as=="string"){var C=x.as,O=T(C,x.crossOrigin),X=typeof x.integrity=="string"?x.integrity:void 0,ee=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;C==="style"?f.d.S(v,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:O,integrity:X,fetchPriority:ee}):C==="script"&&f.d.X(v,{crossOrigin:O,integrity:X,fetchPriority:ee,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},_n.preinitModule=function(v,x){if(typeof v=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var C=T(x.as,x.crossOrigin);f.d.M(v,{crossOrigin:C,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0})}}else x==null&&f.d.M(v)},_n.preload=function(v,x){if(typeof v=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var C=x.as,O=T(C,x.crossOrigin);f.d.L(v,C,{crossOrigin:O,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},_n.preloadModule=function(v,x){if(typeof v=="string")if(x){var C=T(x.as,x.crossOrigin);f.d.m(v,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:C,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0})}else f.d.m(v)},_n.requestFormReset=function(v){f.d.r(v)},_n.unstable_batchedUpdates=function(v,x){return v(x)},_n.useFormState=function(v,x,C){return S.H.useFormState(v,x,C)},_n.useFormStatus=function(){return S.H.useHostTransitionStatus()},_n.version="19.3.0",_n}var Gp;function Ty(){if(Gp)return _f.exports;Gp=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),_f.exports=Hb(),_f.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Yp;function Ub(){if(Yp)return dc;Yp=1;var a=_b(),i=ch(),r=Ty();function f(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;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."}function h(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function p(e){for(var t=e,n=t;n&&!n.alternate;)t=n,(t.flags&4098)!==0&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function y(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 N(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function S(e){if(p(e)!==e)throw Error(f(188))}function T(e){var t=e.alternate;if(!t){if(t=p(e),t===null)throw Error(f(188));return t!==e?null:e}for(var n=e,l=t;;){var s=n.return;if(s===null)break;var c=s.alternate;if(c===null){if(l=s.return,l!==null){n=l;continue}break}if(s.child===c.child){for(c=s.child;c;){if(c===n)return S(s),e;if(c===l)return S(s),t;c=c.sibling}throw Error(f(188))}if(n.return!==l.return)n=s,l=c;else{for(var m=!1,j=s.child;j;){if(j===n){m=!0,n=s,l=c;break}if(j===l){m=!0,l=s,n=c;break}j=j.sibling}if(!m){for(j=c.child;j;){if(j===n){m=!0,n=c,l=s;break}if(j===l){m=!0,l=c,n=s;break}j=j.sibling}if(!m)throw Error(f(189))}}if(n.alternate!==l)throw Error(f(190))}if(n.tag!==3)throw Error(f(188));return n.stateNode.current===n?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}function x(e,t,n,l,s,c){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,l,s,c)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&x(e.child,t,n,l,s,c))return!0;e=e.sibling}return!1}function C(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function O(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function X(e){var t=[null,null],n=C(e);return n===null||ee(t,e,n.child,{foundSelf:!1}),t}function ee(e,t,n,l){for(;n!==null;){if(n===t)l.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(l.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&ee(e,t,n.child,l))return!0;n=n.sibling}return!1}function k(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(f(559))}}var $=null,J=null;function Q(e,t,n){return e===n?!0:e===t?($=e,!0):!1}function q(e,t,n){return e===n?(J=e,!1):e===t?(J!==null&&($=e),!0):!1}function I(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function ce(e,t,n){for(var l=0,s=e;s;s=n(s))l++;s=0;for(var c=t;c;c=n(c))s++;for(;0<l-s;)e=n(e),l--;for(;0<s-l;)t=n(t),s--;for(;l--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var se=Object.assign,P=Symbol.for("react.element"),re=Symbol.for("react.transitional.element"),Se=Symbol.for("react.portal"),Ne=Symbol.for("react.fragment"),mt=Symbol.for("react.strict_mode"),Ct=Symbol.for("react.profiler"),_t=Symbol.for("react.consumer"),st=Symbol.for("react.context"),fe=Symbol.for("react.forward_ref"),ye=Symbol.for("react.suspense"),xe=Symbol.for("react.suspense_list"),_e=Symbol.for("react.memo"),ke=Symbol.for("react.lazy"),xt=Symbol.for("react.activity"),Ke=Symbol.for("react.legacy_hidden"),Pe=Symbol.for("react.memo_cache_sentinel"),D=Symbol.for("react.view_transition"),G=Symbol.for("react.recoverable"),oe=Symbol.iterator;function _(e){return e===null||typeof e!="object"?null:(e=oe&&e[oe]||e["@@iterator"],typeof e=="function"?e:null)}var ge=Symbol.for("react.client.reference");function je(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ge?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ne:return"Fragment";case Ct:return"Profiler";case mt:return"StrictMode";case ye:return"Suspense";case xe:return"SuspenseList";case xt:return"Activity";case D:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case Se:return"Portal";case st:return e.displayName||"Context";case _t:return(e._context.displayName||"Context")+".Consumer";case fe:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _e:return t=e.displayName||null,t!==null?t:je(e.type)||"Memo";case ke:t=e._payload,e=e._init;try{return je(e(t))}catch{}}return null}var He=Array.isArray,me=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,rt={pending:!1,data:null,method:null,action:null},Ea=[],Xn=-1;function jn(e){return{current:e}}function at(e){0>Xn||(e.current=Ea[Xn],Ea[Xn]=null,Xn--)}function Le(e,t){Xn++,Ea[Xn]=e.current,e.current=t}var xn=jn(null),Mn=jn(null),Kt=jn(null),sn=jn(null);function B(e,t){switch(Le(Kt,t),Le(Mn,e),Le(xn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Yg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Yg(t),e=qg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}at(xn),Le(xn,e)}function K(){at(xn),at(Mn),at(Kt)}function le(e){var t=e.memoizedState;t!==null&&(eo._currentValue=t.memoizedState,Le(sn,e)),t=xn.current;var n=qg(t,e.type);t!==n&&(Le(Mn,e),Le(xn,n))}function be(e){Mn.current===e&&(at(xn),at(Mn)),sn.current===e&&(at(sn),eo._currentValue=rt)}var Be,Fe;function De(e){if(Be===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Be=t&&t[1]||"",Fe=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Be+e+Fe}var Qe=!1;function Dt(e,t){if(!e||Qe)return"";Qe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(pe){var H=pe}Reflect.construct(e,[],ie)}else{try{ie.call()}catch(pe){H=pe}ie=!1;try{var V=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ie=!0,new e}finally{ie&&(V!==void 0?Object.defineProperty(e.prototype,"props",V):delete e.prototype.props)}}}else{try{throw Error()}catch(pe){H=pe}(ie=e())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(pe){if(pe&&H&&typeof pe.stack=="string")return[pe.stack,H.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=l.DetermineComponentFrameRoot(),m=c[0],j=c[1];if(m&&j){var A=m.split(`
44
+ `),L=j.split(`
45
+ `);for(s=l=0;l<A.length&&!A[l].includes("DetermineComponentFrameRoot");)l++;for(;s<L.length&&!L[s].includes("DetermineComponentFrameRoot");)s++;if(l===A.length||s===L.length)for(l=A.length-1,s=L.length-1;1<=l&&0<=s&&A[l]!==L[s];)s--;for(;1<=l&&0<=s;l--,s--)if(A[l]!==L[s]){if(l!==1||s!==1)do if(l--,s--,0>s||A[l]!==L[s]){var F=`
46
+ `+A[l].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),F}while(1<=l&&0<=s);break}}}finally{Qe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?De(n):""}function Ht(e,t){switch(e.tag){case 26:case 27:case 5:return De(e.type);case 16:return De("Lazy");case 13:return e.child!==t&&t!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return Dt(e.type,!1);case 11:return Dt(e.type.render,!1);case 1:return Dt(e.type,!0);case 31:return De("Activity");case 30:return De("ViewTransition");default:return""}}function Rt(e){try{var t="",n=null;do t+=Ht(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
47
+ Error generating stack: `+l.message+`
48
+ `+l.stack}}var Wt=Object.prototype.hasOwnProperty,et=a.unstable_scheduleCallback,on=a.unstable_cancelCallback,wt=a.unstable_shouldYield,St=a.unstable_requestPaint,Vt=a.unstable_now,gt=a.unstable_getCurrentPriorityLevel,cn=a.unstable_ImmediatePriority,na=a.unstable_UserBlockingPriority,Fa=a.unstable_NormalPriority,Ba=a.unstable_LowPriority,_a=a.unstable_IdlePriority,Ha=a.log,rn=a.unstable_setDisableYieldValue,Ln=null,Zt=null;function Kn(e){if(typeof Ha=="function"&&rn(e),Zt&&typeof Zt.setStrictMode=="function")try{Zt.setStrictMode(Ln,e)}catch{}}var hn=Math.clz32?Math.clz32:Ja,Sl=Math.log,Qt=Math.LN2;function Ja(e){return e>>>=0,e===0?32:31-(Sl(e)/Qt|0)|0}var Ia=256,Ua=262144,ma=4194304;function zn(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function aa(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var s=0,c=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var j=l&134217727;return j!==0?(l=j&~c,l!==0?s=zn(l):(m&=j,m!==0?s=zn(m):n||(n=j&~e,n!==0&&(s=zn(n))))):(j=l&~c,j!==0?s=zn(j):m!==0?s=zn(m):n||(n=l&~e,n!==0&&(s=zn(n)))),s===0?0:t!==0&&t!==s&&(t&c)===0&&(c=s&-s,n=t&-t,c>=n||c===32&&(n&4194048)!==0)?t:s}function Wa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function jl(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var l=31-hn(n),s=1<<l;t|=e[l],n&=~s}return t}function fs(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pa(){var e=ma;return ma<<=1,(ma&62914560)===0&&(ma=4194304),e}function Gl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function M(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function W(e,t,n,l,s,c){var m=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var j=e.entanglements,A=e.expirationTimes,L=e.hiddenUpdates;for(n=m&~n;0<n;){var F=31-hn(n),ie=1<<F;j[F]=0,A[F]=-1;var H=L[F];if(H!==null)for(L[F]=null,F=0;F<H.length;F++){var V=H[F];V!==null&&(V.lane&=-536870913)}n&=~ie}l!==0&&Me(e,l,0),c!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=c&~(m&~t))}function Me(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-hn(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function ue(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-hn(n),s=1<<l;s&t|e[l]&t&&(e[l]|=t),n&=~s}}function Re(e,t){var n=t&-t;return n=(n&42)!==0?1:$e(n),(n&(e.suspendedLanes|t))!==0?0:n}function $e(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ge(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Pt(){var e=ve.p;return e!==0?e:(e=window.event,e===void 0?32:Ep(e.type))}function Zn(e,t){var n=ve.p;try{return ve.p=e,t()}finally{ve.p=n}}var ut=Math.random().toString(36).slice(2),he="__reactFiber$"+ut,Mt="__reactProps$"+ut,Yl="__reactContainer$"+ut,ql="__reactEvents$"+ut,Qn="__reactListeners$"+ut,Mi="__reactHandles$"+ut,Ft="__reactResources$"+ut,el="__reactMarker$"+ut,Gn="__reactLoad$"+ut;function Nl(e){delete e[he],delete e[Mt],delete e[Qn],delete e[Mi]}function dt(e){var t;if(t=e[he])return t;for(var n=e.parentNode;n;){if(t=n[Yl]||n[he]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=sp(e);e!==null;){if(n=e[he])return n;e=sp(e)}return t}e=n,n=e.parentNode}return null}function zt(e){if(e=e[he]||e[Yl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function la(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(f(33))}function Yn(e){var t=e[Ft];return t||(t=e[Ft]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function un(e){e[el]=!0}function zi(e){e[Gn]=void 0}var oo=new Set,tl={};function Tl(e,t){qn(e,t),qn(e+"Capture",t)}function qn(e,t){for(tl[e]=t,e=0;e<t.length;e++)oo.add(t[e])}var nl=RegExp("^[: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]*$"),Sc={},co={};function jc(e){return Wt.call(co,e)?!0:Wt.call(Sc,e)?!1:nl.test(e)?co[e]=!0:(Sc[e]=!0,!1)}var ot=!1;function ro(){var e=ot;return ot=!1,e}function Ai(e,t,n){if(jc(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function Yt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,n)}}function wn(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,l)}}function ft(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Nc(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var s=l.get,c=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(m){n=""+m,c.call(this,m)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(m){n=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ia(e){if(!e._valueTracker){var t=Jt(e)?"checked":"value";e._valueTracker=Nc(e,t,""+e[t])}}function uo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Jt(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}var Tc=/[\n"\\]/g;function Fn(e){return e.replace(Tc,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function hs(e,t,n,l,s,c,m,j){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ft(t)):e.value!==""+ft(t)&&(e.value=""+ft(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?m==="number"&&e.value==t?Te(e,ft(e.value)):Te(e,ft(t)):n!=null?Te(e,ft(n)):l!=null&&e.removeAttribute("value"),s==null&&c!=null&&(e.defaultChecked=!!c),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+ft(j):e.removeAttribute("name")}function Oi(e,t,n,l,s,c,m,j){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){ia(e);return}n=n!=null?""+ft(n):"",t=t!=null?""+ft(t):n,j||t===e.value||(e.value=t),e.defaultValue=t}l=l??s,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=j?e.checked:!!l,e.defaultChecked=!!l,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),ia(e)}function Te(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function El(e,t,n,l){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&l&&(e[n].defaultSelected=!0)}else{for(n=""+ft(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,l&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function fo(e,t,n){if(t!=null&&(t=""+ft(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+ft(n):""}function $t(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(f(92));if(He(l)){if(1<l.length)throw Error(f(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=ft(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),ia(e)}function mn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var kl=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function en(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||kl.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function ms(e,t,n){if(t!=null&&typeof t!="object")throw Error(f(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="",ot=!0);for(var s in t)l=t[s],t.hasOwnProperty(s)&&n[s]!==l&&(en(e,s,l),ot=!0)}else for(var c in t)t.hasOwnProperty(c)&&en(e,c,t[c])}function dn(e){if(e.indexOf("-")===-1)return!1;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 pu=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),yu=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Jn(e){return yu.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ga(){}var ho=null;function al(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var sa=null,pa=null;function Vl(e){var t=zt(e);if(t&&(e=t.stateNode)){var n=e[Mt]||null;e:switch(e=t.stateNode,t.type){case"input":if(hs(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Fn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var s=l[Mt]||null;if(!s)throw Error(f(90));hs(l,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&uo(l)}break e;case"textarea":fo(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&El(e,!!n.multiple,t,!1)}}}var ka=!1;function Xl(e,t,n){if(ka)return e(t,n);ka=!0;try{var l=e(t);return l}finally{if(ka=!1,(sa!==null||pa!==null)&&(Br(),sa&&(t=sa,e=pa,pa=sa=null,Vl(t),e)))for(t=0;t<e.length;t++)Vl(e[t])}}function ll(e,t){var n=e.stateNode;if(n===null)return null;var l=n[Mt]||null;if(l===null)return null;n=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(f(231,t,typeof n));return n}var oa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Di=!1;if(oa)try{var il={};Object.defineProperty(il,"passive",{get:function(){Di=!0}}),window.addEventListener("test",il,il),window.removeEventListener("test",il,il)}catch{Di=!1}var La=null,mo=null,gs=null;function ca(){if(gs)return gs;var e,t=mo,n=t.length,l,s="value"in La?La.value:La.textContent,c=s.length;for(e=0;e<n&&t[e]===s[e];e++);var m=n-e;for(l=1;l<=m&&t[n-l]===s[c-l];l++);return gs=s.slice(e,1<l?1-l:void 0)}function Ri(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 ya(){return!0}function Ec(){return!1}function gn(e){function t(n,l,s,c,m){this._reactName=n,this._targetInst=s,this.type=l,this.nativeEvent=c,this.target=m,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(n=e[j],this[j]=n?n(c):c[j]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?ya:Ec,this.isPropagationStopped=Ec,this}return se(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=ya)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ya)},persist:function(){},isPersistent:ya}),t}var sl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$i=gn(sl),Cl=se({},sl,{view:0,detail:0}),Bi=gn(Cl),Ca,ps,Kl,_i=se({},Cl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xs,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!==Kl&&(Kl&&e.type==="mousemove"?(Ca=e.screenX-Kl.screenX,ps=e.screenY-Kl.screenY):ps=Ca=0,Kl=e),Ca)},movementY:function(e){return"movementY"in e?e.movementY:ps}}),Hi=gn(_i),ys=se({},_i,{dataTransfer:0}),vs=gn(ys),vu=se({},Cl,{relatedTarget:0}),bs=gn(vu),Zl=se({},sl,{animationName:0,elapsedTime:0,pseudoElement:0}),bu=gn(Zl),xu=se({},sl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),wu=gn(xu),go=se({},sl,{data:0}),kc=gn(go),Su={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Cc={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"},ju={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ui(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ju[e])?!!t[e]:!1}function xs(){return Ui}var Ql=se({},Cl,{key:function(e){if(e.key){var t=Su[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ri(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Cc[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xs,charCode:function(e){return e.type==="keypress"?Ri(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ri(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Fl=gn(Ql),Nu=se({},_i,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mc=gn(Nu),zc=se({},sl,{submitter:0}),Tu=gn(zc),Eu=se({},Cl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xs}),ku=gn(Eu),Ac=se({},sl,{propertyName:0,elapsedTime:0,pseudoElement:0}),ol=gn(Ac),Oc=se({},_i,{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}),Dc=gn(Oc),Rc=se({},sl,{newState:0,oldState:0,source:0}),Nn=gn(Rc),$c=[9,13,27,32],Li=oa&&"CompositionEvent"in window,Gi=null;oa&&"documentMode"in document&&(Gi=document.documentMode);var Cu=oa&&"TextEvent"in window&&!Gi,Bc=oa&&(!Li||Gi&&8<Gi&&11>=Gi),po=" ",_c=!1;function Hc(e,t){switch(e){case"keyup":return $c.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jl=!1;function Mu(e,t){switch(e){case"compositionend":return yo(t);case"keypress":return t.which!==32?null:(_c=!0,po);case"textInput":return e=t.data,e===po&&_c?null:e;default:return null}}function Uc(e,t){if(Jl)return e==="compositionend"||!Li&&Hc(e,t)?(e=ca(),gs=mo=La=null,Jl=!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 Bc&&t.locale!=="ko"?null:t.data;default:return null}}var Lc={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 Yi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lc[e.type]:t==="textarea"}function vo(e,t,n,l){sa?pa?pa.push(l):pa=[l]:sa=l,t=Yr(t,"onChange"),0<t.length&&(n=new $i("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var Il=null,qi=null;function bo(e){Bg(e,0)}function ws(e){var t=la(e);if(uo(t))return e}function Gc(e,t){if(e==="change")return t}var xo=!1;if(oa){var Ss;if(oa){var js="oninput"in document;if(!js){var Yc=document.createElement("div");Yc.setAttribute("oninput","return;"),js=typeof Yc.oninput=="function"}Ss=js}else Ss=!1;xo=Ss&&(!document.documentMode||9<document.documentMode)}function Ze(){Il&&(Il.detachEvent("onpropertychange",Wl),qi=Il=null)}function Wl(e){if(e.propertyName==="value"&&ws(qi)){var t=[];vo(t,qi,e,al(e)),Xl(bo,t)}}function zu(e,t,n){e==="focusin"?(Ze(),Il=t,qi=n,Il.attachEvent("onpropertychange",Wl)):e==="focusout"&&Ze()}function Vi(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ws(qi)}function Au(e,t){if(e==="click")return ws(t)}function Ga(e,t){if(e==="input"||e==="change")return ws(t)}function Pl(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var An=typeof Object.is=="function"?Object.is:Pl;function Ml(e,t){if(An(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var s=n[l];if(!Wt.call(t,s)||!An(e[s],t[s]))return!1}return!0}function ei(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 Xi(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ti(e,t){var n=Xi(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Xi(n)}}function wo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function So(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ei(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ei(e.document)}return t}function jo(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")}var qc=oa&&"documentMode"in document&&11>=document.documentMode,va=null,Ns=null,ni=null,Ts=!1;function No(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ts||va==null||va!==ei(l)||(l=va,"selectionStart"in l&&jo(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ni&&Ml(ni,l)||(ni=l,l=Yr(Ns,"onSelect"),0<l.length&&(t=new $i("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=va)))}function cl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var zl={animationend:cl("Animation","AnimationEnd"),animationiteration:cl("Animation","AnimationIteration"),animationstart:cl("Animation","AnimationStart"),transitionrun:cl("Transition","TransitionRun"),transitionstart:cl("Transition","TransitionStart"),transitioncancel:cl("Transition","TransitionCancel"),transitionend:cl("Transition","TransitionEnd")},Es={},To={};oa&&(To=document.createElement("div").style,"AnimationEvent"in window||(delete zl.animationend.animation,delete zl.animationiteration.animation,delete zl.animationstart.animation),"TransitionEvent"in window||delete zl.transitionend.transition);function rl(e){if(Es[e])return Es[e];if(!zl[e])return e;var t=zl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in To)return Es[e]=t[n];return e}var Eo=rl("animationend"),ko=rl("animationiteration"),Co=rl("animationstart"),Vc=rl("transitionrun"),Xc=rl("transitionstart"),Kc=rl("transitioncancel"),Mo=rl("transitionend"),d=new Map,g="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");g.push("scrollEnd");function b(e,t){d.set(e,t),Tl(t,[e])}var E=0;function z(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Xa.identifierPrefix;var n=E++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function Z(e){if(e==null||typeof e=="string")return e;var t=null,n=Vs;if(n!==null)for(var l=0;l<n.length;l++){var s=e[n[l]];if(s!=null){if(s==="none")return"none";t=t==null?s:t+(" "+s)}}return t??e.default}function te(e,t){return e=Z(e),t=Z(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var de=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ze=[],Je=0,qe=0;function pt(){for(var e=Je,t=qe=Je=0;t<e;){var n=ze[t];ze[t++]=null;var l=ze[t];ze[t++]=null;var s=ze[t];ze[t++]=null;var c=ze[t];if(ze[t++]=null,l!==null&&s!==null){var m=l.pending;m===null?s.next=s:(s.next=m.next,m.next=s),l.pending=s}c!==0&&Ae(n,s,c)}}function Tn(e,t,n,l){ze[Je++]=e,ze[Je++]=t,ze[Je++]=n,ze[Je++]=l,qe|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function ct(e,t,n,l){return Tn(e,t,n,l),We(e)}function tn(e,t){return Tn(e,null,null,t),We(e)}function Ae(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var s=!1,c=e.return;c!==null;)c.childLanes|=n,l=c.alternate,l!==null&&(l.childLanes|=n),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(s=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,s&&t!==null&&(s=31-hn(n),e=c.hiddenUpdates,l=e[s],l===null?e[s]=[t]:l.push(t),t.lane=n|536870912),c):null}function We(e){if(50<Wo)throw Wo=0,$r=null,Error(f(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ut={};function ra(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function At(e,t,n,l){return new ra(e,t,n,l)}function qt(e){return e=e.prototype,!(!e||!e.isReactComponent)}function In(e,t){var n=e.alternate;return n===null?(n=At(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&1206910976,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.refCleanup=e.refCleanup,n}function zo(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Zc(e,t,n,l,s,c){var m=0;if(l=e,typeof l=="function")qt(l)&&(m=1);else if(typeof l=="string")m=vb(e,n,xn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(l){case xt:return e=At(31,n,t,s),e.elementType=xt,e.lanes=c,e;case Ne:return Ki(n.children,s,c,t);case mt:m=8,s|=24;break;case Ct:return e=At(12,n,t,s|2),e.elementType=Ct,e.lanes=c,e;case ye:return e=At(13,n,t,s),e.elementType=ye,e.lanes=c,e;case xe:return e=At(19,n,t,s),e.elementType=xe,e.lanes=c,e;case Ke:case D:return e=s|32,e=At(30,n,t,e),e.elementType=D,e.lanes=c,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case st:m=10;break e;case _t:m=9;break e;case fe:m=11;break e;case _e:m=14;break e;case ke:m=16,l=null;break e}m=29,n=Error(f(130,e===null?"null":typeof e,"")),l=null}return t=At(m,n,t,s),t.elementType=e,t.type=l,t.lanes=c,t}function Ki(e,t,n,l){return e=At(7,e,l,t),e.lanes=n,e}function Ou(e,t,n){return e=At(6,e,null,t),e.lanes=n,e}function gh(e){var t=At(18,null,null,0);return t.stateNode=e,t}function Du(e,t,n){return t=At(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ph=new WeakMap;function Ma(e,t){if(typeof e=="object"&&e!==null){var n=ph.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Rt(t)},ph.set(e,t),t)}return{value:e,source:t,stack:Rt(t)}}var ks=[],Cs=0,Qc=null,Ao=0,za=[],Aa=0,ai=null,ul=1,dl="";function Al(e,t){ks[Cs++]=Ao,ks[Cs++]=Qc,Qc=e,Ao=t}function yh(e,t,n){za[Aa++]=ul,za[Aa++]=dl,za[Aa++]=ai,ai=e;var l=ul;e=dl;var s=32-hn(l)-1;l&=~(1<<s),n+=1;var c=32-hn(t)+s;if(30<c){var m=s-s%5;c=(l&(1<<m)-1).toString(32),l>>=m,s-=m,ul=1<<32-hn(t)+s|n<<s|l,dl=c+e}else ul=1<<c|n<<s|l,dl=e}function Fc(e){e.return!==null&&(Al(e,1),yh(e,1,0))}function Ru(e){for(;e===Qc;)Qc=ks[--Cs],ks[Cs]=null,Ao=ks[--Cs],ks[Cs]=null;for(;e===ai;)ai=za[--Aa],za[Aa]=null,dl=za[--Aa],za[Aa]=null,ul=za[--Aa],za[Aa]=null}function vh(e,t){za[Aa++]=ul,za[Aa++]=dl,za[Aa++]=ai,ul=t.id,dl=t.overflow,ai=e}var En=null,Lt=null,Ie=!1,li=null,Oa=!1,$u=Error(f(519));function ii(e){var t=Error(f(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Oo(Ma(t,e)),$u}function bh(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[he]=e,t[Mt]=l,n){case"dialog":nt("cancel",t),nt("close",t);break;case"iframe":case"object":case"embed":nt("load",t);break;case"video":case"audio":for(n=0;n<ec.length;n++)nt(ec[n],t);break;case"source":nt("error",t);break;case"img":case"image":case"link":nt("error",t),nt("load",t);break;case"details":nt("toggle",t);break;case"input":nt("invalid",t),Oi(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":nt("invalid",t);break;case"textarea":nt("invalid",t),$t(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||Lg(t.textContent,n)?(l.popover!=null&&(nt("beforetoggle",t),nt("toggle",t)),l.onScroll!=null&&nt("scroll",t),l.onScrollEnd!=null&&nt("scrollend",t),l.onClick!=null&&(t.onclick=ga),t=!0):t=!1,t||ii(e,!0)}function Jc(e){for(En=e.return;En;)switch(En.tag){case 5:case 31:case 13:Oa=!1;return;case 27:case 3:Oa=!0;return;default:En=En.return}}function Ms(e){if(e!==En)return!1;if(!Ie)return Jc(e),Ie=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||ff(e.type,e.memoizedProps)),n=!n),n&&Lt&&ii(e),Jc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(317));Lt=ip(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(317));Lt=ip(e)}else t===27?(t=Lt,wi(e.type)?(e=wf,wf=null,Lt=e):Lt=t):Lt=En?Ra(e.stateNode.nextSibling):null;return!0}function Zi(){Lt=En=null,Ie=!1}function Bu(){var e=li;return e!==null&&(fa===null?fa=e:fa.push.apply(fa,e),li=null),e}function Oo(e){li===null?li=[e]:li.push(e)}var _u=jn(null),Qi=null,Ol=null;function si(e,t,n){Le(_u,t._currentValue),t._currentValue=n}function Dl(e){e._currentValue=_u.current,at(_u)}function Ic(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function Hu(e,t,n,l){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var c=s.dependencies;if(c!==null){var m=s.child;c=c.firstContext;e:for(;c!==null;){var j=c;c=s;for(var A=0;A<t.length;A++)if(j.context===t[A]){c.lanes|=n,j=c.alternate,j!==null&&(j.lanes|=n),Ic(c.return,n,e),l||(m=null);break e}c=j.next}}else if(s.tag===18){if(m=s.return,m===null)throw Error(f(341));m.lanes|=n,c=m.alternate,c!==null&&(c.lanes|=n),Ic(m,n,e),m=null}else s.tag===13&&s.memoizedState!==null&&s.memoizedState.dehydrated===null?(s.lanes|=n,m=s.alternate,m!==null&&(m.lanes|=n),Ic(s.return,n,e),m=s.child,m=m!==null?m.sibling:null):m=s.child;if(m!==null)m.return=s;else for(m=s;m!==null;){if(m===e){m=null;break}if(s=m.sibling,s!==null){s.return=m.return,m=s;break}m=m.return}s=m}}function Fi(e,t,n,l){e=null;for(var s=t,c=!1;s!==null;){if(!c){if((s.flags&524288)!==0)c=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var m=s.alternate;if(m===null)throw Error(f(387));if(m=m.memoizedProps,m!==null){var j=s.type;An(s.pendingProps.value,m.value)||(e!==null?e.push(j):e=[j])}}else if(s===sn.current){if(m=s.alternate,m===null)throw Error(f(387));m.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(eo):e=[eo])}s=s.return}return e!==null&&Hu(t,e,n,l),t.flags|=262144,e!==null}function Wc(e){for(e=e.firstContext;e!==null;){if(!An(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ji(e){Qi=e,Ol=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function On(e){return xh(Qi,e)}function Pc(e,t){return Qi===null&&Ji(e),xh(e,t)}function xh(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ol===null){if(e===null)throw Error(f(308));Ol=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ol=Ol.next=t;return n}var Xy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Ky=a.unstable_scheduleCallback,Zy=a.unstable_NormalPriority,pn={$$typeof:st,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Uu(){return{controller:new Xy,data:new Map,refCount:0}}function Do(e){e.refCount--,e.refCount===0&&Ky(Zy,function(){e.controller.abort()})}function wh(e,t){if((e.pendingLanes&4194048)!==0){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var l=t[e];n.indexOf(l)===-1&&n.push(l)}}}var Ro=null;function Qy(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var $o=null,Lu=0,Ii=0,zs=null;function Fy(e,t){if($o===null){var n=$o=[];Lu=0,Ii=nf(),zs={status:"pending",value:void 0,then:function(l){n.push(l)}}}return Lu++,t.then(Sh,Sh),t}function Sh(){if(--Lu===0&&(Ro=null,$o!==null)){zs!==null&&(zs.status="fulfilled");var e=$o;$o=null,Ii=0,zs=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Jy(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(s){n.push(s)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var s=0;s<n.length;s++)(0,n[s])(t)},function(s){for(l.status="rejected",l.reason=s,s=0;s<n.length;s++)(0,n[s])(void 0)}),l}var jh=me.S;me.S=function(e,t){if(gg=Vt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Fy(e,t),Ro!==null)for(var n=Qs;n!==null;)wh(n,Ro),n=n.next;if(n=e.types,n!==null){for(var l=Qs;l!==null;)wh(l,n),l=l.next;if(Ii!==0){l=Ro,l===null&&(l=Ro=[]);for(var s=0;s<n.length;s++){var c=n[s];l.indexOf(c)===-1&&l.push(c)}}}jh!==null&&jh(e,t)};var Wi=jn(null);function Gu(){var e=Wi.current;return e!==null?e:Bt.pooledCache}function er(e,t){t===null?Le(Wi,Wi.current):Le(Wi,t.pool)}function Nh(){var e=Gu();return e===null?null:{parent:pn._currentValue,pool:e}}var As=Error(f(460)),Yu=Error(f(474)),tr=Error(f(542)),nr={then:function(){}};function Th(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Eh(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ga,ga),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ch(e),e===void 0&&!("reason"in t)?Error(f(600)):e;default:if(typeof t.status=="string")t.then(ga,ga);else{if(e=Bt,e!==null&&100<e.shellSuspendCounter)throw Error(f(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=l}},function(l){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ch(e),e}throw es=t,As}}function Pi(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(es=n,As):n}}var es=null;function kh(){if(es===null)throw Error(f(459));var e=es;return es=null,e}function Ch(e){if(e===As||e===tr)throw Error(f(483))}var Os=null,Bo=0;function ar(e){var t=Bo;return Bo+=1,Os===null&&(Os=[]),Eh(Os,e,t)}function oi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function lr(e,t){throw t.$$typeof===P?Error(f(525)):(e=Object.prototype.toString.call(t),Error(f(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Mh(e){function t(U,R){if(e){var Y=U.deletions;Y===null?(U.deletions=[R],U.flags|=16):Y.push(R)}}function n(U,R){if(!e)return null;for(;R!==null;)t(U,R),R=R.sibling;return null}function l(U){for(var R=new Map;U!==null;)U.key===null?R.set(U.index,U):R.set(U.key,U),U=U.sibling;return R}function s(U,R){return U=In(U,R),U.index=0,U.sibling=null,U}function c(U,R,Y){return U.index=Y,e?(Y=U.alternate,Y!==null?(Y=Y.index,Y<R?(U.flags|=2,R):Y):(U.flags|=134217730,R)):(U.flags|=1048576,R)}function m(U){return e&&U.alternate===null&&(U.flags|=134217730),U}function j(U,R,Y,ae){return R===null||R.tag!==6?(R=Ou(Y,U.mode,ae),R.return=U,R):(R=s(R,Y),R.return=U,R)}function A(U,R,Y,ae){var we=Y.type;return we===Ne?(U=F(U,R,Y.props.children,ae,Y.key),oi(U,Y),U):R!==null&&(R.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===ke&&Pi(we)===R.type)?(R=s(R,Y.props),oi(R,Y),R.return=U,R):(R=Zc(Y.type,Y.key,Y.props,null,U.mode,ae),oi(R,Y),R.return=U,R)}function L(U,R,Y,ae){return R===null||R.tag!==4||R.stateNode.containerInfo!==Y.containerInfo||R.stateNode.implementation!==Y.implementation?(R=Du(Y,U.mode,ae),R.return=U,R):(R=s(R,Y.children||[]),R.return=U,R)}function F(U,R,Y,ae,we){return R===null||R.tag!==7?(R=Ki(Y,U.mode,ae,we),R.return=U,R):(R=s(R,Y),R.return=U,R)}function ie(U,R,Y){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=Ou(""+R,U.mode,Y),R.return=U,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case re:return Y=Zc(R.type,R.key,R.props,null,U.mode,Y),oi(Y,R),Y.return=U,Y;case Se:return R=Du(R,U.mode,Y),R.return=U,R;case ke:return R=Pi(R),ie(U,R,Y)}if(He(R)||_(R))return R=Ki(R,U.mode,Y,null),R.return=U,R;if(typeof R.then=="function")return ie(U,ar(R),Y);if(R.$$typeof===st)return ie(U,Pc(U,R),Y);lr(U,R)}return null}function H(U,R,Y,ae){var we=R!==null?R.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return we!==null?null:j(U,R,""+Y,ae);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case re:return Y.key===we?A(U,R,Y,ae):null;case Se:return Y.key===we?L(U,R,Y,ae):null;case ke:return Y=Pi(Y),H(U,R,Y,ae)}if(He(Y)||_(Y))return we!==null?null:F(U,R,Y,ae,null);if(typeof Y.then=="function")return H(U,R,ar(Y),ae);if(Y.$$typeof===st)return H(U,R,Pc(U,Y),ae);lr(U,Y)}return null}function V(U,R,Y,ae,we){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return U=U.get(Y)||null,j(R,U,""+ae,we);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case re:return U=U.get(ae.key===null?Y:ae.key)||null,A(R,U,ae,we);case Se:return U=U.get(ae.key===null?Y:ae.key)||null,L(R,U,ae,we);case ke:return ae=Pi(ae),V(U,R,Y,ae,we)}if(He(ae)||_(ae))return U=U.get(Y)||null,F(R,U,ae,we,null);if(typeof ae.then=="function")return V(U,R,Y,ar(ae),we);if(ae.$$typeof===st)return V(U,R,Y,Pc(R,ae),we);lr(R,ae)}return null}function pe(U,R,Y,ae){for(var we=null,it=null,Oe=R,Ue=R=0,bn=null;Oe!==null&&Ue<Y.length;Ue++){Oe.index>Ue?(bn=Oe,Oe=null):bn=Oe.sibling;var ht=H(U,Oe,Y[Ue],ae);if(ht===null){Oe===null&&(Oe=bn);break}e&&Oe&&ht.alternate===null&&t(U,Oe),R=c(ht,R,Ue),it===null?we=ht:it.sibling=ht,it=ht,Oe=bn}if(Ue===Y.length)return n(U,Oe),Ie&&Al(U,Ue),we;if(Oe===null){for(;Ue<Y.length;Ue++)Oe=ie(U,Y[Ue],ae),Oe!==null&&(R=c(Oe,R,Ue),it===null?we=Oe:it.sibling=Oe,it=Oe);return Ie&&Al(U,Ue),we}for(Oe=l(Oe);Ue<Y.length;Ue++)bn=V(Oe,U,Ue,Y[Ue],ae),bn!==null&&(e&&(ht=bn.alternate,ht!==null&&Oe.delete(ht.key===null?Ue:ht.key)),R=c(bn,R,Ue),it===null?we=bn:it.sibling=bn,it=bn);return e&&Oe.forEach(function(Ei){return t(U,Ei)}),Ie&&Al(U,Ue),we}function Ee(U,R,Y,ae){if(Y==null)throw Error(f(151));for(var we=null,it=null,Oe=R,Ue=R=0,bn=null,ht=Y.next();Oe!==null&&!ht.done;Ue++,ht=Y.next()){Oe.index>Ue?(bn=Oe,Oe=null):bn=Oe.sibling;var Ei=H(U,Oe,ht.value,ae);if(Ei===null){Oe===null&&(Oe=bn);break}e&&Oe&&Ei.alternate===null&&t(U,Oe),R=c(Ei,R,Ue),it===null?we=Ei:it.sibling=Ei,it=Ei,Oe=bn}if(ht.done)return n(U,Oe),Ie&&Al(U,Ue),we;if(Oe===null){for(;!ht.done;Ue++,ht=Y.next())ht=ie(U,ht.value,ae),ht!==null&&(R=c(ht,R,Ue),it===null?we=ht:it.sibling=ht,it=ht);return Ie&&Al(U,Ue),we}for(Oe=l(Oe);!ht.done;Ue++,ht=Y.next())ht=V(Oe,U,Ue,ht.value,ae),ht!==null&&(e&&(bn=ht.alternate,bn!==null&&Oe.delete(bn.key===null?Ue:bn.key)),R=c(ht,R,Ue),it===null?we=ht:it.sibling=ht,it=ht);return e&&Oe.forEach(function(zb){return t(U,zb)}),Ie&&Al(U,Ue),we}function Xe(U,R,Y,ae){if(typeof Y=="object"&&Y!==null&&Y.type===Ne&&Y.key===null&&Y.props.ref===void 0&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case re:e:{for(var we=Y.key;R!==null;){if(R.key===we){if(we=Y.type,we===Ne){if(R.tag===7){n(U,R.sibling),ae=s(R,Y.props.children),oi(ae,Y),ae.return=U,U=ae;break e}}else if(R.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===ke&&Pi(we)===R.type){n(U,R.sibling),ae=s(R,Y.props),oi(ae,Y),ae.return=U,U=ae;break e}n(U,R);break}else t(U,R);R=R.sibling}Y.type===Ne?(ae=Ki(Y.props.children,U.mode,ae,Y.key),oi(ae,Y),ae.return=U,U=ae):(ae=Zc(Y.type,Y.key,Y.props,null,U.mode,ae),oi(ae,Y),ae.return=U,U=ae)}return m(U);case Se:e:{for(we=Y.key;R!==null;){if(R.key===we)if(R.tag===4&&R.stateNode.containerInfo===Y.containerInfo&&R.stateNode.implementation===Y.implementation){n(U,R.sibling),ae=s(R,Y.children||[]),ae.return=U,U=ae;break e}else{n(U,R);break}else t(U,R);R=R.sibling}ae=Du(Y,U.mode,ae),ae.return=U,U=ae}return m(U);case ke:return Y=Pi(Y),Xe(U,R,Y,ae)}if(He(Y))return pe(U,R,Y,ae);if(_(Y)){if(we=_(Y),typeof we!="function")throw Error(f(150));return Y=we.call(Y),Ee(U,R,Y,ae)}if(typeof Y.then=="function")return Xe(U,R,ar(Y),ae);if(Y.$$typeof===st)return Xe(U,R,Pc(U,Y),ae);lr(U,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,R!==null&&R.tag===6?(n(U,R.sibling),ae=s(R,Y),ae.return=U,U=ae):(n(U,R),ae=Ou(Y,U.mode,ae),ae.return=U,U=ae),m(U)):n(U,R)}return function(U,R,Y,ae){try{Bo=0;var we=Xe(U,R,Y,ae);return Os=null,we}catch(Oe){if(Oe===As||Oe===tr)throw Oe;var it=At(29,Oe,null,U.mode);return it.lanes=ae,it.return=U,it}finally{}}}var ts=Mh(!0),zh=Mh(!1),ci=!1;function qu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ri(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ui(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(vt&2)!==0){var s=l.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),l.pending=t,t=We(e),Ae(e,null,n),t}return Tn(e,l,t,n),We(e)}function _o(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,ue(e,n)}}function Xu(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var s=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var m={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?s=c=m:c=c.next=m,n=n.next}while(n!==null);c===null?s=c=t:c=c.next=t}else s=c=t;n={baseState:l.baseState,firstBaseUpdate:s,lastBaseUpdate:c,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ku=!1;function Ho(){if(Ku){var e=zs;if(e!==null)throw e}}function Uo(e,t,n,l){Ku=!1;var s=e.updateQueue;ci=!1;var c=s.firstBaseUpdate,m=s.lastBaseUpdate,j=s.shared.pending;if(j!==null){s.shared.pending=null;var A=j,L=A.next;A.next=null,m===null?c=L:m.next=L,m=A;var F=e.alternate;F!==null&&(F=F.updateQueue,j=F.lastBaseUpdate,j!==m&&(j===null?F.firstBaseUpdate=L:j.next=L,F.lastBaseUpdate=A))}if(c!==null){var ie=s.baseState;m=0,F=L=A=null,j=c;do{var H=j.lane&-536870913,V=H!==j.lane;if(V?(lt&H)===H:(l&H)===H){H!==0&&H===Ii&&(Ku=!0),F!==null&&(F=F.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var pe=e,Ee=j;H=t;var Xe=n;switch(Ee.tag){case 1:if(pe=Ee.payload,typeof pe=="function"){ie=pe.call(Xe,ie,H);break e}ie=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Ee.payload,H=typeof pe=="function"?pe.call(Xe,ie,H):pe,H==null)break e;ie=se({},ie,H);break e;case 2:ci=!0}}H=j.callback,H!==null&&(e.flags|=64,V&&(e.flags|=8192),V=s.callbacks,V===null?s.callbacks=[H]:V.push(H))}else V={lane:H,tag:j.tag,payload:j.payload,callback:j.callback,next:null},F===null?(L=F=V,A=ie):F=F.next=V,m|=H;if(j=j.next,j===null){if(j=s.shared.pending,j===null)break;V=j,j=V.next,V.next=null,s.lastBaseUpdate=V,s.shared.pending=null}}while(!0);F===null&&(A=ie),s.baseState=A,s.firstBaseUpdate=L,s.lastBaseUpdate=F,c===null&&(s.shared.lanes=0),yi|=m,e.lanes=m,e.memoizedState=ie}}function Ah(e,t){if(typeof e!="function")throw Error(f(191,e));e.call(t)}function Oh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ah(n[e],t)}var di=jn(null),ir=jn(0);function Dh(e,t){e=Hl,Le(ir,e),Le(di,t),Hl=e|t.baseLanes}function Zu(){Le(ir,Hl),Le(di,di.current)}function Qu(){Hl=ir.current,at(di),at(ir)}var Dn=jn(null),Vn=null;function fi(e){var t=e.alternate;Le(Rn,Rn.current&1),Le(Dn,e),Vn===null&&(t===null||di.current!==null||t.memoizedState!==null)&&(Vn=e)}function Fu(e){Le(Rn,Rn.current),Le(Dn,e),Vn===null&&(Vn=e)}function Rh(e){e.tag===22?(Le(Rn,Rn.current),Le(Dn,e),Vn===null&&(Vn=e)):hi()}function hi(){Le(Rn,Rn.current),Le(Dn,Dn.current)}function ba(e){at(Dn),Vn===e&&(Vn=null),at(Rn)}var Rn=jn(0);function Lo(e,t){Le(Dn,Dn.current),Le(Rn,t)}function Ju(e){at(Rn),at(Dn),Vn===e&&(Vn=null)}function sr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||bf(n)||xf(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)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 Rl=0,Ve=null,Ot=null,yn=null,or=!1,Ds=!1,ns=!1,cr=0,Go=0,Rs=null,Iy=0;function nn(){throw Error(f(321))}function Iu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!An(e[n],t[n]))return!1;return!0}function Wu(e,t,n,l,s,c){return Rl=c,Ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,me.H=e===null||e.memoizedState===null?ym:vm,ns=!1,c=n(l,s),ns=!1,Ds&&(c=Bh(t,n,l,s)),$h(e),c}function $h(e){me.H=gr;var t=Ot!==null&&Ot.next!==null;if(Rl=0,yn=Ot=Ve=null,or=!1,Go=0,Rs=null,t)throw Error(f(300));e===null||vn||(e=e.dependencies,e!==null&&Wc(e)&&(vn=!0))}function Bh(e,t,n,l){Ve=e;var s=0;do{if(Ds&&(Rs=null),Go=0,Ds=!1,25<=s)throw Error(f(301));if(s+=1,yn=Ot=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}me.H=iv,c=t(n,l)}while(Ds);return c}function Wy(){var e=me.H,t=e.useState()[0];return t=typeof t.then=="function"?Yo(t):t,e=e.useState()[0],(Ot!==null?Ot.memoizedState:null)!==e&&(Ve.flags|=1024),t}function Pu(){var e=cr!==0;return cr=0,e}function ed(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function td(e){if(or){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}or=!1}Rl=0,yn=Ot=Ve=null,Ds=!1,Go=cr=0,Rs=null}function Wn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yn===null?Ve.memoizedState=yn=e:yn=yn.next=e,yn}function fn(){if(Ot===null){var e=Ve.alternate;e=e!==null?e.memoizedState:null}else e=Ot.next;var t=yn===null?Ve.memoizedState:yn.next;if(t!==null)yn=t,Ot=e;else{if(e===null)throw Ve.alternate===null?Error(f(467)):Error(f(310));Ot=e,e={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},yn===null?Ve.memoizedState=yn=e:yn=yn.next=e}return yn}function rr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yo(e){var t=Go;return Go+=1,Rs===null&&(Rs=[]),e=Eh(Rs,e,t),t=Ve,(yn===null?t.memoizedState:yn.next)===null&&(t=t.alternate,me.H=t===null||t.memoizedState===null?ym:vm),e}function ur(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Yo(e);if(e.$$typeof===G)return;if(e.$$typeof===st)return On(e)}throw Error(f(438,String(e)))}function nd(e){var t=null,n=Ve.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=Ve.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=rr(),Ve.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=Pe;return t.index++,n}function $l(e,t){return typeof t=="function"?t(e):t}function dr(e){var t=fn();return ad(t,Ot,e)}function ad(e,t,n){var l=e.queue;if(l===null)throw Error(f(311));l.lastRenderedReducer=n;var s=e.baseQueue,c=l.pending;if(c!==null){if(s!==null){var m=s.next;s.next=c.next,c.next=m}t.baseQueue=s=c,l.pending=null}if(c=e.baseState,s===null)e.memoizedState=c;else{t=s.next;var j=m=null,A=null,L=t,F=!1;do{var ie=L.lane&-536870913;if(ie!==L.lane?(lt&ie)===ie:(Rl&ie)===ie){var H=L.revertLane;if(H===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),ie===Ii&&(F=!0);else if((Rl&H)===H){L=L.next,H===Ii&&(F=!0);continue}else ie={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},A===null?(j=A=ie,m=c):A=A.next=ie,Ve.lanes|=H,yi|=H;ie=L.action,ns&&n(c,ie),c=L.hasEagerState?L.eagerState:n(c,ie)}else H={lane:ie,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},A===null?(j=A=H,m=c):A=A.next=H,Ve.lanes|=ie,yi|=ie;L=L.next}while(L!==null&&L!==t);if(A===null?m=c:A.next=j,!An(c,e.memoizedState)&&(vn=!0,F&&(n=zs,n!==null)))throw n;e.memoizedState=c,e.baseState=m,e.baseQueue=A,l.lastRenderedState=c}return s===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function ld(e){var t=fn(),n=t.queue;if(n===null)throw Error(f(311));n.lastRenderedReducer=e;var l=n.dispatch,s=n.pending,c=t.memoizedState;if(s!==null){n.pending=null;var m=s=s.next;do c=e(c,m.action),m=m.next;while(m!==s);An(c,t.memoizedState)||(vn=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,l]}function _h(e,t,n){var l=Ve,s=fn(),c=Ie;if(c){if(n===void 0)throw Error(f(407));n=n()}else n=t();var m=!An((Ot||s).memoizedState,n);if(m&&(s.memoizedState=n,vn=!0),s=s.queue,od(Lh.bind(null,l,s,e),[e]),e=s.getSnapshot!==t||m||yn!==null&&(yn.memoizedState.tag&1)!==0,$s(e?9:8,{destroy:void 0},Uh.bind(null,l,s,n,t),null),e){if(l.flags|=2048,Bt===null)throw Error(f(349));c||(Rl&127)!==0||Hh(l,t,n)}return n}function Hh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ve.updateQueue,t===null?(t=rr(),Ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Uh(e,t,n,l){t.value=n,t.getSnapshot=l,Gh(t)&&Yh(e)}function Lh(e,t,n){return n(function(){Gh(t)&&Yh(e)})}function Gh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!An(e,n)}catch{return!0}}function Yh(e){var t=tn(e,2);t!==null&&ha(t,e,2)}function id(e){var t=Wn();if(typeof e=="function"){var n=e;if(e=n(),ns){Kn(!0);try{n()}finally{Kn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$l,lastRenderedState:e},t}function qh(e,t,n,l){return e.baseState=n,ad(e,Ot,typeof l=="function"?l:$l)}function Py(e,t,n,l,s){if(mr(e))throw Error(f(485));if(e=t.action,e!==null){var c={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){c.listeners.push(m)}};me.T!==null?n(!0):c.isTransition=!1,l(c),n=t.pending,n===null?(c.next=t.pending=c,Vh(t,c)):(c.next=n.next,t.pending=n.next=c)}}function Vh(e,t){var n=t.action,l=t.payload,s=e.state;if(t.isTransition){var c=me.T,m={};m.types=c!==null?c.types:null,me.T=m;try{var j=n(s,l),A=me.S;A!==null&&A(m,j),Xh(e,t,j)}catch(L){sd(e,t,L)}finally{c!==null&&m.types!==null&&(c.types=m.types),me.T=c}}else try{c=n(s,l),Xh(e,t,c)}catch(L){sd(e,t,L)}}function Xh(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Kh(e,t,l)},function(l){return sd(e,t,l)}):Kh(e,t,n)}function Kh(e,t,n){t.status="fulfilled",t.value=n,Zh(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Vh(e,n)))}function sd(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Zh(t),t=t.next;while(t!==l)}e.action=null}function Zh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Qh(e,t){return t}function Fh(e,t){if(Ie){var n=Bt.formState;if(n!==null){e:{var l=Ve;if(Ie){if(Lt){t:{for(var s=Lt,c=Oa;s.nodeType!==8;){if(!c){s=null;break t}if(s=Ra(s.nextSibling),s===null){s=null;break t}}c=s.data,s=c==="F!"||c==="F"?s:null}if(s){Lt=Ra(s.nextSibling),l=s.data==="F!";break e}}ii(l)}l=!1}l&&(t=n[0])}}return n=Wn(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qh,lastRenderedState:t},n.queue=l,n=mm.bind(null,Ve,l),l.dispatch=n,l=id(!1),c=fd.bind(null,Ve,!1,l.queue),l=Wn(),s={state:t,dispatch:null,action:e,pending:null},l.queue=s,n=Py.bind(null,Ve,s,c,n),s.dispatch=n,l.memoizedState=e,[t,n,!1]}function Jh(e){var t=fn();return Ih(t,Ot,e)}function Ih(e,t,n){if(t=ad(e,t,Qh)[0],e=dr($l)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Yo(t)}catch(m){throw m===As?tr:m}else l=t;t=fn();var s=t.queue,c=s.dispatch;return n!==t.memoizedState&&(Ve.flags|=2048,$s(9,{destroy:void 0},ev.bind(null,s,n),null)),[l,c,e]}function ev(e,t){e.action=t}function Wh(e){var t=fn(),n=Ot;if(n!==null)return Ih(t,n,e);fn(),t=t.memoizedState,n=fn();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function $s(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=Ve.updateQueue,t===null&&(t=rr(),Ve.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function Ph(){return fn().memoizedState}function fr(e,t,n,l){var s=Wn();Ve.flags|=e,s.memoizedState=$s(1|t,{destroy:void 0},n,l===void 0?null:l)}function hr(e,t,n,l){var s=fn();l=l===void 0?null:l;var c=s.memoizedState.inst;Ot!==null&&l!==null&&Iu(l,Ot.memoizedState.deps)?s.memoizedState=$s(t,c,n,l):(Ve.flags|=e,s.memoizedState=$s(1|t,c,n,l))}function em(e,t){fr(8390656,8,e,t)}function od(e,t){hr(2048,8,e,t)}function tv(e){Ve.flags|=4;var t=Ve.updateQueue;if(t===null)t=rr(),Ve.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function tm(e){var t=fn().memoizedState;return tv({ref:t,nextImpl:e}),function(){if((vt&2)!==0)throw Error(f(440));return t.impl.apply(void 0,arguments)}}function nm(e,t){return hr(4,2,e,t)}function am(e,t){return hr(4,4,e,t)}function lm(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function im(e,t,n){n=n!=null?n.concat([e]):null,hr(4,4,lm.bind(null,t,e),n)}function cd(){}function sm(e,t){var n=fn();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&Iu(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function om(e,t){var n=fn();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&Iu(t,l[1]))return l[0];if(l=e(),ns){Kn(!0);try{e()}finally{Kn(!1)}}return n.memoizedState=[l,t],l}function rd(e,t,n){return n===void 0||(Rl&1073741824)!==0&&(lt&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=yg(),Ve.lanes|=e,yi|=e,n)}function cm(e,t,n,l){return An(n,t)?n:di.current!==null?(e=rd(e,n,l),An(e,t)||(vn=!0),e):(Rl&106)===0||(Rl&1073741824)!==0&&(lt&261930)===0?(vn=!0,e.memoizedState=n):(e=yg(),Ve.lanes|=e,yi|=e,t)}function rm(e,t,n,l,s){var c=ve.p;ve.p=c!==0&&8>c?c:8;var m=me.T,j={};j.types=m!==null?m.types:null,me.T=j,fd(e,!1,t,n);try{var A=s(),L=me.S;if(L!==null&&L(j,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var F=Jy(A,l);qo(e,t,F,ja(e))}else qo(e,t,l,ja(e))}catch(ie){qo(e,t,{then:function(){},status:"rejected",reason:ie},ja())}finally{ve.p=c,m!==null&&j.types!==null&&(m.types=j.types),me.T=m}}function nv(){}function ud(e,t,n,l){if(e.tag!==5)throw Error(f(476));var s=um(e).queue;rm(e,s,t,rt,n===null?nv:function(){return dm(e),n(l)})}function um(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:rt,baseState:rt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$l,lastRenderedState:rt},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$l,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function dm(e){var t=um(e);t.next===null&&(t=e.alternate.memoizedState),qo(e,t.next.queue,{},ja())}function dd(){return On(eo)}function fm(){return fn().memoizedState}function hm(){return fn().memoizedState}function av(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=ja();e=ri(n);var l=ui(t,e,n);l!==null&&(ha(l,t,n),_o(l,t,n)),t={cache:Uu()},e.payload=t;return}t=t.return}}function lv(e,t,n){var l=ja();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},mr(e)?gm(t,n):(n=ct(e,t,n,l),n!==null&&(ha(n,e,l),pm(n,t,l)))}function mm(e,t,n){var l=ja();qo(e,t,n,l)}function qo(e,t,n,l){var s={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(mr(e))gm(t,s);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var m=t.lastRenderedState,j=c(m,n);if(s.hasEagerState=!0,s.eagerState=j,An(j,m))return Tn(e,t,s,0),Bt===null&&pt(),!1}catch{}finally{}if(n=ct(e,t,s,l),n!==null)return ha(n,e,l),pm(n,t,l),!0}return!1}function fd(e,t,n,l){if(l={lane:2,revertLane:nf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},mr(e)){if(t)throw Error(f(479))}else t=ct(e,n,l,2),t!==null&&ha(t,e,2)}function mr(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function gm(e,t){Ds=or=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pm(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,ue(e,n)}}var gr={readContext:On,use:ur,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useLayoutEffect:nn,useInsertionEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useSyncExternalStore:nn,useId:nn,useHostTransitionStatus:nn,useFormState:nn,useActionState:nn,useOptimistic:nn,useMemoCache:nn,useCacheRefresh:nn,useEffectEvent:nn},ym={readContext:On,use:ur,useCallback:function(e,t){return Wn().memoizedState=[e,t===void 0?null:t],e},useContext:On,useEffect:em,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,fr(4194308,4,lm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fr(4194308,4,e,t)},useInsertionEffect:function(e,t){fr(4,2,e,t)},useMemo:function(e,t){var n=Wn();t=t===void 0?null:t;var l=e();if(ns){Kn(!0);try{e()}finally{Kn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Wn();if(n!==void 0){var s=n(t);if(ns){Kn(!0);try{n(t)}finally{Kn(!1)}}}else s=t;return l.memoizedState=l.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},l.queue=e,e=e.dispatch=lv.bind(null,Ve,e),[l.memoizedState,e]},useRef:function(e){var t=Wn();return e={current:e},t.memoizedState=e},useState:function(e){e=id(e);var t=e.queue,n=mm.bind(null,Ve,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:cd,useDeferredValue:function(e,t){var n=Wn();return rd(n,e,t)},useTransition:function(){var e=id(!1);return e=rm.bind(null,Ve,e.queue,!0,!1),Wn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=Ve,s=Wn();if(Ie){if(n===void 0)throw Error(f(407));n=n()}else{if(n=t(),Bt===null)throw Error(f(349));(lt&127)!==0||Hh(l,t,n)}s.memoizedState=n;var c={value:n,getSnapshot:t};return s.queue=c,em(Lh.bind(null,l,c,e),[e]),l.flags|=2048,$s(9,{destroy:void 0},Uh.bind(null,l,c,n,t),null),n},useId:function(){var e=Wn(),t=Bt.identifierPrefix;if(Ie){var n=dl,l=ul;n=(l&~(1<<32-hn(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=cr++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Iy++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:dd,useFormState:Fh,useActionState:Fh,useOptimistic:function(e){var t=Wn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=fd.bind(null,Ve,!0,n),n.dispatch=t,[e,t]},useMemoCache:nd,useCacheRefresh:function(){return Wn().memoizedState=av.bind(null,Ve)},useEffectEvent:function(e){var t=Wn(),n={impl:e};return t.memoizedState=n,function(){if((vt&2)!==0)throw Error(f(440));return n.impl.apply(void 0,arguments)}}},vm={readContext:On,use:ur,useCallback:sm,useContext:On,useEffect:od,useImperativeHandle:im,useInsertionEffect:nm,useLayoutEffect:am,useMemo:om,useReducer:dr,useRef:Ph,useState:function(){return dr($l)},useDebugValue:cd,useDeferredValue:function(e,t){var n=fn();return cm(n,Ot.memoizedState,e,t)},useTransition:function(){var e=dr($l)[0],t=fn().memoizedState;return[typeof e=="boolean"?e:Yo(e),t]},useSyncExternalStore:_h,useId:fm,useHostTransitionStatus:dd,useFormState:Jh,useActionState:Jh,useOptimistic:function(e,t){var n=fn();return qh(n,Ot,e,t)},useMemoCache:nd,useCacheRefresh:hm,useEffectEvent:tm},iv={readContext:On,use:ur,useCallback:sm,useContext:On,useEffect:od,useImperativeHandle:im,useInsertionEffect:nm,useLayoutEffect:am,useMemo:om,useReducer:ld,useRef:Ph,useState:function(){return ld($l)},useDebugValue:cd,useDeferredValue:function(e,t){var n=fn();return Ot===null?rd(n,e,t):cm(n,Ot.memoizedState,e,t)},useTransition:function(){var e=ld($l)[0],t=fn().memoizedState;return[typeof e=="boolean"?e:Yo(e),t]},useSyncExternalStore:_h,useId:fm,useHostTransitionStatus:dd,useFormState:Wh,useActionState:Wh,useOptimistic:function(e,t){var n=fn();return Ot!==null?qh(n,Ot,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:nd,useCacheRefresh:hm,useEffectEvent:tm};function hd(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:se({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var md={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=ja(),s=ri(l);s.payload=t,n!=null&&(s.callback=n),t=ui(e,s,l),t!==null&&(ha(t,e,l),_o(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=ja(),s=ri(l);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=ui(e,s,l),t!==null&&(ha(t,e,l),_o(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ja(),l=ri(n);l.tag=2,t!=null&&(l.callback=t),t=ui(e,l,n),t!==null&&(ha(t,e,n),_o(t,e,n))}};function bm(e,t,n,l,s,c,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,m):t.prototype&&t.prototype.isPureReactComponent?!Ml(n,l)||!Ml(s,c):!0}function xm(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&md.enqueueReplaceState(t,t.state,null)}function as(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=se({},n));for(var s in e)n[s]===void 0&&(n[s]=e[s])}return n}function wm(e){de(e)}function Sm(e){console.error(e)}function jm(e){de(e)}function pr(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Nm(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function gd(e,t,n){return n=ri(n),n.tag=3,n.payload={element:null},n.callback=function(){pr(e,t)},n}function Tm(e){return e=ri(e),e.tag=3,e}function Em(e,t,n,l){var s=n.type.getDerivedStateFromError;if(typeof s=="function"){var c=l.value;e.payload=function(){return s(c)},e.callback=function(){Nm(t,n,l)}}var m=n.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){Nm(t,n,l),typeof s!="function"&&(vi===null?vi=new Set([this]):vi.add(this));var j=l.stack;this.componentDidCatch(l.value,{componentStack:j!==null?j:""})})}function sv(e,t,n,l,s){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Fi(t,n,s,!0),n=Dn.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Vn===null?_r():n.alternate===null&&an===0&&(an=3),n.flags&=-257,n.flags|=65536,n.lanes=s,l===nr?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),Pd(e,l,s)),!1;case 22:return n.flags|=65536,l===nr?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),Pd(e,l,s)),!1}throw Error(f(435,n.tag))}return Pd(e,l,s),_r(),!1}if(Ie)return t=Dn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,l!==$u&&(e=Error(f(422),{cause:l}),Oo(Ma(e,n)))):(l!==$u&&(t=Error(f(423),{cause:l}),Oo(Ma(t,n))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,l=Ma(l,n),s=gd(e.stateNode,l,s),Xu(e,s),an!==4&&(an=2)),!1;var c=Error(f(520),{cause:l});if(c=Ma(c,n),Io===null?Io=[c]:Io.push(c),an!==4&&(an=2),t===null)return!0;l=Ma(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=s&-s,n.lanes|=e,e=gd(n.stateNode,l,e),Xu(n,e),!1;case 1:if(t=n.type,c=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(vi===null||!vi.has(c))))return n.flags|=65536,s&=-s,n.lanes|=s,s=Tm(s),Em(s,e,n,l),Xu(n,s),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var pd=Error(f(461)),vn=!1;function Sn(e,t,n,l){t.child=e===null?zh(t,null,n,l):ts(t,e.child,n,l)}function km(e,t,n,l,s){n=n.render;var c=t.ref;if("ref"in l){var m={};for(var j in l)j!=="ref"&&(m[j]=l[j])}else m=l;return Ji(t),l=Wu(e,t,n,m,c,s),j=Pu(),e!==null&&!vn?(ed(e,t,s),Bl(e,t,s)):(Ie&&j&&Fc(t),t.flags|=1,Sn(e,t,l,s),t.child)}function Cm(e,t,n,l,s){if(e===null){var c=n.type;return typeof c=="function"&&!qt(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,Mm(e,t,c,l,s)):(e=Zc(n.type,null,l,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Nd(e,s)){var m=c.memoizedProps;if(n=n.compare,n=n!==null?n:Ml,n(m,l)&&e.ref===t.ref)return Bl(e,t,s)}return t.flags|=1,e=In(c,l),e.ref=t.ref,e.return=t,t.child=e}function Mm(e,t,n,l,s){if(e!==null){var c=e.memoizedProps;if(Ml(c,l)&&e.ref===t.ref)if(vn=!1,t.pendingProps=l=c,Nd(e,s))(e.flags&131072)!==0&&(vn=!0);else return t.lanes=e.lanes,Bl(e,t,s)}return yd(e,t,n,l,s)}function zm(e,t,n,l){var s=l.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|n:n,e!==null){for(l=t.child=e.child,s=0;l!==null;)s=s|l.lanes|l.childLanes,l=l.sibling;l=s&~c}else l=0,t.child=null;return Am(e,t,c,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&er(t,c!==null?c.cachePool:null),c!==null?Dh(t,c):Zu(),Rh(t);else return l=t.lanes=536870912,Am(e,t,c!==null?c.baseLanes|n:n,n,l)}else c!==null?(er(t,c.cachePool),Dh(t,c),hi(),t.memoizedState=null):(e!==null&&er(t,null),Zu(),hi());return Sn(e,t,s,n),t.child}function Vo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Am(e,t,n,l,s){var c=Gu();return c=c===null?null:{parent:pn._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&er(t,null),Zu(),Rh(t),e!==null&&Fi(e,t,l,!0),t.childLanes=s,null}function yr(e,t){return t=vr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Om(e,t,n){return ts(t,e.child,null,n),e=yr(t,t.pendingProps),e.flags|=2,ba(t),t.memoizedState=null,e}function ov(e,t,n){var l=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ie){if(l.mode==="hidden")return e=yr(t,l),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Vo(null,e);if(Fu(t),(e=Lt)?(e=lp(e,Oa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ai!==null?{id:ul,overflow:dl}:null,retryLane:536870912,hydrationErrors:null},n=gh(e),n.return=t,t.child=n,En=t,Lt=null)):e=null,e===null)throw ii(t);return t.lanes=536870912,null}return yr(t,l)}var c=e.memoizedState;if(c!==null){var m=c.dehydrated;if(Fu(t),s)if(t.flags&256)t.flags&=-257,t=Om(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(f(558));else if(vn||Fi(e,t,n,!1),s=(n&e.childLanes)!==0,vn||s){if(di.current===null){if(l=Bt,l!==null&&(m=Re(l,n),m!==0&&m!==c.retryLane))throw c.retryLane=m,tn(e,m),ha(l,e,m),pd;_r()}t=Om(e,t,n)}else e=c.treeContext,Lt=Ra(m.nextSibling),En=t,Ie=!0,li=null,Oa=!1,e!==null&&vh(t,e),t=yr(t,l),t.flags|=134221824;return t}return e=In(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Bs(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(f(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function yd(e,t,n,l,s){return Ji(t),n=Wu(e,t,n,l,void 0,s),l=Pu(),e!==null&&!vn?(ed(e,t,s),Bl(e,t,s)):(Ie&&l&&Fc(t),t.flags|=1,Sn(e,t,n,s),t.child)}function Dm(e,t,n,l,s,c){return Ji(t),t.updateQueue=null,n=Bh(t,l,n,s),$h(e),l=Pu(),e!==null&&!vn?(ed(e,t,c),Bl(e,t,c)):(Ie&&l&&Fc(t),t.flags|=1,Sn(e,t,n,c),t.child)}function Rm(e,t,n,l,s){if(Ji(t),t.stateNode===null){var c=Ut,m=n.contextType;typeof m=="object"&&m!==null&&(c=On(m)),c=new n(l,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=md,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=l,c.state=t.memoizedState,c.refs={},qu(t),m=n.contextType,c.context=typeof m=="object"&&m!==null?On(m):Ut,c.state=t.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(hd(t,n,m,l),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(m=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),m!==c.state&&md.enqueueReplaceState(c,c.state,null),Uo(t,l,c,s),Ho(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){c=t.stateNode;var j=t.memoizedProps,A=as(n,j);c.props=A;var L=c.context,F=n.contextType;m=Ut,typeof F=="object"&&F!==null&&(m=On(F));var ie=n.getDerivedStateFromProps;F=typeof ie=="function"||typeof c.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,F||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(j||L!==m)&&xm(t,c,l,m),ci=!1;var H=t.memoizedState;c.state=H,Uo(t,l,c,s),Ho(),L=t.memoizedState,j||H!==L||ci?(typeof ie=="function"&&(hd(t,n,ie,l),L=t.memoizedState),(A=ci||bm(t,n,A,l,H,L,m))?(F||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=L),c.props=l,c.state=L,c.context=m,l=A):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{c=t.stateNode,Vu(e,t),m=t.memoizedProps,F=as(n,m),c.props=F,ie=t.pendingProps,H=c.context,L=n.contextType,A=Ut,typeof L=="object"&&L!==null&&(A=On(L)),j=n.getDerivedStateFromProps,(L=typeof j=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(m!==ie||H!==A)&&xm(t,c,l,A),ci=!1,H=t.memoizedState,c.state=H,Uo(t,l,c,s),Ho();var V=t.memoizedState;m!==ie||H!==V||ci||e!==null&&e.dependencies!==null&&Wc(e.dependencies)?(typeof j=="function"&&(hd(t,n,j,l),V=t.memoizedState),(F=ci||bm(t,n,F,l,H,V,A)||e!==null&&e.dependencies!==null&&Wc(e.dependencies))?(L||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(l,V,A),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(l,V,A)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||m===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=V),c.props=l,c.state=V,c.context=A,l=F):(typeof c.componentDidUpdate!="function"||m===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),l=!1)}return c=l,Bs(e,t),l=(t.flags&128)!==0,c||l?(c=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&l?(t.child=ts(t,e.child,null,s),t.child=ts(t,null,n,s)):Sn(e,t,n,s),t.memoizedState=c.state,e=t.child):e=Bl(e,t,s),e}function $m(e,t,n,l){return Zi(),t.flags|=256,Sn(e,t,n,l),t.child}var vd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bd(e){return{baseLanes:e,cachePool:Nh()}}function xd(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Sa),e}function Bm(e,t,n){var l=t.pendingProps,s=!1,c=(t.flags&128)!==0,m;if((m=c)||(m=e!==null&&e.memoizedState===null?!1:(Rn.current&2)!==0),m&&(s=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ie){if(s?fi(t):hi(),(e=Lt)?(e=lp(e,Oa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ai!==null?{id:ul,overflow:dl}:null,retryLane:536870912,hydrationErrors:null},n=gh(e),n.return=t,t.child=n,En=t,Lt=null)):e=null,e===null)throw ii(t);return xf(e)?t.lanes=32:t.lanes=536870912,null}return c=l.children,l=l.fallback,s?(hi(),s=t.mode,c=vr({mode:"hidden",children:c},s),l=Ki(l,s,n,null),c.return=t,l.return=t,c.sibling=l,t.child=c,l=t.child,l.memoizedState=bd(n),l.childLanes=xd(e,m,n),t.memoizedState=vd,Vo(null,l)):(fi(t),wd(t,c))}var j=e.memoizedState;if(j!==null){var A=j.dehydrated;if(A!==null)return cv(e,t,c,m,l,A,j,n)}return s?(hi(),s=l.fallback,c=t.mode,j=e.child,A=j.sibling,l=In(j,{mode:"hidden",children:l.children}),l.subtreeFlags=j.subtreeFlags&1206910976,A!==null?s=In(A,s):(s=Ki(s,c,n,null),s.flags|=2),s.return=t,l.return=t,l.sibling=s,t.child=l,Vo(null,l),l=t.child,s=e.child.memoizedState,s===null?s=bd(n):(c=s.cachePool,c!==null?(j=pn._currentValue,c=c.parent!==j?{parent:j,pool:j}:c):c=Nh(),s={baseLanes:s.baseLanes|n,cachePool:c}),l.memoizedState=s,l.childLanes=xd(e,m,n),t.memoizedState=vd,Vo(e.child,l)):(fi(t),n=e.child,e=n.sibling,n=In(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=n,t.memoizedState=null,n)}function wd(e,t){return t=vr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function vr(e,t){return e=At(22,e,null,t),e.lanes=0,e}function br(e,t,n){return ts(t,e.child,null,n),e=wd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cv(e,t,n,l,s,c,m,j){if(n)return t.flags&256?(fi(t),t.flags&=-257,br(e,t,j)):t.memoizedState!==null?(hi(),t.child=e.child,t.flags|=128,null):(hi(),c=s.fallback,m=t.mode,s=vr({mode:"visible",children:s.children},m),c=Ki(c,m,j,null),c.flags|=2,s.return=t,c.return=t,s.sibling=c,t.child=s,ts(t,e.child,null,j),s=t.child,s.memoizedState=bd(j),s.childLanes=xd(e,l,j),t.memoizedState=vd,Vo(null,s));if(fi(t),xf(c)){if(l=c.nextSibling&&c.nextSibling.dataset,l)var A=l.dgst;return l=A,l!==""&&(s=Error(f(419)),s.stack="",s.digest=l,Oo({value:s,source:null,stack:null})),br(e,t,j)}if(vn||Fi(e,t,j,!1),l=(j&e.childLanes)!==0,vn||l){if(di.current!==null)return br(e,t,j);if(l=Bt,l!==null&&(s=Re(l,j),s!==0&&s!==m.retryLane))throw m.retryLane=s,tn(e,s),ha(l,e,s),pd;return bf(c)||_r(),br(e,t,j)}return bf(c)?(t.flags|=192,t.child=e.child,null):(e=m.treeContext,Lt=Ra(c.nextSibling),En=t,Ie=!0,li=null,Oa=!1,e!==null&&vh(t,e),t=wd(t,s.children),t.flags|=134221824,t)}function _m(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Ic(e.return,t,n)}function Hm(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&sr(n)===null&&(t=e),e=e.sibling}return t}function xr(e,t,n,l,s,c){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:s,treeForkCount:c}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=l,m.tail=n,m.tailMode=s,m.treeForkCount=c)}function Sd(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function jd(e,t,n){var l=t.pendingProps,s=l.revealOrder,c=l.tail;l=l.children;var m=Rn.current;if(t.flags&128)return Lo(t,m),null;var j=(m&2)!==0;if(j?(m=m&1|2,t.flags|=128):m&=1,Lo(t,m),s==="backwards"&&e!==null?(Sd(e),Sn(e,t,l,n),Sd(e)):Sn(e,t,l,n),l=Ie?Ao:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_m(e,n,t);else if(e.tag===19)_m(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}switch(s){case"backwards":n=Hm(t.child),n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null,Sd(t)),xr(t,!0,s,null,c,l);break;case"unstable_legacy-backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&sr(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}xr(t,!0,n,null,c,l);break;case"together":xr(t,!1,null,null,void 0,l);break;case"independent":t.memoizedState=null;break;default:n=Hm(t.child),n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),xr(t,!1,s,n,c,l)}return t.child}function Um(e,t,n){var l=t.pendingProps;return si(t,t.type,l.value),Sn(e,t,l.children,n),t.child}function Bl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),yi|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Fi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(f(153));if(t.child!==null){for(e=t.child,n=In(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=In(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Nd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Wc(e)))}function rv(e,t,n){switch(t.tag){case 3:B(t,t.stateNode.containerInfo),si(t,pn,e.memoizedState.cache),Zi();break;case 27:case 5:le(t);break;case 4:B(t,t.stateNode.containerInfo);break;case 10:si(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Fu(t),null;break;case 13:var l=t.memoizedState;if(l!==null){if(l.dehydrated!==null)return fi(t),t.flags|=128,null;l=Fi(e,t,n,!1);var s=t.child.childLanes;return l||(n&s)!==0?Bm(e,t,n):(fi(t),e=Bl(e,t,n),e!==null?e.sibling:null)}fi(t);break;case 19:if(t.flags&128)return jd(e,t,n);if(s=(e.flags&128)!==0,l=(n&t.childLanes)!==0,l||(Fi(e,t,n,!1),l=(n&t.childLanes)!==0),s){if(l)return jd(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Lo(t,Rn.current),l)break;return null;case 22:return t.lanes=0,zm(e,t,n,t.pendingProps);case 24:si(t,pn,e.memoizedState.cache)}return Bl(e,t,n)}function Lm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)vn=!0;else{if(!Nd(e,n)&&(t.flags&128)===0)return vn=!1,rv(e,t,n);vn=(e.flags&131072)!==0}else vn=!1,Ie&&(t.flags&1048576)!==0&&yh(t,Ao,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Pi(t.elementType),t.type=e,typeof e=="function")qt(e)?(l=as(e,l),t.tag=1,t=Rm(null,t,e,l,n)):(t.tag=0,t=yd(null,t,e,l,n));else{if(e!=null){var s=e.$$typeof;if(s===fe){t.tag=11,t=km(null,t,e,l,n);break e}else if(s===_e){t.tag=14,t=Cm(null,t,e,l,n);break e}else if(s===st){t.tag=10,t.type=e,t=Um(null,t,n);break e}}throw t=je(e)||e,Error(f(306,t,""))}}return t;case 0:return yd(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,s=as(l,t.pendingProps),Rm(e,t,l,s,n);case 3:e:{if(B(t,t.stateNode.containerInfo),e===null)throw Error(f(387));l=t.pendingProps;var c=t.memoizedState;s=c.element,Vu(e,t),Uo(t,l,null,n);var m=t.memoizedState;if(l=m.cache,si(t,pn,l),l!==c.cache&&Hu(t,[pn],n,!0),Ho(),l=m.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=$m(e,t,l,n);break e}else if(l!==s){s=Ma(Error(f(424)),t),Oo(s),t=$m(e,t,l,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Lt=Ra(e.firstChild),En=t,Ie=!0,li=null,Oa=!0,n=zh(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(Zi(),l===s){t=Bl(e,t,n);break e}Sn(e,t,l,n)}t=t.child}return t;case 26:return Bs(e,t),e===null?(n=dp(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ie||(t.stateNode=Vg(t.type,t.pendingProps,Kt.current,t)):t.memoizedState=dp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return le(t),e===null&&Ie&&(l=t.stateNode=op(t.type,t.pendingProps,Kt.current),En=t,Oa=!0,s=Lt,wi(t.type)?(wf=s,Lt=Ra(l.firstChild)):Lt=s),Sn(e,t,t.pendingProps.children,n),Bs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ie&&((s=l=Lt)&&(l=ab(l,t.type,t.pendingProps,Oa),l!==null?(t.stateNode=l,En=t,Lt=Ra(l.firstChild),Oa=!1,s=!0):s=!1),s||ii(t)),le(t),s=t.type,c=t.pendingProps,m=e!==null?e.memoizedProps:null,l=c.children,ff(s,c)?l=null:m!==null&&ff(s,m)&&(t.flags|=32),t.memoizedState!==null&&(s=Wu(e,t,Wy,null,null,n),eo._currentValue=s),Bs(e,t),Sn(e,t,l,n),t.child;case 6:return e===null&&Ie&&((e=n=Lt)&&(n=lb(n,t.pendingProps,Oa),n!==null?(t.stateNode=n,En=t,Lt=null,e=!0):e=!1),e||ii(t)),null;case 13:return Bm(e,t,n);case 4:return B(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=ts(t,null,l,n):Sn(e,t,l,n),t.child;case 11:return km(e,t,t.type,t.pendingProps,n);case 7:return l=t.pendingProps,Bs(e,t),Sn(e,t,l,n),t.child;case 8:return Sn(e,t,t.pendingProps.children,n),t.child;case 12:return Sn(e,t,t.pendingProps.children,n),t.child;case 10:return Um(e,t,n);case 9:return s=t.type._context,l=t.pendingProps.children,Ji(t),s=On(s),l=l(s),t.flags|=1,Sn(e,t,l,n),t.child;case 14:return Cm(e,t,t.type,t.pendingProps,n);case 15:return Mm(e,t,t.type,t.pendingProps,n);case 19:return jd(e,t,n);case 31:return ov(e,t,n);case 22:return zm(e,t,n,t.pendingProps);case 24:return Ji(t),l=On(pn),e===null?(s=Gu(),s===null&&(s=Bt,c=Uu(),s.pooledCache=c,c.refCount++,c!==null&&(s.pooledCacheLanes|=n),s=c),t.memoizedState={parent:l,cache:s},qu(t),si(t,pn,s)):((e.lanes&n)!==0&&(Vu(e,t),Uo(t,null,null,n),Ho()),s=e.memoizedState,c=t.memoizedState,s.parent!==l?(s={parent:l,cache:l},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),si(t,pn,l)):(l=c.cache,si(t,pn,l),l!==s.cache&&Hu(t,[pn],n,!0))),Sn(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=t.pendingProps,l.name!=null&&l.name!=="auto"?t.flags|=e===null?18882560:18874368:Ie&&Fc(t),e!==null&&e.memoizedProps.name!==l.name?t.flags|=4194816:Bs(e,t),Sn(e,t,l.children,n),t.child;case 29:throw t.pendingProps}throw Error(f(156,t.tag))}function _l(e){e.flags|=4}function Td(e,t,n,l,s){var c;if((c=(e.mode&32)!==0)&&(c=n===null?gp(t,l):gp(t,l)&&(l.src!==n.src||l.srcSet!==n.srcSet)),c){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(wg())e.flags|=8192;else throw es=nr,Yu}else e.flags&=-16777217}function Gm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!pp(t))if(wg())e.flags|=8192;else throw es=nr,Yu}function wr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Pa():536870912,e.lanes|=t,Gs|=t)}function Xo(e,t){if(!Ie)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function Gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,l|=s.subtreeFlags&1206910976,l|=s.flags&1206910976,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,l|=s.subtreeFlags,l|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function uv(e,t,n){var l=t.pendingProps;switch(Ru(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gt(t),null;case 1:return Gt(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Dl(pn),K(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ms(t)?_l(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Bu())),Gt(t),null;case 26:var s=t.type,c=t.memoizedState;return e===null?(_l(t),c!==null?(Gt(t),Gm(t,c)):(Gt(t),Td(t,s,null,l,n))):c?c!==e.memoizedState?(_l(t),Gt(t),Gm(t,c)):(Gt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&_l(t),Gt(t),Td(t,s,e,l,n)),null;case 27:if(be(t),n=Kt.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&_l(t);else{if(!l){if(t.stateNode===null)throw Error(f(166));return Gt(t),t.subtreeFlags&=-33554433,null}e=xn.current,Ms(t)?bh(t):(e=op(s,l,n),t.stateNode=e,_l(t))}return Gt(t),t.subtreeFlags&=-33554433,null;case 5:if(be(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&_l(t);else{if(!l){if(t.stateNode===null)throw Error(f(166));return Gt(t),t.subtreeFlags&=-33554433,null}if(c=xn.current,Ms(t))bh(t);else{var m=nc(Kt.current);switch(c){case 1:c=m.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:c=m.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":c=m.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":c=m.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":c=m.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof l.is=="string"?m.createElement("select",{is:l.is}):m.createElement("select"),l.multiple?c.multiple=!0:l.size&&(c.size=l.size);break;default:c=typeof l.is=="string"?m.createElement(s,{is:l.is}):m.createElement(s)}}c[he]=t,c[Mt]=l;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)c.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=c;e:switch(Bn(c,s,l),s){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&_l(t)}}return Gt(t),t.subtreeFlags&=-33554433,Td(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&_l(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(f(166));if(e=Kt.current,Ms(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,s=En,s!==null)switch(s.tag){case 27:case 5:l=s.memoizedProps}e[he]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||Lg(e.nodeValue,n)),e||ii(t,!0)}else e=nc(e).createTextNode(l),e[he]=t,t.stateNode=e}return Gt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Ms(t),n!==null){if(e===null){if(!l)throw Error(f(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(557));e[he]=t}else Zi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Gt(t),e=!1}else n=Bu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ba(t),t):(ba(t),null);if((t.flags&128)!==0)throw Error(f(558))}return Gt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Ms(t),l!==null&&l.dehydrated!==null){if(e===null){if(!s)throw Error(f(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(f(317));s[he]=t}else Zi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Gt(t),s=!1}else s=Bu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(ba(t),t):(ba(t),null)}return ba(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,s=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(s=l.alternate.memoizedState.cachePool.pool),c=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(c=l.memoizedState.cachePool.pool),c!==s&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),wr(t,t.updateQueue),Gt(t),null);case 4:return K(),e===null&&of(t.stateNode.containerInfo),t.flags|=67108864,Gt(t),null;case 10:return Dl(t.type),Gt(t),null;case 19:if(Ju(t),l=t.memoizedState,l===null)return Gt(t),null;if(s=(t.flags&128)!==0,c=l.rendering,c===null)if(s)Xo(l,!1);else{if(an!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=sr(e),c!==null){for(t.flags|=128,Xo(l,!1),e=c.updateQueue,t.updateQueue=e,wr(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)zo(n,e),n=n.sibling;return Lo(t,Rn.current&1|2),Ie&&Al(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Vt()>Dr&&(t.flags|=128,s=!0,Xo(l,!1),t.lanes=4194304)}else{if(!s)if(e=sr(c),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,wr(t,e),Xo(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!c.alternate&&!Ie)return Gt(t),null}else 2*Vt()-l.renderingStartTime>Dr&&n!==536870912&&(t.flags|=128,s=!0,Xo(l,!1),t.lanes=4194304);l.isBackwards?(c.sibling=t.child,t.child=c):(e=l.last,e!==null?e.sibling=c:t.child=c,l.last=c)}if(l.tail!==null){e=l.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Vt(),e.sibling=null,c=Rn.current,c=s?c&1|2:c&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!n||Ie?Lo(t,c):(n=c,Le(Dn,t),Le(Rn,n),Vn===null&&(Vn=t)),Ie&&Al(t,l.treeForkCount),e}return Gt(t),null;case 22:case 23:return ba(t),Qu(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(Gt(t),t.subtreeFlags&6&&(t.flags|=8192)):Gt(t),n=t.updateQueue,n!==null&&wr(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&at(Wi),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Dl(pn),Gt(t),null;case 25:return null;case 30:return t.flags|=33554432,Gt(t),null}throw Error(f(156,t.tag))}function dv(e,t){switch(Ru(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Dl(pn),K(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return be(t),null;case 31:if(t.memoizedState!==null){if(ba(t),t.alternate===null)throw Error(f(340));Zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ba(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(f(340));Zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ju(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return K(),null;case 10:return Dl(t.type),null;case 22:case 23:return ba(t),Qu(),e!==null&&at(Wi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Dl(pn),null;case 25:return null;default:return null}}function Ym(e,t){switch(Ru(t),t.tag){case 3:Dl(pn),K();break;case 26:case 27:case 5:be(t);break;case 4:K();break;case 31:t.memoizedState!==null&&ba(t);break;case 13:ba(t);break;case 19:Ju(t);break;case 10:Dl(t.type);break;case 22:case 23:ba(t),Qu(),e!==null&&at(Wi);break;case 24:Dl(pn)}}function Ko(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var s=l.next;n=s;do{if((n.tag&e)===e){l=void 0;var c=n.create,m=n.inst;l=c(),m.destroy=l}n=n.next}while(n!==s)}}catch(j){Nt(t,t.return,j)}}function mi(e,t,n){try{var l=t.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var c=s.next;l=c;do{if((l.tag&e)===e){var m=l.inst,j=m.destroy;if(j!==void 0){m.destroy=void 0,s=t;var A=n,L=j;try{L()}catch(F){Nt(s,A,F)}}}l=l.next}while(l!==c)}}catch(F){Nt(t,t.return,F)}}function qm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Oh(t,n)}catch(l){Nt(e,e.return,l)}}}function Vm(e,t,n){n.props=as(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Nt(e,t,l)}}function fl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var s=e.stateNode,c=z(e.memoizedProps,s);(s.ref===null||s.ref.name!==c)&&(s.ref=Ig(c)),l=s.ref;break;case 7:if(e.stateNode===null){var m=new Na(e);x(e.child,!1,tb,m,void 0,void 0),e.stateNode=m}l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(j){Nt(e,t,j)}}function $n(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(s){Nt(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(s){Nt(e,t,s)}else n.current=null}function Sr(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)ap(e.stateNode,t[n])}function Xm(e){for(var t=e.return;t!==null&&(kd(t)&&ap(e.stateNode,t.stateNode),!Ed(t));)t=t.return}function Zo(e){for(var t=e.return;t!==null&&(kd(t)&&nb(e.stateNode,t.stateNode),!Ed(t));)t=t.return}function Ed(e){return e.tag===5||e.tag===3||e.tag===27}function kd(e){return e&&e.tag===7&&e.stateNode!==null}function Cd(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(s){Nt(e,e.return,s)}}function Md(e,t,n){try{var l=e.stateNode;_v(l,e.type,n,t),l[Mt]=t}catch(s){Nt(e,e.return,s)}}function Km(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wi(e.type)||e.tag===4}function zd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Km(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.tag===27&&wi(e.type)||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 Ad(e,t,n,l){var s=e.tag;if(s===5||s===6)s=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(s,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(s),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ga)),Sr(e,l),ot=!0;else if(s!==4&&(s===27&&(Sr(e,l),l=null,wi(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ad(e,t,n,l),e=e.sibling;e!==null;)Ad(e,t,n,l),e=e.sibling}function jr(e,t,n,l){var s=e.tag;if(s===5||s===6)s=e.stateNode,t?n.insertBefore(s,t):n.appendChild(s),Sr(e,l),ot=!0;else if(s!==4&&(s===27&&(Sr(e,l),l=null,wi(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(jr(e,t,n,l),e=e.sibling;e!==null;)jr(e,t,n,l),e=e.sibling}function Zm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);Bn(t,l,n),t[he]=e,t[Mt]=n}catch(c){Nt(e,e.return,c)}}var Nr=!1,xa=null;function Qm(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Nr=!0)}var hl=null;function Fm(){var e=hl;return hl=null,e}var ua=0;function _s(e,t,n,l,s){return ua=0,Jm(e.child,t,n,l,s)}function Jm(e,t,n,l,s){for(var c=!1;e!==null;){if(e.tag===5){var m=e.stateNode;if(l!==null){var j=gf(m);l.push(j),j.view&&(c=!0)}else c||gf(m).view&&(c=!0);Nr=!0,Fg(m,ua===0?t:t+"_"+ua,n),ua++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&s||Jm(e.child,t,n,l,s)&&(c=!0));e=e.sibling}return c}function ml(e,t){for(;e!==null;)e.tag===5?Jg(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||ml(e.child,t)),e=e.sibling}function Tr(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Tr(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(f(544));var n=t.name;t=te(t.default,t.share),t!=="none"&&(_s(e,n,t,null,!1)||ml(e.child,!1))}e=e.sibling}}function Od(e,t){if(e.tag===30){var n=e.stateNode,l=e.memoizedProps,s=z(l,n),c=te(l.default,n.paired?l.share:l.enter);c!=="none"?_s(e,s,c,null,!1)?(Tr(e),n.paired||t||Xs(e,l.onEnter)):ml(e.child,!1):Tr(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Od(e,t),e=e.sibling;else Tr(e)}function Dd(e){if(xa!==null&&xa.size!==0){var t=xa;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var n=e.memoizedProps,l=n.name;if(l!=null&&l!=="auto"){var s=t.get(l);if(s!==void 0){var c=te(n.default,n.share);if(c!=="none"&&(_s(e,l,c,null,!1)?(c=e.stateNode,s.paired=c,c.paired=s,Xs(e,n.onShare)):ml(e.child,!1)),t.delete(l),t.size===0)break}}}Dd(e)}e=e.sibling}}}function Rd(e){if(e.tag===30){var t=e.memoizedProps,n=z(t,e.stateNode),l=xa!==null?xa.get(n):void 0,s=te(t.default,l!==void 0?t.share:t.exit);s!=="none"&&(_s(e,n,s,null,!1)?l!==void 0?(s=e.stateNode,l.paired=s,s.paired=l,xa.delete(n),Xs(e,t.onShare)):Xs(e,t.onExit):ml(e.child,!1)),xa!==null&&Dd(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Rd(e),e=e.sibling;else xa!==null&&Dd(e)}function Im(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=z(t,e.stateNode);t=te(t.default,t.update),e.flags&=-5,t!=="none"&&_s(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Im(e);e=e.sibling}}function $d(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,ml(e.child,!1))}$d(e)}e=e.sibling}}function Er(e){if(e.tag===30)e.stateNode.paired=null,ml(e.child,!1),$d(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Er(e),e=e.sibling;else $d(e)}function Wm(e){for(e=e.child;e!==null;)e.tag===30?ml(e.child,!1):(e.subtreeFlags&33554432)!==0&&Wm(e),e=e.sibling}function Bd(e,t,n,l,s,c,m){for(var j=!1;t!==null;){if(t.tag===5){var A=t.stateNode;if(c!==null&&ua<c.length){var L=c[ua],F=gf(A);(L.view||F.view)&&(j=!0);var ie;if(ie=(e.flags&4)===0)if(F.clip)ie=!0;else{ie=L.rect;var H=F.rect;ie=ie.y!==H.y||ie.x!==H.x||ie.height!==H.height||ie.width!==H.width}ie&&(e.flags|=4),F.abs?F=!L.abs:(L=L.rect,F=F.rect,F=L.height!==F.height||L.width!==F.width),F&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Fg(A,ua===0?n:n+"_"+ua,s),j&&(e.flags&4)!==0||(hl===null&&(hl=[]),hl.push(A,ua===0?l:l+"_"+ua,t.memoizedProps)),ua++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&m?e.flags|=t.flags&32:Bd(e,t.child,n,l,s,c,m)&&(j=!0));t=t.sibling}return j}function Pm(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,l=e.stateNode,s=z(n,l),c=te(n.default,n.update),m;m=e.memoizedState,e.memoizedState=null,l=e;var j=e.child;ua=0,s=Bd(l,j,s,s,c,m,!1),(e.flags&4)!==0&&s&&Xs(e,n.onUpdate)}else(e.subtreeFlags&33554432)!==0&&Pm(e);e=e.sibling}}var kn=!1,bt=!1,gl=!1,_d=!1,eg=typeof WeakSet=="function"?WeakSet:Set,Cn=null,pl=!1,Qo=!1,kr=!1,Hd=!1;function fv(e,t,n){if(e=e.containerInfo,uf=to,e=So(e),jo(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var s=l.getSelection&&l.getSelection();if(s&&s.rangeCount!==0){l=s.anchorNode;var c=s.anchorOffset,m=s.focusNode;s=s.focusOffset;try{l.nodeType,m.nodeType}catch{l=null;break e}var j=0,A=-1,L=-1,F=0,ie=0,H=e,V=null;t:for(;;){for(var pe;H!==l||c!==0&&H.nodeType!==3||(A=j+c),H!==m||s!==0&&H.nodeType!==3||(L=j+s),H.nodeType===3&&(j+=H.nodeValue.length),(pe=H.firstChild)!==null;)V=H,H=pe;for(;;){if(H===e)break t;if(V===l&&++F===c&&(A=j),V===m&&++ie===s&&(L=j),(pe=H.nextSibling)!==null)break;H=V,V=H.parentNode}H=pe}l=A===-1||L===-1?null:{start:A,end:L}}else l=null}l=l||{start:0,end:0}}else l=null;for(df={focusedElem:e,selectionRange:l},to=!1,n=(n&335544064)===n,Cn=t,t=n?9270:1024;Cn!==null;){if(e=Cn,n&&(l=e.deletions,l!==null))for(c=0;c<l.length;c++)n&&Rd(l[c]);if(e.alternate===null&&(e.flags&2)!==0)n&&Qm(e),Cr(n);else{if(e.tag===22){if(l=e.alternate,e.memoizedState!==null){l!==null&&l.memoizedState===null&&n&&Rd(l),Cr(n);continue}else if(l!==null&&l.memoizedState!==null){n&&Qm(e),Cr(n);continue}}l=e.child,(e.subtreeFlags&t)!==0&&l!==null?(l.return=e,Cn=l):(n&&Im(e),Cr(n))}}xa=null}function Cr(e){for(;Cn!==null;){var t=Cn,n=e,l=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((s&1024)!==0&&l!==null){n=void 0,s=l.memoizedProps,l=l.memoizedState;var c=t.stateNode;try{var m=as(t.type,s);n=c.getSnapshotBeforeUpdate(m,l),c.__reactInternalSnapshotBeforeUpdate=n}catch(j){Nt(t,t.return,j)}}break;case 3:if((s&1024)!==0){if(l=t.stateNode.containerInfo,n=l.nodeType,n===9)vf(l);else if(n===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":vf(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&l!==null&&(n=z(l.memoizedProps,l.stateNode),s=t.memoizedProps,s=te(s.default,s.update),s!=="none"&&_s(l,n,s,l.memoizedState=[],!0));break;default:if((s&1024)!==0)throw Error(f(163))}if(l=t.sibling,l!==null){l.return=t.return,Cn=l;break}Cn=t.return}}function tg(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:yl(e,n),l&4&&Ko(5,n);break;case 1:if(yl(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(m){Nt(n,n.return,m)}else{var s=as(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){Nt(n,n.return,m)}}l&64&&qm(n),l&512&&fl(n,n.return);break;case 3:if(yl(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Oh(e,t)}catch(m){Nt(n,n.return,m)}}break;case 27:t===null&&l&4&&Zm(n);case 26:case 5:yl(e,n),t===null&&l&4&&Cd(n),l&512&&fl(n,n.return);break;case 12:yl(e,n);break;case 31:yl(e,n),l&4&&ig(e,n);break;case 13:yl(e,n),l&4&&sg(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Nv.bind(null,n),ib(e,n))));break;case 22:if(l=n.memoizedState!==null||kn,!l){var c=t!==null&&t.memoizedState!==null||bt;t=kn,s=bt,kn=l,(bt=c)&&!s?(l=2,(n.subtreeFlags&8772)!==0&&(l|=1),Va(e,n,l)):yl(e,n),kn=t,bt=s}break;case 30:yl(e,n),l&512&&fl(n,n.return);break;case 7:l&512&&fl(n,n.return);default:yl(e,n)}}function Ud(e,t){for(e=e.child;e!==null;)ng(e,t),e=e.sibling}function ng(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var l=n.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var s=e.stateNode,c=e.memoizedProps.style,m=c!=null&&c.hasOwnProperty("display")?c.display:null;s.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(A){Nt(e,e.return,A)}Ld(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,ot=!0}catch(A){Nt(e,e.return,A)}break;case 18:try{var j=e.stateNode;t?Qg(j,!0):Qg(e.stateNode,!1)}catch(A){Nt(e,e.return,A)}break;case 22:case 23:e.memoizedState===null&&Ud(e,t);break;default:Ud(e,t)}}function Ld(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,l=t;switch(n.tag){case 4:ng(n,l);break e;case 22:n.memoizedState===null&&Ld(n,l);break e;default:Ld(n,l)}}e=e.sibling}}function ag(e){var t=e.alternate;t!==null&&(e.alternate=null,ag(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nl(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Xt=null,da=!1;function Ya(e,t,n){for(n=n.child;n!==null;)lg(e,t,n),n=n.sibling}function lg(e,t,n){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(Ln,n)}catch{}switch(n.tag){case 26:bt||$n(n,t),Ya(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!bt&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:bt||$n(n,t),Zo(n);var l=Xt,s=da;wi(n.type)&&(Xt=n.stateNode,da=!1),Ya(e,t,n),cp(n.stateNode,n.type,n.memoizedProps),Xt=l,da=s;break;case 5:bt||$n(n,t),Zo(n);case 6:if(n.tag===6&&Zo(n),l=Xt,s=da,Xt=null,Ya(e,t,n),Xt=l,da=s,Xt!==null)if(da)try{(Xt.nodeType===9?Xt.body:Xt.nodeName==="HTML"?Xt.ownerDocument.body:Xt).removeChild(n.stateNode),ot=!0}catch(c){Nt(n,t,c)}else try{Xt.removeChild(n.stateNode),ot=!0}catch(c){Nt(n,t,c)}break;case 18:Xt!==null&&(da?(e=Xt,Zg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),no(e)):Zg(Xt,n.stateNode));break;case 4:l=Xt,s=da,Xt=n.stateNode.containerInfo,da=!0,Ya(e,t,n),Xt=l,da=s;break;case 0:case 11:case 14:case 15:mi(2,n,t),bt||mi(4,n,t),Ya(e,t,n);break;case 1:bt||($n(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Vm(n,t,l)),Ya(e,t,n);break;case 21:Ya(e,t,n);break;case 22:bt=(l=bt)||n.memoizedState!==null,Ya(e,t,n),bt=l;break;case 30:$n(n,t),Ya(e,t,n);break;case 7:bt||$n(n,t),Ya(e,t,n);break;default:Ya(e,t,n)}}function ig(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{no(e)}catch(n){Nt(t,t.return,n)}}}function sg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{no(e)}catch(n){Nt(t,t.return,n)}}function hv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new eg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new eg),t;default:throw Error(f(435,e.tag))}}function Mr(e,t){var n=hv(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var s=Tv.bind(null,e,l);l.then(s,s)}})}function Pn(e,t,n){var l=t.deletions;if(l!==null)for(var s=0;s<l.length;s++){var c=l[s],m=e,j=t,A=j;e:for(;A!==null;){switch(A.tag){case 27:if(wi(A.type)){Xt=A.stateNode,da=!1;break e}break;case 5:Xt=A.stateNode,da=!1;break e;case 3:case 4:Xt=A.stateNode.containerInfo,da=!0;break e}A=A.return}if(Xt===null)throw Error(f(160));lg(m,j,c),Xt=null,da=!1,m=c.alternate,m!==null&&(m.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)og(t,e,n),t=t.sibling}var qa=null;function og(e,t,n){var l=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(s&4&&(l=e.updateQueue,l=l!==null?l.events:null,l!==null))for(var c=0;c<l.length;c++){var m=l[c];m.ref.impl=m.nextImpl}Pn(t,e,n),ea(e),s&4&&(mi(3,e,e.return),Ko(3,e),mi(5,e,e.return));break;case 1:Pn(t,e,n),ea(e),s&512&&(bt||l===null||$n(l,l.return)),s&64&&kn&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(c=qa,Pn(t,e,n),ea(e),s&512&&(bt||l===null||$n(l,l.return)),s&4)if(s=l!==null?l.memoizedState:null,n=e.memoizedState,l===null)if(n===null)if(e.stateNode===null)if(kn)e.stateNode=Vg(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,s=c.ownerDocument||c;t:switch(t){case"title":l=s.getElementsByTagName("title")[0],(!l||l[el]||l[he]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=s.createElement(t),s.head.insertBefore(l,s.querySelector("head > title"))),Bn(l,t,n),l[he]=e,un(l),t=l;break e;case"link":if(c=mp("link","href",s).get(t+(n.href||""))){for(m=0;m<c.length;m++)if(l=c[m],l.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&l.getAttribute("rel")===(n.rel==null?null:n.rel)&&l.getAttribute("title")===(n.title==null?null:n.title)&&l.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){c.splice(m,1);break t}}l=s.createElement(t),Bn(l,t,n),s.head.appendChild(l);break;case"meta":if(c=mp("meta","content",s).get(t+(n.content||""))){for(m=0;m<c.length;m++)if(l=c[m],l.getAttribute("content")===(n.content==null?null:""+n.content)&&l.getAttribute("name")===(n.name==null?null:n.name)&&l.getAttribute("property")===(n.property==null?null:n.property)&&l.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&l.getAttribute("charset")===(n.charSet==null?null:n.charSet)){c.splice(m,1);break t}}l=s.createElement(t),Bn(l,t,n),s.head.appendChild(l);break;default:throw Error(f(468,t))}l[he]=e,un(l),t=l}e.stateNode=t}else kn||Tf(c,e.type,e.stateNode);else e.stateNode=hp(c,n,e.memoizedProps);else s!==n?(s===null?(t=l.stateNode,t===null||bt||t.parentNode.removeChild(t)):s.count--,n===null?kn||Tf(c,e.type,e.stateNode):hp(c,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Md(e,e.memoizedProps,l.memoizedProps);break;case 27:Pn(t,e,n),ea(e),s&512&&(bt||l===null||$n(l,l.return)),l!==null&&s&4&&Md(e,e.memoizedProps,l.memoizedProps);break;case 5:if(c=gl,gl=!1,Pn(t,e,n),gl=c,ea(e),s&512&&(bt||l===null||$n(l,l.return)),e.flags&32){t=e.stateNode;try{mn(t,""),ot=!0}catch(F){Nt(e,e.return,F)}}s&4&&e.stateNode!=null&&(t=e.memoizedProps,Md(e,t,l!==null?l.memoizedProps:t)),s&1024&&(_d=!0);break;case 6:if(Pn(t,e,n),ea(e),s&4){if(e.stateNode===null)throw Error(f(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,ot=!0}catch(F){Nt(e,e.return,F)}}break;case 3:if(ot=!1,Vr=null,c=qa,qa=ac(t.containerInfo),Pn(t,e,n),qa=c,ea(e),s&4&&l!==null&&l.memoizedState.isDehydrated)try{no(t.containerInfo)}catch(F){Nt(e,e.return,F)}_d&&(_d=!1,cg(e)),ot=!1;break;case 4:s=gl,gl=kn,l=ro(),c=qa,qa=ac(e.stateNode.containerInfo),Pn(t,e,n),ea(e),qa=c,ot&&Qo&&(kr=!0),ot=l,gl=s;break;case 12:Pn(t,e,n),ea(e);break;case 31:Pn(t,e,n),ea(e),s&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Mr(e,t)));break;case 13:Pn(t,e,n),ea(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Or=Vt()),s&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Mr(e,t)));break;case 22:c=e.memoizedState!==null,m=l!==null&&l.memoizedState!==null;var j=kn,A=bt,L=gl;kn=j||c,gl=L||c,bt=A||m,Pn(t,e,n),bt=A,gl=L,kn=j,ea(e),s&8192&&(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,!c||l===null||m||kn||bt||(t=m||bt,n=kn,l=bt,kn=c||kn,bt=t,gi(e,2),kn=n,bt=l),!c&&gl||Ud(e,c)),s&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Mr(e,n))));break;case 19:Pn(t,e,n),ea(e),s&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Mr(e,t)));break;case 30:s&512&&(bt||l===null||$n(l,l.return)),s=ro(),c=Qo,m=(n&335544064)===n,j=e.memoizedProps,Qo=m&&te(j.default,j.update)!=="none",Pn(t,e,n),ea(e),m&&l!==null&&ot&&(e.flags|=4),Qo=c,ot=s;break;case 21:break;case 7:s&512&&(bt||l===null||$n(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=e);default:Pn(t,e,n),ea(e)}}function ea(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Km(l)){n=l;break}l=l.return}l=null;for(var s=e.return;s!==null;){if(kd(s)){var c=s.stateNode;l===null?l=[c]:l.push(c)}if(Ed(s))break;s=s.return}var m=l;if(n==null)throw Error(f(160));switch(n.tag){case 27:var j=n.stateNode,A=zd(e);jr(e,A,j,m);break;case 5:var L=n.stateNode;n.flags&32&&(mn(L,""),n.flags&=-33);var F=zd(e);jr(e,F,L,m);break;case 3:case 4:var ie=n.stateNode.containerInfo,H=zd(e);Ad(e,H,ie,m);break;default:throw Error(f(161))}}catch(V){Nt(e,e.return,V)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function cg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;cg(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,to=!0,t.reset(),to=!1),e=e.sibling}}function Hs(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)rg(t,e),t=t.sibling;else Pm(t)}function rg(e,t){var n=e.alternate;if(n===null)Od(e,!1);else switch(e.tag){case 3:if(Hd=pl=!1,Fm(),Hs(t,e),!pl&&!kr){if(e=hl,e!==null)for(var l=0;l<e.length;l+=3){n=e[l];var s=e[l+1];Jg(n,e[l+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+s+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Hd=!0}hl=null;break;case 5:Hs(t,e);break;case 4:l=pl,pl=!1,Hs(t,e),pl&&(kr=!0),pl=l;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?Od(e,!1):Hs(t,e));break;case 30:l=pl,s=Fm(),pl=!1,Hs(t,e),pl&&(e.flags|=4);var c=e.memoizedProps,m=e.stateNode;t=z(c,m),m=z(n.memoizedProps,m);var j=te(c.default,c.update);j==="none"?t=!1:(c=n.memoizedState,n.memoizedState=null,n=e.child,ua=0,t=Bd(e,n,t,m,j,c,!0),ua!==(c===null?0:c.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Xs(e,e.memoizedProps.onUpdate),hl=s):s!==null&&(s.push.apply(s,hl),hl=s),pl=(e.flags&32)!==0?!0:l;break;default:Hs(t,e)}}function yl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)tg(e,t.alternate,t),t=t.sibling}function gi(e,t){for(e=e.child;e!==null;){var n=e,l=t;switch(n.tag){case 0:case 11:case 14:case 15:mi(4,n,n.return),gi(n,l);break;case 1:$n(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&Vm(n,n.return,s),gi(n,l);break;case 27:(l&2)!==0&&cp(n.stateNode,n.type,n.memoizedProps);case 5:$n(n,n.return),n.tag!==5&&n.tag!==27||Zo(n),gi(n,l);break;case 6:Zo(n);break;case 26:$n(n,n.return),s=n.stateNode,n.memoizedState!==null||s===null||bt||s.parentNode.removeChild(s),gi(n,l);break;case 22:n.memoizedState===null&&gi(n,l);break;case 30:$n(n,n.return),gi(n,l);break;case 7:$n(n,n.return);default:gi(n,l)}e=e.sibling}}function Va(e,t,n){for(n=(t.subtreeFlags&8772)!==0?n:n&-2,t=t.child;t!==null;){var l=t.alternate,s=e,c=t,m=c.flags,j=(n&1)!==0;switch(c.tag){case 0:case 11:case 15:Va(s,c,n),Ko(4,c);break;case 1:if(Va(s,c,n),l=c,s=l.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(F){Nt(l,l.return,F)}if(l=c,s=l.updateQueue,s!==null){var A=l.stateNode;try{var L=s.shared.hiddenCallbacks;if(L!==null)for(s.shared.hiddenCallbacks=null,s=0;s<L.length;s++)Ah(L[s],A)}catch(F){Nt(l,l.return,F)}}j&&m&64&&qm(c),fl(c,c.return);break;case 27:(n&2)!==0&&Zm(c);case 5:c.tag!==5&&c.tag!==27||Xm(c),Va(s,c,n),j&&l===null&&m&4&&Cd(c),fl(c,c.return);break;case 6:Xm(c);break;case 26:A=c.stateNode,c.memoizedState!==null||A===null||kn||Tf(ac(A.ownerDocument),c.type,A),Va(s,c,n),j&&l===null&&m&4&&Cd(c),fl(c,c.return);break;case 12:Va(s,c,n);break;case 31:Va(s,c,n),j&&m&4&&ig(s,c);break;case 13:Va(s,c,n),j&&m&4&&sg(s,c);break;case 22:c.memoizedState===null&&Va(s,c,n),fl(c,c.return);break;case 30:Va(s,c,n),fl(c,c.return);break;case 7:fl(c,c.return);default:Va(s,c,n)}t=t.sibling}}function Gd(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Do(n))}function Yd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Do(e))}function Da(e,t,n,l){var s=(n&335544064)===n;if(t.subtreeFlags&(s?10262:10256))for(t=t.child;t!==null;)ug(e,t,n,l),t=t.sibling;else s&&Wm(t)}function ug(e,t,n,l){var s=(n&335544064)===n;s&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Er(t);var c=t.flags;switch(t.tag){case 0:case 11:case 15:Da(e,t,n,l),c&2048&&Ko(9,t);break;case 1:Da(e,t,n,l);break;case 3:Da(e,t,n,l),s&&Hd&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),c&2048&&(c=null,t.alternate!==null&&(c=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==c&&(t.refCount++,c!=null&&Do(c)));break;case 12:if(c&2048){Da(e,t,n,l),c=t.stateNode;try{var m=t.memoizedProps,j=m.id,A=m.onPostCommit;typeof A=="function"&&A(j,t.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(L){Nt(t,t.return,L)}}else Da(e,t,n,l);break;case 31:Da(e,t,n,l);break;case 13:Da(e,t,n,l);break;case 23:break;case 22:m=t.stateNode,j=t.alternate,t.memoizedState!==null?(s&&j!==null&&j.memoizedState===null&&Er(j),m._visibility&2?Da(e,t,n,l):Fo(e,t)):(s&&j!==null&&j.memoizedState!==null&&Er(t),m._visibility&2?Da(e,t,n,l):(m._visibility|=2,Us(e,t,n,l,(t.subtreeFlags&10256)!==0||!1))),c&2048&&Gd(j,t);break;case 24:Da(e,t,n,l),c&2048&&Yd(t.alternate,t);break;case 30:s&&(c=t.alternate,c!==null&&(ml(c.child,!0),ml(t.child,!0))),Da(e,t,n,l);break;default:Da(e,t,n,l)}}function Us(e,t,n,l,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,m=t,j=n,A=l,L=m.flags;switch(m.tag){case 0:case 11:case 15:Us(c,m,j,A,s),Ko(8,m);break;case 23:break;case 22:var F=m.stateNode;m.memoizedState!==null?F._visibility&2?Us(c,m,j,A,s):Fo(c,m):(F._visibility|=2,Us(c,m,j,A,s)),s&&L&2048&&Gd(m.alternate,m);break;case 24:Us(c,m,j,A,s),s&&L&2048&&Yd(m.alternate,m);break;default:Us(c,m,j,A,s)}t=t.sibling}}function Fo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,s=l.flags;switch(l.tag){case 22:Fo(n,l),s&2048&&Gd(l.alternate,l);break;case 24:Fo(n,l),s&2048&&Yd(l.alternate,l);break;default:Fo(n,l)}t=t.sibling}}var ls=8192;function is(e,t,n){if(e.subtreeFlags&ls)for(e=e.child;e!==null;)dg(e,t,n),e=e.sibling}function dg(e,t,n){switch(e.tag){case 26:is(e,t,n),e.flags&ls&&(e.memoizedState!==null?bb(n,qa,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&vp(n,e)));break;case 5:is(e,t,n),e.flags&ls&&(e=e.stateNode,(t&335544128)===t&&vp(n,e));break;case 3:case 4:var l=qa;qa=ac(e.stateNode.containerInfo),is(e,t,n),qa=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=ls,ls=16777216,is(e,t,n),ls=l):is(e,t,n));break;case 30:if((e.flags&ls)!==0&&(l=e.memoizedProps.name,l!=null&&l!=="auto")){var s=e.stateNode;s.paired=null,xa===null&&(xa=new Map),xa.set(l,s)}is(e,t,n);break;default:is(e,t,n)}}function fg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Jo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Cn=l,mg(l,e)}fg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)hg(e),e=e.sibling}function hg(e){switch(e.tag){case 0:case 11:case 15:Jo(e),e.flags&2048&&mi(9,e,e.return);break;case 3:Jo(e);break;case 12:Jo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,zr(e)):Jo(e);break;default:Jo(e)}}function zr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Cn=l,mg(l,e)}fg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:mi(8,t,t.return),zr(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,zr(t));break;default:zr(t)}e=e.sibling}}function mg(e,t){for(;Cn!==null;){var n=Cn;switch(n.tag){case 0:case 11:case 15:mi(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Do(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Cn=l;else e:for(n=e;Cn!==null;){l=Cn;var s=l.sibling,c=l.return;if(ag(l),l===n){Cn=null;break e}if(s!==null){s.return=c,Cn=s;break e}Cn=c}}}var mv={getCacheForType:function(e){var t=On(pn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return On(pn).controller.signal}},gv=typeof WeakMap=="function"?WeakMap:Map,vt=0,Bt=null,tt=null,lt=0,jt=0,wa=null,pi=!1,Ls=!1,qd=!1,Hl=0,an=0,yi=0,ss=0,Ar=0,Sa=0,Gs=0,Io=null,fa=null,Vd=!1,Or=0,gg=0,Dr=1/0,Rr=null,vi=null,It=0,Xa=null,os=null,vl=0,Xd=0,Kd=null,pg=null,Ys=null,qs=null,Vs=null,Wo=0,$r=null;function ja(){return(vt&2)!==0&&lt!==0?lt&-lt:me.T!==null?nf():Pt()}function yg(){if(Sa===0)if((lt&536870912)===0||Ie){var e=Ua;Ua<<=1,(Ua&3932160)===0&&(Ua=262144),Sa=e}else Sa=536870912;return e=Dn.current,e!==null&&(e.flags|=32),Sa}function Xs(e,t){if(t!=null){var n=e.stateNode,l=n.ref;l===null&&(l=n.ref=Ig(z(e.memoizedProps,n))),qs===null&&(qs=[]),qs.push(t.bind(null,l))}}function ha(e,t,n){(e===Bt&&(jt===2||jt===9)||e.cancelPendingCommit!==null)&&(Ks(e,0),bi(e,lt,Sa,!1)),M(e,n),((vt&2)===0||e!==Bt)&&(e===Bt&&((vt&2)===0&&(ss|=n),an===4&&bi(e,lt,Sa,!1)),bl(e))}function vg(e,t,n){if((vt&6)!==0)throw Error(f(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Wa(e,t),s=l?vv(e,t):Qd(e,t,!0),c=l;do{if(s===0){Ls&&!l&&bi(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!pv(n)){s=Qd(e,t,!1),c=!1;continue}if(s===2){if(c=t,e.errorRecoveryDisabledLanes&c)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var j=e;s=Io;var A=j.current.memoizedState.isDehydrated;if(A&&(Ks(j,m).flags|=256),m=Qd(j,m,!1),m!==2&&m!==6){if(qd&&!A){j.errorRecoveryDisabledLanes|=c,ss|=c,s=4;break e}c=fa,fa=s,c!==null&&(fa===null?fa=c:fa.push.apply(fa,c))}s=m}if(c=!1,s!==2)continue}}if(s===1){Ks(e,0),bi(e,t,0,!0);break}e:{switch(l=e,c=s,c){case 0:case 1:throw Error(f(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:bi(l,t,Sa,!pi);break e;case 2:fa=null;break;case 3:case 5:break;default:throw Error(f(329))}if((t&62914560)===t&&(s=Or+300-Vt(),10<s)){if(bi(l,t,Sa,!pi),aa(l,0,!0)!==0)break e;vl=t,l.timeoutHandle=mf(bg.bind(null,l,n,fa,Rr,Vd,t,Sa,ss,Gs,pi,c,"Throttled",-0,0),s);break e}bg(l,n,fa,Rr,Vd,t,Sa,ss,Gs,pi,c,null,-0,0)}}break}while(!0);bl(e)}function bg(e,t,n,l,s,c,m,j,A,L,F,ie,H,V){e.timeoutHandle=-1;var pe=t.subtreeFlags,Ee=(c&335544064)===c;if(ie=null,(Ee||pe&8192||(pe&16785408)===16785408)&&(ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ga},xa=null,dg(t,c,ie),Ee&&(pe=ie,Ee=e.containerInfo,Ee=(Ee.nodeType===9?Ee:Ee.ownerDocument).__reactViewTransition,Ee!=null&&(pe.count++,pe.waitingForViewTransition=!0,pe=sc.bind(pe),Ee.finished.then(pe,pe))),pe=(c&62914560)===c?Or-Vt():(c&4194048)===c?gg-Vt():0,pe=xb(ie,pe),pe!==null)){vl=c,e.cancelPendingCommit=pe(kg.bind(null,e,t,c,n,l,s,m,j,A,L,F,ie,null,H,V)),bi(e,c,m,!L);return}kg(e,t,c,n,l,s,m,j,A,L,F,ie)}function pv(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var s=n[l],c=s.getSnapshot;s=s.value;try{if(!An(c(),s))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 bi(e,t,n,l){t=jl(e,t),t&=~Ar,t&=~ss,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var s=t;0<s;){var c=31-hn(s),m=1<<c;l[c]=-1,s&=~m}n!==0&&Me(e,n,t)}function Br(){return(vt&6)===0?(Po(0),!1):!0}function Zd(){if(tt!==null){if(jt===0)var e=tt.return;else e=tt,Ol=Qi=null,td(e),Os=null,Bo=0,e=tt;for(;e!==null;)Ym(e.alternate,e),e=e.return;tt=null}}function Ks(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Lv(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),vl=0,Zd(),Bt=e,tt=n=In(e.current,null),lt=t,jt=0,wa=null,pi=!1,Ls=Wa(e,t),qd=!1,Gs=Sa=Ar=ss=yi=an=0,fa=Io=null,Vd=!1,Hl=jl(e,t),pt(),n}function xg(e,t){Ve=null,me.H=gr,t===As||t===tr?(t=kh(),jt=3):t===Yu?(t=kh(),jt=4):jt=t===pd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,wa=t,tt===null&&(an=1,pr(e,Ma(t,e.current)))}function wg(){var e=Dn.current;return e===null?!0:(lt&4194048)===lt?Vn===null:(lt&62914560)===lt||(lt&536870912)!==0?e===Vn:!1}function Sg(){var e=me.H;return me.H=gr,e===null?gr:e}function jg(){var e=me.A;return me.A=mv,e}function _r(){an=4,pi||(lt&4194048)!==lt&&Dn.current!==null||(Ls=!0),(yi&134217727)===0&&(ss&134217727)===0||Bt===null||bi(Bt,lt,Sa,!1)}function Qd(e,t,n){var l=vt;vt|=2;var s=Sg(),c=jg();(Bt!==e||lt!==t)&&(Rr=null,Ks(e,t)),t=!1;var m=an;e:do try{if(jt!==0&&tt!==null){var j=tt,A=wa;switch(jt){case 8:Zd(),m=6;break e;case 3:case 2:case 9:case 6:Dn.current===null&&(t=!0);var L=jt;if(jt=0,wa=null,Zs(e,j,A,L),n&&Ls){m=0;break e}break;default:L=jt,jt=0,wa=null,Zs(e,j,A,L)}}yv(),m=an;break}catch(F){xg(e,F)}while(!0);return t&&e.shellSuspendCounter++,Ol=Qi=null,vt=l,me.H=s,me.A=c,tt===null&&(Bt=null,lt=0,pt()),m}function yv(){for(;tt!==null;)Ng(tt)}function vv(e,t){var n=vt;vt|=2;var l=Sg(),s=jg();Bt!==e||lt!==t?(Rr=null,Dr=Vt()+500,Ks(e,t)):Ls=Wa(e,t);e:do try{if(jt!==0&&tt!==null){t=tt;var c=wa;t:switch(jt){case 1:jt=0,wa=null,Zs(e,t,c,1);break;case 2:case 9:if(Th(c)){jt=0,wa=null,Tg(t);break}t=function(){jt!==2&&jt!==9||Bt!==e||(jt=7),bl(e)},c.then(t,t);break e;case 3:jt=7;break e;case 4:jt=5;break e;case 7:Th(c)?(jt=0,wa=null,Tg(t)):(jt=0,wa=null,Zs(e,t,c,7));break;case 5:var m=null;switch(tt.tag){case 26:m=tt.memoizedState;case 5:case 27:var j=tt;if(m?pp(m):j.stateNode.complete){jt=0,wa=null;var A=j.sibling;if(A!==null)tt=A;else{var L=j.return;L!==null?(tt=L,Hr(L)):tt=null}break t}}jt=0,wa=null,Zs(e,t,c,5);break;case 6:jt=0,wa=null,Zs(e,t,c,6);break;case 8:Zd(),an=6;break e;default:throw Error(f(462))}}bv();break}catch(F){xg(e,F)}while(!0);return Ol=Qi=null,me.H=l,me.A=s,vt=n,tt!==null?0:(Bt=null,lt=0,pt(),an)}function bv(){for(;tt!==null&&!wt();)Ng(tt)}function Ng(e){var t=Lm(e.alternate,e,Hl);e.memoizedProps=e.pendingProps,t===null?Hr(e):tt=t}function Tg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Dm(n,t,t.pendingProps,t.type,void 0,lt);break;case 11:t=Dm(n,t,t.pendingProps,t.type.render,t.ref,lt);break;case 5:td(t);var l=t;l===En&&(Ie?(Jc(l),l.tag===5&&l.stateNode!=null&&(Lt=l.stateNode)):(Jc(l),Ie=!0));default:Ym(n,t),t=tt=zo(t,Hl),t=Lm(n,t,Hl)}e.memoizedProps=e.pendingProps,t===null?Hr(e):tt=t}function Zs(e,t,n,l){Ol=Qi=null,td(t),Os=null,Bo=0;var s=t.return;try{if(sv(e,s,t,n,lt)){an=1,pr(e,Ma(n,e.current)),tt=null;return}}catch(c){if(s!==null)throw tt=s,c;an=1,pr(e,Ma(n,e.current)),tt=null;return}t.flags&32768?(Ie||l===1?e=!0:Ls||(lt&536870912)!==0?e=!1:(pi=e=!0,(l===2||l===9||l===3||l===6)&&(l=Dn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Eg(t,e)):Hr(t)}function Hr(e){var t=e;do{if((t.flags&32768)!==0){Eg(t,pi);return}e=t.return;var n=uv(t.alternate,t,Hl);if(n!==null){tt=n;return}if(t=t.sibling,t!==null){tt=t;return}tt=t=e}while(t!==null);an===0&&(an=5)}function Eg(e,t){do{var n=dv(e.alternate,e);if(n!==null){n.flags&=32767,tt=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){tt=e;return}tt=e=n}while(e!==null);an=6,tt=null}function kg(e,t,n,l,s,c,m,j,A,L,F,ie){e.cancelPendingCommit=null;do Ur();while(It!==0);if((vt&6)!==0)throw Error(f(327));if(t!==null){if(t===e.current)throw Error(f(177));e===Bt&&(tt=Bt=null,lt=0),os=t,Xa=e,vl=n,Kd=s,pg=l,xv(e,t,n,m,j,A,ie)}}function xv(e,t,n,l,s,c,m){var j=t.lanes|t.childLanes;if(Xd=j,j|=qe,W(e,n,j,l,s,c),qs=null,(n&335544064)===n?(Vs=Qy(e),l=10262):(Vs=null,l=10256),(t.subtreeFlags&l)!==0||(t.flags&l)!==0?(e.callbackNode=null,e.callbackPriority=0,Ev(Fa,function(){return Wd(),null})):(e.callbackNode=null,e.callbackPriority=0),Nr=!1,l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=me.T,me.T=null,s=ve.p,ve.p=2,c=vt,vt|=4;try{fv(e,t,n)}finally{vt=c,ve.p=s,me.T=l}}It=1,Nr?Ys=Kv(m,e.containerInfo,Vs,Fd,Jd,Sv,Id,Wd,wv):(Fd(),Jd(),Id())}function wv(e){if(It!==0){var t=Xa.onRecoverableError;t(e,{componentStack:null})}}function Sv(){It===3&&(It=0,rg(os,Xa),It=4)}function Fd(){if(It===1){It=0;var e=Xa,t=os,n=vl,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=me.T,me.T=null;var s=ve.p;ve.p=2;var c=vt;vt|=4;try{Qo=kr=!1,og(t,e,n),n=df;var m=So(e.containerInfo),j=n.focusedElem,A=n.selectionRange;if(m!==j&&j&&j.ownerDocument&&wo(j.ownerDocument.documentElement,j)){if(A!==null&&jo(j)){var L=A.start,F=A.end;if(F===void 0&&(F=L),"selectionStart"in j)j.selectionStart=L,j.selectionEnd=Math.min(F,j.value.length);else{var ie=j.ownerDocument||document,H=ie&&ie.defaultView||window;if(H.getSelection){var V=H.getSelection(),pe=j.textContent.length,Ee=Math.min(A.start,pe),Xe=A.end===void 0?Ee:Math.min(A.end,pe);!V.extend&&Ee>Xe&&(m=Xe,Xe=Ee,Ee=m);var U=ti(j,Ee),R=ti(j,Xe);if(U&&R&&(V.rangeCount!==1||V.anchorNode!==U.node||V.anchorOffset!==U.offset||V.focusNode!==R.node||V.focusOffset!==R.offset)){var Y=ie.createRange();Y.setStart(U.node,U.offset),V.removeAllRanges(),Ee>Xe?(V.addRange(Y),V.extend(R.node,R.offset)):(Y.setEnd(R.node,R.offset),V.addRange(Y))}}}}for(ie=[],V=j;V=V.parentNode;)V.nodeType===1&&ie.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<ie.length;j++){var ae=ie[j];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}to=!!uf,df=uf=null}finally{vt=c,ve.p=s,me.T=l}}e.current=t,It=2}}function Jd(){if(It===2){It=0;var e=Xa,t=os,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=me.T,me.T=null;var l=ve.p;ve.p=2;var s=vt;vt|=4;try{tg(e,t.alternate,t)}finally{vt=s,ve.p=l,me.T=n}}It=3}}function Id(){if(It===4||It===3){It=0;var e=Ys;Ys=null,St();var t=Xa,n=os,l=vl,s=pg,c=(l&335544064)===l?10262:10256;if((n.subtreeFlags&c)!==0||(n.flags&c)!==0?It=5:(It=0,os=Xa=null,Cg(t,t.pendingLanes)),c=t.pendingLanes,c===0&&(vi=null),Ge(l),n=n.stateNode,Zt&&typeof Zt.onCommitFiberRoot=="function")try{Zt.onCommitFiberRoot(Ln,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=me.T,c=ve.p,ve.p=2,me.T=null;try{for(var m=t.onRecoverableError,j=0;j<s.length;j++){var A=s[j];m(A.value,{componentStack:A.stack})}}finally{me.T=n,ve.p=c}}if(s=qs,m=Vs,Vs=null,s!==null&&(qs=null,m===null&&(m=[]),e!==null))for(A=0;A<s.length;A++)n=(0,s[A])(m),n!==void 0&&e.finished.finally(n);(vl&3)!==0&&Ur(),bl(t),c=t.pendingLanes,(l&261930)!==0&&(c&42)!==0?t===$r?Wo++:(Wo=0,$r=t):(Wo=0,$r=null),Po(0)}}function Cg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Do(t)))}function Ur(){return Ys!==null&&(Ys.skipTransition(),Ys=null),Fd(),Jd(),Id(),Wd()}function Wd(){if(It!==5)return!1;var e=Xa,t=Xd;Xd=0;var n=Ge(vl),l=me.T,s=ve.p;try{ve.p=32>n?32:n,me.T=null,n=Kd,Kd=null;var c=Xa,m=vl;if(It=0,os=Xa=null,vl=0,(vt&6)!==0)throw Error(f(331));var j=vt;if(vt|=4,hg(c.current),ug(c,c.current,m,n),vt=j,Po(0,!1),Zt&&typeof Zt.onPostCommitFiberRoot=="function")try{Zt.onPostCommitFiberRoot(Ln,c)}catch{}return!0}finally{ve.p=s,me.T=l,Cg(e,t)}}function Mg(e,t,n){t=Ma(n,t),t=gd(e.stateNode,t,2),e=ui(e,t,2),e!==null&&(M(e,2),bl(e))}function Nt(e,t,n){if(e.tag===3)Mg(e,e,n);else for(;t!==null;){if(t.tag===3){Mg(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(vi===null||!vi.has(l))){e=Ma(n,e),n=Tm(2),l=ui(t,n,2),l!==null&&(Em(n,l,t,e),M(l,2),bl(l));break}}t=t.return}}function Pd(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new gv;var s=new Set;l.set(t,s)}else s=l.get(t),s===void 0&&(s=new Set,l.set(t,s));s.has(n)||(qd=!0,s.add(n),e=jv.bind(null,e,t,n),t.then(e,e))}function jv(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Bt===e&&(lt&n)===n&&((an===4||an===3&&(lt&62914560)===lt&&300>Vt()-Or)&&(vt&2)===0?Ks(e,0):Ar|=n,Gs===lt&&(Gs=0)),bl(e)}function zg(e,t){t===0&&(t=Pa()),e=tn(e,t),e!==null&&(M(e,t),bl(e))}function Nv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),zg(e,n)}function Tv(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(f(314))}l!==null&&l.delete(t),zg(e,n)}function Ev(e,t){return et(e,t)}var Qs=null,Fs=null,ef=!1,Lr=!1,tf=!1,xi=0;function bl(e){e!==Fs&&e.next===null&&(Fs===null?Qs=Fs=e:Fs=Fs.next=e),Lr=!0,ef||(ef=!0,Cv())}function Po(e,t){if(!tf&&Lr){tf=!0;do for(var n=!1,l=Qs;l!==null;){if(e!==0){var s=l.pendingLanes;if(s===0)var c=0;else{var m=l.suspendedLanes,j=l.pingedLanes;c=(1<<31-hn(42|e)+1)-1,c&=s&~(m&~j),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,Rg(l,c))}else c=lt,c=aa(l,l===Bt?c:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(c&3)===0||Wa(l,c)||(n=!0,Rg(l,c));l=l.next}while(n);tf=!1}}function kv(){Ag()}function Ag(){Lr=ef=!1;var e=0;xi!==0&&Uv()&&(e=xi);for(var t=Vt(),n=null,l=Qs;l!==null;){var s=l.next,c=Og(l,t);c===0?(l.next=null,n===null?Qs=s:n.next=s,s===null&&(Fs=n)):(n=l,(e!==0||(c&3)!==0)&&(Lr=!0)),l=s}It!==0&&It!==5||Po(e),xi!==0&&(xi=0)}function Og(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,s=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var m=31-hn(c),j=1<<m,A=s[m];A===-1?((j&n)===0||(j&l)!==0)&&(s[m]=fs(j,t)):A<=t&&(e.expiredLanes|=j),c&=~j}if(t=Bt,n=lt,n=aa(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(jt===2||jt===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&on(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Wa(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&on(l),Ge(n)){case 2:case 8:n=na;break;case 32:n=Fa;break;case 268435456:n=_a;break;default:n=Fa}return l=Dg.bind(null,e),n=et(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&on(l),e.callbackPriority=2,e.callbackNode=null,2}function Dg(e,t){if(It!==0&&It!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ur()&&e.callbackNode!==n)return null;var l=lt;return l=aa(e,e===Bt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(vg(e,l,t),Og(e,Vt()),e.callbackNode!=null&&e.callbackNode===n?Dg.bind(null,e):null)}function Rg(e,t){if(Ur())return null;vg(e,t,!0)}function Cv(){Gv(function(){(vt&6)!==0?et(cn,kv):Ag()})}function nf(){if(xi===0){var e=Ii;e===0&&(e=Ia,Ia<<=1,(Ia&261888)===0&&(Ia=256)),xi=e}return xi}function $g(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Jn(e)}function Mv(e,t,n,l,s){if(t==="submit"&&n&&n.stateNode===s){var c=$g((s[Mt]||null).action),m=l.submitter;m&&(t=(t=m[Mt]||null)?$g(t.formAction):m.getAttribute("formAction"),t!==null&&(c=t,m=null));var j=new $i("action","action",null,l,s);e.push({event:j,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(xi!==0){var A=new FormData(s,m);ud(n,{pending:!0,data:A,method:s.method,action:c},null,A)}}else typeof c=="function"&&(j.preventDefault(),A=new FormData(s,m),ud(n,{pending:!0,data:A,method:s.method,action:c},c,A))},currentTarget:s}]})}}for(var af=0;af<g.length;af++){var lf=g[af],zv=lf.toLowerCase(),Av=lf[0].toUpperCase()+lf.slice(1);b(zv,"on"+Av)}b(Eo,"onAnimationEnd"),b(ko,"onAnimationIteration"),b(Co,"onAnimationStart"),b("dblclick","onDoubleClick"),b("focusin","onFocus"),b("focusout","onBlur"),b(Vc,"onTransitionRun"),b(Xc,"onTransitionStart"),b(Kc,"onTransitionCancel"),b(Mo,"onTransitionEnd"),qn("onMouseEnter",["mouseout","mouseover"]),qn("onMouseLeave",["mouseout","mouseover"]),qn("onPointerEnter",["pointerout","pointerover"]),qn("onPointerLeave",["pointerout","pointerover"]),Tl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Tl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Tl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Tl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Tl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Tl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ec="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(" "),Ov=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ec));function Bg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],s=l.event;l=l.listeners;e:{var c=void 0;if(t)for(var m=l.length-1;0<=m;m--){var j=l[m],A=j.instance,L=j.currentTarget;if(j=j.listener,A!==c&&s.isPropagationStopped())break e;c=j,s.currentTarget=L;try{c(s)}catch(F){de(F)}s.currentTarget=null,c=A}else for(m=0;m<l.length;m++){if(j=l[m],A=j.instance,L=j.currentTarget,j=j.listener,A!==c&&s.isPropagationStopped())break e;c=j,s.currentTarget=L;try{c(s)}catch(F){de(F)}s.currentTarget=null,c=A}}}}function nt(e,t){var n=t[ql];n===void 0&&(n=t[ql]=new Set);var l=e+"__bubble";n.has(l)||(_g(t,e,2,!1),n.add(l))}function sf(e,t,n){var l=0;t&&(l|=4),_g(n,e,l,t)}var Gr="_reactListening"+Math.random().toString(36).slice(2);function of(e){if(!e[Gr]){e[Gr]=!0,oo.forEach(function(n){n!=="selectionchange"&&(Ov.has(n)||sf(n,!1,e),sf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Gr]||(t[Gr]=!0,sf("selectionchange",!1,t))}}function _g(e,t,n,l){switch(Ep(t)){case 2:var s=Nb;break;case 8:s=Tb;break;default:s=kf}n=s.bind(null,t,n,e),s=void 0,!Di||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),l?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function cf(e,t,n,l,s){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var m=l.tag;if(m===3||m===4){var j=l.stateNode.containerInfo;if(j===s)break;if(m===4)for(m=l.return;m!==null;){var A=m.tag;if((A===3||A===4)&&m.stateNode.containerInfo===s)return;m=m.return}for(;j!==null;){if(m=dt(j),m===null)return;if(A=m.tag,A===5||A===6||A===26||A===27){l=c=m;continue e}j=j.parentNode}}l=l.return}Xl(function(){var L=c,F=al(n),ie=[];e:{var H=d.get(e);if(H!==void 0){var V=$i,pe=e;switch(e){case"keypress":if(Ri(n)===0)break e;case"keydown":case"keyup":V=Fl;break;case"focusin":pe="focus",V=bs;break;case"focusout":pe="blur",V=bs;break;case"beforeblur":case"afterblur":V=bs;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":V=Hi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=vs;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=ku;break;case Eo:case ko:case Co:V=bu;break;case Mo:V=ol;break;case"scroll":case"scrollend":V=Bi;break;case"wheel":V=Dc;break;case"copy":case"cut":case"paste":V=wu;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=Mc;break;case"submit":V=Tu;break;case"toggle":case"beforetoggle":V=Nn}var Ee=(t&4)!==0,Xe=!Ee&&(e==="scroll"||e==="scrollend"),U=Ee?H!==null?H+"Capture":null:H;Ee=[];for(var R=L,Y;R!==null;){var ae=R;if(Y=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||Y===null||U===null||(ae=ll(R,U),ae!=null&&Ee.push(tc(R,ae,Y))),Xe)break;R=R.return}0<Ee.length&&(H=new V(H,pe,null,n,F),ie.push({event:H,listeners:Ee}))}}if((t&7)===0){e:{if(V=e==="mouseover"||e==="pointerover",H=e==="mouseout"||e==="pointerout",V&&n!==ho&&(pe=n.relatedTarget||n.fromElement)&&(dt(pe)||pe[Yl]))break e;(H||V)&&(pe=F.window===F?F:(V=F.ownerDocument)?V.defaultView||V.parentWindow:window,H?(V=n.relatedTarget||n.toElement,H=L,V=V?dt(V):null,V!==null&&(Xe=p(V),Ee=V.tag,V!==Xe||Ee!==5&&Ee!==27&&Ee!==6)&&(V=null)):(H=null,V=L),H!==V&&(Ee=Hi,ae="onMouseLeave",U="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=Mc,ae="onPointerLeave",U="onPointerEnter",R="pointer"),Xe=H==null?pe:la(H),Y=V==null?pe:la(V),pe=new Ee(ae,R+"leave",H,n,F),pe.target=Xe,pe.relatedTarget=Y,ae=null,dt(F)===L&&(Ee=new Ee(U,R+"enter",V,n,F),Ee.target=Y,Ee.relatedTarget=Xe,ae=Ee),Xe=ae,Ee=H&&V?ce(H,V,Dv):null,H!==null&&Hg(ie,pe,H,Ee,!1),V!==null&&Xe!==null&&Hg(ie,Xe,V,Ee,!0)))}e:{if(H=L?la(L):window,V=H.nodeName&&H.nodeName.toLowerCase(),V==="select"||V==="input"&&H.type==="file")var we=Gc;else if(Yi(H))if(xo)we=Ga;else{we=Vi;var it=zu}else V=H.nodeName,!V||V.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?L&&dn(L.elementType)&&(we=Gc):we=Au;if(we&&(we=we(e,L))){vo(ie,we,n,F);break e}it&&it(e,H,L)}switch(it=L?la(L):window,e){case"focusin":(Yi(it)||it.contentEditable==="true")&&(va=it,Ns=L,ni=null);break;case"focusout":ni=Ns=va=null;break;case"mousedown":Ts=!0;break;case"contextmenu":case"mouseup":case"dragend":Ts=!1,No(ie,n,F);break;case"selectionchange":if(qc)break;case"keydown":case"keyup":No(ie,n,F)}var Oe;if(Li)e:{switch(e){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else Jl?Hc(e,n)&&(Ue="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ue="onCompositionStart");Ue&&(Bc&&n.locale!=="ko"&&(Jl||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Jl&&(Oe=ca()):(La=F,mo="value"in La?La.value:La.textContent,Jl=!0)),it=Yr(L,Ue),0<it.length&&(Ue=new kc(Ue,e,null,n,F),ie.push({event:Ue,listeners:it}),Oe?Ue.data=Oe:(Oe=yo(n),Oe!==null&&(Ue.data=Oe)))),(Oe=Cu?Mu(e,n):Uc(e,n))&&(Ue=Yr(L,"onBeforeInput"),0<Ue.length&&(it=new kc("onBeforeInput","beforeinput",null,n,F),ie.push({event:it,listeners:Ue}),it.data=Oe)),Mv(ie,e,L,n,F)}Bg(ie,t)})}function tc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Yr(e,t){for(var n=t+"Capture",l=[];e!==null;){var s=e,c=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||c===null||(s=ll(e,n),s!=null&&l.unshift(tc(e,s,c)),s=ll(e,t),s!=null&&l.push(tc(e,s,c))),e.tag===3)return l;e=e.return}return[]}function Dv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Hg(e,t,n,l,s){for(var c=t._reactName,m=[];n!==null&&n!==l;){var j=n,A=j.alternate,L=j.stateNode;if(j=j.tag,A!==null&&A===l)break;j!==5&&j!==26&&j!==27||L===null||(A=L,s?(L=ll(n,c),L!=null&&m.unshift(tc(n,L,A))):s||(L=ll(n,c),L!=null&&m.push(tc(n,L,A)))),n=n.return}m.length!==0&&e.push({event:t,listeners:m})}var Rv=/\r\n?/g,$v=/\u0000|\uFFFD/g;function Ug(e){return(typeof e=="string"?e:""+e).replace(Rv,`
49
+ `).replace($v,"")}function Lg(e,t){return t=Ug(t),Ug(e)===t}function Tt(e,t,n,l,s,c){switch(n){case"children":if(typeof l=="string")t==="body"||t==="textarea"&&l===""||mn(e,l);else if(typeof l=="number"||typeof l=="bigint")t!=="body"&&mn(e,""+l);else return;break;case"className":Yt(e,"class",l);break;case"tabIndex":Yt(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Yt(e,n,l);break;case"style":ms(e,l,c);return;case"data":if(t!=="object"){Yt(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=Jn(l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(n==="formAction"?(t!=="input"&&Tt(e,t,"name",s.name,s,null),Tt(e,t,"formEncType",s.formEncType,s,null),Tt(e,t,"formMethod",s.formMethod,s,null),Tt(e,t,"formTarget",s.formTarget,s,null)):(Tt(e,t,"encType",s.encType,s,null),Tt(e,t,"method",s.method,s,null),Tt(e,t,"target",s.target,s,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=Jn(l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=ga);return;case"onScroll":l!=null&&nt("scroll",e);return;case"onScrollEnd":l!=null&&nt("scrollend",e);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(f(61));if(n=l.__html,n!=null){if(s.children!=null)throw Error(f(60));(c!=null?c.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=Jn(l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":nt("beforetoggle",e),nt("toggle",e),Ai(e,"popover",l);break;case"xlinkActuate":wn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":wn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":wn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":wn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":wn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":wn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":wn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":wn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":wn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Ai(e,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=pu.get(n)||n,Ai(e,n,l);else return}ot=!0}function rf(e,t,n,l,s,c){switch(n){case"style":ms(e,l,c);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(f(61));if(n=l.__html,n!=null){if(s.children!=null)throw Error(f(60));(c!=null?c.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if(typeof l=="string")mn(e,l);else if(typeof l=="number"||typeof l=="bigint")mn(e,""+l);else return;break;case"onScroll":l!=null&&nt("scroll",e);return;case"onScrollEnd":l!=null&&nt("scrollend",e);return;case"onClick":l!=null&&(e.onclick=ga);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!tl.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(s=n.endsWith("Capture"),c=n.slice(2,s?n.length-7:void 0),t=e[Mt]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(c,t,s),typeof l=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(c,l,s);break e}ot=!0,n in e?e[n]=l:l===!0?e.setAttribute(n,""):Ai(e,n,l)}return}ot=!0}function Bn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":nt("error",e),nt("load",e);var l=!1,s=!1,c;for(c in n)if(n.hasOwnProperty(c)){var m=n[c];if(m!=null)switch(c){case"src":l=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(f(137,t));default:Tt(e,t,c,m,n,null)}}s&&Tt(e,t,"srcSet",n.srcSet,n,null),l&&Tt(e,t,"src",n.src,n,null);return;case"input":nt("invalid",e);var j=c=m=s=null,A=null,L=null;for(l in n)if(n.hasOwnProperty(l)){var F=n[l];if(F!=null)switch(l){case"name":s=F;break;case"type":m=F;break;case"checked":A=F;break;case"defaultChecked":L=F;break;case"value":c=F;break;case"defaultValue":j=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(f(137,t));break;default:Tt(e,t,l,F,n,null)}}Oi(e,c,j,A,L,m,s,!1);return;case"select":nt("invalid",e),l=m=c=null;for(s in n)if(n.hasOwnProperty(s)&&(j=n[s],j!=null))switch(s){case"value":c=j;break;case"defaultValue":m=j;break;case"multiple":l=j;default:Tt(e,t,s,j,n,null)}t=c,n=m,e.multiple=!!l,t!=null?El(e,!!l,t,!1):n!=null&&El(e,!!l,n,!0);return;case"textarea":nt("invalid",e),c=s=l=null;for(m in n)if(n.hasOwnProperty(m)&&(j=n[m],j!=null))switch(m){case"value":l=j;break;case"defaultValue":s=j;break;case"children":c=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(f(91));break;default:Tt(e,t,m,j,n,null)}$t(e,l,s,c);return;case"option":for(A in n)if(n.hasOwnProperty(A)&&(l=n[A],l!=null))switch(A){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Tt(e,t,A,l,n,null)}return;case"dialog":nt("beforetoggle",e),nt("toggle",e),nt("cancel",e),nt("close",e);break;case"iframe":case"object":nt("load",e);break;case"video":case"audio":for(l=0;l<ec.length;l++)nt(ec[l],e);break;case"image":nt("error",e),nt("load",e);break;case"details":nt("toggle",e);break;case"embed":case"source":case"link":nt("error",e),nt("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(L in n)if(n.hasOwnProperty(L)&&(l=n[L],l!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(f(137,t));default:Tt(e,t,L,l,n,null)}return;default:if(dn(t)){for(F in n)n.hasOwnProperty(F)&&(l=n[F],l!==void 0&&rf(e,t,F,l,n,void 0));return}}for(j in n)n.hasOwnProperty(j)&&(l=n[j],l!=null&&Tt(e,t,j,l,n,null))}var Bv={};function _v(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,c=null,m=null,j=null,A=null,L=null,F=null;for(V in n){var ie=n[V];if(n.hasOwnProperty(V)&&ie!=null)switch(V){case"checked":break;case"value":break;case"defaultValue":A=ie;default:l.hasOwnProperty(V)||Tt(e,t,V,null,l,ie)}}for(var H in l){var V=l[H];if(ie=n[H],l.hasOwnProperty(H)&&(V!=null||ie!=null))switch(H){case"type":V!==ie&&(ot=!0),c=V;break;case"name":V!==ie&&(ot=!0),s=V;break;case"checked":V!==ie&&(ot=!0),L=V;break;case"defaultChecked":V!==ie&&(ot=!0),F=V;break;case"value":V!==ie&&(ot=!0),m=V;break;case"defaultValue":V!==ie&&(ot=!0),j=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(f(137,t));break;default:V!==ie&&Tt(e,t,H,V,l,ie)}}hs(e,m,j,A,L,F,c,s);return;case"select":V=m=j=H=null;for(c in n)if(A=n[c],n.hasOwnProperty(c)&&A!=null)switch(c){case"value":break;case"multiple":V=A;default:l.hasOwnProperty(c)||Tt(e,t,c,null,l,A)}for(s in l)if(c=l[s],A=n[s],l.hasOwnProperty(s)&&(c!=null||A!=null))switch(s){case"value":c!==A&&(ot=!0),H=c;break;case"defaultValue":c!==A&&(ot=!0),j=c;break;case"multiple":c!==A&&(ot=!0),m=c;default:c!==A&&Tt(e,t,s,c,l,A)}t=j,n=m,l=V,H!=null?El(e,!!n,H,!1):!!l!=!!n&&(t!=null?El(e,!!n,t,!0):El(e,!!n,n?[]:"",!1));return;case"textarea":V=H=null;for(j in n)if(s=n[j],n.hasOwnProperty(j)&&s!=null&&!l.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Tt(e,t,j,null,l,s)}for(m in l)if(s=l[m],c=n[m],l.hasOwnProperty(m)&&(s!=null||c!=null))switch(m){case"value":s!==c&&(ot=!0),H=s;break;case"defaultValue":s!==c&&(ot=!0),V=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(f(91));break;default:s!==c&&Tt(e,t,m,s,l,c)}fo(e,H,V);return;case"option":for(var pe in n)if(H=n[pe],n.hasOwnProperty(pe)&&H!=null&&!l.hasOwnProperty(pe))switch(pe){case"selected":e.selected=!1;break;default:Tt(e,t,pe,null,l,H)}for(A in l)if(H=l[A],V=n[A],l.hasOwnProperty(A)&&H!==V&&(H!=null||V!=null))switch(A){case"selected":H!==V&&(ot=!0),e.selected=H&&typeof H!="function"&&typeof H!="symbol";break;default:Tt(e,t,A,H,l,V)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ee in n)H=n[Ee],n.hasOwnProperty(Ee)&&H!=null&&!l.hasOwnProperty(Ee)&&Tt(e,t,Ee,null,l,H);for(L in l)if(H=l[L],V=n[L],l.hasOwnProperty(L)&&H!==V&&(H!=null||V!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(f(137,t));break;default:Tt(e,t,L,H,l,V)}return;default:if(dn(t)){for(var Xe in n)H=n[Xe],n.hasOwnProperty(Xe)&&H!==void 0&&!l.hasOwnProperty(Xe)&&rf(e,t,Xe,void 0,l,H);for(F in l)H=l[F],V=n[F],!l.hasOwnProperty(F)||H===V||H===void 0&&V===void 0||rf(e,t,F,H,l,V);return}}for(var U in n)H=n[U],n.hasOwnProperty(U)&&H!=null&&!l.hasOwnProperty(U)&&Tt(e,t,U,null,l,H);for(ie in l)H=l[ie],V=n[ie],!l.hasOwnProperty(ie)||H===V||H==null&&V==null||Tt(e,t,ie,H,l,V)}function Gg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Hv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var s=n[l],c=s.transferSize,m=s.initiatorType,j=s.duration;if(c&&j&&Gg(m)){for(m=0,j=s.responseEnd,l+=1;l<n.length;l++){var A=n[l],L=A.startTime;if(L>j)break;var F=A.transferSize,ie=A.initiatorType;F&&Gg(ie)&&(A=A.responseEnd,m+=F*(A<j?1:(j-L)/(A-L)))}if(--l,t+=8*(c+m)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var uf=null,df=null;function nc(e){return e.nodeType===9?e:e.ownerDocument}function Yg(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function qg(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Vg(e,t,n,l){return n=nc(n).createElement(e),n[he]=l,n[Mt]=t,Bn(n,e,t),un(n),n}function ff(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var hf=null;function Uv(){var e=window.event;return e&&e.type==="popstate"?e===hf?!1:(hf=e,!0):(hf=null,!1)}var mf=typeof setTimeout=="function"?setTimeout:void 0,Lv=typeof clearTimeout=="function"?clearTimeout:void 0,Xg=typeof Promise=="function"?Promise:void 0,Kg=typeof requestAnimationFrame=="function"?requestAnimationFrame:mf,Gv=typeof queueMicrotask=="function"?queueMicrotask:typeof Xg<"u"?function(e){return Xg.resolve(null).then(e).catch(Yv)}:mf;function Yv(e){setTimeout(function(){throw e})}function wi(e){return e==="head"}function Zg(e,t){var n=t,l=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(s),no(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Sf(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Sf(n);for(var c=n.firstChild;c;){var m=c.nextSibling,j=c.nodeName;c[el]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=m}}else n==="body"&&Sf(e.ownerDocument.body);n=s}while(n);no(t)}function Qg(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function Fg(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display==="inline"){if(t=e.getClientRects(),t.length===1)var l=1;else for(var s=l=0;s<t.length;s++){var c=t[s];0<c.width&&0<c.height&&l++}l===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function Jg(e,t){e=e.style,t=t.style;var n=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=n==null||typeof n=="boolean"?"":(""+n).trim(),n=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=n==null||typeof n=="boolean"?"":(""+n).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(n=t.display,e.display=n==null||typeof n=="boolean"?"":n,n=t.margin,n!=null?e.margin=n:(n=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=n==null||typeof n=="boolean"?"":n,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function qv(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function gf(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return qv(t,n,e)}function Vv(e){return e.documentElement.clientHeight}function Xv(e){this.addEventListener("load",e),this.addEventListener("error",e)}function Kv(e,t,n,l,s,c,m,j,A){var L=t.nodeType===9?t:t.ownerDocument;try{var F=L.startViewTransition({update:function(){var H=L.defaultView,V=H.navigation&&H.navigation.transition,pe=L.fonts.status;l();var Ee=[];if(pe==="loaded"&&(Vv(L),L.fonts.status==="loading"&&Ee.push(L.fonts.ready)),pe=Ee.length,e!==null)for(var Xe=e.suspenseyImages,U=0,R=0;R<Xe.length;R++){var Y=Xe[R];if(!Y.complete){var ae=Y.getBoundingClientRect();if(0<ae.bottom&&0<ae.right&&ae.top<H.innerHeight&&ae.left<H.innerWidth){if(U+=yp(Y),U>Xr){Ee.length=pe;break}Y=new Promise(Xv.bind(Y)),Ee.push(Y)}}}if(0<Ee.length)return H=Promise.race([Promise.all(Ee),new Promise(function(we){return setTimeout(we,500)})]).then(s,s),(V?Promise.allSettled([V.finished,H]):H).then(c,c);if(s(),V)return V.finished.then(c,c);c()},types:n});L.__reactViewTransition=F;var ie=[];return F.ready.then(function(){for(var H=L.documentElement.getAnimations({subtree:!0}),V=0;V<H.length;V++){var pe=H[V],Ee=pe.effect,Xe=Ee.pseudoElement;if(Xe!=null&&Xe.startsWith("::view-transition")){ie.push(pe),pe=Ee.getKeyframes();for(var U=Xe=void 0,R=!0,Y=0;Y<pe.length;Y++){var ae=pe[Y],we=ae.width;if(Xe===void 0)Xe=we;else if(Xe!==we){R=!1;break}if(we=ae.height,U===void 0)U=we;else if(U!==we){R=!1;break}delete ae.width,delete ae.height,ae.transform==="none"&&delete ae.transform}R&&Xe!==void 0&&U!==void 0&&(Ee.setKeyframes(pe),R=getComputedStyle(Ee.target,Ee.pseudoElement),R.width!==Xe||R.height!==U)&&(R=pe[0],R.width=Xe,R.height=U,R=pe[pe.length-1],R.width=Xe,R.height=U,Ee.setKeyframes(pe))}}m()},function(H){L.__reactViewTransition===F&&(L.__reactViewTransition=null);try{if(typeof H=="object"&&H!==null)switch(H.name){case"InvalidStateError":(H.message==="View transition was skipped because document visibility state is hidden."||H.message==="Skipping view transition because document visibility state has become hidden."||H.message==="Skipping view transition because viewport size changed."||H.message==="Transition was aborted because of invalid state")&&(H=null)}H!==null&&A(H)}finally{l(),s(),m()}}),F.finished.finally(function(){for(var H=0;H<ie.length;H++)ie[H].cancel();L.__reactViewTransition===F&&(L.__reactViewTransition=null),j()}),F}catch{return l(),s(),m(),null}}function cs(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}cs.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:se({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},cs.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),l=[],s=0;s<n.length;s++){var c=n[s].effect;c!==null&&c.target===e&&c.pseudoElement===t&&l.push(n[s])}return l},cs.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Ig(e){return{name:e,group:new cs("group",e),imagePair:new cs("image-pair",e),old:new cs("old",e),new:new cs("new",e)}}function Na(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Na.prototype.addEventListener=function(e,t,n){var l=null,s=null;if(!(n!=null&&typeof n!="boolean"&&(l=n.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var c=this._eventListeners;if(Pg(c,e,t,n)===-1){var m=this,j=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(j=function(A){m.removeEventListener(e,t,n),typeof t=="function"?t.call(this,A):t.handleEvent(A)}),l!==null&&(s=m.removeEventListener.bind(m,e,t,n),l.addEventListener("abort",s,{once:!0}),s=l.removeEventListener.bind(l,"abort",s)),l=Js(n),c.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:j,cleanup:s}),x(this._fragmentFiber.child,!1,Zv,e,j,l)}this._eventListeners=c}};function Zv(e,t,n,l){return k(e).addEventListener(t,n,l),!1}Na.prototype.removeEventListener=function(e,t,n){var l=this._eventListeners;if(l!==null&&(t=Pg(l,e,t,n),t!==-1)){var s=l[t];n=s.attachedListener;var c=s.cleanup;s=Js(s.optionsOrUseCapture),x(this._fragmentFiber.child,!1,Qv,e,n,s),l.splice(t,1),c!==null&&c()}};function Qv(e,t,n,l){return k(e).removeEventListener(t,n,l),!1}function Js(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Wg(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Pg(e,t,n,l){if(e.length===0)return-1;l=Wg(l);for(var s=0;s<e.length;s++){var c=e[s];if(c.type===t&&c.listener===n&&Wg(c.optionsOrUseCapture)===l)return s}return-1}Na.prototype.dispatchEvent=function(e){var t=C(this._fragmentFiber);if(t===null)return!0;t=k(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var l=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var s=0;s<n.length;s++){var c=n[s];l.addEventListener(c.type,c.attachedListener,Js(c.optionsOrUseCapture))}if(t.appendChild(l),e=l.dispatchEvent(e),n)for(s=0;s<n.length;s++)c=n[s],l.removeEventListener(c.type,c.attachedListener,Js(c.optionsOrUseCapture));return t.removeChild(l),e}return t.dispatchEvent(e)},Na.prototype.focus=function(e){x(this._fragmentFiber.child,!0,ep,e,void 0,void 0)};function ep(e,t){return e.tag===6?!1:(e=k(e),sb(e,t))}Na.prototype.focusLast=function(e){var t=[];x(this._fragmentFiber.child,!0,pf,t,void 0,void 0);for(var n=t.length-1;0<=n&&!ep(t[n],e);n--);};function pf(e,t){return t.push(e),!1}Na.prototype.blur=function(){var e=C(this._fragmentFiber);e!==null&&(e=k(e),e=nc(e).activeElement,e!==null&&x(this._fragmentFiber.child,!1,Fv,e,void 0,void 0))};function Fv(e,t){return e.tag===6?!1:(e=k(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Na.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),x(this._fragmentFiber.child,!1,Jv,e,void 0,void 0)};function Jv(e,t){return e.tag===6||(e=k(e),t.observe(e)),!1}Na.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),x(this._fragmentFiber.child,!1,Iv,e,void 0,void 0);for(var n=t=0;n<Ka.length;n++){var l=Ka[n];l.fragmentInstance===this&&l.observer===e?e.unobserve(l.instance):Ka[t++]=l}Ka.length=t}};function Iv(e,t){return e.tag===6||(e=k(e),t.unobserve(e)),!1}var Ka=[],yf=!1;function Wv(e,t,n){Ka.push({fragmentInstance:e,observer:t,instance:n}),yf||(yf=!0,ob(function(){yf=!1;var l=Ka;Ka=[];for(var s=0;s<l.length;s++){var c=l[s];c.observer.unobserve(c.instance)}}))}Na.prototype.getClientRects=function(){var e=[];return x(this._fragmentFiber.child,!1,Pv,e,void 0,void 0),e};function Pv(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=k(e),t.push.apply(t,e.getClientRects());return!1}Na.prototype.getRootNode=function(e){var t=C(this._fragmentFiber);return t===null?this:k(t).getRootNode(e)},Na.prototype.compareDocumentPosition=function(e){var t=C(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];x(this._fragmentFiber.child,!1,pf,n,void 0,void 0);var l=k(t);if(n.length===0){if(n=l,O(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var s=l=n.compareDocumentPosition(e);return n===e?s=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=X(t)[1],n===null?s=Node.DOCUMENT_POSITION_PRECEDING:(e=k(n).compareDocumentPosition(e),s=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),s|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=k(n[0]),s=k(n[n.length-1]);var c=O(this._fragmentFiber)?t.parentElement:l;if(c==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=c.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,c=c.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINED_BY;var m=t.compareDocumentPosition(e),j=s.compareDocumentPosition(e),A=m&Node.DOCUMENT_POSITION_CONTAINED_BY||j&Node.DOCUMENT_POSITION_CONTAINED_BY;return j=l&&c&&m&Node.DOCUMENT_POSITION_FOLLOWING&&j&Node.DOCUMENT_POSITION_PRECEDING,t=l&&t===e||c&&s===e||A||j?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&t===e||!c&&s===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:m,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||eb(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function eb(e,t,n,l,s){var c=dt(s);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!c)e:{for(;c!==null;){if(c.tag===7&&(c===t||c.alternate===t)){n=!0;break e}c=c.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(c===null)return c=s.ownerDocument,s===c||s===c.documentElement||s===c.body;e:{for(c=t,t=C(t);c!==null;){if(!(c.tag!==5&&c.tag!==3&&c.tag!==27||c!==t&&c.alternate!==t)){c=!0;break e}c=c.return}c=!1}return c}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!c)&&!(t=c===n)&&(t=ce(n,c,I),t===null?t=!1:(x(t,!0,Q,c,n),c=$,$=null,t=c!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!c)&&!(t=c===l)&&(t=ce(l,c,I),t===null?t=!1:(x(t,!0,q,c,l),c=$,J=$=null,t=c!==null)),t):!1}function tp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Na.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(f(566));var t=[];x(this._fragmentFiber.child,!1,pf,t,void 0,void 0);var n=e!==!1;if(t.length===0){var l=X(this._fragmentFiber);if(l=n?l[1]||l[0]||C(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){e=k(l),tp(e,n);return}if(l=k(l),l.nodeType!==9){if(l.nodeType===11){n="host"in l?l.host:null,n!==null&&n.scrollIntoView(e);return}l.scrollIntoView(e)}}for(l=n?t.length-1:0;l!==(n?-1:t.length);){var s=t[l];s.tag===6?(s=k(s),tp(s,n)):k(s).scrollIntoView(e),l+=n?-1:1}};function tb(e,t){return e=k(e),np(e,t),!1}function np(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function ap(e,t){var n=t._eventListeners;if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];e.addEventListener(s.type,s.attachedListener,Js(s.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(c){for(var m=0,j=0;j<Ka.length;j++){var A=Ka[j];(A.fragmentInstance!==t||A.observer!==c||A.instance!==e)&&(Ka[m++]=A)}Ka.length=m,c.observe(e)}),np(e,t))}function nb(e,t){var n=t._eventListeners;if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];e.removeEventListener(s.type,s.attachedListener,Js(s.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(c){typeof c.rootMargin=="string"?Wv(t,c,e):c.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function vf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":vf(n),Nl(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function ab(e,t,n,l){for(;e.nodeType===1;){var s=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[el])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=Ra(e.nextSibling),e===null)break}return null}function lb(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ra(e.nextSibling),e===null))return null;return e}function lp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ra(e.nextSibling),e===null))return null;return e}function bf(e){return e.data==="$?"||e.data==="$~"}function xf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function ib(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Ra(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==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var wf=null;function ip(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Ra(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function sp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function sb(e,t){function n(){l=!0}if(e.ownerDocument.activeElement===e)return!0;var l=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return l}function ob(e){Kg(function(){Kg(function(t){return e(t)})})}function op(e,t,n){switch(t=nc(n),e){case"html":if(e=t.documentElement,!e)throw Error(f(452));return e;case"head":if(e=t.head,!e)throw Error(f(453));return e;case"body":if(e=t.body,!e)throw Error(f(454));return e;default:throw Error(f(451))}}function cp(e,t,n){for(var l in n){var s=n[l];n.hasOwnProperty(l)&&s!=null&&Tt(e,t,l,null,Bv,s)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===ga&&(e.onclick=null),Nl(e)}function Sf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nl(e)}var $a=new Map,rp=new Set;function ac(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Ul=ve.d;ve.d={f:cb,r:rb,D:ub,C:db,L:fb,m:hb,X:gb,S:mb,M:pb};function cb(){var e=Ul.f(),t=Br();return e||t}function rb(e){var t=zt(e);t!==null&&t.tag===5&&t.type==="form"?dm(t):Ul.r(e)}var Is=typeof document>"u"?null:document;function up(e,t,n){var l=Is;if(l&&typeof t=="string"&&t){var s=Fn(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof n=="string"&&(s+='[crossorigin="'+n+'"]'),rp.has(s)||(rp.add(s),e={rel:e,crossOrigin:n,href:t},l.querySelector(s)===null&&(t=l.createElement("link"),Bn(t,"link",e),un(t),l.head.appendChild(t)))}}function ub(e){Ul.D(e),up("dns-prefetch",e,null)}function db(e,t){Ul.C(e,t),up("preconnect",e,t)}function fb(e,t,n){Ul.L(e,t,n);var l=Is;if(l&&e&&t){var s='link[rel="preload"][as="'+Fn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(s+='[imagesrcset="'+Fn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(s+='[imagesizes="'+Fn(n.imageSizes)+'"]')):s+='[href="'+Fn(e)+'"]';var c=s;switch(t){case"style":c=Ws(e);break;case"script":c=Ps(e)}if(!($a.has(c)||(e=se({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),$a.set(c,e),l.querySelector(s)!==null||t==="style"&&l.querySelector(lc(c))||t==="script"&&l.querySelector(ic(c))))){var m=l.createElement("link");Bn(m,"link",e),t==="style"&&(m[Gn]=!0,m.onload=m.onerror=function(){zi(m)}),un(m),l.head.appendChild(m)}}}function hb(e,t){Ul.m(e,t);var n=Is;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Fn(l)+'"][href="'+Fn(e)+'"]',c=s;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Ps(e)}if(!$a.has(c)&&(e=se({rel:"modulepreload",href:e},t),$a.set(c,e),n.querySelector(s)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ic(c)))return}l=n.createElement("link"),Bn(l,"link",e),un(l),n.head.appendChild(l)}}}function mb(e,t,n){Ul.S(e,t,n);var l=Is;if(l&&e){var s=Yn(l).hoistableStyles,c=Ws(e);t=t||"default";var m=s.get(c);if(!m){var j={loading:0,preload:null};if(m=l.querySelector(lc(c)))j.loading=5;else{e=se({rel:"stylesheet",href:e,"data-precedence":t},n),(n=$a.get(c))&&jf(e,n);var A=m=l.createElement("link");un(A),Bn(A,"link",e),A._p=new Promise(function(L,F){A.onload=L,A.onerror=F}),A.addEventListener("load",function(){j.loading|=1}),A.addEventListener("error",function(){j.loading|=2}),j.loading|=4,qr(m,t,l)}m={type:"stylesheet",instance:m,count:1,state:j},s.set(c,m)}}}function gb(e,t){Ul.X(e,t);var n=Is;if(n&&e){var l=Yn(n).hoistableScripts,s=Ps(e),c=l.get(s);c||(c=n.querySelector(ic(s)),c||(e=se({src:e,async:!0},t),(t=$a.get(s))&&Nf(e,t),c=n.createElement("script"),un(c),Bn(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(s,c))}}function pb(e,t){Ul.M(e,t);var n=Is;if(n&&e){var l=Yn(n).hoistableScripts,s=Ps(e),c=l.get(s);c||(c=n.querySelector(ic(s)),c||(e=se({src:e,async:!0,type:"module"},t),(t=$a.get(s))&&Nf(e,t),c=n.createElement("script"),un(c),Bn(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(s,c))}}function dp(e,t,n,l){var s=(s=Kt.current)?ac(s):null;if(!s)throw Error(f(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=Ws(n.href),t=Yn(s).hoistableStyles,l=t.get(n),l||(l={type:"style",instance:null,count:0,state:null},t.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ws(n.href);var c=Yn(s).hoistableStyles,m=c.get(e);if(m||(s=s.ownerDocument||s,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,m),(c=s.querySelector(lc(e)))?c._p||(m.instance=c,m.state.loading=5):(c=$a.get(e),c||(c={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},$a.set(e,c)),yb(s,e,c,m.state))),t&&l===null)throw Error(f(528,""));return m}if(t&&l!==null)throw Error(f(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(n=Ps(n),t=Yn(s).hoistableScripts,l=t.get(n),l||(l={type:"script",instance:null,count:0,state:null},t.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(f(444,e))}}function Ws(e){return'href="'+Fn(e)+'"'}function lc(e){return'link[rel="stylesheet"]['+e+"]"}function fp(e){return se({},e,{"data-precedence":e.precedence,precedence:null})}function yb(e,t,n,l){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Gn]!==!0){l.loading=1;return}}else t=e.createElement("link"),t[Gn]=!0,t.onload=t.onerror=zi.bind(null,t),Bn(t,"link",n),un(t),e.head.appendChild(t);l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2})}function Ps(e){return'[src="'+Fn(e)+'"]'}function ic(e){return"script[async]"+e}function hp(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Fn(n.href)+'"]');if(l)return t.instance=l,un(l),l;var s=se({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),un(l),Bn(l,"style",s),qr(l,n.precedence,e),t.instance=l;case"stylesheet":s=Ws(n.href);var c=e.querySelector(lc(s));if(c)return t.state.loading|=4,t.instance=c,un(c),c;l=fp(n),(s=$a.get(s))&&jf(l,s),c=(e.ownerDocument||e).createElement("link"),un(c);var m=c;return m._p=new Promise(function(j,A){m.onload=j,m.onerror=A}),Bn(c,"link",l),t.state.loading|=4,qr(c,n.precedence,e),t.instance=c;case"script":return c=Ps(n.src),(s=e.querySelector(ic(c)))?(t.instance=s,un(s),s):(l=n,(s=$a.get(c))&&(l=se({},n),Nf(l,s)),e=e.ownerDocument||e,s=e.createElement("script"),un(s),Bn(s,"link",l),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(f(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,qr(l,n.precedence,e));return t.instance}function qr(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=l.length?l[l.length-1]:null,c=s,m=0;m<l.length;m++){var j=l[m];if(j.dataset.precedence===t)c=j;else if(c!==s)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function jf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Nf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Vr=null;function mp(e,t,n){if(Vr===null){var l=new Map,s=Vr=new Map;s.set(n,l)}else s=Vr,l=s.get(n),l||(l=new Map,s.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),s=0;s<n.length;s++){var c=n[s];if(!(c[el]||c[he]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var m=c.getAttribute(t)||"";m=e+m;var j=l.get(m);j?j.push(c):l.set(m,[c])}}return l}function Tf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function vb(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function gp(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function pp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function yp(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function vp(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=yp(t),e.suspenseyImages.push(t)),e=wb.bind(e),t.decode().then(e,e))}function bb(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var s=Ws(l.href),c=t.querySelector(lc(s));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=sc.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,un(c);return}c=t.ownerDocument||t,l=fp(l),(s=$a.get(s))&&jf(l,s),c=c.createElement("link"),un(c);var m=c;m._p=new Promise(function(j,A){m.onload=j,m.onerror=A}),Bn(c,"link",l),n.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=sc.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Xr=0;function xb(e,t){return e.stylesheets&&e.count===0&&Zr(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&Zr(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Xr===0&&(Xr=62500*Hv());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zr(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Xr?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(s)}}:null}function bp(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Zr(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function sc(){this.count--,bp(this)}function wb(){this.imgCount--,bp(this)}var Kr=null;function Zr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Kr=new Map,t.forEach(Sb,e),Kr=null,sc.call(e))}function Sb(e,t){if(!(t.state.loading&4)){var n=Kr.get(e);if(n)var l=n.get(null);else{n=new Map,Kr.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<s.length;c++){var m=s[c];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(n.set(m.dataset.precedence,m),l=m)}l&&n.set(null,l)}s=t.instance,m=s.getAttribute("data-precedence"),c=n.get(m)||l,c===l&&n.set(null,s),n.set(m,s),this.count++,l=sc.bind(this),s.addEventListener("load",l),s.addEventListener("error",l),c?c.parentNode.insertBefore(s,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var eo={$$typeof:st,Provider:null,Consumer:null,_currentValue:rt,_currentValue2:rt,_threadCount:0};function jb(e,t,n,l,s,c,m,j,A){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Gl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gl(0),this.hiddenUpdates=Gl(null),this.identifierPrefix=l,this.onUncaughtError=s,this.onCaughtError=c,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.transitionTypes=null,this.incompleteTransitions=new Map}function xp(e,t,n,l,s,c,m,j,A,L,F,ie){return e=new jb(e,t,n,m,A,L,F,ie,j),t=1,c===!0&&(t|=24),c=At(3,null,null,t),e.current=c,c.stateNode=e,t=Uu(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:l,isDehydrated:n,cache:t},qu(c),e}function wp(e){return e?(e=Ut,e):Ut}function Sp(e,t,n,l,s,c){s=wp(s),l.context===null?l.context=s:l.pendingContext=s,l=ri(t),l.payload={element:n},c=c===void 0?null:c,c!==null&&(l.callback=c),n=ui(e,l,t),n!==null&&(ha(n,e,t),_o(n,e,t))}function jp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ef(e,t){jp(e,t),(e=e.alternate)&&jp(e,t)}function Np(e){if(e.tag===13||e.tag===31){var t=tn(e,67108864);t!==null&&ha(t,e,67108864),Ef(e,67108864)}}function Tp(e){if(e.tag===13||e.tag===31){var t=ja();t=$e(t);var n=tn(e,t);n!==null&&ha(n,e,t),Ef(e,t)}}var to=!0;function Nb(e,t,n,l){var s=me.T;me.T=null;var c=ve.p;try{ve.p=2,kf(e,t,n,l)}finally{ve.p=c,me.T=s}}function Tb(e,t,n,l){var s=me.T;me.T=null;var c=ve.p;try{ve.p=8,kf(e,t,n,l)}finally{ve.p=c,me.T=s}}function kf(e,t,n,l){if(to){var s=Cf(l);if(s===null)cf(e,t,l,Qr,n),kp(e,l);else if(kb(s,e,t,n,l))l.stopPropagation();else if(kp(e,l),t&4&&-1<Eb.indexOf(e)){for(;s!==null;){var c=zt(s);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var m=zn(c.pendingLanes);if(m!==0){var j=c;for(j.pendingLanes|=2,j.entangledLanes|=2;m;){var A=1<<31-hn(m);j.entanglements[1]|=A,m&=~A}bl(c),(vt&6)===0&&(Dr=Vt()+500,Po(0))}}break;case 31:case 13:j=tn(c,2),j!==null&&ha(j,c,2),Br(),Ef(c,2)}if(c=Cf(l),c===null&&cf(e,t,l,Qr,n),c===s)break;s=c}s!==null&&l.stopPropagation()}else cf(e,t,l,null,n)}}function Cf(e){return e=al(e),Mf(e)}var Qr=null;function Mf(e){if(Qr=null,e=dt(e),e!==null){var t=p(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=y(t),e!==null)return e;e=null}else if(n===31){if(e=N(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 Qr=e,null}function Ep(e){switch(e){case"beforetoggle":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"seeked":case"submit":case"toggle":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"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(gt()){case cn:return 2;case na:return 8;case Fa:case Ba:return 32;case _a:return 268435456;default:return 32}default:return 32}}var zf=!1,Si=null,ji=null,Ni=null,oc=new Map,cc=new Map,Ti=[],Eb="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".split(" ");function kp(e,t){switch(e){case"focusin":case"focusout":Si=null;break;case"dragenter":case"dragleave":ji=null;break;case"mouseover":case"mouseout":Ni=null;break;case"pointerover":case"pointerout":oc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":cc.delete(t.pointerId)}}function rc(e,t,n,l,s,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:c,targetContainers:[s]},t!==null&&(t=zt(t),t!==null&&Np(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function kb(e,t,n,l,s){switch(t){case"focusin":return Si=rc(Si,e,t,n,l,s),!0;case"dragenter":return ji=rc(ji,e,t,n,l,s),!0;case"mouseover":return Ni=rc(Ni,e,t,n,l,s),!0;case"pointerover":var c=s.pointerId;return oc.set(c,rc(oc.get(c)||null,e,t,n,l,s)),!0;case"gotpointercapture":return c=s.pointerId,cc.set(c,rc(cc.get(c)||null,e,t,n,l,s)),!0}return!1}function Cp(e){var t=dt(e.target);if(t!==null){var n=p(t);if(n!==null){if(t=n.tag,t===13){if(t=y(n),t!==null){e.blockedOn=t,Zn(e.priority,function(){Tp(n)});return}}else if(t===31){if(t=N(n),t!==null){e.blockedOn=t,Zn(e.priority,function(){Tp(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 Fr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cf(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);ho=l,n.target.dispatchEvent(l),ho=null}else return t=zt(n),t!==null&&Np(t),e.blockedOn=n,!1;t.shift()}return!0}function Mp(e,t,n){Fr(e)&&n.delete(t)}function Cb(){zf=!1,Si!==null&&Fr(Si)&&(Si=null),ji!==null&&Fr(ji)&&(ji=null),Ni!==null&&Fr(Ni)&&(Ni=null),oc.forEach(Mp),cc.forEach(Mp)}function Jr(e,t){e.blockedOn===t&&(e.blockedOn=null,zf||(zf=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Cb)))}var Ir=null;function zp(e){Ir!==e&&(Ir=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Ir===e&&(Ir=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],s=e[t+2];if(typeof l!="function"){if(Mf(l||n)===null)continue;break}var c=zt(n);c!==null&&(e.splice(t,3),t-=3,ud(c,{pending:!0,data:s,method:n.method,action:l},l,s))}}))}function no(e){function t(A){return Jr(A,e)}Si!==null&&Jr(Si,e),ji!==null&&Jr(ji,e),Ni!==null&&Jr(Ni,e),oc.forEach(t),cc.forEach(t);for(var n=0;n<Ti.length;n++){var l=Ti[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ti.length&&(n=Ti[0],n.blockedOn===null);)Cp(n),n.blockedOn===null&&Ti.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var s=n[l],c=n[l+1],m=s[Mt]||null;if(typeof c=="function")m||zp(n);else if(m){var j=null;if(c&&c.hasAttribute("formAction")){if(s=c,m=c[Mt]||null)j=m.formAction;else if(Mf(s)!==null)continue}else j=m.action;typeof j=="function"?n[l+1]=j:(n.splice(l,3),l-=3),zp(n)}}}function Ap(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(m){return s=m})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Af(e){this._internalRoot=e}Wr.prototype.render=Af.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(f(409));var n=t.current,l=ja();Sp(n,l,e,t,null,null)},Wr.prototype.unmount=Af.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Sp(e.current,2,null,e,null,null),Br(),t[Yl]=null}};function Wr(e){this._internalRoot=e}Wr.prototype.unstable_scheduleHydration=function(e){if(e){var t=Pt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ti.length&&t!==0&&t<Ti[n].priority;n++);Ti.splice(n,0,e),n===0&&Cp(e)}};var Op=i.version;if(Op!=="19.3.0")throw Error(f(527,Op,"19.3.0"));ve.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(f(188)):(e=Object.keys(e).join(","),Error(f(268,e)));return e=T(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var Mb={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:me,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pr.isDisabled&&Pr.supportsFiber)try{Ln=Pr.inject(Mb),Zt=Pr}catch{}}return dc.createRoot=function(e,t){if(!h(e))throw Error(f(299));var n=!1,l="",s=wm,c=Sm,m=jm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=xp(e,1,!1,null,null,n,l,null,s,c,m,Ap),e[Yl]=t.current,of(e),new Af(t)},dc.hydrateRoot=function(e,t,n){if(!h(e))throw Error(f(299));var l=!1,s="",c=wm,m=Sm,j=jm,A=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(j=n.onRecoverableError),n.formState!==void 0&&(A=n.formState)),t=xp(e,1,!0,t,n??null,l,s,A,c,m,j,Ap),t.context=wp(null),n=t.current,l=ja(),l=$e(l),s=ri(l),s.callback=null,ui(n,s,l),n=l,t.current.lanes=n,M(t,n),bl(t),e[Yl]=t.current,of(e),new Wr(t)},dc.version="19.3.0",dc}var qp;function Lb(){if(qp)return Rf.exports;qp=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),Rf.exports=Ub(),Rf.exports}var Gb=Lb();const rh=Math.random().toString(36).slice(2),hu=(()=>{try{let a=localStorage.getItem("design-canvas:browser");return a||localStorage.setItem("design-canvas:browser",a=Math.random().toString(36).slice(2)),a}catch{return rh}})();let ru="";const Yb=a=>void(ru=a),eu=()=>({"X-Easel-Client":hu,...ru?{"X-Easel-Author":encodeURIComponent(ru)}:{}});async function rs(a){const i=await a.json().catch(()=>({}));if(!a.ok)throw Object.assign(new Error(i.error??a.statusText),{status:a.status,body:i});return i}const Ce={board:()=>fetch("/api/board").then(a=>rs(a)),update:()=>fetch("/api/update").then(a=>rs(a)),saveBoard:(a,i)=>fetch("/api/board",{method:"PUT",headers:{"Content-Type":"application/json",...eu()},body:JSON.stringify({...a,clientId:rh,...i?{label:i}:{}})}).then(r=>rs(r)),post:(a,i)=>fetch(a,{method:"POST",headers:{"Content-Type":"application/json",...eu()},body:JSON.stringify(i)}).then(r=>rs(r)),put:(a,i)=>fetch(a,{method:"PUT",headers:{"Content-Type":"application/json",...eu()},body:JSON.stringify(i)}).then(r=>rs(r)),get:a=>fetch(a).then(i=>rs(i)),blob:(a,i)=>fetch(a,{method:"POST",headers:{"Content-Type":"application/json",...eu()},body:JSON.stringify(i)}).then(r=>r.ok?r.blob():rs(r))};let gc=null,Wf=null;function Ey(a){Wf=a,(gc==null?void 0:gc.readyState)===1&&gc.send(JSON.stringify({type:"editing",file:a,client:hu,person:ru||void 0}))}function qb(a){let i=null,r=!1;const f=()=>{i=gc=new WebSocket(`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`),i.onopen=()=>Wf&&Ey(Wf),i.onmessage=h=>{try{a(JSON.parse(h.data))}catch{}},i.onclose=()=>{r||setTimeout(f,1e3)}};return f(),()=>{r=!0,i==null||i.close()}}function Ta(a){const i=a.ownerDocument,r=[];let f=a;for(;f&&f!==i.body;){const h=f.parentElement;if(!h)return null;r.unshift(Array.prototype.indexOf.call(h.children,f)),f=h}return f===i.body?r.join("/"):null}function Hn(a,i){let r=a.body;if(!i)return r;for(const f of i.split("/"))if(r=(r==null?void 0:r.children[Number(f)])??null,!r)return null;return r}function wl(a){const i=a.getBoundingClientRect();return{x:i.left,y:i.top,w:i.width,h:i.height}}const Vb=["width","height","padding","margin","gap","font-family","font-size","font-weight","color","background-color","border-radius","display","flex-direction","align-items","justify-content","line-height","text-align","border","box-shadow","opacity","flex-wrap","flex-grow","align-self","grid-template-columns","grid-template-rows","position","background-image"];function Xb(a){const i=a.ownerDocument.defaultView.getComputedStyle(a),r={};for(const f of Vb)r[f]=i.getPropertyValue(f);return r}function Vp(a){const i={},r=a.style;if(!r)return i;for(let f=0;f<r.length;f++)i[r[f]]=r.getPropertyValue(r[f]);return i}function Kb(a,i,r,f){const h=f.replace(/\s+/g," ").trim().slice(0,40);return`${a} ${i} ${h?`"${h}" `:""}(${r})`}const Zb={select:"M5 3l13 8-6 1.5L9.5 19z",hand:"M8 12V6.5a1.5 1.5 0 0 1 3 0V11m0-5.5V5a1.5 1.5 0 0 1 3 0v6m0-4.5a1.5 1.5 0 0 1 3 0V13a7 7 0 0 1-7 7h-.5a6 6 0 0 1-5-2.7L3.3 14a1.5 1.5 0 0 1 2.4-1.8L8 15",board:"M4 5h16v14H4zM4 9h16",title:"M5 6h14M12 6v13M9 19h6",sticky:"M5 4h14v10l-5 6H5zM14 20v-6h5",search:"M11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14zM20 20l-4-4",undo:"M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3",redo:"M15 14l5-5-5-5M20 9H10a6 6 0 0 0 0 12h3",play:"M8 5l11 7-11 7z",stop:"M7 7h10v10H7z",edit:"M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4",trash:"M4 7h16M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3",copy:"M8 8h11v11H8zM5 16V5h11",plus:"M12 5v14M5 12h14",close:"M6 6l12 12M18 6L6 18",chevronDown:"M6 9l6 6 6-6",chevronRight:"M9 6l6 6-6 6",list:"M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01",fit:"M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5",focus:"M9 4H4v5M15 4h5v5M9 20H4v-5M15 20h5v-5M9 9h6v6H9z",layers:"M12 3l9 5-9 5-9-5zM3 13l9 5 9-5",comment:"M4 5h16v11H9l-5 4z",front:"M8 8h12v12H8zM4 4h12v4M4 4v12h4",back:"M4 4h12v12H4zM8 16v4h12V8h-4",page:"M6 3h9l4 4v14H6zM15 3v4h4",more:"M5 12h.01M12 12h.01M19 12h.01",moon:"M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z",sun:"M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4",map:"M3 6l6-2 6 2 6-2v14l-6 2-6-2-6 2zM9 4v14M15 6v14",panel:"M4 5h16v14H4zM15 5v14",check:"M5 12l5 5 9-10",warn:"M12 4l9 16H3zM12 10v4M12 17h.01",info:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM12 11v5M12 8h.01",rect:"M4 6h16v12H4z",oval:"M12 19c4.4 0 8-3.1 8-7s-3.6-7-8-7-8 3.1-8 7 3.6 7 8 7z",line:"M5 19L19 5",arrow:"M5 19L19 5M10 5h9v9",pen:"M4 20l1-4L16.5 4.5l3 3L8 19zM14 7l3 3",image:"M4 5h16v14H4zM4 15l4-4 4 4 3-3 5 5M15 9h.01",grid:"M4 4h16v16H4zM4 12h16M12 4v16",system:"M4 5h16v11H4zM9 20h6M12 16v4",globe:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM3 12h18M12 3c2.5 2.5 3.8 5.5 3.8 9s-1.3 6.5-3.8 9c-2.5-2.5-3.8-5.5-3.8-9S9.5 5.5 12 3z",share:"M12 15V4M8 8l4-4 4 4M5 13v6h14v-6",folder:"M4 6h6l2 2h8v11H4z",file:"M6 3h8l4 4v14H6zM14 3v4h4",pdf:"M6 3h8l4 4v14H6zM14 3v4h4M9 13h6M9 17h4",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",compare:"M4 5h7v14H4zM13 5h7v14h-7",restore:"M4 12a8 8 0 1 0 3-6.2M4 4v4h4",link:"M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1",radius:"M5 19V11a6 6 0 0 1 6-6h8",spacing:"M4 4v16M20 4v16M8 12h8M8 12l2-2M8 12l2 2M16 12l-2-2M16 12l-2 2",minus:"M5 12h14",parent:"M10 14L5 9l5-5M5 9h8a6 6 0 0 1 6 6v5",clock:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2",person:"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM5 20a7 7 0 0 1 14 0",alignLeft:"M5 4v16M9 8h10M9 16h6",alignHcenter:"M12 4v16M6 8h12M8 16h8",alignRight:"M19 4v16M5 8h10M9 16h6",alignTop:"M4 5h16M8 9v10M16 9v6",alignVcenter:"M4 12h16M8 6v12M16 8v8",alignBottom:"M4 19h16M8 5v10M16 9v6"};function ne({name:a,size:i=18,...r}){return o.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r,children:o.jsx("path",{d:Zb[a]})})}const ta=(a,i,r)=>a===1?`1 ${i}`:`${a} ${r}`,Hf=a=>ta(a,"variant","variants"),Qb={button:"Button",a:"Link",img:"Image",input:"Field",textarea:"Field",select:"Menu",label:"Label",p:"Paragraph",span:"Text",li:"List item",ul:"List",ol:"List",nav:"Navigation",header:"Header",footer:"Footer",main:"Main",section:"Section",form:"Form",svg:"Icon",style:"Styles",script:"Script"},Xp=(a,i)=>Qb[a??""]??(/^h[1-6]$/.test(a??"")?"Heading":i?`.${i}`:a?`<${a}>`:"Element"),Fb={app:{title:"Easel",docTitle:a=>`${a} — Easel`,loadFailed:"Couldn't load:",retry:"Try again",crashed:"The canvas hit an error and stopped:",reload:"Reload",loadingBoards:"Loading boards…",loading:"Loading…",emptyPage:"This page is empty",drawBoard:"Draw board",defaultAuthor:"Me",tokensAside:"Design tokens",assetsAside:"Assets",inspectorAside:"Inspector",navigation:"Navigation",announceBoard:(a,i,r)=>`${a} selected, ${i}/${r}. Enter to select inside`,firstRunEdit:"Click anything on a board to select it · double-click text to edit it",firstRunAi:a=>`Press ${a}J to ask the AI for a change`},templates:{blank:"Blank",mobile:"Mobile screen",desktop:"Desktop screen",doc:"Document",tablet:"Tablet screen",watch:"Watch screen",email:"Email"},tools:{select:"Select",hand:"Hand",board:"Draw board",title:"Title",sticky:"Note",rect:"Rectangle",oval:"Oval",line:"Line",arrow:"Arrow",pen:"Pen"},toolHints:{select:"Select and move boards",hand:"Drag to pan the canvas",board:"Drag to draw a board",title:"Click to add a title",sticky:"Click to add a sticky note",rect:"Drag to draw a rectangle",oval:"Drag to draw an oval",line:"Drag to draw a line",arrow:"Drag to draw an arrow",pen:"Drag to draw freehand"},toolbar:{aria:"Tools",leftPanel:"Left panel",leftPanelTitle:a=>`Left panel (${a}\\)`,canvasTools:"Canvas tools",shapes:"Shapes",tool:(a,i)=>`${a} (${i})`,shapeToolTitle:(a,i)=>`${a} (${i}) · Shift for square or circle`,insertImage:"Insert image",insertImageTitle:"Insert image (you can also paste onto the canvas)",undo:"Undo",redo:"Redo",undoTitle:(a,i)=>a?`Undo: ${a} (${i}Z)`:`Undo (${i}Z)`,redoTitle:(a,i)=>a?`Redo: ${a} (⇧${i}Z)`:`Redo (⇧${i}Z)`,newBoard:"New board",newBoardTitle:"New board (choose a template)",themeTitle:"Design system theme (used by swatches, token check and AI)",theme:"Theme",themeOption:a=>`Theme: ${a}`,snapshot:"Snapshot (git)",snapshotTitle:"Snapshot: save the design folder as a git commit",erroredBoards:"Boards with errors",erroredBoardsN:a=>`Boards with errors ${a}`,errors:a=>`Errors ${a}`,zoomOut:"Zoom out",zoomOutTitle:a=>`Zoom out (${a}-)`,zoomIn:"Zoom in",zoomInTitle:a=>`Zoom in (${a}+)`,zoom100:"Zoom to 100%",zoom100Title:a=>`Zoom to 100% (${a}0)`,fitAll:"Fit all",fitAllTitle:"Fit all (⇧1)",aiChat:"AI chat",askAi:"Ask AI",aiChatTitle:a=>`AI chat (${a}J)`,guides:"Show layout guides",guidesTitle:"Show layout guides (⌃G)",appearance:a=>`Appearance: ${a==="system"?"System":a==="light"?"Light":"Dark"}`,appearanceTitle:a=>`Appearance: ${a==="system"?"Follow system":a==="light"?"Light":"Dark"} (click to change)`,minimap:"Minimap",minimapTitle:"Minimap (M)",viewMenu:"View",viewMenuTitle:"View: guides, minimap, appearance, theme, language, snapshot",viewMenuTitleNarrow:"View: zoom, history, guides, minimap, appearance, language, snapshot",language:a=>`Language: ${a}`,project:"Project",history:"History"},tabs:{left:"Left panel",boards:"Boards",assets:"Assets",tokens:"Tokens",right:"Right panel",closePanel:"Close panel",properties:"Properties",ai:"AI"},boardList:{aria:"Pages and boards",pages:"Pages",addPage:"Add page",singlePage:"Viewing everything as one page. Use + to split it into pages.",pageTabTitle:"Drag to reorder · right-click to rename or delete",boardsHead:"Boards",searchPlaceholder:"Find boards (⌘K)",search:"Find boards",noMatch:a=>`No boards match "${a}". Try part of the file name.`,emptyPage:"No boards on this page yet. Press B and drag on the canvas to draw one.",fileMissing:"File missing",otherGroup:"Other",mainPage:"Main",groupTitle:a=>`${ta(a,"board","boards")} · click to collapse or expand · double-click to rename`,groupMenu:"Group menu"},minimap:{aria:"Minimap: click to move there"},sections:{board:"Board",comments:"Comments",guides:"Layout guides",tweaks:"Adjustable values",tokenCheck:"Token check",a11y:"Accessibility",checks:"Checks",properties:"Properties",layers:"Layers"},boardOptions:{aria:"Board options",positionAndSize:"Position and size",position:"Position",size:"Size",options:"Options",renameTitle:"Rename (F2)",renameFileTitle:"Rename file",width:"Width",height:"Height",radius:"Radius",interactive:"Show Play button",interactiveTitle:"Keeps the ▶ on the board's label always visible, with a dot. Without it the ▶ shows when the board is selected or hovered; any board plays with P or right-click",frameless:"No frame",fill:"Stretch to window",launch:"Open as launch screen",page:"Page",focus:"Focus view",focusTitle:"Focus view (F)",front:"Bring to front",frontTitle:"Bring to front (⌘])",back:"Send to back",backTitle:"Send to back (⌘[)",duplicate:"Duplicate",duplicateTitle:"Duplicate (⌘D)",delete:"Delete",deleteTitle:"Delete (Delete)",selectedN:a=>`${ta(a,"board","boards")} selected`,frontTitleMod:a=>`Bring to front (${a}])`,backTitleMod:a=>`Send to back (${a}[)`,goToSelected:"Go to selected boards",goToSelectedTitle:"Go to selected boards (⇧2)",deleteTitleKey:"Delete (⌫)"},focus:{aria:a=>`${a} focus view`,prev:"Previous board",next:"Next board",pageStyle:" · page-style",close:"Close"},play:{back:"Back",forward:"Forward",viewOnCanvas:"View on canvas",closeTitle:"Close (Esc)",close:"Close"},share:{button:"Share",buttonTitle:"Share a view-only copy (web folder, single file, PDF or PNG)",title:"Share a view-only copy",scope:"What to export",whole:"Whole canvas",page:"This page",pageNone:"This canvas has one page",selected:a=>`Selected boards (${a})`,webTitle:"Web folder",webHint:"Static files. Host on Vercel, GitHub Pages or a PR preview.",singleTitle:"Single file",singleHint:a=>` · ${a} · opens in any browser, no hosting`,singleSwitch:"One .html file",measuring:"measuring…",pdfTitle:"PDF",pdfHint:"One board per page",pngTitle:"PNG",pngHint:"One image per board, 2×",export:"Export",save:"Save",working:"Exporting…",exported:"exported",saved:"saved",reveal:"Reveal",revealTitle:"Show the folder in your file manager",copyDeploy:"Copy deploy command",copyDeployTitle:a=>`Copies ${a} (run it in the project folder)`,copied:a=>`Copied: ${a}`,copyFailed:"Couldn't copy to the clipboard",attachHint:"Attach it to Slack, email or a PR.",skipped:a=>`${a} reference${a===1?"":"s"} could not be included`,largeFiles:"Large canvases make large files. No live updates.",sameAs:"Same as:",unavailable:"Unavailable here."},viewer:{docTitle:a=>`${a} — view only`,noData:"This page is an Easel export, but its data is missing (easel-viewer/data.js).",bar:"Viewer",pages:"Pages",play:"Play",playTitle:"Try the selected board full screen (or the first one)",stamp:a=>`View only · exported ${a}`,stampTitle:"A read-only copy. Changes happen in the design files, then export again.",madeWith:"Made with Easel",comments:"Comments",commentsN:a=>`Comments ${a}`,noComments:"No comments",replies:a=>a===1?"1 reply":`${a} replies`,pin:(a,i)=>`Comment ${a} by ${i}`,threadOf:(a,i)=>`${a} of ${i}`,closeThread:"Close comment",boardsPanel:"Boards",commentsPanel:"Comments panel",empty:"Nothing on this page",embedGate:"Use the canvas: pan, zoom, open a board, press Play. Esc gives the page back.",embedHint:"Click the canvas to pan and zoom",embedHintLive:"Esc or a click outside gives the page back"},canvas:{aria:"Design canvas",board:(a,i,r,f)=>`Board ${a}${i?" (selected)":""}${r?" editing":""}${f?" playing":""}`,interactive:"Marked as playable",hint:"Click selects · Double-click edits text · Esc deselects",notLoaded:"Scroll closer to load",fileMissing:a=>`File missing · ${a}`,playing:"▶ Playing · Esc",exportingPng:"Exporting PNG…",play:"Play",playTitle:"Play (P)",stopPlay:"Stop Play",stopPlayTitle:"Stop Play (P or Esc)",boardSize:"Board size",titleMaxWidth:"Max width",stickySize:"Sticky note size",deleteNote:"Delete note"},editMode:{fileChanged:"Someone changed this file first. Select the element again."},elementDrag:{moveAria:"Move element (Alt: into the hovered box)",moveTitle:"Drag to move · hold Alt to drop into the hovered box",width:"Width",height:"Height",size:"Size"},layers:{collapse:"Collapse",expand:"Expand",title:"Layers",hint:"Drop an item on another to move it in front of that item. Shift+click to select several (for wrapping). Click the list, then use ↑↓ to move and ←→ to collapse or expand."},select:{toolbar:"Element",text:"Text",textOff:"No text in this element",fill:"Fill",radius:"Radius",spacing:"Spacing",askAi:"Ask AI",askAiTitle:"Ask AI about this element",comment:"Comment",commentTitle:"Comment on this element",tokens:"Tokens",custom:"Custom…",hex:"Hex colour",picker:"Pick a colour",tokenNow:a=>`${a} · token`,decrease:a=>`Decrease ${a.toLowerCase()}`,increase:a=>`Increase ${a.toLowerCase()}`},design:{fill:"Fill",text:"Text",font:"Font",size:"Size",weight:"Weight",color:"Color",cornerRadius:"Corner radius",padding:"Padding",gap:"Gap",more:"More (CSS)",none:"None",inherited:a=>`(${a})`,weights:{100:"Thin",200:"Extra light",300:"Light",400:"Regular",500:"Medium",600:"Semibold",700:"Bold",800:"Extra bold",900:"Black"},white:"white",black:"black",grade:a=>a>=7?"AAA":a>=4.5?"AA":a>=3?"AA large text only":"too low",contrastWith:(a,i,r)=>`Contrast ${a}:1 with ${i} text · ${r}`,contrastOn:(a,i,r)=>`Contrast ${a}:1 on ${i} · ${r}`,openFill:a=>`${a}: change`},properties:{tokenColors:{text:"Text",secondaryText:"Secondary text",background:"Background",surface:"Surface",divider:"Divider",accent:"Accent",error:"Error"},fields:{width:"Width",height:"Height",fontSize:"Font size",fontWeight:"Weight",color:"Color",background:"Background",radius:"Radius",flexDirection:"Flex direction",alignItems:"Align items",justifyContent:"Justify content",flexWrap:"Wrap",flexGrow:"Grow",alignSelf:"Align self",lineHeight:"Line height",textAlign:"Text align",border:"Border",boxShadow:"Shadow",opacity:"Opacity"},alignButtons:{left:"Align left",hcenter:"Align center",right:"Align right",top:"Align top",vcenter:"Align middle",bottom:"Align bottom"},columns:"Columns",rows:"Rows",align:"Align",layout:"Layout",wrap:"Wrap",image:"Image",replaceImage:"Replace image…",wrapTitle:"Select consecutive siblings with the same parent first",wrapFlex:"Wrap in flex",wrapGrid:"Wrap in grid",duplicate:"Duplicate",delete:"Delete",offToken:a=>`Off tokens: ${a}`,none:"none",contrastTitle:"Contrast with background (4.5 or more for body text, 3 or more for large text)",contrast:"Contrast",largeTextOnly:"Large text only",tooLow:"Too low"},shapes:{selectedN:a=>`${a} shapes selected`,deleteAll:"Delete selected shapes",stickyColors:{yellow:"Yellow",orange:"Orange",pink:"Pink",purple:"Purple",blue:"Blue",green:"Green",gray:"Gray",white:"White"},shapeSize:"Shape size",drawShape:"Draw shape",kinds:{rect:"Rectangle",oval:"Oval",line:"Line",arrow:"Arrow",pen:"Pen",image:"Image"},none:"None",options:"Shape options",strokeColor:"Stroke color",fill:"Fill",weight:"Weight",strokeWeight:"Stroke weight",front:"Bring to front",back:"Send to back",deleteShape:"Delete shape",deleteTitle:"Delete (⌫)"},notes:{selectedN:a=>`${a} notes selected`,deleteAll:"Delete selected notes",options:"Note options",title:"Title",sticky:"Sticky note",fontSize:"Font size",defaultSuffix:" (default)",textStyle:"Text style",bold:"Bold",italic:"Italic",color:"Color",stickyColor:a=>`${a} sticky note`,maxWidth:"Max width",maxHeight:"Max height",width:"Width",height:"Height",titleHint:"Text shrinks once it passes the max width or height (0 means no limit).",stickyHint:"With a height set, overflowing text scrolls (0 fits the content).",deleteNote:"Delete note",deleteTitle:"Delete (⌫)"},guides:{aria:"Layout guides",heading:(a,i)=>`Layout guides ${a}/${i}`,types:{columns:"Columns",rows:"Rows",grid:"Grid"},add:{columns:"Add column guide",rows:"Add row guide",grid:"Add grid guide"},empty:"Add up to 6 column, row or grid guides. They show only on the canvas and never go into the screen HTML. Hide all: ⌃G",color:"Guide color",show:"Show",hide:"Hide",deleteGuide:"Delete guide",delete:"Delete",cell:"Cell",count:"Count",gutter:"Gutter",margin:"Margin",cellSize:"Cell size",align:"Align",alignAria:"Guide alignment",stretch:"Stretch",left:"Left",top:"Top",center:"Center",right:"Right",bottom:"Bottom"},dialog:{renameGroupTitle:"Rename group",menu:"Menu",cancel:"Cancel",ok:"OK",deleteBoardsTitle:(a,i)=>a>1?`Delete ${a} boards?`:`Delete board "${i}"?`,deleteBoardsBody:"The HTML files are deleted too. A copy stays in the trash (docs/design/.trash), and Undo (⌘Z) brings them back right away.",delete:"Delete",renameBoardTitle:"Rename board",name:"Name",rename:"Rename",renameFileTitle:"Rename file",fileName:"File name",renameFileRefs:a=>`Links or iframes pointing to this file: ${a}`,renameFileNoRefs:"No links or iframes point to this file.",renameFileExtra:a=>`Also update ${ta(a,"reference","references")} to the new name`,newPageTitle:"New page",newPageName:a=>`Page ${a}`,create:"Create",renamePageTitle:"Rename page",deletePageTitle:a=>`Delete page "${a}"?`,deletePageBody:a=>`Its ${ta(a,"board","boards")} and notes aren't deleted; they move to the first page. You can undo with ⌘Z.`,authorTitle:"Comment author",save:"Save",snapshotTitle:"Save snapshot",snapshotLabel:"Message",snapshotMessage:a=>`docs(design): design snapshot ${a}`,snapshotHint:"Commits only the design folder. The author comes from your git config, and nothing else you staged is included.",commit:"Commit"},toast:{saveFailed:a=>`Save failed: ${a}`,undoRedoDone:(a,i)=>`${a==="undo"?"Undo":"Redo"}: ${i}`,nothingToUndo:"Nothing to undo",nothingToRedo:"Nothing to redo",undoAction:"Undo",textOnly:"Only elements that contain just text (and line breaks) can be edited in place",moved:"Moved",movedFrozen:"Moved (kept the size of the original spot)",copiedElement:(a,i)=>`Copied <${a}> — paste it into another board while editing with ${i}V`,nothingCopied:"No element copied. Select an element while editing and press ⌘C",pasted:(a,i)=>`Pasted <${i}> from ${a}`,imageReplaced:a=>`Replaced the image with ${a}`,boardCreated:a=>`Created board ${a}`,boardCreateFailed:a=>`Couldn't create the board: ${a}`,boardsDeleted:a=>`Deleted ${ta(a,"board","boards")}`,duplicated:a=>`Duplicated as ${a}`,renamed:"Renamed",fileRenamed:(a,i)=>`Renamed to ${a}${i?" (references updated)":""}`,notesMax:a=>`You can have up to ${a} notes`,noteDeleted:"Note deleted",shapeDeleted:"Shape deleted",shapesDeleted:a=>`Deleted ${ta(a,"shape","shapes")}`,imageReadFailed:"Couldn't read the image",importOnly:a=>`${a}: only HTML or images can be imported`,imported:a=>`Imported ${ta(a,"board","boards")}`,pagesMax:"You can have up to 40 pages",pageDeleted:"Page deleted",copied:"Copied",elementDeleted:"Element deleted",wrapped:a=>`Wrapped in ${a}`,theme:a=>`Theme: ${a}`,tokensSaved:"Tokens saved",nothingChanged:"Nothing changed",snapshot:a=>`Snapshot ${a}`,cleanedUp:a=>`Cleaned up ${ta(a,"board","boards")}`,uploaded:a=>`Uploaded ${a}`,tweaksSaved:"Saved tweaks to source",blockFlow:"Vertical alignment doesn't apply in block flow. Try changing the parent to flex",pngExporting:a=>`Rendering ${a}…`,pngExported:a=>`Downloaded ${a}`,pngNeedsBrowser:"PNG export needs a headless browser:",pngFailed:a=>`Couldn't render the PNG: ${a}`},history:{renameGroup:"Rename group",pageFromGroup:"Page from group",boardOptions:"Board options",front:"Bring to front",back:"Send to back",moveBoard:"Move board",resizeBoard:"Resize board",addTitle:"Add title",addNote:"Add note",deleteNote:"Delete note",duplicateNote:"Duplicate note",moveNote:"Move note",editNote:"Edit note",noteStyle:"Note style",addShape:"Add shape",deleteShape:"Delete shape",moveShape:"Move shape",resizeShape:"Resize shape",shapeStyle:"Shape style",shapeFront:"Bring shape to front",shapeBack:"Send shape to back",addImage:"Add image",launchPage:"Launch page",moveToPage:"Move to page",launchScreen:"Set launch screen",changeTheme:"Change theme",cleanMissing:"Clean up boards with missing files",editGuide:"Edit layout guide",addGuide:"Add layout guide",deleteGuide:"Delete layout guide",saveTokens:"Save tokens",registerTokens:"Register tokens"},defaults:{newTitle:"New title",note:"Note",pastedImage:"pasted-image.png"},menu:{newBoard:"New board",renameGroup:"Rename group…",pageFromGroup:"Make a page from this group",drawWithB:"B to draw",rename:"Rename",moveUp:"Move up",moveDown:"Move down",unsetLaunchPage:"Unset launch page",setLaunchPage:"Set as launch page",moveSelectedToPage:a=>`Move ${ta(a,"selected board","selected boards")} to this page`,delete:"Delete",selectInside:"Select inside",playInPlace:"Play in place",stopPlay:"Stop Play",playFullScreen:"Play full screen",askReview:"Ask AI for a review",focusView:"Focus view",askAI:"Ask AI",askFixErrors:"Ask AI to fix errors",goToBoard:"Go to board",exportPng:"Export PNG",exportingPng:"Exporting PNG…",renameFile:"Rename file…",duplicate:"Duplicate",front:"Bring to front",back:"Send to back",deleteBoards:a=>`Delete ${a} boards`,title:"Title",note:"Note",duplicateInFront:"Duplicate in front",newBoardHere:"New board here",mobileFrameHere:"Mobile screen frame here",titleHere:"Title here",noteHere:"Note here",selectAll:"Select all on this page",fitAll:"Fit all",zoom100:"Zoom to 100%",undo:"Undo",redo:"Redo",element:"Element",editText:"Edit text",selectParent:"Select parent",elementToAI:"Send this element to AI",copy:"Copy",pasteAfter:"Paste after",replaceImage:"Replace image…",copyForAI:"Copy description for AI",shape:"Shape",snapshot:"Snapshot",notGit:"The design folder isn't inside a git repository",snapshotStatus:(a,i)=>`Snapshot · ${a} · ${ta(i,"changed file","changed files")}`,snapshotNow:"Save snapshot now (git commit)…",nothingChanged:"Nothing changed",fileMissing:"File is missing",askFixAll:"Ask AI to fix all",cleanMissing:a=>`Clean up ${ta(a,"board","boards")} with missing files`},prompts:{fixErrors:a=>`Fix these errors:
50
+ ${a}`,error:"Error",review:"Review this screen: point out accessibility (48px touch targets, 4.5 contrast, labels), information hierarchy, and token violations (get_tokens, check_tokens), with fixes in priority order. Don't edit anything; only suggest.",fixComment:"Fix only that spot, as this comment says",fixTokens:a=>`Replace off-token values with tokens (verify with check_tokens):
51
+ ${a}`,fixA11y:a=>`Fix the accessibility issues (keep the visible size; enlarge touch targets with padding):
52
+ ${a}`,line:"Line "},checks:{tokenCheck:a=>`Token check · ${a}`,noOffToken:"No off-token values",off:"off",tokensOffTitle:"No tokens registered — checks are off",tokensOffBody:"Colours and sizes are not checked, and the AI is not given a default palette.",setUpTokens:"Set up tokens",a11y:"Accessibility",a11yOk:"No touch target, contrast or label issues",askFix:"Ask AI to fix",notVisible:"Checks run when the board is visible on screen.",pickInEdit:a=>`Select ${a} on the board`,line:a=>`Line ${a}`,more:a=>`+${a} more`,colorNotInTokens:"Color not in tokens",tokenFontSizes:a=>`Token font sizes: ${a}`,tokenRadii:a=>`Token radius: ${a}`,notMultipleOf4:"Not a multiple of 4",tokenWeights:a=>`Token weights: ${a}`,smallTarget:(a,i,r,f)=>`<${a}> touch target ${i}×${r} (under ${f})`,noName:a=>`<${a}> has no name (aria-label, text or label)`,noAlt:'<img> has no alt (use alt="" if decorative)',lowContrast:(a,i,r)=>`Contrast ${a}:1 (needs ${i}) "${r}"`},tokens:{import:"Import tokens (tokens.json or Figma variables JSON)",importFailed:a=>`Couldn't import: ${a}`,theme:"Theme",addTheme:"Add theme (copy current theme)",newTheme:"New theme",newThemeN:a=>`New theme ${a}`,activeTheme:"Active theme",themeName:"Theme name",importedTheme:"Imported",colors:a=>`Colors ${a}`,addColor:"Add color",colorN:a=>`Color ${a}`,colorOf:a=>`${a} color`,colorName:"Color name",remove:a=>`Remove ${a}`,fontSizes:"Font sizes",fontWeights:"Font weights",radii:"Radius",spacing:"Spacing",touchTarget:"Touch target",minTouchTarget:"Minimum touch target",saveTitle:"Save to docs/design/tokens.json",save:"Save",register:"Register tokens",registeredHint:"Properties panel swatches, token check and AI (get_tokens) use the selected theme's values.",defaultHint:"Starter values, not in use yet. Registering saves them to tokens.json and turns on the token check and the AI palette.",noColors:"Couldn't find any color values"},tweaks:{revert:"Revert",save:"Save to source",hint:"Applied right away as CSS variables. Saving changes only the values in the board-tweaks JSON."},inspector:{shotFailed:a=>`Failed: ${a}`,kindName:a=>({text:"Text",button:"Button",link:"Link",image:"Image",input:"Input",icon:"Icon",container:"Container"})[a]??a,crumbs:"Selection path",crumbBoard:"Select the board",crumbParent:a=>`Select ${a}`,crumbElement:(a,i)=>`<${a}> ${i}`,more:a=>`+${a} more`,copy:"Copy",copied:"Copied",capturing:"Capturing…",screenshot:"Screenshot",boardScreenshot:"Board screenshot",boardScreenshotTitle:"Save a PNG of this board next to the design folder",screenshotTitle:"Save a PNG of this element",actions:"Element actions",boardActions:"Board actions"},comments:{title:"Comments",placeholderElement:a=>`Comment on the selected element (${a})`,placeholderBoard:"Comment on the board",add:"Comment",authorTitle:"Change comment author name",author:a=>`Author: ${a}`,replyPlaceholder:a=>`Reply as ${a} (⌘Enter)`,reply:"Reply",replyResolve:"Reply and resolve",reopen:"Reopen",resolve:"Resolve",sendToAI:"Send to AI",sendToAITitle:"Send to AI to fix only where this comment points"},assets:{uploading:"Uploading…",upload:"Upload (images and fonts; drag and drop works too)",loading:"Loading…",empty:"No assets yet. Uploaded images are saved to docs/design/assets/ and used in screens as ../assets/name.",copyPath:" · click to copy path",file:"File",pickImage:"Choose image",pickLabel:", use this image",close:"Close"},chat:{aria:"AI chat",agent:"Agent",agentHint:"Which agent edits the files",agentButton:(a,i)=>i?`Agent: ${a} — ${i}`:`Agent: ${a}`,agentStatus:{ready:"ready",signin:"sign-in needed",missing:"not installed",unknown:"couldn't check"},checking:"Checking…",checkedOnOpen:"Checked when the AI tab opened",checkAgain:"Check again",model:"Model",modelDefault:"Default (from CLI config)",modelTitle:a=>`Model for ${a}: an alias or a full model id. Leave empty for the CLI's own default.`,continuing:"Continuing conversation",newConversation:"New conversation",newChat:"New chat",intro:a=>`Sends the selected boards and elements, plus the boards visible on screen, to ${a} as context. The agent edits the source HTML directly, and the canvas redraws right away.`,suggestions:[{label:"AI review: accessibility, contrast, hierarchy",text:"Review the selected screen: accessibility (48px touch targets, 4.5 contrast, labels), information hierarchy, and token violations (get_tokens, check_tokens). Only suggest changes in priority order; don't edit anything.",n:1},{label:"3 variants of this screen",text:"Make 3 variants of the selected screen in different directions (each with a different layout, hierarchy and emphasis).",n:3},{label:"Shorten the selected button text",text:"Shorten the selected button text",n:1},{label:"Make a new empty-state screen",text:"Make a new empty-state screen",n:1}],remedySignin:(a,i)=>`${a} is not signed in. Run \`${i}\` in a terminal.`,remedyMissing:a=>`\`${a}\` command not found. Install it, then Check again.`,copyCommand:"Copy command",copy:"Copy",copied:"Copied",sendNeedsSignin:a=>`Sign in to ${a} to send`,sendNeedsInstall:a=>`Install ${a} to send`,running:"Running",cancelled:"Cancelled",failed:"Failed",retry:"Retry",switchTo:a=>`Switch to ${a}`,details:"Details",noFilesChanged:"No files were changed.",restored:"Restored from the failed message",madeVariants:a=>`Made ${Hf(a)} side by side · View`,thinking:"Thinking…",chipElement:a=>`Element <${a}>`,chipElementText:(a,i)=>`Element <${a}> ${i}`,chipBoards:a=>`${a} boards`,chipVisible:a=>`Visible boards ${a}`,chipComment:a=>`Comment "${a}"`,variants:Hf,tooBig:a=>`${a}: larger than 15MB`,refLink:"Reference link",placeholderRunning:"Running… (Esc to cancel)",placeholder:"What should change? (Enter to send · Shift+Enter for a new line)",input:"Message to AI",attach:"Attach file or image",attachTitle:"Attach file or image (drag and drop or paste works too)",addLink:"Add reference link",variantsTitle:"Copies the selected board and makes different variants side by side",variantsDisabledTitle:"Select one board to use this",variantsAria:"Number of variants",cancel:"Cancel",cancelTitle:"Cancel (Esc)",send:"Send",chipRemoveTitle:"Click to remove",chipAddTitle:"Click to attach",remove:a=>`Remove ${a}`,howToInstall:"How to install",customCommand:"Custom command…",checkedAt:(a,i)=>i?`Checked when the AI tab opened · ${a}`:`Checked again at ${a}`,customTitle:"Custom command",customName:"Name",customCommandLabel:"Command",customNamePlaceholder:"Aider",customCommandPlaceholder:"aider --message {prompt} --yes",customHint:"`{prompt}` is replaced with your request and the canvas context. Output is shown as plain text.",customSave:"Save",customCommandTitle:a=>`Runs without a shell: ${a}`,waiting:"Waiting for you",waitingHint:"answer the request above",permAsk:(a,i,r)=>i==="command"?`${a} asks to run a command`:i==="edit"?`${a} asks to ${r==="Write"?"write":"edit"} a file`:i==="fetch"?`${a} asks to fetch a page`:`${a} asks to use ${r}`,permIn:"in",permOutside:"outside the design folder",allowOnce:"Allow once",alwaysAllow:a=>`Always allow ${a}`,alwaysAllowTitle:"Until Easel restarts, for this canvas only",deny:"Deny",permDone:{once:"Allowed",always:"Always allowed",deny:"Denied"},permDoneOutside:"(outside the design folder)",noPause:{codex:"Codex exec cannot pause to ask; it follows its sandbox setting.",cursor:"Cursor Agent cannot pause to ask here; it runs with --force.",gemini:"Gemini CLI cannot pause to ask here; it accepts edits on its own."},runChanged:(a,i)=>a&&i?`Changed ${a} board${a===1?"":"s"} · added ${i}`:i?`Added ${i} board${i===1?"":"s"}`:a?`Changed ${a} board${a===1?"":"s"}`:"Changed the canvas",chipNew:a=>`${a} (new)`,chipRemoved:a=>`${a} (removed)`,undoRun:"Undo this run",compare:"Compare",redo:"Redo",runUndone:a=>`Run undone · ${a} board${a===1?"":"s"} restored`,conflictUndo:a=>`Changed since this run: ${a}. Undo the rest and keep those, or undo all and overwrite them?`,conflictRedo:a=>`Changed since the undo: ${a}. Redo the rest and keep those, or redo all and overwrite them?`,undoRest:"Undo the rest",undoAll:"Undo all anyway",redoRest:"Redo the rest",redoAll:"Redo all anyway",restoreCopy:"Restore the copy from before this run",savedAt:a=>`Saved ${a}`,copyGone:"The copy from before this run is gone (only the newest 10 are kept).",restoredCopy:"Canvas restored to the copy from before this run",restoreTitle:"Restore the copy from before this run?",restoreBody:a=>`This puts the whole canvas back to ${a}, before this run: every screen and board.json, including anything changed since by you or by other runs. Undo takes the restore back.`,restoreOk:"Restore",restarted:a=>`Easel restarted · ${a}`},compare:{title:a=>`Compare · ${a}`,boards:"Boards",before:"Before",after:"After",notBefore:"This board did not exist before the run.",notAfter:"This run removed the board.",notBeforeChange:"This board did not exist before this change.",close:"Close"},activity:{outside:"Outside Easel",ago:a=>{const i=Math.floor(Math.max(0,a)/6e4);return i<1?"now":i<60?`${i}m`:i<1440?`${Math.floor(i/60)}h`:`${Math.floor(i/1440)}d`},agoLong:a=>{const i=Math.floor(Math.max(0,a)/6e4);return i<1?"just now":i<60?`${i} min ago`:i<1440?`${Math.floor(i/60)} h ago`:`${Math.floor(i/1440)} d ago`},tag:(a,i,r,f)=>`${a} · ${i} · ${f&&r===1?"new board":ta(r,"change","changes")}`,tagTitle:a=>`${a} — click for the change, Before / After and Undo`,tagsAria:a=>`${ta(a,"change","changes")} by others`,popAria:a=>`Change by ${a}`,element:Xp,change:a=>{const i=Xp(a.tag,a.cls);switch(a.kind){case"style":return`Style changed on ${i}`;case"attr":return`${i} attributes changed`;case"edited":return`${i} changed`;case"added":return a.count>1?`${a.count} elements added`:`${i} added`;case"removed":return a.count>1?`${a.count} elements removed`:`${i} removed`;case"replaced":return`${i} replaced`;case"many":return`${a.count}${a.more?"+":""} elements changed`;case"page":return"Page styles or title changed";case"source":return"Only spacing or comments in the source changed";case"new":return"New board";case"deleted":return"Board deleted";case"moved":return"Board moved";case"resized":return"Board resized";case"renamed":return"Board renamed";case"options":return"Board options changed";default:return"Changed"}},changes:a=>`${ta(a,"change","changes")} on this board`,quote:a=>`“${a}”`,arrow:"→",beforeAfter:"Before / After",undo:"Undo",undoTitle:a=>a===1?"Undo this change":`Undo these ${a} changes`,conflict:a=>`Changed since: ${a}. Undo the rest and keep those, or undo all and overwrite them?`,undoRest:"Undo the rest",undoAll:"Undo all anyway",cancel:"Cancel",close:"Close",historyButton:"History",historyTitle:"History · newest first",historyEmpty:"Nothing yet. Changes made in this session show up here.",historyFoot:"History is kept for this session.",now:"Now",goBack:"Go back to here",goBackAria:(a,i,r)=>`${a} by ${i}, ${r} · Go back to here`,nowAria:(a,i,r)=>`${a} by ${i}, ${r} · current`,undoneAria:(a,i,r)=>`${a} by ${i}, ${r} · undone`,wentBack:a=>`Back to: ${a}`},occupancy:{editing:a=>`${a} is editing…`,you:"You · editing",personEditing:a=>`${a} · editing`,done:(a,i)=>`${a} · done ${i}`,someone:"Someone",clock:a=>new Date(a).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),tagsAria:"Who is on this board",listDot:a=>`${a} is editing`,youListDot:"You are editing",forked:(a,i,r)=>`Forked ${a} — ${i} started while ${r} was editing`,forkBlock:(a,i)=>a===1?`Fork of ${i}`:`${a} forks of ${i}`,forkBlockWhile:(a,i,r)=>`${a===1?`Fork of ${i}`:`${a} forks of ${i}`} · made while ${r} was editing`,forkBlockShort:a=>a===1?"Fork":`${a} forks`,useThis:"Use this",useThisOne:"Use this one",useThisTitle:"Make this variant the original board; the other variants go to trash",useThisOneTitle:a=>`Keep this version as the board; ${a===1?"the other version goes":`the other ${a} versions go`} to trash`,waitFor:a=>`Wait until ${a} is done editing`,confirmVariant:(a,i)=>`Apply "${a}" to ${i}?`,confirmVariantBody:(a,i)=>`${a} is replaced.${i?` The other ${i===1?"variant goes":`${i} variants go`} to trash.`:""}`,confirmFork:(a,i)=>`Use "${a}" for ${i}?`,confirmForkBody:(a,i)=>`${a} is replaced by this version. ${i?`This fork and the other ${i===1?"fork go":`${i} forks go`} to trash.`:"The fork goes to trash."}`,confirmKeep:a=>`Keep "${a}"?`,confirmKeepBody:(a,i)=>`${a} ${i===1?"goes":"go"} to trash.`,apply:"Apply",keepAll:"Keep all",keepBoth:"Keep both",applied:(a,i)=>`Applied ${a} to ${i}`,kept:(a,i)=>`Kept ${a}; ${i===1?"the other version is":`the other ${i} versions are`} in trash`,keptAll:(a,i)=>a==="variant"?`Kept all ${Hf(i)} as boards`:i===1?"Kept both versions as boards":`Kept all ${i+1} versions as boards`,undo:"Undo"},update:{out:a=>`Easel ${a} is out`,copy:"Copy command",copied:"Copied. Run it, then restart Easel",hide:"Hide until the next version"}},Jb={button:"버튼",a:"링크",img:"이미지",input:"입력란",textarea:"입력란",select:"선택 메뉴",label:"라벨",p:"문단",span:"텍스트",li:"목록 항목",ul:"목록",ol:"목록",nav:"내비게이션",header:"헤더",footer:"푸터",main:"본문",section:"섹션",form:"폼",svg:"아이콘",style:"스타일",script:"스크립트"},Kp=(a,i)=>Jb[a??""]??(/^h[1-6]$/.test(a??"")?"제목":i?`.${i}`:a?`<${a}>`:"요소");function Ib(a,i){const r=a.replace(/[\s>)"'”’\]]+$/,"").slice(-1),f=r.charCodeAt(0);let h=null;f>=44032&&f<=55203?h=(f-44032)%28:/[0-9]/.test(r)?h=[21,8,0,16,0,0,1,8,8,0][Number(r)]:/[lmn]/i.test(r)?h=/l/i.test(r)?8:/m/i.test(r)?16:4:/[a-z]/i.test(r)&&(h=0);const[p,y]=i.split("/");return h==null?i==="으로/로"?"(으)로":`${p}(${y})`:i==="으로/로"?h===0||h===8?"로":"으로":h?p:y}const Et=(a,i)=>a+Ib(a,i),Zp=a=>a==="system"?"시스템":a==="light"?"라이트":"다크",Wb={app:{title:"Easel",docTitle:a=>`${a} — Easel`,loadFailed:"불러오지 못했어요:",retry:"다시 시도",crashed:"캔버스에 오류가 나서 멈췄어요:",reload:"새로고침",loadingBoards:"보드를 불러오는 중…",loading:"불러오는 중…",emptyPage:"이 페이지는 비어 있어요",drawBoard:"보드 그리기",defaultAuthor:"나",tokensAside:"디자인 토큰",assetsAside:"에셋",inspectorAside:"인스펙터",navigation:"내비게이션",announceBoard:(a,i,r)=>`${a} 선택됨, ${i}/${r}. Enter를 누르면 안쪽을 선택해요`,firstRunEdit:"보드에서 무엇이든 클릭해 선택하고, 텍스트는 더블클릭해 고쳐요",firstRunAi:a=>`${a}J를 눌러 AI에게 수정을 요청해요`},templates:{blank:"빈 보드",mobile:"모바일 화면",desktop:"데스크톱 화면",doc:"문서",tablet:"태블릿 화면",watch:"워치 화면",email:"이메일"},tools:{select:"선택",hand:"손",board:"보드 그리기",title:"제목",sticky:"메모",rect:"사각형",oval:"타원",line:"선",arrow:"화살표",pen:"펜"},toolHints:{select:"보드를 선택하고 옮겨요",hand:"끌어서 캔버스를 움직여요",board:"끌어서 보드를 그려요",title:"클릭해 제목을 넣어요",sticky:"클릭해 스티키 노트를 붙여요",rect:"끌어서 사각형을 그려요",oval:"끌어서 타원을 그려요",line:"끌어서 선을 그려요",arrow:"끌어서 화살표를 그려요",pen:"끌어서 자유롭게 그려요"},toolbar:{aria:"도구",leftPanel:"왼쪽 패널",leftPanelTitle:a=>`왼쪽 패널 (${a}\\)`,canvasTools:"캔버스 도구",shapes:"도형",tool:(a,i)=>`${a} (${i})`,shapeToolTitle:(a,i)=>`${a} (${i}) · Shift를 누르면 정사각형이나 원`,insertImage:"이미지 넣기",insertImageTitle:"이미지 넣기 (캔버스에 붙여 넣어도 돼요)",undo:"실행 취소",redo:"다시 실행",undoTitle:(a,i)=>a?`실행 취소: ${a} (${i}Z)`:`실행 취소 (${i}Z)`,redoTitle:(a,i)=>a?`다시 실행: ${a} (⇧${i}Z)`:`다시 실행 (⇧${i}Z)`,newBoard:"새 보드",newBoardTitle:"새 보드 (템플릿 고르기)",themeTitle:"디자인 시스템 테마 (색 견본, 토큰 검사, AI가 써요)",theme:"테마",themeOption:a=>`테마: ${a}`,snapshot:"스냅샷 (git)",snapshotTitle:"스냅샷: 디자인 폴더를 git 커밋으로 저장해요",erroredBoards:"오류가 있는 보드",erroredBoardsN:a=>`오류가 있는 보드 ${a}`,errors:a=>`오류 ${a}`,zoomOut:"축소",zoomOutTitle:a=>`축소 (${a}-)`,zoomIn:"확대",zoomInTitle:a=>`확대 (${a}+)`,zoom100:"100%로 보기",zoom100Title:a=>`100%로 보기 (${a}0)`,fitAll:"전체 보기",fitAllTitle:"전체 보기 (⇧1)",aiChat:"AI 채팅",askAi:"AI에게 묻기",aiChatTitle:a=>`AI 채팅 (${a}J)`,guides:"레이아웃 가이드 보기",guidesTitle:"레이아웃 가이드 보기 (⌃G)",appearance:a=>`화면 모드: ${Zp(a)}`,appearanceTitle:a=>`화면 모드: ${a==="system"?"시스템 설정 따르기":Zp(a)} (클릭해 바꾸기)`,minimap:"미니맵",minimapTitle:"미니맵 (M)",viewMenu:"보기",viewMenuTitle:"보기: 가이드, 미니맵, 화면 모드, 테마, 언어, 스냅샷",viewMenuTitleNarrow:"보기: 확대/축소, 기록, 가이드, 미니맵, 화면 모드, 언어, 스냅샷",language:a=>`언어: ${a}`,project:"프로젝트",history:"기록"},tabs:{left:"왼쪽 패널",boards:"보드",assets:"에셋",tokens:"토큰",right:"오른쪽 패널",closePanel:"패널 닫기",properties:"속성",ai:"AI"},boardList:{aria:"페이지와 보드",pages:"페이지",addPage:"페이지 추가",singlePage:"모든 보드를 한 페이지로 보고 있어요. +를 눌러 페이지를 나눠요.",pageTabTitle:"끌어서 순서 바꾸기 · 오른쪽 클릭으로 이름 바꾸기나 삭제",boardsHead:"보드",searchPlaceholder:"보드 찾기 (⌘K)",search:"보드 찾기",noMatch:a=>`"${a}"에 맞는 보드가 없어요. 파일 이름의 일부로 찾아 보세요.`,emptyPage:"이 페이지에는 아직 보드가 없어요. B를 누르고 캔버스에서 끌어 그려요.",fileMissing:"파일 없음",otherGroup:"기타",mainPage:"기본",groupTitle:a=>`보드 ${a}개 · 클릭해 접고 펼치기 · 더블클릭해 이름 바꾸기`,groupMenu:"그룹 메뉴"},minimap:{aria:"미니맵: 클릭한 곳으로 이동"},sections:{board:"보드",comments:"댓글",guides:"레이아웃 가이드",tweaks:"조정 값",tokenCheck:"토큰 검사",a11y:"접근성",checks:"검사",properties:"속성",layers:"레이어"},boardOptions:{aria:"보드 옵션",positionAndSize:"위치와 크기",position:"위치",size:"크기",options:"옵션",renameTitle:"이름 바꾸기 (F2)",renameFileTitle:"파일 이름 바꾸기",width:"너비",height:"높이",radius:"모서리",interactive:"재생 버튼 표시",interactiveTitle:"보드 라벨의 ▶를 점과 함께 늘 보여 줘요. 끄면 보드를 선택하거나 마우스를 올렸을 때만 ▶가 보여요. 어떤 보드든 P나 오른쪽 클릭으로 재생할 수 있어요",frameless:"프레임 없음",fill:"창에 맞춰 늘이기",launch:"시작 화면으로 열기",page:"페이지",focus:"포커스 보기",focusTitle:"포커스 보기 (F)",front:"맨 앞으로 가져오기",frontTitle:"맨 앞으로 가져오기 (⌘])",back:"맨 뒤로 보내기",backTitle:"맨 뒤로 보내기 (⌘[)",duplicate:"복제",duplicateTitle:"복제 (⌘D)",delete:"삭제",deleteTitle:"삭제 (Delete)",selectedN:a=>`보드 ${a}개 선택됨`,frontTitleMod:a=>`맨 앞으로 가져오기 (${a}])`,backTitleMod:a=>`맨 뒤로 보내기 (${a}[)`,goToSelected:"선택한 보드로 이동",goToSelectedTitle:"선택한 보드로 이동 (⇧2)",deleteTitleKey:"삭제 (⌫)"},focus:{aria:a=>`${a} 포커스 보기`,prev:"이전 보드",next:"다음 보드",pageStyle:" · 페이지형",close:"닫기"},play:{back:"뒤로",forward:"앞으로",viewOnCanvas:"캔버스에서 보기",closeTitle:"닫기 (Esc)",close:"닫기"},share:{button:"공유",buttonTitle:"보기 전용 사본 공유 (웹 폴더, 파일 하나, PDF, PNG)",title:"보기 전용 사본 공유",scope:"내보낼 범위",whole:"캔버스 전체",page:"이 페이지",pageNone:"이 캔버스는 페이지가 하나예요",selected:a=>`선택한 보드 (${a})`,webTitle:"웹 폴더",webHint:"정적 파일이에요. Vercel, GitHub Pages, PR 미리보기에 올려요.",singleTitle:"파일 하나",singleHint:a=>` · ${a} · 호스팅 없이 어느 브라우저에서나 열려요`,singleSwitch:".html 파일 하나로",measuring:"크기 재는 중…",pdfTitle:"PDF",pdfHint:"한 페이지에 보드 하나",pngTitle:"PNG",pngHint:"보드마다 이미지 하나, 2배",export:"내보내기",save:"저장",working:"내보내는 중…",exported:"내보냄",saved:"저장함",reveal:"폴더 보기",revealTitle:"파일 관리자에서 폴더를 보여 줘요",copyDeploy:"배포 명령 복사",copyDeployTitle:a=>`${Et(a,"을/를")} 복사해요 (프로젝트 폴더에서 실행해요)`,copied:a=>`복사함: ${a}`,copyFailed:"클립보드에 복사하지 못했어요",attachHint:"Slack, 이메일, PR에 첨부해요.",skipped:a=>`참조 ${a}개는 넣지 못했어요`,largeFiles:"캔버스가 크면 파일도 커져요. 실시간으로 바뀌지 않아요.",sameAs:"같은 명령:",unavailable:"여기서는 쓸 수 없어요."},viewer:{docTitle:a=>`${a} — 보기 전용`,noData:"Easel에서 내보낸 페이지지만 데이터가 없어요 (easel-viewer/data.js).",bar:"뷰어",pages:"페이지",play:"재생",playTitle:"선택한 보드(없으면 첫 보드)를 전체 화면으로 재생해요",stamp:a=>`보기 전용 · ${a}에 내보냄`,stampTitle:"읽기 전용 사본이에요. 디자인 파일을 고친 뒤 다시 내보내요.",madeWith:"Easel로 만듦",comments:"댓글",commentsN:a=>`댓글 ${a}`,noComments:"댓글 없음",replies:a=>`답글 ${a}개`,pin:(a,i)=>`${i}의 댓글 ${a}`,threadOf:(a,i)=>`${a}/${i}`,closeThread:"댓글 닫기",boardsPanel:"보드",commentsPanel:"댓글 패널",empty:"이 페이지에는 아무것도 없어요",embedGate:"캔버스를 직접 써 볼 수 있어요. 화면 이동, 확대/축소, 보드 열기, 재생. Esc를 누르면 페이지로 돌아가요.",embedHint:"클릭하면 캔버스를 움직이고 확대/축소할 수 있어요",embedHintLive:"Esc를 누르거나 바깥을 클릭하면 페이지로 돌아가요"},canvas:{aria:"디자인 캔버스",board:(a,i,r,f)=>`보드 ${a}${i?" (선택됨)":""}${r?" 편집 중":""}${f?" 재생 중":""}`,interactive:"재생할 수 있는 보드",hint:"클릭해 선택 · 더블클릭해 텍스트 고치기 · Esc로 선택 해제",notLoaded:"가까이 가면 불러와요",fileMissing:a=>`파일 없음 · ${a}`,playing:"▶ 재생 중 · Esc",exportingPng:"PNG 내보내는 중…",play:"재생",playTitle:"재생 (P)",stopPlay:"재생 중지",stopPlayTitle:"재생 중지 (P 또는 Esc)",boardSize:"보드 크기",titleMaxWidth:"최대 너비",stickySize:"스티키 노트 크기",deleteNote:"메모 삭제"},editMode:{fileChanged:"다른 사람이 먼저 이 파일을 바꿨어요. 요소를 다시 선택해 주세요."},elementDrag:{moveAria:"요소 옮기기 (Alt: 가리킨 상자 안으로)",moveTitle:"끌어서 옮기기 · Alt를 누르고 있으면 가리킨 상자 안에 넣어요",width:"너비",height:"높이",size:"크기"},layers:{collapse:"접기",expand:"펼치기",title:"레이어",hint:"항목을 다른 항목 위에 놓으면 그 앞으로 옮겨요. Shift+클릭으로 여러 개를 골라 감쌀 수 있어요. 목록을 클릭한 뒤 ↑↓로 옮기고 ←→로 접고 펼쳐요."},select:{toolbar:"요소",text:"텍스트",textOff:"이 요소에는 텍스트가 없어요",fill:"채우기",radius:"모서리",spacing:"간격",askAi:"AI에게 묻기",askAiTitle:"이 요소에 대해 AI에게 물어요",comment:"댓글",commentTitle:"이 요소에 댓글 달기",tokens:"토큰",custom:"직접 입력…",hex:"Hex 색",picker:"색 고르기",tokenNow:a=>`${a} · 토큰`,decrease:a=>`${a} 줄이기`,increase:a=>`${a} 늘리기`},design:{fill:"채우기",text:"텍스트",font:"글꼴",size:"크기",weight:"굵기",color:"색",cornerRadius:"모서리 반경",padding:"패딩",gap:"간격",more:"더 보기 (CSS)",none:"없음",inherited:a=>`(${a})`,weights:{100:"Thin",200:"Extra light",300:"Light",400:"Regular",500:"Medium",600:"Semibold",700:"Bold",800:"Extra bold",900:"Black"},white:"흰색",black:"검은색",grade:a=>a>=7?"AAA":a>=4.5?"AA":a>=3?"AA 큰 글자만":"너무 낮음",contrastWith:(a,i,r)=>`${i} 글자와 명도 대비 ${a}:1 · ${r}`,contrastOn:(a,i,r)=>`${i} 위 명도 대비 ${a}:1 · ${r}`,openFill:a=>`${a}: 바꾸기`},properties:{tokenColors:{text:"텍스트",secondaryText:"보조 텍스트",background:"배경",surface:"표면",divider:"구분선",accent:"강조",error:"오류"},fields:{width:"너비",height:"높이",fontSize:"글자 크기",fontWeight:"굵기",color:"색",background:"배경",radius:"모서리",flexDirection:"Flex 방향",alignItems:"항목 정렬",justifyContent:"콘텐츠 배치",flexWrap:"줄바꿈",flexGrow:"늘이기",alignSelf:"자기 정렬",lineHeight:"줄 높이",textAlign:"텍스트 정렬",border:"테두리",boxShadow:"그림자",opacity:"불투명도"},alignButtons:{left:"왼쪽 정렬",hcenter:"가운데 정렬",right:"오른쪽 정렬",top:"위쪽 정렬",vcenter:"세로 가운데 정렬",bottom:"아래쪽 정렬"},columns:"열",rows:"행",align:"정렬",layout:"레이아웃",wrap:"감싸기",image:"이미지",replaceImage:"이미지 바꾸기…",wrapTitle:"같은 부모 아래 이어진 형제 요소를 먼저 선택해요",wrapFlex:"Flex로 감싸기",wrapGrid:"Grid로 감싸기",duplicate:"복제",delete:"삭제",offToken:a=>`토큰 밖: ${a}`,none:"없음",contrastTitle:"배경과의 명도 대비 (본문 4.5 이상, 큰 글자 3 이상)",contrast:"명도 대비",largeTextOnly:"큰 글자만",tooLow:"너무 낮음"},shapes:{selectedN:a=>`도형 ${a}개 선택됨`,deleteAll:"선택한 도형 삭제",stickyColors:{yellow:"노랑",orange:"주황",pink:"분홍",purple:"보라",blue:"파랑",green:"초록",gray:"회색",white:"흰색"},shapeSize:"도형 크기",drawShape:"도형 그리기",kinds:{rect:"사각형",oval:"타원",line:"선",arrow:"화살표",pen:"펜",image:"이미지"},none:"없음",options:"도형 옵션",strokeColor:"선 색",fill:"채우기",weight:"굵기",strokeWeight:"선 굵기",front:"맨 앞으로 가져오기",back:"맨 뒤로 보내기",deleteShape:"도형 삭제",deleteTitle:"삭제 (⌫)"},notes:{selectedN:a=>`메모 ${a}개 선택됨`,deleteAll:"선택한 메모 삭제",options:"메모 옵션",title:"제목",sticky:"스티키 노트",fontSize:"글자 크기",defaultSuffix:" (기본)",textStyle:"텍스트 스타일",bold:"굵게",italic:"기울임",color:"색",stickyColor:a=>`${a} 스티키 노트`,maxWidth:"최대 너비",maxHeight:"최대 높이",width:"너비",height:"높이",titleHint:"최대 너비나 높이를 넘으면 글자가 작아져요 (0은 제한 없음).",stickyHint:"높이를 정하면 넘치는 글은 스크롤돼요 (0은 내용에 맞춤).",deleteNote:"메모 삭제",deleteTitle:"삭제 (⌫)"},guides:{aria:"레이아웃 가이드",heading:(a,i)=>`레이아웃 가이드 ${a}/${i}`,types:{columns:"열",rows:"행",grid:"그리드"},add:{columns:"열 가이드 추가",rows:"행 가이드 추가",grid:"그리드 가이드 추가"},empty:"열, 행, 그리드 가이드를 6개까지 넣을 수 있어요. 캔버스에만 보이고 화면 HTML에는 들어가지 않아요. 모두 숨기기: ⌃G",color:"가이드 색",show:"보이기",hide:"숨기기",deleteGuide:"가이드 삭제",delete:"삭제",cell:"칸",count:"개수",gutter:"거터",margin:"여백",cellSize:"칸 크기",align:"정렬",alignAria:"가이드 정렬",stretch:"늘이기",left:"왼쪽",top:"위",center:"가운데",right:"오른쪽",bottom:"아래"},dialog:{renameGroupTitle:"그룹 이름 바꾸기",menu:"메뉴",cancel:"취소",ok:"확인",deleteBoardsTitle:(a,i)=>a>1?`보드 ${a}개를 삭제할까요?`:`"${i}" 보드를 삭제할까요?`,deleteBoardsBody:"HTML 파일도 함께 지워져요. 사본은 휴지통(docs/design/.trash)에 남고, 실행 취소(⌘Z)로 바로 되돌릴 수 있어요.",delete:"삭제",renameBoardTitle:"보드 이름 바꾸기",name:"이름",rename:"이름 바꾸기",renameFileTitle:"파일 이름 바꾸기",fileName:"파일 이름",renameFileRefs:a=>`이 파일을 가리키는 링크나 iframe: ${a}`,renameFileNoRefs:"이 파일을 가리키는 링크나 iframe이 없어요.",renameFileExtra:a=>`참조 ${a}개도 새 이름으로 바꾸기`,newPageTitle:"새 페이지",newPageName:a=>`페이지 ${a}`,create:"만들기",renamePageTitle:"페이지 이름 바꾸기",deletePageTitle:a=>`"${a}" 페이지를 삭제할까요?`,deletePageBody:a=>`보드 ${a}개와 메모는 지워지지 않고 첫 페이지로 옮겨져요. ⌘Z로 되돌릴 수 있어요.`,authorTitle:"댓글 작성자",save:"저장",snapshotTitle:"스냅샷 저장",snapshotLabel:"메시지",snapshotMessage:a=>`docs(design): design snapshot ${a}`,snapshotHint:"디자인 폴더만 커밋해요. 작성자는 git 설정을 따르고, 따로 스테이징한 다른 파일은 들어가지 않아요.",commit:"커밋"},toast:{saveFailed:a=>`저장하지 못했어요: ${a}`,undoRedoDone:(a,i)=>`${a==="undo"?"실행 취소":"다시 실행"}: ${i}`,nothingToUndo:"되돌릴 작업이 없어요",nothingToRedo:"다시 실행할 작업이 없어요",undoAction:"실행 취소",textOnly:"텍스트(와 줄바꿈)만 든 요소만 그 자리에서 고칠 수 있어요",moved:"옮겼어요",movedFrozen:"옮겼어요 (원래 자리의 크기를 유지했어요)",copiedElement:(a,i)=>`${Et(`<${a}>`,"을/를")} 복사했어요. 다른 보드를 편집하면서 ${i}V로 붙여 넣어요`,nothingCopied:"복사한 요소가 없어요. 편집 중에 요소를 선택하고 ⌘C를 눌러요",pasted:(a,i)=>`${a}에서 ${Et(`<${i}>`,"을/를")} 붙여 넣었어요`,imageReplaced:a=>`이미지를 ${Et(a,"으로/로")} 바꿨어요`,boardCreated:a=>`${a} 보드를 만들었어요`,boardCreateFailed:a=>`보드를 만들지 못했어요: ${a}`,boardsDeleted:a=>`보드 ${a}개를 삭제했어요`,duplicated:a=>`${Et(a,"으로/로")} 복제했어요`,renamed:"이름을 바꿨어요",fileRenamed:(a,i)=>`${Et(a,"으로/로")} 이름을 바꿨어요${i?" (참조도 바꿨어요)":""}`,notesMax:a=>`메모는 ${a}개까지 둘 수 있어요`,noteDeleted:"메모를 삭제했어요",shapeDeleted:"도형을 삭제했어요",shapesDeleted:a=>`도형 ${a}개를 삭제했어요`,imageReadFailed:"이미지를 읽지 못했어요",importOnly:a=>`${a}: HTML이나 이미지만 가져올 수 있어요`,imported:a=>`보드 ${a}개를 가져왔어요`,pagesMax:"페이지는 40개까지 만들 수 있어요",pageDeleted:"페이지를 삭제했어요",copied:"복사했어요",elementDeleted:"요소를 삭제했어요",wrapped:a=>`${Et(a,"으로/로")} 감쌌어요`,theme:a=>`테마: ${a}`,tokensSaved:"토큰을 저장했어요",nothingChanged:"바뀐 것이 없어요",snapshot:a=>`스냅샷 ${a}`,cleanedUp:a=>`보드 ${a}개를 정리했어요`,uploaded:a=>`${Et(a,"을/를")} 올렸어요`,tweaksSaved:"조정 값을 소스에 저장했어요",blockFlow:"블록 흐름에서는 세로 정렬이 적용되지 않아요. 부모를 flex로 바꿔 보세요",pngExporting:a=>`${a} 만드는 중…`,pngExported:a=>`${Et(a,"을/를")} 내려받았어요`,pngNeedsBrowser:"PNG로 내보내려면 헤드리스 브라우저가 필요해요:",pngFailed:a=>`PNG를 만들지 못했어요: ${a}`},history:{renameGroup:"그룹 이름 바꾸기",pageFromGroup:"그룹으로 페이지 만들기",boardOptions:"보드 옵션",front:"맨 앞으로 가져오기",back:"맨 뒤로 보내기",moveBoard:"보드 옮기기",resizeBoard:"보드 크기 바꾸기",addTitle:"제목 추가",addNote:"메모 추가",deleteNote:"메모 삭제",duplicateNote:"메모 복제",moveNote:"메모 옮기기",editNote:"메모 고치기",noteStyle:"메모 스타일",addShape:"도형 추가",deleteShape:"도형 삭제",moveShape:"도형 옮기기",resizeShape:"도형 크기 바꾸기",shapeStyle:"도형 스타일",shapeFront:"도형 맨 앞으로",shapeBack:"도형 맨 뒤로",addImage:"이미지 추가",launchPage:"시작 페이지",moveToPage:"페이지로 옮기기",launchScreen:"시작 화면 정하기",changeTheme:"테마 바꾸기",cleanMissing:"파일 없는 보드 정리",editGuide:"레이아웃 가이드 고치기",addGuide:"레이아웃 가이드 추가",deleteGuide:"레이아웃 가이드 삭제",saveTokens:"토큰 저장",registerTokens:"토큰 등록"},defaults:{newTitle:"새 제목",note:"메모",pastedImage:"pasted-image.png"},menu:{newBoard:"새 보드",renameGroup:"그룹 이름 바꾸기…",pageFromGroup:"이 그룹으로 페이지 만들기",drawWithB:"B로 그리기",rename:"이름 바꾸기",moveUp:"위로 옮기기",moveDown:"아래로 옮기기",unsetLaunchPage:"시작 페이지 해제",setLaunchPage:"시작 페이지로 정하기",moveSelectedToPage:a=>`선택한 보드 ${a}개를 이 페이지로 옮기기`,delete:"삭제",selectInside:"안쪽 선택",playInPlace:"제자리에서 재생",stopPlay:"재생 중지",playFullScreen:"전체 화면으로 재생",askReview:"AI에게 리뷰 요청",focusView:"포커스 보기",askAI:"AI에게 묻기",askFixErrors:"AI에게 오류 수정 요청",goToBoard:"보드로 이동",exportPng:"PNG로 내보내기",exportingPng:"PNG 내보내는 중…",renameFile:"파일 이름 바꾸기…",duplicate:"복제",front:"맨 앞으로 가져오기",back:"맨 뒤로 보내기",deleteBoards:a=>`보드 ${a}개 삭제`,title:"제목",note:"메모",duplicateInFront:"앞에 복제",newBoardHere:"여기에 새 보드",mobileFrameHere:"여기에 모바일 화면 프레임",titleHere:"여기에 제목",noteHere:"여기에 메모",selectAll:"이 페이지 모두 선택",fitAll:"전체 보기",zoom100:"100%로 보기",undo:"실행 취소",redo:"다시 실행",element:"요소",editText:"텍스트 고치기",selectParent:"부모 선택",elementToAI:"이 요소를 AI에게 보내기",copy:"복사",pasteAfter:"뒤에 붙여 넣기",replaceImage:"이미지 바꾸기…",copyForAI:"AI용 설명 복사",shape:"도형",snapshot:"스냅샷",notGit:"디자인 폴더가 git 저장소 안에 있지 않아요",snapshotStatus:(a,i)=>`스냅샷 · ${a} · 바뀐 파일 ${i}개`,snapshotNow:"지금 스냅샷 저장 (git 커밋)…",nothingChanged:"바뀐 것 없음",fileMissing:"파일이 없어요",askFixAll:"AI에게 모두 수정 요청",cleanMissing:a=>`파일 없는 보드 ${a}개 정리`},prompts:{fixErrors:a=>`이 오류들을 고쳐 줘:
53
+ ${a}`,error:"오류",review:"이 화면을 리뷰해 줘: 접근성(48px 터치 영역, 명도 대비 4.5, 라벨), 정보 위계, 토큰 위반(get_tokens, check_tokens)을 짚고 우선순위대로 고칠 방법을 알려 줘. 아무것도 고치지 말고 제안만 해 줘.",fixComment:"이 댓글이 말하는 대로 그 부분만 고쳐 줘",fixTokens:a=>`토큰 밖의 값을 토큰으로 바꿔 줘 (check_tokens로 확인해 줘):
54
+ ${a}`,fixA11y:a=>`접근성 문제를 고쳐 줘 (보이는 크기는 그대로 두고 터치 영역은 패딩으로 넓혀 줘):
55
+ ${a}`,line:"줄 "},checks:{tokenCheck:a=>`토큰 검사 · ${a}`,noOffToken:"토큰 밖의 값이 없어요",off:"꺼짐",tokensOffTitle:"등록된 토큰이 없어 검사가 꺼져 있어요",tokensOffBody:"색과 크기를 검사하지 않고, AI에게 기본 팔레트도 주지 않아요.",setUpTokens:"토큰 설정",a11y:"접근성",a11yOk:"터치 영역, 명도 대비, 라벨 문제가 없어요",askFix:"AI에게 수정 요청",notVisible:"보드가 화면에 보일 때 검사해요.",pickInEdit:a=>`보드에서 ${a} 선택`,line:a=>`${a}번째 줄`,more:a=>`외 ${a}개`,colorNotInTokens:"토큰에 없는 색",tokenFontSizes:a=>`토큰 글자 크기: ${a}`,tokenRadii:a=>`토큰 모서리: ${a}`,notMultipleOf4:"4의 배수가 아님",tokenWeights:a=>`토큰 굵기: ${a}`,smallTarget:(a,i,r,f)=>`<${a}> 터치 영역 ${i}×${r} (${f} 미만)`,noName:a=>`<${a}>에 이름이 없어요 (aria-label, 텍스트, label)`,noAlt:'<img>에 alt가 없어요 (장식용이면 alt="")',lowContrast:(a,i,r)=>`명도 대비 ${a}:1 (${i} 필요) "${r}"`},tokens:{import:"토큰 가져오기 (tokens.json 또는 Figma 변수 JSON)",importFailed:a=>`가져오지 못했어요: ${a}`,theme:"테마",addTheme:"테마 추가 (지금 테마 복사)",newTheme:"새 테마",newThemeN:a=>`새 테마 ${a}`,activeTheme:"사용 중인 테마",themeName:"테마 이름",importedTheme:"가져온 테마",colors:a=>`색 ${a}`,addColor:"색 추가",colorN:a=>`색 ${a}`,colorOf:a=>`${a} 색`,colorName:"색 이름",remove:a=>`${a} 삭제`,fontSizes:"글자 크기",fontWeights:"글자 굵기",radii:"모서리",spacing:"간격",touchTarget:"터치 영역",minTouchTarget:"최소 터치 영역",saveTitle:"docs/design/tokens.json에 저장",save:"저장",register:"토큰 등록",registeredHint:"속성 패널의 색 견본, 토큰 검사, AI(get_tokens)가 선택한 테마의 값을 써요.",defaultHint:"아직 쓰이지 않는 시작 값이에요. 등록하면 tokens.json에 저장되고 토큰 검사와 AI 팔레트가 켜져요.",noColors:"색 값을 찾지 못했어요"},tweaks:{revert:"되돌리기",save:"소스에 저장",hint:"CSS 변수로 바로 적용돼요. 저장하면 board-tweaks JSON의 값만 바뀌어요."},inspector:{shotFailed:a=>`실패: ${a}`,kindName:a=>({text:"텍스트",button:"버튼",link:"링크",image:"이미지",input:"입력란",icon:"아이콘",container:"컨테이너"})[a]??a,crumbs:"선택 경로",crumbBoard:"보드 선택",crumbParent:a=>`${a} 선택`,crumbElement:(a,i)=>`<${a}> ${i}`,more:a=>`외 ${a}개`,copy:"복사",copied:"복사함",capturing:"캡처하는 중…",screenshot:"스크린샷",boardScreenshot:"보드 스크린샷",boardScreenshotTitle:"이 보드의 PNG를 디자인 폴더 옆에 저장해요",screenshotTitle:"이 요소의 PNG를 저장해요",actions:"요소 작업",boardActions:"보드 작업"},comments:{title:"댓글",placeholderElement:a=>`선택한 요소(${a})에 댓글 달기`,placeholderBoard:"보드에 댓글 달기",add:"댓글",authorTitle:"댓글 작성자 이름 바꾸기",author:a=>`작성자: ${a}`,replyPlaceholder:a=>`${Et(a,"으로/로")} 답글 달기 (⌘Enter)`,reply:"답글",replyResolve:"답글 달고 해결",reopen:"다시 열기",resolve:"해결",sendToAI:"AI에게 보내기",sendToAITitle:"이 댓글이 가리키는 곳만 고치도록 AI에게 보내요"},assets:{uploading:"올리는 중…",upload:"올리기 (이미지와 글꼴, 끌어다 놓아도 돼요)",loading:"불러오는 중…",empty:"아직 에셋이 없어요. 올린 이미지는 docs/design/assets/에 저장되고 화면에서는 ../assets/이름 으로 써요.",copyPath:" · 클릭해 경로 복사",file:"파일",pickImage:"이미지 고르기",pickLabel:", 이 이미지 쓰기",close:"닫기"},chat:{aria:"AI 채팅",agent:"에이전트",agentHint:"파일을 고칠 에이전트",agentButton:(a,i)=>i?`에이전트: ${a} — ${i}`:`에이전트: ${a}`,agentStatus:{ready:"준비됨",signin:"로그인 필요",missing:"설치 안 됨",unknown:"확인하지 못함"},checking:"확인하는 중…",checkedOnOpen:"AI 탭을 열 때 확인함",checkAgain:"다시 확인",model:"모델",modelDefault:"기본값 (CLI 설정)",modelTitle:a=>`${a}의 모델: 별칭이나 전체 모델 ID. 비워 두면 CLI 기본값을 써요.`,continuing:"대화 이어 가는 중",newConversation:"새 대화",newChat:"새 채팅",intro:a=>`선택한 보드와 요소, 화면에 보이는 보드를 맥락으로 ${a}에게 보내요. 에이전트가 소스 HTML을 바로 고치고, 캔버스는 곧바로 다시 그려져요.`,suggestions:[{label:"AI 리뷰: 접근성, 명도 대비, 위계",text:"선택한 화면을 리뷰해 줘: 접근성(48px 터치 영역, 명도 대비 4.5, 라벨), 정보 위계, 토큰 위반(get_tokens, check_tokens). 아무것도 고치지 말고 우선순위대로 제안만 해 줘.",n:1},{label:"이 화면의 시안 3개",text:"선택한 화면을 서로 다른 방향으로 시안 3개 만들어 줘 (레이아웃, 위계, 강조점을 각각 다르게).",n:3},{label:"선택한 버튼 문구 줄이기",text:"선택한 버튼 문구를 줄여 줘",n:1},{label:"새 빈 상태 화면 만들기",text:"새 빈 상태 화면을 만들어 줘",n:1}],remedySignin:(a,i)=>`${a}에 로그인되어 있지 않아요. 터미널에서 \`${i}\` 명령을 실행해요.`,remedyMissing:a=>`\`${a}\` 명령을 찾지 못했어요. 설치한 뒤 다시 확인해요.`,copyCommand:"명령 복사",copy:"복사",copied:"복사함",sendNeedsSignin:a=>`보내려면 ${a}에 로그인해요`,sendNeedsInstall:a=>`보내려면 ${Et(a,"을/를")} 설치해요`,running:"실행 중",cancelled:"취소됨",failed:"실패",retry:"다시 시도",switchTo:a=>`${Et(a,"으로/로")} 바꾸기`,details:"자세히",noFilesChanged:"바뀐 파일이 없어요.",restored:"실패한 메시지에서 되살렸어요",madeVariants:a=>`시안 ${a}개를 나란히 만들었어요 · 보기`,thinking:"생각하는 중…",chipElement:a=>`요소 <${a}>`,chipElementText:(a,i)=>`요소 <${a}> ${i}`,chipBoards:a=>`보드 ${a}개`,chipVisible:a=>`보이는 보드 ${a}`,chipComment:a=>`댓글 "${a}"`,variants:a=>`시안 ${a}개`,tooBig:a=>`${a}: 15MB보다 커요`,refLink:"참고 링크",placeholderRunning:"실행 중… (Esc로 취소)",placeholder:"무엇을 바꿀까요? (Enter로 보내기 · Shift+Enter로 줄바꿈)",input:"AI에게 보낼 메시지",attach:"파일이나 이미지 첨부",attachTitle:"파일이나 이미지 첨부 (끌어다 놓거나 붙여 넣어도 돼요)",addLink:"참고 링크 추가",variantsTitle:"선택한 보드를 복사해 서로 다른 시안을 나란히 만들어요",variantsDisabledTitle:"보드를 하나 선택하면 쓸 수 있어요",variantsAria:"시안 개수",cancel:"취소",cancelTitle:"취소 (Esc)",send:"보내기",chipRemoveTitle:"클릭해 빼기",chipAddTitle:"클릭해 첨부",remove:a=>`${a} 빼기`,howToInstall:"설치 방법",customCommand:"직접 지정한 명령…",checkedAt:(a,i)=>i?`AI 탭을 열 때 확인함 · ${a}`:`${a}에 다시 확인함`,customTitle:"직접 지정한 명령",customName:"이름",customCommandLabel:"명령",customNamePlaceholder:"Aider",customCommandPlaceholder:"aider --message {prompt} --yes",customHint:"`{prompt}`는 요청과 캔버스 맥락으로 바뀌어요. 출력은 일반 텍스트로 보여요.",customSave:"저장",customCommandTitle:a=>`셸 없이 실행해요: ${a}`,waiting:"응답 기다리는 중",waitingHint:"위의 요청에 답해 주세요",permAsk:(a,i,r)=>i==="command"?`${Et(a,"이/가")} 명령 실행을 요청해요`:i==="edit"?`${Et(a,"이/가")} 파일 ${r==="Write"?"쓰기를":"수정을"} 요청해요`:i==="fetch"?`${Et(a,"이/가")} 페이지 가져오기를 요청해요`:`${Et(a,"이/가")} ${r} 사용을 요청해요`,permIn:"위치",permOutside:"디자인 폴더 밖",allowOnce:"한 번 허용",alwaysAllow:a=>`${a} 항상 허용`,alwaysAllowTitle:"Easel을 다시 시작할 때까지, 이 캔버스에서만",deny:"거부",permDone:{once:"허용함",always:"항상 허용함",deny:"거부함"},permDoneOutside:"(디자인 폴더 밖)",noPause:{codex:"Codex exec는 멈추고 물어볼 수 없어서 샌드박스 설정을 따라요.",cursor:"Cursor Agent는 여기서 멈추고 물어볼 수 없어서 --force로 실행돼요.",gemini:"Gemini CLI는 여기서 멈추고 물어볼 수 없어서 수정을 스스로 받아들여요."},runChanged:(a,i)=>a&&i?`보드 ${a}개 바꿈 · ${i}개 추가`:i?`보드 ${i}개 추가`:a?`보드 ${a}개 바꿈`:"캔버스를 바꿈",chipNew:a=>`${a} (새로 만듦)`,chipRemoved:a=>`${a} (삭제됨)`,undoRun:"이 실행 취소",compare:"비교",redo:"다시 실행",runUndone:a=>`실행을 취소했어요 · 보드 ${a}개를 되돌렸어요`,conflictUndo:a=>`이 실행 뒤에 바뀐 보드: ${a}. 나머지만 취소하고 이 보드는 그대로 둘까요, 모두 취소하고 덮어쓸까요?`,conflictRedo:a=>`취소한 뒤에 바뀐 보드: ${a}. 나머지만 다시 실행하고 이 보드는 그대로 둘까요, 모두 다시 실행하고 덮어쓸까요?`,undoRest:"나머지만 취소",undoAll:"그래도 모두 취소",redoRest:"나머지만 다시 실행",redoAll:"그래도 모두 다시 실행",restoreCopy:"이 실행 전 사본으로 되돌리기",savedAt:a=>`${a}에 저장함`,copyGone:"이 실행 전 사본이 없어요 (최근 10개만 보관해요).",restoredCopy:"캔버스를 이 실행 전 사본으로 되돌렸어요",restoreTitle:"이 실행 전 사본으로 되돌릴까요?",restoreBody:a=>`캔버스 전체를 이 실행 전인 ${a} 상태로 되돌려요. 모든 화면과 board.json이 바뀌고, 그 뒤에 내가 바꾸거나 다른 실행이 바꾼 것도 포함돼요. 실행 취소로 되돌리기를 취소할 수 있어요.`,restoreOk:"되돌리기",restarted:a=>`Easel 다시 시작됨 · ${a}`},compare:{title:a=>`비교 · ${a}`,boards:"보드",before:"전",after:"후",notBefore:"실행 전에는 없던 보드예요.",notAfter:"이 실행이 보드를 삭제했어요.",notBeforeChange:"이 변경 전에는 없던 보드예요.",close:"닫기"},activity:{outside:"Easel 밖",ago:a=>{const i=Math.floor(Math.max(0,a)/6e4);return i<1?"방금":i<60?`${i}분`:i<1440?`${Math.floor(i/60)}시간`:`${Math.floor(i/1440)}일`},agoLong:a=>{const i=Math.floor(Math.max(0,a)/6e4);return i<1?"방금":i<60?`${i}분 전`:i<1440?`${Math.floor(i/60)}시간 전`:`${Math.floor(i/1440)}일 전`},tag:(a,i,r,f)=>`${a} · ${i} · ${f&&r===1?"새 보드":`변경 ${r}개`}`,tagTitle:a=>`${a} — 클릭해 변경 내용, 전/후, 실행 취소 보기`,tagsAria:a=>`다른 사람의 변경 ${a}개`,popAria:a=>`${a}의 변경`,element:Kp,change:a=>{const i=Kp(a.tag,a.cls);switch(a.kind){case"style":return`${i} 스타일 바뀜`;case"attr":return`${i} 속성 바뀜`;case"edited":return`${i} 바뀜`;case"added":return a.count>1?`요소 ${a.count}개 추가됨`:`${i} 추가됨`;case"removed":return a.count>1?`요소 ${a.count}개 삭제됨`:`${i} 삭제됨`;case"replaced":return`${i} 교체됨`;case"many":return`요소 ${a.count}${a.more?"+":""}개 바뀜`;case"page":return"페이지 스타일이나 제목 바뀜";case"source":return"소스의 공백이나 주석만 바뀜";case"new":return"새 보드";case"deleted":return"보드 삭제됨";case"moved":return"보드 옮겨짐";case"resized":return"보드 크기 바뀜";case"renamed":return"보드 이름 바뀜";case"options":return"보드 옵션 바뀜";default:return"바뀜"}},changes:a=>`이 보드의 변경 ${a}개`,quote:a=>`“${a}”`,arrow:"→",beforeAfter:"전 / 후",undo:"실행 취소",undoTitle:a=>a===1?"이 변경 실행 취소":`이 변경 ${a}개 실행 취소`,conflict:a=>`그 뒤에 바뀐 보드: ${a}. 나머지만 취소하고 이 보드는 그대로 둘까요, 모두 취소하고 덮어쓸까요?`,undoRest:"나머지만 취소",undoAll:"그래도 모두 취소",cancel:"취소",close:"닫기",historyButton:"기록",historyTitle:"기록 · 최신순",historyEmpty:"아직 없어요. 이 세션에서 바꾼 것이 여기에 보여요.",historyFoot:"기록은 이 세션 동안 보관돼요.",now:"지금",goBack:"여기로 돌아가기",goBackAria:(a,i,r)=>`${i}, ${r}: ${a} · 여기로 돌아가기`,nowAria:(a,i,r)=>`${i}, ${r}: ${a} · 지금`,undoneAria:(a,i,r)=>`${i}, ${r}: ${a} · 취소됨`,wentBack:a=>`되돌아감: ${a}`},occupancy:{editing:a=>`${a} 편집 중…`,you:"나 · 편집 중",personEditing:a=>`${a} · 편집 중`,done:(a,i)=>`${a} · ${i} 완료`,someone:"누군가",clock:a=>new Date(a).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),tagsAria:"이 보드에 있는 사람",listDot:a=>`${a} 편집 중`,youListDot:"내가 편집 중",forked:(a,i,r)=>`${a}에 포크됨 — ${Et(r,"이/가")} 편집하는 동안 ${Et(i,"이/가")} 시작함`,forkBlock:(a,i)=>a===1?`${i}의 포크`:`${i}의 포크 ${a}개`,forkBlockWhile:(a,i,r)=>`${a===1?`${i}의 포크`:`${i}의 포크 ${a}개`} · ${Et(r,"이/가")} 편집하는 동안 만듦`,forkBlockShort:a=>a===1?"포크":`포크 ${a}개`,useThis:"이걸로 쓰기",useThisOne:"이 버전으로 쓰기",useThisTitle:"이 시안을 원래 보드로 만들고 나머지 시안은 휴지통으로 보내요",useThisOneTitle:a=>`이 버전을 보드로 남기고 다른 버전 ${a}개는 휴지통으로 보내요`,waitFor:a=>`${Et(a,"이/가")} 편집을 마칠 때까지 기다려요`,confirmVariant:(a,i)=>`${Et(`"${a}"`,"을/를")} ${i}에 적용할까요?`,confirmVariantBody:(a,i)=>`${Et(a,"이/가")} 바뀌어요.${i?` 다른 시안 ${i}개는 휴지통으로 가요.`:""}`,confirmFork:(a,i)=>`${i}에 ${Et(`"${a}"`,"을/를")} 쓸까요?`,confirmForkBody:(a,i)=>`${Et(a,"이/가")} 이 버전으로 바뀌어요. ${i?`이 포크와 다른 포크 ${i}개는 휴지통으로 가요.`:"포크는 휴지통으로 가요."}`,confirmKeep:a=>`${Et(`"${a}"`,"을/를")} 남길까요?`,confirmKeepBody:(a,i)=>`${Et(a,"은/는")} 휴지통으로 가요.`,apply:"적용",keepAll:"모두 남기기",keepBoth:"둘 다 남기기",applied:(a,i)=>`${Et(a,"을/를")} ${i}에 적용했어요`,kept:(a,i)=>`${Et(a,"을/를")} 남겼어요. 다른 버전 ${i}개는 휴지통에 있어요`,keptAll:(a,i)=>a==="variant"?`시안 ${i}개를 모두 보드로 남겼어요`:`버전 ${i+1}개를 모두 보드로 남겼어요`,undo:"실행 취소"},update:{out:a=>`Easel ${Et(a,"이/가")} 나왔어요`,copy:"명령 복사",copied:"복사했어요. 실행한 뒤 Easel을 다시 시작해요",hide:"다음 버전까지 숨기기"}},tu=[{id:"en",name:"English"},{id:"ko",name:"한국어"}],ky="design-canvas:lang";function Pb(a,i){return a==="en"||a==="ko"?a:/^ko($|[-_])/i.test(i??"")?"ko":"en"}function e0(){if(typeof window>"u")return"en";let a=null;try{a=localStorage.getItem(ky)}catch{}return Pb(a,navigator.language)}const uu=e0();function t0(a){try{localStorage.setItem(ky,a)}catch{}location.reload()}const n0={en:Fb,ko:Wb},u=n0[uu],a0=1440*60*1e3,Uf=a=>`design-canvas:seen:${a}`,mu=a=>a.by?"comment":a.person||!a.outside?"person":"file",uh=(a,i)=>a.by??a.person??(a.outside?u.activity.outside:i);function l0(a){const[i,r]=w.useState(null),[f,h]=w.useState(()=>Date.now()),[p,y]=w.useState({}),N=w.useRef(null),S=w.useCallback(()=>{N.current&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>{Ce.get(`/api/activity?client=${encodeURIComponent(hu)}`).then(r).catch(()=>{})},120)},[]);w.useEffect(()=>{S();const C=window.setInterval(()=>h(Date.now()),3e4);return()=>window.clearInterval(C)},[S]),w.useEffect(()=>{if(!(!a||!i))try{const C=JSON.parse(localStorage.getItem(Uf(a))??"{}"),O=Object.fromEntries(Object.entries(C).filter(([X])=>X.startsWith(`${i.boot}:`)));y(O),Object.keys(O).length!==Object.keys(C).length&&localStorage.setItem(Uf(a),JSON.stringify(O))}catch{}},[a,i==null?void 0:i.boot]);const T=w.useCallback(C=>{!i||!C.length||y(O=>{const X=C.filter(k=>!O[`${i.boot}:${k}`]);if(!X.length)return O;const ee={...O,...Object.fromEntries(X.map(k=>[`${i.boot}:${k}`,Date.now()]))};try{a&&localStorage.setItem(Uf(a),JSON.stringify(ee))}catch{}return ee})},[i,a]),v=w.useCallback(C=>{if(!i)return"fresh";const O=C.steps.map(X=>p[`${i.boot}:${X}`]);return O.some(X=>!X)?"fresh":f-Math.max(...O)>a0?"gone":"seen"},[i,p,f]),x=w.useCallback(C=>((i==null?void 0:i.tags[C])??[]).filter(O=>v(O)!=="gone"),[i,v]);return{data:i,now:f,reload:S,markSeen:T,stateOf:v,tagsOf:x}}function i0({file:a,act:i,me:r,onOpen:f,lead:h}){const p=i.tagsOf(a);return!p.length&&!h?null:o.jsxs("span",{className:"act-tags",role:"group","aria-label":p.length?u.activity.tagsAria(p.reduce((y,N)=>y+N.count,0)):u.occupancy.tagsAria,children:[h,p.map(y=>{const N=u.activity.tag(uh(y,r),u.activity.ago(i.now-y.at),y.count,y.newBoard);return o.jsxs("button",{className:`act-tag ${i.stateOf(y)==="seen"?"seen":""}`,"data-tag":`${a}|${y.key}`,title:u.activity.tagTitle(N),"aria-haspopup":"dialog",onPointerDown:S=>S.stopPropagation(),onDoubleClick:S=>S.stopPropagation(),onClick:S=>{S.stopPropagation(),f(a,y.key)},children:[o.jsx(ne,{name:mu(y),size:16}),o.jsx("span",{className:"act-tag-text",children:N})]},y.key)})]})}function s0({tag:a}){const i=a.change;return a.count>1?o.jsx("div",{className:"callout-diff",children:u.activity.changes(a.count)}):(i==null?void 0:i.kind)==="text"?o.jsxs("div",{className:"callout-diff",children:[o.jsx("span",{className:"diff-old",children:u.activity.quote(i.from??"")})," ",u.activity.arrow," ",o.jsx("span",{className:"diff-new",children:u.activity.quote(i.to??"")})]}):o.jsx("div",{className:"callout-diff",children:i?u.activity.change(i):u.activity.change({kind:"",count:1})})}function o0(a){const i=w.useRef(null),[r,f]=w.useState(null),h=()=>document.querySelector(`[data-tag="${CSS.escape(`${a.file}|${a.tag.key}`)}"]`);w.useLayoutEffect(()=>{var C,O;const y=h();if(!y)return void a.onClose();const N=y.getBoundingClientRect(),S=((C=i.current)==null?void 0:C.offsetWidth)??280,T=((O=i.current)==null?void 0:O.offsetHeight)??140,v=Math.max(8,Math.min(N.left,window.innerWidth-S-8)),x=N.bottom+8+T>window.innerHeight-8?Math.max(8,N.top-T-8):N.bottom+8;(!r||Math.abs(r.x-v)>.5||Math.abs(r.y-x)>.5)&&f({x:v,y:x})}),w.useEffect(()=>{var N,S;(S=(N=i.current)==null?void 0:N.querySelector("button"))==null||S.focus();const y=T=>{var x,C;const v=T.target;(x=i.current)!=null&&x.contains(v)||(C=h())!=null&&C.contains(v)||v instanceof Element&&v.closest(".dialog-backdrop")||a.onClose()};return window.addEventListener("pointerdown",y,!0),()=>window.removeEventListener("pointerdown",y,!0)},[a.file,a.tag.key]);const p=uh(a.tag,a.me);return o.jsxs("div",{ref:i,className:"callout",role:"dialog","aria-label":u.activity.popAria(p),style:{left:(r==null?void 0:r.x)??-9999,top:(r==null?void 0:r.y)??-9999},onKeyDown:y=>{var N;y.key==="Escape"&&(y.stopPropagation(),a.onClose(),(N=h())==null||N.focus())},children:[o.jsxs("div",{className:"callout-top",children:[o.jsx(ne,{name:mu(a.tag),size:16}),p," ",o.jsxs("span",{className:"muted",children:["· ",u.activity.agoLong(a.now-a.tag.at)]}),o.jsx("button",{className:"icon-btn sm callout-x","aria-label":u.activity.close,title:u.activity.close,onClick:a.onClose,children:o.jsx(ne,{name:"close",size:14})})]}),o.jsx(s0,{tag:a.tag}),o.jsxs("div",{className:"callout-actions",children:[o.jsxs("button",{onClick:a.onCompare,children:[o.jsx(ne,{name:"compare",size:14})," ",u.activity.beforeAfter]}),o.jsxs("button",{disabled:a.busy,title:u.activity.undoTitle(a.tag.steps.length),onClick:()=>a.onUndo(),children:[o.jsx(ne,{name:"undo",size:14})," ",u.activity.undo]})]}),a.conflict&&o.jsxs("div",{className:"rr-conflict",role:"alert",children:[o.jsx("p",{children:u.activity.conflict(a.conflict.join(", "))}),o.jsxs("div",{className:"btn-row",children:[o.jsx("button",{onClick:()=>a.onUndo("rest"),children:u.activity.undoRest}),o.jsx("button",{className:"danger",onClick:()=>a.onUndo("all"),children:u.activity.undoAll}),o.jsx("button",{onClick:a.onCancelConflict,children:u.activity.cancel})]})]})]})}function c0({frame:a,paths:i,zoom:r}){const[f,h]=w.useState([]),p=i.join(",");w.useEffect(()=>{if(!a)return h([]);const N=()=>{const T=a.isConnected?a.contentDocument:null;if(!(T!=null&&T.body))return h([]);h(i.map(v=>Hn(T,v)).filter(v=>!!v&&v!==T.body).map(wl))};N();const S=window.setTimeout(N,300);return a.addEventListener("load",N),a.addEventListener("dc-reloaded",N),a.addEventListener("dc-patched",N),()=>{a.removeEventListener("dc-patched",N),window.clearTimeout(S),a.removeEventListener("load",N),a.removeEventListener("dc-reloaded",N)}},[a,p]);const y=1/Math.max(r,.05);return o.jsx(o.Fragment,{children:f.map((N,S)=>o.jsx("div",{className:"box change-outline",style:{left:N.x,top:N.y,width:N.w,height:N.h,"--px":`${y}px`}},S))})}function r0(a){var T;const i=w.useRef(null),r=Math.max(0,a.steps.findIndex(v=>v.now)),[f,h]=w.useState(r),p=w.useRef([]),y=(T=a.steps[r])==null?void 0:T.id;w.useEffect(()=>{var v;(v=p.current[r])==null||v.focus(),h(r)},[y]),w.useEffect(()=>{const v=x=>{var O;const C=x.target;(O=i.current)!=null&&O.contains(C)||C instanceof Element&&C.closest(".caret-btn")||a.onClose()};return window.addEventListener("pointerdown",v,!0),()=>window.removeEventListener("pointerdown",v,!0)},[a.onClose]);const N=v=>{var C;const x=Math.max(0,Math.min(a.steps.length-1,v));h(x),(C=p.current[x])==null||C.focus()},S=w.useMemo(()=>{var O;const v=((O=document.querySelector(".oc-dock"))==null?void 0:O.getBoundingClientRect())??a.anchor,x=Math.min(448,window.innerWidth-16);if(!v)return{left:8,bottom:76,width:x};const C=Math.round(window.innerHeight-v.top+8);return{left:Math.round(Math.max(8,Math.min(v.right-x,window.innerWidth-x-8))),bottom:C,width:x,maxHeight:Math.round(window.innerHeight-C-8)}},[a.anchor]);return o.jsxs("div",{ref:i,className:"menu oc-hist entering",role:"menu","aria-label":u.activity.historyTitle,style:S,onKeyDown:v=>{var x;["Escape","ArrowDown","ArrowUp","Home","End","Enter"," "].includes(v.key)&&v.stopPropagation(),v.key==="Escape"?(v.preventDefault(),a.onClose(),(x=document.querySelector(".caret-btn"))==null||x.focus()):v.key==="ArrowDown"||v.key==="ArrowUp"?(v.preventDefault(),N(f+(v.key==="ArrowDown"?1:-1))):(v.key==="Home"||v.key==="End")&&(v.preventDefault(),N(v.key==="Home"?0:a.steps.length-1))},children:[o.jsx("div",{className:"oc-menu-h",children:u.activity.historyTitle}),!a.steps.length&&o.jsx("p",{className:"hist-empty",children:u.activity.historyEmpty}),o.jsx("div",{className:"hist-rows",children:a.steps.map((v,x)=>{const C=uh(v,a.me),O=u.activity.ago(a.now-v.at);return o.jsxs("button",{ref:X=>void(p.current[x]=X),role:"menuitem",className:`menu-item oc-hrow ${v.now?"now":""} ${v.undone?"past":""} ${f===x?"active":""}`,"aria-label":(v.now?u.activity.nowAria:v.undone?u.activity.undoneAria:u.activity.goBackAria)(v.name,C,O),"aria-current":v.now?"step":void 0,title:v.label,"aria-disabled":a.busy||void 0,onMouseEnter:()=>h(x),onFocus:()=>h(x),onClick:()=>!v.now&&!a.busy&&a.onGo(v),children:[o.jsx("span",{className:"oc-now-dot","aria-hidden":"true"}),o.jsxs("span",{className:"oc-who",children:[o.jsx(ne,{name:mu(v),size:16}),o.jsx("span",{children:C})]}),o.jsx("span",{className:"oc-what",children:v.name}),v.now?o.jsx("span",{className:"oc-mark",children:u.activity.now}):f===x?o.jsx("span",{className:"oc-mark go",children:u.activity.goBack}):o.jsx("span",{}),o.jsx("span",{className:"oc-when",children:O})]},v.id)})}),o.jsx("div",{className:"menu-foot",children:o.jsx("span",{children:u.activity.historyFoot})})]})}const u0=3,Qp=(a,i,r=u0)=>Math.abs(a)+Math.abs(i)>=r;function d0(a,i,r=8){const f=(i.full??i.w)>a-r*2;return{x:Math.max(r,Math.round((a-i.w)/2)),icons:f}}function f0(a,i=2){const r=a.split("/"),f=r.slice(1).map((h,p)=>r.slice(0,p+1).join("/"));return{paths:f.slice(-i),skipped:f.length>i}}function Za(a){const i=(a??"").trim(),r=i.match(/^(-?\d+(?:\.\d+)?)px$/);return r?String(Number(r[1])):i}const Pf=a=>(a??"").trim().split(/\s+/).filter(Boolean).map(Za).join(" · ");function h0(a){return a.replace(/·/g," ").trim().split(/\s+/).filter(Boolean).map(r=>/^-?\d+(?:\.\d+)?$/.test(r)?`${Number(r)}px`:r).join(" ")}function eh(a,i){const r=Number(a);return!a||!Number.isFinite(r)?String(a??""):i[r]?`${i[r]} · ${r}`:String(r)}const m0=/^(system-ui|-apple-system|blinkmacsystemfont|ui-sans-serif)$/i;function Fp(a){var r;const i=((r=(a??"").split(",")[0])==null?void 0:r.trim().replace(/^["']|["']$/g,""))??"";return m0.test(i)?"System UI":i}function g0(a){const i=a.trim();return/^system ui$/i.test(i)?"system-ui":i.includes(",")||/^["'].*["']$/.test(i)||!/\s/.test(i)?i:`"${i}"`}function Un(a){const i=(a??"").trim().toLowerCase();let r=i.match(/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/);if(r){let f=r[1];return f.length<=4&&(f=[...f].map(h=>h+h).join("")),f.length===8&&f.slice(6)!=="ff"?null:"#"+f.slice(0,6).toUpperCase()}return r=i.match(/^rgba?\(\s*([\d.]+)[ ,]+([\d.]+)[ ,]+([\d.]+)(?:[ ,/]+([\d.]+%?))?\s*\)$/),r?r[4]!=null&&parseFloat(r[4])<(r[4].endsWith("%")?100:1)?null:"#"+[r[1],r[2],r[3]].map(f=>Math.round(Number(f)).toString(16).padStart(2,"0")).join("").toUpperCase():null}const Cy=a=>a.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"token";function wc(a,i){var p;const r=(a??"").trim(),f=r.match(/^var\(\s*--([a-z0-9-]+)/i);if(f){const y=i.find(S=>Cy(S.name)===f[1].toLowerCase());if(y)return y;const N=(p=r.match(/,\s*([^)]+)\)\s*$/))==null?void 0:p[1];return N?wc(N,i):null}const h=Un(r);return h?i.find(y=>Un(y.value)===h)??null:null}function p0(a,i){const r=Cy(a.name);if(i[`--${r}`]!=null)return`var(--${r})`;const f=Un(a.value),h=Object.keys(i).find(p=>f&&Un(i[p])===f);return h?`var(${h})`:`var(--${r}, ${f??a.value})`}const y0=(a,i)=>a==="text"&&Un(i)==null?"color":"background";function ou(a,i,r=1,f=0){const h=parseFloat(a),p=Number.isFinite(h)?h:0;return Math.max(f,Math.round((p+i*r)*100)/100)}function v0(a,i,r=4){return(a||"0px").trim().split(/\s+/).map(h=>`${ou(h,i,r)}px`).join(" ")}const th=[{id:"yellow",label:u.shapes.stickyColors.yellow,bg:"#FFF1A8"},{id:"orange",label:u.shapes.stickyColors.orange,bg:"#FFD9BC"},{id:"pink",label:u.shapes.stickyColors.pink,bg:"#FFD6E2"},{id:"purple",label:u.shapes.stickyColors.purple,bg:"#E5DAFF"},{id:"blue",label:u.shapes.stickyColors.blue,bg:"#D2E4FF"},{id:"green",label:u.shapes.stickyColors.green,bg:"#D5F0D3"},{id:"gray",label:u.shapes.stickyColors.gray,bg:"#ECEBE7"},{id:"white",label:u.shapes.stickyColors.white,bg:"#FFFFFF"}],b0=a=>{var i;return((i=th.find(r=>r.id===a))==null?void 0:i.bg)??th[0].bg},Jp=200,Ip=6,x0=["#111111","#6B6B6B","#C94F0C","#B42318","#1E7A4C","#2F6FDE","#FFFFFF","none"];function My({s:a,id:i}){var T;const r=a.strokeWidth??4,f=a.stroke??"#111111",h=a.fill??"none",p=r,y=Math.max(1,a.w),N=Math.max(1,a.h),S=(a.points??[]).map(([v,x])=>`${v},${x}`).join(" ");return o.jsxs("svg",{width:y+p*2,height:N+p*2,viewBox:`${-p} ${-p} ${y+p*2} ${N+p*2}`,style:{position:"absolute",left:-p,top:-p,overflow:"visible"},children:[a.kind==="arrow"&&o.jsx("defs",{children:o.jsx("marker",{id:`ah-${i}`,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"5",markerHeight:"5",orient:"auto-start-reverse",children:o.jsx("path",{d:"M0 0L10 5L0 10z",fill:f})})}),a.kind==="rect"&&o.jsx("rect",{x:0,y:0,width:y,height:N,rx:8,fill:h,stroke:f,strokeWidth:r}),a.kind==="oval"&&o.jsx("ellipse",{cx:y/2,cy:N/2,rx:y/2,ry:N/2,fill:h,stroke:f,strokeWidth:r}),(a.kind==="line"||a.kind==="arrow")&&o.jsx("polyline",{points:S,fill:"none",stroke:f,strokeWidth:r,strokeLinecap:"round",markerEnd:a.kind==="arrow"?`url(#ah-${i})`:void 0}),a.kind==="pen"&&o.jsx("polyline",{points:S,fill:"none",stroke:f,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round"}),a.kind==="image"&&o.jsx("image",{href:(T=a.src)==null?void 0:T.replace(/^\.\.\//,"/"),x:0,y:0,width:y,height:N,preserveAspectRatio:"xMidYMid slice"})]})}function w0(a){const i=w.useRef(null),r=(h,p)=>y=>{y.button!==0||!a.interactive||(y.stopPropagation(),a.onSelect(h,y.shiftKey),!y.shiftKey&&(i.current={id:h,mode:p,sx:y.clientX,sy:y.clientY,o:a.shapes[h],moved:!1},y.currentTarget.setPointerCapture(y.pointerId)))},f=(h,p=!1)=>{const y=i.current;if(!y)return;const N=(h.clientX-y.sx)/a.zoom,S=(h.clientY-y.sy)/a.zoom;if(!y.moved&&Math.abs(N)+Math.abs(S)<2/a.zoom){p&&(i.current=null);return}if(y.moved=!0,y.mode==="move")a.onChange(y.id,{x:Math.round(y.o.x+N),y:Math.round(y.o.y+S)},p);else{const T=Math.max(8,y.o.w+N),v=Math.max(8,y.o.h+S),x=T/Math.max(1,y.o.w),C=v/Math.max(1,y.o.h),O={w:Math.round(T),h:Math.round(v)};y.o.points&&(O.points=y.o.points.map(([X,ee])=>[Math.round(X*x),Math.round(ee*C)])),a.onChange(y.id,O,p)}p&&(i.current=null)};return o.jsx(o.Fragment,{children:a.ids.map(h=>{const p=a.shapes[h],y=a.selected.includes(h);return o.jsxs("div",{className:`shape ${y?"selected":""}`,"data-shape":h,style:{left:p.x,top:p.y,width:Math.max(1,p.w),height:Math.max(1,p.h),pointerEvents:a.interactive?"auto":"none"},onPointerDown:r(h,"move"),onPointerMove:N=>f(N),onPointerUp:N=>f(N,!0),onContextMenu:N=>{N.preventDefault(),N.stopPropagation(),a.selected.includes(h)||a.onSelect(h),a.onContext(h,N)},children:[o.jsx(My,{s:p,id:h}),y&&o.jsx("div",{className:"shape-resize",role:"slider","aria-label":u.shapes.shapeSize,"aria-valuetext":`${p.w} × ${p.h}`,style:{width:12/a.zoom,height:12/a.zoom,right:-6/a.zoom,bottom:-6/a.zoom,borderWidth:1.5/a.zoom},onPointerDown:r(h,"resize"),onPointerMove:N=>f(N),onPointerUp:N=>f(N,!0)})]},h)})})}function S0({tool:a,view:i,onDone:r}){const[f,h]=w.useState(null),p=w.useRef(null),y=S=>{const T=S.currentTarget.getBoundingClientRect();return{x:(S.clientX-T.left-i.x)/i.zoom,y:(S.clientY-T.top-i.y)/i.zoom}},N=(S,T,v,x,C,O)=>{if(O&&(a==="rect"||a==="oval")){const J=Math.max(Math.abs(v-S),Math.abs(x-T));v=S+Math.sign(v-S||1)*J,x=T+Math.sign(x-T||1)*J}if(a==="pen"){const J=C.map(ce=>ce[0]),Q=C.map(ce=>ce[1]),q=Math.min(...J),I=Math.min(...Q);return{kind:"pen",x:q,y:I,w:Math.max(...J)-q,h:Math.max(...Q)-I,points:C.map(([ce,se])=>[Math.round(ce-q),Math.round(se-I)])}}const X=Math.min(S,v),ee=Math.min(T,x),k=Math.abs(v-S),$=Math.abs(x-T);return a==="line"||a==="arrow"?{kind:a,x:X,y:ee,w:k,h:$,points:[[Math.round(S-X),Math.round(T-ee)],[Math.round(v-X),Math.round(x-ee)]]}:{kind:a,x:X,y:ee,w:k,h:$}};return o.jsx("div",{className:"shape-drawer","aria-label":u.shapes.drawShape,onPointerDown:S=>{if(S.button!==0)return;S.currentTarget.setPointerCapture(S.pointerId);const T=y(S);p.current={x0:T.x,y0:T.y,pts:[[T.x,T.y]]}},onPointerMove:S=>{const T=p.current;if(!T)return;const v=y(S);a==="pen"&&T.pts.push([v.x,v.y]),h(N(T.x0,T.y0,v.x,v.y,T.pts,S.shiftKey))},onPointerUp:S=>{const T=p.current;if(p.current=null,h(null),!T)return;const v=y(S);let x=N(T.x0,T.y0,v.x,v.y,T.pts,S.shiftKey);if(x.w<4&&x.h<4){if(a==="pen")return;x=a==="line"||a==="arrow"?{kind:a,x:T.x0,y:T.y0,w:200,h:0,points:[[0,0],[200,0]]}:{kind:a,x:T.x0,y:T.y0,w:200,h:140}}r({...x,x:Math.round(x.x),y:Math.round(x.y),w:Math.round(x.w),h:Math.round(x.h)})},children:f&&o.jsx("div",{className:"world",style:{transform:`translate(${i.x}px, ${i.y}px) scale(${i.zoom})`,pointerEvents:"none"},children:o.jsx("div",{className:"shape",style:{left:f.x,top:f.y,width:Math.max(1,f.w),height:Math.max(1,f.h)},children:o.jsx(My,{s:{...f,strokeWidth:4},id:"draft"})})})})}function j0({shape:a,onPatch:i,onDelete:r,onFront:f,onBack:h}){const p=u.shapes.kinds,y=({value:N,onPick:S,allowNone:T})=>o.jsx("span",{className:"swatches",children:x0.filter(v=>T||v!=="none").map(v=>o.jsx("button",{className:`swatch ${N===v?"on":""} ${v==="none"?"none":""}`,title:v==="none"?u.shapes.none:v,"aria-label":v==="none"?u.shapes.none:v,style:{background:v==="none"?void 0:v},onClick:()=>S(v)},v))});return o.jsxs("section",{className:"board-opts","aria-label":u.shapes.options,children:[o.jsx("div",{className:"sec-head",children:o.jsx("span",{children:p[a.kind]})}),a.kind!=="image"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"field-row",children:[o.jsx("span",{children:u.shapes.strokeColor}),o.jsx(y,{value:a.stroke??"#111111",onPick:N=>i({stroke:N})})]}),(a.kind==="rect"||a.kind==="oval")&&o.jsxs("div",{className:"field-row",children:[o.jsx("span",{children:u.shapes.fill}),o.jsx(y,{value:a.fill??"none",onPick:N=>i({fill:N}),allowNone:!0})]}),o.jsxs("label",{className:"field-row",children:[o.jsx("span",{children:u.shapes.weight}),o.jsx("input",{type:"range",min:1,max:24,value:a.strokeWidth??4,onChange:N=>i({strokeWidth:Number(N.target.value)}),"aria-label":u.shapes.strokeWeight})]})]}),o.jsxs("div",{className:"muted small",children:[a.w," × ",a.h," · (",a.x,", ",a.y,")"]}),o.jsxs("div",{className:"btn-row",children:[o.jsx("button",{className:"icon-btn","aria-label":u.shapes.front,title:u.shapes.front,onClick:f,children:o.jsx(ne,{name:"front"})}),o.jsx("button",{className:"icon-btn","aria-label":u.shapes.back,title:u.shapes.back,onClick:h,children:o.jsx(ne,{name:"back"})}),o.jsx("button",{className:"icon-btn danger","aria-label":u.shapes.deleteShape,title:u.shapes.deleteTitle,onClick:r,children:o.jsx(ne,{name:"trash"})})]})]})}function N0({note:a,onPatch:i,onDelete:r}){const f=a.kind==="title",h=f?72:22;return o.jsxs("section",{className:"board-opts","aria-label":u.notes.options,children:[o.jsx("div",{className:"sec-head",children:o.jsx("span",{children:f?u.notes.title:u.notes.sticky})}),o.jsxs("label",{className:"field-row",children:[o.jsx("span",{children:u.notes.fontSize}),o.jsx("select",{value:a.size??h,onChange:p=>i({size:Number(p.target.value)===h?void 0:Number(p.target.value)}),"aria-label":u.notes.fontSize,children:(f?[32,48,56,72,96,128]:[14,18,22,28,36]).map(p=>o.jsxs("option",{value:p,children:[p,"px",p===h?u.notes.defaultSuffix:""]},p))})]}),o.jsxs("div",{className:"btn-row",role:"group","aria-label":u.notes.textStyle,children:[o.jsx("button",{className:`icon-btn ${a.bold??f?"on":""}`,"aria-pressed":!!(a.bold??f),"aria-label":u.notes.bold,title:u.notes.bold,onClick:()=>i({bold:!(a.bold??f)}),children:o.jsx("strong",{children:"B"})}),o.jsx("button",{className:`icon-btn ${a.italic?"on":""}`,"aria-pressed":!!a.italic,"aria-label":u.notes.italic,title:u.notes.italic,onClick:()=>i({italic:!a.italic||void 0}),children:o.jsx("em",{children:"I"})})]}),!f&&o.jsxs("div",{className:"field-row",children:[o.jsx("span",{children:u.notes.color}),o.jsx("span",{className:"swatches",children:th.map(p=>o.jsx("button",{className:`swatch ${(a.color??"yellow")===p.id?"on":""}`,title:p.label,"aria-label":u.notes.stickyColor(p.label),style:{background:p.bg},onClick:()=>i({color:p.id==="yellow"?void 0:p.id})},p.id))})]}),f?o.jsxs("div",{className:"grid2",children:[o.jsx(Ll,{label:u.notes.maxWidth,value:a.maxW??2e3,onCommit:p=>i({maxW:p})}),o.jsx(Ll,{label:u.notes.maxHeight,value:a.maxH??0,onCommit:p=>i({maxH:p||void 0})})]}):o.jsxs("div",{className:"grid2",children:[o.jsx(Ll,{label:u.notes.width,value:a.w??400,onCommit:p=>i({w:p})}),o.jsx(Ll,{label:u.notes.height,value:a.h??0,onCommit:p=>i({h:p||void 0})})]}),o.jsx("p",{className:"muted small",children:f?u.notes.titleHint:u.notes.stickyHint}),o.jsx("div",{className:"btn-row",children:o.jsx("button",{className:"icon-btn danger","aria-label":u.notes.deleteNote,title:u.notes.deleteTitle,onClick:r,children:o.jsx(ne,{name:"trash"})})})]})}function Ll({label:a,value:i,onCommit:r}){return o.jsxs("label",{className:"num",children:[o.jsx("span",{children:a}),o.jsx("input",{inputMode:"numeric",defaultValue:i,onBlur:f=>{const h=Math.max(0,Math.round(Number(f.target.value)));Number.isFinite(h)&&h!==i&&r(h)},onKeyDown:f=>!f.nativeEvent.isComposing&&f.key==="Enter"&&f.target.blur()},i)]})}const T0=a=>a==="grid"?{type:a,count:0,gutter:0,margin:0,align:"stretch",size:8,color:"#C94F0C"}:{type:a,count:a==="columns"?4:6,gutter:16,margin:20,align:"stretch",size:80,color:"#C94F0C"};function E0(a,i){const r=Math.max(1,Math.round(i.count));if(i.align==="stretch"){const y=(a-i.margin*2-i.gutter*(r-1))/r;return Array.from({length:r},(N,S)=>[i.margin+S*(y+i.gutter),y])}const f=r*i.size+(r-1)*i.gutter,h=i.align==="start"?i.margin:i.align==="end"?a-i.margin-f:(a-f)/2;return Array.from({length:r},(p,y)=>[h+y*(i.size+i.gutter),i.size])}function k0({guides:a,w:i,h:r}){return o.jsx("div",{className:"layout-guides","aria-hidden":"true",children:a.filter(f=>!f.hidden).map((f,h)=>f.type==="grid"?o.jsx("div",{className:"lg-grid",style:{backgroundImage:`linear-gradient(to right, ${f.color}55 1px, transparent 1px), linear-gradient(to bottom, ${f.color}55 1px, transparent 1px)`,backgroundSize:`${f.size}px ${f.size}px`}},h):E0(f.type==="columns"?i:r,f).map(([p,y],N)=>o.jsx("div",{className:"lg-track",style:f.type==="columns"?{left:p,top:0,width:y,height:r,background:`${f.color}1f`}:{top:p,left:0,height:y,width:i,background:`${f.color}1f`}},`${h}-${N}`)))})}function C0({guides:a,onChange:i}){const r=(h,p)=>i(a.map((y,N)=>N===h?{...y,...p}:y),u.history.editGuide),f=u.guides.types;return o.jsxs("section",{className:"board-opts guides-editor","aria-label":u.guides.aria,children:[o.jsxs("div",{className:"sec-head",children:[o.jsx("span",{children:u.guides.heading(a.length,Ip)}),o.jsx("span",{className:"btn-row",children:["columns","rows","grid"].map(h=>o.jsx("button",{className:"icon-btn sm",disabled:a.length>=Ip,title:u.guides.add[h],"aria-label":u.guides.add[h],onClick:()=>i([...a,T0(h)],u.history.addGuide),children:o.jsx("span",{className:"small",children:f[h]})},h))})]}),a.length===0&&o.jsx("p",{className:"muted small",children:u.guides.empty}),a.map((h,p)=>o.jsxs("div",{className:"guide-row",children:[o.jsxs("div",{className:"guide-head",children:[o.jsx("strong",{children:f[h.type]}),o.jsx("input",{type:"color",value:h.color,onChange:y=>r(p,{color:y.target.value}),"aria-label":u.guides.color}),o.jsx("div",{className:"spacer"}),o.jsx("button",{className:"icon-btn sm","aria-label":h.hidden?u.guides.show:u.guides.hide,title:h.hidden?u.guides.show:u.guides.hide,onClick:()=>r(p,{hidden:!h.hidden||void 0}),children:o.jsx(ne,{name:h.hidden?"close":"check",size:14})}),o.jsx("button",{className:"icon-btn sm danger","aria-label":u.guides.deleteGuide,title:u.guides.delete,onClick:()=>i(a.filter((y,N)=>N!==p),u.history.deleteGuide),children:o.jsx(ne,{name:"trash",size:14})})]}),h.type==="grid"?o.jsx("div",{className:"grid2",children:o.jsx(Ll,{label:u.guides.cell,value:h.size,onCommit:y=>r(p,{size:Math.max(2,y)})})}):o.jsxs("div",{className:"grid2",children:[o.jsx(Ll,{label:u.guides.count,value:h.count,onCommit:y=>r(p,{count:Math.max(1,Math.min(48,y))})}),o.jsx(Ll,{label:u.guides.gutter,value:h.gutter,onCommit:y=>r(p,{gutter:y})}),o.jsx(Ll,{label:u.guides.margin,value:h.margin,onCommit:y=>r(p,{margin:y})}),h.align!=="stretch"&&o.jsx(Ll,{label:u.guides.cellSize,value:h.size,onCommit:y=>r(p,{size:Math.max(1,y)})}),o.jsxs("label",{className:"field-row span2",children:[o.jsx("span",{children:u.guides.align}),o.jsxs("select",{value:h.align,onChange:y=>r(p,{align:y.target.value}),"aria-label":u.guides.alignAria,children:[o.jsx("option",{value:"stretch",children:u.guides.stretch}),o.jsx("option",{value:"start",children:h.type==="columns"?u.guides.left:u.guides.top}),o.jsx("option",{value:"center",children:u.guides.center}),o.jsx("option",{value:"end",children:h.type==="columns"?u.guides.right:u.guides.bottom})]})]})]})]},p))]})}const Wp={paths:[],rects:[],selection:null,error:null};function M0(a,i){const[r,f]=w.useState(Wp),h=w.useRef([]);h.current=r.paths;const p=w.useCallback(()=>{var T;if(!a)return;const S=(T=i(a))==null?void 0:T.contentDocument;S&&f(v=>{const x=v.paths.map(C=>Hn(S,C));return x.some(C=>!C)?{...v,paths:[],rects:[],selection:null,error:u.editMode.fileChanged}:{...v,rects:x.map(C=>wl(C))}})},[a,i]),y=w.useCallback(async S=>{var C;if(!a)return;const T=(C=i(a))==null?void 0:C.contentDocument,v=T?S.map(O=>Hn(T,O)):[];if(!T||!S.length||v.some(O=>!O)){f(O=>({...O,paths:[],rects:[],selection:null})),await Ce.put("/api/selection",{file:null}).catch(()=>{});return}const x=S[S.length-1];f(O=>({...O,paths:S,rects:v.map(X=>wl(X)),error:null}));try{const{selection:O}=await Ce.put("/api/selection",{file:a,path:x,paths:S,styles:Xb(Hn(T,x)),...zy(Hn(T,x))});f(X=>X.paths===S||X.paths.join()===S.join()?{...X,selection:O}:X)}catch(O){f(X=>({...X,selection:null,error:String(O.message)}))}},[a,i]),N=w.useRef(!0);return w.useEffect(()=>{f(Wp),N.current?N.current=!1:a||Ce.put("/api/selection",{file:null}).catch(()=>{})},[a]),w.useEffect(()=>{var O;if(!a)return;const S=i(a);if(!S)return;let T=()=>{};const v=()=>{T();const X=S.contentDocument,ee=S.contentWindow;if(!X||!ee)return;const k=J=>{var Q;J.isComposing||(Q=J.target)!=null&&Q.isContentEditable||(window.dispatchEvent(new KeyboardEvent("keydown",{key:J.key,code:J.code,metaKey:J.metaKey,ctrlKey:J.ctrlKey,shiftKey:J.shiftKey,altKey:J.altKey})),(/^(Arrow|Delete|Backspace|Tab|Enter|Escape)/.test(J.key)||(J.metaKey||J.ctrlKey)&&/^[zydcvg]$/i.test(J.key))&&J.preventDefault())},$=()=>p();X.addEventListener("keydown",k,!0),ee.addEventListener("scroll",$,!0),T=()=>{X.removeEventListener("keydown",k,!0),ee.removeEventListener("scroll",$,!0)}},x=()=>{v(),h.current.length&&y(h.current)},C=()=>h.current.length&&void y(h.current);return((O=S.contentDocument)==null?void 0:O.readyState)==="complete"&&v(),S.addEventListener("load",x),S.addEventListener("dc-patched",C),()=>{S.removeEventListener("load",x),S.removeEventListener("dc-patched",C),T()}},[a,i,y,p]),{state:r,select:y,refresh:p,setError:S=>f(T=>({...T,error:S}))}}function Lf(a,i,r){const f=a==null?void 0:a.contentDocument;if(!a||!(f!=null&&f.body))return null;const h=a.getBoundingClientRect(),p=h.width/(a.offsetWidth||h.width)||1,y=f.elementFromPoint((i-h.left)/p,(r-h.top)/p);if(!y||y===f.body||y===f.documentElement)return null;const N=Ta(y);return N==null?null:{el:y,path:N}}function z0(a,i,r,f,h){const p=a==null?void 0:a.contentDocument,y=a==null?void 0:a.contentWindow;if(!a||!(p!=null&&p.body)||!y)return!1;const N=a.getBoundingClientRect(),S=N.width/(a.offsetWidth||N.width)||1,T=p.scrollingElement??p.documentElement,v=O=>{const X=O===T?null:y.getComputedStyle(O),ee=(!X||/auto|scroll/.test(X.overflowY))&&(h<0?O.scrollTop>0:h>0&&O.scrollTop+O.clientHeight<O.scrollHeight-1),k=(!X||/auto|scroll/.test(X.overflowX))&&(f<0?O.scrollLeft>0:f>0&&O.scrollLeft+O.clientWidth<O.scrollWidth-1);return ee||k};let x=p.elementFromPoint((i-N.left)/S,(r-N.top)/S);for(;x&&x!==T&&x!==p.body&&!v(x);)x=x.parentElement;const C=x&&x!==p.body&&v(x)?x:v(T)?T:null;return C?(C.scrollBy(f/S,h/S),!0):!1}function A0(a,i){const r=p=>{const y=p.getBoundingClientRect();return y.width>0&&y.height>0&&y.left>=i.x&&y.top>=i.y&&y.right<=i.x+i.w&&y.bottom<=i.y+i.h},f=[],h=p=>{for(const y of Array.from(p.children))if(!/^(script|style|template)$/i.test(y.tagName))if(r(y)){const N=Ta(y);N!=null&&f.push(N)}else h(y)};return h(a.body),f}function zy(a){var p,y,N;const i=a.tagName.toLowerCase(),r=a.getAttribute("role"),f=i==="img"||i==="picture"||(y=(p=a.style)==null?void 0:p.backgroundImage)!=null&&y.includes("url(")?"image":i==="button"||r==="button"?"button":i==="a"?"link":/^(input|textarea|select)$/.test(i)?"input":i==="svg"?"icon":!a.children.length&&((N=a.textContent)!=null&&N.trim())?"text":"container",h=(a.getAttribute("aria-label")||a.getAttribute("alt")||a.getAttribute("title")||a.getAttribute("placeholder")||a.innerText||a.textContent||"").trim().replace(/\s+/g," ").slice(0,60);return{kind:f,label:h}}function O0(a){let i=a;const r=new Set;return{get:()=>i,set(f){const h=typeof f=="function"?f(i):f;if(!(h===i||h.x===i.x&&h.y===i.y&&h.zoom===i.zoom)){i=h;for(const p of[...r])p()}},subscribe(f){return r.add(f),()=>r.delete(f)}}}function D0(a){const i=w.useRef(null);return i.current||(i.current=O0(a)),i.current}function dh(a){return w.useSyncExternalStore(a.subscribe,a.get,a.get)}function nh(a,i){const r=()=>i(a.get());return w.useSyncExternalStore(a.subscribe,r,r)}function R0(a,i){const r=()=>i?a.get():null;return w.useSyncExternalStore(a.subscribe,r,r)}const fh=.04,hh=4,$0=.25,B0=640,Gf=.5,Pp=150,_0=40,vc=[600,1200,2400],H0=a=>vc.find(i=>i>=a)??vc[vc.length-1],U0=6,Ay={url:a=>`/screens/${a}`,thumbs:!0};function L0(a){var sn;const i=dh(a.view),r=a.view.set,f=w.useRef(null),h=w.useRef(null),[p,y]=w.useState({w:1200,h:800}),[N,S]=w.useState(!1),[T,v]=w.useState([]),[x,C]=w.useState(null),O=w.useRef(null),X=w.useRef(null);w.useLayoutEffect(()=>{const B=f.current,K=()=>{var Be;const be={w:B.clientWidth,h:B.clientHeight};!be.w||!be.h||(y(Fe=>Fe.w===be.w&&Fe.h===be.h?Fe:be),(Be=a.onSize)==null||Be.call(a,be))},le=new ResizeObserver(K);return le.observe(B),document.addEventListener("visibilitychange",K),()=>{le.disconnect(),document.removeEventListener("visibilitychange",K)}},[]);const ee=w.useRef(!1);w.useEffect(()=>{const B=h.current;if(!B)return;if(!ee.current){ee.current=!0;return}B.style.willChange="transform";const K=setTimeout(()=>B.style.willChange="",200);return()=>clearTimeout(K)},[i.x,i.y,i.zoom]),w.useEffect(()=>{const B=f.current,K=le=>{var De,Qe,Dt;le.preventDefault();const be=B.getBoundingClientRect(),Be=le.clientX-be.left,Fe=le.clientY-be.top;if(le.ctrlKey||le.metaKey)r(Ht=>{const Rt=so(Ht.zoom*Math.exp(-le.deltaY*.01),fh,hh),Wt=(Be-Ht.x)/Ht.zoom,et=(Fe-Ht.y)/Ht.zoom;return{zoom:Rt,x:Be-Wt*Rt,y:Fe-et*Rt}});else{const Ht=((Dt=(Qe=(De=le.target)==null?void 0:De.closest)==null?void 0:Qe.call(De,".board-frame[data-inside]"))==null?void 0:Dt.querySelector("iframe"))??null;if(z0(Ht,le.clientX,le.clientY,le.deltaX,le.deltaY))return;r(Rt=>({...Rt,x:Rt.x-le.deltaX,y:Rt.y-le.deltaY}))}};return B.addEventListener("wheel",K,{passive:!1}),()=>B.removeEventListener("wheel",K)},[r]),w.useEffect(()=>{const B=le=>{le.code==="Space"&&!Dy(le)&&!le.repeat&&(le.preventDefault(),S(!0))},K=le=>le.code==="Space"&&S(!1);return window.addEventListener("keydown",B),window.addEventListener("keyup",K),()=>{window.removeEventListener("keydown",B),window.removeEventListener("keyup",K)}},[]);const k=(B,K)=>{const le=f.current.getBoundingClientRect();return{x:(B-le.left-i.x)/i.zoom,y:(K-le.top-i.y)/i.zoom}},$=B=>{O.current=B,C(B)},J=N||a.tool==="hand"||!!a.readOnly,Q=a.screens??Ay,q=B=>{if(B.target!==B.currentTarget&&B.button!==1)return;if(B.currentTarget.setPointerCapture(B.pointerId),B.button===1||J){X.current={kind:"pan",sx:B.clientX,sy:B.clientY,vx:i.x,vy:i.y};return}if(B.button!==0)return;const K=k(B.clientX,B.clientY);if(a.tool==="title"||a.tool==="sticky"){a.onCreateNote(a.tool,{x:Math.round(K.x),y:Math.round(K.y)}),a.setTool("select");return}X.current={kind:a.tool==="board"?"draw":"marquee",sx:K.x,sy:K.y,additive:B.shiftKey,moved:!1}},I=B=>{const K=X.current;if(!K)return;if(K.kind==="pan"){r(Be=>({...Be,x:K.vx+B.clientX-K.sx,y:K.vy+B.clientY-K.sy}));return}const le=k(B.clientX,B.clientY),be={x:Math.min(K.sx,le.x),y:Math.min(K.sy,le.y),w:Math.abs(le.x-K.sx),h:Math.abs(le.y-K.sy)};(be.w+be.h)*i.zoom>4&&(K.moved=!0),K.moved&&$(be)},ce=B=>{const K=X.current;if(X.current=null,(K==null?void 0:K.kind)==="pan"&&a.readOnly&&Math.abs(B.clientX-K.sx)+Math.abs(B.clientY-K.sy)<4&&a.onSelect([],"replace"),!K||K.kind==="pan")return;const le=O.current;if($(null),K.kind==="draw"){const De=k(B.clientX,B.clientY);a.onCreateBoard(K.moved&&le&&le.w>20&&le.h>20?V0(le):{x:Math.round(De.x),y:Math.round(De.y),w:390,h:844}),a.setTool("select");return}if(!K.moved||!le){K.additive||(a.onSelect([],"replace"),a.onSelectNote(null));return}const be=a.visibleBoards.filter(De=>Yf(a.board.boards[De],le)),Be=a.visibleNotes.filter(De=>{var Wt;const Qe=(Wt=f.current)==null?void 0:Wt.querySelector(`[data-note="${De}"]`);if(!Qe)return!1;const Dt=Qe.getBoundingClientRect(),Ht=k(Dt.left,Dt.top),Rt=k(Dt.right,Dt.bottom);return Yf({x:Ht.x,y:Ht.y,w:Rt.x-Ht.x,h:Rt.y-Ht.y},le)}),Fe=Object.entries(a.board.shapes??{}).filter(([,De])=>Yf({x:De.x,y:De.y,w:Math.max(1,De.w),h:Math.max(1,De.h)},le)).map(([De])=>De);a.onMarquee({boards:be,notes:Be,shapes:Fe},K.additive)},se=w.useRef(null),P=(B,K)=>{const le=a.selected.includes(K)?a.selected:[K],be={};for(const Be of le)be[Be]={x:a.board.boards[Be].x,y:a.board.boards[Be].y};se.current={sx:B.clientX,sy:B.clientY,origins:be,moved:!1},B.currentTarget.setPointerCapture(B.pointerId)},re=(B,K=!1)=>{const le=se.current;if(!le)return;let be=(B.clientX-le.sx)/i.zoom,Be=(B.clientY-le.sy)/i.zoom;if(!le.moved&&!Qp(B.clientX-le.sx,B.clientY-le.sy))return;le.moved=!0;const Fe=Object.keys(le.origins),De=Fe.map(et=>({...a.board.boards[et],x:le.origins[et].x+be,y:le.origins[et].y+Be})),Qe=Oy(De),Dt=a.visibleBoards.filter(et=>!Fe.includes(et)).map(et=>a.board.boards[et]),Ht=U0/i.zoom,Rt=[];if(!B.altKey){const et=ty([Qe.x,Qe.x+Qe.w/2,Qe.x+Qe.w],Dt.flatMap(wt=>[wt.x,wt.x+wt.w/2,wt.x+wt.w]),Ht),on=ty([Qe.y,Qe.y+Qe.h/2,Qe.y+Qe.h],Dt.flatMap(wt=>[wt.y,wt.y+wt.h/2,wt.y+wt.h]),Ht);if(et){be+=et.d;const wt=Dt.filter(St=>[St.x,St.x+St.w/2,St.x+St.w].some(Vt=>Math.abs(Vt-et.at)<.5));Rt.push({axis:"x",at:et.at,from:Math.min(Qe.y+((on==null?void 0:on.d)??0),...wt.map(St=>St.y)),to:Math.max(Qe.y+Qe.h+((on==null?void 0:on.d)??0),...wt.map(St=>St.y+St.h))})}if(on){Be+=on.d;const wt=Dt.filter(St=>[St.y,St.y+St.h/2,St.y+St.h].some(Vt=>Math.abs(Vt-on.at)<.5));Rt.push({axis:"y",at:on.at,from:Math.min(Qe.x+((et==null?void 0:et.d)??0),...wt.map(St=>St.x)),to:Math.max(Qe.x+Qe.w+((et==null?void 0:et.d)??0),...wt.map(St=>St.x+St.w))})}}v(K?[]:Rt);const Wt={};for(const et of Fe)Wt[et]={x:Math.round(le.origins[et].x+be),y:Math.round(le.origins[et].y+Be)};a.onMoveBoards(Wt,K)},Se=B=>{const K=se.current;K!=null&&K.moved&&re(B,!0),se.current=null,v([])},Ne=p.w/i.zoom,mt=p.h/i.zoom,Ct=-i.x/i.zoom,_t=-i.y/i.zoom,st=B=>B.x+B.w>Ct-200&&B.x<Ct+Ne+200&&B.y+B.h>_t-200&&B.y<_t+mt+200,fe=B=>{B.currentTarget.setPointerCapture(B.pointerId),X.current={kind:"pan",sx:B.clientX,sy:B.clientY,vx:i.x,vy:i.y}},ye=w.useRef(null),xe=!!a.onPickElement&&!a.readOnly&&!J&&a.tool==="select",_e=(B,K,le,be)=>{var Fe;if(B.button!==0)return;if(B.stopPropagation(),a.readOnly||J)return a.readOnly&&a.onSelect([K],"replace"),fe(B);const Be=a.selected.includes(K);if((Fe=a.onHoverElement)==null||Fe.call(a,null),le==="frame"&&xe&&be&&B.shiftKey&&a.editFile===K){B.currentTarget.setPointerCapture(B.pointerId),ye.current={file:K,kind:"elements",sx:B.clientX,sy:B.clientY,moved:!1};return}if(B.shiftKey)return a.onSelect([K],"toggle");Be||a.onSelect([K],"replace"),P(B,K),ye.current={file:K,kind:le==="frame"&&xe&&be?"board":"label",sx:B.clientX,sy:B.clientY,moved:!1}},ke=(B,K)=>({x:Math.min(B.sx,K.clientX),y:Math.min(B.sy,K.clientY),w:Math.abs(K.clientX-B.sx),h:Math.abs(K.clientY-B.sy)}),xt=(B,K,le)=>{var Be,Fe,De;if(a.readOnly||((Be=X.current)==null?void 0:Be.kind)==="pan")return I(B);ye.current&&B.buttons===0&&(ye.current=null,se.current=null);const be=ye.current;if(!be){B.buttons===0&&xe&&le&&((Fe=a.onHoverElement)==null||Fe.call(a,K,B));return}if(be.kind==="elements"){if(!be.moved&&!Qp(B.clientX-be.sx,B.clientY-be.sy))return;be.moved=!0,(De=a.onElementMarquee)==null||De.call(a,be.file,ke(be,B),!1);return}re(B)},Ke=(B,K)=>{var Be,Fe,De,Qe,Dt;if(a.readOnly||((Be=X.current)==null?void 0:Be.kind)==="pan")return void(X.current=null);const le=ye.current;if(ye.current=null,(le==null?void 0:le.kind)==="elements"){le.moved?(Fe=a.onElementMarquee)==null||Fe.call(a,le.file,ke(le,B),!0):(De=a.onPickElement)==null||De.call(a,K,B,{add:!0,double:!1});return}const be=!!((Qe=se.current)!=null&&Qe.moved);Se(B),!(!le||be)&&(le.kind==="board"?(Dt=a.onPickElement)==null||Dt.call(a,K,B,{add:!1,double:!1}):le.kind==="label"&&a.editFile===K&&a.onSelect([K],"replace"))},Pe=new Set(a.visibleBoards),D=new Set;for(const B of a.visibleBoards){const K=(sn=a.board.boards[B])==null?void 0:sn.origin;(K==null?void 0:K.kind)==="fork"&&(D.add(B),Pe.has(K.of)&&D.add(K.of))}const G=w.useRef(new Set),oe=w.useRef([]),_=w.useRef(!1),ge=w.useRef(0),[,je]=w.useState(0),He=()=>{if(ge.current||!_.current)return;const B=oe.current.find(K=>!G.current.has(K));B&&(G.current.add(B),je(K=>K+1),ge.current=window.setTimeout(()=>{ge.current=0,He()},_0))},me=w.useRef(0);w.useEffect(()=>{_.current=!1;const B=performance.now(),K=B-me.current;me.current=B;const le=window.setTimeout(()=>{_.current=!0,He()},K<400?Math.max(Pp,K*3):Pp);return()=>window.clearTimeout(le)},[i.x,i.y,i.zoom]),w.useEffect(()=>()=>window.clearTimeout(ge.current),[]);const ve=[],rt=Ct+Ne/2,Ea=_t+mt/2;w.useEffect(()=>{const B=new Set(ve.map(K=>K.f));for(const K of G.current)B.has(K)||G.current.delete(K);oe.current=ve.sort((K,le)=>K.d-le.d).map(K=>K.f),He()});const Xn=w.useRef({p:a,pressBoard:_e,moveBoardPress:xt,releaseBoard:Ke,picking:xe});Xn.current={p:a,pressBoard:_e,moveBoardPress:xt,releaseBoard:Ke,picking:xe};const jn=w.useMemo(()=>{const B=()=>Xn.current;return{press:(K,le,be,Be)=>B().pressBoard(K,le,be,Be),pressMove:(K,le,be)=>B().moveBoardPress(K,le,be),release:(K,le)=>B().releaseBoard(K,le),leave:()=>{var K,le;return!ye.current&&((le=(K=B().p).onHoverElement)==null?void 0:le.call(K,null))},doubleClickFrame:(K,le)=>{var be,Be;return(Be=(be=B().p).onPickElement)==null?void 0:Be.call(be,le,K,{add:!1,double:!0})},contextFrame:(K,le,be)=>{var Be,Fe;return B().picking&&be&&!!((Fe=(Be=B().p).onElementContext)!=null&&Fe.call(Be,le,K))},resize:(K,le,be)=>B().p.onMoveBoards({[K]:le},be),play:K=>B().p.onPlay(K),rename:K=>B().p.onRename(K),context:(K,le)=>B().p.onContext({type:"board",file:K},le),iframeRef:(K,le)=>{var be,Be;return(Be=(be=B().p).iframeRef)==null?void 0:Be.call(be,K,le)},selectNote:(K,le)=>B().p.onSelectNote(K,le),moveNote:(K,le,be)=>B().p.onMoveNote(K,le,be),deleteNote:K=>B().p.onDeleteNote(K),contextNote:(K,le)=>B().p.onContext({type:"note",id:K},le)}},[]),at=w.useMemo(()=>new Set(a.files),[a.files]),Le=w.useRef({zoom:0,of:new Map});(Le.current.fn!==a.renderBoardOverlay||Le.current.zoom!==i.zoom)&&(Le.current={fn:a.renderBoardOverlay,zoom:i.zoom,of:new Map});const xn=B=>{var le;const K=Le.current.of;return K.has(B)||K.set(B,(le=a.renderBoardOverlay)==null?void 0:le.call(a,B,i.zoom)),K.get(B)},Mn=w.useMemo(()=>{var B;return(B=a.underLayer)==null?void 0:B.call(a,i.zoom)},[a.underLayer,i.zoom]),Kt=w.useMemo(()=>{var B;return(B=a.worldLayer)==null?void 0:B.call(a,i.zoom)},[a.worldLayer,i.zoom]);return o.jsxs("div",{ref:f,className:`canvas tool-${J?"hand":a.tool}`,onPointerDown:q,onPointerMove:I,onPointerUp:ce,onAuxClick:B=>B.preventDefault(),onContextMenu:B=>{if(B.target!==B.currentTarget)return;B.preventDefault();const K=k(B.clientX,B.clientY);a.onContext({type:"canvas",x:Math.round(K.x),y:Math.round(K.y)},B)},role:"application","aria-label":u.canvas.aria,children:[o.jsxs("div",{ref:h,className:"world",style:{transform:`translate(${i.x}px, ${i.y}px) scale(${i.zoom})`},children:[Mn,a.visibleNotes.map(B=>o.jsx(q0,{note:a.board.notes[B],zoom:i.zoom,id:B,selected:a.selectedNotes.includes(B),readOnly:a.readOnly,h:jn},B)),a.visibleBoards.map(B=>{var Dt,Ht,Rt,Wt;const K=a.board.boards[B],le=a.playing===B||a.editFile===B||a.typing===B,be=le||st(K),Be=le||be&&(!Q.thumbs||i.zoom>=$0||Math.max(K.w,K.h)*i.zoom>=B0);Be&&ve.push({f:B,d:le?-1:Math.hypot(K.x+K.w/2-rt,K.y+K.h/2-Ea)}),le&&G.current.add(B);const Fe=le||Be&&G.current.has(B),De=Be&&!Fe,Qe=a.selected.includes(B);return o.jsx(G0,{file:B,item:K,exists:at.has(B),zoom:i.zoom,live:Fe,selected:Qe,single:Qe&&a.selected.length===1&&!a.readOnly,readOnly:a.readOnly,screens:Q,editing:a.editFile===B,typing:a.typing===B,playing:a.playing===B,near:be,waiting:De,reloadKey:a.reloadKeys[B]??0,version:((Dt=a.versions)==null?void 0:Dt[B])??a.reloadKeys[B]??0,pickable:xe&&Fe,h:jn,overlay:xn(B),compact:K.w*i.zoom>=48&&i.zoom<Gf&&D.has(B),forkScene:D.has(B),tags:K.w*i.zoom>=48&&!(i.zoom<Gf&&D.has(B))&&a.playing!==B?(Ht=a.renderBoardTags)==null?void 0:Ht.call(a,B):null,buttons:a.readOnly?null:(Rt=a.renderBoardButtons)==null?void 0:Rt.call(a,B,i.zoom<Gf&&D.has(B)),ring:((Wt=a.boardRing)==null?void 0:Wt.call(a,B))??null},B)}),Kt,T.map((B,K)=>B.axis==="x"?o.jsx("div",{className:"guide",style:{left:B.at,top:B.from,width:1/i.zoom,height:B.to-B.from}},K):o.jsx("div",{className:"guide",style:{left:B.from,top:B.at,height:1/i.zoom,width:B.to-B.from}},K)),x&&o.jsx("div",{className:a.tool==="board"?"draft-board":"marquee",style:{left:x.x,top:x.y,width:x.w,height:x.h,borderWidth:1/i.zoom},children:a.tool==="board"&&o.jsxs("span",{style:{transform:`scale(${1/i.zoom})`},children:[Math.round(x.w)," × ",Math.round(x.h)]})})]}),N&&o.jsx("div",{className:"pan-capture",onPointerDown:fe,onPointerMove:I,onPointerUp:()=>X.current=null})]})}const G0=w.memo(function(i){var J,Q,q;const{item:r,zoom:f,file:h,h:p,live:y}=i,N=ah(f),S=r.title??i.file,[T,v]=w.useState(!1);w.useEffect(()=>{i.live||v(!1)},[i.live]);const x=r.w*f<48,C=!x&&!!i.compact,O=((J=r.origin)==null?void 0:J.kind)==="fork"&&r.origin.by?r.origin:null,X=O?u.occupancy.forked(u.occupancy.clock(Date.parse(O.at??"")||Date.now()),O.by,O.while??u.occupancy.someone):null,ee=I=>{I.preventDefault(),I.stopPropagation(),p.context(h,I)},k=I=>I.stopPropagation(),$=r.w*f>=110&&o.jsx("button",{className:`icon-btn sm board-play ${r.is_interactive?"always":""} ${i.playing?"pressed":""}`,"aria-label":i.playing?u.canvas.stopPlay:u.canvas.play,title:i.playing?u.canvas.stopPlayTitle:u.canvas.playTitle,onPointerDown:k,onClick:I=>{I.stopPropagation(),p.play(h)},children:o.jsx(ne,{name:i.playing?"stop":"play",size:14})});return o.jsxs("div",{className:`board ${i.selected?"selected":""} ${i.editing?"editing":""} ${i.playing?"playing":""} ${r.frameless?"frameless":""} ${r.is_interactive?"interactive":""} ${i.ring?"held":""}`,style:{left:r.x,top:r.y,width:r.w,height:r.h,...i.ring?{"--ring":i.ring}:{}},"data-file":i.file,role:"group","aria-label":u.canvas.board(S,!!i.selected,!!i.editing,!!i.playing),"aria-description":X??void 0,children:[o.jsxs("div",{className:`board-label ${x?"tiny":""} ${C?"compact":""} ${i.tags?"tagged":""} ${i.forkScene?"fork-scene":""}`,style:{transform:`scale(${1/f})`,width:r.w*f},onPointerDown:I=>p.press(I,h,"label",y),onPointerMove:I=>p.pressMove(I,h,y),onPointerUp:I=>p.release(I,h),onContextMenu:ee,title:`${S} · ${i.file}${X?`
56
+ ${X}`:""}`,children:[i.tags,o.jsxs("span",{className:"lab-row",children:[r.is_interactive&&o.jsx("span",{className:"dot","aria-label":u.canvas.interactive}),C&&O?o.jsxs("span",{className:`occ-tag fork-who ${i.ring?"":"done"}`,onDoubleClick:I=>I.stopPropagation(),children:[i.ring?o.jsx("span",{className:"spinner","aria-hidden":"true"}):o.jsx(ne,{name:"comment",size:16}),o.jsx("span",{className:"act-tag-text",children:O.by})]}):o.jsx("span",{className:"board-title",onDoubleClick:I=>{I.stopPropagation(),i.readOnly||p.rename(h)},children:S}),r.w*f>=160&&S!==i.file&&!(C&&O)&&o.jsx("span",{className:"board-file",children:i.file}),C&&i.selected&&(i.buttons||$)&&o.jsxs("span",{className:"board-btns pinned",children:[i.buttons,$]}),!C&&r.w*f>=110&&o.jsxs("span",{className:`board-btns ${i.buttons?"pinned":""}`,children:[i.buttons,$]})]})]}),o.jsxs("div",{className:"board-frame","data-inside":i.editing&&!i.readOnly?"":void 0,style:{borderRadius:r.radius??0},onDoubleClick:I=>{i.playing||i.typing||!i.pickable||(I.stopPropagation(),p.doubleClickFrame(I,h))},onPointerDown:I=>!i.playing&&!i.typing&&p.press(I,h,"frame",y),onPointerMove:I=>!i.playing&&!i.typing&&p.pressMove(I,h,y),onPointerUp:I=>!i.playing&&!i.typing&&p.release(I,h),onPointerLeave:p.leave,onContextMenu:I=>{i.playing||i.typing||(p.contextFrame(I,h,y)?(I.preventDefault(),I.stopPropagation()):ee(I))},children:[i.exists?i.live?o.jsxs(o.Fragment,{children:[o.jsx(Y0,{reloadKey:i.reloadKey,iframeRef:I=>p.iframeRef(h,I),src:i.screens.url(i.file),html:(q=(Q=i.screens).html)==null?void 0:q.call(Q,i.file),title:S,interactive:!!i.playing||!!i.typing,onLoad:()=>v(!0)}),!T&&i.screens.thumbs&&o.jsx("div",{className:"board-placeholder loading board-cover",style:{position:"absolute",inset:0,pointerEvents:"none",fontSize:Math.min(64,14/f)},"aria-hidden":"true",children:o.jsx(ey,{file:i.file,v:i.version,px:vc[0]})})]}):o.jsxs("div",{className:`board-placeholder ${i.near?"loading":"far"}`,style:{fontSize:Math.min(64,14/f)},children:[i.near&&i.screens.thumbs&&o.jsx(ey,{file:i.file,v:i.version,px:i.waiting?vc[0]:H0(Math.max(r.w,r.h)*f*(window.devicePixelRatio||1))}),o.jsx("span",{className:"ph-title","data-hint":i.near?"":u.canvas.notLoaded,children:S}),i.near&&o.jsx("span",{className:"ph-bar",style:{height:3/Math.max(f,.05)},"aria-hidden":"true"})]}):o.jsx("div",{className:"board-missing",children:u.canvas.fileMissing(i.file)}),i.playing&&o.jsx("div",{className:"playing-badge",style:{transform:`scale(${1/Math.max(f,.25)})`},children:u.canvas.playing}),i.overlay]}),i.single&&o.jsx("div",{className:"board-resize",role:"slider","aria-label":u.canvas.boardSize,"aria-valuetext":`${r.w} × ${r.h}`,style:{width:12/f,height:12/f,right:-6/f,bottom:-6/f,borderWidth:1.5/f},onPointerDown:I=>{I.button===0&&(I.stopPropagation(),N.start(I,{x:r.w,y:r.h},(ce,se)=>p.resize(h,{w:so(Math.round(ce.x),40,8e3),h:so(Math.round(ce.y),40,8e3)},se)))},onPointerMove:N.move,onPointerUp:N.end})]})});function ey({file:a,v:i,px:r}){const[f,h]=w.useState(!1),[p,y]=w.useState(r);w.useEffect(()=>y(x=>Math.max(x,r)),[r]);const N=`/api/thumb?f=${encodeURIComponent(a)}&v=${i}&px=${p}`,[S,T]=w.useState(null),v=w.useRef(null);return w.useEffect(()=>{if(N===v.current)return;const x=new Image;return x.onload=()=>T(v.current=N),x.onerror=()=>!v.current&&h(!0),x.src=N,()=>{x.onload=x.onerror=null}},[N]),f||!S?null:o.jsx("img",{className:"board-thumb",src:S,alt:"",decoding:"async",draggable:!1,onLoad:x=>{var C;x.currentTarget.classList.add("loaded"),(C=x.currentTarget.parentElement)==null||C.classList.remove("loading")}})}function Y0(a){const i=w.useRef(null),r=w.useRef(!0);return w.useEffect(()=>{if(r.current){r.current=!1;return}const f=i.current,h=f==null?void 0:f.contentWindow;if(!f||!h)return;const p=h.document,y=[];p.querySelectorAll("*").forEach((v,x)=>{(v.scrollTop||v.scrollLeft)&&y.push([x,v.scrollTop,v.scrollLeft])});const N=h.scrollX,S=h.scrollY,T=()=>{f.removeEventListener("load",T);const v=f.contentWindow;v.scrollTo(N,S);const x=v.document.querySelectorAll("*");for(const[C,O,X]of y){const ee=x[C];ee&&(ee.scrollTop=O,ee.scrollLeft=X)}f.dispatchEvent(new CustomEvent("dc-reloaded"))};f.addEventListener("load",T),h.location.reload()},[a.reloadKey]),o.jsx("iframe",{ref:f=>{i.current=f,a.iframeRef(f)},src:a.html==null?a.src:void 0,srcDoc:a.html??void 0,title:a.title,onLoad:a.onLoad,style:{pointerEvents:a.interactive?"auto":"none"}})}const q0=w.memo(function(i){const{note:r,h:f,id:h}=i,p=(Q,q)=>f.moveNote(h,Q,q),y=ah(i.zoom),[N,S]=w.useState(!1),T=w.useRef(null);w.useEffect(()=>{if(N&&T.current){T.current.focus();const Q=document.createRange();Q.selectNodeContents(T.current);const q=getSelection();q==null||q.removeAllRanges(),q==null||q.addRange(Q)}},[N]);const v=w.useRef(!1),x=w.useRef(!1),C=Q=>{S(!1);const q=Q.innerText;q!==r.text&&p({text:q},!0)},O=r.size??(r.kind==="title"?72:22),[X,ee]=w.useState(O);w.useLayoutEffect(()=>{const Q=T.current;if(!Q||r.kind!=="title"||N)return ee(O);let q=O;Q.style.fontSize=`${q}px`;const I=r.maxW??4e3,ce=r.maxH||1/0;for(let se=0;se<40&&q>12&&(Q.scrollWidth>I+1||Q.scrollHeight>ce+1);se++)q=Math.max(12,Math.floor(q*.92)),Q.style.fontSize=`${q}px`;ee(q)},[r.text,O,r.maxW,r.maxH,r.kind,N]);const k=ah(i.zoom),$=r.kind==="title"?{left:r.x,top:r.y,maxWidth:r.maxW??4e3,maxHeight:r.maxH||void 0}:{left:r.x,top:r.y,width:r.w??320,height:r.h||void 0,background:b0(r.color)},J={fontSize:X,fontWeight:r.bold??r.kind==="title"?700:400,fontStyle:r.italic?"italic":void 0};return r.kind==="title"&&X*i.zoom<12&&Object.assign($,{transform:`scale(${12/(X*i.zoom)})`,transformOrigin:"0 0"}),o.jsxs("div",{className:`note note-${r.kind} ${i.selected?"selected":""} ${i.readOnly?"read-only":""}`,"data-note":i.id,style:$,onPointerDown:Q=>{N||Q.button!==0||i.readOnly||(Q.stopPropagation(),Q.shiftKey?f.selectNote(h,!0):i.selected||f.selectNote(h,!1),y.start(Q,{x:r.x,y:r.y},(q,I)=>p({x:Math.round(q.x),y:Math.round(q.y)},I)))},onPointerMove:y.move,onPointerUp:y.end,onDoubleClick:Q=>{Q.stopPropagation(),i.readOnly||S(!0)},onContextMenu:Q=>{Q.preventDefault(),Q.stopPropagation(),!i.readOnly&&(f.selectNote(h,!1),f.contextNote(h,Q))},children:[o.jsx("div",{ref:T,className:"note-text",style:J,contentEditable:N,suppressContentEditableWarning:!0,onCompositionStart:()=>v.current=!0,onCompositionEnd:Q=>{v.current=!1,x.current&&(x.current=!1,C(Q.currentTarget))},onBlur:Q=>{v.current?x.current=!0:C(Q.currentTarget)},onKeyDown:Q=>{Q.nativeEvent.isComposing||Q.key==="Escape"&&Q.currentTarget.blur()},children:r.text}),i.selected&&i.zoom>=.2&&!N&&o.jsx("div",{className:"note-resize",role:"slider","aria-label":r.kind==="title"?u.canvas.titleMaxWidth:u.canvas.stickySize,style:{width:12/i.zoom,height:12/i.zoom,right:-6/i.zoom,bottom:-6/i.zoom,borderWidth:1.5/i.zoom},onPointerDown:Q=>{if(Q.button!==0)return;Q.stopPropagation();const q=Q.currentTarget.parentElement.getBoundingClientRect(),I=q.width/i.zoom,ce=q.height/i.zoom;k.start(Q,{x:I,y:ce},(se,P)=>p(r.kind==="title"?{maxW:Math.max(80,Math.round(se.x))}:{w:Math.max(80,Math.round(se.x)),h:Math.max(60,Math.round(se.y))},P))},onPointerMove:k.move,onPointerUp:k.end}),i.selected&&!N&&i.zoom>=.2&&o.jsx("button",{className:"note-del icon-btn","aria-label":u.canvas.deleteNote,style:{transform:`scale(${1/i.zoom})`},onPointerDown:Q=>Q.stopPropagation(),onClick:Q=>{Q.stopPropagation(),f.deleteNote(h)},children:o.jsx(ne,{name:"close",size:14})})]})});function ah(a){const i=w.useRef(null);return{start(r,f,h){i.current={sx:r.clientX,sy:r.clientY,ox:f.x,oy:f.y,cb:h,moved:!1},r.currentTarget.setPointerCapture(r.pointerId)},move(r){const f=i.current;if(!f)return;const h=(r.clientX-f.sx)/a,p=(r.clientY-f.sy)/a;!f.moved&&Math.abs(h)+Math.abs(p)<2/a||(f.moved=!0,f.cb({x:f.ox+h,y:f.oy+p},!1))},end(r){const f=i.current;i.current=null,!(!f||!f.moved)&&f.cb({x:f.ox+(r.clientX-f.sx)/a,y:f.oy+(r.clientY-f.sy)/a},!0)}}}function ty(a,i,r){let f=null;for(const h of a)for(const p of i){const y=p-h;Math.abs(y)<=r&&(!f||Math.abs(y)<Math.abs(f.d))&&(f={d:y,at:p})}return f}const Oy=a=>{const i=Math.min(...a.map(f=>f.x)),r=Math.min(...a.map(f=>f.y));return{x:i,y:r,w:Math.max(...a.map(f=>f.x+f.w))-i,h:Math.max(...a.map(f=>f.y+f.h))-r}},Yf=(a,i)=>a.x<i.x+i.w&&a.x+a.w>i.x&&a.y<i.y+i.h&&a.y+a.h>i.y,V0=a=>({x:Math.round(a.x),y:Math.round(a.y),w:Math.round(a.w),h:Math.round(a.h)});function so(a,i,r){return Math.min(r,Math.max(i,a))}function Dy(a){const i=a.target;return i?i.tagName==="INPUT"?!/^(checkbox|radio|button|range|color)$/.test(i.type):i.isContentEditable||/^(TEXTAREA|SELECT)$/.test(i.tagName):!1}function us(a,i,r=60,f){if(!a.length)return{x:0,y:0,zoom:1};(i.w<100||i.h<100)&&(i={w:window.innerWidth,h:Math.max(200,window.innerHeight)});const h=f&&f.w>=100&&f.h>=100?f:{x:0,y:0,w:i.w,h:i.h};r=Math.min(r,h.w*.08,h.h*.08);const p=Oy(a),y=so(Math.min((h.w-r*2)/p.w,(h.h-r*2)/p.h),fh,hh);return{zoom:y,x:Math.round(h.x+r-p.x*y+(h.w-r*2-p.w*y)/2),y:Math.round(h.y+r-p.y*y+(h.h-r*2-p.h*y)/2)}}function X0(a){const[i,r]=w.useState(null),f=w.useCallback(()=>Ce.get("/api/assets").then(h=>r(h.assets)).catch(()=>r([])),[]);return w.useEffect(()=>{f()},[f,a]),{list:i,reload:f}}async function lh(a){const i=[];for(const r of Array.from(a)){const f=await new Promise(h=>{const p=new FileReader;p.onload=()=>h(String(p.result).split(",")[1]??""),p.readAsDataURL(r)});i.push(await Ce.post("/api/assets",{name:r.name,data:f}))}return i}const K0=a=>a>1024*1024?`${(a/1024/1024).toFixed(1)}MB`:`${Math.max(1,Math.round(a/1024))}KB`;function Ry(a){const{list:i,reload:r}=X0(a.version),[f,h]=w.useState(!1),[p,y]=w.useState(!1),N=async T=>{var v;h(!0);try{const x=await lh(T);await r(),(v=a.onUploaded)==null||v.call(a,x)}catch(x){a.onError(x.message)}finally{h(!1)}},S=(i??[]).filter(T=>!a.only||T.kind===a.only);return o.jsxs("div",{className:`assets ${p?"over":""}`,onDragOver:T=>{T.preventDefault(),y(!0)},onDragLeave:()=>y(!1),onDrop:T=>{T.preventDefault(),y(!1),T.dataTransfer.files.length&&N(T.dataTransfer.files)},children:[o.jsxs("label",{className:"upload",children:[o.jsx(ne,{name:"plus",size:14})," ",f?u.assets.uploading:u.assets.upload,o.jsx("input",{type:"file",hidden:!0,multiple:!0,accept:"image/*,.woff,.woff2,.ttf,.otf",onChange:T=>T.target.files&&void N(T.target.files)})]}),i==null?o.jsxs("p",{className:"empty",children:[o.jsx("span",{className:"spinner","aria-hidden":"true"})," ",u.assets.loading]}):S.length===0?o.jsx("p",{className:"empty",children:u.assets.empty}):o.jsx("ul",{className:"asset-grid",children:S.map(T=>o.jsx("li",{children:o.jsxs("button",{className:"asset",title:`${T.ref} · ${K0(T.size)}${a.onPick?"":u.assets.copyPath}`,"aria-label":`${T.name}${a.pickLabel??""}`,onClick:()=>a.onPick?a.onPick(T):void navigator.clipboard.writeText(T.ref).catch(()=>{}),children:[T.kind==="image"?o.jsx("img",{src:T.url,alt:"",loading:"lazy"}):o.jsx("span",{className:"asset-font",children:T.kind==="font"?"Aa":u.assets.file}),o.jsx("span",{className:"asset-name",children:T.name})]})},T.name))})]})}function Z0({open:a,version:i,onClose:r,onPick:f,onError:h}){return w.useEffect(()=>{if(!a)return;const p=y=>y.key==="Escape"&&r();return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[a,r]),a?o.jsx("div",{className:"dialog-backdrop",onPointerDown:p=>p.target===p.currentTarget&&r(),children:o.jsxs("div",{className:"dialog wide",role:"dialog","aria-modal":"true","aria-label":u.assets.pickImage,children:[o.jsx("h2",{children:u.assets.pickImage}),o.jsx(Ry,{version:i,only:"image",pickLabel:u.assets.pickLabel,onPick:f,onError:h,onUploaded:p=>p[0]&&p[0].kind==="image"&&f(p[0])}),o.jsx("div",{className:"dialog-actions",children:o.jsx("button",{onClick:r,children:u.assets.close})})]})}):null}var qf=Ty();function ny({label:a,src:i,empty:r,w:f,h}){const p=w.useRef(null),[y,N]=w.useState(0);return w.useEffect(()=>{const S=p.current;if(!S)return;const T=()=>N(Math.min(1,(S.clientWidth-16)/f,(S.clientHeight-16)/h));T();const v=new ResizeObserver(T);return v.observe(S),()=>v.disconnect()},[f,h]),o.jsxs("figure",{className:"cmp-pane",children:[o.jsx("figcaption",{children:a}),o.jsx("div",{className:"cmp-stage",ref:p,children:i?o.jsx("div",{className:"cmp-frame",style:{width:f*y,height:h*y},children:y>0&&o.jsx("iframe",{title:a,src:i,style:{width:f,height:h,transform:`scale(${y})`}})}):o.jsx("p",{className:"muted",children:r})})]})}const Q0=a=>i=>`/api/chat/run-file?id=${encodeURIComponent(a)}&f=${encodeURIComponent(`screens/${i}`)}`,F0=a=>i=>`/api/history/step-file?id=${encodeURIComponent(a)}&f=${encodeURIComponent(i)}`;function $y({before:a,boards:i,onClose:r,notBefore:f=u.compare.notBefore}){const[h,p]=w.useState(()=>Math.max(0,i.findIndex(S=>S.kind==="changed"))),y=i[h];if(!y)return null;const N=S=>S.split("/").map(encodeURIComponent).join("/");return o.jsx("div",{className:"dialog-backdrop",onPointerDown:S=>S.target===S.currentTarget&&r(),children:o.jsxs("div",{className:"dialog cmp",role:"dialog","aria-modal":"true","aria-label":u.compare.title(y.title),onKeyDown:S=>S.key==="Escape"&&r(),children:[o.jsxs("div",{className:"cmp-head",children:[o.jsx("h2",{children:u.compare.title(y.title)}),o.jsx("button",{className:"icon-btn sm","aria-label":u.compare.close,title:u.compare.close,autoFocus:!0,onClick:r,children:o.jsx(ne,{name:"close",size:14})})]}),i.length>1&&o.jsx("div",{className:"chips",role:"tablist","aria-label":u.compare.boards,children:i.map((S,T)=>o.jsx("button",{role:"tab","aria-selected":T===h,className:`chip cmp-tab ${T===h?"on":""}`,onClick:()=>p(T),children:S.kind==="added"?u.chat.chipNew(S.title):S.title},S.file))}),o.jsxs("div",{className:"cmp-panes",children:[o.jsx(ny,{label:u.compare.before,src:y.kind==="added"?null:a(y.file),empty:f,w:y.w,h:y.h},`b-${y.file}`),o.jsx(ny,{label:u.compare.after,src:y.kind==="removed"?null:`/screens/${N(y.file)}`,empty:u.compare.notAfter,w:y.w,h:y.h},`a-${y.file}`)]})]})})}const J0=/^ {0,3}(`{3,}|~{3,})\s*([\w#+.-]*)/,I0=/^ {0,3}(#{1,6})\s+(.*?)\s*#*\s*$/,pc=/^(\s*)([-*+]|\d{1,9}[.)])\s+(.*)$/,W0=/^ {0,3}([-*_])(\s*\1){2,}\s*$/,P0=a=>/^https?:\/\/[^\s<>"]+$/i.test(a)?a:null;function ex(a){const i=String(a??"").replace(/\r\n?/g,`
57
+ `).split(`
58
+ `),r=[];let f=[];const h=()=>{f.length&&r.push({t:"p",c:ds(f.join(`
59
+ `))}),f=[]};for(let p=0;p<i.length;p++){const y=i[p],N=J0.exec(y);if(N){h();const T=N[1],v=[];let x=!0;for(p++;p<i.length;p++){if(new RegExp(`^ {0,3}${T[0]==="`"?"`":"~"}{${T.length},}\\s*$`).test(i[p])){x=!1;break}v.push(i[p])}r.push({t:"code",lang:N[2]??"",v:v.join(`
60
+ `),open:x});continue}if(!y.trim()){h();continue}const S=I0.exec(y);if(S){h(),r.push({t:"h",level:S[1].length,c:ds(S[2])});continue}if(W0.test(y)&&!f.length){r.push({t:"hr"});continue}if(pc.test(y)&&(!f.length||!/^\s/.test(y))){h(),p=tx(i,p,r)-1;continue}f.push(y.trim())}return h(),r}const fc=a=>/\d/.test(a)?"ol":"ul";function tx(a,i,r){var S;const f=pc.exec(a[i]),h=f[1].length,p={t:fc(f[2]),start:fc(f[2])==="ol"?parseInt(f[2],10):1,items:[]},y=[],N=[];for(;i<a.length;i++){const T=a[i];if(!T.trim()){const C=a.slice(i+1).find(O=>O.trim());if(C&&pc.test(C)&&pc.exec(C)[1].length>=h)continue;break}const v=pc.exec(T);if(v&&v[1].length<=h+1){if(fc(v[2])!==p.t)break;p.items.push({c:[]}),y.push([v[3]]),N.push({list:{t:"ul",start:1,items:[]},texts:[]});continue}if(!p.items.length)break;const x=N[N.length-1];if(v){x.list.items.length||(x.list={t:fc(v[2]),start:fc(v[2])==="ol"?parseInt(v[2],10):1,items:[]}),x.list.items.push({c:[]}),x.texts.push([v[3]]);continue}if(!/^\s/.test(T)&&!((S=a[i-1])!=null&&S.trim()))break;(x.texts.length?x.texts[x.texts.length-1]:y[y.length-1]).push(T.trim())}return p.items.forEach((T,v)=>{T.c=ds(y[v].join(`
61
+ `));const x=N[v];x.list.items.length&&(x.list.items.forEach((C,O)=>C.c=ds(x.texts[O].join(`
62
+ `))),T.sub=x.list)}),r.push(p),i}function ds(a){const i=[];let r="";const f=p=>{r&&i.push({t:"text",v:r}),r="",i.push(p)};let h=0;for(;h<a.length;){const p=a[h];if(p==="\\"&&h+1<a.length&&/[\\`*_[\]()#+\-.!>~|]/.test(a[h+1])){r+=a[h+1],h+=2;continue}if(p===`
63
+ `){f({t:"br"}),h++;continue}if(p==="`"){let y=1;for(;a[h+y]==="`";)y++;const N="`".repeat(y),S=a.indexOf(N,h+y);if(S>h){const T=a.slice(h+y,S);f({t:"code",v:T.length>2&&T.startsWith(" ")&&T.endsWith(" ")?T.slice(1,-1):T}),h=S+y;continue}r+=N,h+=y;continue}if((p==="*"||p==="_")&&a[h+1]===p){const y=a.indexOf(p+p,h+2);if(y>h+2&&a[h+2]!==" "){f({t:"b",c:ds(a.slice(h+2,y))}),h=y+2;continue}}else if(p==="*"||p==="_"){const y=p==="*"||!/\w/.test(a[h-1]??"");let N=-1;for(let S=h+1;S<a.length;S++)if(a[S]===p&&a[S+1]!==p&&a[S-1]!==" "&&(p==="*"||!/\w/.test(a[S+1]??""))){N=S;break}if(y&&N>h+1&&a[h+1]!==" "&&!a.slice(h+1,N).includes(`
64
+ `)){f({t:"i",c:ds(a.slice(h+1,N))}),h=N+1;continue}}if(p==="["){const y=/^\[([^\]\n]*)\]\(([^)\s]*)\)/.exec(a.slice(h));if(y){const N=P0(y[2]),S=ds(y[1]);if(N)f({t:"a",href:N,c:S});else for(const T of S)T.t==="text"?r+=T.v:f(T);h+=y[0].length;continue}}if((p==="h"||p==="H")&&!/\w/.test(a[h-1]??"")){const y=/^https?:\/\/[^\s<>"`]+/i.exec(a.slice(h));if(y){const N=y[0].replace(/[.,;:!?)\]'"]+$/,"");f({t:"a",href:N,c:[{t:"text",v:N}]}),h+=N.length;continue}}r+=p,h++}return r&&i.push({t:"text",v:r}),i}function io({c:a}){return o.jsx(o.Fragment,{children:a.map((i,r)=>i.t==="text"?i.v:i.t==="code"?o.jsx("code",{className:i.v.length>24?"long":void 0,children:i.v},r):i.t==="b"?o.jsx("strong",{children:o.jsx(io,{c:i.c})},r):i.t==="i"?o.jsx("em",{children:o.jsx(io,{c:i.c})},r):i.t==="a"?o.jsx("a",{href:i.href,target:"_blank",rel:"noopener noreferrer",children:o.jsx(io,{c:i.c})},r):o.jsx("br",{},r))})}function By({list:a}){const i=a.items.map((r,f)=>o.jsxs("li",{children:[o.jsx(io,{c:r.c}),r.sub&&o.jsx(By,{list:r.sub})]},f));return a.t==="ol"?o.jsx("ol",{start:a.start,children:i}):o.jsx("ul",{children:i})}function nx({v:a}){const[i,r]=w.useState(!1);return o.jsxs("div",{className:"codeblock",children:[o.jsxs("button",{className:"copy",onClick:()=>{var f;return void((f=navigator.clipboard)==null?void 0:f.writeText(a).then(()=>{r(!0),window.setTimeout(()=>r(!1),1500)}))},children:[o.jsx(ne,{name:"copy",size:12})," ",i?u.chat.copied:u.chat.copy]}),o.jsx("pre",{children:o.jsx("code",{children:a})})]})}const ax=({b:a})=>a.t==="p"?o.jsx("p",{children:o.jsx(io,{c:a.c})}):a.t==="h"?o.jsx("p",{className:`md-h h${Math.min(a.level,3)}`,role:"heading","aria-level":a.level,children:o.jsx(io,{c:a.c})}):a.t==="code"?o.jsx(nx,{v:a.v}):a.t==="hr"?o.jsx("hr",{}):o.jsx(By,{list:a});function lx({text:a,className:i=""}){const r=w.useMemo(()=>ex(a),[a]);return o.jsx("div",{className:`md ${i}`,children:r.map((f,h)=>o.jsx(ax,{b:f},h))})}const _y=w.createContext(()=>{}),Hy=()=>w.useContext(_y);function ix({children:a}){const[i,r]=w.useState([]),f=w.useCallback(h=>{const p=Date.now()+Math.random();r(y=>[...y.slice(-3),{...h,id:p}]),setTimeout(()=>r(y=>y.filter(N=>N.id!==p)),h.ms??(h.tone==="error"?6e3:3200))},[]);return o.jsxs(_y.Provider,{value:f,children:[a,o.jsx("div",{className:"toasts",role:"status","aria-live":"polite",children:i.map(h=>o.jsxs("div",{className:`toast ${h.tone??"info"}`,children:[h.tone==="error"?o.jsx(ne,{name:"warn"}):h.tone==="ok"?o.jsx(ne,{name:"check"}):null,h.dot&&o.jsx("span",{className:"toast-dot","aria-hidden":"true"}),o.jsx("span",{children:h.text}),h.code&&o.jsx("code",{className:"toast-code",children:h.code}),h.action&&o.jsx("button",{className:"toast-action",onClick:()=>{h.action.run(),r(p=>p.filter(y=>y.id!==h.id))},children:h.action.label}),h.close&&o.jsx("button",{className:"icon-btn oc-ib toast-close","aria-label":h.close.label,title:h.close.label,onClick:()=>{var p,y;(y=(p=h.close).run)==null||y.call(p),r(N=>N.filter(S=>S.id!==h.id))},children:o.jsx(ne,{name:"close",size:16})})]},h.id))})]})}function sx({menu:a,onClose:i,head:r}){const f=w.useRef(null),[h,p]=w.useState({x:0,y:0}),[y,N]=w.useState(-1);if(w.useLayoutEffect(()=>{if(!a||!f.current)return;const v=f.current.getBoundingClientRect(),x=a.right?a.x-v.width:a.x,C=a.up?a.y-v.height:a.y;p({x:Math.round(Math.max(8,Math.min(x,window.innerWidth-v.width-8))),y:Math.round(Math.max(8,Math.min(C,window.innerHeight-v.height-8)))}),N(-1),f.current.focus()},[a]),w.useEffect(()=>{if(!a)return;const v=x=>{f.current&&x.target instanceof Node&&f.current.contains(x.target)||i()};return window.addEventListener("pointerdown",v,!0),window.addEventListener("blur",i),()=>{window.removeEventListener("pointerdown",v,!0),window.removeEventListener("blur",i)}},[a,i]),!a)return null;const S=a.items,T=S.map((v,x)=>v!=="sep"&&!v.disabled?x:-1).filter(v=>v>=0);return o.jsxs("div",{ref:f,className:`menu entering ${a.className??""}`,role:"menu",tabIndex:-1,"aria-label":a.title??u.dialog.menu,style:{left:h.x,top:h.y},onKeyDown:v=>{if(v.key==="Escape")i();else if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const x=T.indexOf(y),C=v.key==="ArrowDown"?T[(x+1)%T.length]:T[(x-1+T.length)%T.length];N(C)}else if(v.key==="Enter"&&y>=0){const x=S[y];x!=="sep"&&(i(),x.run())}},children:[a.title&&o.jsx("div",{className:"menu-title",children:a.title}),r??a.head,S.map((v,x)=>v==="sep"?o.jsx("div",{className:"menu-sep",role:"separator"},x):o.jsxs("button",{role:v.check===void 0?"menuitem":"menuitemcheckbox","aria-checked":v.check===void 0?void 0:v.check,className:`menu-item ${y===x?"active":""} ${v.danger?"danger":""}`,disabled:v.disabled,onMouseEnter:()=>N(x),onClick:()=>{i(),v.run()},children:[o.jsx("span",{className:"menu-icon",children:v.icon&&o.jsx(ne,{name:v.icon,size:16})}),o.jsx("span",{className:"menu-label",children:v.label}),v.check!==void 0&&o.jsx("span",{className:`menu-check ${v.check?"on":""}`,"aria-hidden":"true",children:o.jsx(ne,{name:"check",size:14})}),v.shortcut&&o.jsx("kbd",{children:v.shortcut})]},x))]})}function ox({state:a,onClose:i}){const[r,f]=w.useState(""),[h,p]=w.useState(!1),y=w.useRef(null),N=w.useRef(null);if(w.useEffect(()=>{var v;a&&(a.kind==="prompt"?(f(a.value),p(((v=a.extra)==null?void 0:v.checked)??!1),setTimeout(()=>{var x;return(x=y.current)==null?void 0:x.select()},0)):setTimeout(()=>{var x;return(x=N.current)==null?void 0:x.focus()},0))},[a]),!a)return null;const S=()=>{a.kind==="prompt"?a.resolve(null):a.resolve(!1),i()},T=()=>{a.kind==="prompt"?a.resolve({value:r,extra:h}):a.resolve(!0),i()};return o.jsx("div",{className:"dialog-backdrop",onPointerDown:v=>v.target===v.currentTarget&&S(),children:o.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true","aria-label":a.title,onKeyDown:v=>{v.key==="Escape"&&S(),v.key==="Enter"&&!v.nativeEvent.isComposing&&T()},children:[o.jsx("h2",{children:a.title}),a.kind==="prompt"?o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"dialog-field",children:[a.label&&o.jsx("span",{children:a.label}),o.jsx("input",{ref:y,value:r,onChange:v=>f(v.target.value)})]}),a.hint&&o.jsx("p",{className:"muted",children:a.hint}),a.extra&&o.jsxs("label",{className:"check",children:[o.jsx("input",{type:"checkbox",checked:h,onChange:v=>p(v.target.checked)}),a.extra.label]})]}):o.jsx("p",{children:a.body}),o.jsxs("div",{className:"dialog-actions",children:[o.jsx("button",{onClick:S,children:u.dialog.cancel}),o.jsx("button",{ref:N,className:a.kind==="confirm"&&a.danger?"danger primary":"primary",onClick:T,children:a.ok})]})]})})}function cx(){const[a,i]=w.useState(null);return{state:a,close:()=>i(null),prompt:h=>new Promise(p=>i({kind:"prompt",value:h.value??"",ok:h.ok??u.dialog.ok,...h,resolve:p})),confirm:h=>new Promise(p=>i({kind:"confirm",ok:h.ok??u.dialog.ok,...h,resolve:p}))}}const ay=a=>`design-canvas:open:${a}`;function ao({id:a,title:i,count:r,defaultOpen:f=!1,right:h,variant:p="head",children:y}){const[N,S]=w.useState(()=>{try{const C=localStorage.getItem(ay(a));return C==null?f:C==="1"}catch{return f}}),T=()=>{S(C=>{try{localStorage.setItem(ay(a),C?"0":"1")}catch{}return!C})},x=r!==void 0&&r!==""&&o.jsx("span",{className:`collapsible-count ${typeof r=="string"?"oc-off":""}`,children:r});return p==="row"?o.jsxs("div",{className:`pp-foldset ${N?"open":""}`,children:[o.jsxs("button",{className:"pp-fold","aria-expanded":N,"aria-controls":`sec-${a}`,onClick:T,children:[o.jsx("span",{className:"pp-l",children:i}),o.jsxs("span",{className:"pp-v",children:[x,o.jsx(ne,{name:"chevronRight",size:14,className:"chev"})]})]}),N&&o.jsx("div",{className:"pp-fold-body",id:`sec-${a}`,children:y})]}):o.jsxs("section",{className:`pp-group collapsible ${N?"open":""}`,children:[o.jsxs("div",{className:"collapsible-head",children:[o.jsxs("button",{className:"pp-fold-h","aria-expanded":N,"aria-controls":`sec-${a}`,onClick:T,children:[o.jsx(ne,{name:"chevronRight",size:14,className:"chev"}),o.jsx("span",{className:"collapsible-title",children:i}),x]}),h&&o.jsx("span",{className:"collapsible-right",children:h})]}),N&&o.jsx("div",{className:"pp-fold-body",id:`sec-${a}`,children:y})]})}function Qa(a,i="button"){var y;if(!a)return;const r=Array.from(a.querySelectorAll(i)),f=`${window.innerWidth}|${(y=document.fonts)==null?void 0:y.status}|${r.map(N=>`${N.className}${N.textContent}`).join("")}`,h=Vf.get(a);if(h&&h.key===f&&h.els.length===r.length&&h.els.every((N,S)=>N===r[S]))return;for(const N of r)N.style.width="";const p=r.map(N=>N.getBoundingClientRect().width);r.forEach((N,S)=>{p[S]%1>.01&&(N.style.width=`${Math.ceil(p[S])}px`)}),p.some(N=>N===0)?Vf.delete(a):Vf.set(a,{key:f,els:r})}const Vf=new WeakMap;function Uy(a,i){const[r,f]=w.useState(null);return w.useLayoutEffect(()=>{const h=a.current;if(!h)return;Qa(h);const p=Math.max(8,Math.round((i-h.offsetWidth)/2));p!==r&&f(p)}),r}const lo={claude:"Claude Code",codex:"Codex",cursor:"Cursor Agent",gemini:"Gemini CLI"},rx=Object.entries(lo).map(([a,i])=>({id:a,label:i,ok:!0})),ux={claude:"claude",codex:"codex",cursor:"cursor-agent",gemini:"gemini"},ly={claude:"claude auth login",codex:"codex login",cursor:"cursor-agent login",gemini:"gemini"},dx={claude:"npm install -g @anthropic-ai/claude-code",codex:"npm install -g @openai/codex",cursor:"curl https://cursor.com/install -fsS | bash",gemini:"npm install -g @google/gemini-cli"},fx={claude:["opus","sonnet","haiku"],codex:[],cursor:[],gemini:["gemini-2.5-pro","gemini-2.5-flash"]},nu={changed:0,added:1,removed:2},hx=a=>lo[a]?`var(--agent-${a})`:"var(--line-strong)",iy=(a,i)=>{try{const r=localStorage.getItem(a);return r==null?i:JSON.parse(r)}catch{return i}},sy=(a,i)=>{try{localStorage.setItem(a,JSON.stringify(i))}catch{}},oy=a=>new Date(a).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"}),cy=a=>new Date(a).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}),mx=a=>(a.split(/[\\/]/).filter(Boolean).pop()??a)+"/";function Xf({text:a}){return o.jsx(o.Fragment,{children:a.split("`").map((i,r)=>r%2?o.jsx("code",{children:i},r):i)})}function Kf(a,i){const r=[...a.parts],f=r[r.length-1],h={...a};if(i.kind==="delta")(f==null?void 0:f.t)==="text"?r[r.length-1]={t:"text",text:f.text+i.text}:r.push({t:"text",text:i.text});else if(i.kind==="break")(f==null?void 0:f.t)==="text"&&f.text&&r.push({t:"text",text:""});else if(i.kind==="text")r.push({t:"text",text:i.text});else if(i.kind==="plain")(f==null?void 0:f.t)==="plain"?r[r.length-1]={t:"plain",text:`${f.text}
65
+ ${i.text}`}:r.push({t:"plain",text:i.text});else if(i.kind==="tool")r.push({t:"tool",name:i.name,detail:i.detail});else if(i.kind==="permission"){const{kind:p,...y}=i,N=r.findIndex(S=>S.t==="perm"&&S.id===i.id);N>=0?r[N]={...r[N],...y}:r.push({t:"perm",...y})}else if(i.kind==="permission-answered"){const p=r.findIndex(y=>y.t==="perm"&&y.id===i.id);p>=0&&(r[p]={...r[p],decision:i.decision})}else if(i.kind==="error"&&i.cause){for(let p=r.length-1;p>=0;p--)r[p].t==="error"&&r.splice(p,1);r.push({t:"error",text:i.text,cause:i.cause,raw:i.raw,changed:i.changed})}else i.kind==="error"?r.push({t:"error",text:i.text}):i.kind==="done"?h.cost=i.cost:i.kind==="start"?h.variants=i.variants:i.kind==="run-undo"?h.undone=i.undone:i.kind==="end"&&(h.status=i.status,h.step=i.step,h.boards=i.boards);return h.parts=r.filter(p=>p.t!=="text"&&p.t!=="plain"||p.text),h}function gx(a){const[i,r]=w.useState([]),[f,h]=w.useState(!1),[p,y]=w.useState(null),[N,S]=w.useState(!1),[T,v]=w.useState(null),[x,C]=w.useState(!1),[O,X]=w.useState(()=>iy("design-canvas:models",{})),[ee,k]=w.useState(!1),[$,J]=w.useState(null),[Q,q]=w.useState(()=>{try{return localStorage.getItem("design-canvas:agent")??"claude"}catch{return"claude"}}),[I,ce]=w.useState([]),[se,P]=w.useState(null),[re,Se]=w.useState({}),[Ne,mt]=w.useState(!0),[Ct,_t]=w.useState(!0),[st,fe]=w.useState(!0),[ye,xe]=w.useState(1),[_e,ke]=w.useState(null),[xt,Ke]=w.useState(null),[Pe,D]=w.useState(null),[G,oe]=w.useState(null),[_,ge]=w.useState(!1),[je,He]=w.useState({}),[me,ve]=w.useState(null),[rt,Ea]=w.useState(null),[Xn,jn]=w.useState(null),[at,Le]=w.useState(null),xn=w.useRef(null),Mn=w.useRef(null),Kt=w.useRef(null),sn=w.useRef(null),B=w.useRef(null),K=w.useRef(null);K.current=se;const le=w.useRef(new Map),be=a.storeKey?`easel:chat:${a.storeKey}`:null,Be=w.useRef(0),Fe=w.useCallback((M=!1)=>{h(!0);const W=++Be.current;Ce.get("/api/agents").then(Me=>{W===Be.current&&(r(Me.agents),y({at:Me.checkedAt,onOpen:M}))}).catch(()=>{}).finally(()=>W===Be.current&&h(!1))},[]);w.useEffect(()=>{a.open&&Fe(!0)},[a.open,Fe]),w.useEffect(()=>{try{localStorage.setItem("design-canvas:agent",Q)}catch{}},[Q]),w.useEffect(()=>sy("design-canvas:models",O),[O]),w.useEffect(()=>{if(!N)return;const M=Me=>{const ue=Re=>Re.current&&Me.target instanceof Node&&Re.current.contains(Me.target);ue(Kt)||ue(sn)||S(!1)},W=()=>S(!1);return window.addEventListener("pointerdown",M,!0),window.addEventListener("resize",W),()=>{window.removeEventListener("pointerdown",M,!0),window.removeEventListener("resize",W)}},[N]),w.useEffect(()=>{var M,W;N&&((W=(M=sn.current)==null?void 0:M.querySelector('[aria-checked="true"], [role^="menuitem"]'))==null||W.focus())},[N]);const De=()=>{var M,W;S(!1),(W=(M=Kt.current)==null?void 0:M.querySelector(".agent-btn"))==null||W.focus()},Qe=M=>{if(M.key==="Escape")return De();if(M.key!=="Tab"||!sn.current)return;const W=Array.from(sn.current.querySelectorAll("button:not(:disabled), a[href]"));M.target===W[M.shiftKey?0:W.length-1]&&(M.preventDefault(),De())},Dt=M=>{const W=M.getBoundingClientRect();v({right:Math.round(window.innerWidth-W.right),top:Math.round(W.bottom+4)}),S(Me=>!Me)},Ht=(M,W)=>{var Me;(Me=navigator.clipboard)==null||Me.writeText(W).then(()=>{J(M),window.setTimeout(()=>J(ue=>ue===M?null:ue),1500)})},Rt=w.useRef(new Set),Wt=w.useRef(new Map),et=w.useRef(()=>{});w.useEffect(()=>a.subscribe((M,W)=>{if(W.kind==="boot")return D(W.boot);if(!Rt.current.has(M)){Wt.current.set(M,[...Wt.current.get(M)??[],W]);return}et.current(M,W)}),[a.subscribe]),et.current=(M,W)=>{if(ce(ue=>ue.map(Re=>Re.role==="ai"&&Re.id===M?Kf(Re,W):Re)),W.kind==="end"&&P(ue=>ue===M?null:ue),W.kind==="session"){const ue=I.find(Re=>Re.role==="ai"&&Re.id===M);ue&&Se(Re=>({...Re,[ue.agent]:W.id}))}W.kind==="error"&&(W.cause==="signin"||W.cause==="missing")&&Fe();const Me=le.current.get(M);W.kind==="end"&&W.status==="error"&&Me&&!a.draft.trim()&&!a.attach.comments.length&&!a.attach.refs.length&&(a.setDraft(Me.text),a.setAttach(()=>Me.attach),k(!0))},w.useEffect(()=>{Ce.get("/api/chat/runs?ids=").then(M=>D(W=>W??M.boot)).catch(()=>{})},[]),w.useEffect(()=>{var W;if(!be||_)return;const M=iy(be,null);(W=M==null?void 0:M.msgs)!=null&&W.length&&(ce(M.msgs),Se(M.sessions??{})),oe((M==null?void 0:M.boot)??null),ge(!0)},[be,_]),w.useEffect(()=>{_&&be&&sy(be,{msgs:I.slice(-100),sessions:re,boot:Pe??G})},[_,be,I,re,Pe,G]),w.useEffect(()=>{if(!_||!Pe)return;const M=!!G&&G!==Pe;oe(Pe),ce(ue=>{if(!M||!ue.length)return ue;const Re=ue.map($e=>$e.role==="ai"&&$e.status==="running"?{...$e,status:"cancelled"}:$e);return Re[Re.length-1].role==="restart"?Re:[...Re,{role:"restart",at:Pe}]});const W=I.filter(ue=>ue.role==="ai");for(const ue of W)ue.status==="running"&&!M&&!Rt.current.has(ue.id)&&Ce.get(`/api/chat?id=${encodeURIComponent(ue.id)}`).then(Re=>{Rt.current.add(ue.id),ce($e=>$e.map(Ge=>Ge.role==="ai"&&Ge.id===ue.id?Re.events.reduce(Kf,{...Ge,parts:[]}):Ge)),Re.events.some($e=>$e.kind==="end")||P(ue.id)});const Me=W.filter(ue=>ue.step).map(ue=>ue.id);Me.length&&Ce.get(`/api/chat/runs?ids=${Me.join(",")}`).then(ue=>He(Re=>({...Re,...ue.runs}))).catch(()=>{})},[_,Pe]),w.useEffect(()=>{const M=xn.current;M&&M.scrollHeight-M.scrollTop-M.clientHeight<160&&(M.scrollTop=M.scrollHeight)},[I]);const on=Ne?a.selection:null,wt=Ct?a.boards:[],St=wt.length===1||!wt.length&&!!on,Vt=i.length?i:rx,gt=Vt.find(M=>M.id===Q),cn=(gt==null?void 0:gt.label)??lo[Q]??Q,na=Q.startsWith("custom:"),Fa=O[Q]??"",Ba=(gt==null?void 0:gt.status)==="signin"?u.chat.sendNeedsSignin(cn):(gt==null?void 0:gt.status)==="missing"?u.chat.sendNeedsInstall(cn):null,_a=I.find(M=>M.role==="ai"&&M.id===se),Ha=!!(_a!=null&&_a.parts.some(M=>M.t==="perm"&&!M.decision)),rn=async(M=a.draft.trim(),W=a.attach)=>{if(!M||se||Ba)return;Ke(null);const Me=[...on?[u.chat.chipElement(on.tag)]:[],...wt.map(ue=>a.titleOf(ue)),...st&&a.visibleCount?[u.chat.chipVisible(a.visibleCount)]:[],...W.comments.map(ue=>u.chat.chipComment(ue.text.slice(0,16))),...W.refs.map(ue=>ue.name??ue.value),...ye>1?[u.chat.variants(ye)]:[]];try{const ue=await Ce.post("/api/chat",{agent:Q,text:M,model:na?void 0:Fa.trim()||void 0,resume:re[Q],variants:St?ye:0,attach:{selection:!!on,boards:wt,visible:st,comments:W.comments.map(Re=>Re.id),refs:W.refs}});le.current.set(ue.id,{text:M,attach:W}),k(!1),ce(Re=>[...Re,{role:"user",text:M,chips:Me},{role:"ai",id:ue.id,agent:Q,label:cn,parts:[],status:"running",boot:Pe??void 0}]),P(ue.id),Rt.current.add(ue.id);for(const Re of Wt.current.get(ue.id)??[])et.current(ue.id,Re);Wt.current.delete(ue.id),a.setDraft(""),a.setAttach(()=>({comments:[],refs:[]})),xe(1),ue.variants.length&&a.onLocate(ue.variants)}catch(ue){Ke(ue.message)}},Ln=()=>se&&Ce.post("/api/chat/cancel",{id:se}).catch(()=>{}),Zt=M=>{const W=le.current.get(M);a.draft.trim()||!W?rn():rn(W.text,W.attach)},Kn=(M,W)=>ce(Me=>Me.map(ue=>ue.role==="ai"&&ue.id===M?W(ue):ue)),hn=(M,W,Me)=>{Kn(M,ue=>Kf(ue,{kind:"permission-answered",id:W,decision:Me})),Ce.post("/api/chat/permission/answer",{id:W,decision:Me}).catch(ue=>Ke(ue.message))},Sl=async(M,W,Me)=>{var ue;Ea(M);try{await Ce.post(`/api/chat/${W}-run`,{id:M,mode:Me}),ve(null),Kn(M,Re=>({...Re,undone:W==="undo"}))}catch(Re){const $e=Re;$e.status===409&&((ue=$e.body)!=null&&ue.conflicts)?ve({id:M,kind:W,names:[...new Set($e.body.conflicts.map(Ge=>Ge.file.endsWith(".html")?a.titleOf(Ge.file):Ge.file))]}):Ke($e.message)}finally{Ea(null)}},Qt=async(M,W)=>{if(await a.confirm({title:u.chat.restoreTitle,body:u.chat.restoreBody(cy(W)),ok:u.chat.restoreOk,danger:!0}))try{await Ce.post("/api/chat/revert",{id:M.id}),Kn(M.id,Me=>({...Me,restored:!0}))}catch(Me){Ke(Me.message)}},Ja=M=>jn({id:M.id,boards:[...M.boards??[]].sort((W,Me)=>nu[W.kind]-nu[Me.kind]).map(W=>({...W,title:a.titleOf(W.file),...a.sizeOf(W.file)??{w:390,h:844}}))}),Ia=async()=>{if(at)try{const M=await Ce.post("/api/agents/custom",{name:at.name,command:at.command});r(W=>[...W.filter(Me=>Me.id!==M.agent.id),M.agent]),q(M.agent.id),Le(null)}catch(M){Le(W=>W&&{...W,error:M.message})}},Ua=async M=>{await Ce.post("/api/agents/custom",{action:"delete",id:M}).catch(()=>{}),r(W=>W.filter(Me=>Me.id!==M)),Q===M&&q("claude")},ma=M=>M.status?u.chat.agentStatus[M.status]:f?u.chat.checking:"",zn=(gt==null?void 0:gt.status)==="signin"?{text:u.chat.remedySignin(cn,ly[Q]??`${Q} login`),cmd:ly[Q]??`${Q} login`}:(gt==null?void 0:gt.status)==="missing"?{text:u.chat.remedyMissing(na?(gt.command??"").split(/\s+/)[0]:ux[Q]??Q),cmd:na?null:dx[Q]??Q}:null,aa=async M=>{for(const W of Array.from(M)){if(W.size>15*1024*1024){Ke(u.chat.tooBig(W.name));continue}const Me=await new Promise(ue=>{const Re=new FileReader;Re.onload=()=>ue(String(Re.result).split(",")[1]??""),Re.readAsDataURL(W)});try{const ue=await Ce.post("/api/refs",{name:W.name||u.defaults.pastedImage,data:Me});a.setAttach(Re=>({...Re,refs:[...Re.refs,ue]}))}catch(ue){Ke(ue.message)}}},Wa=M=>{const W=[...M.boards??[]].sort((ut,he)=>nu[ut.kind]-nu[he.kind]),Me=W.filter(ut=>ut.kind!=="added").length,ue=W.filter(ut=>ut.kind==="added").length,Re=u.chat.runChanged(Me,ue),$e=!!Pe&&!!M.boot&&M.boot!==Pe,Ge=je[M.id],Pt=(me==null?void 0:me.id)===M.id?me:null;if(M.restored)return o.jsx("div",{className:"run-result undone",children:o.jsx("div",{className:"oc-rr-top",children:o.jsxs("span",{className:"rr-line",children:[o.jsx(ne,{name:"restore",size:14})," ",u.chat.restoredCopy]})})});if($e)return o.jsxs("div",{className:"run-result",children:[o.jsx("div",{className:"oc-rr-top",children:o.jsx("span",{className:"rr-line",children:Re})}),Ge===void 0?null:Ge.copy?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"btn-row",children:o.jsxs("button",{className:"btn",onClick:()=>void Qt(M,Ge.copy.at),children:[o.jsx(ne,{name:"restore",size:14})," ",u.chat.restoreCopy]})}),o.jsx("p",{className:"sub",children:u.chat.savedAt(cy(Ge.copy.at))})]}):o.jsx("p",{className:"sub",children:u.chat.copyGone})]});const Zn=Pt&&o.jsxs("div",{className:"rr-conflict",role:"alert",children:[o.jsx("p",{children:(Pt.kind==="undo"?u.chat.conflictUndo:u.chat.conflictRedo)(Pt.names.join(", "))}),o.jsxs("div",{className:"btn-row",children:[o.jsx("button",{className:"btn",onClick:()=>void Sl(M.id,Pt.kind,"rest"),children:Pt.kind==="undo"?u.chat.undoRest:u.chat.redoRest}),o.jsx("button",{className:"btn danger",onClick:()=>void Sl(M.id,Pt.kind,"all"),children:Pt.kind==="undo"?u.chat.undoAll:u.chat.redoAll}),o.jsx("button",{className:"btn",onClick:()=>ve(null),children:u.chat.cancel})]})]});return M.undone?o.jsxs("div",{className:"run-result undone",children:[o.jsx("div",{className:"oc-rr-top",children:o.jsxs("span",{className:"rr-line",children:[o.jsx(ne,{name:"undo",size:14})," ",u.chat.runUndone(W.length)]})}),o.jsx("div",{className:"btn-row",children:o.jsxs("button",{className:"btn",disabled:rt===M.id||!!se,onClick:()=>void Sl(M.id,"redo"),children:[o.jsx(ne,{name:"redo",size:14})," ",u.chat.redo]})}),Zn]}):o.jsxs("div",{className:"run-result",children:[o.jsxs("div",{className:"oc-rr-top",children:[o.jsx("span",{className:"rr-line",children:Re}),W.map(ut=>ut.kind==="removed"?o.jsxs("span",{className:"chip",children:[o.jsx(ne,{name:"board",size:12})," ",u.chat.chipRemoved(a.titleOf(ut.file))]},ut.file):o.jsxs("button",{className:"chip",title:ut.file,onClick:()=>a.onLocate([ut.file]),children:[o.jsx(ne,{name:"board",size:12})," ",ut.kind==="added"?u.chat.chipNew(a.titleOf(ut.file)):a.titleOf(ut.file)]},ut.file))]}),o.jsxs("div",{className:"btn-row",children:[o.jsxs("button",{className:"btn",disabled:rt===M.id||!!se,onClick:()=>void Sl(M.id,"undo"),children:[o.jsx(ne,{name:"undo",size:14})," ",u.chat.undoRun]}),W.length>0&&o.jsxs("button",{className:"btn",onClick:()=>Ja(M),children:[o.jsx(ne,{name:"compare",size:14})," ",u.chat.compare]})]}),Zn]})},jl=(M,W)=>W.decision?o.jsxs("div",{className:"perm-done",title:W.subject,children:[o.jsx(ne,{name:W.decision==="deny"?"close":"check",size:14,className:W.decision==="deny"?"no":"ok"}),o.jsxs("span",{children:[u.chat.permDone[W.decision]," · ",W.tool," ",W.what==="tool"?null:o.jsx("code",{children:W.subject}),W.outside?` ${u.chat.permDoneOutside}`:""]})]}):o.jsxs("div",{className:"perm",role:"group","aria-label":u.chat.permAsk(M.label??lo[M.agent]??M.agent,W.what,W.tool),children:[o.jsxs("div",{className:"perm-head",children:[o.jsx("span",{className:"idot","aria-hidden":"true"}),u.chat.permAsk(M.label??lo[M.agent]??M.agent,W.what,W.tool)]}),o.jsx("div",{className:"perm-cmd",children:W.subject}),o.jsxs("div",{className:"perm-where",title:W.where,children:[o.jsx(ne,{name:"folder",size:14})," ",u.chat.permIn," ",o.jsx("code",{children:mx(W.where)}),W.outside&&o.jsxs("span",{className:"perm-outside",children:["· ",u.chat.permOutside]})]}),o.jsxs("div",{className:`btn-row ${W.rule?"":"oc-one"}`,children:[o.jsx("button",{className:"btn primary",onClick:()=>hn(M.id,W.id,"once"),children:u.chat.allowOnce}),W.rule&&o.jsx("button",{className:"btn",title:u.chat.alwaysAllowTitle,onClick:()=>hn(M.id,W.id,"always"),children:u.chat.alwaysAllow(W.rule)}),o.jsx("button",{className:"btn",onClick:()=>hn(M.id,W.id,"deny"),children:u.chat.deny})]})]}),fs=I.map(M=>M.role==="ai"?`${M.status}${M.undone?"u":""}${M.restored?"r":""}${M.parts.length}`:M.role).join(),Pa=w.useCallback(()=>{Qa(B.current,".chat-head .new-chat, .rr-line, .chip, .bubble, .btn-row .btn, .oc-variants, .run-status > *"),Qa(sn.current,".agent-status, .menu-foot .btn")},[]);w.useLayoutEffect(Pa,[Pa,fs,se,Q,N,a.open,a.attach,a.selection,a.boards,a.visibleCount,$,je,me,f,i,Ne,Ct,st]),w.useEffect(()=>{const M=B.current;if(!M)return;const W=new ResizeObserver(Pa);return W.observe(M),()=>W.disconnect()},[Pa]);const Gl=(M,W)=>{const Me=[];let ue=[],Re=0;const $e=()=>{ue.length&&Me.push(o.jsx("div",{className:"oc-tools",children:ue},`t${Re}`)),ue=[]};return M.parts.forEach((Ge,Pt)=>{if(Ge.t==="tool"||Ge.t==="perm"&&Ge.decision){ue.length||(Re=Pt);const Zn=M.status==="running"&&Pt===M.parts.length-1;ue.push(Ge.t==="tool"?o.jsxs("div",{className:`ai-tool ${Zn?"is-current":""}`,children:[o.jsx(ne,{name:"edit",size:14}),o.jsx("span",{children:Ge.name}),Ge.detail&&o.jsx("code",{children:Ge.detail})]},Pt):o.jsx(w.Fragment,{children:jl(M,Ge)},Pt));return}$e(),Me.push(Ge.t==="text"?o.jsx(lx,{className:"ai-text",text:Ge.text},Pt):Ge.t==="plain"?o.jsx("pre",{className:"ai-plain",children:Ge.text},Pt):Ge.t==="perm"?o.jsx(w.Fragment,{children:jl(M,Ge)},Pt):Ge.cause?o.jsxs("div",{className:"ai-fail",children:[o.jsx("div",{className:"ai-error",children:o.jsx("span",{children:o.jsx(Xf,{text:Ge.text})})}),W&&o.jsxs("div",{className:"btn-row",children:[o.jsx("button",{className:"btn",disabled:!!se||!!Ba,title:Ba??void 0,onClick:()=>Zt(M.id),children:u.chat.retry}),(()=>{const Zn=Vt.find(ut=>ut.id!==M.agent&&ut.status!=="missing"&&ut.ok&&!ut.custom);return Zn&&Zn.id!==Q?o.jsx("button",{className:"btn",onClick:()=>q(Zn.id),children:u.chat.switchTo(Zn.label)}):null})()]}),Ge.raw&&o.jsxs("details",{className:"ai-details",children:[o.jsxs("summary",{children:[o.jsx(ne,{name:"chevronDown",size:14}),u.chat.details]}),o.jsx("div",{className:"ai-details-bar",children:o.jsxs("button",{className:"btn copy",onClick:()=>Ht(`raw-${M.id}`,Ge.raw),children:[o.jsx(ne,{name:"copy",size:12})," ",$===`raw-${M.id}`?u.chat.copied:u.chat.copy]})}),o.jsx("pre",{children:Ge.raw})]}),Ge.changed===!1&&o.jsx("p",{className:"muted small",children:u.chat.noFilesChanged})]},Pt):o.jsxs("div",{className:"ai-error",children:[o.jsx(ne,{name:"warn",size:14})," ",Ge.text]},Pt))}),$e(),Me};return o.jsxs("section",{className:"chat","aria-label":u.chat.aria,ref:B,children:[o.jsxs("div",{className:`chat-head ${x?"is-scrolled":""}`,children:[o.jsxs("div",{className:"chat-head-row oc-field",children:[o.jsx("span",{className:"pp-l",children:u.chat.agent}),o.jsx("div",{className:"agent-pick",ref:Kt,children:o.jsxs("button",{className:`agent-btn ${N?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":N,"aria-label":u.chat.agentButton(cn,gt?ma(gt):""),title:u.chat.agentHint,disabled:!!se,onClick:M=>Dt(M.currentTarget),onKeyDown:M=>M.key==="Escape"&&S(!1),children:[o.jsx("span",{className:`dot ${(gt==null?void 0:gt.status)??""}`,"aria-hidden":"true"}),o.jsx("span",{className:"agent-name",children:cn}),o.jsx(ne,{name:"chevronDown",size:14})]})})]}),o.jsxs("div",{className:"chat-head-row oc-field",children:[o.jsx("span",{className:"pp-l",children:na?u.chat.customCommandLabel:u.chat.model}),na?o.jsx("span",{className:"model-field mono custom-cmd",title:gt==null?void 0:gt.command,children:gt==null?void 0:gt.command}):o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"model-field",list:`models-${Q}`,value:Fa,placeholder:u.chat.modelDefault,"aria-label":u.chat.model,title:u.chat.modelTitle(cn),disabled:!!se,spellCheck:!1,onChange:M=>X(W=>({...W,[Q]:M.target.value}))}),o.jsx("datalist",{id:`models-${Q}`,children:(fx[Q]??[]).map(M=>o.jsx("option",{value:M},M))})]})]}),o.jsxs("div",{className:"chat-head-row sub",children:[o.jsx("span",{className:"muted small",children:se?u.chat.running:re[Q]?u.chat.continuing:u.chat.newConversation}),o.jsx("div",{className:"spacer"}),o.jsxs("button",{className:"icon-btn sm new-chat","aria-label":u.chat.newChat,title:u.chat.newChat,disabled:!!se||!I.length&&!re[Q],onClick:()=>{ce([]),Se({}),k(!1),ve(null),C(!1)},children:[o.jsx(ne,{name:"plus",size:14})," ",o.jsx("span",{children:u.chat.newChat})]})]})]}),N&&T&&qf.createPortal(o.jsxs("div",{ref:sn,className:"menu agent-menu oc-agent-menu entering",role:"menu","aria-label":u.chat.agent,style:{right:T.right,top:T.top},onKeyDown:Qe,children:[Vt.map(M=>o.jsxs("div",{className:`menu-item agent-item ${M.status==="missing"?"off":""}`,role:"none",children:[o.jsxs("button",{role:"menuitemradio","aria-checked":M.id===Q,className:"agent-choose",title:M.custom&&M.command?u.chat.customCommandTitle(M.command):void 0,onClick:()=>{q(M.id),S(!1)},children:[o.jsx("span",{className:`menu-check ${M.id===Q?"on":""}`,"aria-hidden":"true",children:o.jsx(ne,{name:"check",size:14})}),o.jsx("span",{className:"idot",style:{background:hx(M.id)},"aria-hidden":"true"}),o.jsx("span",{className:"menu-label",children:M.label})]}),o.jsxs("span",{className:`agent-status ${M.status==="missing"?"off":M.status??""}`,children:[M.status&&M.status!=="missing"&&o.jsx("span",{className:`dot ${M.status}`,"aria-hidden":"true"}),ma(M),M.status==="missing"&&M.install&&o.jsxs(o.Fragment,{children:[" · ",o.jsx("a",{className:"link",href:M.install,target:"_blank",rel:"noopener noreferrer",children:u.chat.howToInstall})]})]}),M.custom&&o.jsx("button",{className:"icon-btn sm oc-remove","aria-label":u.chat.remove(M.label),title:u.chat.remove(M.label),onClick:()=>void Ua(M.id),children:o.jsx(ne,{name:"close",size:12})})]},M.id)),o.jsx("div",{className:"menu-sep",role:"separator"}),o.jsxs("button",{role:"menuitem",className:"menu-item oc-custom",onClick:()=>{S(!1),Le({name:"",command:""})},children:[o.jsx("span",{className:"menu-check on muted","aria-hidden":"true",children:o.jsx(ne,{name:"plus",size:14})}),o.jsx("span",{className:"menu-label",children:u.chat.customCommand})]}),o.jsxs("div",{className:"menu-foot",children:[o.jsx("span",{children:f?u.chat.checking:p?u.chat.checkedAt(oy(p.at),p.onOpen):u.chat.checkedOnOpen}),o.jsx("button",{className:"btn",disabled:f,onClick:()=>Fe(),children:u.chat.checkAgain})]})]}),document.body),at&&qf.createPortal(o.jsx("div",{className:"dialog-backdrop",onPointerDown:M=>M.target===M.currentTarget&&Le(null),children:o.jsxs("div",{className:"dialog cf",role:"dialog","aria-modal":"true","aria-label":u.chat.customTitle,onKeyDown:M=>M.key==="Escape"&&Le(null),children:[o.jsxs("h2",{className:"cf-title",children:[o.jsx("span",{className:"idot","aria-hidden":"true"}),u.chat.customTitle]}),o.jsxs("label",{className:"dialog-field",children:[u.chat.customName,o.jsx("input",{autoFocus:!0,value:at.name,placeholder:u.chat.customNamePlaceholder,onChange:M=>Le({...at,name:M.target.value,error:void 0})})]}),o.jsxs("label",{className:"dialog-field",children:[u.chat.customCommandLabel,o.jsx("input",{className:"mono",value:at.command,spellCheck:!1,placeholder:u.chat.customCommandPlaceholder,onChange:M=>Le({...at,command:M.target.value,error:void 0}),onKeyDown:M=>M.key==="Enter"&&!M.nativeEvent.isComposing&&void Ia()})]}),o.jsx("p",{className:"cf-hint",children:o.jsx(Xf,{text:u.chat.customHint})}),at.error&&o.jsxs("p",{className:"cf-error",children:[o.jsx(ne,{name:"warn",size:14})," ",at.error]}),o.jsxs("div",{className:"dialog-actions",children:[o.jsx("button",{onClick:()=>Le(null),children:u.chat.cancel}),o.jsx("button",{className:"primary",disabled:!at.name.trim()||!at.command.trim(),onClick:()=>void Ia(),children:u.chat.customSave})]})]})}),document.body),o.jsx("div",{className:"chat-list",ref:xn,"aria-live":"polite",onScroll:M=>C(M.currentTarget.scrollTop>0),children:I.length===0?o.jsxs("div",{className:"chat-empty",children:[o.jsx("p",{children:u.chat.intro(cn)}),o.jsx("div",{className:"chat-suggest",children:u.chat.suggestions.map(M=>o.jsx("button",{className:"btn",onClick:()=>{a.setDraft(M.text),xe(M.n)},children:M.label},M.label))})]}):I.map((M,W)=>{var Me;return M.role==="restart"?o.jsx("div",{className:"restart",role:"separator",children:u.chat.restarted(oy(M.at))},W):M.role==="user"?o.jsxs("div",{className:"msg user",children:[M.chips.length>0&&o.jsx("div",{className:"chips",children:M.chips.map((ue,Re)=>o.jsx("span",{className:"chip",children:ue},Re))}),o.jsx("div",{className:"bubble",children:M.text})]},W):o.jsxs("div",{className:`msg ai ${M.status}`,children:[o.jsxs("div",{className:"msg-head",children:[o.jsx("strong",{children:M.label??lo[M.agent]??M.agent}),M.status==="running"&&(M.parts.some(ue=>ue.t==="perm"&&!ue.decision)?o.jsxs("span",{className:"waiting",children:[o.jsx("span",{className:"pulse","aria-hidden":"true"}),u.chat.waiting]}):o.jsx("span",{className:"spinner",role:"img","aria-label":u.chat.running})),M.status==="cancelled"&&o.jsx("span",{className:"muted",children:u.chat.cancelled}),M.status==="error"&&o.jsxs("span",{className:"oc-failed",children:[o.jsx(ne,{name:"warn",size:14}),u.chat.failed]}),M.status==="done"&&M.cost!=null&&o.jsxs("span",{className:"muted small",children:["$",M.cost.toFixed(3)]})]}),(Me=M.variants)!=null&&Me.length?o.jsxs("button",{className:"btn oc-variants",onClick:()=>a.onLocate(M.variants),children:[o.jsx(ne,{name:"board",size:14})," ",u.chat.madeVariants(M.variants.length)]}):null,Gl(M,W===I.length-1),M.status==="running"&&!M.parts.length&&o.jsx("div",{className:"muted oc-thinking",children:u.chat.thinking}),u.chat.noPause[M.agent]&&M.parts.some(ue=>ue.t==="tool")&&o.jsx("p",{className:"ai-note",children:u.chat.noPause[M.agent]}),M.status!=="running"&&M.step&&Wa(M)]},W)})}),zn&&o.jsxs("div",{className:"remedy",role:"status",children:[o.jsx(ne,{name:"warn",size:16}),o.jsxs("div",{children:[o.jsx("p",{children:o.jsx(Xf,{text:zn.text})}),o.jsxs("div",{className:"btn-row",children:[zn.cmd&&o.jsxs("button",{className:"btn",onClick:()=>Ht("cmd",zn.cmd),title:zn.cmd,children:[o.jsx(ne,{name:"copy",size:14})," ",$==="cmd"?u.chat.copied:u.chat.copyCommand]}),o.jsx("button",{className:"btn",disabled:f,onClick:()=>Fe(),children:f?u.chat.checking:u.chat.checkAgain})]})]})]}),o.jsxs("div",{className:"composer",onDragOver:M=>M.preventDefault(),onDrop:M=>{M.preventDefault(),M.dataTransfer.files.length&&aa(M.dataTransfer.files)},children:[Ha&&o.jsxs("div",{className:"run-status",role:"status",children:[o.jsxs("span",{className:"waiting",children:[o.jsx("span",{className:"pulse","aria-hidden":"true"}),u.chat.waiting]}),o.jsxs("span",{className:"muted",children:["· ",u.chat.waitingHint]})]}),o.jsxs("div",{className:"chips",children:[a.selection&&o.jsx(hc,{on:Ne,onToggle:()=>mt(M=>!M),icon:"select",label:u.chat.chipElementText(a.selection.tag,a.selection.text.slice(0,14))}),a.boards.length>0&&o.jsx(hc,{on:Ct,onToggle:()=>_t(M=>!M),icon:"board",label:a.boards.length===1?a.titleOf(a.boards[0]):u.chat.chipBoards(a.boards.length)}),a.visibleCount>0&&o.jsx(hc,{on:st,onToggle:()=>fe(M=>!M),icon:"fit",label:u.chat.chipVisible(a.visibleCount)}),a.attach.comments.map(M=>o.jsx(hc,{on:!0,icon:"comment",label:u.chat.chipComment(M.text.slice(0,14)),onRemove:()=>a.setAttach(W=>({...W,comments:W.comments.filter(Me=>Me.id!==M.id)}))},M.id)),a.attach.refs.map((M,W)=>o.jsx(hc,{on:!0,icon:M.kind==="url"?"link":"page",label:M.name??M.value,onRemove:()=>a.setAttach(Me=>({...Me,refs:Me.refs.filter((ue,Re)=>Re!==W)}))},W))]}),_e!=null&&o.jsx("div",{className:"url-row",children:o.jsx("input",{autoFocus:!0,value:_e,placeholder:"https://","aria-label":u.chat.refLink,onChange:M=>ke(M.target.value),onKeyDown:M=>{M.nativeEvent.isComposing||(M.key==="Enter"&&/^https?:\/\/\S+$/.test(_e.trim())&&(a.setAttach(W=>({...W,refs:[...W.refs,{kind:"url",value:_e.trim()}]})),ke(null)),M.key==="Escape"&&ke(null))}})}),ee&&a.draft.trim()&&o.jsx("span",{className:"restored muted small",children:u.chat.restored}),o.jsx("textarea",{ref:a.inputRef,value:a.draft,rows:3,placeholder:se?u.chat.placeholderRunning:u.chat.placeholder,"aria-label":u.chat.input,onChange:M=>a.setDraft(M.target.value),onPaste:M=>{const W=Array.from(M.clipboardData.files);W.length&&(M.preventDefault(),aa(W))},onKeyDown:M=>{M.nativeEvent.isComposing||M.keyCode===229||(M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),rn()),M.key==="Escape"&&(se?Ln():M.target.blur()))}}),xt&&o.jsxs("p",{className:"warn small oc-err",children:[o.jsx(ne,{name:"warn",size:14})," ",xt]}),Ba&&!se&&o.jsxs("p",{className:"send-why",children:[o.jsx(ne,{name:"warn",size:14})," ",Ba]}),o.jsxs("div",{className:"composer-bar",children:[o.jsx("button",{className:"icon-btn sm","aria-label":u.chat.attach,title:u.chat.attachTitle,onClick:()=>{var M;return(M=Mn.current)==null?void 0:M.click()},children:o.jsx(ne,{name:"plus",size:14})}),o.jsx("button",{className:"icon-btn sm","aria-label":u.chat.addLink,title:u.chat.addLink,onClick:()=>ke(""),children:o.jsx(ne,{name:"link",size:14})}),o.jsx("input",{ref:Mn,type:"file",multiple:!0,hidden:!0,accept:"image/*,.pdf,.md,.txt,.html,.csv,.json",onChange:M=>M.target.files&&void aa(M.target.files)}),o.jsx("label",{className:"variants",title:St?u.chat.variantsTitle:u.chat.variantsDisabledTitle,children:o.jsxs("select",{value:ye,disabled:!St||!!se,onChange:M=>xe(Number(M.target.value)),"aria-label":u.chat.variantsAria,children:[o.jsx("option",{value:1,children:u.chat.variants(1)}),o.jsx("option",{value:2,children:u.chat.variants(2)}),o.jsx("option",{value:3,children:u.chat.variants(3)}),o.jsx("option",{value:4,children:u.chat.variants(4)})]})}),o.jsx("div",{className:"spacer"}),se?o.jsxs("button",{className:"btn oc-cancel",title:u.chat.cancelTitle,onClick:Ln,children:[o.jsx(ne,{name:"close",size:14})," ",u.chat.cancel]}):o.jsx("button",{className:"primary",disabled:!a.draft.trim()||!!Ba,title:Ba??void 0,onClick:()=>void rn(),children:u.chat.send})]})]}),Xn&&qf.createPortal(o.jsx($y,{before:Q0(Xn.id),boards:Xn.boards,onClose:()=>jn(null)}),document.body)]})}function hc({on:a,onToggle:i,onRemove:r,icon:f,label:h}){return o.jsxs("span",{className:`chip ${a?"on":"off"}`,children:[o.jsxs("button",{className:"chip-main",onClick:i,disabled:!i,"aria-pressed":i?a:void 0,title:i?a?u.chat.chipRemoveTitle:u.chat.chipAddTitle:void 0,children:[o.jsx(ne,{name:f,size:12}),o.jsx("span",{children:h})]}),r&&o.jsx("button",{className:"chip-x","aria-label":u.chat.remove(h),onClick:r,children:o.jsx(ne,{name:"close",size:12})})]})}const gu=a=>(a==null?void 0:a.querySelector("script[data-dc-probe]"))??null;function mh(a,i){const r=a!=null&&a.isConnected?a.contentDocument:null;if(!r||r.readyState!=="complete"||!r.body)return null;try{if(decodeURIComponent(r.location.pathname)!==`/screens/${i}`)return null}catch{return null}return r}function Ly(a,i){const r=gu(mh(a,i));return!r||r.hasAttribute("data-dc-dirty")?null:r.getAttribute("data-dc-src")}const ry=(a,i)=>{var r;return!!((r=gu(mh(a,i)))!=null&&r.hasAttribute("data-dc-patched"))},px=a=>{var i;return(i=gu(a))==null?void 0:i.setAttribute("data-dc-dirty","")};function yx(a,i,r){var y;if(!((y=r.live)!=null&&y.length)||!r.base||!r.hash||r.forked)return!1;const f=mh(a,i);if(!f||Ly(a,i)!==r.base)return!1;const h=r.live.map(N=>Hn(f,N.path));if(h.some((N,S)=>!N||N===f.body||N.localName!==r.live[S].tag||N.namespaceURI!=="http://www.w3.org/1999/xhtml"))return!1;r.live.forEach((N,S)=>{const T=h[S];for(const[v,x]of N.attrs??[])x==null?T.removeAttribute(v):T.setAttribute(v,x);N.inner!=null&&(T.innerHTML=N.inner)});const p=gu(f);return p.setAttribute("data-dc-src",r.hash),p.setAttribute("data-dc-patched",""),a.dispatchEvent(new CustomEvent("dc-patched")),!0}function vx(){const a=new Map,i=new Map,r=new Map;return{begin(f){a.set(f,(a.get(f)??0)+1)},end(f){const h=(a.get(f)??1)-1;if(h>0)return a.set(f,h),[];a.delete(f);const p=i.get(f)??[];return i.delete(f),p},patched(f,h,p){const y=r.get(f)??new Set;y.add(h).add(p),r.set(f,y)},reset(f){r.delete(f)},decide(f,h,p,y=!1){var N;return a.get(f)?(i.set(f,[...i.get(f)??[],h]),"queue"):h?y?h===p.shown?"keep":"reload":!p.patched||!p.shown?"reload":h===p.shown?"keep":(N=r.get(f))!=null&&N.has(h)?"check":"reload":"reload"}}}function bx(a){const[i,r]=w.useState(null);return w.useEffect(()=>{Ce.get("/api/tokens").then(r).catch(()=>{})},[a]),i}const Gy=a=>Object.entries((a==null?void 0:a.themes[a.active])??{}).map(([i,r])=>({name:i,value:r}));function du(a){const i=a.trim().toLowerCase();let r=i.match(/^#([0-9a-f]{3,8})$/);if(r){let f=r[1];return f.length<=4&&(f=[...f].map(h=>h+h).join("")),[parseInt(f.slice(0,2),16),parseInt(f.slice(2,4),16),parseInt(f.slice(4,6),16),f.length===8?parseInt(f.slice(6),16)/255:1]}return r=i.match(/^rgba?\(\s*([\d.]+)[ ,]+([\d.]+)[ ,]+([\d.]+)(?:[ ,/]+([\d.]+))?\s*\)$/),r?[Number(r[1]),Number(r[2]),Number(r[3]),r[4]==null?1:Number(r[4])]:i==="transparent"?[0,0,0,0]:null}const uy=([a,i,r])=>{const f=h=>{const p=h/255;return p<=.03928?p/12.92:((p+.055)/1.055)**2.4};return .2126*f(a)+.7152*f(i)+.0722*f(r)};function cu(a,i){const r=du(a),f=du(i);if(!r||!f)return null;const[h,p]=[uy(r),uy(f)].sort((y,N)=>N-y);return(h+.05)/(p+.05)}const ih=a=>{const i=du(a);return i&&i[3]===1?"#"+i.slice(0,3).map(r=>Math.round(r).toString(16).padStart(2,"0")).join("").toUpperCase():null};function dy(a,i,r){if(!(r!=null&&r.registered)||!i)return null;const f=new Set(Gy(r).map(p=>ih(p.value)));if(/^(color|background|background-color|border-color)$/.test(a)){const p=ih(i);if(p&&!f.has(p))return u.checks.colorNotInTokens}const h=[...i.matchAll(/(-?\d+(?:\.\d+)?)px/g)].map(p=>Number(p[1]));return a==="font-size"&&h.some(p=>!r.fontSizes.includes(p))?u.checks.tokenFontSizes(r.fontSizes.join("·")):a==="border-radius"&&h.some(p=>!r.radii.includes(p)&&p<999)?u.checks.tokenRadii(r.radii.join("·")):/^(gap|padding|margin)/.test(a)&&h.some(p=>p%4!==0)?u.checks.notMultipleOf4:a==="font-weight"&&/^\d+$/.test(i)&&!r.fontWeights.includes(Number(i))?u.checks.tokenWeights(r.fontWeights.join("·")):null}function xx(a,i=48){var T,v;const r=a.defaultView,f=[],h=x=>{for(let C=x;C&&C.nodeType===1;C=C.parentElement){const O=r.getComputedStyle(C),X=du(O.backgroundColor);if(O.backgroundImage!=="none")return"";if(X&&X[3]>.5)return O.backgroundColor}return"rgb(255,255,255)"},p=x=>{const C=x.getBoundingClientRect(),O=r.getComputedStyle(x);return C.width>0&&C.height>0&&O.visibility!=="hidden"&&O.display!=="none"},y=a.body.querySelectorAll("a[href], button, input:not([type=hidden]), select, textarea, [role=button], [role=tab], [onclick]");for(const x of Array.from(y)){if(!p(x))continue;const C=Ta(x);if(C==null)continue;const O=x.getBoundingClientRect();O.width<i&&O.height<i&&f.push({path:C,kind:"target",message:u.checks.smallTarget(x.tagName.toLowerCase(),Math.round(O.width),Math.round(O.height),i)});const X=(x.getAttribute("aria-label")||x.getAttribute("title")||x.getAttribute("placeholder")||x.innerText||((T=x.querySelector("img[alt]"))==null?void 0:T.getAttribute("alt"))||"").trim(),ee=x.getAttribute("aria-labelledby")||x.id&&a.querySelector(`label[for="${x.id}"]`)||x.closest("label");!X&&!ee&&f.push({path:C,kind:"label",message:u.checks.noName(x.tagName.toLowerCase())})}for(const x of Array.from(a.body.querySelectorAll("img")))if(!x.hasAttribute("alt")&&p(x)){const C=Ta(x);C!=null&&f.push({path:C,kind:"label",message:u.checks.noAlt})}const N=a.createTreeWalker(a.body,NodeFilter.SHOW_TEXT),S=new Set;for(let x=N.nextNode();x;x=N.nextNode()){const C=x.parentElement;if(!C||S.has(C)||!((v=x.textContent)!=null&&v.trim())||/^(SCRIPT|STYLE)$/.test(C.tagName)||!p(C))continue;S.add(C);const O=r.getComputedStyle(C),X=h(C);if(!X)continue;const ee=cu(O.color,X);if(ee==null)continue;const k=parseFloat(O.fontSize),J=k>=24||k>=18.66&&Number(O.fontWeight)>=700?3:4.5;if(ee<J){const Q=Ta(C);Q!=null&&f.push({path:Q,kind:"contrast",message:u.checks.lowContrast(ee.toFixed(2),J,x.textContent.trim().slice(0,16))})}}return f}function wx({tokens:a,onSave:i}){const[r,f]=w.useState(a);w.useEffect(()=>f(a),[a]);const h=r.themes[r.active]??{},p=JSON.stringify(r)!==JSON.stringify(a)||!a.registered,y=S=>f({...r,themes:{...r.themes,[r.active]:S}}),N=(S,T)=>o.jsxs("label",{className:"field-row tok-list",children:[o.jsx("span",{children:T}),o.jsx("input",{defaultValue:r[S].join(", "),"aria-label":T,onBlur:v=>f({...r,[S]:v.target.value.split(/[,\s]+/).map(Number).filter(x=>Number.isFinite(x))})},r[S].join())]});return o.jsxs("div",{className:"tokens",children:[o.jsxs("label",{className:"upload small",children:[o.jsx(ne,{name:"plus",size:14})," ",u.tokens.import,o.jsx("input",{type:"file",hidden:!0,accept:".json,application/json",onChange:async S=>{var v;const T=(v=S.target.files)==null?void 0:v[0];if(T)try{f(Sx(JSON.parse(await T.text()),r))}catch(x){alert(u.tokens.importFailed(x.message))}}})]}),o.jsxs("div",{className:"sec-head",children:[o.jsx("span",{children:u.tokens.theme}),o.jsx("button",{className:"icon-btn sm","aria-label":u.tokens.addTheme,title:u.tokens.addTheme,onClick:()=>{let S=u.tokens.newTheme;for(let T=2;r.themes[S];T++)S=u.tokens.newThemeN(T);f({...r,themes:{...r.themes,[S]:{...h}},active:S})},children:o.jsx(ne,{name:"plus",size:14})})]}),o.jsxs("div",{className:"theme-row",children:[o.jsx("select",{value:r.active,onChange:S=>f({...r,active:S.target.value}),"aria-label":u.tokens.activeTheme,children:Object.keys(r.themes).map(S=>o.jsx("option",{children:S},S))}),o.jsx("input",{defaultValue:r.active,"aria-label":u.tokens.themeName,onBlur:S=>{const T=S.target.value.trim();if(!T||T===r.active||r.themes[T])return;const{[r.active]:v,...x}=r.themes;f({...r,themes:{...x,[T]:v},active:T})}},r.active)]}),o.jsxs("div",{className:"sec-head",children:[o.jsx("span",{children:u.tokens.colors(Object.keys(h).length)}),o.jsx("button",{className:"icon-btn sm","aria-label":u.tokens.addColor,title:u.tokens.addColor,onClick:()=>y({...h,[u.tokens.colorN(Object.keys(h).length+1)]:"#111111"}),children:o.jsx(ne,{name:"plus",size:14})})]}),o.jsx("ul",{className:"tok-colors",children:Object.entries(h).map(([S,T])=>{var v;return o.jsxs("li",{children:[o.jsx("input",{type:"color",value:((v=ih(T))==null?void 0:v.toLowerCase())??"#000000","aria-label":u.tokens.colorOf(S),onChange:x=>y({...h,[S]:x.target.value.toUpperCase()})}),o.jsx("input",{defaultValue:S,"aria-label":u.tokens.colorName,onBlur:x=>{const C=x.target.value.trim();!C||C===S||h[C]||y(Object.fromEntries(Object.entries(h).map(([O,X])=>O===S?[C,X]:[O,X])))}}),o.jsx("code",{children:T}),o.jsx("button",{className:"icon-btn sm danger","aria-label":u.tokens.remove(S),onClick:()=>y(Object.fromEntries(Object.entries(h).filter(([x])=>x!==S))),children:o.jsx(ne,{name:"close",size:12})})]},S)})}),N("fontSizes",u.tokens.fontSizes),N("fontWeights",u.tokens.fontWeights),N("radii",u.tokens.radii),N("spacing",u.tokens.spacing),o.jsxs("label",{className:"field-row tok-list",children:[o.jsx("span",{children:u.tokens.touchTarget}),o.jsx("input",{type:"number",value:r.minTarget,onChange:S=>f({...r,minTarget:Number(S.target.value)||48}),"aria-label":u.tokens.minTouchTarget})]}),o.jsx("button",{disabled:!p,title:u.tokens.saveTitle,onClick:()=>i(r,a.registered?u.history.saveTokens:u.history.registerTokens),children:a.registered?u.tokens.save:u.tokens.register}),o.jsx("p",{className:"muted small",children:a.registered?u.tokens.registeredHint:u.tokens.defaultHint})]})}function Sx(a,i){const r=a;if(r&&typeof r=="object"&&r.themes&&typeof r.themes=="object")return{...i,...r,active:r.active??Object.keys(r.themes)[0]};const f={},h=(p,y)=>{if(typeof p=="string"&&/^#|^rgb/i.test(p))f[y]=p.toUpperCase();else if(p&&typeof p=="object"){const N=p.value??p.$value;if(typeof N=="string")h(N,y);else for(const[S,T]of Object.entries(p))h(T,y?`${y} ${S}`:S)}};if(h(a,""),!Object.keys(f).length)throw new Error(u.tokens.noColors);return{...i,themes:{...i.themes,[u.tokens.importedTheme]:f},active:u.tokens.importedTheme}}function fy({title:a,items:i,empty:r,onPick:f,onAskAI:h}){return o.jsxs("section",{className:"board-opts","aria-label":a,children:[o.jsxs("div",{className:"sec-head",children:[o.jsxs("span",{children:[a," ",i?i.length:""]}),h&&i&&i.length>0&&o.jsx("button",{className:"link",onClick:h,children:u.checks.askFix})]}),i==null?o.jsx("p",{className:"muted small",children:u.checks.notVisible}):i.length===0?o.jsxs("p",{className:"ok-line",children:[o.jsx(ne,{name:"check",size:14})," ",r]}):o.jsxs("ul",{className:"check-list",children:[i.slice(0,30).map((p,y)=>o.jsx("li",{children:o.jsxs("button",{className:"check-item",disabled:!p.path,onClick:()=>p.path&&f(p.path),title:p.path?u.checks.pickInEdit(p.path):u.checks.line(p.line),children:[o.jsx(ne,{name:"warn",size:12}),o.jsx("span",{children:p.message}),o.jsx("code",{children:p.path??u.checks.line(p.line)})]})},y)),i.length>30&&o.jsx("li",{className:"muted small",children:u.checks.more(i.length-30)})]})]})}function jx({onSetUp:a}){const i=w.useRef(null);return w.useLayoutEffect(()=>Qa(i.current,".btn"),[]),o.jsxs("div",{ref:i,className:"oc-tc-off",role:"note","aria-label":u.checks.tokensOffTitle,children:[o.jsx(ne,{name:"info",size:16}),o.jsxs("div",{children:[o.jsx("strong",{children:u.checks.tokensOffTitle}),o.jsx("p",{children:u.checks.tokensOffBody})]}),o.jsx("button",{className:"btn",onClick:a,children:u.checks.setUpTokens})]})}function bc(a){const i=a==null?void 0:a.getElementById("board-tweaks");if(!i)return null;try{return JSON.parse(i.textContent??"")}catch{return null}}function hy(a,i,r){px(a);const f=r.type==="boolean"?r.value?"1":"0":String(r.value)+(r.type==="number"&&r.unit?r.unit:"");r.var&&a.documentElement.style.setProperty(r.var,f),a.documentElement.setAttribute(`data-tweak-${i}`,r.type==="boolean"?r.value?"on":"off":String(r.value))}function Nx({doc:a,onSave:i}){const[r,f]=w.useState(()=>bc(a)),[h,p]=w.useState(()=>JSON.stringify(bc(a)));if(w.useEffect(()=>{const S=bc(a);f(S),p(JSON.stringify(S))},[a]),!r)return null;const y=(S,T)=>{const v={...r,[S]:{...r[S],value:T}};f(v),a&&hy(a,S,v[S])},N=JSON.stringify(r)!==h;return o.jsxs("section",{className:"board-opts","aria-label":"Tweaks",children:[o.jsx("div",{className:"sec-head",children:o.jsx("span",{children:"Tweaks"})}),Object.entries(r).map(([S,T])=>o.jsx("label",{className:T.type==="boolean"?"check":"field-row",children:T.type==="boolean"?o.jsxs(o.Fragment,{children:[o.jsx("input",{type:"checkbox",checked:!!T.value,onChange:v=>y(S,v.target.checked)}),T.label??S]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{children:T.label??S}),T.type==="color"?o.jsx("input",{type:"color",value:String(T.value),onChange:v=>y(S,v.target.value.toUpperCase()),"aria-label":T.label??S}):T.type==="enum"?o.jsx("select",{value:String(T.value),onChange:v=>y(S,v.target.value),"aria-label":T.label??S,children:(T.options??[]).map(v=>o.jsx("option",{children:v},v))}):o.jsxs("span",{className:"tw-num",children:[o.jsx("input",{type:"range",min:T.min??0,max:T.max??100,step:T.step??1,value:Number(T.value),onChange:v=>y(S,Number(v.target.value)),"aria-label":T.label??S}),o.jsxs("code",{children:[String(T.value),T.unit??""]})]})]})},S)),o.jsxs("div",{className:"btn-row",children:[o.jsx("button",{disabled:!N,onClick:()=>{const S=JSON.parse(h);if(f(S),a)for(const[T,v]of Object.entries(S))hy(a,T,v)},children:u.tweaks.revert}),o.jsx("button",{className:"primary",disabled:!N,onClick:()=>void i(Object.fromEntries(Object.entries(r).map(([S,T])=>[S,T.value]))).then(()=>p(JSON.stringify(r))),children:u.tweaks.save})]}),o.jsx("p",{className:"muted small",children:u.tweaks.hint})]})}const ln=u.select,xl=u.design,Yy=a=>a!=null&&a.registered?Gy(a):[];function Tx(a){const i={};if(!(a!=null&&a.documentElement))return i;const r=f=>{for(let h=0;h<f.length;h++)f[h].startsWith("--")&&(i[f[h]]=f.getPropertyValue(f[h]).trim())};for(const f of Array.from(a.styleSheets)){let h=null;try{h=f.cssRules}catch{continue}for(const p of Array.from(h??[])){const y=p;y.selectorText&&y.style&&/(^|,)\s*(:root|html|body)\s*(,|$)/.test(y.selectorText)&&r(y.style)}}return r(a.documentElement.style),i}function qy(a,i){const r=y0(a.kind,a.styles["background-color"]);if(r==="color")return{prop:r,css:"color",value:i.color||a.styles.color||""};const f=i.background!=null?"background":"background-color";return{prop:r,css:f,value:i.background||i["background-color"]||a.styles["background-color"]||""}}function sh(a){const i=wc(a.value,a.colors),r=Un(a.value)??(i?Un(i.value):null)??"",[f,h]=w.useState(r);w.useEffect(()=>h(r),[r]);const p=w.useRef(null);w.useEffect(()=>{var N,S;a.autoFocus&&((S=(N=p.current)==null?void 0:N.querySelector("button, input"))==null||S.focus())},[]);const y=()=>{const N=Un(f.startsWith("#")?f:`#${f}`);N&&N!==r?a.onPick(N):h(r)};return o.jsxs("div",{className:"fill-picker",ref:p,children:[o.jsxs("div",{className:"pop-top",children:[o.jsx("strong",{children:a.title}),o.jsx("span",{className:"muted",children:i?ln.tokenNow(i.name):r||xl.none})]}),a.colors.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"pop-h",children:ln.tokens}),o.jsx("div",{className:"tok-row",role:"group","aria-label":ln.tokens,children:a.colors.map(N=>o.jsxs("button",{className:`tok ${(i==null?void 0:i.name)===N.name?"on":""}`,"aria-pressed":(i==null?void 0:i.name)===N.name,title:`${N.name} ${Un(N.value)??N.value}`,onClick:()=>a.onPick(p0(N,a.vars)),children:[o.jsx("i",{style:{background:N.value}}),o.jsx("span",{children:N.name})]},N.name))}),o.jsx("div",{className:"pop-sep"})]}),o.jsx("div",{className:"custom-row",children:o.jsx("span",{children:ln.custom})}),o.jsxs("div",{className:"hex",children:[o.jsx("input",{type:"color",className:"sw","aria-label":ln.picker,value:(Un(f)??(r||"#000000")).toLowerCase(),onChange:N=>h(N.target.value.toUpperCase()),onBlur:y}),o.jsx("input",{className:"num","aria-label":ln.hex,value:f,spellCheck:!1,onChange:N=>h(N.target.value),onBlur:y,onKeyDown:N=>{N.nativeEvent.isComposing||N.key==="Enter"&&y()}})]})]})}function au(a){const[i,r]=w.useState(a.value);w.useEffect(()=>r(a.value),[a.value]);const f=()=>i.trim()!==a.value.trim()&&a.onCommit(i.trim());return o.jsxs("div",{className:"pop-field",children:[o.jsx("span",{className:"pop-h",title:a.css,children:a.label}),a.chips&&a.chips.length>0&&o.jsx("span",{className:"chips-row",children:a.chips.map(h=>o.jsx("button",{className:`tchip ${Za(a.value||a.placeholder)===String(h)?"on":""}`,onClick:()=>a.onCommit(String(h)),children:h},h))}),o.jsxs("span",{className:"stepper",children:[o.jsx("button",{className:"icon-btn sm","aria-label":ln.decrease(a.label),onClick:()=>a.onStep(-1),children:o.jsx(ne,{name:"minus",size:14})}),o.jsx("input",{"aria-label":a.label,title:a.css,value:i,placeholder:a.placeholder,onChange:h=>r(h.target.value),onBlur:f,onKeyDown:h=>{h.nativeEvent.isComposing||h.key==="Enter"&&f()}}),o.jsx("button",{className:"icon-btn sm","aria-label":ln.increase(a.label),onClick:()=>a.onStep(1),children:o.jsx(ne,{name:"plus",size:14})})]})]})}const lu=a=>/^-?\d+(?:\.\d+)?$/.test(a)?`${Number(a)}px`:a;function Ex(a){var xt,Ke,Pe,D,G,oe;const i=a.selection,r=w.useRef(null),f=w.useRef(null),[h,p]=w.useState({w:420,h:36}),y=w.useRef(0),[N,S]=w.useState(null),[T,v]=w.useState(null),[x,C]=w.useState(0),O=w.useRef([]),[X,ee]=w.useState({});w.useEffect(()=>ee({}),[i.hash,i.path,i.file]);const k=_=>X[_]??a.inline[_]??i.styles[_]??"",$=(_,ge)=>{ee(je=>({...je,[_]:ge})),a.onStyle(_,ge)},J=d0(a.win.w,{w:h.w,full:y.current||h.w});w.useLayoutEffect(()=>{const _=r.current;_&&(Qa(_),J.icons||(y.current=_.offsetWidth),(_.offsetWidth!==h.w||_.offsetHeight!==h.h)&&p({w:_.offsetWidth,h:_.offsetHeight}))});const Q=a.win.h-a.bottom-h.h;w.useLayoutEffect(()=>{if(!N)return v(null);const _=f.current,ge=O.current[re.findIndex(rt=>rt.pop===N)];if(!_||!ge||!r.current)return;const je=_.offsetWidth,He=_.offsetHeight,me=Math.round(Math.max(8,Math.min(J.x+ge.offsetLeft,a.win.w-je-8))),ve=Math.round(Math.max(8,Q-He-8));(!T||T.x!==me||T.y!==ve)&&v({x:me,y:ve})}),w.useEffect(()=>{if(!N)return;const _=ge=>{var He,me;const je=ge.target;(He=f.current)!=null&&He.contains(je)||(me=r.current)!=null&&me.contains(je)||S(null)};return window.addEventListener("pointerdown",_,!0),()=>window.removeEventListener("pointerdown",_,!0)},[N]);const q=Yy(a.tokens),I=!!i.text.trim(),ce=qy(i,a.inline),se=X[ce.css]??ce.value,P=Un(se)??Un((xt=wc(se,q))==null?void 0:xt.value)??null,re=[{id:"text",label:ln.text,icon:"title",pop:"text",disabled:!I,title:I?ln.text:ln.textOff},{id:"fill",label:ln.fill,pop:"fill",title:`${ln.fill} (${ce.css})`},{id:"radius",label:ln.radius,icon:"radius",pop:"radius",title:`${xl.cornerRadius} (border-radius)`},{id:"spacing",label:ln.spacing,icon:"spacing",pop:"spacing",title:`${xl.padding} · ${xl.gap}`},{id:"ask",label:ln.askAi,icon:"comment",cls:"accent",title:ln.askAiTitle,run:a.onAskAi},{id:"comment",label:ln.comment,icon:"comment",title:ln.commentTitle,run:a.onComment}],Se=re.map((_,ge)=>_.disabled?-1:ge).filter(_=>_>=0),Ne=Se.includes(x)?x:Se[0],mt=_=>{var ge;return _.pop?S(je=>je===_.pop?null:_.pop):(ge=_.run)==null?void 0:ge.call(_)},Ct=()=>{var ge;const _=re.findIndex(je=>je.pop===N);S(null),(ge=O.current[_])==null||ge.focus()},_t=_=>{if(!_.nativeEvent.isComposing){if(_.key==="Escape"){N&&(_.preventDefault(),_.stopPropagation(),Ct());return}_.metaKey||_.ctrlKey||/^(Arrow|Home$|End$|Enter$| $|Delete$|Backspace$)/.test(_.key)&&_.stopPropagation()}},st=_=>{const ge=Se.indexOf(Ne),je=He=>{var ve;_.preventDefault();const me=Se[(He+Se.length)%Se.length];C(me),(ve=O.current[me])==null||ve.focus()};_.key==="ArrowRight"?je(ge+1):_.key==="ArrowLeft"?je(ge-1):_.key==="Home"?je(0):_.key==="End"&&je(Se.length-1)},fe=(Ke=a.tokens)!=null&&Ke.registered?a.tokens.fontSizes:[],ye=[...new Set([...(Pe=a.tokens)!=null&&Pe.registered?a.tokens.fontWeights:[],400,500,600,700])].sort((_,ge)=>_-ge),xe=(D=a.tokens)!=null&&D.registered?a.tokens.radii.filter(_=>_<999):[],_e=(G=a.tokens)!=null&&G.registered?a.tokens.spacing.filter(_=>_<=64):[];let ke=null;return N==="text"?ke=o.jsxs(o.Fragment,{children:[o.jsx(au,{label:xl.size,css:"font-size",value:Za(k("font-size")),chips:fe,onStep:_=>$("font-size",`${ou(k("font-size"),_,1,1)}px`),onCommit:_=>$("font-size",lu(_))}),o.jsxs("label",{className:"pop-field",children:[o.jsx("span",{className:"pop-h",title:"font-weight",children:xl.weight}),o.jsx("select",{value:String(Number(k("font-weight"))||""),onChange:_=>$("font-weight",_.target.value),children:ye.map(_=>o.jsx("option",{value:String(_),children:eh(_,xl.weights)},_))})]})]}):N==="fill"?ke=o.jsx(sh,{title:ln.fill,value:se,colors:q,vars:a.vars,autoFocus:!0,onPick:_=>$(ce.css,_)}):N==="radius"?ke=o.jsx(au,{label:xl.cornerRadius,css:"border-radius",value:Za(k("border-radius")),chips:xe,onStep:_=>$("border-radius",`${ou(k("border-radius"),_)}px`),onCommit:_=>$("border-radius",lu(_))}):N==="spacing"&&(ke=o.jsxs(o.Fragment,{children:[o.jsx(au,{label:xl.padding,css:"padding",value:Pf(k("padding")),chips:_e,onStep:_=>$("padding",v0(k("padding"),_)),onCommit:_=>$("padding",_.replace(/·/g," ").trim().split(/\s+/).map(lu).join(" "))}),o.jsx(au,{label:xl.gap,css:"gap",value:Za(k("gap")==="normal"?"0px":k("gap")),chips:_e,onStep:_=>$("gap",`${ou(k("gap"),_,4)}px`),onCommit:_=>$("gap",lu(_))})]})),o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:r,className:`etb oc-context ${J.icons?"is-icons":""}`,role:"toolbar","aria-label":ln.toolbar,"aria-orientation":"horizontal",style:{left:J.x},onKeyDown:_=>{_t(_),st(_)},onPointerDown:_=>_.stopPropagation(),children:re.map((_,ge)=>o.jsxs("span",{className:"etb-item",children:[_.id==="ask"&&o.jsx("span",{className:"sep","aria-hidden":"true"}),o.jsxs("button",{ref:je=>void(O.current[ge]=je),className:`${_.cls??""} ${N&&N===_.pop?"on":""}`,tabIndex:ge===Ne?0:-1,disabled:_.disabled,title:_.title,"aria-label":_.id==="fill"?ln.fill:J.icons?_.label:void 0,"aria-haspopup":_.pop?"dialog":void 0,"aria-expanded":_.pop?N===_.pop:void 0,onFocus:()=>C(ge),onClick:()=>mt(_),children:[_.id==="fill"?o.jsx("span",{className:"sw",style:{background:P??"transparent"}}):o.jsx(ne,{name:_.icon,size:14}),_.id!=="fill"&&!J.icons&&_.label,(_.id==="text"||_.id==="fill")&&o.jsx(ne,{name:"chevronDown",size:14})]})]},_.id))}),N&&o.jsx("div",{ref:f,className:"menu pop",role:"dialog","aria-label":(oe=re.find(_=>_.pop===N))==null?void 0:oe.label,style:T?{left:T.x,top:T.y}:{visibility:"hidden",left:0,top:0},onKeyDown:_t,onPointerDown:_=>_.stopPropagation(),children:ke})]})}function kx(a){return o.jsxs("nav",{className:"crumb","aria-label":u.inspector.crumbs,children:[o.jsx("button",{className:"link",title:u.inspector.crumbBoard,onClick:a.onBoard,children:a.board}),a.skipped&&o.jsxs(o.Fragment,{children:[o.jsx("span",{"aria-hidden":"true",children:"›"}),o.jsx("span",{children:"…"})]}),a.parents.map(i=>o.jsxs("span",{className:"crumb-step",children:[o.jsx("span",{"aria-hidden":"true",children:"›"}),o.jsx("button",{className:"link",title:u.inspector.crumbParent(i.name),onClick:()=>a.onPath(i.path),children:i.name})]},i.path)),o.jsx("span",{"aria-hidden":"true",children:"›"}),o.jsx("b",{"aria-current":"true",title:a.title,children:a.current})]})}const Cx=a=>a.includes("/")?a.slice(0,a.lastIndexOf("/")):"",yc=a=>`${Math.round(a)}px`;function Mx(a,i,r,f,h){const p=i.style.pointerEvents;i.style.pointerEvents="none";const y=a.elementFromPoint(r,f);if(i.style.pointerEvents=p,!y||y===a.documentElement||i.contains(y))return null;const N=a.defaultView,S=Q=>{const q=N.getComputedStyle(Q);return/flex/.test(q.display)&&!q.flexDirection.startsWith("column")},T=/^(img|input|br|hr|textarea|select|svg|path|video|iframe)$/i,v=Q=>{const q=Q===a.body?"":Ta(Q);if(q==null)return null;const I=S(Q),ce=Array.from(Q.children).filter(Se=>{var Ne;return Se!==i&&!((Ne=Se.hasAttribute)!=null&&Ne.call(Se,"data-dc-probe"))});let se=ce.length;for(let Se=0;Se<ce.length;Se++){const Ne=wl(ce[Se]);if(I?r<Ne.x+Ne.w/2:f<Ne.y+Ne.h/2){se=Se;break}}const P=wl(Q);let re;if(se<ce.length){const Se=wl(ce[se]);re=I?{x:Se.x-1,y:Se.y,w:2,h:Se.h}:{x:Se.x,y:Se.y-1,w:Se.w,h:2}}else if(ce.length){const Se=wl(ce[ce.length-1]);re=I?{x:Se.x+Se.w,y:Se.y,w:2,h:Se.h}:{x:Se.x,y:Se.y+Se.h,w:Se.w,h:2}}else re={x:P.x,y:P.y+P.h-2,w:P.w,h:2};return{toParentPath:q,index:se,freeze:[],line:re}};if(y.contains(i)||y===a.body)return v(y===a.body?a.body:y);if(h&&!T.test(y.tagName))return v(y);const x=y.parentElement,C=x===a.body?"":Ta(x);if(C==null)return null;const O=S(x),X=wl(y),ee=O?r>X.x+X.w/2:f>X.y+X.h/2,$=Array.from(x.children).filter(Q=>Q!==i).indexOf(y)+(ee?1:0),J=O?{x:ee?X.x+X.w:X.x-1,y:X.y,w:2,h:X.h}:{x:X.x,y:ee?X.y+X.h:X.y-1,w:X.w,h:2};return{toParentPath:C,index:$,freeze:[],line:J}}function zx(a,i,r){const f=i.parentElement;if(!f||f===a.body)return[];const h=Ta(f);if(h==null||h===r)return[];const p=a.defaultView.getComputedStyle(f);if(!/flex|grid/.test(p.display))return[];const y=[],N=(v,x)=>{const C=Ta(v),O=v.style,X=v.getBoundingClientRect(),ee={};for(const k of x)O.getPropertyValue(k)||(ee[k]=yc(k==="width"?X.width:X.height));C!=null&&Object.keys(ee).length&&y.push({path:C,props:ee})};N(f,["width","height"]);const S=p.display.includes("grid"),T=!p.flexDirection.startsWith("column");for(const v of Array.from(f.children))v!==i&&N(v,S?["width","height"]:T?["width"]:["height"]);return y}function Ax(a){const[i,r]=w.useState(null),[f,h]=w.useState(null),p=w.useRef(null),y=1/Math.max(a.zoom,.25),N=C=>O=>{if(O.button!==0)return;O.stopPropagation(),O.preventDefault();const X=Hn(a.doc,a.path);if(!X)return;const ee=a.doc.defaultView.getComputedStyle(X),k=ee.position==="absolute"||ee.position==="fixed",$=X.getBoundingClientRect();p.current={kind:C,sx:O.clientX,sy:O.clientY,el:X,abs:k,left:parseFloat(ee.left)||0,top:parseFloat(ee.top)||0,w:$.width,h:$.height,plan:null,moved:!1},O.currentTarget.setPointerCapture(O.pointerId)},S=C=>{var k,$;const O=p.current;if(!O)return;const X=(C.clientX-O.sx)/a.zoom,ee=(C.clientY-O.sy)/a.zoom;if(!(!O.moved&&Math.abs(X)+Math.abs(ee)<3)){if(O.moved=!0,O.kind==="move"){if(O.abs){O.el.style.left=yc(O.left+X),O.el.style.top=yc(O.top+ee);return}h({...a.rect,x:a.rect.x+X,y:a.rect.y+ee});const J=($=(k=a.doc.defaultView)==null?void 0:k.frameElement)==null?void 0:$.getBoundingClientRect(),Q=J?J.width/(a.doc.defaultView.innerWidth||J.width):a.zoom,q=J?(C.clientX-J.left)/Q:a.rect.x+X,I=J?(C.clientY-J.top)/Q:a.rect.y+ee,ce=Mx(a.doc,O.el,q,I,C.altKey);O.plan=ce?{toParentPath:ce.toParentPath,index:ce.index,freeze:[]}:null,r((ce==null?void 0:ce.line)??null);return}O.kind!=="s"&&(O.el.style.width=yc(Math.max(8,O.w+X))),O.kind!=="e"&&(O.el.style.height=yc(Math.max(8,O.h+ee)))}},T=C=>{const O=p.current;if(p.current=null,r(null),h(null),!O||!O.moved)return;const X=(C.clientX-O.sx)/a.zoom,ee=(C.clientY-O.sy)/a.zoom;if(O.kind==="move"){if(O.abs)return a.onPosition(Math.round(O.left+X),Math.round(O.top+ee));if(!O.plan||O.plan.toParentPath===Cx(a.path)&&O.plan.index===Array.from(O.el.parentElement.children).indexOf(O.el))return;a.onMove({...O.plan,freeze:zx(a.doc,O.el,O.plan.toParentPath)});return}a.onResize(Math.round(O.kind==="s"?O.w:Math.max(8,O.w+X)),Math.round(O.kind==="e"?O.h:Math.max(8,O.h+ee)))},v=a.rect,x=10*y;return o.jsxs(o.Fragment,{children:[f&&o.jsx("div",{className:"drag-ghost",style:{left:f.x,top:f.y,width:f.w,height:f.h}}),i&&o.jsx("div",{className:"drop-line",style:{left:i.x,top:i.y,width:Math.max(i.w,2*y),height:Math.max(i.h,2*y)}}),o.jsx("button",{className:"el-move","aria-label":u.elementDrag.moveAria,title:u.elementDrag.moveTitle,style:{left:Math.max(0,v.x),top:v.y>=22*y?v.y-22*y:Math.max(0,v.y),transform:`scale(${y})`,transformOrigin:v.y>=22*y?"0 100%":"0 0"},onPointerDown:N("move"),onPointerMove:S,onPointerUp:T,children:o.jsx(ne,{name:"hand",size:12})}),["e","s","se"].map(C=>o.jsx("div",{className:`el-resize ${C}`,role:"slider","aria-label":C==="e"?u.elementDrag.width:C==="s"?u.elementDrag.height:u.elementDrag.size,"aria-valuetext":`${Math.round(v.w)} × ${Math.round(v.h)}`,style:{left:C==="s"?v.x+v.w/2-x/2:v.x+v.w-x/2,top:C==="e"?v.y+v.h/2-x/2:v.y+v.h-x/2,width:x,height:x,borderWidth:1.5*y},onPointerDown:N(C),onPointerMove:S,onPointerUp:T},C))]})}function Ox(a,i,r,f){const h=Hn(a,i),p=h==null?void 0:h.parentElement;if(!h||!p)return null;const y=a.defaultView.getComputedStyle(p),N=/flex/.test(y.display),S=N&&y.flexDirection.startsWith("column"),T=f==="left"||f==="hcenter"||f==="right",v=f==="left"||f==="top"?"start":f==="right"||f==="bottom"?"end":"center",x={start:"flex-start",center:"center",end:"flex-end"}[v],C=(O,X)=>({op:"setStyle",path:i,hash:r,prop:O,value:X});return N&&(T?S:!S)?[C("align-self",x)]:T?v==="start"?[C("margin-left","0"),C("margin-right","auto")]:v==="end"?[C("margin-left","auto"),C("margin-right","0")]:[C("margin-left","auto"),C("margin-right","auto")]:N?v==="start"?[C("margin-top","0"),C("margin-bottom","auto")]:v==="end"?[C("margin-top","auto"),C("margin-bottom","0")]:[C("margin-top","auto"),C("margin-bottom","auto")]:null}function Dx(a){const[i,r]=w.useState(""),[f,h]=w.useState(null),[p,y]=w.useState(!1),[N,S]=w.useState(!1),[T,v]=w.useState(null),[x,C]=w.useState(""),O=w.useRef(null),X=w.useRef(null);w.useLayoutEffect(()=>{Qa(O.current),Qa(X.current,".crumb button, .crumb span[aria-hidden], .oc-cmt button")});const ee=async(P,re=!1)=>{x.trim()&&(await Ce.post("/api/comments",{action:"reply",id:P,text:x,author:a.author,resolve:re}),C(""),v(null))},k=P=>new Date(P).toLocaleString("ko-KR",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}),$=a.selection,J=!!$&&!!a.file&&$.file===a.file,Q=a.comments.filter(P=>!a.file||P.file===a.file),q=Q.filter(P=>!P.resolved).length,I=async()=>{$&&(await navigator.clipboard.writeText(Kb($.file,$.path,$.tag,$.text)).catch(()=>{}),S(!0),setTimeout(()=>S(!1),1200))},ce=async()=>{if(a.file){y(!0);try{const P=await Ce.post("/api/screenshot",{file:a.file,path:$==null?void 0:$.path});h(P.path)}catch(P){h(u.inspector.shotFailed(P.message))}finally{y(!1)}}},se=async()=>{!a.file||!i.trim()||(await Ce.post("/api/comments",{file:a.file,path:($==null?void 0:$.file)===a.file?$.path:"",text:i,author:a.author}),r(""))};return o.jsxs("div",{className:"pp inspector",children:[o.jsxs("div",{className:"pp-scroll",ref:X,children:[J&&$&&o.jsxs("header",{className:"pp-head",children:[o.jsx("span",{className:"pp-file",children:$.file}),o.jsx("h2",{className:"pp-name",children:o.jsxs("span",{children:[u.inspector.kindName($.kind??$.tag),$.label&&` · ${$.label.slice(0,40)}`,a.multi>1&&o.jsxs("span",{className:"muted",children:[" ",u.inspector.more(a.multi-1)]})]})}),o.jsxs("div",{className:"pp-crumb",children:[a.crumbs,$.path.includes("/")&&o.jsx("button",{className:"icon-btn pp-ib","aria-label":u.menu.selectParent,title:u.menu.selectParent,onClick:()=>a.onSelectPath($.path.slice(0,$.path.lastIndexOf("/"))),children:o.jsx(ne,{name:"parent",size:16})})]}),$.text&&!$.label&&o.jsxs("p",{className:"pp-note sel-text",children:["“",$.text.slice(0,120),"”"]})]}),a.error&&o.jsx("p",{className:"pp-note warn",children:a.error}),f&&o.jsx("p",{className:"pp-note muted shot",children:f}),a.children,a.file&&o.jsxs("section",{className:"pp-group oc-cmt","aria-label":u.comments.title,children:[o.jsxs("h3",{className:"pp-group-h",children:[u.comments.title,q>0&&o.jsx("span",{className:"oc-count",children:q})]}),o.jsx("textarea",{ref:a.commentRef,value:i,"aria-label":u.comments.title,placeholder:J&&$?u.comments.placeholderElement($.path):u.comments.placeholderBoard,onChange:P=>r(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.metaKey||P.ctrlKey)&&se()}}),o.jsxs("div",{className:"oc-cmt-bar",children:[o.jsx("button",{className:"btn",onClick:se,disabled:!i.trim(),children:u.comments.add}),o.jsx("button",{className:"btn oc-plain",onClick:a.onAuthor,title:u.comments.authorTitle,children:u.comments.author(a.author)}),!J&&o.jsx("button",{className:"btn oc-plain shot-link",onClick:ce,disabled:p,title:u.inspector.boardScreenshotTitle,children:p?u.inspector.capturing:u.inspector.boardScreenshot})]}),o.jsx("ul",{className:"comments",children:Q.map(P=>o.jsxs("li",{className:`oc-cmt-item ${P.resolved?"resolved":""}`,children:[o.jsxs("div",{className:"c-head",children:[o.jsx("span",{className:"who",children:P.author}),P.path&&o.jsx("button",{className:"btn oc-plain c-path",onClick:()=>a.onSelectPath(P.path),children:P.path}),o.jsx("span",{className:"when",children:k(P.createdAt)})]}),o.jsx("div",{children:P.text}),(P.replies??[]).length>0&&o.jsx("ul",{className:"replies",children:P.replies.map(re=>o.jsxs("li",{children:[o.jsxs("div",{className:"c-head",children:[o.jsx("span",{className:"who",children:re.author}),o.jsx("span",{className:"when",children:k(re.createdAt)})]}),o.jsx("div",{children:re.text})]},re.id))}),T===P.id&&o.jsxs("div",{className:"reply-box",children:[o.jsx("textarea",{autoFocus:!0,value:x,placeholder:u.comments.replyPlaceholder(a.author),"aria-label":u.comments.reply,onChange:re=>C(re.target.value),onKeyDown:re=>{re.nativeEvent.isComposing||(re.key==="Enter"&&(re.metaKey||re.ctrlKey)&&ee(P.id),re.key==="Escape"&&v(null))}}),o.jsxs("div",{className:"oc-cmt-bar",children:[o.jsx("button",{className:"btn",onClick:()=>void ee(P.id),disabled:!x.trim(),children:u.comments.reply}),o.jsx("button",{className:"btn",onClick:()=>void ee(P.id,!0),disabled:!x.trim(),children:u.comments.replyResolve})]})]}),o.jsxs("div",{className:"oc-cmt-bar",children:[T!==P.id&&o.jsx("button",{className:"btn oc-plain",onClick:()=>v(P.id),children:u.comments.reply}),o.jsx("button",{className:"btn oc-plain",onClick:()=>Ce.post("/api/comments",{action:"resolve",id:P.id,resolved:!P.resolved}),children:P.resolved?u.comments.reopen:u.comments.resolve}),!P.resolved&&a.onAskAI&&o.jsx("button",{className:"btn oc-plain",onClick:()=>a.onAskAI(P),title:u.comments.sendToAITitle,children:u.comments.sendToAI})]})]},P.id))})]})]}),J?o.jsxs("footer",{className:"pp-actions","aria-label":u.inspector.actions,ref:O,children:[a.onDuplicate&&o.jsx("button",{className:"btn",onClick:a.onDuplicate,children:u.properties.duplicate}),o.jsx("button",{className:"btn",onClick:I,children:N?u.inspector.copied:u.inspector.copy}),o.jsx("button",{className:"btn",onClick:ce,disabled:p,title:u.inspector.screenshotTitle,children:p?u.inspector.capturing:u.inspector.screenshot}),a.onDelete&&o.jsx("button",{className:"icon-btn pp-del","aria-label":u.properties.delete,title:u.boardOptions.deleteTitleKey,onClick:a.onDelete,children:o.jsx(ne,{name:"trash"})})]}):a.footer]})}const Rx=(a,i)=>a.x<i.x+i.w+(a.w+i.w)/2&&i.x<a.x+a.w+(a.w+i.w)/2&&a.y<i.y+i.h+(a.h+i.h)/2&&i.y<a.y+a.h+(a.h+i.h)/2;function $x(a){const i=new Set,r=[];for(const f of a){if(i.has(f))continue;const h=[f];i.add(f);for(let p=0;p<h.length;p++)for(const y of a)!i.has(y)&&Rx(y,h[p])&&(i.add(y),h.push(y));r.push(a.filter(p=>h.includes(p)))}return r}function Bx(a){const i=Math.min(...a.map(r=>r.y));return a.filter(r=>r.y-i<r.h/2).reduce((r,f)=>f.x<r.x?f:r)}function _x(a){const i=Math.min(...a.map(f=>f.x)),r=Math.min(...a.map(f=>f.y));return{x:i,y:r,w:Math.max(...a.map(f=>f.x+f.w))-i,h:Math.max(...a.map(f=>f.y+f.h))-r}}function Hx(a,i,r,f){const h=new Set(r.map(p=>p??"")).size===1&&r[0]?r[0]:null;return{long:h?f.forkBlockWhile(a,i,h):null,medium:f.forkBlock(a,i),short:f.forkBlockShort(a)}}function Ux(a,i,r,f){if(a.long&&r(a.long)<=i&&!f(r(a.long)))return a.long;for(const h of[a.medium,a.short])if(!f(r(h)))return h;return null}const oh=a=>a.kind==="person"&&a.client===hu,xc=a=>a.by??a.person??u.occupancy.someone,Vy=(a,i)=>(a[i]??[]).filter(r=>r.kind==="agent"&&r.state==="editing");function Lx({list:a}){return o.jsx(o.Fragment,{children:a.map(i=>{const r=oh(i),f=r?u.occupancy.you:i.state==="done"?u.occupancy.done(xc(i),u.occupancy.clock(i.doneAt??Date.now())):i.kind==="person"?u.occupancy.personEditing(xc(i)):u.occupancy.editing(xc(i));return o.jsxs("span",{className:`occ-tag ${r?"you":""} ${i.state==="done"?"done":""}`,"data-occ":i.key,title:f,children:[r?o.jsx("span",{className:"idot","aria-hidden":"true"}):i.state==="editing"&&i.kind==="agent"?o.jsx("span",{className:"spinner","aria-hidden":"true"}):o.jsx(ne,{name:mu(i.kind==="agent"?{by:i.by??""}:{person:i.person??""}),size:16}),o.jsx("span",{className:"act-tag-text",children:f})]},i.key)})})}function Gx(a,i){const r=(a[i]??[]).find(f=>f.state==="editing");return r?{color:oh(r)?"var(--select)":"var(--text)",label:oh(r)?u.occupancy.youListDot:u.occupancy.listDot(xc(r))}:null}function iu(a,i){var p;const r=a.boards[i];if(!r)return null;const f=(y,N)=>Object.keys(a.boards).filter(S=>{var T,v;return S!==y&&((T=a.boards[S].origin)==null?void 0:T.of)===y&&((v=a.boards[S].origin)==null?void 0:v.kind)===N});if((p=r.origin)!=null&&p.of&&a.boards[r.origin.of])return{original:r.origin.of,kind:r.origin.kind,chosen:i,alts:f(r.origin.of,r.origin.kind)};const h=f(i,"fork");return h.length?{original:i,kind:"fork",chosen:i,alts:h}:null}const Yx=(a,i)=>[i.original,...i.alts].flatMap(r=>Vy(a,r))[0]??null,qx=a=>a.replace(/:.*$/,"");function Vx({file:a,group:i,busy:r,open:f,onOpen:h,compact:p=!1}){const y=i.kind==="variant"?u.occupancy.useThis:u.occupancy.useThisOne;return o.jsxs("button",{className:`icon-btn sm use-btn ${r?"":"ready"} ${f?"pressed":""} ${p?"icon-only":""}`,"data-use":a,"aria-disabled":r?!0:void 0,"aria-haspopup":"dialog","aria-expanded":f,"aria-label":p?y:void 0,title:r?u.occupancy.waitFor(xc(r)):p?y:i.kind==="variant"?u.occupancy.useThisTitle:u.occupancy.useThisOneTitle(i.alts.length),onPointerDown:N=>N.stopPropagation(),onDoubleClick:N=>N.stopPropagation(),onClick:N=>{N.stopPropagation(),r||h()},children:[o.jsx(ne,{name:"check",size:14}),!p&&o.jsx("span",{className:"use-label",children:y})]})}function Xx(a){const i=w.useRef(null),[r,f]=w.useState(null),h=()=>document.querySelector(`[data-use="${CSS.escape(a.file)}"]`),p=x=>{var C;return((C=a.board.boards[x])==null?void 0:C.title)??x},y=a.group,N=p(y.original),S=u.occupancy,[T,v]=y.kind==="variant"?[S.confirmVariant(p(y.chosen),N),S.confirmVariantBody(N,y.alts.length-1)]:y.chosen===y.original?[S.confirmKeep(N),S.confirmKeepBody(y.alts.map(p).join(", "),y.alts.length)]:[S.confirmFork(p(y.chosen),N),S.confirmForkBody(N,y.alts.length-1)];return w.useLayoutEffect(()=>{var $,J;const x=h();if(!x)return void a.onClose();const C=x.getBoundingClientRect(),O=(($=i.current)==null?void 0:$.offsetWidth)??288,X=Math.round(Math.max(8,Math.min(C.right-O,window.innerWidth-O-8))),ee=((J=i.current)==null?void 0:J.offsetHeight)??120,k=Math.round(Math.max(8,Math.min(C.bottom+8,window.innerHeight-ee-8)));(!r||r.x!==X||r.y!==k)&&f({x:X,y:k})}),w.useEffect(()=>{var C,O;(O=(C=i.current)==null?void 0:C.querySelector("button"))==null||O.focus();const x=X=>{var k,$;const ee=X.target;(k=i.current)!=null&&k.contains(ee)||($=h())!=null&&$.contains(ee)||a.onClose()};return window.addEventListener("pointerdown",x,!0),()=>window.removeEventListener("pointerdown",x,!0)},[a.file]),o.jsxs("div",{ref:i,className:"menu confirm entering",role:"dialog","aria-label":T,style:{left:(r==null?void 0:r.x)??-9999,top:(r==null?void 0:r.y)??-9999},onKeyDown:x=>{var C;x.key==="Escape"&&(x.stopPropagation(),a.onClose(),(C=h())==null||C.focus())},children:[o.jsx("p",{className:"c-title",children:T}),o.jsx("p",{className:"c-body",children:v}),o.jsxs("div",{className:"btn-row",children:[o.jsx("button",{className:"btn oc-strong",disabled:a.busy,onClick:a.onApply,children:S.apply}),o.jsx("button",{className:"btn oc-plain",disabled:a.busy,onClick:a.onKeepAll,children:y.kind==="variant"||y.alts.length>1?S.keepAll:S.keepBoth})]})]})}function Kx({board:a,files:i,zoom:r}){const f=new Set(i),h=new Map;for(const p of i){const y=a.boards[p].origin;(y==null?void 0:y.kind)==="fork"&&f.has(y.of)&&a.boards[y.of]&&h.set(y.of,[...h.get(y.of)??[],{...a.boards[p],f:p}])}return h.size?o.jsx(o.Fragment,{children:[...h].flatMap(([p,y])=>$x(y).map(N=>o.jsx(Zx,{of:p,from:a.boards[p],forks:N,zoom:Math.max(r,.05),board:a},N.map(S=>S.f).join(" "))))}):null}function Zx({of:a,from:i,forks:r,zoom:f,board:h}){const p=w.useRef(null),y=w.useRef(null),N=Bx(r),S=_x(r),T=r.length,v=i.title??a,x=Hx(T,v,r.map(P=>{var re;return(re=P.origin)==null?void 0:re.while}),u.occupancy),[C,O]=w.useState(x.medium),X={left:S.x,top:S.y+S.h+10/f,transform:`scale(${1/f})`,transformOrigin:"0 0"};w.useLayoutEffect(()=>{var xe;const P=y.current,re=(xe=p.current)==null?void 0:xe.getBoundingClientRect();if(!P||!re)return;const Se=document.createElement("canvas").getContext("2d"),Ne=getComputedStyle(P),mt=parseFloat(Ne.paddingLeft)+parseFloat(Ne.paddingRight);Se&&(Se.font=`${Ne.fontWeight} ${Ne.fontSize} ${Ne.fontFamily}`);const Ct=parseFloat(Ne.lineHeight)||16,_t=re.left+S.x*f,st=re.top+(S.y+S.h)*f+10,fe=[...document.querySelectorAll(".canvas .note, .canvas .board-frame, .canvas .board-label")].map(_e=>_e.getBoundingClientRect()),ye=Ux(x,S.w*f,_e=>(Se?Se.measureText(_e).width:_e.length*7)+mt,_e=>fe.some(ke=>ke.left<_t+_e&&ke.right>_t&&ke.top<st+Ct&&ke.bottom>st));ye!==C&&O(ye)},[f,S.x,S.y,S.w,S.h,x.long,x.medium,x.short,h]);const ee=Qx(i,N),k=ee[ee.length-1],$=ee[0];if(Math.hypot(k.x-$.x,k.y-$.y)<4)return null;const J=1.5/f,Q=ee[ee.length-2],q=Math.atan2(k.y-Q.y,k.x-Q.x),I=6/f,ce=Math.min(...ee.map(P=>P.x))-I,se=Math.min(...ee.map(P=>P.y))-I;return o.jsxs("div",{ref:p,className:"fork-link","data-fork":N.f,"data-forks":r.map(P=>P.f).join(" "),"aria-label":x.long??x.medium,role:"img",children:[o.jsx("svg",{className:"fork-svg",style:{left:ce,top:se,width:Math.max(...ee.map(P=>P.x))+I-ce,height:Math.max(...ee.map(P=>P.y))+I-se},"aria-hidden":"true",children:o.jsxs("g",{transform:`translate(${-ce} ${-se})`,children:[o.jsx("path",{d:ee.map((P,re)=>`${re?"L":"M"}${P.x} ${P.y}`).join(""),strokeWidth:J,strokeDasharray:`${4*J} ${4*J}`}),o.jsx("path",{d:`M${k.x-I*Math.cos(q-.6)} ${k.y-I*Math.sin(q-.6)}L${k.x} ${k.y}L${k.x-I*Math.cos(q+.6)} ${k.y-I*Math.sin(q+.6)}`,strokeWidth:J})]})}),o.jsx("div",{className:"fork-caption",style:{...X,visibility:C?void 0:"hidden"},"aria-hidden":"true",children:o.jsx("span",{ref:y,children:C??x.short})})]})}function Qx(a,i){const r=Math.max(a.y,i.y)+Math.min(48,Math.min(a.h,i.h)/4),f=r<Math.min(a.y+a.h,i.y+i.h);if(f&&i.x>=a.x+a.w)return[{x:a.x+a.w+8,y:r},{x:i.x-8,y:r}];if(f&&i.x+i.w<=a.x)return[{x:a.x-8,y:r},{x:i.x+i.w+8,y:r}];const h=N=>Math.min(48,N.h/4);if(i.x<a.x+a.w&&i.x+i.w>a.x){const N=Math.min(a.x,i.x)-40,S=i.y>=a.y,T=S?a.y+a.h-h(a):a.y+h(a),v=S?i.y+h(i):i.y+i.h-h(i);return[{x:a.x-8,y:T},{x:N,y:T},{x:N,y:v},{x:i.x-8,y:v}]}const p={x:a.x+a.w/2,y:a.y+a.h/2},y={x:i.x+i.w/2,y:i.y+i.h/2};return i.y>=a.y+a.h?[{x:p.x,y:a.y+a.h+8},{x:y.x,y:i.y-8}]:[{x:p.x,y:a.y-8},{x:y.x,y:i.y+i.h+8}]}const Zf=a=>a.includes("/")?a.slice(0,a.lastIndexOf("/")):"",my=a=>Number(a.split("/").pop());function Fx(a){var Q;const[i,r]=w.useState([]),[f,h]=w.useState({0:!0}),[p,y]=w.useState(null),[N,S]=w.useState(null),[T,v]=w.useState(null);w.useEffect(()=>{Ce.get(`/api/outline?f=${encodeURIComponent(a.file)}`).then(q=>r(q.tree)).catch(()=>r([]))},[a.file,a.version]),w.useEffect(()=>{const q={};for(const I of a.selected){const ce=I.split("/");for(let se=1;se<ce.length;se++)q[ce.slice(0,se).join("/")]=!0}Object.keys(q).length&&h(I=>({...I,...q}))},[a.selected.join("|")]);const x=q=>{if(!p||p===q||q.startsWith(p+"/"))return;const I=Zf(q);let ce=my(q);Zf(p)===I&&my(p)<ce&&(ce-=1),a.onMove(p,I,ce)},C=[],O=new Map,X=q=>{for(const I of q)C.push(I),O.set(I.path,I),I.children.length&&f[I.path]&&X(I.children)};X(i);const ee=T??a.selected[a.selected.length-1]??((Q=C[0])==null?void 0:Q.path)??null,k=q=>{q==null||!O.has(q)||(v(q),a.onSelect(q,!1))},$=q=>{if(!ee)return;const I=C.findIndex(re=>re.path===ee),ce=O.get(ee),P={ArrowDown:()=>{var re;return k((re=C[I+1])==null?void 0:re.path)},ArrowUp:()=>{var re;return k((re=C[I-1])==null?void 0:re.path)},ArrowRight:()=>ce!=null&&ce.children.length?f[ee]?k(ce.children[0].path):h(re=>({...re,[ee]:!0})):void 0,ArrowLeft:()=>ce!=null&&ce.children.length&&f[ee]?h(re=>({...re,[ee]:!1})):k(ee.includes("/")?Zf(ee):null),Home:()=>{var re;return k((re=C[0])==null?void 0:re.path)},End:()=>{var re;return k((re=C[C.length-1])==null?void 0:re.path)},Enter:()=>k(ee)," ":()=>k(ee)}[q.key];P&&(q.preventDefault(),q.stopPropagation(),P())},J=(q,I)=>{const ce=q.children.length>0,se=f[q.path];return o.jsxs("li",{children:[o.jsxs("div",{role:"treeitem","aria-selected":a.selected.includes(q.path),"aria-expanded":ce?!!se:void 0,"aria-level":I+1,className:`layer ${a.selected.includes(q.path)?"on":""} ${N===q.path?"over":""} ${ee===q.path?"kbd-focus":""}`,style:{paddingLeft:8+I*16},draggable:!0,onDragStart:P=>{y(q.path),P.dataTransfer.effectAllowed="move"},onDragEnd:()=>{y(null),S(null)},onDragOver:P=>{p&&(P.preventDefault(),S(q.path))},onDragLeave:()=>S(P=>P===q.path?null:P),onDrop:P=>{P.preventDefault(),x(q.path),S(null)},onClick:P=>{v(q.path),a.onSelect(q.path,P.shiftKey)},children:[o.jsx("button",{className:"twisty",tabIndex:-1,"aria-label":se?u.layers.collapse:u.layers.expand,style:{visibility:ce?"visible":"hidden"},onClick:P=>{P.stopPropagation(),h(re=>({...re,[q.path]:!se}))},children:o.jsx(ne,{name:se?"chevronDown":"chevronRight",size:14})}),o.jsx("span",{className:"tag",children:q.tag}),o.jsxs("span",{className:"lname",children:[q.cls&&`.${q.cls}`,q.cls&&q.text&&" · ",q.text]})]}),ce&&se&&o.jsx("ul",{children:q.children.map(P=>J(P,I+1))})]},q.path)};return o.jsxs("section",{className:"pp-group layers",children:[o.jsx("h3",{className:"pp-group-h",title:u.layers.hint,children:u.layers.title}),o.jsx("ul",{className:"layer-tree",role:"tree","aria-label":u.layers.title,title:u.layers.hint,tabIndex:0,onKeyDown:$,children:i.map(q=>J(q,0))})]})}const Jx=12,gy=a=>{var i;return((i=/^([a-z]+)[-_]/i.exec(a))==null?void 0:i[1].toUpperCase())??""},Ix=w.forwardRef(function(i,r){var k;const[f,h]=w.useState(""),[p,y]=w.useState(null),[N,S]=w.useState(null),T=(k=i.pages[0])==null?void 0:k.id,v=w.useMemo(()=>{const $=f.trim().toLowerCase();return[...new Set(i.board.order)].filter(J=>{const Q=i.board.boards[J];return Q?$?J.toLowerCase().includes($)||(Q.title??"").toLowerCase().includes($):!i.pages.length||(Q.page??T)===i.currentPage:!1})},[f,i.board,i.pages,i.currentPage,T]),x=w.useMemo(()=>{if(f.trim()||v.length<Jx)return null;const $=new Map;for(const q of v){const I=gy(q);$.has(I)||$.set(I,[]),$.get(I).push(q)}const J=[...$.keys()].filter(q=>q&&$.get(q).length>=2);if(J.length<2)return null;const Q=v.filter(q=>!J.includes(gy(q)));return[...J.map(q=>({key:q,label:q,files:$.get(q)})),...Q.length?[{key:"",label:u.boardList.otherGroup,files:Q}]:[]]},[v,f]),[C,O]=w.useState(()=>{try{return JSON.parse(localStorage.getItem("design-canvas:groups-closed")??"{}")}catch{return{}}}),X=$=>O(J=>{const Q={...J,[$]:!J[$]};try{localStorage.setItem("design-canvas:groups-closed",JSON.stringify(Q))}catch{}return Q}),ee=$=>{var I;const J=i.board.boards[$],Q=!!J.title&&J.title!==$.replace(/\.html$/,""),q=(I=i.dotOf)==null?void 0:I.call(i,$);return o.jsx("li",{children:o.jsxs("button",{className:`row oc-row ${i.selected.includes($)?"on":""}`,"aria-current":i.selected.includes($)||void 0,onClick:ce=>i.onPick($,ce.shiftKey||ce.metaKey),onContextMenu:ce=>{i.onBoardMenu&&(ce.preventDefault(),i.onBoardMenu($,ce))},title:$,children:[o.jsx("span",{className:"row-title",children:J.title??$}),i.missing.includes($)&&o.jsx(ne,{name:"warn",size:14,className:"warn-icon","aria-label":u.boardList.fileMissing}),q&&o.jsx("span",{className:"idot occ-dot",style:{background:q.color},role:"img","aria-label":q.label,title:q.label}),Q&&o.jsx("span",{className:"row-file",children:$})]})},$)};return o.jsxs("aside",{className:i.className??"left",style:i.style,"aria-label":u.boardList.aria,children:[i.header,i.showPages!==!1&&o.jsxs("section",{className:"left-pages",children:[o.jsxs("div",{className:"oc-sec",children:[o.jsx("span",{children:u.boardList.pages}),i.onAddPage&&o.jsx("button",{className:"icon-btn oc-ib","aria-label":u.boardList.addPage,title:u.boardList.addPage,onClick:i.onAddPage,children:o.jsx(ne,{name:"plus",size:16})})]}),i.pages.length===0?o.jsx("p",{className:"oc-empty",children:u.boardList.singlePage}):o.jsx("ul",{className:"oc-list",role:"tablist","aria-label":u.boardList.pages,children:i.pages.map(($,J)=>o.jsx("li",{draggable:!!i.onMovePage,onDragStart:Q=>{y($.id),Q.dataTransfer.effectAllowed="move"},onDragOver:Q=>{p&&(Q.preventDefault(),S(J))},onDragEnd:()=>{y(null),S(null)},onDrop:Q=>{var I;Q.preventDefault();const q=i.pages.findIndex(ce=>ce.id===p);p&&q!==J&&((I=i.onMovePage)==null||I.call(i,p,J)),y(null),S(null)},children:o.jsxs("button",{role:"tab",title:u.boardList.pageTabTitle,"aria-selected":$.id===i.currentPage,className:`row oc-row ${$.id===i.currentPage?"on":""} ${N===J&&p!==$.id?"drop-before":""}`,onClick:()=>i.onPage($.id),onContextMenu:Q=>{i.onPageMenu&&(Q.preventDefault(),i.onPageMenu($.id,Q))},children:[o.jsx("span",{className:"row-title",children:$.name}),o.jsx("span",{className:"row-count",children:Object.values(i.board.boards).filter(Q=>(Q.page??T)===$.id).length})]})},$.id))})]}),o.jsxs("section",{className:"left-boards",children:[o.jsx("div",{className:"oc-sec",children:o.jsxs("span",{children:[u.boardList.boardsHead,o.jsx("span",{className:"oc-count",children:v.length})]})}),o.jsxs("label",{className:"oc-search",children:[o.jsx(ne,{name:"search",size:16}),o.jsx("input",{ref:r,value:f,placeholder:u.boardList.searchPlaceholder,"aria-label":u.boardList.search,onChange:$=>h($.target.value),onKeyDown:$=>{$.nativeEvent.isComposing||($.key==="Enter"&&v[0]&&i.onPick(v[0],!1),$.key==="Escape"&&(h(""),$.target.blur()))}})]}),v.length===0?o.jsx("p",{className:"oc-empty",children:f?u.boardList.noMatch(f):u.boardList.emptyPage}):x?o.jsx("ul",{className:"oc-list board-list",children:x.map($=>{var Q;const J=!C[$.key]||$.files.some(q=>i.selected.includes(q));return o.jsxs("li",{className:`group ${J?"open":""}`,children:[o.jsxs("div",{className:"row oc-row group-head",role:"button",tabIndex:0,"aria-expanded":J,title:u.boardList.groupTitle($.files.length),onClick:()=>X($.key),onKeyDown:q=>{(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),X($.key))},onDoubleClick:()=>{var q;return $.key&&((q=i.onGroupRename)==null?void 0:q.call(i,$.key))},onContextMenu:q=>{i.onGroupMenu&&(q.preventDefault(),i.onGroupMenu($.key,$.files,q))},children:[o.jsx(ne,{name:"chevronRight",size:14,className:"chev"}),o.jsx("span",{className:"row-title",children:$.key&&((Q=i.board.groupNames)==null?void 0:Q[$.key])||$.label}),o.jsx("span",{className:"row-count",children:$.files.length}),i.onGroupMenu&&o.jsx("button",{className:"icon-btn sm group-more","aria-label":u.boardList.groupMenu,title:u.boardList.groupMenu,onClick:q=>{q.stopPropagation();const I=q.currentTarget.getBoundingClientRect();i.onGroupMenu($.key,$.files,{clientX:I.left,clientY:I.bottom+4})},children:o.jsx(ne,{name:"more",size:14})})]}),J&&o.jsx("ul",{className:"oc-list oc-sub",children:$.files.map(ee)})]},$.key)})}):o.jsx("ul",{className:"oc-list board-list",children:v.map(ee)})]}),i.footer]})});function Wx({rects:a,selected:i,view:r,size:f,onJump:h,w:p=200,h:y=130,inset:N=0,className:S="minimap"}){const T=w.useMemo(()=>{if(!a.length)return{x:0,y:0,w:1,h:1};const k=Math.min(...a.map(J=>J.x)),$=Math.min(...a.map(J=>J.y));return{x:k,y:$,w:Math.max(...a.map(J=>J.x+J.w))-k,h:Math.max(...a.map(J=>J.y+J.h))-$}},[a]),v=Math.min((p-N*2)/T.w,(y-N*2)/T.h),x=(p-T.w*v)/2,C=(y-T.h*v)/2,O={x:(-r.x/r.zoom-T.x)*v+x,y:(-r.y/r.zoom-T.y)*v+C,w:Math.max(0,f.w/r.zoom*v),h:Math.max(0,f.h/r.zoom*v)},X=w.useRef(!1),ee=k=>{const $=k.currentTarget.getBoundingClientRect(),J=$.width/p;h(((k.clientX-$.left)/J-x)/v+T.x,((k.clientY-$.top)/J-C)/v+T.y)};return o.jsx("div",{className:`${S} ${a.length>30?"many":""}`,role:"img","aria-label":u.minimap.aria,onPointerDown:k=>{X.current=!0,k.currentTarget.setPointerCapture(k.pointerId),ee(k)},onPointerMove:k=>X.current&&ee(k),onPointerUp:()=>X.current=!1,children:o.jsxs("svg",{width:p,height:y,children:[a.map(k=>o.jsx("rect",{x:(k.x-T.x)*v+x,y:(k.y-T.y)*v+C,width:Math.max(1,k.w*v),height:Math.max(1,k.h*v),rx:2,className:i.includes(k.file)?"mm-sel":"mm-board"},k.file)),o.jsx("rect",{x:Math.round(O.x)+.5,y:Math.round(O.y)+.5,width:Math.max(0,Math.round(O.w)-1),height:Math.max(0,Math.round(O.h)-1),rx:3,className:"mm-view"})]})})}function Px(a){const i=a.item,r=u.boardOptions,f=(h,p,y,N,S=!1)=>o.jsx(t1,{label:p,bare:S,value:i[h]??0,min:y,max:N,onCommit:T=>a.onPatch({[h]:T})},h+a.file+(i[h]??""));return o.jsxs(o.Fragment,{children:[o.jsxs("header",{className:"pp-head","aria-label":r.aria,children:[o.jsx("button",{className:"pp-file",onClick:a.onRenameFile,title:r.renameFileTitle,children:a.file}),o.jsxs("h2",{className:"pp-name",children:[o.jsx("span",{children:i.title??a.file}),o.jsx("button",{className:"icon-btn pp-ib","aria-label":u.menu.rename,title:r.renameTitle,onClick:a.onRename,children:o.jsx(ne,{name:"edit",size:16})})]})]}),o.jsxs("section",{className:"pp-group",children:[o.jsx("h3",{className:"pp-group-h",children:r.positionAndSize}),o.jsxs("div",{className:"pp-row",children:[o.jsx("span",{className:"pp-l",children:r.position}),o.jsxs("span",{className:"pp-two",children:[f("x","X"),f("y","Y")]})]}),o.jsxs("div",{className:"pp-row",children:[o.jsx("span",{className:"pp-l",children:u.boardOptions.size}),o.jsxs("span",{className:"pp-two",children:[f("w",r.width,40,8e3),f("h",r.height,40,8e3)]})]}),o.jsxs("div",{className:"pp-row",children:[o.jsx("span",{className:"pp-l",children:r.radius}),o.jsx("span",{className:"pp-two",children:f("radius",r.radius,0,200,!0)})]})]}),o.jsxs("section",{className:"pp-group",children:[o.jsx("h3",{className:"pp-group-h",children:r.options}),o.jsx(su,{on:!!i.is_interactive,label:r.interactive,title:r.interactiveTitle,onChange:h=>a.onPatch({is_interactive:h||void 0})}),o.jsx(su,{on:!!i.frameless,label:r.frameless,onChange:h=>a.onPatch({frameless:h||void 0})}),o.jsx(su,{on:i.expand==="fill",label:r.fill,onChange:h=>a.onPatch({expand:h?"fill":void 0})}),o.jsx(su,{on:a.isLaunch,label:r.launch,onChange:a.onLaunch}),a.pages.length>0&&o.jsxs("label",{className:"pp-row",children:[o.jsx("span",{className:"pp-l",children:r.page}),o.jsx("select",{value:i.page??a.pages[0].id,onChange:h=>a.onPatch({page:h.target.value}),children:a.pages.map(h=>o.jsx("option",{value:h.id,children:h.name},h.id))})]})]})]})}function e1(a){const i=u.boardOptions;return o.jsxs("footer",{className:"pp-actions","aria-label":u.inspector.boardActions,children:[o.jsx("button",{className:"icon-btn","aria-label":i.focus,title:i.focusTitle,onClick:a.onFocus,children:o.jsx(ne,{name:"focus"})}),o.jsx("button",{className:"icon-btn","aria-label":i.duplicate,title:i.duplicateTitle,onClick:a.onDuplicate,children:o.jsx(ne,{name:"copy"})}),o.jsx("button",{className:"icon-btn","aria-label":i.front,title:i.frontTitle,onClick:a.onFront,children:o.jsx(ne,{name:"front"})}),o.jsx("button",{className:"icon-btn","aria-label":i.back,title:i.backTitle,onClick:a.onBack,children:o.jsx(ne,{name:"back"})}),o.jsx("button",{className:"icon-btn pp-del","aria-label":i.delete,title:i.deleteTitleKey,onClick:a.onDelete,children:o.jsx(ne,{name:"trash"})})]})}function su(a){return o.jsxs("label",{className:"check",title:a.title,children:[o.jsx("input",{type:"checkbox",checked:a.on,onChange:i=>a.onChange(i.target.checked)}),o.jsx("i",{className:a.on?"on":"","aria-hidden":"true",children:a.on&&o.jsx(ne,{name:"check",size:12})}),a.label]})}function t1({label:a,value:i,min:r,max:f,bare:h,onCommit:p}){const[y,N]=w.useState(String(i));w.useEffect(()=>N(String(i)),[i]);const S=()=>{let T=Math.round(Number(y));if(!Number.isFinite(T))return N(String(i));r!=null&&(T=Math.max(r,T)),f!=null&&(T=Math.min(f,T)),T!==i&&p(T),N(String(T))};return o.jsxs("label",{className:"num",children:[!h&&o.jsx("span",{children:a}),o.jsx("input",{inputMode:"numeric","aria-label":h?a:void 0,value:y,onChange:T=>N(T.target.value),onBlur:S,onKeyDown:T=>{if(!T.nativeEvent.isComposing&&(T.key==="Enter"&&T.target.blur(),T.key==="ArrowUp"||T.key==="ArrowDown")){T.preventDefault();const v=Number(y)+(T.key==="ArrowUp"?1:-1)*(T.shiftKey?10:1);N(String(v))}}})]})}function n1({board:a,file:i,onClose:r,onNav:f}){const h=a.boards[i],p=w.useRef(null),[y,N]=w.useState(1),S=[...new Set(a.order)].filter(x=>a.boards[x]),T=S.indexOf(i);if(w.useEffect(()=>{const x=C=>{C.key==="Escape"&&r(),C.key==="ArrowRight"&&S[T+1]&&f(S[T+1]),C.key==="ArrowLeft"&&S[T-1]&&f(S[T-1])};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[i,r,f,T,S]),w.useEffect(()=>{const x=()=>{const C=p.current;!C||!h||N(Math.min(1,(C.clientWidth-48)/h.w,(C.clientHeight-48)/h.h))};return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[h]),!h)return null;const v=h.expand==="fill";return o.jsxs("div",{className:"focus",role:"dialog","aria-modal":"true","aria-label":u.focus.aria(h.title??i),children:[o.jsxs("div",{className:"focus-bar",children:[o.jsx("button",{className:"icon-btn","aria-label":u.focus.prev,disabled:!S[T-1],onClick:()=>f(S[T-1]),children:o.jsx(ne,{name:"chevronRight",style:{transform:"rotate(180deg)"}})}),o.jsx("button",{className:"icon-btn","aria-label":u.focus.next,disabled:!S[T+1],onClick:()=>f(S[T+1]),children:o.jsx(ne,{name:"chevronRight"})}),o.jsx("strong",{children:h.title??i}),o.jsxs("span",{className:"muted",children:[i,v?u.focus.pageStyle:` · ${h.w}×${h.h} · ${Math.round(y*100)}%`]}),o.jsx("div",{className:"spacer"}),o.jsxs("button",{onClick:r,children:[u.focus.close," ",o.jsx("kbd",{children:"Esc"})]})]}),o.jsx("div",{ref:p,className:`focus-stage ${v?"fill":""}`,children:v?o.jsx("iframe",{src:`/screens/${i}`,title:h.title??i,className:"focus-fill"}):o.jsx("div",{className:"focus-frame",style:{width:h.w*y,height:h.h*y,borderRadius:(h.radius??0)*y},children:o.jsx("iframe",{src:`/screens/${i}`,title:h.title??i,style:{width:h.w,height:h.h,transform:`scale(${y})`,transformOrigin:"0 0"}})})})]})}function py({store:a,...i}){return o.jsx(Wx,{...i,view:dh(a)})}const yy="https://screens.invalid/",a1=a=>a.split("/").map(encodeURIComponent).join("/");function l1({board:a,file:i,onClose:r,onLocate:f,screens:h=Ay}){var k;const p=w.useRef(null),[y,N]=w.useState(i),[S,T]=w.useState({list:[i],i:0}),v=!!h.html,x=v?S.list[S.i]:y,C=a.boards[x]??a.boards[i],O=$=>T(J=>({list:[...J.list.slice(0,J.i+1),$],i:J.i+1})),X=$=>{var J,Q,q,I;if(v)return T(ce=>({...ce,i:Math.max(0,Math.min(ce.list.length-1,ce.i+$))}));try{$<0?(Q=(J=p.current)==null?void 0:J.contentWindow)==null||Q.history.back():(I=(q=p.current)==null?void 0:q.contentWindow)==null||I.history.forward()}catch{}},ee=()=>{var J,Q,q;let $=null;try{$=((J=p.current)==null?void 0:J.contentDocument)??null}catch{}if($==null||$.addEventListener("click",I=>{var P,re,Se;const ce=(re=(P=I.target)==null?void 0:P.closest)==null?void 0:re.call(P,"a[href]");if(!ce)return;if(v){const Ne=new URL(ce.getAttribute("href")??"",yy+a1(x));if(Ne.href.startsWith(yy)){const mt=decodeURIComponent(Ne.pathname.slice(1));if(mt===x&&Ne.hash)return;I.preventDefault(),((Se=h.html)==null?void 0:Se.call(h,mt))!=null&&O(mt);return}I.preventDefault(),window.open(Ne.href,"_blank","noopener");return}const se=new URL(ce.href,$.baseURI);se.origin!==location.origin&&(I.preventDefault(),window.open(se.href,"_blank","noopener"))}),!v)try{const I=new URL(h.url(""),location.href).href,ce=((q=(Q=p.current)==null?void 0:Q.contentWindow)==null?void 0:q.location.href)??"";ce.startsWith(I)&&N(decodeURIComponent(ce.slice(I.length).split(/[?#]/)[0]))}catch{}};return w.useEffect(()=>{const $=J=>J.key==="Escape"&&r();return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[r]),o.jsxs("div",{className:"play",onPointerDown:$=>$.target===$.currentTarget&&r(),children:[o.jsxs("div",{className:"play-bar",children:[o.jsx("button",{onClick:()=>X(-1),title:u.play.back,disabled:v&&S.i===0,children:"←"}),o.jsx("button",{onClick:()=>X(1),title:u.play.forward,disabled:v&&S.i>=S.list.length-1,children:"→"}),o.jsx("strong",{children:(C==null?void 0:C.title)??x}),o.jsx("span",{className:"muted",children:x}),o.jsx("div",{className:"spacer"}),o.jsx("button",{onClick:()=>{f(x),r()},children:u.play.viewOnCanvas}),o.jsx("button",{onClick:r,title:u.play.closeTitle,children:u.play.close})]}),o.jsx("iframe",{ref:p,className:"play-frame",src:v?void 0:h.url(i),srcDoc:v?(k=h.html)==null?void 0:k.call(h,x):void 0,title:u.viewer.play,onLoad:ee,style:{width:Math.min((C==null?void 0:C.w)??390,window.innerWidth-32)}})]})}function i1(a,i){return a.length===1&&Object.hasOwn(i,a[0])?"play":"pen"}function s1(a){return(a.split(/[\\/]/).pop()||"board.html").replace(/\.html?$/i,"")+".png"}function o1(a,i){return a===501||/executable doesn't exist|playwright install|playwright is not installed|failed to launch|browserType\.launch/i.test(i)?"browser":"render"}const c1=a=>(a.split(`
66
+ `)[0]??"").trim().slice(0,140),yt=u.design,r1=[{prop:"width",label:u.properties.fields.width},{prop:"height",label:u.properties.fields.height},{prop:"margin",label:"margin"},{prop:"color",label:u.properties.fields.color,color:!0},{prop:"background",label:u.properties.fields.background,color:!0},{prop:"display",label:"display",options:["","block","flex","grid","inline-flex","none"]},{prop:"flex-direction",label:u.properties.fields.flexDirection,options:["","row","column"]},{prop:"align-items",label:u.properties.fields.alignItems,options:["","flex-start","center","flex-end","stretch","baseline"]},{prop:"justify-content",label:u.properties.fields.justifyContent,options:["","flex-start","center","flex-end","space-between"]},{prop:"flex-wrap",label:u.properties.fields.flexWrap,options:["","nowrap","wrap"]},{prop:"flex-grow",label:u.properties.fields.flexGrow,options:["","0","1"]},{prop:"align-self",label:u.properties.fields.alignSelf,options:["","auto","flex-start","center","flex-end","stretch"]},{prop:"line-height",label:u.properties.fields.lineHeight},{prop:"text-align",label:u.properties.fields.textAlign,options:["","left","center","right"]},{prop:"border",label:u.properties.fields.border},{prop:"box-shadow",label:u.properties.fields.boxShadow},{prop:"opacity",label:u.properties.fields.opacity}];function vy(a){if(!a||a==="none")return null;const i=a.match(/^\s*repeat\(\s*(\d+)\s*,/);if(i)return Number(i[1]);let r=0,f=0,h=!1;for(const p of a)p==="("&&r++,p===")"&&r--,/\s/.test(p)&&r===0?h=!1:h||(h=!0,f++);return f||null}const u1=a=>`repeat(${a}, minmax(0, 1fr))`,d1=[{dir:"left",label:u.properties.alignButtons.left,icon:"alignLeft"},{dir:"hcenter",label:u.properties.alignButtons.hcenter,icon:"alignHcenter"},{dir:"right",label:u.properties.alignButtons.right,icon:"alignRight"},{dir:"top",label:u.properties.alignButtons.top,icon:"alignTop"},{dir:"vcenter",label:u.properties.alignButtons.vcenter,icon:"alignVcenter"},{dir:"bottom",label:u.properties.alignButtons.bottom,icon:"alignBottom"}],f1={a:["href"],img:["src","alt"],input:["placeholder"],button:["aria-label"]};function h1(a){var ee;const i=a.selection,r=f1[i.tag]??[],f=Yy(a.tokens),h=qy(i,a.inline),p=!!i.text.trim(),[y,N]=w.useState(null);w.useEffect(()=>N(null),[i.file,i.path]);const S=i.path+i.hash,T=k=>dy(k,a.inline[k]??"",a.tokens),v=k=>{var J;const $=Un(k);return $==="#FFFFFF"?yt.white:$==="#000000"?yt.black:((J=wc(k,f))==null?void 0:J.name)??$??k},x=Un(i.styles["background-color"]),C=p?h.prop==="background"?cu(i.styles.color??"",x??a.bg):cu(i.styles.color??"",a.bg):null,O=C==null?null:h.prop==="background"?yt.contrastWith(C.toFixed(1),v(i.styles.color??""),yt.grade(C)):yt.contrastOn(C.toFixed(1),v(a.bg),yt.grade(C)),X=[...new Set([...(ee=a.tokens)!=null&&ee.registered?a.tokens.fontWeights:[],100,200,300,400,500,600,700,800,900])].sort((k,$)=>k-$);return o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"pp-group",children:[o.jsx("h3",{className:"pp-group-h",children:yt.fill}),o.jsx(ki,{word:yt.color,css:h.css,children:o.jsx(by,{value:h.value,computed:h.prop==="color"?i.styles.color:i.styles["background-color"],colors:f,css:h.css,label:yt.fill,open:y==="fill",onToggle:()=>N(k=>k==="fill"?null:"fill")})}),O&&o.jsx("div",{className:"pp-row",children:o.jsx("span",{className:`pp-note contrast ${C>=4.5?"ok":C>=3?"mid":"bad"}`,title:u.properties.contrastTitle,children:O})}),y==="fill"&&o.jsx(sh,{title:yt.fill,value:h.value,colors:f,vars:a.vars,onPick:k=>a.onStyle(h.css,k)})]}),p&&o.jsxs("section",{className:"pp-group",children:[o.jsx("h3",{className:"pp-group-h",children:yt.text}),o.jsx(ki,{word:yt.font,css:"font-family",children:o.jsx(mc,{label:yt.font,value:Fp(a.inline["font-family"]),placeholder:Fp(i.styles["font-family"]),onCommit:k=>a.onStyle("font-family",k?g0(k):"")},"ff"+S)}),o.jsx(ki,{word:yt.size,css:"font-size",warn:T("font-size"),children:o.jsx(mc,{label:yt.size,value:Za(a.inline["font-size"]),placeholder:Za(i.styles["font-size"]),onCommit:k=>a.onStyle("font-size",Qf(k))},"fs"+S)}),o.jsx(ki,{word:yt.weight,css:"font-weight",warn:T("font-weight"),children:o.jsxs("select",{"aria-label":yt.weight,defaultValue:a.inline["font-weight"]??"",onChange:k=>a.onStyle("font-weight",k.target.value),children:[o.jsx("option",{value:"",children:yt.inherited(eh(i.styles["font-weight"],yt.weights))}),X.map(k=>o.jsx("option",{value:String(k),children:eh(k,yt.weights)},k))]},"fw"+S)}),h.prop==="background"&&o.jsxs(o.Fragment,{children:[o.jsx(ki,{word:yt.color,css:"color",children:o.jsx(by,{value:a.inline.color??"",computed:i.styles.color,colors:f,css:"color",label:yt.color,open:y==="color",onToggle:()=>N(k=>k==="color"?null:"color")})}),y==="color"&&o.jsx(sh,{title:yt.color,value:a.inline.color||i.styles.color||"",colors:f,vars:a.vars,onPick:k=>a.onStyle("color",k)})]})]}),o.jsxs("section",{className:"pp-group",children:[o.jsx("h3",{className:"pp-group-h",children:u.properties.layout}),o.jsx(ki,{word:yt.cornerRadius,css:"border-radius",warn:T("border-radius"),children:o.jsx(mc,{label:yt.cornerRadius,value:Za(a.inline["border-radius"]),placeholder:Za(i.styles["border-radius"]),onCommit:k=>a.onStyle("border-radius",Qf(k))},"br"+S)}),o.jsx(ki,{word:yt.padding,css:"padding",warn:T("padding"),children:o.jsx(mc,{label:yt.padding,value:Pf(a.inline.padding),placeholder:Pf(i.styles.padding),onCommit:k=>a.onStyle("padding",h0(k))},"pd"+S)}),o.jsx(ki,{word:yt.gap,css:"gap",warn:T("gap"),children:o.jsx(mc,{label:yt.gap,value:Za(a.inline.gap),placeholder:Za(i.styles.gap==="normal"?"":i.styles.gap),onCommit:k=>a.onStyle("gap",Qf(k))},"gp"+S)}),o.jsxs("div",{className:"pp-row",children:[o.jsx("span",{className:"pp-l",children:u.properties.align}),o.jsx("span",{className:"align-set",role:"group","aria-label":u.properties.align,children:d1.map(k=>o.jsx("button",{className:"icon-btn","aria-label":k.label,title:k.label,onClick:()=>a.onAlign(k.dir),children:o.jsx(ne,{name:k.icon,size:16})},k.dir))})]}),o.jsxs("div",{className:"pp-row",children:[o.jsx("span",{className:"pp-l",children:u.properties.wrap}),o.jsxs("span",{className:"pp-btns",children:[o.jsx("button",{className:"btn",onClick:()=>a.onWrap("flex"),disabled:!a.canWrap,title:u.properties.wrapTitle,children:u.properties.wrapFlex}),o.jsx("button",{className:"btn",onClick:()=>a.onWrap("grid"),disabled:!a.canWrap,title:u.properties.wrapTitle,children:u.properties.wrapGrid})]})]}),a.onReplaceImage&&o.jsxs("div",{className:"pp-row",children:[o.jsx("span",{className:"pp-l",children:u.properties.image}),o.jsx("span",{className:"pp-btns",children:o.jsx("button",{className:"btn",onClick:a.onReplaceImage,children:u.properties.replaceImage})})]})]}),a.children,o.jsx(ao,{id:"more-css",title:yt.more,children:o.jsxs("div",{className:"more-css",children:[r1.map(k=>o.jsx(Ff,{label:k.label,value:a.inline[k.prop]??(k.prop==="background"?a.inline["background-color"]??"":""),placeholder:i.styles[k.prop==="background"?"background-color":k.prop]??"",options:k.options,color:k.color,swatches:k.color?f:void 0,warn:dy(k.prop,a.inline[k.prop]??(k.prop==="background"?a.inline["background-color"]??"":""),a.tokens),ratio:k.prop==="color"?cu(a.inline.color||i.styles.color||"",a.bg):null,onCommit:$=>a.onStyle(k.prop,$)},k.prop+S)),(a.inline.display??i.styles.display??"").includes("grid")&&["grid-template-columns","grid-template-rows"].map(k=>o.jsx(Ff,{label:k.endsWith("columns")?u.properties.columns:u.properties.rows,value:String(vy(a.inline[k])??""),placeholder:String(vy(i.styles[k])??""),onCommit:$=>a.onStyle(k,/^\d+$/.test($)&&Number($)>0?u1(Math.min(24,Number($))):$)},k+S)),r.map(k=>o.jsx(Ff,{label:k,value:a.attrs[k]??"",placeholder:"",onCommit:$=>a.onAttr(k,$===""?null:$)},k+S))]})})]})}const Qf=a=>/^-?\d+(?:\.\d+)?$/.test(a.trim())?`${Number(a)}px`:a.trim();function ki(a){return o.jsxs("label",{className:"pp-row",title:a.css,children:[o.jsxs("span",{className:"pp-l",children:[a.word,a.warn&&o.jsxs("span",{className:"tok-warn",title:a.warn,"aria-label":u.properties.offToken(a.warn),children:[" ","⚠"]})]}),a.children]})}function mc(a){const[i,r]=w.useState(a.value);w.useEffect(()=>r(a.value),[a.value]);const f=()=>i.trim()!==a.value.trim()&&a.onCommit(i.trim());return o.jsx("input",{"aria-label":a.label,value:i,placeholder:a.placeholder,onChange:h=>r(h.target.value),onBlur:f,onKeyDown:h=>{h.nativeEvent.isComposing||(h.key==="Enter"&&h.currentTarget.blur(),h.key==="Escape"&&(r(a.value),h.stopPropagation()))}})}function by(a){const i=a.value||a.computed||"",r=wc(i,a.colors),f=Un(i)??Un(a.computed)??(r?Un(r.value):null);return o.jsxs("button",{className:`fillv ${a.open?"on":""}`,"aria-expanded":a.open,"aria-label":yt.openFill(a.label),title:a.css,onClick:h=>{h.preventDefault(),a.onToggle()},children:[o.jsx("span",{className:"sw",style:{background:f??"transparent"}}),o.jsx("span",{className:"fillv-name",children:(r==null?void 0:r.name)??f??yt.none}),r&&f&&o.jsx("span",{className:"muted",children:f})]})}function Ff(a){const[i,r]=w.useState(a.value);w.useEffect(()=>r(a.value),[a.value]);const f=(h=i)=>{h.trim()!==a.value.trim()&&a.onCommit(h.trim())};return o.jsxs("label",{className:"field",children:[o.jsxs("span",{children:[a.label,a.warn&&o.jsxs("span",{className:"tok-warn",title:a.warn,"aria-label":u.properties.offToken(a.warn),children:[" ","⚠"]})]}),a.options?o.jsx("select",{value:i,onChange:h=>{r(h.target.value),f(h.target.value)},children:a.options.map(h=>o.jsx("option",{value:h,children:h||`(${a.placeholder||u.properties.none})`},h))}):o.jsx("input",{value:i,placeholder:a.placeholder,onChange:h=>r(h.target.value),onBlur:()=>f(),onKeyDown:h=>{h.nativeEvent.isComposing||(h.key==="Enter"&&h.currentTarget.blur(),h.key==="Escape"&&(r(a.value),h.currentTarget.blur()))}}),a.ratio!=null&&o.jsxs("span",{className:`ratio ${a.ratio>=4.5?"ok":a.ratio>=3?"mid":"bad"}`,title:u.properties.contrastTitle,children:[u.properties.contrast," ",a.ratio.toFixed(2),":1 · ",a.ratio>=7?"AAA":a.ratio>=4.5?"AA":a.ratio>=3?u.properties.largeTextOnly:u.properties.tooLow]}),a.chips&&o.jsx("span",{className:"chips-row",children:a.chips.map(h=>o.jsx("button",{className:`tchip ${i===h?"on":""}`,onClick:p=>{p.preventDefault(),r(h),f(h)},children:h.replace("px","")},h))}),a.color&&o.jsx("span",{className:"swatches",children:(a.swatches??[]).map(h=>o.jsx("button",{className:`swatch ${i.toUpperCase()===h.value?"on":""}`,title:`${h.name} ${h.value}`,style:{background:h.value},onClick:p=>{p.preventDefault(),r(h.value),f(h.value)}},h.value))})]})}const xy=384,wy=a=>/^[\w./@:,=+-]+$/.test(a)?a:`'${a.replace(/'/g,"'\\''")}'`,m1=a=>a>=1048576?`${(a/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(a/1024))} KB`;function g1(a){const i=["npx easel-canvas export"];return a.dirFlag&&i.push(a.dirFlag),a.scope==="page"&&a.page&&i.push(`--page ${wy(a.pages.filter(r=>r.name===a.page.name).length>1?a.page.id:a.page.name)}`),a.scope==="boards"&&a.boards.length&&i.push(`--boards ${wy(a.boards.join(","))}`),a.single&&i.push("--single-file"),i.join(" ")}function p1({pages:a,currentPage:i,selected:r}){const f=Hy(),[h,p]=w.useState(!1),[y,N]=w.useState("all"),[S,T]=w.useState(!1),[v,x]=w.useState(null),[C,O]=w.useState(null),[X,ee]=w.useState(null),[k,$]=w.useState({}),[J,Q]=w.useState({}),[q,I]=w.useState({left:0,top:0,width:xy}),ce=w.useRef(null),se=w.useRef(null),P=a.find(G=>G.id===i)??a[0],re=y==="boards"&&!r.length||y==="page"&&!a.length?"all":y,Se={scope:re,page:re==="page"?P==null?void 0:P.id:void 0,boards:re==="boards"?r:void 0},Ne=(G=!0)=>{var oe;p(!1),G&&((oe=ce.current)==null||oe.focus())},mt=()=>{if(h)return Ne();N(r.length?"boards":"all"),p(!0)};w.useLayoutEffect(()=>{if(!h)return;const G=()=>{var je;const oe=ce.current.getBoundingClientRect(),_=((je=ce.current.closest(".oc-card"))==null?void 0:je.getBoundingClientRect())??oe,ge=Math.min(xy,window.innerWidth-16);I({width:ge,top:Math.round(oe.bottom+8),left:Math.round(Math.max(8,Math.min(_.right-ge,window.innerWidth-ge-8)))})};return G(),window.addEventListener("resize",G),()=>window.removeEventListener("resize",G)},[h]),w.useLayoutEffect(()=>{h&&Qa(se.current,".oc-seg button, .btn")}),w.useEffect(()=>{var _,ge;if(!h)return;(ge=(_=se.current)==null?void 0:_.querySelector(".oc-seg [aria-checked='true']"))==null||ge.focus();const G=je=>{var me,ve;const He=je.target;!((me=se.current)!=null&&me.contains(He))&&!((ve=ce.current)!=null&&ve.contains(He))&&Ne(!1)},oe=je=>{je.key==="Escape"&&(je.stopPropagation(),Ne())};return document.addEventListener("pointerdown",G,!0),window.addEventListener("keydown",oe,!0),()=>{document.removeEventListener("pointerdown",G,!0),window.removeEventListener("keydown",oe,!0)}},[h]),w.useEffect(()=>{h&&!v&&Ce.get("/api/export").then(x,()=>{})},[h]);const Ct=JSON.stringify(Se);w.useEffect(()=>{if(!h||!S)return;let G=!0;return O(null),Ce.post("/api/export/estimate",Se).then(oe=>G&&O(oe.bytes),()=>{}),()=>{G=!1}},[h,S,Ct]);const _t=async G=>{if(!X){ee(G),Q(oe=>({...oe,[G]:void 0}));try{const oe=await Ce.post("/api/export",{...Se,format:G==="pdf"||G==="png"?G:"web",singleFile:G==="single"});$(_=>({..._,[G]:oe})),G==="single"&&O(oe.bytes)}catch(oe){Q(_=>({..._,[G]:oe.message}))}finally{ee(null)}}},st=()=>Ce.post("/api/export/reveal",{}).catch(G=>f({tone:"error",text:G.message})),fe=async G=>{try{await navigator.clipboard.writeText(G),f({tone:"ok",text:u.share.copied(G)})}catch{f({tone:"error",text:u.share.copyFailed})}},ye=S?"single":"web",xe=k[ye],_e=v&&!v.browser.ok?v.browser.reason??"":null,ke=(v==null?void 0:v.project)??"",xt=G=>`${ke?ke+"/":""}${G.mainRel.endsWith("/")||G.kind==="web"?G.outRel:G.mainRel}`,Ke=(v==null?void 0:v.single)??`${ke}-canvas.html`,Pe=(G,oe)=>o.jsxs("span",{className:"oc-res",role:"status",children:[o.jsxs("span",{className:"oc-rline",children:[o.jsx(ne,{name:"check",size:16}),o.jsx("code",{children:G.kind==="single"?G.mainRel.split("/").pop():xt(G)})," ",G.kind==="single"?u.share.saved:u.share.exported]}),o.jsxs("span",{className:"oc-racts",children:[o.jsx("button",{className:"btn",title:u.share.revealTitle,onClick:()=>void st(),children:u.share.reveal}),oe.deploy&&G.deploy&&o.jsx("button",{className:"btn",title:u.share.copyDeployTitle(G.deploy),onClick:()=>void fe(G.deploy),children:u.share.copyDeploy})]}),oe.hint&&o.jsx("span",{className:"oc-rhint",children:u.share.attachHint}),G.skipped.length>0&&o.jsx("span",{className:"oc-rhint",title:G.skipped.map(_=>`${_.ref} (${_.from}): ${_.reason}`).join(`
67
+ `),children:u.share.skipped(G.skipped.length)})]}),D=(G,oe,_,ge)=>o.jsxs("div",{className:"oc-orow",children:[o.jsx("span",{className:"out-ic",children:o.jsx(ne,{name:oe})}),o.jsxs("span",{className:"oc-otext",children:[o.jsx("strong",{children:_}),o.jsx("span",{children:_e?`${u.share.unavailable} ${_e}`:ge})]}),o.jsx("button",{className:"btn",disabled:!!_e,"aria-busy":X===G,onClick:()=>void _t(G),children:X===G?u.share.working:u.share.export}),J[G]&&o.jsx(Sy,{text:J[G]}),k[G]&&!J[G]&&Pe(k[G],{})]});return o.jsxs("div",{className:"share-wrap",children:[o.jsxs("button",{ref:ce,className:`share-btn ${h?"on":""}`,"aria-haspopup":"dialog","aria-expanded":h,"aria-label":u.share.button,title:u.share.buttonTitle,onClick:mt,children:[o.jsx(ne,{name:"share",size:16})," ",o.jsx("span",{className:"share-label",children:u.share.button})]}),h&&o.jsxs("div",{ref:se,className:"share-pop oc-share entering",role:"dialog","aria-label":u.share.title,style:{left:q.left,top:q.top,width:q.width},onKeyDown:G=>{G.stopPropagation()},children:[o.jsx("h4",{children:u.share.title}),o.jsxs("div",{className:"oc-seg",role:"radiogroup","aria-label":u.share.scope,children:[o.jsx("button",{role:"radio","aria-checked":re==="all",className:re==="all"?"on":"",onClick:()=>N("all"),children:u.share.whole}),o.jsx("button",{role:"radio","aria-checked":re==="page",className:re==="page"?"on":"",disabled:!a.length,title:a.length?P==null?void 0:P.name:u.share.pageNone,onClick:()=>N("page"),children:u.share.page}),r.length>0&&o.jsx("button",{role:"radio","aria-checked":re==="boards",className:re==="boards"?"on":"",onClick:()=>N("boards"),children:u.share.selected(r.length)})]}),o.jsxs("div",{className:"oc-out",children:[o.jsxs("div",{className:"oc-orow first",children:[o.jsx("span",{className:"out-ic",children:o.jsx(ne,{name:S?"file":"folder"})}),o.jsxs("span",{className:"oc-otext",children:[o.jsx("strong",{children:S?u.share.singleTitle:u.share.webTitle}),o.jsx("span",{children:S?o.jsxs(o.Fragment,{children:[o.jsx("code",{children:Ke}),u.share.singleHint(C==null?u.share.measuring:m1(C))]}):u.share.webHint}),o.jsxs("label",{className:"oc-sw",children:[o.jsx("button",{type:"button",role:"switch","aria-checked":S,className:`switch ${S?"on":""}`,onClick:()=>T(G=>!G)}),o.jsx("span",{children:u.share.singleSwitch})]})]}),o.jsx("button",{className:"btn","aria-busy":X===ye,onClick:()=>void _t(ye),children:X===ye?u.share.working:S?u.share.save:u.share.export}),J[ye]&&o.jsx(Sy,{text:J[ye]}),xe&&!J[ye]&&Pe(xe,{deploy:!S,hint:S})]}),D("pdf","pdf",u.share.pdfTitle,u.share.pdfHint),D("png","image",u.share.pngTitle,u.share.pngHint)]}),o.jsxs("div",{className:"oc-pfoot",children:[S&&o.jsx("span",{children:u.share.largeFiles}),o.jsxs("span",{children:[u.share.sameAs," ",o.jsx("code",{children:g1({dirFlag:v==null?void 0:v.dirFlag,scope:re,page:P,pages:a,boards:r,single:S})})]})]})]})]})}function Sy({text:a}){return o.jsxs("span",{className:"oc-err",role:"alert",children:[o.jsx(ne,{name:"warn",size:16}),o.jsx("span",{children:a})]})}const y1=400,kt=navigator.platform.includes("Mac")?"⌘":"Ctrl+",fu=a=>`design-canvas:${a}`;function v1(a){try{return JSON.parse(sessionStorage.getItem(fu(a))??localStorage.getItem(fu(a))??"{}")}catch{return{}}}const jy=[{id:"blank",label:u.templates.blank,size:"390×844",w:390,h:844,group:0},{id:"watch",label:u.templates.watch,size:"198×242",w:198,h:242,group:1},{id:"mobile",label:u.templates.mobile,size:"390×844",w:390,h:844,group:1},{id:"tablet",label:u.templates.tablet,size:"834×1194",w:834,h:1194,group:1},{id:"desktop",label:u.templates.desktop,size:"1440×900",w:1440,h:900,group:1},{id:"doc",label:u.templates.doc,size:"800×1000",w:800,h:1e3,group:2},{id:"email",label:u.templates.email,size:"600×1200",w:600,h:1200,group:2}],Ci=[{id:"select",icon:"select",label:u.tools.select,hint:u.toolHints.select,key:"V"},{id:"hand",icon:"hand",label:u.tools.hand,hint:u.toolHints.hand,key:"H"},{id:"board",icon:"board",label:u.tools.board,hint:u.toolHints.board,key:"B"},{id:"title",icon:"title",label:u.tools.title,hint:u.toolHints.title,key:"T"},{id:"sticky",icon:"sticky",label:u.tools.sticky,hint:u.toolHints.sticky,key:"N"},{id:"rect",icon:"rect",label:u.tools.rect,hint:u.toolHints.rect,key:"R"},{id:"oval",icon:"oval",label:u.tools.oval,hint:u.toolHints.oval,key:"O"},{id:"line",icon:"line",label:u.tools.line,hint:u.toolHints.line,key:"L"},{id:"arrow",icon:"arrow",label:u.tools.arrow,hint:u.toolHints.arrow,key:"A"},{id:"pen",icon:"pen",label:u.tools.pen,hint:u.toolHints.pen,key:"P"}],b1=["rect","oval","line","arrow","pen"];function x1(){var ni,Ts,No,cl,zl,Es,To,rl,Eo,ko,Co,Vc,Xc,Kc,Mo;const[a,i]=w.useState(null),[r,f]=w.useState(null),h=D0({x:0,y:0,zoom:.1}),p=h.set,[y,N]=w.useState(null),[S,T]=w.useState("select"),[v,x]=w.useState([]),[C,O]=w.useState([]),X=C.length===1?C[0]:null,ee=d=>O(d?[d]:[]),[k,$]=w.useState(null),[J,Q]=w.useState(null),[q,I]=w.useState(null),[ce,se]=w.useState(null),P=w.useRef(null),[re,Se]=w.useState(null),[Ne,mt]=w.useState(null),Ct=w.useRef(new Set),[_t,st]=w.useState([]),[fe,ye]=w.useState(!1),[xe,_e]=w.useState(""),[ke,xt]=w.useState(null),[Ke,Pe]=w.useState(!0),[D,G]=w.useState(()=>({w:window.innerWidth,h:window.innerHeight}));w.useEffect(()=>{const d=()=>G({w:window.innerWidth,h:window.innerHeight});return window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[]);const oe=D.w<=1e3,_=D.w<=480,[ge,je]=w.useState(!0),[He,me]=w.useState(!1),[ve,rt]=w.useState(null),[Ea,Xn]=w.useState({canUndo:!1,canRedo:!1,undo:[],redo:[]}),[jn,at]=w.useState({}),[Le,xn]=w.useState({}),Mn=d=>g=>({...g,[d]:(g[d]??0)+1}),Kt=w.useRef(vx()).current,sn=w.useRef(()=>{});sn.current=(d,g,b=!1)=>{const E=$e.current.get(d),z=Kt.decide(d,g,{shown:Ly(E,d),patched:ry(E,d)},b);if(!(z==="queue"||z==="keep")){if(z==="check")return void Ce.get(`/api/file-hash?f=${encodeURIComponent(d)}`).then(Z=>sn.current(d,Z.hash,!0)).catch(()=>sn.current(d,void 0));Kt.reset(d),at(Mn(d))}};const[B,K]=w.useState(null),[le,be]=w.useState(null),[Be,Fe]=w.useState([]),[De,Qe]=w.useState("inspect"),[Dt,Ht]=w.useState(""),[Rt,Wt]=w.useState({comments:[],refs:[]}),[et,on]=w.useState({}),wt=w.useRef(new Set),St=w.useCallback(d=>(wt.current.add(d),()=>void wt.current.delete(d)),[]),Vt=w.useRef(null),gt=w.useRef(0),[cn,na]=w.useState("boards"),[Fa,Ba]=w.useState(0),[_a,Ha]=w.useState(null),[rn,Ln]=w.useState([]),Zt=rn.length===1?rn[0]:null,Kn=d=>Ln(d?[d]:[]),[hn,Sl]=w.useState(0),Qt=bx(hn),[Ja,Ia]=w.useState(()=>{try{return localStorage.getItem("design-canvas:author")??""}catch{return""}});w.useEffect(()=>{Ja||Ce.get("/api/me").then(d=>d.name&&Ia(d.name)).catch(()=>{})},[]),w.useEffect(()=>Yb(Ja),[Ja]);const Ua=Ja||u.app.defaultAuthor,[ma,zn]=w.useState(null),[aa,Wa]=w.useState(null),jl=w.useRef(null),fs=w.useRef(()=>{}),[Pa,Gl]=w.useState(!0),[M,W]=w.useState(()=>{try{return localStorage.getItem("design-canvas:theme")||"system"}catch{return"system"}});w.useEffect(()=>{M==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",M);try{localStorage.setItem("design-canvas:theme",M)}catch{}},[M]);const[Me,ue]=w.useState(null),Re=w.useRef(!1),$e=w.useRef(new Map),[Ge,Pt]=w.useState(0),Zn=E1(),ut=w.useRef(null),he=Hy(),Mt=cx();w.useEffect(()=>{let d=!1;const g="design-canvas:update-seen";return Ce.update().then(({update:b})=>{if(d||!b)return;try{if(localStorage.getItem(g)===b.latest)return}catch{}const E=()=>{try{localStorage.setItem(g,b.latest)}catch{}};he({dot:!0,text:u.update.out(b.latest),code:b.command,ms:12e3,action:{label:u.update.copy,run:()=>(E(),void navigator.clipboard.writeText(b.command).then(()=>he({tone:"ok",text:u.update.copied})))},close:{label:u.update.hide,run:E}})}).catch(()=>{}),()=>void(d=!0)},[he]);const Yl=w.useCallback(d=>$e.current.get(d)??null,[Ge]),ql=w.useRef(null),Qn=w.useRef(null);Qn.current=r;const Mi=w.useRef(null),Ft=w.useCallback(async()=>{try{const d=await Ce.board();i(d),f(g=>k1(g,d.board)),K(null)}catch(d){K(String(d.message))}},[]),el=w.useCallback(()=>Ce.get("/api/comments").then(d=>Fe(d.comments)).catch(()=>{}),[]),Gn=w.useCallback(()=>Ce.get("/api/history").then(Xn).catch(()=>{}),[]),Nl=w.useCallback(()=>Ce.get("/api/errors").then(d=>on(g=>JSON.stringify(g)===JSON.stringify(d.errors)?g:d.errors)).catch(()=>{}),[]),dt=l0((a==null?void 0:a.dir)??null),[zt,la]=w.useState(null),[Yn,un]=w.useState(null),[zi,oo]=w.useState(!1),[tl,Tl]=w.useState({}),[qn,nl]=w.useState(null),[Sc,co]=w.useState(!1),jc=w.useRef(null),ot=w.useRef(null),ro=w.useRef(null),Ai=w.useRef(null);w.useLayoutEffect(()=>{Qa(ot.current),Qa(ro.current),Qa(Ai.current)}),w.useEffect(()=>{Ft(),el(),Gn(),Nl()},[Ft,el,Gn,Nl]),w.useEffect(()=>{document.title=r!=null&&r.title?u.app.docTitle(r.title):u.app.title},[r==null?void 0:r.title]),w.useEffect(()=>{const d=new Map,g=E=>{const z=d.get(E);window.clearTimeout(z.t),z.t=window.setTimeout(()=>void Ce.put("/api/errors",{file:E,errors:z.list}).catch(()=>{}),200)},b=E=>{const z=E.data;if(!z||z.type!=="dc-error"||typeof z.file!="string")return;if(z.start)return void d.set(z.file,{list:[],loaded:!1});const Z=d.get(z.file)??{list:[],loaded:!0};if(d.set(z.file,Z),z.loaded)return Z.loaded=!0,g(z.file);Z.list.length<20&&!Z.list.some(te=>te.message===z.message)&&Z.list.push({kind:z.kind,message:z.message,line:z.line}),Z.loaded&&g(z.file)};return window.addEventListener("message",b),()=>window.removeEventListener("message",b)},[]);const Yt=w.useCallback((d,g)=>{const b=Qn.current;if(!b)return;const E=d(b);if(Qn.current=E,f(E),!g)return;Mi.current&&window.clearTimeout(Mi.current);const z=()=>(gt.current++,Ce.saveBoard(Qn.current,g==="draft"?void 0:g).catch(Z=>he({tone:"error",text:u.toast.saveFailed(Z.message)})).finally(()=>gt.current--));g==="draft"?Mi.current=window.setTimeout(()=>{Mi.current=null,z()},y1):z()},[he]),wn=w.useCallback(async d=>{try{const g=await Ce.post(`/api/history/${d}`,{});g.label?he({text:u.toast.undoRedoDone(d,g.label)}):he({text:d==="undo"?u.toast.nothingToUndo:u.toast.nothingToRedo}),await Ft()}catch(g){he({tone:"error",text:String(g.message)})}Gn()},[he,Ft,Gn]),ft={label:u.toast.undoAction,run:()=>void wn("undo")},Jt=w.useCallback(async(d,g=k)=>{var b;if(!g)return!1;Kt.begin(g);try{const E=await Ce.post("/api/edit",{file:g,...d});return E.base&&E.hash&&yx($e.current.get(g),g,E)&&(Kt.patched(g,E.base,E.hash),xn(Mn(g))),!0}catch(E){return(b=ql.current)==null||b.setError(String(E.message)),he({tone:"error",text:String(E.message)}),!1}finally{for(const E of Kt.end(g))sn.current(g,E)}},[k,he,Kt]),Nc=w.useCallback((d,g,b)=>{var Ut,ra,At;if(Array.from(g.children).some(qt=>qt.tagName!=="BR")){(Ut=ql.current)==null||Ut.setError(u.toast.textOnly);return}const E=g.innerText??"";Q(d);const z=g.getAttribute("contenteditable");g.contentEditable="true",g.focus();const Z=g.ownerDocument,te=Z.createRange();te.selectNodeContents(g),(ra=Z.getSelection())==null||ra.removeAllRanges(),(At=Z.getSelection())==null||At.addRange(te);const de=qt=>{if(g.contains(qt.target))return void(qt.type==="click"&&qt.preventDefault());qt.preventDefault(),qt.stopPropagation(),qt.type==="mousedown"&&g.blur()};Z.addEventListener("mousedown",de,!0),Z.addEventListener("click",de,!0);let ze=!1;const Je=async()=>{var zo;g.removeEventListener("keydown",qe),Z.removeEventListener("mousedown",de,!0),Z.removeEventListener("click",de,!0),z==null?g.removeAttribute("contenteditable"):g.setAttribute("contenteditable",z),Q(null),document.activeElement===((zo=Z.defaultView)==null?void 0:zo.frameElement)&&Ny();const qt=(g.innerText??"").replace(/\n$/,"");if(ze||qt===E){ze&&(g.innerText=E);return}const In=await ia(d,b);await Jt({op:"setText",path:b,hash:In,text:qt},d)||(g.innerText=E)},qe=qt=>{qt.isComposing||qt.keyCode===229||(qt.key==="Enter"&&!qt.shiftKey?(qt.preventDefault(),g.blur()):qt.key==="Escape"&&(ze=!0,g.blur()))};let pt=!1,Tn=!1;const ct=()=>pt=!0,tn=()=>{pt=!1,Tn&&Ae()},Ae=()=>{g.removeEventListener("compositionstart",ct),g.removeEventListener("compositionend",tn),g.removeEventListener("blur",We),Je()},We=()=>{pt?Tn=!0:Ae()};g.addEventListener("compositionstart",ct),g.addEventListener("compositionend",tn),g.addEventListener("keydown",qe),g.addEventListener("blur",We)},[Jt]),ia=(d,g)=>Ce.get(`/api/element?f=${encodeURIComponent(d)}&path=${encodeURIComponent(g)}`).then(b=>(b.fileHash&&ry($e.current.get(d),d)&&sn.current(d,b.fileHash,!0),b.hash)),uo=async(d,g)=>{var E;if(!k)return;const b=await ia(k,d);await Jt({op:"move",path:d,hash:b,...g})&&((E=ql.current)==null||E.select([w1(d,g.toParentPath,g.index)]),he({text:g.freeze.length?u.toast.movedFrozen:u.toast.moved,action:ft}))},Tc=async()=>{var b;const d=Te.state.selection;if(!k||!d)return;const{source:g}=await Ce.get(`/api/element?f=${encodeURIComponent(k)}&path=${encodeURIComponent(d.path)}&full=1`);try{localStorage.setItem("design-canvas:clip",JSON.stringify({source:g,file:k,path:d.path,tag:d.tag}))}catch{}await((b=navigator.clipboard)==null?void 0:b.writeText(g).catch(()=>{})),he({tone:"ok",text:u.toast.copiedElement(d.tag,kt)})},Fn=async()=>{if(!k)return;let d=null;try{d=JSON.parse(localStorage.getItem("design-canvas:clip")??"null")}catch{d=null}if(!d)return he({text:u.toast.nothingCopied});const g=Te.state.selection,b=(g==null?void 0:g.file)===k?g.path:"";if(await Jt({op:"insert",path:b,hash:b?g.hash:void 0,position:"after",html:d.source})&&(he({tone:"ok",text:u.toast.pasted(d.file,d.tag),action:ft}),b)){const E=b.split("/");E[E.length-1]=String(Number(E[E.length-1])+1),setTimeout(()=>{var z;return void((z=ql.current)==null?void 0:z.select([E.join("/")]))},600)}},hs=(d,g)=>Ha(()=>async b=>{if(Ha(null),!k)return;const E=await ia(k,d);(g?await Jt({op:"setAttr",path:d,hash:E,name:"src",value:b.ref}):await Jt({op:"setStyle",path:d,hash:E,prop:"background-image",value:`url("${b.ref}")`}))&&he({tone:"ok",text:u.toast.imageReplaced(b.name),action:ft})}),Oi=w.useRef(null),Te=M0(k,Yl);ql.current=Te;const El=w.useRef(Promise.resolve()),fo=(d,g)=>{var z;const b=k,E=(z=Te.state.selection)==null?void 0:z.path;!b||!E||(El.current=El.current.then(async()=>{const Z=await ia(b,E).catch(()=>null);Z&&await Jt({op:"setStyle",path:E,hash:Z,prop:d,value:g},b)}))};w.useEffect(()=>qb(d=>{if(d.type==="file-changed")xn(Mn(d.file)),d.kind!=="change"?(Kt.reset(d.file),at(Mn(d.file)),Ft()):sn.current(d.file,d.hash);else if(d.type==="board-changed"&&d.source!==rh)Ft(),dt.reload();else if(d.type==="comments-changed")el();else if(d.type==="history-changed")Gn(),dt.reload();else if(d.type==="errors-changed")Nl();else if(d.type==="assets-changed")Ba(g=>g+1);else if(d.type==="tokens-changed")Sl(g=>g+1);else if(d.type==="app-changed")window.location.reload();else if(d.type==="chat")for(const g of wt.current)g(d.id,d.ev);else if(d.type==="hello")for(const g of wt.current)g("",{kind:"boot",boot:d.boot});else d.type==="occupancy"&&Tl(d.boards)}),[Ft,el,Gn,Nl,dt.reload]);const $t=(r==null?void 0:r.pages)??[],mn=((ni=$t.find(d=>d.id===y))==null?void 0:ni.id)??((Ts=$t[0])==null?void 0:Ts.id)??null,kl=w.useCallback(d=>!$t.length||(d.page??$t[0].id)===mn,[$t,mn]),en=w.useMemo(()=>r?[...new Set(r.order)].filter(d=>r.boards[d]&&kl(r.boards[d])):[],[r,kl]),ms=w.useMemo(()=>r?Object.keys(r.notes).filter(d=>kl(r.notes[d])):[],[r,kl]),dn=le??D,pu=nh(h,d=>d.zoom>=.25),yu=w.useCallback(d=>r?o.jsx(Kx,{board:r,files:en,zoom:d}):null,[r,en]),Jn=()=>{const d=oe?8:12,g=!oe&&Ke?d+240+d:0,b=oe?dn.w:dn.w-d-288,E=oe?d+48:0,z=dn.h-(oe?64:68)-36;return{x:g,y:E,w:b-g,h:z-E}},ga=(d,g)=>{const b=Jn();p(E=>({...E,x:Math.round(b.x+b.w/2-d*E.zoom),y:Math.round(b.y+b.h/2-g*E.zoom)}))};w.useEffect(()=>{if(Re.current||!r||!le)return;Re.current=!0;const d=v1(r.title);window.innerWidth<1e3?Pe(!1):d.left!=null&&Pe(d.left),d.minimap!=null&&je(d.minimap);const g=r.launch;if(g!=null&&g.page?N(g.page):d.page&&N(d.page),(g==null?void 0:g.view)==="focused"&&g.file&&r.boards[g.file]&&xt(g.file),d.view&&!(g!=null&&g.page))p(d.view);else if(!d.view&&r.order.length>0){const b=r.order.find(z=>r.boards[z]&&kl(r.boards[z]))??r.order[0],E=r.boards[b];if(E){const z=us([E],le,80,Jn());p({...z,zoom:Math.min(z.zoom,1)}),x([b]),ye(!0)}else p(us(Object.values(r.boards),le,60,Jn()))}else p(us(Object.values(r.boards),le,60,Jn()))},[r,le]),w.useEffect(()=>{if(!r)return;let d=0;const g=()=>{window.clearTimeout(d),Re.current&&(d=window.setTimeout(()=>{try{const E=JSON.stringify({view:h.get(),page:mn,left:oe?void 0:Ke,minimap:ge});localStorage.setItem(fu(r.title),E),sessionStorage.setItem(fu(r.title),E)}catch{}},300))};g();const b=h.subscribe(g);return()=>{b(),window.clearTimeout(d)}},[mn,Ke,ge,r==null?void 0:r.title]),w.useEffect(()=>{if(!r)return;let d=0;const g=()=>{window.clearTimeout(d),d=window.setTimeout(()=>{var Je;const E=h.get(),z=-E.x/E.zoom,Z=-E.y/E.zoom,te=dn.w/E.zoom,de=dn.h/E.zoom,ze=ke?[ke]:en.filter(qe=>{const pt=r.boards[qe];return pt.x<z+te&&pt.x+pt.w>z&&pt.y<Z+de&&pt.y+pt.h>Z});Ce.put("/api/context",{mode:re?"play":ke?"focus":k?"edit":"canvas",page:mn,pageName:((Je=$t.find(qe=>qe.id===mn))==null?void 0:Je.name)??null,visibleArtboards:ze,selectedArtboards:v,dirty:gt.current>0||!!Mi.current}).catch(()=>{})},300)};g();const b=h.subscribe(g);return()=>{b(),window.clearTimeout(d)}},[mn,v,k,ke,re,en,dn.w,dn.h]),w.useEffect(()=>{!Me||!r||!Me.every(d=>r.boards[d])||(x(Me),p(us(Me.map(d=>r.boards[d]),dn,80,Jn())),ue(null))},[Me,r]);const ho=d=>({x:d.x,y:d.y,w:d.w??d.maxW??400,h:d.kind==="title"?90:200}),al=()=>{r&&p(us([...en.map(d=>r.boards[d]),...ms.map(d=>ho(r.notes[d]))],dn,60,Jn()))},sa=d=>{!r||!d.length||p(us(d.map(g=>r.boards[g]).filter(Boolean),dn,80,Jn()))},pa=d=>p(g=>{const b=so(g.zoom*d,fh,hh),E=Jn(),z=E.x+E.w/2,Z=E.y+E.h/2;return{zoom:b,x:Math.round(z-(z-g.x)/g.zoom*b),y:Math.round(Z-(Z-g.y)/g.zoom*b)}}),Vl=d=>pa(d/h.get().zoom);w.useEffect(()=>{if(!fe)return;let d=!1;const g=window.setTimeout(()=>d=!0,1500),b=()=>d&&ye(!1),E=window.setTimeout(()=>ye(!1),15e3);return window.addEventListener("pointerdown",b,!0),window.addEventListener("keydown",b,!0),()=>{window.clearTimeout(g),window.clearTimeout(E),window.removeEventListener("pointerdown",b,!0),window.removeEventListener("keydown",b,!0)}},[fe]);const ka=(d,g="replace")=>{x(b=>g==="replace"?d:g==="add"?[...new Set([...b,...d])]:d.reduce((E,z)=>E.includes(z)?E.filter(Z=>Z!==z):[...E,z],b)),g==="replace"&&$(null),d.length&&g==="replace"&&(O([]),Ln([]))},Xl=()=>$t.length&&mn?{page:mn}:{},ll=async(d,g="blank")=>{try{const{file:b}=await Ce.post("/api/boards/create",{...d,template:g,...Xl()});await Ft(),x([b]),T("select"),he({tone:"ok",text:u.toast.boardCreated(b),action:ft})}catch(b){he({tone:"error",text:u.toast.boardCreateFailed(b.message)})}},oa=async d=>{if(!d.length||!r)return;const g=d.map(E=>{var z;return((z=r.boards[E])==null?void 0:z.title)??E});if(await Mt.confirm({title:u.dialog.deleteBoardsTitle(d.length,g[0]),body:u.dialog.deleteBoardsBody,ok:u.dialog.delete,danger:!0}))try{await Ce.post("/api/boards/delete",{files:d}),k&&d.includes(k)&&$(null),x([]),await Ft(),he({text:u.toast.boardsDeleted(d.length),action:ft})}catch(E){he({tone:"error",text:String(E.message)})}},Di=async d=>{try{const g=await Ce.post("/api/boards/duplicate",{file:d});await Ft(),x([g.file]),he({tone:"ok",text:u.toast.duplicated(g.file),action:ft})}catch(g){he({tone:"error",text:String(g.message)})}},il=async d=>{var E;const g=(E=Qn.current)==null?void 0:E.boards[d];if(!g)return;const b=await Mt.prompt({title:u.dialog.renameBoardTitle,label:u.dialog.name,value:g.title??d.replace(/\.html$/,""),ok:u.dialog.rename});if(!(!b||b.value.trim()===(g.title??"")))try{await Ce.post("/api/boards/rename",{file:d,title:b.value.trim()}),await Ft(),he({tone:"ok",text:u.toast.renamed,action:ft})}catch(z){he({tone:"error",text:String(z.message)})}},La=async d=>{const{refs:g}=await Ce.get(`/api/boards/refs?file=${encodeURIComponent(d)}`).catch(()=>({refs:[]})),b=await Mt.prompt({title:u.dialog.renameFileTitle,label:u.dialog.fileName,value:d,hint:g.length?u.dialog.renameFileRefs(g.map(z=>z.file).join(", ")):u.dialog.renameFileNoRefs,ok:u.dialog.rename,extra:g.length?{label:u.dialog.renameFileExtra(g.reduce((z,Z)=>z+(Z.count??1),0)),checked:!0}:void 0});if(!b)return;let E=b.value.trim();if(E.endsWith(".html")||(E+=".html"),E!==d)try{await Ce.post("/api/boards/rename",{file:d,newFile:E,updateRefs:b.extra}),k===d&&$(E),x([E]),await Ft(),he({tone:"ok",text:u.toast.fileRenamed(E,!!b.extra),action:ft})}catch(z){he({tone:"error",text:String(z.message)})}},mo=d=>{const g=Jn(),b=h.get(),E=(g.x+g.w/2-b.x)/b.zoom,z=(g.y+g.h/2-b.y)/b.zoom;ll({x:Math.round(E-d.w/2),y:Math.round(z-d.h/2),w:d.w,h:d.h},d.id).then(()=>p(us([{x:E-d.w/2,y:z-d.h/2,w:d.w,h:d.h}],dn,80,Jn())))},gs=d=>rt({x:d.clientX,y:d.clientY,up:!0,title:u.menu.newBoard,items:jy.flatMap((g,b)=>[...b&&jy[b-1].group!==g.group?["sep"]:[],{label:`${g.label} · ${g.size}`,icon:g.group===2?"page":"board",shortcut:g.id==="blank"?u.menu.drawWithB:void 0,run:()=>mo(g)}])}),ca=(d,g)=>{Qe("chat"),Fl(!0),g!=null&&g.length&&x(g),d!=null&&Ht(d),setTimeout(()=>{var b;return(b=Vt.current)==null?void 0:b.focus()},0)},Ri=d=>ca(u.prompts.fixErrors(d.map(g=>`- ${g}: ${(et[g]??[{message:a!=null&&a.missing.includes(g)?u.menu.fileMissing:u.prompts.error}])[0].message}`).join(`
68
+ `)),d.filter(g=>r==null?void 0:r.boards[g])),ya=(d,g)=>Yt(b=>{const E=b.order.filter(Z=>!d.includes(Z)),z=b.order.filter(Z=>d.includes(Z));return{...b,order:g==="front"?[...E,...z]:[...z,...E]}},g==="front"?u.history.front:u.history.back),Ec=(d,g,b=u.history.boardOptions)=>Yt(E=>{const z={...E.boards[d],...g};for(const Z of Object.keys(z))z[Z]===void 0&&delete z[Z];return{...E,boards:{...E.boards,[d]:z}}},b),gn=(d,g,b,E=v,z=C,Z=rn)=>({...d,boards:{...d.boards,...Object.fromEntries(E.filter(te=>d.boards[te]).map(te=>[te,{...d.boards[te],x:d.boards[te].x+g,y:d.boards[te].y+b,autoPlaced:void 0}]))},notes:{...d.notes,...Object.fromEntries(z.filter(te=>d.notes[te]).map(te=>[te,{...d.notes[te],x:d.notes[te].x+g,y:d.notes[te].y+b}]))},shapes:{...d.shapes??{},...Object.fromEntries(Z.filter(te=>{var de;return(de=d.shapes)==null?void 0:de[te]}).map(te=>[te,{...d.shapes[te],x:d.shapes[te].x+g,y:d.shapes[te].y+b}]))}}),sl=(d,g)=>Yt(b=>gn(b,d,g),v.length?u.history.moveBoard:C.length?u.history.moveNote:u.history.moveShape),$i=()=>{var g;let d="";do d=`n${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`;while((g=Qn.current)!=null&&g.notes[d]);return d},Cl=(d,g)=>{var Z;if(Object.keys(((Z=Qn.current)==null?void 0:Z.notes)??{}).length>=Jp)return he({tone:"error",text:u.toast.notesMax(Jp)});const b=$i(),E=Math.round(g.x),z=Math.round(g.y);Yt(te=>({...te,notes:{...te.notes,[b]:d==="title"?{kind:d,x:E,y:z,text:u.defaults.newTitle,maxW:2e3,...Xl()}:{kind:d,x:E,y:z,text:u.defaults.note,w:400,...Xl()}}}),d==="title"?u.history.addTitle:u.history.addNote),ee(b),x([]),T("select")},Bi=d=>{Yt(g=>{const b={...g.notes};for(const E of d)delete b[E];return{...g,notes:b}},u.history.deleteNote),O([]),he({text:u.toast.noteDeleted,action:ft})},Ca=(r==null?void 0:r.shapes)??{},ps=w.useMemo(()=>Object.keys(Ca).filter(d=>kl(Ca[d])).sort((d,g)=>(Ca[d].z??0)-(Ca[g].z??0)||(d<g?-1:1)),[Ca,kl]),Kl=(d,g=u.history.addShape)=>{var z,Z,te;let b="";do b=`s${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`;while((Z=(z=Qn.current)==null?void 0:z.shapes)!=null&&Z[b]);const E=Math.max(0,...Object.values(((te=Qn.current)==null?void 0:te.shapes)??{}).map(de=>de.z??0))+1;return Yt(de=>({...de,shapes:{...de.shapes??{},[b]:{...d,z:E,...Xl()}}}),g),Kn(b),x([]),ee(null),T("select"),b},_i=(d,g,b)=>Yt(E=>({...E,shapes:{...E.shapes??{},[d]:{...E.shapes[d],...g}}}),b),Hi=d=>{Yt(g=>{const b={...g.shapes??{}};for(const E of d)delete b[E];return{...g,shapes:b}},u.history.deleteShape),Ln([]),he({text:d.length===1?u.toast.shapeDeleted:u.toast.shapesDeleted(d.length),action:ft})},ys=(d,g)=>{var E;const b=Object.values(((E=Qn.current)==null?void 0:E.shapes)??{}).map(z=>z.z??0);_i(d,{z:g==="front"?Math.max(0,...b)+1:Math.min(0,...b)-1},g==="front"?u.history.shapeFront:u.history.shapeBack)},vs=(d,g)=>{const b=new Image;b.onload=()=>{const E=Math.min(1,600/Math.max(b.naturalWidth,b.naturalHeight)),z=Math.round(b.naturalWidth*E)||300,Z=Math.round(b.naturalHeight*E)||200,te=h.get(),de=g??{x:(dn.w/2-te.x)/te.zoom-z/2,y:(dn.h/2-te.y)/te.zoom-Z/2};Kl({kind:"image",x:Math.round(de.x),y:Math.round(de.y),w:z,h:Z,src:d.ref},u.history.addImage)},b.onerror=()=>he({tone:"error",text:u.toast.imageReadFailed}),b.src=d.url};w.useEffect(()=>{const d=async g=>{var E,z,Z;if(k||(z=(E=g.target)==null?void 0:E.closest)!=null&&z.call(E,"input,textarea,[contenteditable=true]"))return;const b=Array.from(((Z=g.clipboardData)==null?void 0:Z.files)??[]).filter(te=>te.type.startsWith("image/"));if(b.length){g.preventDefault();try{const[te]=await lh(b.map(de=>de.name?de:new File([de],u.defaults.pastedImage,{type:de.type})));vs(te)}catch(te){he({tone:"error",text:String(te.message)})}}};return window.addEventListener("paste",d),()=>window.removeEventListener("paste",d)});const vu=async(d,g)=>{var z,Z;let b=Math.round(g.x);const E=[];for(const te of d)try{if(/\.html?$/i.test(te.name)){const de=await te.text(),ze=de.match(/<meta[^>]+name=["']board-size["'][^>]+content=["'](\d+)x(\d+)/i),Je=ze?Number(ze[1]):390,qe=ze?Number(ze[2]):844,pt=((Z=(z=de.match(/<title>([^<]*)<\/title>/i))==null?void 0:z[1])==null?void 0:Z.trim())||te.name.replace(/\.html?$/i,""),Tn=te.name.toLowerCase().replace(/\.htm$/,".html").replace(/[^a-z0-9._-]+/g,"-"),ct=await Ce.post("/api/boards/create",{file:Tn,html:de,title:pt,x:b,y:Math.round(g.y),w:Je,h:qe,...Xl()});E.push(ct.file),b+=Je+80}else if(te.type.startsWith("image/")){const[de]=await lh([te]);vs(de,{x:b,y:g.y}),b+=400}else he({tone:"error",text:u.toast.importOnly(te.name)})}catch(de){he({tone:"error",text:`${te.name}: ${de.message}`})}E.length&&(await Ft(),ue(E),he({tone:"ok",text:u.toast.imported(E.length),action:ft}))},bs=async d=>{var b;if(!r)return;const g=await Mt.prompt({title:u.dialog.renameGroupTitle,label:u.dialog.name,value:((b=r.groupNames)==null?void 0:b[d])??d,ok:u.dialog.save});g!=null&&g.value.trim()&&Yt(E=>({...E,groupNames:{...E.groupNames??{},[d]:g.value.trim()}}),u.history.renameGroup)},Zl=async(d,g)=>{try{const b=await Ce.post("/api/pages",d);return await Ft(),g&&he({tone:"ok",text:g,action:ft}),b}catch(b){return he({tone:"error",text:String(b.message)}),null}},bu=async()=>{if($t.length>=40)return he({tone:"error",text:u.toast.pagesMax});const d=await Mt.prompt({title:u.dialog.newPageTitle,label:u.dialog.name,value:u.dialog.newPageName(Math.max($t.length,1)+1),ok:u.dialog.create});if(!(d!=null&&d.value.trim()))return;const g=await Zl({action:"add",name:d.value.trim()});g!=null&&g.id&&N(g.id)},xu=async d=>{const g=$t.find(E=>E.id===d),b=await Mt.prompt({title:u.dialog.renamePageTitle,label:u.dialog.name,value:(g==null?void 0:g.name)??"",ok:u.dialog.rename});!(b!=null&&b.value.trim())||b.value.trim()===(g==null?void 0:g.name)||await Zl({action:"rename",id:d,name:b.value.trim()})},wu=async d=>{const g=$t.find(E=>E.id===d),b=Object.values((r==null?void 0:r.boards)??{}).filter(E=>{var z;return(E.page??((z=$t[0])==null?void 0:z.id))===d}).length;await Mt.confirm({title:u.dialog.deletePageTitle((g==null?void 0:g.name)??""),body:u.dialog.deletePageBody(b),ok:u.dialog.delete,danger:!0})&&(mn===d&&N(null),await Zl({action:"delete",id:d},u.toast.pageDeleted))},go=(d,g)=>void Zl({action:"move",id:d,index:g}),kc=(d,g)=>{var E,z;const b=$t.findIndex(Z=>Z.id===d);rt({x:g.clientX,y:g.clientY,title:(E=$t[b])==null?void 0:E.name,items:[{label:u.menu.rename,icon:"edit",run:()=>void xu(d)},{label:u.menu.moveUp,icon:"chevronDown",disabled:b<=0,run:()=>go(d,b-1)},{label:u.menu.moveDown,icon:"chevronDown",disabled:b>=$t.length-1,run:()=>go(d,b+1)},{label:((z=r==null?void 0:r.launch)==null?void 0:z.page)===d?u.menu.unsetLaunchPage:u.menu.setLaunchPage,icon:"page",run:()=>Yt(Z=>{var te;return{...Z,launch:{...Z.launch??{view:"canvas"},page:((te=Z.launch)==null?void 0:te.page)===d?void 0:d}}},u.history.launchPage)},...v.length?[{label:u.menu.moveSelectedToPage(v.length),icon:"page",run:()=>Yt(Z=>({...Z,boards:{...Z.boards,...Object.fromEntries(v.map(te=>{var de;return[te,{...Z.boards[te],page:d===((de=$t[0])==null?void 0:de.id)?void 0:d}]}))}}),u.history.moveToPage)}]:[],"sep",{label:u.menu.delete,icon:"trash",danger:!0,disabled:$t.length<=1,run:()=>void wu(d)}]})},Su=async d=>{if(Ct.current.has(d))return;Ct.current.add(d),st([...Ct.current]);const g=s1(d);he({text:u.toast.pngExporting(g)});try{const b=await Ce.blob("/api/screenshot",{file:d,inline:!0}),E=URL.createObjectURL(b),z=document.createElement("a");z.href=E,z.download=g,document.body.append(z),z.click(),z.remove(),setTimeout(()=>URL.revokeObjectURL(E),1e4),he({tone:"ok",text:u.toast.pngExported(g)})}catch(b){const E=b;o1(E.status,E.message)==="browser"?he({tone:"error",text:u.toast.pngNeedsBrowser,code:"npx playwright install chromium",ms:1e4}):he({tone:"error",text:u.toast.pngFailed(c1(E.message))})}finally{Ct.current.delete(d),st([...Ct.current])}},Cc=d=>{const g=v.includes(d)?v:[d],b=g.length>1;return[{label:u.menu.selectInside,icon:"select",shortcut:"Enter",disabled:b,run:()=>Rc(d)},{label:Ne===d?u.menu.stopPlay:u.menu.playInPlace,icon:"play",shortcut:"P",disabled:b,run:()=>Ne===d?Ui():mt(d)},{label:u.menu.playFullScreen,icon:"play",disabled:b,run:()=>Se(d)},{label:u.menu.askReview,icon:"comment",run:()=>ca(u.prompts.review,g)},{label:u.menu.focusView,icon:"focus",shortcut:"F",disabled:b,run:()=>xt(d)},{label:u.menu.askAI,icon:"comment",shortcut:`${kt}J`,run:()=>ca(void 0,g)},...et[d]||a!=null&&a.missing.includes(d)?[{label:u.menu.askFixErrors,icon:"warn",run:()=>Ri([d])}]:[],{label:u.menu.goToBoard,icon:"fit",shortcut:"⇧2",run:()=>sa(g)},"sep",{label:u.menu.rename,icon:"title",shortcut:"F2",disabled:b,run:()=>void il(d)},{label:u.menu.renameFile,icon:"link",disabled:b,run:()=>void La(d)},{label:u.menu.duplicate,icon:"copy",shortcut:`${kt}D`,disabled:b,run:()=>void Di(d)},{label:_t.includes(d)?u.menu.exportingPng:u.menu.exportPng,icon:"image",disabled:b||_t.includes(d)||!!(a!=null&&a.missing.includes(d)),run:()=>void Su(d)},"sep",{label:u.menu.front,icon:"front",shortcut:`${kt}]`,run:()=>ya(g,"front")},{label:u.menu.back,icon:"back",shortcut:`${kt}[`,run:()=>ya(g,"back")},"sep",{label:b?u.menu.deleteBoards(g.length):u.menu.delete,icon:"trash",shortcut:"⌫",danger:!0,run:()=>void oa(g)}]},ju=(d,g)=>{var b,E;r&&(d.type==="board"?(v.includes(d.file)||ka([d.file]),rt({x:g.clientX,y:g.clientY,title:((b=r.boards[d.file])==null?void 0:b.title)??d.file,items:Cc(d.file)})):d.type==="note"?(ee(d.id),rt({x:g.clientX,y:g.clientY,title:((E=r.notes[d.id])==null?void 0:E.kind)==="title"?u.menu.title:u.menu.note,items:[{label:u.menu.duplicateInFront,icon:"copy",shortcut:`${kt}D`,run:()=>{const z=r.notes[d.id],Z=$i();Yt(te=>({...te,notes:{...te.notes,[Z]:{...z,x:z.x+40,y:z.y+40}}}),u.history.duplicateNote),ee(Z)}},"sep",{label:u.menu.delete,icon:"trash",shortcut:"⌫",danger:!0,run:()=>Bi([d.id])}]})):rt({x:g.clientX,y:g.clientY,items:[{label:u.menu.newBoardHere,icon:"board",shortcut:"B",run:()=>void ll({x:Math.round(d.x),y:Math.round(d.y),w:390,h:844})},{label:u.menu.mobileFrameHere,icon:"board",run:()=>void ll({x:Math.round(d.x),y:Math.round(d.y)},"mobile")},{label:u.menu.titleHere,icon:"title",shortcut:"T",run:()=>Cl("title",d)},{label:u.menu.noteHere,icon:"sticky",shortcut:"N",run:()=>Cl("sticky",d)},"sep",{label:u.menu.selectAll,icon:"select",shortcut:`${kt}A`,run:()=>ka(en)},{label:u.menu.fitAll,icon:"fit",shortcut:"⇧1",run:al},{label:u.menu.zoom100,icon:"search",shortcut:`${kt}0`,run:()=>Vl(1)},"sep",{label:u.menu.undo,icon:"undo",shortcut:`${kt}Z`,disabled:!Ea.canUndo,run:()=>void wn("undo")},{label:u.menu.redo,icon:"redo",shortcut:`⇧${kt}Z`,disabled:!Ea.canRedo,run:()=>void wn("redo")}]}))};Oi.current=(d,g)=>{var Z;if(!k)return;const b=()=>ia(k,d),E=(Z=$e.current.get(k))!=null&&Z.contentDocument?Hn($e.current.get(k).contentDocument,d):null,z=d.includes("/")?d.slice(0,d.lastIndexOf("/")):null;rt({x:g.clientX,y:g.clientY,title:E?`<${E.tagName.toLowerCase()}>`:u.menu.element,items:[{label:u.menu.editText,icon:"edit",disabled:!E||E.children.length>0,run:()=>E&&Nc(k,E,d)},{label:u.menu.selectParent,icon:"layers",shortcut:"↑",disabled:z==null,run:()=>z!=null&&void Te.select([z])},{label:u.menu.elementToAI,icon:"comment",run:()=>ca()},{label:u.menu.copy,icon:"copy",shortcut:`${kt}C`,run:()=>void Tc()},{label:u.menu.pasteAfter,icon:"copy",shortcut:`${kt}V`,run:()=>void Fn()},...(E==null?void 0:E.tagName)==="IMG"?[{label:u.menu.replaceImage,icon:"page",run:()=>hs(d,!0)}]:[],{label:u.menu.copyForAI,icon:"copy",run:()=>void navigator.clipboard.writeText(`${k} ${d} <${E==null?void 0:E.tagName.toLowerCase()}> "${((E==null?void 0:E.textContent)??"").trim().slice(0,60)}"`).then(()=>he({tone:"ok",text:u.toast.copied}))},"sep",{label:u.menu.duplicate,icon:"copy",shortcut:`${kt}D`,run:async()=>void Jt({op:"duplicate",path:d,hash:await b()})},{label:u.menu.delete,icon:"trash",shortcut:"⌫",danger:!0,run:async()=>{await Jt({op:"delete",path:d,hash:await b()})&&(Te.select([]),he({text:u.toast.elementDeleted,action:ft}))}}]})};const Ui=()=>{var g,b;const d=Ne;mt(null),(b=(g=document.activeElement)==null?void 0:g.blur)==null||b.call(g),Ny(),d&&(Kt.reset(d),at(Mn(d)),xn(Mn(d)))};w.useEffect(()=>{if(!Ne)return;const d=$e.current.get(Ne);if(!d)return;const g=z=>z.key==="Escape"&&xs.current();let b=null;const E=()=>{b==null||b.removeEventListener("keydown",g,!0),b=d.contentDocument,b==null||b.addEventListener("keydown",g,!0)};return E(),d.addEventListener("load",E),()=>{d.removeEventListener("load",E),b==null||b.removeEventListener("keydown",g,!0)}},[Ne,Ge]);const xs=w.useRef(()=>{});xs.current=Ui;const[Ql,Fl]=w.useState(()=>!window.matchMedia("(max-width: 1000px)").matches),Nu=nh(h,d=>{if(!r||!Ql||De!=="chat")return 0;const g=-d.x/d.zoom,b=-d.y/d.zoom,E=dn.w/d.zoom,z=dn.h/d.zoom;return en.filter(Z=>{const te=r.boards[Z];return te.x<g+E&&te.x+te.w>g&&te.y<b+z&&te.y+te.h>b}).length}),Mc=R0(h,_&&Ql),zc=w.useRef(!1);w.useEffect(()=>{const d=setTimeout(()=>zc.current=!0,1500);return()=>clearTimeout(d)},[]),w.useEffect(()=>{oe&&zc.current&&Fl(!0)},[oe,v,k,De]),w.useEffect(()=>{oe&&Ke&&Fl(!1)},[oe,Ke]),w.useEffect(()=>{oe&&Ql&&Pe(!1)},[oe,Ql]);const Tu=()=>{const d=Ke||Ql;Pe(!d),Fl(!d)},Eu=d=>{const g=[".oc-dock",".oc-left",".canvas",".oc-right"].map(Z=>document.querySelector(Z)).filter(Boolean),b=g.findIndex(Z=>Z.contains(document.activeElement)),E=g[(b+(d?-1:1)+g.length)%g.length],z=E.matches(".canvas")?E:E.querySelector("button:not([disabled]), input, select, textarea, [tabindex]");E.matches(".canvas")&&(E.tabIndex=-1),(z??E).focus()},ku=async d=>{if(!k)return;const g=[...Te.state.paths].sort((E,z)=>Number(E.split("/").pop())-Number(z.split("/").pop())),b=await Promise.all(g.map(E=>ia(k,E)));await Jt({op:"wrap",paths:g,hashes:b,display:d})&&(Te.select([g[0]]),he({tone:"ok",text:u.toast.wrapped(d),action:ft}))},Ac=async(d,g)=>{try{await Ce.put("/api/tokens",{...d,label:g}),Sl(b=>b+1),he({tone:"ok",text:g===u.history.changeTheme?u.toast.theme(d.active):u.toast.tokensSaved,action:ft})}catch(b){he({tone:"error",text:String(b.message)})}},ol=(d,g)=>{if(k===d){g.join()!==Te.state.paths.join()&&Te.select(g);return}jl.current={file:d,paths:g},$(d),x([d]),O([]),Ln([])},Oc=(d,g)=>ol(d,[g]),Dc=(d,g,b)=>{const E=Lf($e.current.get(d),g.clientX,g.clientY);if(!E)return void(!b.add&&k===d&&$(null));if(b.add&&k===d){const z=Te.state.paths;return void Te.select(z.includes(E.path)?z.filter(Z=>Z!==E.path):[...z,E.path])}ol(d,[E.path]),b.double&&Nc(d,E.el,E.path)};fs.current=Dc,w.useEffect(()=>{var E,z;const d=jl.current,g=d&&k===d.file?$e.current.get(d.file):null;if(!d||!g)return;const b=()=>{jl.current=null,Te.select(d.paths)};return((E=g.contentDocument)==null?void 0:E.readyState)==="complete"&&((z=g.contentDocument.body)!=null&&z.childElementCount)?b():(g.addEventListener("load",b,{once:!0}),()=>g.removeEventListener("load",b))},[k,Ge]);const Rc=d=>{var z,Z;const g=(z=$e.current.get(d))==null?void 0:z.contentDocument,b=g?Array.from(((Z=g.body)==null?void 0:Z.children)??[]).find(te=>!/^(SCRIPT|STYLE|TEMPLATE)$/.test(te.tagName)):null,E=b?Ta(b):"0";E!=null&&ol(d,[E])};w.useEffect(()=>{k&&!(v.length===1&&v[0]===k)&&$(null)},[v]),w.useEffect(()=>{I(null),se(null)},[k,S]),w.useEffect(()=>{Ne&&k===Ne&&$(null)},[Ne]);const Nn=k??(v.length===1?v[0]:null),$c=w.useMemo(()=>{var d;return Tx(k?(d=$e.current.get(k))==null?void 0:d.contentDocument:null)},[k,Ge,Le[k??""],(No=Te.state.selection)==null?void 0:No.hash]);w.useEffect(()=>{if(!Nn)return zn(null);Ce.get(`/api/lint?f=${encodeURIComponent(Nn)}`).then(d=>zn(d.files[Nn]??[])).catch(()=>zn(null))},[Nn,Le[Nn??""],hn]),w.useEffect(()=>{if(!Nn)return Wa(null);const d=()=>{var E;const b=(E=$e.current.get(Nn))==null?void 0:E.contentDocument;Wa((b==null?void 0:b.readyState)==="complete"?xx(b,(Qt==null?void 0:Qt.minTarget)??48):null)},g=window.setTimeout(d,600);return()=>window.clearTimeout(g)},[Nn,Ge,Le[Nn??""],Qt==null?void 0:Qt.minTarget,pu]);const Li=d=>{var E;const g=d.currentTarget.getBoundingClientRect(),b=((E=d.currentTarget.closest(".oc-dock"))==null?void 0:E.getBoundingClientRect())??g;return{clientX:g.left,clientY:b.top-8}},Gi=d=>rt({x:d.clientX,y:d.clientY,up:!0,title:u.toolbar.canvasTools,items:Ci.slice(0,5).map(g=>({label:g.label,icon:g.icon,shortcut:g.key,check:S===g.id,run:()=>T(g.id)}))}),Cu=d=>rt({x:d.clientX,y:d.clientY,up:!0,title:u.toolbar.shapes,items:[...Ci.slice(5).map(g=>({label:g.label,icon:g.icon,shortcut:g.key,check:S===g.id,run:()=>T(g.id)})),"sep",{label:u.toolbar.insertImage,icon:"image",run:()=>Ha(()=>g=>{Ha(null),vs(g)})}]}),Bc=d=>{const g=Qt?Object.keys(Qt.themes):[];rt({x:d.clientX,y:d.clientY,right:!0,className:"view oc-menu",title:u.toolbar.viewMenu,head:oe?o.jsx(If,{store:h,onZoom:pa,onZoom100:()=>Vl(1),onFit:al,menu:!0}):void 0,items:[...oe?[{label:u.toolbar.history,icon:"clock",run:()=>Ss()},"sep"]:[],{label:u.toolbar.guides,icon:"grid",shortcut:"⌃G",check:Pa,run:()=>Gl(b=>!b)},{label:u.toolbar.minimap,icon:"map",shortcut:"M",check:oe?He:ge,run:po},{label:u.toolbar.leftPanel,icon:"panel",shortcut:`${kt}\\`,check:Ke,run:()=>Pe(b=>!b)},"sep",{label:u.toolbar.appearance(M),icon:M==="system"?"system":M==="light"?"sun":"moon",run:()=>W(b=>b==="system"?"light":b==="light"?"dark":"system")},...g.length>1?g.map(b=>({label:u.toolbar.themeOption(b),icon:"layers",check:Qt.active===b,run:()=>void Ac({...Qt,active:b},u.history.changeTheme)})):[],{label:u.toolbar.language(tu.find(b=>b.id===uu).name),icon:"globe",run:()=>t0(tu[(tu.findIndex(b=>b.id===uu)+1)%tu.length].id)},"sep",{label:u.toolbar.snapshot,icon:"layers",run:()=>void yo(d,!0)}]})},po=()=>oe?me(d=>!d):je(d=>!d),_c=d=>rt({x:d.clientX,y:d.clientY,title:(a==null?void 0:a.dir)??(r==null?void 0:r.title),items:[{label:u.boardList.search,icon:"search",shortcut:"⌘K",run:()=>{na("boards"),Pe(!0),setTimeout(()=>{var g;return(g=ut.current)==null?void 0:g.focus()},0)}},{label:u.toolbar.snapshot,icon:"layers",run:()=>void yo(d)}]}),Hc=(d,g)=>{!r||!a||rt({x:d.clientX,y:d.clientY,title:u.toolbar.erroredBoardsN(g.length),items:[...g.slice(0,12).map(b=>{var E,z,Z;return{label:`${((E=r.boards[b])==null?void 0:E.title)??b} — ${(((Z=(z=et[b])==null?void 0:z[0])==null?void 0:Z.message)??u.menu.fileMissing).slice(0,40)}`,icon:"warn",run:()=>{ka([b]),sa([b])}}}),"sep",{label:u.menu.askFixAll,icon:"comment",run:()=>Ri(g)},...a.missing.length?[{label:u.menu.cleanMissing(a.missing.length),icon:"trash",danger:!0,run:()=>{Yt(b=>{const E={...b.boards};for(const z of a.missing)delete E[z];return{...b,boards:E,order:b.order.filter(z=>!a.missing.includes(z))}},u.history.cleanMissing),he({text:u.toast.cleanedUp(a.missing.length),action:ft})}}]:[]]})},yo=async(d,g=!1)=>{const b=await Ce.get("/api/snapshots").catch(()=>null);if(!(b!=null&&b.git))return rt({x:d.clientX,y:d.clientY,right:g,title:u.menu.snapshot,items:[{label:u.menu.notGit,disabled:!0,run:()=>{}}]});rt({x:d.clientX,y:d.clientY,right:g,title:u.menu.snapshotStatus(b.branch??"",b.changed),items:[{label:b.changed?u.menu.snapshotNow:u.menu.nothingChanged,icon:"check",disabled:!b.changed,run:async()=>{const E=await Mt.prompt({title:u.dialog.snapshotTitle,label:u.dialog.snapshotLabel,value:u.dialog.snapshotMessage(new Date().toLocaleDateString("en-CA")),hint:u.dialog.snapshotHint,ok:u.dialog.commit});if(E)try{const z=await Ce.post("/api/snapshot",{message:E.value});he({tone:"ok",text:z.nothing?u.toast.nothingChanged:u.toast.snapshot(z.hash??"")})}catch(z){he({tone:"error",text:String(z.message)})}}},"sep",...b.snapshots.slice(0,10).map(E=>({label:`${E.hash} ${E.subject.slice(0,40)} · ${E.when}`,disabled:!0,run:()=>{}}))]})};w.useEffect(()=>Ey(k),[k]);const Jl=async d=>{const g=Qn.current,b=g&&iu(g,d);if(!g||!b)return;const E=z=>{var Z;return((Z=g.boards[z])==null?void 0:Z.title)??z};nl(z=>z&&{...z,busy:!0});try{const z=await Ce.post("/api/boards/use",{file:d});nl(null),k&&b.alts.includes(k)&&$(null),await Ft(),ue([b.original]);const Z=b.chosen===b.original?u.occupancy.kept(E(b.original),b.alts.length):u.occupancy.applied(qx(E(b.chosen)),E(b.original));he({tone:"ok",text:Z,action:z.step?{label:u.occupancy.undo,run:()=>void Uc(z.step,Z,[b.original,...b.alts])}:ft})}catch(z){nl(Z=>Z&&{...Z,busy:!1}),he({tone:"error",text:String(z.message)})}Gn(),dt.reload()},Mu=async d=>{const g=Qn.current,b=g&&iu(g,d);if(!(!g||!b)){nl(E=>E&&{...E,busy:!0});try{const E=await Ce.post("/api/boards/keep",{file:d});nl(null),await Ft();const z=u.occupancy.keptAll(b.kind,b.alts.length);he({text:z,action:E.step?{label:u.occupancy.undo,run:()=>void Uc(E.step,z)}:ft})}catch(E){nl(z=>z&&{...z,busy:!1}),he({tone:"error",text:String(E.message)})}Gn(),dt.reload()}},Uc=async(d,g,b=[])=>{try{await Ce.post("/api/history/undo-steps",{ids:[d],mode:"rest"}),await Ft(),b.length&&ue(b),he({text:u.toast.undoRedoDone("undo",g),action:{label:u.toolbar.redo,run:()=>void wn("redo")}})}catch(E){he({tone:"error",text:String(E.message)})}Gn(),dt.reload()},Lc=w.useRef([]);w.useEffect(()=>{const d=[...v,...k?[k]:[]],g=d.filter(b=>!Lc.current.includes(b));Lc.current=d;for(const b of g)dt.markSeen(dt.tagsOf(b).flatMap(E=>E.steps))},[v,k]);const Yi=(d,g)=>dt.tagsOf(d).find(b=>b.key===g)??null,vo=(d,g)=>{Yi(d,g)&&la(b=>(b==null?void 0:b.file)===d&&b.key===g?null:{file:d,key:g,conflict:null,busy:!1})},Il=w.useRef(vo);Il.current=vo;const qi=w.useCallback((d,g)=>Il.current(d,g),[]),bo=w.useRef(null);w.useEffect(()=>{var b;const d=bo.current,g=zt&&Yi(zt.file,zt.key);bo.current=g?{id:`${zt.file}|${g.key}`,steps:g.steps}:null,d&&d.id!==((b=bo.current)==null?void 0:b.id)&&dt.markSeen(d.steps)},[zt==null?void 0:zt.file,zt==null?void 0:zt.key]);const ws=async(d,g,b)=>{var z,Z,te;la(de=>de&&{...de,busy:!0});const E=((Z=(z=dt.data)==null?void 0:z.steps.find(de=>de.id===g.steps[0]))==null?void 0:Z.name)??"";try{const de=()=>Ce.post("/api/history/undo-steps",{ids:g.steps,mode:b});g.run?await Ce.post("/api/chat/undo-run",{id:g.run,mode:b}).catch(ze=>ze.status===404?de():Promise.reject(ze)):await de(),la(null),he({text:u.toast.undoRedoDone("undo",g.steps.length===1?E:u.activity.changes(g.steps.length)),action:{label:u.toolbar.redo,run:()=>void wn("redo")}}),await Ft()}catch(de){const ze=de,Je=ze.status===409?(te=ze.body)==null?void 0:te.conflicts:void 0;Je?la(qe=>qe&&{...qe,busy:!1,conflict:[...new Set(Je.map(pt=>{var Tn,ct;return pt.file.endsWith(".html")?((ct=(Tn=Qn.current)==null?void 0:Tn.boards[pt.file])==null?void 0:ct.title)??pt.file:pt.file}))]}):(la(qe=>qe&&{...qe,busy:!1}),he({tone:"error",text:ze.message}))}Gn(),dt.reload()},Gc=async d=>{co(!0);try{await Ce.post("/api/history/goto",{id:d.id}),he({text:u.activity.wentBack(d.name)}),await Ft()}catch(g){he({tone:"error",text:String(g.message)})}finally{co(!1),Gn(),dt.reload()}},xo=w.useCallback(()=>oo(!1),[]),Ss=()=>{dt.reload(),oo(!0)};w.useEffect(()=>{zt&&!Yi(zt.file,zt.key)&&la(null)},[dt.data,dt.now]);const js=w.useRef(()=>{});js.current=d=>{var ze,Je,qe,pt,Tn,ct,tn;if(!r||Mt.state||ke||re||Dy(d)||d.isComposing)return;const g=d.metaKey||d.ctrlKey,b=d.key.toLowerCase(),E=v.length===1?v[0]:null,z=Ae=>{d.preventDefault(),Ae()};if(g&&b==="z")return z(()=>void wn(d.shiftKey?"redo":"undo"));if(g&&b==="y")return z(()=>void wn("redo"));if(g&&b==="j")return z(()=>De==="chat"?Qe("inspect"):ca());if(g&&b==="k")return z(()=>{Pe(!0),setTimeout(()=>{var Ae;return(Ae=ut.current)==null?void 0:Ae.focus()},0)});if(g&&b==="a"&&!k)return z(()=>ka(en));if(g&&b==="a"&&k){const Ae=(ze=$e.current.get(k))==null?void 0:ze.contentDocument,We=(Je=Te.state.selection)==null?void 0:Je.path,Ut=Ae&&(We?(qe=Hn(Ae,We))==null?void 0:qe.parentElement:Ae.body.firstElementChild),ra=Ut?Array.from(Ut.children).filter(At=>!/^(SCRIPT|STYLE)$/.test(At.tagName)).map(At=>Ta(At)).filter(At=>At!=null):[];return z(()=>ra.length&&void Te.select(ra))}if(g&&b==="c"&&k&&Te.state.selection)return z(()=>void Tc());if(g&&b==="v"&&k)return z(()=>void Fn());if(g&&b==="d"&&k&&Te.state.selection){const Ae=Te.state.selection;return z(()=>void Jt({op:"duplicate",path:Ae.path,hash:Ae.hash}))}if(g&&b==="d"&&E&&!k)return z(()=>void Di(E));if(g&&d.key==="]"&&v.length)return z(()=>ya(v,"front"));if(g&&d.key==="["&&v.length)return z(()=>ya(v,"back"));if(g&&d.key==="0")return z(()=>Vl(1));if(g&&d.key==="1")return z(al);if(g&&(d.key==="="||d.key==="+"))return z(()=>pa(2));if(g&&d.key==="-")return z(()=>pa(1/2));if(g&&d.key==="\\")return z(()=>Tu());if(d.ctrlKey&&!d.metaKey&&b==="g")return z(()=>Gl(Ae=>!Ae));if(g&&b==="g"&&k&&Te.state.paths.length>=2)return z(()=>void ku("flex"));if(g)return;if(d.shiftKey&&d.code==="Digit1")return z(al);if(d.shiftKey&&d.code==="Digit2")return z(()=>sa(v));if(d.key==="Escape"){if(Ne)return z(()=>Ui());if(k)return z(()=>$(null));if(S!=="select")return z(()=>T("select"));x([]),ee(null),Kn(null);return}if(d.key==="F6")return z(()=>Eu(d.shiftKey));const Z=document.activeElement,te=!Z||Z===document.body||!!((pt=Z.closest)!=null&&pt.call(Z,".canvas"))||Z.tagName==="IFRAME";if(d.key==="Tab"&&!d.shiftKey&&te&&k&&Te.state.selection){const Ae=document.querySelector('.etb button[tabindex="0"]');if(Ae)return z(()=>Ae.focus())}if(d.key==="Tab"&&te&&!k&&en.length){const Ae=v.length?en.indexOf(v[v.length-1]):-1,We=en[(Ae+(d.shiftKey?-1:1)+en.length)%en.length];return z(()=>{var Ut;ka([We]),sa([We]),_e(u.app.announceBoard(((Ut=r.boards[We])==null?void 0:Ut.title)??We,en.indexOf(We)+1,en.length))})}if(d.key==="Enter"&&!k&&v.length===1&&te)return z(()=>Rc(v[0]));if(d.key==="Enter"&&k&&Te.state.selection){const Ae=(Tn=$e.current.get(k))==null?void 0:Tn.contentDocument,We=Ae&&Hn(Ae,Te.state.selection.path),Ut=d.shiftKey?We==null?void 0:We.parentElement:We==null?void 0:We.firstElementChild,ra=Ut&&Ut!==(Ae==null?void 0:Ae.body)?Ta(Ut):null;return ra!=null?z(()=>void Te.select([ra])):void 0}if(b==="p"&&!g&&i1(v,r.boards)==="play")return z(()=>Ne===v[0]?Ui():mt(v[0]));if((d.key==="Delete"||d.key==="Backspace")&&rn.length&&!k)return z(()=>Hi(rn));if(d.key==="Delete"||d.key==="Backspace"){if(k&&Te.state.selection){const Ae=Te.state.selection;return z(async()=>{await Jt({op:"delete",path:Ae.path,hash:Ae.hash})&&(Te.select([]),he({text:u.toast.elementDeleted,action:ft}))})}return C.length||v.length&&!k?z(()=>{C.length&&Bi(C),v.length&&!k&&oa(v)}):void 0}if((d.key.startsWith("Arrow")||d.key==="Enter")&&k&&Te.state.selection){const Ae=Te.state.selection,We=(ct=$e.current.get(k))==null?void 0:ct.contentDocument,Ut=We&&Hn(We,Ae.path);if(!Ut)return;if(d.altKey&&(d.key==="ArrowUp"||d.key==="ArrowDown")){const At=Ae.path.includes("/")?Ae.path.slice(0,Ae.path.lastIndexOf("/")):"",qt=Number(Ae.path.split("/").pop()),In=d.key==="ArrowUp"?qt-1:qt+1;return In<0||In>=(((tn=Ut.parentElement)==null?void 0:tn.children.length)??0)?z(()=>{}):z(()=>void uo(Ae.path,{toParentPath:At,index:In,freeze:[]}))}const ra=d.key==="ArrowUp"||d.key==="Enter"&&d.shiftKey?Ut.parentElement:d.key==="ArrowDown"||d.key==="Enter"?Ut.firstElementChild:d.key==="ArrowRight"?Ut.nextElementSibling:Ut.previousElementSibling;if(ra&&ra!==We.body){const At=Ta(ra);if(At!=null)return z(()=>void Te.select([At]))}return z(()=>{})}if(d.key.startsWith("Arrow")&&(v.length||C.length||rn.length)&&!k){const Ae=d.altKey?100:d.shiftKey?10:1;return z(()=>sl(d.key==="ArrowLeft"?-Ae:d.key==="ArrowRight"?Ae:0,d.key==="ArrowUp"?-Ae:d.key==="ArrowDown"?Ae:0))}if(d.key==="F2"&&E)return z(()=>void il(E));if(b==="f"&&E)return z(()=>xt(E));if(b==="m")return z(po);const de=Ci.find(Ae=>Ae.key.toLowerCase()===b);if(de)return z(()=>T(de.id))},w.useEffect(()=>{const d=g=>js.current(g);return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[]);const Yc=(d,g)=>{var pt,Tn;const b=Be.filter(ct=>ct.file===d&&!ct.resolved),E=(pt=$e.current.get(d))==null?void 0:pt.contentDocument,z=k===d,Z=Pa?(((Tn=r==null?void 0:r.guides)==null?void 0:Tn[d])??[]).filter(ct=>!ct.hidden):[],te=Ne===d?void 0:dt.tagsOf(d).find(ct=>ct.paths.length&&dt.stateOf(ct)==="fresh"),de=(q==null?void 0:q.file)===d&&Ne!==d&&!(z&&Te.state.paths.includes(q.path))?q:null,ze=(ce==null?void 0:ce.file)===d?ce.rect:null,Je=_t.includes(d);if(!z&&!b.length&&!Z.length&&!te&&!de&&!ze&&!Je)return null;const qe=1/Math.max(g,.05);return o.jsxs("div",{className:"overlay",children:[Je&&o.jsx("div",{className:"export-badge",role:"status",style:{transform:`scale(${1/Math.max(g,.25)})`},children:u.canvas.exportingPng}),te&&o.jsx(c0,{frame:$e.current.get(d)??null,paths:te.paths,zoom:g}),Z.length>0&&r&&o.jsx(k0,{guides:Z,w:r.boards[d].w,h:r.boards[d].h}),de&&o.jsx(Jf,{r:de.rect,cls:"hover",px:qe}),z&&Te.state.rects.map((ct,tn)=>o.jsx(Jf,{r:ct,cls:"sel",px:qe},tn)),ze&&o.jsx(Jf,{r:ze,cls:"marquee-el",px:qe}),z&&J!==d&&E&&Te.state.paths.length===1&&Te.state.rects[0]&&o.jsx(Ax,{doc:E,path:Te.state.paths[0],rect:Te.state.rects[0],zoom:g,onMove:ct=>void uo(Te.state.paths[0],ct),onPosition:async(ct,tn)=>{const Ae=Te.state.paths[0],We=await ia(d,Ae);await Jt({op:"batch",ops:[{op:"setStyle",path:Ae,hash:We,prop:"left",value:`${ct}px`},{op:"setStyle",path:Ae,hash:We,prop:"top",value:`${tn}px`}]})},onResize:async(ct,tn)=>{const Ae=Te.state.paths[0],We=await ia(d,Ae);await Jt({op:"batch",ops:[{op:"setStyle",path:Ae,hash:We,prop:"width",value:`${ct}px`},{op:"setStyle",path:Ae,hash:We,prop:"height",value:`${tn}px`}]})}}),b.map((ct,tn)=>{const Ae=E&&ct.path?Hn(E,ct.path):null,We=Ae?wl(Ae):null;return o.jsx("div",{className:"pin",title:ct.text,style:We?{left:We.x+We.w-12,top:We.y-12,transform:`scale(${1/Math.max(g,.25)})`}:{right:8,top:8+tn*30,transform:`scale(${1/Math.max(g,.25)})`},children:tn+1},ct.id)})]})};if(!r||!a)return o.jsx("div",{className:"loading",role:"status",children:B?o.jsxs(o.Fragment,{children:[o.jsx(ne,{name:"warn"})," ",u.app.loadFailed," ",B,o.jsx("button",{onClick:()=>void Ft(),children:u.app.retry})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"spinner","aria-hidden":"true"})," ",u.app.loadingBoards]})});const Ze=v.length===1?v[0]:null,Wl=[...new Set([...a.missing,...Object.keys(et)])],zu=o.jsxs("div",{className:"oc-tabs",role:"tablist","aria-label":u.tabs.left,ref:ot,children:[o.jsx("button",{role:"tab","aria-selected":cn==="boards",className:cn==="boards"?"on":"",onClick:()=>na("boards"),children:u.tabs.boards}),o.jsx("button",{role:"tab","aria-selected":cn==="assets",className:cn==="assets"?"on":"",onClick:()=>na("assets"),children:u.tabs.assets}),o.jsx("button",{role:"tab","aria-selected":cn==="tokens",className:cn==="tokens"?"on":"",onClick:()=>na("tokens"),children:u.tabs.tokens})]}),Vi=en.map(d=>({file:d,...r.boards[d]})),Au=!k&&!v.length&&!C.length&&!rn.length,Ga=!Ql||De==="inspect"&&Au,Pl=_&&!Ga,An=oe?8:12,Ml=D.h-An-(oe?64:184),ei=`oc-card oc-left ${Ke?"":"is-collapsed"} ${Ke&&cn!=="boards"?"is-tall":""}`,Xi=o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"oc-head",children:[o.jsxs("button",{className:"oc-project",title:a.dir??r.title,"aria-haspopup":"menu",onClick:d=>{const g=d.currentTarget.getBoundingClientRect();_c({clientX:g.left,clientY:g.bottom+8})},children:[o.jsx("strong",{className:"app-title",children:r.title}),o.jsx(ne,{name:"chevronDown",size:16})]}),o.jsx("button",{className:`icon-btn oc-ib ${Ke?"on":""}`,"aria-label":u.toolbar.leftPanel,"aria-pressed":Ke,title:u.toolbar.leftPanelTitle(kt),onClick:()=>Pe(d=>!d),children:o.jsx(ne,{name:"panel"})})]}),(Wl.length>0||B)&&o.jsxs("div",{className:"oc-status",children:[Wl.length>0&&o.jsxs("button",{className:"err-chip","aria-haspopup":"menu",title:u.toolbar.erroredBoards,onClick:d=>{const g=d.currentTarget.getBoundingClientRect();Hc({clientX:g.left,clientY:g.bottom+8},Wl)},children:[o.jsx(ne,{name:"warn",size:16})," ",u.toolbar.errors(Wl.length)]}),B&&o.jsx("span",{className:"warn",children:B})]}),Ke&&zu]}),ti=Te.state.selection,wo=!!k&&!!r.boards[k]&&!!ti&&ti.file===k&&Te.state.paths.length===1&&!J&&S==="select"&&Ne!==k,So=zi||!!(ve!=null&&ve.up),jo=!wo&&S==="select"&&!J&&!So&&!(Ze&&Ne===Ze),qc=(()=>{if(!Pl)return 0;const d=k?r.boards[k]:Ze?r.boards[Ze]:null,g=k?Te.state.rects[0]:null,b=Mc??h.get(),E=d?b.y+(d.y+(g?g.y+g.h:d.h))*b.zoom+4:0;return Math.round(so(E+8,An+48+An,D.h-(De==="chat"?480:280)))})(),va=k&&((cl=Te.state.selection)==null?void 0:cl.file)===k?Te.state.selection:null,Ns=Nn&&r.boards[Nn]&&o.jsxs("section",{className:"pp-group",children:[o.jsx("h3",{className:"pp-group-h",children:u.sections.checks}),Qt&&!Qt.registered?o.jsx(ao,{variant:"row",id:"token-check",title:u.sections.tokenCheck,count:u.checks.off,children:o.jsx(jx,{onSetUp:()=>{na("tokens"),Pe(!0)}})}):o.jsx(ao,{variant:"row",id:"token-check",title:u.sections.tokenCheck,count:(ma==null?void 0:ma.length)??0,children:o.jsx(fy,{title:u.checks.tokenCheck((Qt==null?void 0:Qt.active)??""),items:ma,empty:u.checks.noOffToken,onPick:d=>Oc(Nn,d),onAskAI:()=>ca(u.prompts.fixTokens((ma??[]).slice(0,12).map(d=>`- ${d.path??u.prompts.line+d.line}: ${d.message}`).join(`
69
+ `)),[Nn])})}),o.jsx(ao,{variant:"row",id:"a11y",title:u.sections.a11y,count:(aa==null?void 0:aa.length)??0,children:o.jsx(fy,{title:u.checks.a11y,items:aa,empty:u.checks.a11yOk,onPick:d=>Oc(Nn,d),onAskAI:()=>ca(u.prompts.fixA11y((aa??[]).slice(0,12).map(d=>`- ${d.path}: ${d.message}`).join(`
70
+ `)),[Nn])})})]});return o.jsxs("div",{className:`app oc ${oe?"oc-n":""} ${D.w<=760?"narrow":""} ${_?"oc-phone":""}`,children:[Ke&&cn==="tokens"?o.jsxs("aside",{className:ei,style:{maxHeight:Ml},"aria-label":u.app.tokensAside,children:[Xi,Qt?o.jsx(wx,{tokens:Qt,onSave:(d,g)=>void Ac(d,g)}):o.jsx("p",{className:"oc-empty",children:u.app.loading})]}):Ke&&cn==="assets"?o.jsxs("aside",{className:ei,style:{maxHeight:Ml},"aria-label":u.app.assetsAside,children:[Xi,o.jsx(Ry,{version:Fa,onError:d=>he({tone:"error",text:d}),onUploaded:d=>he({tone:"ok",text:u.toast.uploaded(d.map(g=>g.name).join(", "))})})]}):Ke?o.jsx(Ix,{className:ei,style:{maxHeight:Ml},header:Xi,ref:ut,board:r,pages:$t,currentPage:mn,selected:v,missing:Wl,onPage:N,onAddPage:()=>void bu(),onPageMenu:kc,onMovePage:go,onPick:(d,g)=>{const b=r.boards[d];$t.length&&b&&(b.page??$t[0].id)!==mn&&N(b.page??$t[0].id),ka([d],g?"toggle":"replace"),g||sa([d]),oe&&!g&&Pe(!1)},onGroupRename:d=>void bs(d),onGroupMenu:(d,g,b)=>{var E;return rt({x:b.clientX,y:b.clientY,title:d&&((E=r.groupNames)==null?void 0:E[d])||d||u.boardList.otherGroup,items:[...d?[{label:u.menu.renameGroup,icon:"title",run:()=>void bs(d)}]:[],{label:u.menu.pageFromGroup,icon:"page",run:async()=>{var Z;if(!$t.length&&!await Zl({action:"add",name:u.boardList.mainPage}))return;const z=await Zl({action:"add",name:d&&((Z=r.groupNames)==null?void 0:Z[d])||d||u.boardList.otherGroup});z!=null&&z.id&&(Yt(te=>({...te,boards:{...te.boards,...Object.fromEntries(g.filter(de=>te.boards[de]).map(de=>[de,{...te.boards[de],page:z.id}]))}}),u.history.pageFromGroup),N(z.id))}}]})},dotOf:d=>Gx(tl,d),onBoardMenu:(d,g)=>{var b;v.includes(d)||ka([d]),rt({x:g.clientX,y:g.clientY,title:((b=r.boards[d])==null?void 0:b.title)??d,items:Cc(d)})}}):o.jsx("aside",{className:ei,"aria-label":u.boardList.aria,children:Xi}),o.jsxs("div",{className:"canvas-wrap",onDragOver:d=>{Array.from(d.dataTransfer.items).some(g=>g.kind==="file")&&d.preventDefault()},onDrop:d=>{const g=Array.from(d.dataTransfer.files);if(!g.length)return;d.preventDefault();const b=d.currentTarget.getBoundingClientRect(),E=h.get(),z={x:(d.clientX-b.left-E.x)/E.zoom,y:(d.clientY-b.top-E.y)/E.zoom};vu(g,z)},children:[o.jsx(L0,{board:r,files:a.files,view:h,tool:S,setTool:T,visibleBoards:en,visibleNotes:ms,selected:v,selectedNotes:C,editFile:k,reloadKeys:jn,versions:Le,onSelect:ka,onSelectNote:(d,g)=>{if(!d)return O([]);O(b=>g?b.includes(d)?b.filter(E=>E!==d):[...b,d]:[d]),g||(x([]),Ln([]))},onMarquee:(d,g)=>{x(b=>g?[...new Set([...b,...d.boards])]:d.boards),O(b=>g?[...new Set([...b,...d.notes])]:d.notes),Ln(b=>g?[...new Set([...b,...d.shapes])]:d.shapes)},onMoveBoards:(d,g)=>Yt(b=>{const E=Object.entries(d),z=E.length>0&&E.every(([,qe])=>qe.w==null&&qe.h==null&&qe.x!=null&&qe.y!=null),[Z,te]=E[0]??[],de=z&&Z&&b.boards[Z]?te.x-b.boards[Z].x:0,ze=z&&Z&&b.boards[Z]?te.y-b.boards[Z].y:0,Je=z&&C.length&&E.every(([qe])=>v.includes(qe))?gn(b,de,ze,[],C):b;return{...Je,boards:{...Je.boards,...Object.fromEntries(E.map(([qe,pt])=>[qe,{...Je.boards[qe],...pt,autoPlaced:void 0}]))}}},g?Object.values(d).some(b=>b.w!=null)?u.history.resizeBoard:u.history.moveBoard:void 0),onMoveNote:(d,g,b)=>Yt(E=>{const z=E.notes[d],Z=g.x!=null?g.x-z.x:0,te=g.y!=null?g.y-z.y:0,ze=(Z||te)&&!("text"in g)&&C.includes(d)?gn(E,Z,te,v,C.filter(Je=>Je!==d)):E;return{...ze,notes:{...ze.notes,[d]:{...z,...g}}}},b?"text"in g?u.history.editNote:u.history.moveNote:void 0),onDeleteNote:d=>Bi([d]),onPlay:d=>Ne===d?Ui():mt(d),playing:Ne,typing:J,onPickElement:(d,g,b)=>{const E=$e.current.get(d),z=E==null?void 0:E.contentDocument;if(E&&(!(z!=null&&z.body)||z.readyState==="loading")){const Z={clientX:g.clientX,clientY:g.clientY};return E.addEventListener("load",()=>fs.current(d,Z,b),{once:!0})}Dc(d,g,b)},onHoverElement:(d,g)=>{const b=d&&g?Lf($e.current.get(d),g.clientX,g.clientY):null;I(E=>!b||!d?null:(E==null?void 0:E.file)===d&&E.path===b.path?E:{file:d,path:b.path,rect:wl(b.el)})},onElementMarquee:(d,g,b)=>{const E=$e.current.get(d),z=E==null?void 0:E.contentDocument;if(!E||!z||!g)return se(null);const Z=E.getBoundingClientRect(),te=Z.width/(E.offsetWidth||Z.width)||1,de={x:(g.x-Z.left)/te,y:(g.y-Z.top)/te,w:g.w/te,h:g.h/te};if(!b)return se({file:d,rect:de});se(null);const ze=k===d?Te.state.paths:[],Je=A0(z,de);ol(d,[...ze,...Je.filter(qe=>!ze.includes(qe))])},onElementContext:(d,g)=>{const b=Lf($e.current.get(d),g.clientX,g.clientY);return b?(k===d&&Te.state.paths.includes(b.path)||ol(d,[b.path]),window.setTimeout(()=>{var E;return(E=Oi.current)==null?void 0:E.call(Oi,b.path,g)},0),!0):!1},onRename:d=>void il(d),onCreateBoard:d=>void ll(d),onCreateNote:Cl,onContext:ju,onSize:be,renderBoardOverlay:Yc,renderBoardTags:d=>{var E;const g=dt.tagsOf(d);if(!g.length&&!((E=tl[d])!=null&&E.length))return null;const b=JSON.stringify([tl[d],Ua,g.map(z=>[z.key,z.by,z.person,z.outside,z.count,z.newBoard,u.activity.ago(dt.now-z.at),dt.stateOf(z)])]);return Zn(`tags:${d}`,b,()=>{var z;return o.jsx(i0,{file:d,act:dt,me:Ua,onOpen:qi,lead:(z=tl[d])!=null&&z.length?o.jsx(Lx,{list:tl[d]}):null})})},renderBoardButtons:(d,g)=>{const b=iu(r,d);if(!b)return null;const E=Yx(tl,b),z=(qn==null?void 0:qn.file)===d;return Zn(`use:${d}`,JSON.stringify([b,E,g,z]),()=>o.jsx(Vx,{file:d,group:b,busy:E,compact:g,open:z,onOpen:()=>nl(Z=>(Z==null?void 0:Z.file)===d?null:{file:d,busy:!1})}))},boardRing:d=>Vy(tl,d).length?"var(--line-strong)":null,underLayer:yu,worldLayer:d=>o.jsx(o.Fragment,{children:o.jsx(w0,{shapes:Ca,ids:ps,zoom:d,selected:rn,interactive:S==="select",onSelect:(g,b)=>{Ln(E=>b?E.includes(g)?E.filter(z=>z!==g):[...E,g]:E.includes(g)?E:[g]),b||(x([]),O([]))},onChange:(g,b,E)=>Yt(z=>{var qe;const Z=(qe=z.shapes)==null?void 0:qe[g];if(!Z)return z;const te=b.x!=null?b.x-Z.x:0,de=b.y!=null?b.y-Z.y:0,Je=(te||de)&&b.w==null&&rn.includes(g)?gn(z,te,de,v,C,rn.filter(pt=>pt!==g)):z;return{...Je,shapes:{...Je.shapes??{},[g]:{...Z,...b}}}},E?b.w!=null?u.history.resizeShape:u.history.moveShape:void 0),onContext:(g,b)=>rt({x:b.clientX,y:b.clientY,title:u.menu.shape,items:[{label:u.menu.front,icon:"front",shortcut:`${kt}]`,run:()=>ys(g,"front")},{label:u.menu.back,icon:"back",shortcut:`${kt}[`,run:()=>ys(g,"back")},"sep",{label:u.menu.delete,icon:"trash",shortcut:"⌫",danger:!0,run:()=>Hi([g])}]})})}),iframeRef:(d,g)=>{g&&$e.current.get(d)!==g&&($e.current.set(d,g),(d===k||d===Ne||d===Nn||d===Ze||Be.some(E=>E.file===d&&!E.resolved)||dt.tagsOf(d).some(E=>E.paths.length))&&Pt(E=>E+1))}}),b1.includes(S)&&o.jsx(T1,{store:h,tool:S,onDone:d=>Kl(d)}),en.length===0&&ms.length===0&&ps.length===0&&o.jsxs("div",{className:"canvas-empty",children:[o.jsx(ne,{name:"board",size:32}),o.jsx("p",{children:u.app.emptyPage}),o.jsxs("button",{className:"primary",onClick:()=>T("board"),children:[u.app.drawBoard," ",o.jsx("kbd",{children:"B"})]})]})]}),!Pl&&(wo&&ti&&!So?o.jsx(Ex,{win:D,bottom:oe?64:68,selection:ti,inline:(()=>{var b;const d=(b=$e.current.get(k))==null?void 0:b.contentDocument,g=d?Hn(d,ti.path):null;return g?Vp(g):{}})(),tokens:Qt,vars:$c,onStyle:fo,onAskAi:()=>ca(),onComment:()=>{Qe("inspect"),Fl(!0),setTimeout(()=>{var d;return(d=P.current)==null?void 0:d.focus()},0)}}):jo&&o.jsx(j1,{win:D,first:fe&&en.length>0})),!oe&&o.jsxs("nav",{className:`oc-card oc-nav ${ge&&Vi.length?"":"is-collapsed"}`,"aria-label":u.app.navigation,children:[ge&&Vi.length>0&&o.jsx(py,{store:h,className:"oc-map",w:240,h:112,inset:8,rects:Vi,selected:v,size:dn,onJump:ga}),o.jsx(If,{store:h,onZoom:pa,onZoom100:()=>Vl(1),onFit:al})]}),oe&&He&&Vi.length>0&&!Pl&&o.jsx("nav",{className:"oc-card oc-nav oc-nav-n","aria-label":u.app.navigation,children:o.jsx(py,{store:h,className:"oc-map",w:240,h:112,inset:8,rects:Vi,selected:v,size:dn,onJump:ga})}),o.jsxs("aside",{className:`oc-card oc-right ${Ga?"is-rest":""} ${Pl?"oc-sheet":""}`,"aria-label":u.app.inspectorAside,style:Pl?{top:qc,height:D.h-qc-8}:void 0,children:[o.jsxs("div",{className:"oc-rhead",ref:Ai,children:[o.jsx(p1,{pages:$t,currentPage:mn,selected:v}),o.jsxs("button",{className:`ask-ai ${De==="chat"&&!Ga?"on":""}`,"aria-label":u.toolbar.aiChat,"aria-pressed":De==="chat"&&!Ga,title:u.toolbar.aiChatTitle(kt),onClick:()=>De==="chat"&&!Ga?Qe("inspect"):ca(),children:[o.jsx(ne,{name:"comment",size:16})," ",o.jsx("span",{className:"ask-ai-label",children:u.toolbar.askAi})]}),o.jsx("button",{className:`icon-btn ${(zl=ve==null?void 0:ve.className)!=null&&zl.startsWith("view")?"on":""}`,"aria-label":u.toolbar.viewMenu,"aria-haspopup":"menu","aria-expanded":!!((Es=ve==null?void 0:ve.className)!=null&&Es.startsWith("view")),title:oe?u.toolbar.viewMenuTitleNarrow:u.toolbar.viewMenuTitle,onClick:d=>{const g=d.currentTarget.getBoundingClientRect();Bc({clientX:g.right,clientY:g.bottom+8})},children:o.jsx(ne,{name:"more"})})]}),!Ga&&o.jsxs("div",{className:"oc-tabs",role:"tablist","aria-label":u.tabs.right,ref:ro,children:[o.jsx("button",{role:"tab","aria-selected":De==="inspect",className:De==="inspect"?"on":"",onClick:()=>Qe("inspect"),children:u.tabs.properties}),o.jsxs("button",{role:"tab","aria-selected":De==="chat",className:De==="chat"?"on":"",onClick:()=>ca(),children:[u.tabs.ai," ",o.jsxs("kbd",{children:[kt,"J"]})]}),oe&&o.jsx("button",{className:"icon-btn oc-close","aria-label":u.tabs.closePanel,title:`${u.tabs.closePanel} (${kt}\\)`,onClick:()=>Fl(!1),children:o.jsx(ne,{name:"close",size:16})})]}),o.jsx("div",{className:"chat-wrap",hidden:Ga||De!=="chat",children:o.jsx(gx,{selection:k&&((To=Te.state.selection)==null?void 0:To.file)===k?Te.state.selection:null,boards:k?[k]:v,visibleCount:Nu,titleOf:d=>{var g;return((g=r.boards[d])==null?void 0:g.title)??d},sizeOf:d=>r.boards[d]?{w:r.boards[d].w,h:r.boards[d].h}:null,storeKey:(a==null?void 0:a.dir)??null,confirm:Mt.confirm,attach:Rt,setAttach:Wt,draft:Dt,setDraft:Ht,subscribe:St,onLocate:ue,inputRef:Vt,open:De==="chat"&&!Ga})}),De==="inspect"&&!Ga&&o.jsxs(Dx,{author:Ja||u.app.defaultAuthor,onAuthor:async()=>{const d=await Mt.prompt({title:u.dialog.authorTitle,label:u.dialog.name,value:Ja,ok:u.dialog.save});if(d!=null&&d.value.trim()){Ia(d.value.trim());try{localStorage.setItem("design-canvas:author",d.value.trim())}catch{}}},onAskAI:d=>{Wt(g=>({...g,comments:g.comments.some(b=>b.id===d.id)?g.comments:[...g.comments,{id:d.id,text:d.text,file:d.file}]})),ca(Dt||u.prompts.fixComment,[d.file])},file:k??Ze,selection:Te.state.selection,crumbs:(()=>{var Z,te;const d=Te.state.selection,g=k?(Z=$e.current.get(k))==null?void 0:Z.contentDocument:null;if(!k||!d||d.file!==k||!g)return null;const b=de=>{if(!de)return"";const{kind:ze,label:Je}=zy(de);if(ze!=="container")return Je?`${u.inspector.kindName(ze)} "${Je.slice(0,24)}"`:u.inspector.kindName(ze);const qe=de.classList[0];return`${u.inspector.kindName(ze)}${de.id?` #${de.id}`:qe?` .${qe}`:""}`},{paths:E,skipped:z}=f0(d.path);return o.jsx(kx,{board:((te=r.boards[k])==null?void 0:te.title)??k,parents:E.map(de=>({path:de,name:b(Hn(g,de))})),skipped:z,current:b(Hn(g,d.path)),title:u.inspector.crumbElement(d.tag,d.path),onBoard:()=>$(null),onPath:de=>void Te.select([de])})})(),commentRef:P,multi:Te.state.paths.length,error:Te.state.error,comments:Be,onSelectPath:d=>{const g=k??Ze;g&&ol(g,[d])},onDuplicate:va?()=>void Jt({op:"duplicate",path:va.path,hash:va.hash}):void 0,onDelete:va?async()=>{await Jt({op:"delete",path:va.path,hash:va.hash})&&Te.select([])}:void 0,footer:!k&&Ze&&r.boards[Ze]?o.jsx(e1,{onFocus:()=>xt(Ze),onDuplicate:()=>void Di(Ze),onFront:()=>ya([Ze],"front"),onBack:()=>ya([Ze],"back"),onDelete:()=>void oa([Ze])}):void 0,children:[!k&&Zt&&Ca[Zt]&&o.jsx(j0,{shape:Ca[Zt],onPatch:d=>_i(Zt,d,u.history.shapeStyle),onDelete:()=>Hi([Zt]),onFront:()=>ys(Zt,"front"),onBack:()=>ys(Zt,"back")}),!k&&X&&r.notes[X]&&o.jsx(N0,{note:r.notes[X],onPatch:d=>Yt(g=>{const b={...g.notes[X],...d};for(const E of Object.keys(b))b[E]===void 0&&delete b[E];return{...g,notes:{...g.notes,[X]:b}}},u.history.noteStyle),onDelete:()=>Bi([X])}),!k&&Ze&&r.boards[Ze]&&o.jsx(Px,{file:Ze,item:r.boards[Ze],pages:$t,isLaunch:((rl=r.launch)==null?void 0:rl.view)==="focused"&&r.launch.file===Ze,onPatch:d=>Ec(Ze,d),onRename:()=>void il(Ze),onRenameFile:()=>void La(Ze),onLaunch:d=>Yt(g=>({...g,launch:d?{view:"focused",file:Ze}:{view:"canvas"}}),u.history.launchScreen)}),!k&&Ns,!k&&Ze&&r.boards[Ze]&&o.jsx(ao,{id:"guides",title:u.sections.guides,count:(((Eo=r.guides)==null?void 0:Eo[Ze])??[]).length,children:o.jsx(C0,{guides:((ko=r.guides)==null?void 0:ko[Ze])??[],onChange:(d,g)=>Yt(b=>({...b,guides:{...b.guides??{},[Ze]:d}}),g)})}),!k&&Ze&&r.boards[Ze]&&bc((Co=$e.current.get(Ze))==null?void 0:Co.contentDocument)&&o.jsx(ao,{id:"tweaks",title:u.sections.tweaks,children:o.jsx(Nx,{doc:bc((Vc=$e.current.get(Ze))==null?void 0:Vc.contentDocument)?$e.current.get(Ze).contentDocument:null,onSave:async d=>{try{await Ce.post("/api/edit",{file:Ze,op:"setTweaks",values:d}),he({tone:"ok",text:u.toast.tweaksSaved,action:ft})}catch(g){he({tone:"error",text:String(g.message)})}}},`${Ze}-${Le[Ze]??0}-${Ge}`)}),!k&&rn.length>1&&o.jsxs("section",{className:"pp-group",children:[o.jsx("h3",{className:"pp-group-h",children:u.shapes.selectedN(rn.length)}),o.jsx("div",{className:"btn-row",children:o.jsx("button",{className:"icon-btn danger","aria-label":u.shapes.deleteAll,title:u.shapes.deleteAll,onClick:()=>Hi(rn),children:o.jsx(ne,{name:"trash"})})})]}),!k&&C.length>1&&o.jsxs("section",{className:"pp-group",children:[o.jsx("h3",{className:"pp-group-h",children:u.notes.selectedN(C.length)}),o.jsx("div",{className:"btn-row",children:o.jsx("button",{className:"icon-btn danger","aria-label":u.notes.deleteAll,title:u.notes.deleteAll,onClick:()=>Bi(C),children:o.jsx(ne,{name:"trash"})})})]}),!k&&v.length>1&&o.jsxs("section",{className:"pp-group",children:[o.jsx("h3",{className:"pp-group-h",children:u.boardOptions.selectedN(v.length)}),o.jsxs("div",{className:"btn-row",children:[o.jsx("button",{className:"icon-btn","aria-label":u.boardOptions.front,title:u.boardOptions.frontTitleMod(kt),onClick:()=>ya(v,"front"),children:o.jsx(ne,{name:"front"})}),o.jsx("button",{className:"icon-btn","aria-label":u.boardOptions.back,title:u.boardOptions.backTitleMod(kt),onClick:()=>ya(v,"back"),children:o.jsx(ne,{name:"back"})}),o.jsx("button",{className:"icon-btn","aria-label":u.boardOptions.goToSelected,title:u.boardOptions.goToSelectedTitle,onClick:()=>sa(v),children:o.jsx(ne,{name:"fit"})}),o.jsx("button",{className:"icon-btn danger","aria-label":u.boardOptions.delete,title:u.boardOptions.deleteTitleKey,onClick:()=>void oa(v),children:o.jsx(ne,{name:"trash"})})]})]}),k&&Te.state.selection&&Te.state.selection.file===k&&(()=>{var z;const d=Te.state.selection,g=(z=$e.current.get(k))!=null&&z.contentDocument?Hn($e.current.get(k).contentDocument,d.path):null,b={};if(g)for(const Z of Array.from(g.attributes))b[Z.name]=Z.value;const E=Te.state.paths;return o.jsx(h1,{tokens:Qt,bg:(()=>{let Z=g;const te=g==null?void 0:g.ownerDocument.defaultView;for(;Z&&te;Z=Z.parentElement){const de=te.getComputedStyle(Z).backgroundColor;if(de&&!/rgba\(0, 0, 0, 0\)|transparent/.test(de))return de}return"rgb(255, 255, 255)"})(),onAlign:async Z=>{var ze;const te=(ze=$e.current.get(k))==null?void 0:ze.contentDocument,de=te&&Ox(te,d.path,d.hash,Z);if(!de)return he({text:u.toast.blockFlow});await Jt({op:"batch",ops:de})},onReplaceImage:d.tag==="img"||/url\(/.test(d.styles["background-image"]??"")?()=>hs(d.path,d.tag==="img"):null,selection:d,inline:g?Vp(g):{},attrs:b,canWrap:E.length>=2,vars:$c,onStyle:fo,onAttr:(Z,te)=>void Jt({op:"setAttr",path:d.path,hash:d.hash,name:Z,value:te}),onWrap:async Z=>{const te=[...E].sort((ze,Je)=>Number(ze.split("/").pop())-Number(Je.split("/").pop())),de=await Promise.all(te.map(ze=>ia(k,ze)));await Jt({op:"wrap",paths:te,hashes:de,display:Z})&&Te.select([te[0]])},children:Ns})})(),(k??(rn.length||C.length?null:Ze))&&(()=>{const d=k??Ze;return o.jsx(Fx,{file:d,version:Le[d]??0,selected:k?Te.state.paths:[],onSelect:(g,b)=>{const E=k?Te.state.paths:[];ol(d,b?E.includes(g)?E.filter(z=>z!==g):[...E,g]:[g])},onMove:async(g,b,E)=>{const z=await ia(d,g);await Jt({op:"move",path:g,hash:z,toParentPath:b,index:E},d)&&ol(d,[b?`${b}/${E}`:String(E)])}})})()]})]}),!Pl&&o.jsx(N1,{tool:S,setTool:T,phone:_,foldShapes:D.w<=900,win:D,hist:Ea,histOpen:zi,caretRef:jc,onNewBoard:d=>gs(Li(d)),onToolsMenu:d=>Gi(Li(d)),onShapesMenu:d=>Cu(Li(d)),onInsertImage:()=>Ha(()=>d=>{Ha(null),vs(d)}),onUndo:()=>void wn("undo"),onRedo:()=>void wn("redo"),onHistory:()=>zi?xo():Ss()}),re&&o.jsx(l1,{board:r,file:re,onClose:()=>Se(null),onLocate:d=>{x([d]),sa([d])}}),ke&&r.boards[ke]&&o.jsx(n1,{board:r,file:ke,onClose:()=>{x([ke]),xt(null)},onNav:xt}),o.jsx(Z0,{open:!!_a,version:Fa,onClose:()=>Ha(null),onPick:d=>_a==null?void 0:_a(d),onError:d=>he({tone:"error",text:d})}),o.jsx("div",{className:"sr-only",role:"status","aria-live":"polite",children:xe}),o.jsx(sx,{menu:ve,onClose:()=>rt(null),head:(Xc=ve==null?void 0:ve.className)!=null&&Xc.startsWith("view")&&oe?o.jsx(If,{store:h,onZoom:pa,onZoom100:()=>Vl(1),onFit:al,menu:!0}):void 0}),zt&&!re&&(()=>{const d=Yi(zt.file,zt.key);return d?o.jsx(o0,{file:zt.file,tag:d,me:Ua,now:dt.now,conflict:zt.conflict,busy:zt.busy,onCompare:()=>un({file:zt.file,step:d.steps[d.steps.length-1],added:d.newBoard}),onUndo:g=>void ws(zt.file,d,g),onCancelConflict:()=>la(g=>g&&{...g,conflict:null}),onClose:()=>la(null)}):null})(),qn&&!re&&(()=>{const d=iu(r,qn.file);return d?o.jsx(Xx,{file:qn.file,group:d,board:r,busy:qn.busy,onApply:()=>void Jl(qn.file),onKeepAll:()=>void Mu(qn.file),onClose:()=>nl(null)}):null})(),Yn&&r.boards[Yn.file]&&o.jsx($y,{before:F0(Yn.step),notBefore:u.compare.notBeforeChange,boards:[{file:Yn.file,kind:Yn.added?"added":"changed",title:r.boards[Yn.file].title??Yn.file,w:r.boards[Yn.file].w,h:r.boards[Yn.file].h}],onClose:()=>un(null)}),zi&&o.jsx(r0,{steps:((Kc=dt.data)==null?void 0:Kc.steps)??[],me:Ua,now:dt.now,anchor:((Mo=jc.current)==null?void 0:Mo.getBoundingClientRect())??null,busy:Sc,onGo:d=>void Gc(d),onClose:xo}),o.jsx(ox,{state:Mt.state,onClose:Mt.close})]})}function w1(a,i,r){const f=a.split("/").map(Number),h=i===""?[]:i.split("/").map(Number),p=f.length-1;return h.length>p&&h.slice(0,p).every((y,N)=>y===f[N])&&h[p]>f[p]&&h[p]--,[...h,r].join("/")}function Jf({r:a,cls:i,px:r=1}){return o.jsx("div",{className:`box ${i}`,style:{left:a.x,top:a.y,width:a.w,height:a.h,"--px":`${r}px`}})}function Ny(){const a=document.querySelector(".canvas");a&&(a.tabIndex=-1,a.focus({preventScroll:!0}))}function S1(a){return o.jsxs("div",{className:a.menu?"menu-zoom":"oc-zoom",children:[o.jsx("button",{className:"icon-btn oc-ib","aria-label":u.toolbar.zoomOut,title:u.toolbar.zoomOutTitle(kt),onClick:()=>a.onZoom(1/2),children:o.jsx(ne,{name:"minus"})}),o.jsxs("button",{className:"zoom","aria-label":u.toolbar.zoom100,title:u.toolbar.zoom100Title(kt),onClick:a.onZoom100,children:[Math.round(a.zoom*100),"%"]}),o.jsx("button",{className:"icon-btn oc-ib","aria-label":u.toolbar.zoomIn,title:u.toolbar.zoomInTitle(kt),onClick:()=>a.onZoom(2),children:o.jsx(ne,{name:"plus"})}),a.menu?o.jsxs("button",{className:"btn",title:u.toolbar.fitAllTitle,onClick:a.onFit,children:[o.jsx(ne,{name:"fit",size:16})," ",u.toolbar.fitAll]}):o.jsx("button",{className:"icon-btn oc-ib oc-fit","aria-label":u.toolbar.fitAll,title:u.toolbar.fitAllTitle,onClick:a.onFit,children:o.jsx(ne,{name:"fit"})})]})}function j1({win:a,first:i}){const r=w.useRef(null),[f,h]=w.useState(!1),[p,y]=w.useState(0);w.useLayoutEffect(()=>h(!1),[a.w,i]),w.useLayoutEffect(()=>{var X;const C=r.current;if(!i||!C)return;const O=((X=document.querySelector(".oc-dock"))==null?void 0:X.offsetWidth)??0;O!==p&&y(O),!f&&C.scrollWidth>a.w-16&&h(!0)});const N=Uy(r,a.w),S={left:N??void 0,visibility:N==null?"hidden":void 0};if(!i)return o.jsx("div",{ref:r,className:"canvas-hint","aria-hidden":"true",style:S,children:u.canvas.hint});const T=`${kt}J`,[v,x]=u.app.firstRunAi(kt).split(T);return o.jsxs("div",{ref:r,className:`canvas-hint oc-first ${f?"is-stacked":""}`,role:"status",style:{...S,minWidth:f?void 0:p||void 0},children:[o.jsxs("span",{className:"oc-fr",children:[o.jsx(ne,{name:"select",size:16}),o.jsx("span",{children:u.app.firstRunEdit})]}),o.jsx("span",{className:"oc-fr-sep","aria-hidden":"true"}),o.jsxs("span",{className:"oc-fr",children:[o.jsx(ne,{name:"comment",size:16}),o.jsxs("span",{children:[v,o.jsx("kbd",{children:T}),x]})]})]})}function N1(a){const i=w.useRef(null),r=Uy(i,a.win.w),f=(y,N)=>o.jsx("button",{role:"radio","aria-checked":a.tool===y.id,"aria-label":u.toolbar.tool(y.label,y.key),title:N,className:`icon-btn tool ${a.tool===y.id?"on":""}`,onClick:()=>a.setTool(y.id),children:o.jsx(ne,{name:y.icon})},y.id),h=Ci.slice(0,5).find(y=>y.id===a.tool),p=Ci.slice(5).find(y=>y.id===a.tool);return o.jsxs("div",{ref:i,className:"oc-dock",role:"toolbar","aria-label":u.toolbar.aria,style:{left:r??void 0,visibility:r==null?"hidden":void 0},children:[o.jsxs("button",{className:"new-board","aria-haspopup":"menu","aria-label":a.phone?u.toolbar.newBoard:void 0,title:u.toolbar.newBoardTitle,onClick:a.onNewBoard,children:[o.jsx(ne,{name:"plus"}),!a.phone&&o.jsx("span",{children:u.toolbar.newBoard}),o.jsx(ne,{name:"chevronDown",size:16,className:"s"})]}),o.jsx("span",{className:"oc-sep","aria-hidden":"true"}),a.phone?o.jsxs("button",{className:`icon-btn tool oc-fold ${h?"on":""}`,"aria-label":u.toolbar.canvasTools,"aria-haspopup":"menu",title:u.toolbar.canvasTools,onClick:a.onToolsMenu,children:[o.jsx(ne,{name:(h==null?void 0:h.icon)??"select"}),o.jsx(ne,{name:"chevronDown",size:16,className:"s"})]}):o.jsxs("div",{className:"oc-group",role:"radiogroup","aria-label":u.toolbar.canvasTools,children:[Ci.slice(0,2).map(y=>f(y,u.toolbar.tool(y.hint,y.key))),o.jsx("span",{className:"oc-sep","aria-hidden":"true"}),Ci.slice(2,5).map(y=>f(y,u.toolbar.tool(y.hint,y.key)))]}),o.jsx("span",{className:"oc-sep","aria-hidden":"true"}),a.foldShapes?o.jsxs("button",{className:`icon-btn tool oc-fold ${p?"on":""}`,"aria-label":u.toolbar.shapes,"aria-haspopup":"menu",title:u.toolbar.shapes,onClick:a.onShapesMenu,children:[o.jsx(ne,{name:(p==null?void 0:p.icon)??"rect"}),o.jsx(ne,{name:"chevronDown",size:16,className:"s"})]}):o.jsxs("div",{className:"oc-group",role:"radiogroup","aria-label":u.toolbar.shapes,children:[Ci.slice(5).map(y=>f(y,u.toolbar.shapeToolTitle(y.hint,y.key))),o.jsx("button",{className:"icon-btn","aria-label":u.toolbar.insertImage,title:u.toolbar.insertImageTitle,onClick:a.onInsertImage,children:o.jsx(ne,{name:"image"})})]}),o.jsx("span",{className:"oc-sep","aria-hidden":"true"}),o.jsxs("div",{className:"oc-group undo-split",children:[o.jsx("button",{className:"icon-btn","aria-label":u.toolbar.undo,title:u.toolbar.undoTitle(a.hist.undo.length?a.hist.undo[a.hist.undo.length-1]:void 0,kt),disabled:!a.hist.canUndo,onClick:a.onUndo,children:o.jsx(ne,{name:"undo"})}),o.jsx("button",{ref:a.caretRef,className:`icon-btn caret-btn ${a.histOpen?"on":""}`,"aria-label":u.activity.historyButton,"aria-haspopup":"menu","aria-expanded":a.histOpen,title:u.activity.historyButton,onClick:a.onHistory,children:o.jsx(ne,{name:"chevronDown",size:16})}),o.jsx("button",{className:"icon-btn","aria-label":u.toolbar.redo,title:u.toolbar.redoTitle(a.hist.redo.length?a.hist.redo[a.hist.redo.length-1]:void 0,kt),disabled:!a.hist.canRedo,onClick:a.onRedo,children:o.jsx(ne,{name:"redo"})})]})]})}function If({store:a,...i}){return o.jsx(S1,{...i,zoom:nh(a,r=>r.zoom)})}function T1({store:a,...i}){return o.jsx(S0,{...i,view:dh(a)})}function E1(){const a=w.useRef(new Map);return w.useCallback((i,r,f)=>{const h=a.current.get(i);if(h&&h.sig===r)return h.node;const p=f();return a.current.set(i,{sig:r,node:p}),p},[])}function k1(a,i){if(!a)return i;if(JSON.stringify(a)===JSON.stringify(i))return a;const r=(f,h)=>{if(!f||!h)return h;const p={};for(const[y,N]of Object.entries(h))p[y]=f[y]!==void 0&&JSON.stringify(f[y])===JSON.stringify(N)?f[y]:N;return p};return{...i,boards:r(a.boards,i.boards),notes:r(a.notes,i.notes),shapes:r(a.shapes,i.shapes)}}class C1 extends w.Component{constructor(){super(...arguments);Dp(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}render(){return this.state.error?o.jsxs("div",{className:"loading",role:"alert",children:[o.jsx(ne,{name:"warn"})," ",u.app.crashed," ",this.state.error.message,o.jsx("button",{onClick:()=>location.reload(),children:u.app.reload})]}):this.props.children}}document.documentElement.lang=uu;Gb.createRoot(document.getElementById("root")).render(o.jsx(C1,{children:o.jsx(ix,{children:o.jsx(x1,{})})}));