@venturewild/workspace 0.5.1 → 0.5.3

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.
@@ -30,14 +30,14 @@
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var C0=w,Bn=k0;function G(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var mv=new Set,Xo={};function ls(e,t){Us(e,t),Us(e+"Capture",t)}function Us(e,t){for(Xo[e]=t,e=0;e<t.length;e++)mv.add(t[e])}var Wr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sh=Object.prototype.hasOwnProperty,E0=/^[: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]*$/,cm={},um={};function N0(e){return Sh.call(um,e)?!0:Sh.call(cm,e)?!1:E0.test(e)?um[e]=!0:(cm[e]=!0,!1)}function j0(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function R0(e,t,n,r){if(t===null||typeof t>"u"||j0(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function bn(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var rn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){rn[e]=new bn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];rn[t]=new bn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){rn[e]=new bn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){rn[e]=new bn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){rn[e]=new bn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){rn[e]=new bn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){rn[e]=new bn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){rn[e]=new bn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){rn[e]=new bn(e,5,!1,e.toLowerCase(),null,!1,!1)});var wf=/[\-:]([a-z])/g;function Sf(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(wf,Sf);rn[t]=new bn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(wf,Sf);rn[t]=new bn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(wf,Sf);rn[t]=new bn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){rn[e]=new bn(e,1,!1,e.toLowerCase(),null,!1,!1)});rn.xlinkHref=new bn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){rn[e]=new bn(e,1,!1,e.toLowerCase(),null,!0,!0)});function xf(e,t,n,r){var i=rn.hasOwnProperty(t)?rn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(R0(t,n,i,r)&&(n=null),r||i===null?N0(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Kr=C0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Aa=Symbol.for("react.element"),ws=Symbol.for("react.portal"),Ss=Symbol.for("react.fragment"),kf=Symbol.for("react.strict_mode"),xh=Symbol.for("react.profiler"),gv=Symbol.for("react.provider"),yv=Symbol.for("react.context"),Cf=Symbol.for("react.forward_ref"),kh=Symbol.for("react.suspense"),Ch=Symbol.for("react.suspense_list"),Ef=Symbol.for("react.memo"),oi=Symbol.for("react.lazy"),_v=Symbol.for("react.offscreen"),hm=Symbol.iterator;function ao(e){return e===null||typeof e!="object"?null:(e=hm&&e[hm]||e["@@iterator"],typeof e=="function"?e:null)}var wt=Object.assign,lu;function Eo(e){if(lu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);lu=t&&t[1]||""}return`
33
+ */var C0=w,Bn=k0;function X(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var mv=new Set,Xo={};function ls(e,t){Us(e,t),Us(e+"Capture",t)}function Us(e,t){for(Xo[e]=t,e=0;e<t.length;e++)mv.add(t[e])}var Wr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sh=Object.prototype.hasOwnProperty,E0=/^[: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]*$/,cm={},um={};function N0(e){return Sh.call(um,e)?!0:Sh.call(cm,e)?!1:E0.test(e)?um[e]=!0:(cm[e]=!0,!1)}function j0(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function R0(e,t,n,r){if(t===null||typeof t>"u"||j0(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function bn(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var rn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){rn[e]=new bn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];rn[t]=new bn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){rn[e]=new bn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){rn[e]=new bn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){rn[e]=new bn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){rn[e]=new bn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){rn[e]=new bn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){rn[e]=new bn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){rn[e]=new bn(e,5,!1,e.toLowerCase(),null,!1,!1)});var wf=/[\-:]([a-z])/g;function Sf(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(wf,Sf);rn[t]=new bn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(wf,Sf);rn[t]=new bn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(wf,Sf);rn[t]=new bn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){rn[e]=new bn(e,1,!1,e.toLowerCase(),null,!1,!1)});rn.xlinkHref=new bn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){rn[e]=new bn(e,1,!1,e.toLowerCase(),null,!0,!0)});function xf(e,t,n,r){var i=rn.hasOwnProperty(t)?rn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(R0(t,n,i,r)&&(n=null),r||i===null?N0(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Kr=C0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Aa=Symbol.for("react.element"),ws=Symbol.for("react.portal"),Ss=Symbol.for("react.fragment"),kf=Symbol.for("react.strict_mode"),xh=Symbol.for("react.profiler"),gv=Symbol.for("react.provider"),yv=Symbol.for("react.context"),Cf=Symbol.for("react.forward_ref"),kh=Symbol.for("react.suspense"),Ch=Symbol.for("react.suspense_list"),Ef=Symbol.for("react.memo"),oi=Symbol.for("react.lazy"),_v=Symbol.for("react.offscreen"),hm=Symbol.iterator;function ao(e){return e===null||typeof e!="object"?null:(e=hm&&e[hm]||e["@@iterator"],typeof e=="function"?e:null)}var wt=Object.assign,lu;function Eo(e){if(lu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);lu=t&&t[1]||""}return`
34
34
  `+lu+e}var cu=!1;function uu(e,t){if(!e||cu)return"";cu=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
35
35
  `),s=r.stack.split(`
36
36
  `),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
37
- `+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{cu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Eo(e):""}function T0(e){switch(e.tag){case 5:return Eo(e.type);case 16:return Eo("Lazy");case 13:return Eo("Suspense");case 19:return Eo("SuspenseList");case 0:case 2:case 15:return e=uu(e.type,!1),e;case 11:return e=uu(e.type.render,!1),e;case 1:return e=uu(e.type,!0),e;default:return""}}function Eh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ss:return"Fragment";case ws:return"Portal";case xh:return"Profiler";case kf:return"StrictMode";case kh:return"Suspense";case Ch:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case yv:return(e.displayName||"Context")+".Consumer";case gv:return(e._context.displayName||"Context")+".Provider";case Cf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ef:return t=e.displayName||null,t!==null?t:Eh(e.type)||"Memo";case oi:t=e._payload,e=e._init;try{return Eh(e(t))}catch{}}return null}function D0(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Eh(t);case 8:return t===kf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function xi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function P0(e){var t=vv(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ia(e){e._valueTracker||(e._valueTracker=P0(e))}function bv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=vv(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fl(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 Nh(e,t){var n=t.checked;return wt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function dm(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=xi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function wv(e,t){t=t.checked,t!=null&&xf(e,"checked",t,!1)}function jh(e,t){wv(e,t);var n=xi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Rh(e,t.type,n):t.hasOwnProperty("defaultValue")&&Rh(e,t.type,xi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function fm(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Rh(e,t,n){(t!=="number"||Fl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var No=Array.isArray;function Is(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+xi(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Th(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(G(91));return wt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function pm(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(G(92));if(No(n)){if(1<n.length)throw Error(G(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:xi(n)}}function Sv(e,t){var n=xi(t.value),r=xi(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function mm(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function xv(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Dh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?xv(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ma,kv=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ma=Ma||document.createElement("div"),Ma.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ma.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Jo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Mo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},L0=["Webkit","ms","Moz","O"];Object.keys(Mo).forEach(function(e){L0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mo[t]=Mo[e]})});function Cv(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Mo.hasOwnProperty(e)&&Mo[e]?(""+t).trim():t+"px"}function Ev(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Cv(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var A0=wt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ph(e,t){if(t){if(A0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(G(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(G(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(G(61))}if(t.style!=null&&typeof t.style!="object")throw Error(G(62))}}function Lh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ah=null;function Nf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ih=null,Ms=null,Os=null;function gm(e){if(e=Sa(e)){if(typeof Ih!="function")throw Error(G(280));var t=e.stateNode;t&&(t=Tc(t),Ih(e.stateNode,e.type,t))}}function Nv(e){Ms?Os?Os.push(e):Os=[e]:Ms=e}function jv(){if(Ms){var e=Ms,t=Os;if(Os=Ms=null,gm(e),t)for(e=0;e<t.length;e++)gm(t[e])}}function Rv(e,t){return e(t)}function Tv(){}var hu=!1;function Dv(e,t,n){if(hu)return e(t,n);hu=!0;try{return Rv(e,t,n)}finally{hu=!1,(Ms!==null||Os!==null)&&(Tv(),jv())}}function Zo(e,t){var n=e.stateNode;if(n===null)return null;var r=Tc(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(G(231,t,typeof n));return n}var Mh=!1;if(Wr)try{var lo={};Object.defineProperty(lo,"passive",{get:function(){Mh=!0}}),window.addEventListener("test",lo,lo),window.removeEventListener("test",lo,lo)}catch{Mh=!1}function I0(e,t,n,r,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var Oo=!1,$l=null,Hl=!1,Oh=null,M0={onError:function(e){Oo=!0,$l=e}};function O0(e,t,n,r,i,s,o,a,l){Oo=!1,$l=null,I0.apply(M0,arguments)}function z0(e,t,n,r,i,s,o,a,l){if(O0.apply(this,arguments),Oo){if(Oo){var c=$l;Oo=!1,$l=null}else throw Error(G(198));Hl||(Hl=!0,Oh=c)}}function cs(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Pv(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 ym(e){if(cs(e)!==e)throw Error(G(188))}function B0(e){var t=e.alternate;if(!t){if(t=cs(e),t===null)throw Error(G(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return ym(i),e;if(s===r)return ym(i),t;s=s.sibling}throw Error(G(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(G(189))}}if(n.alternate!==r)throw Error(G(190))}if(n.tag!==3)throw Error(G(188));return n.stateNode.current===n?e:t}function Lv(e){return e=B0(e),e!==null?Av(e):null}function Av(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Av(e);if(t!==null)return t;e=e.sibling}return null}var Iv=Bn.unstable_scheduleCallback,_m=Bn.unstable_cancelCallback,F0=Bn.unstable_shouldYield,$0=Bn.unstable_requestPaint,Tt=Bn.unstable_now,H0=Bn.unstable_getCurrentPriorityLevel,jf=Bn.unstable_ImmediatePriority,Mv=Bn.unstable_UserBlockingPriority,Wl=Bn.unstable_NormalPriority,W0=Bn.unstable_LowPriority,Ov=Bn.unstable_IdlePriority,Ec=null,Nr=null;function U0(e){if(Nr&&typeof Nr.onCommitFiberRoot=="function")try{Nr.onCommitFiberRoot(Ec,e,void 0,(e.current.flags&128)===128)}catch{}}var hr=Math.clz32?Math.clz32:K0,V0=Math.log,q0=Math.LN2;function K0(e){return e>>>=0,e===0?32:31-(V0(e)/q0|0)|0}var Oa=64,za=4194304;function jo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ul(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=jo(a):(s&=o,s!==0&&(r=jo(s)))}else o=n&~i,o!==0?r=jo(o):s!==0&&(r=jo(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-hr(t),i=1<<n,r|=e[n],t&=~i;return r}function Y0(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function G0(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-hr(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=Y0(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function zh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function zv(){var e=Oa;return Oa<<=1,!(Oa&4194240)&&(Oa=64),e}function du(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ba(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-hr(t),e[t]=n}function X0(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-hr(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function Rf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-hr(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Ze=0;function Bv(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Fv,Tf,$v,Hv,Wv,Bh=!1,Ba=[],pi=null,mi=null,gi=null,Qo=new Map,ea=new Map,ci=[],J0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function vm(e,t){switch(e){case"focusin":case"focusout":pi=null;break;case"dragenter":case"dragleave":mi=null;break;case"mouseover":case"mouseout":gi=null;break;case"pointerover":case"pointerout":Qo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ea.delete(t.pointerId)}}function co(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Sa(t),t!==null&&Tf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Z0(e,t,n,r,i){switch(t){case"focusin":return pi=co(pi,e,t,n,r,i),!0;case"dragenter":return mi=co(mi,e,t,n,r,i),!0;case"mouseover":return gi=co(gi,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Qo.set(s,co(Qo.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,ea.set(s,co(ea.get(s)||null,e,t,n,r,i)),!0}return!1}function Uv(e){var t=Wi(e.target);if(t!==null){var n=cs(t);if(n!==null){if(t=n.tag,t===13){if(t=Pv(n),t!==null){e.blockedOn=t,Wv(e.priority,function(){$v(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 _l(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Fh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ah=r,n.target.dispatchEvent(r),Ah=null}else return t=Sa(n),t!==null&&Tf(t),e.blockedOn=n,!1;t.shift()}return!0}function bm(e,t,n){_l(e)&&n.delete(t)}function Q0(){Bh=!1,pi!==null&&_l(pi)&&(pi=null),mi!==null&&_l(mi)&&(mi=null),gi!==null&&_l(gi)&&(gi=null),Qo.forEach(bm),ea.forEach(bm)}function uo(e,t){e.blockedOn===t&&(e.blockedOn=null,Bh||(Bh=!0,Bn.unstable_scheduleCallback(Bn.unstable_NormalPriority,Q0)))}function ta(e){function t(i){return uo(i,e)}if(0<Ba.length){uo(Ba[0],e);for(var n=1;n<Ba.length;n++){var r=Ba[n];r.blockedOn===e&&(r.blockedOn=null)}}for(pi!==null&&uo(pi,e),mi!==null&&uo(mi,e),gi!==null&&uo(gi,e),Qo.forEach(t),ea.forEach(t),n=0;n<ci.length;n++)r=ci[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ci.length&&(n=ci[0],n.blockedOn===null);)Uv(n),n.blockedOn===null&&ci.shift()}var zs=Kr.ReactCurrentBatchConfig,Vl=!0;function e1(e,t,n,r){var i=Ze,s=zs.transition;zs.transition=null;try{Ze=1,Df(e,t,n,r)}finally{Ze=i,zs.transition=s}}function t1(e,t,n,r){var i=Ze,s=zs.transition;zs.transition=null;try{Ze=4,Df(e,t,n,r)}finally{Ze=i,zs.transition=s}}function Df(e,t,n,r){if(Vl){var i=Fh(e,t,n,r);if(i===null)Su(e,t,r,ql,n),vm(e,r);else if(Z0(i,e,t,n,r))r.stopPropagation();else if(vm(e,r),t&4&&-1<J0.indexOf(e)){for(;i!==null;){var s=Sa(i);if(s!==null&&Fv(s),s=Fh(e,t,n,r),s===null&&Su(e,t,r,ql,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Su(e,t,r,null,n)}}var ql=null;function Fh(e,t,n,r){if(ql=null,e=Nf(r),e=Wi(e),e!==null)if(t=cs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Pv(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ql=e,null}function Vv(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(H0()){case jf:return 1;case Mv:return 4;case Wl:case W0:return 16;case Ov:return 536870912;default:return 16}default:return 16}}var hi=null,Pf=null,vl=null;function qv(){if(vl)return vl;var e,t=Pf,n=t.length,r,i="value"in hi?hi.value:hi.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return vl=i.slice(e,1<r?1-r:void 0)}function bl(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 Fa(){return!0}function wm(){return!1}function $n(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Fa:wm,this.isPropagationStopped=wm,this}return wt(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=Fa)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Fa)},persist:function(){},isPersistent:Fa}),t}var eo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Lf=$n(eo),wa=wt({},eo,{view:0,detail:0}),n1=$n(wa),fu,pu,ho,Nc=wt({},wa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Af,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!==ho&&(ho&&e.type==="mousemove"?(fu=e.screenX-ho.screenX,pu=e.screenY-ho.screenY):pu=fu=0,ho=e),fu)},movementY:function(e){return"movementY"in e?e.movementY:pu}}),Sm=$n(Nc),r1=wt({},Nc,{dataTransfer:0}),i1=$n(r1),s1=wt({},wa,{relatedTarget:0}),mu=$n(s1),o1=wt({},eo,{animationName:0,elapsedTime:0,pseudoElement:0}),a1=$n(o1),l1=wt({},eo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),c1=$n(l1),u1=wt({},eo,{data:0}),xm=$n(u1),h1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},d1={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"},f1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function p1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=f1[e])?!!t[e]:!1}function Af(){return p1}var m1=wt({},wa,{key:function(e){if(e.key){var t=h1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=bl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?d1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Af,charCode:function(e){return e.type==="keypress"?bl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?bl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),g1=$n(m1),y1=wt({},Nc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),km=$n(y1),_1=wt({},wa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Af}),v1=$n(_1),b1=wt({},eo,{propertyName:0,elapsedTime:0,pseudoElement:0}),w1=$n(b1),S1=wt({},Nc,{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}),x1=$n(S1),k1=[9,13,27,32],If=Wr&&"CompositionEvent"in window,zo=null;Wr&&"documentMode"in document&&(zo=document.documentMode);var C1=Wr&&"TextEvent"in window&&!zo,Kv=Wr&&(!If||zo&&8<zo&&11>=zo),Cm=" ",Em=!1;function Yv(e,t){switch(e){case"keyup":return k1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xs=!1;function E1(e,t){switch(e){case"compositionend":return Gv(t);case"keypress":return t.which!==32?null:(Em=!0,Cm);case"textInput":return e=t.data,e===Cm&&Em?null:e;default:return null}}function N1(e,t){if(xs)return e==="compositionend"||!If&&Yv(e,t)?(e=qv(),vl=Pf=hi=null,xs=!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 Kv&&t.locale!=="ko"?null:t.data;default:return null}}var j1={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 Nm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!j1[e.type]:t==="textarea"}function Xv(e,t,n,r){Nv(r),t=Kl(t,"onChange"),0<t.length&&(n=new Lf("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Bo=null,na=null;function R1(e){ab(e,0)}function jc(e){var t=Es(e);if(bv(t))return e}function T1(e,t){if(e==="change")return t}var Jv=!1;if(Wr){var gu;if(Wr){var yu="oninput"in document;if(!yu){var jm=document.createElement("div");jm.setAttribute("oninput","return;"),yu=typeof jm.oninput=="function"}gu=yu}else gu=!1;Jv=gu&&(!document.documentMode||9<document.documentMode)}function Rm(){Bo&&(Bo.detachEvent("onpropertychange",Zv),na=Bo=null)}function Zv(e){if(e.propertyName==="value"&&jc(na)){var t=[];Xv(t,na,e,Nf(e)),Dv(R1,t)}}function D1(e,t,n){e==="focusin"?(Rm(),Bo=t,na=n,Bo.attachEvent("onpropertychange",Zv)):e==="focusout"&&Rm()}function P1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return jc(na)}function L1(e,t){if(e==="click")return jc(t)}function A1(e,t){if(e==="input"||e==="change")return jc(t)}function I1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mr=typeof Object.is=="function"?Object.is:I1;function ra(e,t){if(mr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Sh.call(t,i)||!mr(e[i],t[i]))return!1}return!0}function Tm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dm(e,t){var n=Tm(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Tm(n)}}function Qv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function eb(){for(var e=window,t=Fl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fl(e.document)}return t}function Mf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function M1(e){var t=eb(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Qv(n.ownerDocument.documentElement,n)){if(r!==null&&Mf(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Dm(n,s);var o=Dm(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var O1=Wr&&"documentMode"in document&&11>=document.documentMode,ks=null,$h=null,Fo=null,Hh=!1;function Pm(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hh||ks==null||ks!==Fl(r)||(r=ks,"selectionStart"in r&&Mf(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fo&&ra(Fo,r)||(Fo=r,r=Kl($h,"onSelect"),0<r.length&&(t=new Lf("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ks)))}function $a(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Cs={animationend:$a("Animation","AnimationEnd"),animationiteration:$a("Animation","AnimationIteration"),animationstart:$a("Animation","AnimationStart"),transitionend:$a("Transition","TransitionEnd")},_u={},tb={};Wr&&(tb=document.createElement("div").style,"AnimationEvent"in window||(delete Cs.animationend.animation,delete Cs.animationiteration.animation,delete Cs.animationstart.animation),"TransitionEvent"in window||delete Cs.transitionend.transition);function Rc(e){if(_u[e])return _u[e];if(!Cs[e])return e;var t=Cs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in tb)return _u[e]=t[n];return e}var nb=Rc("animationend"),rb=Rc("animationiteration"),ib=Rc("animationstart"),sb=Rc("transitionend"),ob=new Map,Lm="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ei(e,t){ob.set(e,t),ls(t,[e])}for(var vu=0;vu<Lm.length;vu++){var bu=Lm[vu],z1=bu.toLowerCase(),B1=bu[0].toUpperCase()+bu.slice(1);Ei(z1,"on"+B1)}Ei(nb,"onAnimationEnd");Ei(rb,"onAnimationIteration");Ei(ib,"onAnimationStart");Ei("dblclick","onDoubleClick");Ei("focusin","onFocus");Ei("focusout","onBlur");Ei(sb,"onTransitionEnd");Us("onMouseEnter",["mouseout","mouseover"]);Us("onMouseLeave",["mouseout","mouseover"]);Us("onPointerEnter",["pointerout","pointerover"]);Us("onPointerLeave",["pointerout","pointerover"]);ls("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ls("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ls("onBeforeInput",["compositionend","keypress","textInput","paste"]);ls("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ls("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ls("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ro="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(" "),F1=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ro));function Am(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,z0(r,t,void 0,e),e.currentTarget=null}function ab(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Am(i,a,c),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Am(i,a,c),s=l}}}if(Hl)throw e=Oh,Hl=!1,Oh=null,e}function ct(e,t){var n=t[Kh];n===void 0&&(n=t[Kh]=new Set);var r=e+"__bubble";n.has(r)||(lb(t,e,2,!1),n.add(r))}function wu(e,t,n){var r=0;t&&(r|=4),lb(n,e,r,t)}var Ha="_reactListening"+Math.random().toString(36).slice(2);function ia(e){if(!e[Ha]){e[Ha]=!0,mv.forEach(function(n){n!=="selectionchange"&&(F1.has(n)||wu(n,!1,e),wu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ha]||(t[Ha]=!0,wu("selectionchange",!1,t))}}function lb(e,t,n,r){switch(Vv(t)){case 1:var i=e1;break;case 4:i=t1;break;default:i=Df}n=i.bind(null,t,n,e),i=void 0,!Mh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Su(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Wi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}Dv(function(){var c=s,d=Nf(n),h=[];e:{var f=ob.get(e);if(f!==void 0){var p=Lf,m=e;switch(e){case"keypress":if(bl(n)===0)break e;case"keydown":case"keyup":p=g1;break;case"focusin":m="focus",p=mu;break;case"focusout":m="blur",p=mu;break;case"beforeblur":case"afterblur":p=mu;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":p=Sm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=i1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=v1;break;case nb:case rb:case ib:p=a1;break;case sb:p=w1;break;case"scroll":p=n1;break;case"wheel":p=x1;break;case"copy":case"cut":case"paste":p=c1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=km}var y=(t&4)!==0,b=!y&&e==="scroll",_=y?f!==null?f+"Capture":null:f;y=[];for(var v=c,g;v!==null;){g=v;var S=g.stateNode;if(g.tag===5&&S!==null&&(g=S,_!==null&&(S=Zo(v,_),S!=null&&y.push(sa(v,S,g)))),b)break;v=v.return}0<y.length&&(f=new p(f,m,null,n,d),h.push({event:f,listeners:y}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==Ah&&(m=n.relatedTarget||n.fromElement)&&(Wi(m)||m[Ur]))break e;if((p||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=c,m=m?Wi(m):null,m!==null&&(b=cs(m),m!==b||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(y=Sm,S="onMouseLeave",_="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(y=km,S="onPointerLeave",_="onPointerEnter",v="pointer"),b=p==null?f:Es(p),g=m==null?f:Es(m),f=new y(S,v+"leave",p,n,d),f.target=b,f.relatedTarget=g,S=null,Wi(d)===c&&(y=new y(_,v+"enter",m,n,d),y.target=g,y.relatedTarget=b,S=y),b=S,p&&m)t:{for(y=p,_=m,v=0,g=y;g;g=ds(g))v++;for(g=0,S=_;S;S=ds(S))g++;for(;0<v-g;)y=ds(y),v--;for(;0<g-v;)_=ds(_),g--;for(;v--;){if(y===_||_!==null&&y===_.alternate)break t;y=ds(y),_=ds(_)}y=null}else y=null;p!==null&&Im(h,f,p,y,!1),m!==null&&b!==null&&Im(h,b,m,y,!0)}}e:{if(f=c?Es(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var C=T1;else if(Nm(f))if(Jv)C=A1;else{C=P1;var x=D1}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(C=L1);if(C&&(C=C(e,c))){Xv(h,C,n,d);break e}x&&x(e,f,c),e==="focusout"&&(x=f._wrapperState)&&x.controlled&&f.type==="number"&&Rh(f,"number",f.value)}switch(x=c?Es(c):window,e){case"focusin":(Nm(x)||x.contentEditable==="true")&&(ks=x,$h=c,Fo=null);break;case"focusout":Fo=$h=ks=null;break;case"mousedown":Hh=!0;break;case"contextmenu":case"mouseup":case"dragend":Hh=!1,Pm(h,n,d);break;case"selectionchange":if(O1)break;case"keydown":case"keyup":Pm(h,n,d)}var T;if(If)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else xs?Yv(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(Kv&&n.locale!=="ko"&&(xs||P!=="onCompositionStart"?P==="onCompositionEnd"&&xs&&(T=qv()):(hi=d,Pf="value"in hi?hi.value:hi.textContent,xs=!0)),x=Kl(c,P),0<x.length&&(P=new xm(P,e,null,n,d),h.push({event:P,listeners:x}),T?P.data=T:(T=Gv(n),T!==null&&(P.data=T)))),(T=C1?E1(e,n):N1(e,n))&&(c=Kl(c,"onBeforeInput"),0<c.length&&(d=new xm("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:c}),d.data=T))}ab(h,t)})}function sa(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Kl(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Zo(e,n),s!=null&&r.unshift(sa(e,s,i)),s=Zo(e,t),s!=null&&r.push(sa(e,s,i))),e=e.return}return r}function ds(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Im(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=Zo(n,s),l!=null&&o.unshift(sa(n,l,a))):i||(l=Zo(n,s),l!=null&&o.push(sa(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var $1=/\r\n?/g,H1=/\u0000|\uFFFD/g;function Mm(e){return(typeof e=="string"?e:""+e).replace($1,`
38
- `).replace(H1,"")}function Wa(e,t,n){if(t=Mm(t),Mm(e)!==t&&n)throw Error(G(425))}function Yl(){}var Wh=null,Uh=null;function Vh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qh=typeof setTimeout=="function"?setTimeout:void 0,W1=typeof clearTimeout=="function"?clearTimeout:void 0,Om=typeof Promise=="function"?Promise:void 0,U1=typeof queueMicrotask=="function"?queueMicrotask:typeof Om<"u"?function(e){return Om.resolve(null).then(e).catch(V1)}:qh;function V1(e){setTimeout(function(){throw e})}function xu(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),ta(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ta(t)}function yi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function zm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var to=Math.random().toString(36).slice(2),Cr="__reactFiber$"+to,oa="__reactProps$"+to,Ur="__reactContainer$"+to,Kh="__reactEvents$"+to,q1="__reactListeners$"+to,K1="__reactHandles$"+to;function Wi(e){var t=e[Cr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ur]||n[Cr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=zm(e);e!==null;){if(n=e[Cr])return n;e=zm(e)}return t}e=n,n=e.parentNode}return null}function Sa(e){return e=e[Cr]||e[Ur],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Es(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(G(33))}function Tc(e){return e[oa]||null}var Yh=[],Ns=-1;function Ni(e){return{current:e}}function ht(e){0>Ns||(e.current=Yh[Ns],Yh[Ns]=null,Ns--)}function ot(e,t){Ns++,Yh[Ns]=e.current,e.current=t}var ki={},dn=Ni(ki),Nn=Ni(!1),Zi=ki;function Vs(e,t){var n=e.type.contextTypes;if(!n)return ki;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function jn(e){return e=e.childContextTypes,e!=null}function Gl(){ht(Nn),ht(dn)}function Bm(e,t,n){if(dn.current!==ki)throw Error(G(168));ot(dn,t),ot(Nn,n)}function cb(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(G(108,D0(e)||"Unknown",i));return wt({},n,r)}function Xl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ki,Zi=dn.current,ot(dn,e),ot(Nn,Nn.current),!0}function Fm(e,t,n){var r=e.stateNode;if(!r)throw Error(G(169));n?(e=cb(e,t,Zi),r.__reactInternalMemoizedMergedChildContext=e,ht(Nn),ht(dn),ot(dn,e)):ht(Nn),ot(Nn,n)}var Mr=null,Dc=!1,ku=!1;function ub(e){Mr===null?Mr=[e]:Mr.push(e)}function Y1(e){Dc=!0,ub(e)}function ji(){if(!ku&&Mr!==null){ku=!0;var e=0,t=Ze;try{var n=Mr;for(Ze=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Mr=null,Dc=!1}catch(i){throw Mr!==null&&(Mr=Mr.slice(e+1)),Iv(jf,ji),i}finally{Ze=t,ku=!1}}return null}var js=[],Rs=0,Jl=null,Zl=0,Xn=[],Jn=0,Qi=null,zr=1,Br="";function Oi(e,t){js[Rs++]=Zl,js[Rs++]=Jl,Jl=e,Zl=t}function hb(e,t,n){Xn[Jn++]=zr,Xn[Jn++]=Br,Xn[Jn++]=Qi,Qi=e;var r=zr;e=Br;var i=32-hr(r)-1;r&=~(1<<i),n+=1;var s=32-hr(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,zr=1<<32-hr(t)+i|n<<i|r,Br=s+e}else zr=1<<s|n<<i|r,Br=e}function Of(e){e.return!==null&&(Oi(e,1),hb(e,1,0))}function zf(e){for(;e===Jl;)Jl=js[--Rs],js[Rs]=null,Zl=js[--Rs],js[Rs]=null;for(;e===Qi;)Qi=Xn[--Jn],Xn[Jn]=null,Br=Xn[--Jn],Xn[Jn]=null,zr=Xn[--Jn],Xn[Jn]=null}var On=null,Mn=null,dt=!1,ur=null;function db(e,t){var n=Qn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function $m(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,On=e,Mn=yi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,On=e,Mn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Qi!==null?{id:zr,overflow:Br}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Qn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,On=e,Mn=null,!0):!1;default:return!1}}function Gh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xh(e){if(dt){var t=Mn;if(t){var n=t;if(!$m(e,t)){if(Gh(e))throw Error(G(418));t=yi(n.nextSibling);var r=On;t&&$m(e,t)?db(r,n):(e.flags=e.flags&-4097|2,dt=!1,On=e)}}else{if(Gh(e))throw Error(G(418));e.flags=e.flags&-4097|2,dt=!1,On=e}}}function Hm(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;On=e}function Ua(e){if(e!==On)return!1;if(!dt)return Hm(e),dt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Vh(e.type,e.memoizedProps)),t&&(t=Mn)){if(Gh(e))throw fb(),Error(G(418));for(;t;)db(e,t),t=yi(t.nextSibling)}if(Hm(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Mn=yi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Mn=null}}else Mn=On?yi(e.stateNode.nextSibling):null;return!0}function fb(){for(var e=Mn;e;)e=yi(e.nextSibling)}function qs(){Mn=On=null,dt=!1}function Bf(e){ur===null?ur=[e]:ur.push(e)}var G1=Kr.ReactCurrentBatchConfig;function fo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(G(309));var r=n.stateNode}if(!r)throw Error(G(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(G(284));if(!n._owner)throw Error(G(290,e))}return e}function Va(e,t){throw e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Wm(e){var t=e._init;return t(e._payload)}function pb(e){function t(_,v){if(e){var g=_.deletions;g===null?(_.deletions=[v],_.flags|=16):g.push(v)}}function n(_,v){if(!e)return null;for(;v!==null;)t(_,v),v=v.sibling;return null}function r(_,v){for(_=new Map;v!==null;)v.key!==null?_.set(v.key,v):_.set(v.index,v),v=v.sibling;return _}function i(_,v){return _=wi(_,v),_.index=0,_.sibling=null,_}function s(_,v,g){return _.index=g,e?(g=_.alternate,g!==null?(g=g.index,g<v?(_.flags|=2,v):g):(_.flags|=2,v)):(_.flags|=1048576,v)}function o(_){return e&&_.alternate===null&&(_.flags|=2),_}function a(_,v,g,S){return v===null||v.tag!==6?(v=Du(g,_.mode,S),v.return=_,v):(v=i(v,g),v.return=_,v)}function l(_,v,g,S){var C=g.type;return C===Ss?d(_,v,g.props.children,S,g.key):v!==null&&(v.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===oi&&Wm(C)===v.type)?(S=i(v,g.props),S.ref=fo(_,v,g),S.return=_,S):(S=Nl(g.type,g.key,g.props,null,_.mode,S),S.ref=fo(_,v,g),S.return=_,S)}function c(_,v,g,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==g.containerInfo||v.stateNode.implementation!==g.implementation?(v=Pu(g,_.mode,S),v.return=_,v):(v=i(v,g.children||[]),v.return=_,v)}function d(_,v,g,S,C){return v===null||v.tag!==7?(v=Gi(g,_.mode,S,C),v.return=_,v):(v=i(v,g),v.return=_,v)}function h(_,v,g){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Du(""+v,_.mode,g),v.return=_,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Aa:return g=Nl(v.type,v.key,v.props,null,_.mode,g),g.ref=fo(_,null,v),g.return=_,g;case ws:return v=Pu(v,_.mode,g),v.return=_,v;case oi:var S=v._init;return h(_,S(v._payload),g)}if(No(v)||ao(v))return v=Gi(v,_.mode,g,null),v.return=_,v;Va(_,v)}return null}function f(_,v,g,S){var C=v!==null?v.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return C!==null?null:a(_,v,""+g,S);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Aa:return g.key===C?l(_,v,g,S):null;case ws:return g.key===C?c(_,v,g,S):null;case oi:return C=g._init,f(_,v,C(g._payload),S)}if(No(g)||ao(g))return C!==null?null:d(_,v,g,S,null);Va(_,g)}return null}function p(_,v,g,S,C){if(typeof S=="string"&&S!==""||typeof S=="number")return _=_.get(g)||null,a(v,_,""+S,C);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Aa:return _=_.get(S.key===null?g:S.key)||null,l(v,_,S,C);case ws:return _=_.get(S.key===null?g:S.key)||null,c(v,_,S,C);case oi:var x=S._init;return p(_,v,g,x(S._payload),C)}if(No(S)||ao(S))return _=_.get(g)||null,d(v,_,S,C,null);Va(v,S)}return null}function m(_,v,g,S){for(var C=null,x=null,T=v,P=v=0,B=null;T!==null&&P<g.length;P++){T.index>P?(B=T,T=null):B=T.sibling;var j=f(_,T,g[P],S);if(j===null){T===null&&(T=B);break}e&&T&&j.alternate===null&&t(_,T),v=s(j,v,P),x===null?C=j:x.sibling=j,x=j,T=B}if(P===g.length)return n(_,T),dt&&Oi(_,P),C;if(T===null){for(;P<g.length;P++)T=h(_,g[P],S),T!==null&&(v=s(T,v,P),x===null?C=T:x.sibling=T,x=T);return dt&&Oi(_,P),C}for(T=r(_,T);P<g.length;P++)B=p(T,_,P,g[P],S),B!==null&&(e&&B.alternate!==null&&T.delete(B.key===null?P:B.key),v=s(B,v,P),x===null?C=B:x.sibling=B,x=B);return e&&T.forEach(function($){return t(_,$)}),dt&&Oi(_,P),C}function y(_,v,g,S){var C=ao(g);if(typeof C!="function")throw Error(G(150));if(g=C.call(g),g==null)throw Error(G(151));for(var x=C=null,T=v,P=v=0,B=null,j=g.next();T!==null&&!j.done;P++,j=g.next()){T.index>P?(B=T,T=null):B=T.sibling;var $=f(_,T,j.value,S);if($===null){T===null&&(T=B);break}e&&T&&$.alternate===null&&t(_,T),v=s($,v,P),x===null?C=$:x.sibling=$,x=$,T=B}if(j.done)return n(_,T),dt&&Oi(_,P),C;if(T===null){for(;!j.done;P++,j=g.next())j=h(_,j.value,S),j!==null&&(v=s(j,v,P),x===null?C=j:x.sibling=j,x=j);return dt&&Oi(_,P),C}for(T=r(_,T);!j.done;P++,j=g.next())j=p(T,_,P,j.value,S),j!==null&&(e&&j.alternate!==null&&T.delete(j.key===null?P:j.key),v=s(j,v,P),x===null?C=j:x.sibling=j,x=j);return e&&T.forEach(function(I){return t(_,I)}),dt&&Oi(_,P),C}function b(_,v,g,S){if(typeof g=="object"&&g!==null&&g.type===Ss&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Aa:e:{for(var C=g.key,x=v;x!==null;){if(x.key===C){if(C=g.type,C===Ss){if(x.tag===7){n(_,x.sibling),v=i(x,g.props.children),v.return=_,_=v;break e}}else if(x.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===oi&&Wm(C)===x.type){n(_,x.sibling),v=i(x,g.props),v.ref=fo(_,x,g),v.return=_,_=v;break e}n(_,x);break}else t(_,x);x=x.sibling}g.type===Ss?(v=Gi(g.props.children,_.mode,S,g.key),v.return=_,_=v):(S=Nl(g.type,g.key,g.props,null,_.mode,S),S.ref=fo(_,v,g),S.return=_,_=S)}return o(_);case ws:e:{for(x=g.key;v!==null;){if(v.key===x)if(v.tag===4&&v.stateNode.containerInfo===g.containerInfo&&v.stateNode.implementation===g.implementation){n(_,v.sibling),v=i(v,g.children||[]),v.return=_,_=v;break e}else{n(_,v);break}else t(_,v);v=v.sibling}v=Pu(g,_.mode,S),v.return=_,_=v}return o(_);case oi:return x=g._init,b(_,v,x(g._payload),S)}if(No(g))return m(_,v,g,S);if(ao(g))return y(_,v,g,S);Va(_,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,v!==null&&v.tag===6?(n(_,v.sibling),v=i(v,g),v.return=_,_=v):(n(_,v),v=Du(g,_.mode,S),v.return=_,_=v),o(_)):n(_,v)}return b}var Ks=pb(!0),mb=pb(!1),Ql=Ni(null),ec=null,Ts=null,Ff=null;function $f(){Ff=Ts=ec=null}function Hf(e){var t=Ql.current;ht(Ql),e._currentValue=t}function Jh(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Bs(e,t){ec=e,Ff=Ts=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(En=!0),e.firstContext=null)}function nr(e){var t=e._currentValue;if(Ff!==e)if(e={context:e,memoizedValue:t,next:null},Ts===null){if(ec===null)throw Error(G(308));Ts=e,ec.dependencies={lanes:0,firstContext:e}}else Ts=Ts.next=e;return t}var Ui=null;function Wf(e){Ui===null?Ui=[e]:Ui.push(e)}function gb(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Wf(t)):(n.next=i.next,i.next=n),t.interleaved=n,Vr(e,r)}function Vr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ai=!1;function Uf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function yb(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function $r(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function _i(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ye&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Vr(e,n)}return i=r.interleaved,i===null?(t.next=t,Wf(r)):(t.next=i.next,i.next=t),r.interleaved=t,Vr(e,n)}function wl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Rf(e,n)}}function Um(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function tc(e,t,n,r){var i=e.updateQueue;ai=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(s!==null){var h=i.baseState;o=0,d=c=l=null,a=s;do{var f=a.lane,p=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,y=a;switch(f=t,p=n,y.tag){case 1:if(m=y.payload,typeof m=="function"){h=m.call(p,h,f);break e}h=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,f=typeof m=="function"?m.call(p,h,f):m,f==null)break e;h=wt({},h,f);break e;case 2:ai=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=p,l=h):d=d.next=p,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(d===null&&(l=h),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);ts|=o,e.lanes=o,e.memoizedState=h}}function Vm(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(G(191,i));i.call(r)}}}var xa={},jr=Ni(xa),aa=Ni(xa),la=Ni(xa);function Vi(e){if(e===xa)throw Error(G(174));return e}function Vf(e,t){switch(ot(la,t),ot(aa,e),ot(jr,xa),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Dh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Dh(t,e)}ht(jr),ot(jr,t)}function Ys(){ht(jr),ht(aa),ht(la)}function _b(e){Vi(la.current);var t=Vi(jr.current),n=Dh(t,e.type);t!==n&&(ot(aa,e),ot(jr,n))}function qf(e){aa.current===e&&(ht(jr),ht(aa))}var vt=Ni(0);function nc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Cu=[];function Kf(){for(var e=0;e<Cu.length;e++)Cu[e]._workInProgressVersionPrimary=null;Cu.length=0}var Sl=Kr.ReactCurrentDispatcher,Eu=Kr.ReactCurrentBatchConfig,es=0,bt=null,Ht=null,Kt=null,rc=!1,$o=!1,ca=0,X1=0;function on(){throw Error(G(321))}function Yf(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mr(e[n],t[n]))return!1;return!0}function Gf(e,t,n,r,i,s){if(es=s,bt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Sl.current=e===null||e.memoizedState===null?ek:tk,e=n(r,i),$o){s=0;do{if($o=!1,ca=0,25<=s)throw Error(G(301));s+=1,Kt=Ht=null,t.updateQueue=null,Sl.current=nk,e=n(r,i)}while($o)}if(Sl.current=ic,t=Ht!==null&&Ht.next!==null,es=0,Kt=Ht=bt=null,rc=!1,t)throw Error(G(300));return e}function Xf(){var e=ca!==0;return ca=0,e}function wr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?bt.memoizedState=Kt=e:Kt=Kt.next=e,Kt}function rr(){if(Ht===null){var e=bt.alternate;e=e!==null?e.memoizedState:null}else e=Ht.next;var t=Kt===null?bt.memoizedState:Kt.next;if(t!==null)Kt=t,Ht=e;else{if(e===null)throw Error(G(310));Ht=e,e={memoizedState:Ht.memoizedState,baseState:Ht.baseState,baseQueue:Ht.baseQueue,queue:Ht.queue,next:null},Kt===null?bt.memoizedState=Kt=e:Kt=Kt.next=e}return Kt}function ua(e,t){return typeof t=="function"?t(e):t}function Nu(e){var t=rr(),n=t.queue;if(n===null)throw Error(G(311));n.lastRenderedReducer=e;var r=Ht,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,c=s;do{var d=c.lane;if((es&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var h={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=h,o=r):l=l.next=h,bt.lanes|=d,ts|=d}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,mr(r,t.memoizedState)||(En=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,bt.lanes|=s,ts|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ju(e){var t=rr(),n=t.queue;if(n===null)throw Error(G(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);mr(s,t.memoizedState)||(En=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function vb(){}function bb(e,t){var n=bt,r=rr(),i=t(),s=!mr(r.memoizedState,i);if(s&&(r.memoizedState=i,En=!0),r=r.queue,Jf(xb.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Kt!==null&&Kt.memoizedState.tag&1){if(n.flags|=2048,ha(9,Sb.bind(null,n,r,i,t),void 0,null),Jt===null)throw Error(G(349));es&30||wb(n,t,i)}return i}function wb(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=bt.updateQueue,t===null?(t={lastEffect:null,stores:null},bt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Sb(e,t,n,r){t.value=n,t.getSnapshot=r,kb(t)&&Cb(e)}function xb(e,t,n){return n(function(){kb(t)&&Cb(e)})}function kb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mr(e,n)}catch{return!0}}function Cb(e){var t=Vr(e,1);t!==null&&dr(t,e,1,-1)}function qm(e){var t=wr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:e},t.queue=e,e=e.dispatch=Q1.bind(null,bt,e),[t.memoizedState,e]}function ha(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=bt.updateQueue,t===null?(t={lastEffect:null,stores:null},bt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Eb(){return rr().memoizedState}function xl(e,t,n,r){var i=wr();bt.flags|=e,i.memoizedState=ha(1|t,n,void 0,r===void 0?null:r)}function Pc(e,t,n,r){var i=rr();r=r===void 0?null:r;var s=void 0;if(Ht!==null){var o=Ht.memoizedState;if(s=o.destroy,r!==null&&Yf(r,o.deps)){i.memoizedState=ha(t,n,s,r);return}}bt.flags|=e,i.memoizedState=ha(1|t,n,s,r)}function Km(e,t){return xl(8390656,8,e,t)}function Jf(e,t){return Pc(2048,8,e,t)}function Nb(e,t){return Pc(4,2,e,t)}function jb(e,t){return Pc(4,4,e,t)}function Rb(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Tb(e,t,n){return n=n!=null?n.concat([e]):null,Pc(4,4,Rb.bind(null,t,e),n)}function Zf(){}function Db(e,t){var n=rr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Yf(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Pb(e,t){var n=rr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Yf(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Lb(e,t,n){return es&21?(mr(n,t)||(n=zv(),bt.lanes|=n,ts|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,En=!0),e.memoizedState=n)}function J1(e,t){var n=Ze;Ze=n!==0&&4>n?n:4,e(!0);var r=Eu.transition;Eu.transition={};try{e(!1),t()}finally{Ze=n,Eu.transition=r}}function Ab(){return rr().memoizedState}function Z1(e,t,n){var r=bi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ib(e))Mb(t,n);else if(n=gb(e,t,n,r),n!==null){var i=_n();dr(n,e,r,i),Ob(n,t,r)}}function Q1(e,t,n){var r=bi(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ib(e))Mb(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,mr(a,o)){var l=t.interleaved;l===null?(i.next=i,Wf(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=gb(e,t,i,r),n!==null&&(i=_n(),dr(n,e,r,i),Ob(n,t,r))}}function Ib(e){var t=e.alternate;return e===bt||t!==null&&t===bt}function Mb(e,t){$o=rc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ob(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Rf(e,n)}}var ic={readContext:nr,useCallback:on,useContext:on,useEffect:on,useImperativeHandle:on,useInsertionEffect:on,useLayoutEffect:on,useMemo:on,useReducer:on,useRef:on,useState:on,useDebugValue:on,useDeferredValue:on,useTransition:on,useMutableSource:on,useSyncExternalStore:on,useId:on,unstable_isNewReconciler:!1},ek={readContext:nr,useCallback:function(e,t){return wr().memoizedState=[e,t===void 0?null:t],e},useContext:nr,useEffect:Km,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,xl(4194308,4,Rb.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xl(4194308,4,e,t)},useInsertionEffect:function(e,t){return xl(4,2,e,t)},useMemo:function(e,t){var n=wr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=wr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Z1.bind(null,bt,e),[r.memoizedState,e]},useRef:function(e){var t=wr();return e={current:e},t.memoizedState=e},useState:qm,useDebugValue:Zf,useDeferredValue:function(e){return wr().memoizedState=e},useTransition:function(){var e=qm(!1),t=e[0];return e=J1.bind(null,e[1]),wr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=bt,i=wr();if(dt){if(n===void 0)throw Error(G(407));n=n()}else{if(n=t(),Jt===null)throw Error(G(349));es&30||wb(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Km(xb.bind(null,r,s,e),[e]),r.flags|=2048,ha(9,Sb.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=wr(),t=Jt.identifierPrefix;if(dt){var n=Br,r=zr;n=(r&~(1<<32-hr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ca++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=X1++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},tk={readContext:nr,useCallback:Db,useContext:nr,useEffect:Jf,useImperativeHandle:Tb,useInsertionEffect:Nb,useLayoutEffect:jb,useMemo:Pb,useReducer:Nu,useRef:Eb,useState:function(){return Nu(ua)},useDebugValue:Zf,useDeferredValue:function(e){var t=rr();return Lb(t,Ht.memoizedState,e)},useTransition:function(){var e=Nu(ua)[0],t=rr().memoizedState;return[e,t]},useMutableSource:vb,useSyncExternalStore:bb,useId:Ab,unstable_isNewReconciler:!1},nk={readContext:nr,useCallback:Db,useContext:nr,useEffect:Jf,useImperativeHandle:Tb,useInsertionEffect:Nb,useLayoutEffect:jb,useMemo:Pb,useReducer:ju,useRef:Eb,useState:function(){return ju(ua)},useDebugValue:Zf,useDeferredValue:function(e){var t=rr();return Ht===null?t.memoizedState=e:Lb(t,Ht.memoizedState,e)},useTransition:function(){var e=ju(ua)[0],t=rr().memoizedState;return[e,t]},useMutableSource:vb,useSyncExternalStore:bb,useId:Ab,unstable_isNewReconciler:!1};function lr(e,t){if(e&&e.defaultProps){t=wt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Zh(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:wt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Lc={isMounted:function(e){return(e=e._reactInternals)?cs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_n(),i=bi(e),s=$r(r,i);s.payload=t,n!=null&&(s.callback=n),t=_i(e,s,i),t!==null&&(dr(t,e,i,r),wl(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_n(),i=bi(e),s=$r(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=_i(e,s,i),t!==null&&(dr(t,e,i,r),wl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_n(),r=bi(e),i=$r(n,r);i.tag=2,t!=null&&(i.callback=t),t=_i(e,i,r),t!==null&&(dr(t,e,r,n),wl(t,e,r))}};function Ym(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!ra(n,r)||!ra(i,s):!0}function zb(e,t,n){var r=!1,i=ki,s=t.contextType;return typeof s=="object"&&s!==null?s=nr(s):(i=jn(t)?Zi:dn.current,r=t.contextTypes,s=(r=r!=null)?Vs(e,i):ki),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Lc,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Gm(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Lc.enqueueReplaceState(t,t.state,null)}function Qh(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Uf(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=nr(s):(s=jn(t)?Zi:dn.current,i.context=Vs(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Zh(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Lc.enqueueReplaceState(i,i.state,null),tc(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Gs(e,t){try{var n="",r=t;do n+=T0(r),r=r.return;while(r);var i=n}catch(s){i=`
37
+ `+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{cu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Eo(e):""}function T0(e){switch(e.tag){case 5:return Eo(e.type);case 16:return Eo("Lazy");case 13:return Eo("Suspense");case 19:return Eo("SuspenseList");case 0:case 2:case 15:return e=uu(e.type,!1),e;case 11:return e=uu(e.type.render,!1),e;case 1:return e=uu(e.type,!0),e;default:return""}}function Eh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ss:return"Fragment";case ws:return"Portal";case xh:return"Profiler";case kf:return"StrictMode";case kh:return"Suspense";case Ch:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case yv:return(e.displayName||"Context")+".Consumer";case gv:return(e._context.displayName||"Context")+".Provider";case Cf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ef:return t=e.displayName||null,t!==null?t:Eh(e.type)||"Memo";case oi:t=e._payload,e=e._init;try{return Eh(e(t))}catch{}}return null}function D0(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Eh(t);case 8:return t===kf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function xi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function P0(e){var t=vv(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ia(e){e._valueTracker||(e._valueTracker=P0(e))}function bv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=vv(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fl(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 Nh(e,t){var n=t.checked;return wt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function dm(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=xi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function wv(e,t){t=t.checked,t!=null&&xf(e,"checked",t,!1)}function jh(e,t){wv(e,t);var n=xi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Rh(e,t.type,n):t.hasOwnProperty("defaultValue")&&Rh(e,t.type,xi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function fm(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Rh(e,t,n){(t!=="number"||Fl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var No=Array.isArray;function Is(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+xi(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Th(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(X(91));return wt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function pm(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(X(92));if(No(n)){if(1<n.length)throw Error(X(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:xi(n)}}function Sv(e,t){var n=xi(t.value),r=xi(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function mm(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function xv(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Dh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?xv(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ma,kv=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ma=Ma||document.createElement("div"),Ma.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ma.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Jo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Mo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},L0=["Webkit","ms","Moz","O"];Object.keys(Mo).forEach(function(e){L0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mo[t]=Mo[e]})});function Cv(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Mo.hasOwnProperty(e)&&Mo[e]?(""+t).trim():t+"px"}function Ev(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Cv(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var A0=wt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ph(e,t){if(t){if(A0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(X(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(X(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(X(61))}if(t.style!=null&&typeof t.style!="object")throw Error(X(62))}}function Lh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ah=null;function Nf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ih=null,Ms=null,Os=null;function gm(e){if(e=Sa(e)){if(typeof Ih!="function")throw Error(X(280));var t=e.stateNode;t&&(t=Tc(t),Ih(e.stateNode,e.type,t))}}function Nv(e){Ms?Os?Os.push(e):Os=[e]:Ms=e}function jv(){if(Ms){var e=Ms,t=Os;if(Os=Ms=null,gm(e),t)for(e=0;e<t.length;e++)gm(t[e])}}function Rv(e,t){return e(t)}function Tv(){}var hu=!1;function Dv(e,t,n){if(hu)return e(t,n);hu=!0;try{return Rv(e,t,n)}finally{hu=!1,(Ms!==null||Os!==null)&&(Tv(),jv())}}function Zo(e,t){var n=e.stateNode;if(n===null)return null;var r=Tc(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(X(231,t,typeof n));return n}var Mh=!1;if(Wr)try{var lo={};Object.defineProperty(lo,"passive",{get:function(){Mh=!0}}),window.addEventListener("test",lo,lo),window.removeEventListener("test",lo,lo)}catch{Mh=!1}function I0(e,t,n,r,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var Oo=!1,$l=null,Hl=!1,Oh=null,M0={onError:function(e){Oo=!0,$l=e}};function O0(e,t,n,r,i,s,o,a,l){Oo=!1,$l=null,I0.apply(M0,arguments)}function z0(e,t,n,r,i,s,o,a,l){if(O0.apply(this,arguments),Oo){if(Oo){var c=$l;Oo=!1,$l=null}else throw Error(X(198));Hl||(Hl=!0,Oh=c)}}function cs(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Pv(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 ym(e){if(cs(e)!==e)throw Error(X(188))}function B0(e){var t=e.alternate;if(!t){if(t=cs(e),t===null)throw Error(X(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return ym(i),e;if(s===r)return ym(i),t;s=s.sibling}throw Error(X(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(X(189))}}if(n.alternate!==r)throw Error(X(190))}if(n.tag!==3)throw Error(X(188));return n.stateNode.current===n?e:t}function Lv(e){return e=B0(e),e!==null?Av(e):null}function Av(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Av(e);if(t!==null)return t;e=e.sibling}return null}var Iv=Bn.unstable_scheduleCallback,_m=Bn.unstable_cancelCallback,F0=Bn.unstable_shouldYield,$0=Bn.unstable_requestPaint,Tt=Bn.unstable_now,H0=Bn.unstable_getCurrentPriorityLevel,jf=Bn.unstable_ImmediatePriority,Mv=Bn.unstable_UserBlockingPriority,Wl=Bn.unstable_NormalPriority,W0=Bn.unstable_LowPriority,Ov=Bn.unstable_IdlePriority,Ec=null,Nr=null;function U0(e){if(Nr&&typeof Nr.onCommitFiberRoot=="function")try{Nr.onCommitFiberRoot(Ec,e,void 0,(e.current.flags&128)===128)}catch{}}var hr=Math.clz32?Math.clz32:K0,V0=Math.log,q0=Math.LN2;function K0(e){return e>>>=0,e===0?32:31-(V0(e)/q0|0)|0}var Oa=64,za=4194304;function jo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ul(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=jo(a):(s&=o,s!==0&&(r=jo(s)))}else o=n&~i,o!==0?r=jo(o):s!==0&&(r=jo(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-hr(t),i=1<<n,r|=e[n],t&=~i;return r}function Y0(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function G0(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-hr(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=Y0(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function zh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function zv(){var e=Oa;return Oa<<=1,!(Oa&4194240)&&(Oa=64),e}function du(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ba(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-hr(t),e[t]=n}function X0(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-hr(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function Rf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-hr(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Ze=0;function Bv(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Fv,Tf,$v,Hv,Wv,Bh=!1,Ba=[],pi=null,mi=null,gi=null,Qo=new Map,ea=new Map,ci=[],J0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function vm(e,t){switch(e){case"focusin":case"focusout":pi=null;break;case"dragenter":case"dragleave":mi=null;break;case"mouseover":case"mouseout":gi=null;break;case"pointerover":case"pointerout":Qo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ea.delete(t.pointerId)}}function co(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Sa(t),t!==null&&Tf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Z0(e,t,n,r,i){switch(t){case"focusin":return pi=co(pi,e,t,n,r,i),!0;case"dragenter":return mi=co(mi,e,t,n,r,i),!0;case"mouseover":return gi=co(gi,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Qo.set(s,co(Qo.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,ea.set(s,co(ea.get(s)||null,e,t,n,r,i)),!0}return!1}function Uv(e){var t=Wi(e.target);if(t!==null){var n=cs(t);if(n!==null){if(t=n.tag,t===13){if(t=Pv(n),t!==null){e.blockedOn=t,Wv(e.priority,function(){$v(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 _l(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Fh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ah=r,n.target.dispatchEvent(r),Ah=null}else return t=Sa(n),t!==null&&Tf(t),e.blockedOn=n,!1;t.shift()}return!0}function bm(e,t,n){_l(e)&&n.delete(t)}function Q0(){Bh=!1,pi!==null&&_l(pi)&&(pi=null),mi!==null&&_l(mi)&&(mi=null),gi!==null&&_l(gi)&&(gi=null),Qo.forEach(bm),ea.forEach(bm)}function uo(e,t){e.blockedOn===t&&(e.blockedOn=null,Bh||(Bh=!0,Bn.unstable_scheduleCallback(Bn.unstable_NormalPriority,Q0)))}function ta(e){function t(i){return uo(i,e)}if(0<Ba.length){uo(Ba[0],e);for(var n=1;n<Ba.length;n++){var r=Ba[n];r.blockedOn===e&&(r.blockedOn=null)}}for(pi!==null&&uo(pi,e),mi!==null&&uo(mi,e),gi!==null&&uo(gi,e),Qo.forEach(t),ea.forEach(t),n=0;n<ci.length;n++)r=ci[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ci.length&&(n=ci[0],n.blockedOn===null);)Uv(n),n.blockedOn===null&&ci.shift()}var zs=Kr.ReactCurrentBatchConfig,Vl=!0;function e1(e,t,n,r){var i=Ze,s=zs.transition;zs.transition=null;try{Ze=1,Df(e,t,n,r)}finally{Ze=i,zs.transition=s}}function t1(e,t,n,r){var i=Ze,s=zs.transition;zs.transition=null;try{Ze=4,Df(e,t,n,r)}finally{Ze=i,zs.transition=s}}function Df(e,t,n,r){if(Vl){var i=Fh(e,t,n,r);if(i===null)Su(e,t,r,ql,n),vm(e,r);else if(Z0(i,e,t,n,r))r.stopPropagation();else if(vm(e,r),t&4&&-1<J0.indexOf(e)){for(;i!==null;){var s=Sa(i);if(s!==null&&Fv(s),s=Fh(e,t,n,r),s===null&&Su(e,t,r,ql,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Su(e,t,r,null,n)}}var ql=null;function Fh(e,t,n,r){if(ql=null,e=Nf(r),e=Wi(e),e!==null)if(t=cs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Pv(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ql=e,null}function Vv(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(H0()){case jf:return 1;case Mv:return 4;case Wl:case W0:return 16;case Ov:return 536870912;default:return 16}default:return 16}}var hi=null,Pf=null,vl=null;function qv(){if(vl)return vl;var e,t=Pf,n=t.length,r,i="value"in hi?hi.value:hi.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return vl=i.slice(e,1<r?1-r:void 0)}function bl(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 Fa(){return!0}function wm(){return!1}function $n(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Fa:wm,this.isPropagationStopped=wm,this}return wt(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=Fa)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Fa)},persist:function(){},isPersistent:Fa}),t}var eo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Lf=$n(eo),wa=wt({},eo,{view:0,detail:0}),n1=$n(wa),fu,pu,ho,Nc=wt({},wa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Af,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!==ho&&(ho&&e.type==="mousemove"?(fu=e.screenX-ho.screenX,pu=e.screenY-ho.screenY):pu=fu=0,ho=e),fu)},movementY:function(e){return"movementY"in e?e.movementY:pu}}),Sm=$n(Nc),r1=wt({},Nc,{dataTransfer:0}),i1=$n(r1),s1=wt({},wa,{relatedTarget:0}),mu=$n(s1),o1=wt({},eo,{animationName:0,elapsedTime:0,pseudoElement:0}),a1=$n(o1),l1=wt({},eo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),c1=$n(l1),u1=wt({},eo,{data:0}),xm=$n(u1),h1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},d1={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"},f1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function p1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=f1[e])?!!t[e]:!1}function Af(){return p1}var m1=wt({},wa,{key:function(e){if(e.key){var t=h1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=bl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?d1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Af,charCode:function(e){return e.type==="keypress"?bl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?bl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),g1=$n(m1),y1=wt({},Nc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),km=$n(y1),_1=wt({},wa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Af}),v1=$n(_1),b1=wt({},eo,{propertyName:0,elapsedTime:0,pseudoElement:0}),w1=$n(b1),S1=wt({},Nc,{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}),x1=$n(S1),k1=[9,13,27,32],If=Wr&&"CompositionEvent"in window,zo=null;Wr&&"documentMode"in document&&(zo=document.documentMode);var C1=Wr&&"TextEvent"in window&&!zo,Kv=Wr&&(!If||zo&&8<zo&&11>=zo),Cm=" ",Em=!1;function Yv(e,t){switch(e){case"keyup":return k1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xs=!1;function E1(e,t){switch(e){case"compositionend":return Gv(t);case"keypress":return t.which!==32?null:(Em=!0,Cm);case"textInput":return e=t.data,e===Cm&&Em?null:e;default:return null}}function N1(e,t){if(xs)return e==="compositionend"||!If&&Yv(e,t)?(e=qv(),vl=Pf=hi=null,xs=!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 Kv&&t.locale!=="ko"?null:t.data;default:return null}}var j1={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 Nm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!j1[e.type]:t==="textarea"}function Xv(e,t,n,r){Nv(r),t=Kl(t,"onChange"),0<t.length&&(n=new Lf("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Bo=null,na=null;function R1(e){ab(e,0)}function jc(e){var t=Es(e);if(bv(t))return e}function T1(e,t){if(e==="change")return t}var Jv=!1;if(Wr){var gu;if(Wr){var yu="oninput"in document;if(!yu){var jm=document.createElement("div");jm.setAttribute("oninput","return;"),yu=typeof jm.oninput=="function"}gu=yu}else gu=!1;Jv=gu&&(!document.documentMode||9<document.documentMode)}function Rm(){Bo&&(Bo.detachEvent("onpropertychange",Zv),na=Bo=null)}function Zv(e){if(e.propertyName==="value"&&jc(na)){var t=[];Xv(t,na,e,Nf(e)),Dv(R1,t)}}function D1(e,t,n){e==="focusin"?(Rm(),Bo=t,na=n,Bo.attachEvent("onpropertychange",Zv)):e==="focusout"&&Rm()}function P1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return jc(na)}function L1(e,t){if(e==="click")return jc(t)}function A1(e,t){if(e==="input"||e==="change")return jc(t)}function I1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mr=typeof Object.is=="function"?Object.is:I1;function ra(e,t){if(mr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Sh.call(t,i)||!mr(e[i],t[i]))return!1}return!0}function Tm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dm(e,t){var n=Tm(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Tm(n)}}function Qv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function eb(){for(var e=window,t=Fl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fl(e.document)}return t}function Mf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function M1(e){var t=eb(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Qv(n.ownerDocument.documentElement,n)){if(r!==null&&Mf(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Dm(n,s);var o=Dm(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var O1=Wr&&"documentMode"in document&&11>=document.documentMode,ks=null,$h=null,Fo=null,Hh=!1;function Pm(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hh||ks==null||ks!==Fl(r)||(r=ks,"selectionStart"in r&&Mf(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fo&&ra(Fo,r)||(Fo=r,r=Kl($h,"onSelect"),0<r.length&&(t=new Lf("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ks)))}function $a(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Cs={animationend:$a("Animation","AnimationEnd"),animationiteration:$a("Animation","AnimationIteration"),animationstart:$a("Animation","AnimationStart"),transitionend:$a("Transition","TransitionEnd")},_u={},tb={};Wr&&(tb=document.createElement("div").style,"AnimationEvent"in window||(delete Cs.animationend.animation,delete Cs.animationiteration.animation,delete Cs.animationstart.animation),"TransitionEvent"in window||delete Cs.transitionend.transition);function Rc(e){if(_u[e])return _u[e];if(!Cs[e])return e;var t=Cs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in tb)return _u[e]=t[n];return e}var nb=Rc("animationend"),rb=Rc("animationiteration"),ib=Rc("animationstart"),sb=Rc("transitionend"),ob=new Map,Lm="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ei(e,t){ob.set(e,t),ls(t,[e])}for(var vu=0;vu<Lm.length;vu++){var bu=Lm[vu],z1=bu.toLowerCase(),B1=bu[0].toUpperCase()+bu.slice(1);Ei(z1,"on"+B1)}Ei(nb,"onAnimationEnd");Ei(rb,"onAnimationIteration");Ei(ib,"onAnimationStart");Ei("dblclick","onDoubleClick");Ei("focusin","onFocus");Ei("focusout","onBlur");Ei(sb,"onTransitionEnd");Us("onMouseEnter",["mouseout","mouseover"]);Us("onMouseLeave",["mouseout","mouseover"]);Us("onPointerEnter",["pointerout","pointerover"]);Us("onPointerLeave",["pointerout","pointerover"]);ls("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ls("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ls("onBeforeInput",["compositionend","keypress","textInput","paste"]);ls("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ls("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ls("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ro="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(" "),F1=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ro));function Am(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,z0(r,t,void 0,e),e.currentTarget=null}function ab(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Am(i,a,c),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Am(i,a,c),s=l}}}if(Hl)throw e=Oh,Hl=!1,Oh=null,e}function ct(e,t){var n=t[Kh];n===void 0&&(n=t[Kh]=new Set);var r=e+"__bubble";n.has(r)||(lb(t,e,2,!1),n.add(r))}function wu(e,t,n){var r=0;t&&(r|=4),lb(n,e,r,t)}var Ha="_reactListening"+Math.random().toString(36).slice(2);function ia(e){if(!e[Ha]){e[Ha]=!0,mv.forEach(function(n){n!=="selectionchange"&&(F1.has(n)||wu(n,!1,e),wu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ha]||(t[Ha]=!0,wu("selectionchange",!1,t))}}function lb(e,t,n,r){switch(Vv(t)){case 1:var i=e1;break;case 4:i=t1;break;default:i=Df}n=i.bind(null,t,n,e),i=void 0,!Mh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Su(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Wi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}Dv(function(){var c=s,d=Nf(n),h=[];e:{var f=ob.get(e);if(f!==void 0){var p=Lf,m=e;switch(e){case"keypress":if(bl(n)===0)break e;case"keydown":case"keyup":p=g1;break;case"focusin":m="focus",p=mu;break;case"focusout":m="blur",p=mu;break;case"beforeblur":case"afterblur":p=mu;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":p=Sm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=i1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=v1;break;case nb:case rb:case ib:p=a1;break;case sb:p=w1;break;case"scroll":p=n1;break;case"wheel":p=x1;break;case"copy":case"cut":case"paste":p=c1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=km}var y=(t&4)!==0,b=!y&&e==="scroll",_=y?f!==null?f+"Capture":null:f;y=[];for(var v=c,g;v!==null;){g=v;var S=g.stateNode;if(g.tag===5&&S!==null&&(g=S,_!==null&&(S=Zo(v,_),S!=null&&y.push(sa(v,S,g)))),b)break;v=v.return}0<y.length&&(f=new p(f,m,null,n,d),h.push({event:f,listeners:y}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==Ah&&(m=n.relatedTarget||n.fromElement)&&(Wi(m)||m[Ur]))break e;if((p||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=c,m=m?Wi(m):null,m!==null&&(b=cs(m),m!==b||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(y=Sm,S="onMouseLeave",_="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(y=km,S="onPointerLeave",_="onPointerEnter",v="pointer"),b=p==null?f:Es(p),g=m==null?f:Es(m),f=new y(S,v+"leave",p,n,d),f.target=b,f.relatedTarget=g,S=null,Wi(d)===c&&(y=new y(_,v+"enter",m,n,d),y.target=g,y.relatedTarget=b,S=y),b=S,p&&m)t:{for(y=p,_=m,v=0,g=y;g;g=ds(g))v++;for(g=0,S=_;S;S=ds(S))g++;for(;0<v-g;)y=ds(y),v--;for(;0<g-v;)_=ds(_),g--;for(;v--;){if(y===_||_!==null&&y===_.alternate)break t;y=ds(y),_=ds(_)}y=null}else y=null;p!==null&&Im(h,f,p,y,!1),m!==null&&b!==null&&Im(h,b,m,y,!0)}}e:{if(f=c?Es(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var C=T1;else if(Nm(f))if(Jv)C=A1;else{C=P1;var x=D1}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(C=L1);if(C&&(C=C(e,c))){Xv(h,C,n,d);break e}x&&x(e,f,c),e==="focusout"&&(x=f._wrapperState)&&x.controlled&&f.type==="number"&&Rh(f,"number",f.value)}switch(x=c?Es(c):window,e){case"focusin":(Nm(x)||x.contentEditable==="true")&&(ks=x,$h=c,Fo=null);break;case"focusout":Fo=$h=ks=null;break;case"mousedown":Hh=!0;break;case"contextmenu":case"mouseup":case"dragend":Hh=!1,Pm(h,n,d);break;case"selectionchange":if(O1)break;case"keydown":case"keyup":Pm(h,n,d)}var T;if(If)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else xs?Yv(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(Kv&&n.locale!=="ko"&&(xs||P!=="onCompositionStart"?P==="onCompositionEnd"&&xs&&(T=qv()):(hi=d,Pf="value"in hi?hi.value:hi.textContent,xs=!0)),x=Kl(c,P),0<x.length&&(P=new xm(P,e,null,n,d),h.push({event:P,listeners:x}),T?P.data=T:(T=Gv(n),T!==null&&(P.data=T)))),(T=C1?E1(e,n):N1(e,n))&&(c=Kl(c,"onBeforeInput"),0<c.length&&(d=new xm("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:c}),d.data=T))}ab(h,t)})}function sa(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Kl(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Zo(e,n),s!=null&&r.unshift(sa(e,s,i)),s=Zo(e,t),s!=null&&r.push(sa(e,s,i))),e=e.return}return r}function ds(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Im(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=Zo(n,s),l!=null&&o.unshift(sa(n,l,a))):i||(l=Zo(n,s),l!=null&&o.push(sa(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var $1=/\r\n?/g,H1=/\u0000|\uFFFD/g;function Mm(e){return(typeof e=="string"?e:""+e).replace($1,`
38
+ `).replace(H1,"")}function Wa(e,t,n){if(t=Mm(t),Mm(e)!==t&&n)throw Error(X(425))}function Yl(){}var Wh=null,Uh=null;function Vh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qh=typeof setTimeout=="function"?setTimeout:void 0,W1=typeof clearTimeout=="function"?clearTimeout:void 0,Om=typeof Promise=="function"?Promise:void 0,U1=typeof queueMicrotask=="function"?queueMicrotask:typeof Om<"u"?function(e){return Om.resolve(null).then(e).catch(V1)}:qh;function V1(e){setTimeout(function(){throw e})}function xu(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),ta(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ta(t)}function yi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function zm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var to=Math.random().toString(36).slice(2),Cr="__reactFiber$"+to,oa="__reactProps$"+to,Ur="__reactContainer$"+to,Kh="__reactEvents$"+to,q1="__reactListeners$"+to,K1="__reactHandles$"+to;function Wi(e){var t=e[Cr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ur]||n[Cr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=zm(e);e!==null;){if(n=e[Cr])return n;e=zm(e)}return t}e=n,n=e.parentNode}return null}function Sa(e){return e=e[Cr]||e[Ur],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Es(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(X(33))}function Tc(e){return e[oa]||null}var Yh=[],Ns=-1;function Ni(e){return{current:e}}function ht(e){0>Ns||(e.current=Yh[Ns],Yh[Ns]=null,Ns--)}function ot(e,t){Ns++,Yh[Ns]=e.current,e.current=t}var ki={},dn=Ni(ki),Nn=Ni(!1),Zi=ki;function Vs(e,t){var n=e.type.contextTypes;if(!n)return ki;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function jn(e){return e=e.childContextTypes,e!=null}function Gl(){ht(Nn),ht(dn)}function Bm(e,t,n){if(dn.current!==ki)throw Error(X(168));ot(dn,t),ot(Nn,n)}function cb(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(X(108,D0(e)||"Unknown",i));return wt({},n,r)}function Xl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ki,Zi=dn.current,ot(dn,e),ot(Nn,Nn.current),!0}function Fm(e,t,n){var r=e.stateNode;if(!r)throw Error(X(169));n?(e=cb(e,t,Zi),r.__reactInternalMemoizedMergedChildContext=e,ht(Nn),ht(dn),ot(dn,e)):ht(Nn),ot(Nn,n)}var Mr=null,Dc=!1,ku=!1;function ub(e){Mr===null?Mr=[e]:Mr.push(e)}function Y1(e){Dc=!0,ub(e)}function ji(){if(!ku&&Mr!==null){ku=!0;var e=0,t=Ze;try{var n=Mr;for(Ze=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Mr=null,Dc=!1}catch(i){throw Mr!==null&&(Mr=Mr.slice(e+1)),Iv(jf,ji),i}finally{Ze=t,ku=!1}}return null}var js=[],Rs=0,Jl=null,Zl=0,Xn=[],Jn=0,Qi=null,zr=1,Br="";function Oi(e,t){js[Rs++]=Zl,js[Rs++]=Jl,Jl=e,Zl=t}function hb(e,t,n){Xn[Jn++]=zr,Xn[Jn++]=Br,Xn[Jn++]=Qi,Qi=e;var r=zr;e=Br;var i=32-hr(r)-1;r&=~(1<<i),n+=1;var s=32-hr(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,zr=1<<32-hr(t)+i|n<<i|r,Br=s+e}else zr=1<<s|n<<i|r,Br=e}function Of(e){e.return!==null&&(Oi(e,1),hb(e,1,0))}function zf(e){for(;e===Jl;)Jl=js[--Rs],js[Rs]=null,Zl=js[--Rs],js[Rs]=null;for(;e===Qi;)Qi=Xn[--Jn],Xn[Jn]=null,Br=Xn[--Jn],Xn[Jn]=null,zr=Xn[--Jn],Xn[Jn]=null}var On=null,Mn=null,dt=!1,ur=null;function db(e,t){var n=Qn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function $m(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,On=e,Mn=yi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,On=e,Mn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Qi!==null?{id:zr,overflow:Br}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Qn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,On=e,Mn=null,!0):!1;default:return!1}}function Gh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xh(e){if(dt){var t=Mn;if(t){var n=t;if(!$m(e,t)){if(Gh(e))throw Error(X(418));t=yi(n.nextSibling);var r=On;t&&$m(e,t)?db(r,n):(e.flags=e.flags&-4097|2,dt=!1,On=e)}}else{if(Gh(e))throw Error(X(418));e.flags=e.flags&-4097|2,dt=!1,On=e}}}function Hm(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;On=e}function Ua(e){if(e!==On)return!1;if(!dt)return Hm(e),dt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Vh(e.type,e.memoizedProps)),t&&(t=Mn)){if(Gh(e))throw fb(),Error(X(418));for(;t;)db(e,t),t=yi(t.nextSibling)}if(Hm(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(X(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Mn=yi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Mn=null}}else Mn=On?yi(e.stateNode.nextSibling):null;return!0}function fb(){for(var e=Mn;e;)e=yi(e.nextSibling)}function qs(){Mn=On=null,dt=!1}function Bf(e){ur===null?ur=[e]:ur.push(e)}var G1=Kr.ReactCurrentBatchConfig;function fo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(X(309));var r=n.stateNode}if(!r)throw Error(X(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(X(284));if(!n._owner)throw Error(X(290,e))}return e}function Va(e,t){throw e=Object.prototype.toString.call(t),Error(X(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Wm(e){var t=e._init;return t(e._payload)}function pb(e){function t(_,v){if(e){var g=_.deletions;g===null?(_.deletions=[v],_.flags|=16):g.push(v)}}function n(_,v){if(!e)return null;for(;v!==null;)t(_,v),v=v.sibling;return null}function r(_,v){for(_=new Map;v!==null;)v.key!==null?_.set(v.key,v):_.set(v.index,v),v=v.sibling;return _}function i(_,v){return _=wi(_,v),_.index=0,_.sibling=null,_}function s(_,v,g){return _.index=g,e?(g=_.alternate,g!==null?(g=g.index,g<v?(_.flags|=2,v):g):(_.flags|=2,v)):(_.flags|=1048576,v)}function o(_){return e&&_.alternate===null&&(_.flags|=2),_}function a(_,v,g,S){return v===null||v.tag!==6?(v=Du(g,_.mode,S),v.return=_,v):(v=i(v,g),v.return=_,v)}function l(_,v,g,S){var C=g.type;return C===Ss?d(_,v,g.props.children,S,g.key):v!==null&&(v.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===oi&&Wm(C)===v.type)?(S=i(v,g.props),S.ref=fo(_,v,g),S.return=_,S):(S=Nl(g.type,g.key,g.props,null,_.mode,S),S.ref=fo(_,v,g),S.return=_,S)}function c(_,v,g,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==g.containerInfo||v.stateNode.implementation!==g.implementation?(v=Pu(g,_.mode,S),v.return=_,v):(v=i(v,g.children||[]),v.return=_,v)}function d(_,v,g,S,C){return v===null||v.tag!==7?(v=Gi(g,_.mode,S,C),v.return=_,v):(v=i(v,g),v.return=_,v)}function h(_,v,g){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Du(""+v,_.mode,g),v.return=_,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Aa:return g=Nl(v.type,v.key,v.props,null,_.mode,g),g.ref=fo(_,null,v),g.return=_,g;case ws:return v=Pu(v,_.mode,g),v.return=_,v;case oi:var S=v._init;return h(_,S(v._payload),g)}if(No(v)||ao(v))return v=Gi(v,_.mode,g,null),v.return=_,v;Va(_,v)}return null}function f(_,v,g,S){var C=v!==null?v.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return C!==null?null:a(_,v,""+g,S);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Aa:return g.key===C?l(_,v,g,S):null;case ws:return g.key===C?c(_,v,g,S):null;case oi:return C=g._init,f(_,v,C(g._payload),S)}if(No(g)||ao(g))return C!==null?null:d(_,v,g,S,null);Va(_,g)}return null}function p(_,v,g,S,C){if(typeof S=="string"&&S!==""||typeof S=="number")return _=_.get(g)||null,a(v,_,""+S,C);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Aa:return _=_.get(S.key===null?g:S.key)||null,l(v,_,S,C);case ws:return _=_.get(S.key===null?g:S.key)||null,c(v,_,S,C);case oi:var x=S._init;return p(_,v,g,x(S._payload),C)}if(No(S)||ao(S))return _=_.get(g)||null,d(v,_,S,C,null);Va(v,S)}return null}function m(_,v,g,S){for(var C=null,x=null,T=v,P=v=0,B=null;T!==null&&P<g.length;P++){T.index>P?(B=T,T=null):B=T.sibling;var j=f(_,T,g[P],S);if(j===null){T===null&&(T=B);break}e&&T&&j.alternate===null&&t(_,T),v=s(j,v,P),x===null?C=j:x.sibling=j,x=j,T=B}if(P===g.length)return n(_,T),dt&&Oi(_,P),C;if(T===null){for(;P<g.length;P++)T=h(_,g[P],S),T!==null&&(v=s(T,v,P),x===null?C=T:x.sibling=T,x=T);return dt&&Oi(_,P),C}for(T=r(_,T);P<g.length;P++)B=p(T,_,P,g[P],S),B!==null&&(e&&B.alternate!==null&&T.delete(B.key===null?P:B.key),v=s(B,v,P),x===null?C=B:x.sibling=B,x=B);return e&&T.forEach(function($){return t(_,$)}),dt&&Oi(_,P),C}function y(_,v,g,S){var C=ao(g);if(typeof C!="function")throw Error(X(150));if(g=C.call(g),g==null)throw Error(X(151));for(var x=C=null,T=v,P=v=0,B=null,j=g.next();T!==null&&!j.done;P++,j=g.next()){T.index>P?(B=T,T=null):B=T.sibling;var $=f(_,T,j.value,S);if($===null){T===null&&(T=B);break}e&&T&&$.alternate===null&&t(_,T),v=s($,v,P),x===null?C=$:x.sibling=$,x=$,T=B}if(j.done)return n(_,T),dt&&Oi(_,P),C;if(T===null){for(;!j.done;P++,j=g.next())j=h(_,j.value,S),j!==null&&(v=s(j,v,P),x===null?C=j:x.sibling=j,x=j);return dt&&Oi(_,P),C}for(T=r(_,T);!j.done;P++,j=g.next())j=p(T,_,P,j.value,S),j!==null&&(e&&j.alternate!==null&&T.delete(j.key===null?P:j.key),v=s(j,v,P),x===null?C=j:x.sibling=j,x=j);return e&&T.forEach(function(I){return t(_,I)}),dt&&Oi(_,P),C}function b(_,v,g,S){if(typeof g=="object"&&g!==null&&g.type===Ss&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Aa:e:{for(var C=g.key,x=v;x!==null;){if(x.key===C){if(C=g.type,C===Ss){if(x.tag===7){n(_,x.sibling),v=i(x,g.props.children),v.return=_,_=v;break e}}else if(x.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===oi&&Wm(C)===x.type){n(_,x.sibling),v=i(x,g.props),v.ref=fo(_,x,g),v.return=_,_=v;break e}n(_,x);break}else t(_,x);x=x.sibling}g.type===Ss?(v=Gi(g.props.children,_.mode,S,g.key),v.return=_,_=v):(S=Nl(g.type,g.key,g.props,null,_.mode,S),S.ref=fo(_,v,g),S.return=_,_=S)}return o(_);case ws:e:{for(x=g.key;v!==null;){if(v.key===x)if(v.tag===4&&v.stateNode.containerInfo===g.containerInfo&&v.stateNode.implementation===g.implementation){n(_,v.sibling),v=i(v,g.children||[]),v.return=_,_=v;break e}else{n(_,v);break}else t(_,v);v=v.sibling}v=Pu(g,_.mode,S),v.return=_,_=v}return o(_);case oi:return x=g._init,b(_,v,x(g._payload),S)}if(No(g))return m(_,v,g,S);if(ao(g))return y(_,v,g,S);Va(_,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,v!==null&&v.tag===6?(n(_,v.sibling),v=i(v,g),v.return=_,_=v):(n(_,v),v=Du(g,_.mode,S),v.return=_,_=v),o(_)):n(_,v)}return b}var Ks=pb(!0),mb=pb(!1),Ql=Ni(null),ec=null,Ts=null,Ff=null;function $f(){Ff=Ts=ec=null}function Hf(e){var t=Ql.current;ht(Ql),e._currentValue=t}function Jh(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Bs(e,t){ec=e,Ff=Ts=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(En=!0),e.firstContext=null)}function nr(e){var t=e._currentValue;if(Ff!==e)if(e={context:e,memoizedValue:t,next:null},Ts===null){if(ec===null)throw Error(X(308));Ts=e,ec.dependencies={lanes:0,firstContext:e}}else Ts=Ts.next=e;return t}var Ui=null;function Wf(e){Ui===null?Ui=[e]:Ui.push(e)}function gb(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Wf(t)):(n.next=i.next,i.next=n),t.interleaved=n,Vr(e,r)}function Vr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ai=!1;function Uf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function yb(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function $r(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function _i(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ye&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Vr(e,n)}return i=r.interleaved,i===null?(t.next=t,Wf(r)):(t.next=i.next,i.next=t),r.interleaved=t,Vr(e,n)}function wl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Rf(e,n)}}function Um(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function tc(e,t,n,r){var i=e.updateQueue;ai=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(s!==null){var h=i.baseState;o=0,d=c=l=null,a=s;do{var f=a.lane,p=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,y=a;switch(f=t,p=n,y.tag){case 1:if(m=y.payload,typeof m=="function"){h=m.call(p,h,f);break e}h=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,f=typeof m=="function"?m.call(p,h,f):m,f==null)break e;h=wt({},h,f);break e;case 2:ai=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=p,l=h):d=d.next=p,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(d===null&&(l=h),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);ts|=o,e.lanes=o,e.memoizedState=h}}function Vm(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(X(191,i));i.call(r)}}}var xa={},jr=Ni(xa),aa=Ni(xa),la=Ni(xa);function Vi(e){if(e===xa)throw Error(X(174));return e}function Vf(e,t){switch(ot(la,t),ot(aa,e),ot(jr,xa),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Dh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Dh(t,e)}ht(jr),ot(jr,t)}function Ys(){ht(jr),ht(aa),ht(la)}function _b(e){Vi(la.current);var t=Vi(jr.current),n=Dh(t,e.type);t!==n&&(ot(aa,e),ot(jr,n))}function qf(e){aa.current===e&&(ht(jr),ht(aa))}var vt=Ni(0);function nc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Cu=[];function Kf(){for(var e=0;e<Cu.length;e++)Cu[e]._workInProgressVersionPrimary=null;Cu.length=0}var Sl=Kr.ReactCurrentDispatcher,Eu=Kr.ReactCurrentBatchConfig,es=0,bt=null,Ht=null,Kt=null,rc=!1,$o=!1,ca=0,X1=0;function on(){throw Error(X(321))}function Yf(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mr(e[n],t[n]))return!1;return!0}function Gf(e,t,n,r,i,s){if(es=s,bt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Sl.current=e===null||e.memoizedState===null?ek:tk,e=n(r,i),$o){s=0;do{if($o=!1,ca=0,25<=s)throw Error(X(301));s+=1,Kt=Ht=null,t.updateQueue=null,Sl.current=nk,e=n(r,i)}while($o)}if(Sl.current=ic,t=Ht!==null&&Ht.next!==null,es=0,Kt=Ht=bt=null,rc=!1,t)throw Error(X(300));return e}function Xf(){var e=ca!==0;return ca=0,e}function wr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?bt.memoizedState=Kt=e:Kt=Kt.next=e,Kt}function rr(){if(Ht===null){var e=bt.alternate;e=e!==null?e.memoizedState:null}else e=Ht.next;var t=Kt===null?bt.memoizedState:Kt.next;if(t!==null)Kt=t,Ht=e;else{if(e===null)throw Error(X(310));Ht=e,e={memoizedState:Ht.memoizedState,baseState:Ht.baseState,baseQueue:Ht.baseQueue,queue:Ht.queue,next:null},Kt===null?bt.memoizedState=Kt=e:Kt=Kt.next=e}return Kt}function ua(e,t){return typeof t=="function"?t(e):t}function Nu(e){var t=rr(),n=t.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=e;var r=Ht,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,c=s;do{var d=c.lane;if((es&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var h={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=h,o=r):l=l.next=h,bt.lanes|=d,ts|=d}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,mr(r,t.memoizedState)||(En=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,bt.lanes|=s,ts|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ju(e){var t=rr(),n=t.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);mr(s,t.memoizedState)||(En=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function vb(){}function bb(e,t){var n=bt,r=rr(),i=t(),s=!mr(r.memoizedState,i);if(s&&(r.memoizedState=i,En=!0),r=r.queue,Jf(xb.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Kt!==null&&Kt.memoizedState.tag&1){if(n.flags|=2048,ha(9,Sb.bind(null,n,r,i,t),void 0,null),Jt===null)throw Error(X(349));es&30||wb(n,t,i)}return i}function wb(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=bt.updateQueue,t===null?(t={lastEffect:null,stores:null},bt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Sb(e,t,n,r){t.value=n,t.getSnapshot=r,kb(t)&&Cb(e)}function xb(e,t,n){return n(function(){kb(t)&&Cb(e)})}function kb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mr(e,n)}catch{return!0}}function Cb(e){var t=Vr(e,1);t!==null&&dr(t,e,1,-1)}function qm(e){var t=wr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:e},t.queue=e,e=e.dispatch=Q1.bind(null,bt,e),[t.memoizedState,e]}function ha(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=bt.updateQueue,t===null?(t={lastEffect:null,stores:null},bt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Eb(){return rr().memoizedState}function xl(e,t,n,r){var i=wr();bt.flags|=e,i.memoizedState=ha(1|t,n,void 0,r===void 0?null:r)}function Pc(e,t,n,r){var i=rr();r=r===void 0?null:r;var s=void 0;if(Ht!==null){var o=Ht.memoizedState;if(s=o.destroy,r!==null&&Yf(r,o.deps)){i.memoizedState=ha(t,n,s,r);return}}bt.flags|=e,i.memoizedState=ha(1|t,n,s,r)}function Km(e,t){return xl(8390656,8,e,t)}function Jf(e,t){return Pc(2048,8,e,t)}function Nb(e,t){return Pc(4,2,e,t)}function jb(e,t){return Pc(4,4,e,t)}function Rb(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Tb(e,t,n){return n=n!=null?n.concat([e]):null,Pc(4,4,Rb.bind(null,t,e),n)}function Zf(){}function Db(e,t){var n=rr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Yf(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Pb(e,t){var n=rr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Yf(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Lb(e,t,n){return es&21?(mr(n,t)||(n=zv(),bt.lanes|=n,ts|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,En=!0),e.memoizedState=n)}function J1(e,t){var n=Ze;Ze=n!==0&&4>n?n:4,e(!0);var r=Eu.transition;Eu.transition={};try{e(!1),t()}finally{Ze=n,Eu.transition=r}}function Ab(){return rr().memoizedState}function Z1(e,t,n){var r=bi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ib(e))Mb(t,n);else if(n=gb(e,t,n,r),n!==null){var i=_n();dr(n,e,r,i),Ob(n,t,r)}}function Q1(e,t,n){var r=bi(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ib(e))Mb(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,mr(a,o)){var l=t.interleaved;l===null?(i.next=i,Wf(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=gb(e,t,i,r),n!==null&&(i=_n(),dr(n,e,r,i),Ob(n,t,r))}}function Ib(e){var t=e.alternate;return e===bt||t!==null&&t===bt}function Mb(e,t){$o=rc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ob(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Rf(e,n)}}var ic={readContext:nr,useCallback:on,useContext:on,useEffect:on,useImperativeHandle:on,useInsertionEffect:on,useLayoutEffect:on,useMemo:on,useReducer:on,useRef:on,useState:on,useDebugValue:on,useDeferredValue:on,useTransition:on,useMutableSource:on,useSyncExternalStore:on,useId:on,unstable_isNewReconciler:!1},ek={readContext:nr,useCallback:function(e,t){return wr().memoizedState=[e,t===void 0?null:t],e},useContext:nr,useEffect:Km,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,xl(4194308,4,Rb.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xl(4194308,4,e,t)},useInsertionEffect:function(e,t){return xl(4,2,e,t)},useMemo:function(e,t){var n=wr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=wr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Z1.bind(null,bt,e),[r.memoizedState,e]},useRef:function(e){var t=wr();return e={current:e},t.memoizedState=e},useState:qm,useDebugValue:Zf,useDeferredValue:function(e){return wr().memoizedState=e},useTransition:function(){var e=qm(!1),t=e[0];return e=J1.bind(null,e[1]),wr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=bt,i=wr();if(dt){if(n===void 0)throw Error(X(407));n=n()}else{if(n=t(),Jt===null)throw Error(X(349));es&30||wb(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Km(xb.bind(null,r,s,e),[e]),r.flags|=2048,ha(9,Sb.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=wr(),t=Jt.identifierPrefix;if(dt){var n=Br,r=zr;n=(r&~(1<<32-hr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ca++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=X1++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},tk={readContext:nr,useCallback:Db,useContext:nr,useEffect:Jf,useImperativeHandle:Tb,useInsertionEffect:Nb,useLayoutEffect:jb,useMemo:Pb,useReducer:Nu,useRef:Eb,useState:function(){return Nu(ua)},useDebugValue:Zf,useDeferredValue:function(e){var t=rr();return Lb(t,Ht.memoizedState,e)},useTransition:function(){var e=Nu(ua)[0],t=rr().memoizedState;return[e,t]},useMutableSource:vb,useSyncExternalStore:bb,useId:Ab,unstable_isNewReconciler:!1},nk={readContext:nr,useCallback:Db,useContext:nr,useEffect:Jf,useImperativeHandle:Tb,useInsertionEffect:Nb,useLayoutEffect:jb,useMemo:Pb,useReducer:ju,useRef:Eb,useState:function(){return ju(ua)},useDebugValue:Zf,useDeferredValue:function(e){var t=rr();return Ht===null?t.memoizedState=e:Lb(t,Ht.memoizedState,e)},useTransition:function(){var e=ju(ua)[0],t=rr().memoizedState;return[e,t]},useMutableSource:vb,useSyncExternalStore:bb,useId:Ab,unstable_isNewReconciler:!1};function lr(e,t){if(e&&e.defaultProps){t=wt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Zh(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:wt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Lc={isMounted:function(e){return(e=e._reactInternals)?cs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_n(),i=bi(e),s=$r(r,i);s.payload=t,n!=null&&(s.callback=n),t=_i(e,s,i),t!==null&&(dr(t,e,i,r),wl(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_n(),i=bi(e),s=$r(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=_i(e,s,i),t!==null&&(dr(t,e,i,r),wl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_n(),r=bi(e),i=$r(n,r);i.tag=2,t!=null&&(i.callback=t),t=_i(e,i,r),t!==null&&(dr(t,e,r,n),wl(t,e,r))}};function Ym(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!ra(n,r)||!ra(i,s):!0}function zb(e,t,n){var r=!1,i=ki,s=t.contextType;return typeof s=="object"&&s!==null?s=nr(s):(i=jn(t)?Zi:dn.current,r=t.contextTypes,s=(r=r!=null)?Vs(e,i):ki),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Lc,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Gm(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Lc.enqueueReplaceState(t,t.state,null)}function Qh(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Uf(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=nr(s):(s=jn(t)?Zi:dn.current,i.context=Vs(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Zh(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Lc.enqueueReplaceState(i,i.state,null),tc(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Gs(e,t){try{var n="",r=t;do n+=T0(r),r=r.return;while(r);var i=n}catch(s){i=`
39
39
  Error generating stack: `+s.message+`
40
- `+s.stack}return{value:e,source:t,stack:i,digest:null}}function Ru(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ed(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var rk=typeof WeakMap=="function"?WeakMap:Map;function Bb(e,t,n){n=$r(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){oc||(oc=!0,ud=r),ed(e,t)},n}function Fb(e,t,n){n=$r(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ed(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){ed(e,t),typeof r!="function"&&(vi===null?vi=new Set([this]):vi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Xm(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new rk;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=yk.bind(null,e,t,n),t.then(e,e))}function Jm(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Zm(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=$r(-1,1),t.tag=2,_i(n,t,1))),n.lanes|=1),e)}var ik=Kr.ReactCurrentOwner,En=!1;function gn(e,t,n,r){t.child=e===null?mb(t,null,n,r):Ks(t,e.child,n,r)}function Qm(e,t,n,r,i){n=n.render;var s=t.ref;return Bs(t,i),r=Gf(e,t,n,r,s,i),n=Xf(),e!==null&&!En?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,qr(e,t,i)):(dt&&n&&Of(t),t.flags|=1,gn(e,t,r,i),t.child)}function eg(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!op(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,$b(e,t,s,r,i)):(e=Nl(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:ra,n(o,r)&&e.ref===t.ref)return qr(e,t,i)}return t.flags|=1,e=wi(s,r),e.ref=t.ref,e.return=t,t.child=e}function $b(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(ra(s,r)&&e.ref===t.ref)if(En=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(En=!0);else return t.lanes=e.lanes,qr(e,t,i)}return td(e,t,n,r,i)}function Hb(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ot(Ps,In),In|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ot(Ps,In),In|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,ot(Ps,In),In|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,ot(Ps,In),In|=r;return gn(e,t,i,n),t.child}function Wb(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function td(e,t,n,r,i){var s=jn(n)?Zi:dn.current;return s=Vs(t,s),Bs(t,i),n=Gf(e,t,n,r,s,i),r=Xf(),e!==null&&!En?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,qr(e,t,i)):(dt&&r&&Of(t),t.flags|=1,gn(e,t,n,i),t.child)}function tg(e,t,n,r,i){if(jn(n)){var s=!0;Xl(t)}else s=!1;if(Bs(t,i),t.stateNode===null)kl(e,t),zb(t,n,r),Qh(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=nr(c):(c=jn(n)?Zi:dn.current,c=Vs(t,c));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&Gm(t,o,r,c),ai=!1;var f=t.memoizedState;o.state=f,tc(t,r,o,i),l=t.memoizedState,a!==r||f!==l||Nn.current||ai?(typeof d=="function"&&(Zh(t,n,d,r),l=t.memoizedState),(a=ai||Ym(t,n,a,r,f,l,c))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,yb(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:lr(t.type,a),o.props=c,h=t.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=nr(l):(l=jn(n)?Zi:dn.current,l=Vs(t,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||f!==l)&&Gm(t,o,r,l),ai=!1,f=t.memoizedState,o.state=f,tc(t,r,o,i);var m=t.memoizedState;a!==h||f!==m||Nn.current||ai?(typeof p=="function"&&(Zh(t,n,p,r),m=t.memoizedState),(c=ai||Ym(t,n,c,r,f,m,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return nd(e,t,n,r,s,i)}function nd(e,t,n,r,i,s){Wb(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Fm(t,n,!1),qr(e,t,s);r=t.stateNode,ik.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ks(t,e.child,null,s),t.child=Ks(t,null,a,s)):gn(e,t,a,s),t.memoizedState=r.state,i&&Fm(t,n,!0),t.child}function Ub(e){var t=e.stateNode;t.pendingContext?Bm(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Bm(e,t.context,!1),Vf(e,t.containerInfo)}function ng(e,t,n,r,i){return qs(),Bf(i),t.flags|=256,gn(e,t,n,r),t.child}var rd={dehydrated:null,treeContext:null,retryLane:0};function id(e){return{baseLanes:e,cachePool:null,transitions:null}}function Vb(e,t,n){var r=t.pendingProps,i=vt.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ot(vt,i&1),e===null)return Xh(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Mc(o,r,0,null),e=Gi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=id(n),t.memoizedState=rd,e):Qf(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return sk(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=wi(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=wi(a,s):(s=Gi(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?id(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=rd,r}return s=e.child,e=s.sibling,r=wi(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Qf(e,t){return t=Mc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function qa(e,t,n,r){return r!==null&&Bf(r),Ks(t,e.child,null,n),e=Qf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sk(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=Ru(Error(G(422))),qa(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=Mc({mode:"visible",children:r.children},i,0,null),s=Gi(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Ks(t,e.child,null,o),t.child.memoizedState=id(o),t.memoizedState=rd,s);if(!(t.mode&1))return qa(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(G(419)),r=Ru(s,r,void 0),qa(e,t,o,r)}if(a=(o&e.childLanes)!==0,En||a){if(r=Jt,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Vr(e,i),dr(r,e,i,-1))}return sp(),r=Ru(Error(G(421))),qa(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=_k.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,Mn=yi(i.nextSibling),On=t,dt=!0,ur=null,e!==null&&(Xn[Jn++]=zr,Xn[Jn++]=Br,Xn[Jn++]=Qi,zr=e.id,Br=e.overflow,Qi=t),t=Qf(t,r.children),t.flags|=4096,t)}function rg(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Jh(e.return,t,n)}function Tu(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function qb(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(gn(e,t,r.children,n),r=vt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rg(e,n,t);else if(e.tag===19)rg(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ot(vt,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&nc(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tu(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&nc(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tu(t,!0,n,null,s);break;case"together":Tu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function kl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function qr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ts|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(G(153));if(t.child!==null){for(e=t.child,n=wi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=wi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ok(e,t,n){switch(t.tag){case 3:Ub(t),qs();break;case 5:_b(t);break;case 1:jn(t.type)&&Xl(t);break;case 4:Vf(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ot(Ql,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ot(vt,vt.current&1),t.flags|=128,null):n&t.child.childLanes?Vb(e,t,n):(ot(vt,vt.current&1),e=qr(e,t,n),e!==null?e.sibling:null);ot(vt,vt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return qb(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ot(vt,vt.current),r)break;return null;case 22:case 23:return t.lanes=0,Hb(e,t,n)}return qr(e,t,n)}var Kb,sd,Yb,Gb;Kb=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};sd=function(){};Yb=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Vi(jr.current);var s=null;switch(n){case"input":i=Nh(e,i),r=Nh(e,r),s=[];break;case"select":i=wt({},i,{value:void 0}),r=wt({},r,{value:void 0}),s=[];break;case"textarea":i=Th(e,i),r=Th(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Yl)}Ph(n,r);var o;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Xo.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Xo.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ct("scroll",e),s||a===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};Gb=function(e,t,n,r){n!==r&&(t.flags|=4)};function po(e,t){if(!dt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function an(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ak(e,t,n){var r=t.pendingProps;switch(zf(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return an(t),null;case 1:return jn(t.type)&&Gl(),an(t),null;case 3:return r=t.stateNode,Ys(),ht(Nn),ht(dn),Kf(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ua(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ur!==null&&(fd(ur),ur=null))),sd(e,t),an(t),null;case 5:qf(t);var i=Vi(la.current);if(n=t.type,e!==null&&t.stateNode!=null)Yb(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(G(166));return an(t),null}if(e=Vi(jr.current),Ua(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Cr]=t,r[oa]=s,e=(t.mode&1)!==0,n){case"dialog":ct("cancel",r),ct("close",r);break;case"iframe":case"object":case"embed":ct("load",r);break;case"video":case"audio":for(i=0;i<Ro.length;i++)ct(Ro[i],r);break;case"source":ct("error",r);break;case"img":case"image":case"link":ct("error",r),ct("load",r);break;case"details":ct("toggle",r);break;case"input":dm(r,s),ct("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ct("invalid",r);break;case"textarea":pm(r,s),ct("invalid",r)}Ph(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Wa(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Wa(r.textContent,a,e),i=["children",""+a]):Xo.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ct("scroll",r)}switch(n){case"input":Ia(r),fm(r,s,!0);break;case"textarea":Ia(r),mm(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Yl)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=xv(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Cr]=t,e[oa]=r,Kb(e,t,!1,!1),t.stateNode=e;e:{switch(o=Lh(n,r),n){case"dialog":ct("cancel",e),ct("close",e),i=r;break;case"iframe":case"object":case"embed":ct("load",e),i=r;break;case"video":case"audio":for(i=0;i<Ro.length;i++)ct(Ro[i],e);i=r;break;case"source":ct("error",e),i=r;break;case"img":case"image":case"link":ct("error",e),ct("load",e),i=r;break;case"details":ct("toggle",e),i=r;break;case"input":dm(e,r),i=Nh(e,r),ct("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=wt({},r,{value:void 0}),ct("invalid",e);break;case"textarea":pm(e,r),i=Th(e,r),ct("invalid",e);break;default:i=r}Ph(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?Ev(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&kv(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Jo(e,l):typeof l=="number"&&Jo(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Xo.hasOwnProperty(s)?l!=null&&s==="onScroll"&&ct("scroll",e):l!=null&&xf(e,s,l,o))}switch(n){case"input":Ia(e),fm(e,r,!1);break;case"textarea":Ia(e),mm(e);break;case"option":r.value!=null&&e.setAttribute("value",""+xi(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Is(e,!!r.multiple,s,!1):r.defaultValue!=null&&Is(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Yl)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return an(t),null;case 6:if(e&&t.stateNode!=null)Gb(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(G(166));if(n=Vi(la.current),Vi(jr.current),Ua(t)){if(r=t.stateNode,n=t.memoizedProps,r[Cr]=t,(s=r.nodeValue!==n)&&(e=On,e!==null))switch(e.tag){case 3:Wa(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Wa(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Cr]=t,t.stateNode=r}return an(t),null;case 13:if(ht(vt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(dt&&Mn!==null&&t.mode&1&&!(t.flags&128))fb(),qs(),t.flags|=98560,s=!1;else if(s=Ua(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(G(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(G(317));s[Cr]=t}else qs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;an(t),s=!1}else ur!==null&&(fd(ur),ur=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||vt.current&1?Wt===0&&(Wt=3):sp())),t.updateQueue!==null&&(t.flags|=4),an(t),null);case 4:return Ys(),sd(e,t),e===null&&ia(t.stateNode.containerInfo),an(t),null;case 10:return Hf(t.type._context),an(t),null;case 17:return jn(t.type)&&Gl(),an(t),null;case 19:if(ht(vt),s=t.memoizedState,s===null)return an(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)po(s,!1);else{if(Wt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=nc(e),o!==null){for(t.flags|=128,po(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ot(vt,vt.current&1|2),t.child}e=e.sibling}s.tail!==null&&Tt()>Xs&&(t.flags|=128,r=!0,po(s,!1),t.lanes=4194304)}else{if(!r)if(e=nc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),po(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!dt)return an(t),null}else 2*Tt()-s.renderingStartTime>Xs&&n!==1073741824&&(t.flags|=128,r=!0,po(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Tt(),t.sibling=null,n=vt.current,ot(vt,r?n&1|2:n&1),t):(an(t),null);case 22:case 23:return ip(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?In&1073741824&&(an(t),t.subtreeFlags&6&&(t.flags|=8192)):an(t),null;case 24:return null;case 25:return null}throw Error(G(156,t.tag))}function lk(e,t){switch(zf(t),t.tag){case 1:return jn(t.type)&&Gl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ys(),ht(Nn),ht(dn),Kf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qf(t),null;case 13:if(ht(vt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ht(vt),null;case 4:return Ys(),null;case 10:return Hf(t.type._context),null;case 22:case 23:return ip(),null;case 24:return null;default:return null}}var Ka=!1,un=!1,ck=typeof WeakSet=="function"?WeakSet:Set,fe=null;function Ds(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){kt(e,t,r)}else n.current=null}function od(e,t,n){try{n()}catch(r){kt(e,t,r)}}var ig=!1;function uk(e,t){if(Wh=Vl,e=eb(),Mf(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,d=0,h=e,f=null;t:for(;;){for(var p;h!==n||i!==0&&h.nodeType!==3||(a=o+i),h!==s||r!==0&&h.nodeType!==3||(l=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(p=h.firstChild)!==null;)f=h,h=p;for(;;){if(h===e)break t;if(f===n&&++c===i&&(a=o),f===s&&++d===r&&(l=o),(p=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Uh={focusedElem:e,selectionRange:n},Vl=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,b=m.memoizedState,_=t.stateNode,v=_.getSnapshotBeforeUpdate(t.elementType===t.type?y:lr(t.type,y),b);_.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(G(163))}}catch(S){kt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return m=ig,ig=!1,m}function Ho(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&od(t,n,s)}i=i.next}while(i!==r)}}function Ac(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ad(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Xb(e){var t=e.alternate;t!==null&&(e.alternate=null,Xb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Cr],delete t[oa],delete t[Kh],delete t[q1],delete t[K1])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Jb(e){return e.tag===5||e.tag===3||e.tag===4}function sg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jb(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ld(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Yl));else if(r!==4&&(e=e.child,e!==null))for(ld(e,t,n),e=e.sibling;e!==null;)ld(e,t,n),e=e.sibling}function cd(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(cd(e,t,n),e=e.sibling;e!==null;)cd(e,t,n),e=e.sibling}var Qt=null,cr=!1;function Qr(e,t,n){for(n=n.child;n!==null;)Zb(e,t,n),n=n.sibling}function Zb(e,t,n){if(Nr&&typeof Nr.onCommitFiberUnmount=="function")try{Nr.onCommitFiberUnmount(Ec,n)}catch{}switch(n.tag){case 5:un||Ds(n,t);case 6:var r=Qt,i=cr;Qt=null,Qr(e,t,n),Qt=r,cr=i,Qt!==null&&(cr?(e=Qt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Qt.removeChild(n.stateNode));break;case 18:Qt!==null&&(cr?(e=Qt,n=n.stateNode,e.nodeType===8?xu(e.parentNode,n):e.nodeType===1&&xu(e,n),ta(e)):xu(Qt,n.stateNode));break;case 4:r=Qt,i=cr,Qt=n.stateNode.containerInfo,cr=!0,Qr(e,t,n),Qt=r,cr=i;break;case 0:case 11:case 14:case 15:if(!un&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&od(n,t,o),i=i.next}while(i!==r)}Qr(e,t,n);break;case 1:if(!un&&(Ds(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){kt(n,t,a)}Qr(e,t,n);break;case 21:Qr(e,t,n);break;case 22:n.mode&1?(un=(r=un)||n.memoizedState!==null,Qr(e,t,n),un=r):Qr(e,t,n);break;default:Qr(e,t,n)}}function og(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ck),t.forEach(function(r){var i=vk.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function sr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Qt=a.stateNode,cr=!1;break e;case 3:Qt=a.stateNode.containerInfo,cr=!0;break e;case 4:Qt=a.stateNode.containerInfo,cr=!0;break e}a=a.return}if(Qt===null)throw Error(G(160));Zb(s,o,i),Qt=null,cr=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){kt(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Qb(t,e),t=t.sibling}function Qb(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(sr(t,e),yr(e),r&4){try{Ho(3,e,e.return),Ac(3,e)}catch(y){kt(e,e.return,y)}try{Ho(5,e,e.return)}catch(y){kt(e,e.return,y)}}break;case 1:sr(t,e),yr(e),r&512&&n!==null&&Ds(n,n.return);break;case 5:if(sr(t,e),yr(e),r&512&&n!==null&&Ds(n,n.return),e.flags&32){var i=e.stateNode;try{Jo(i,"")}catch(y){kt(e,e.return,y)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&wv(i,s),Lh(a,o);var c=Lh(a,s);for(o=0;o<l.length;o+=2){var d=l[o],h=l[o+1];d==="style"?Ev(i,h):d==="dangerouslySetInnerHTML"?kv(i,h):d==="children"?Jo(i,h):xf(i,d,h,c)}switch(a){case"input":jh(i,s);break;case"textarea":Sv(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?Is(i,!!s.multiple,p,!1):f!==!!s.multiple&&(s.defaultValue!=null?Is(i,!!s.multiple,s.defaultValue,!0):Is(i,!!s.multiple,s.multiple?[]:"",!1))}i[oa]=s}catch(y){kt(e,e.return,y)}}break;case 6:if(sr(t,e),yr(e),r&4){if(e.stateNode===null)throw Error(G(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(y){kt(e,e.return,y)}}break;case 3:if(sr(t,e),yr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ta(t.containerInfo)}catch(y){kt(e,e.return,y)}break;case 4:sr(t,e),yr(e);break;case 13:sr(t,e),yr(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(np=Tt())),r&4&&og(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(un=(c=un)||d,sr(t,e),un=c):sr(t,e),yr(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(fe=e,d=e.child;d!==null;){for(h=fe=d;fe!==null;){switch(f=fe,p=f.child,f.tag){case 0:case 11:case 14:case 15:Ho(4,f,f.return);break;case 1:Ds(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(y){kt(r,n,y)}}break;case 5:Ds(f,f.return);break;case 22:if(f.memoizedState!==null){lg(h);continue}}p!==null?(p.return=f,fe=p):lg(h)}d=d.sibling}e:for(d=null,h=e;;){if(h.tag===5){if(d===null){d=h;try{i=h.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=h.stateNode,l=h.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Cv("display",o))}catch(y){kt(e,e.return,y)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(y){kt(e,e.return,y)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:sr(t,e),yr(e),r&4&&og(e);break;case 21:break;default:sr(t,e),yr(e)}}function yr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Jb(n)){var r=n;break e}n=n.return}throw Error(G(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Jo(i,""),r.flags&=-33);var s=sg(e);cd(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=sg(e);ld(e,a,o);break;default:throw Error(G(161))}}catch(l){kt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hk(e,t,n){fe=e,ew(e)}function ew(e,t,n){for(var r=(e.mode&1)!==0;fe!==null;){var i=fe,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Ka;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||un;a=Ka;var c=un;if(Ka=o,(un=l)&&!c)for(fe=i;fe!==null;)o=fe,l=o.child,o.tag===22&&o.memoizedState!==null?cg(i):l!==null?(l.return=o,fe=l):cg(i);for(;s!==null;)fe=s,ew(s),s=s.sibling;fe=i,Ka=a,un=c}ag(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,fe=s):ag(e)}}function ag(e){for(;fe!==null;){var t=fe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:un||Ac(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!un)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:lr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Vm(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Vm(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&ta(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(G(163))}un||t.flags&512&&ad(t)}catch(f){kt(t,t.return,f)}}if(t===e){fe=null;break}if(n=t.sibling,n!==null){n.return=t.return,fe=n;break}fe=t.return}}function lg(e){for(;fe!==null;){var t=fe;if(t===e){fe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,fe=n;break}fe=t.return}}function cg(e){for(;fe!==null;){var t=fe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ac(4,t)}catch(l){kt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){kt(t,i,l)}}var s=t.return;try{ad(t)}catch(l){kt(t,s,l)}break;case 5:var o=t.return;try{ad(t)}catch(l){kt(t,o,l)}}}catch(l){kt(t,t.return,l)}if(t===e){fe=null;break}var a=t.sibling;if(a!==null){a.return=t.return,fe=a;break}fe=t.return}}var dk=Math.ceil,sc=Kr.ReactCurrentDispatcher,ep=Kr.ReactCurrentOwner,er=Kr.ReactCurrentBatchConfig,Ye=0,Jt=null,Mt=null,nn=0,In=0,Ps=Ni(0),Wt=0,da=null,ts=0,Ic=0,tp=0,Wo=null,Cn=null,np=0,Xs=1/0,Ir=null,oc=!1,ud=null,vi=null,Ya=!1,di=null,ac=0,Uo=0,hd=null,Cl=-1,El=0;function _n(){return Ye&6?Tt():Cl!==-1?Cl:Cl=Tt()}function bi(e){return e.mode&1?Ye&2&&nn!==0?nn&-nn:G1.transition!==null?(El===0&&(El=zv()),El):(e=Ze,e!==0||(e=window.event,e=e===void 0?16:Vv(e.type)),e):1}function dr(e,t,n,r){if(50<Uo)throw Uo=0,hd=null,Error(G(185));ba(e,n,r),(!(Ye&2)||e!==Jt)&&(e===Jt&&(!(Ye&2)&&(Ic|=n),Wt===4&&ui(e,nn)),Rn(e,r),n===1&&Ye===0&&!(t.mode&1)&&(Xs=Tt()+500,Dc&&ji()))}function Rn(e,t){var n=e.callbackNode;G0(e,t);var r=Ul(e,e===Jt?nn:0);if(r===0)n!==null&&_m(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&_m(n),t===1)e.tag===0?Y1(ug.bind(null,e)):ub(ug.bind(null,e)),U1(function(){!(Ye&6)&&ji()}),n=null;else{switch(Bv(r)){case 1:n=jf;break;case 4:n=Mv;break;case 16:n=Wl;break;case 536870912:n=Ov;break;default:n=Wl}n=lw(n,tw.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function tw(e,t){if(Cl=-1,El=0,Ye&6)throw Error(G(327));var n=e.callbackNode;if(Fs()&&e.callbackNode!==n)return null;var r=Ul(e,e===Jt?nn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=lc(e,r);else{t=r;var i=Ye;Ye|=2;var s=rw();(Jt!==e||nn!==t)&&(Ir=null,Xs=Tt()+500,Yi(e,t));do try{mk();break}catch(a){nw(e,a)}while(!0);$f(),sc.current=s,Ye=i,Mt!==null?t=0:(Jt=null,nn=0,t=Wt)}if(t!==0){if(t===2&&(i=zh(e),i!==0&&(r=i,t=dd(e,i))),t===1)throw n=da,Yi(e,0),ui(e,r),Rn(e,Tt()),n;if(t===6)ui(e,r);else{if(i=e.current.alternate,!(r&30)&&!fk(i)&&(t=lc(e,r),t===2&&(s=zh(e),s!==0&&(r=s,t=dd(e,s))),t===1))throw n=da,Yi(e,0),ui(e,r),Rn(e,Tt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(G(345));case 2:zi(e,Cn,Ir);break;case 3:if(ui(e,r),(r&130023424)===r&&(t=np+500-Tt(),10<t)){if(Ul(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){_n(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=qh(zi.bind(null,e,Cn,Ir),t);break}zi(e,Cn,Ir);break;case 4:if(ui(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-hr(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=Tt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*dk(r/1960))-r,10<r){e.timeoutHandle=qh(zi.bind(null,e,Cn,Ir),r);break}zi(e,Cn,Ir);break;case 5:zi(e,Cn,Ir);break;default:throw Error(G(329))}}}return Rn(e,Tt()),e.callbackNode===n?tw.bind(null,e):null}function dd(e,t){var n=Wo;return e.current.memoizedState.isDehydrated&&(Yi(e,t).flags|=256),e=lc(e,t),e!==2&&(t=Cn,Cn=n,t!==null&&fd(t)),e}function fd(e){Cn===null?Cn=e:Cn.push.apply(Cn,e)}function fk(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!mr(s(),i))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 ui(e,t){for(t&=~tp,t&=~Ic,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-hr(t),r=1<<n;e[n]=-1,t&=~r}}function ug(e){if(Ye&6)throw Error(G(327));Fs();var t=Ul(e,0);if(!(t&1))return Rn(e,Tt()),null;var n=lc(e,t);if(e.tag!==0&&n===2){var r=zh(e);r!==0&&(t=r,n=dd(e,r))}if(n===1)throw n=da,Yi(e,0),ui(e,t),Rn(e,Tt()),n;if(n===6)throw Error(G(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,zi(e,Cn,Ir),Rn(e,Tt()),null}function rp(e,t){var n=Ye;Ye|=1;try{return e(t)}finally{Ye=n,Ye===0&&(Xs=Tt()+500,Dc&&ji())}}function ns(e){di!==null&&di.tag===0&&!(Ye&6)&&Fs();var t=Ye;Ye|=1;var n=er.transition,r=Ze;try{if(er.transition=null,Ze=1,e)return e()}finally{Ze=r,er.transition=n,Ye=t,!(Ye&6)&&ji()}}function ip(){In=Ps.current,ht(Ps)}function Yi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,W1(n)),Mt!==null)for(n=Mt.return;n!==null;){var r=n;switch(zf(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Gl();break;case 3:Ys(),ht(Nn),ht(dn),Kf();break;case 5:qf(r);break;case 4:Ys();break;case 13:ht(vt);break;case 19:ht(vt);break;case 10:Hf(r.type._context);break;case 22:case 23:ip()}n=n.return}if(Jt=e,Mt=e=wi(e.current,null),nn=In=t,Wt=0,da=null,tp=Ic=ts=0,Cn=Wo=null,Ui!==null){for(t=0;t<Ui.length;t++)if(n=Ui[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}Ui=null}return e}function nw(e,t){do{var n=Mt;try{if($f(),Sl.current=ic,rc){for(var r=bt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}rc=!1}if(es=0,Kt=Ht=bt=null,$o=!1,ca=0,ep.current=null,n===null||n.return===null){Wt=1,da=t,Mt=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=nn,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=Jm(o);if(p!==null){p.flags&=-257,Zm(p,o,a,s,t),p.mode&1&&Xm(s,c,t),t=p,l=c;var m=t.updateQueue;if(m===null){var y=new Set;y.add(l),t.updateQueue=y}else m.add(l);break e}else{if(!(t&1)){Xm(s,c,t),sp();break e}l=Error(G(426))}}else if(dt&&a.mode&1){var b=Jm(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Zm(b,o,a,s,t),Bf(Gs(l,a));break e}}s=l=Gs(l,a),Wt!==4&&(Wt=2),Wo===null?Wo=[s]:Wo.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var _=Bb(s,l,t);Um(s,_);break e;case 1:a=l;var v=s.type,g=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(vi===null||!vi.has(g)))){s.flags|=65536,t&=-t,s.lanes|=t;var S=Fb(s,a,t);Um(s,S);break e}}s=s.return}while(s!==null)}sw(n)}catch(C){t=C,Mt===n&&n!==null&&(Mt=n=n.return);continue}break}while(!0)}function rw(){var e=sc.current;return sc.current=ic,e===null?ic:e}function sp(){(Wt===0||Wt===3||Wt===2)&&(Wt=4),Jt===null||!(ts&268435455)&&!(Ic&268435455)||ui(Jt,nn)}function lc(e,t){var n=Ye;Ye|=2;var r=rw();(Jt!==e||nn!==t)&&(Ir=null,Yi(e,t));do try{pk();break}catch(i){nw(e,i)}while(!0);if($f(),Ye=n,sc.current=r,Mt!==null)throw Error(G(261));return Jt=null,nn=0,Wt}function pk(){for(;Mt!==null;)iw(Mt)}function mk(){for(;Mt!==null&&!F0();)iw(Mt)}function iw(e){var t=aw(e.alternate,e,In);e.memoizedProps=e.pendingProps,t===null?sw(e):Mt=t,ep.current=null}function sw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=lk(n,t),n!==null){n.flags&=32767,Mt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Wt=6,Mt=null;return}}else if(n=ak(n,t,In),n!==null){Mt=n;return}if(t=t.sibling,t!==null){Mt=t;return}Mt=t=e}while(t!==null);Wt===0&&(Wt=5)}function zi(e,t,n){var r=Ze,i=er.transition;try{er.transition=null,Ze=1,gk(e,t,n,r)}finally{er.transition=i,Ze=r}return null}function gk(e,t,n,r){do Fs();while(di!==null);if(Ye&6)throw Error(G(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(G(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(X0(e,s),e===Jt&&(Mt=Jt=null,nn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ya||(Ya=!0,lw(Wl,function(){return Fs(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=er.transition,er.transition=null;var o=Ze;Ze=1;var a=Ye;Ye|=4,ep.current=null,uk(e,n),Qb(n,e),M1(Uh),Vl=!!Wh,Uh=Wh=null,e.current=n,hk(n),$0(),Ye=a,Ze=o,er.transition=s}else e.current=n;if(Ya&&(Ya=!1,di=e,ac=i),s=e.pendingLanes,s===0&&(vi=null),U0(n.stateNode),Rn(e,Tt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(oc)throw oc=!1,e=ud,ud=null,e;return ac&1&&e.tag!==0&&Fs(),s=e.pendingLanes,s&1?e===hd?Uo++:(Uo=0,hd=e):Uo=0,ji(),null}function Fs(){if(di!==null){var e=Bv(ac),t=er.transition,n=Ze;try{if(er.transition=null,Ze=16>e?16:e,di===null)var r=!1;else{if(e=di,di=null,ac=0,Ye&6)throw Error(G(331));var i=Ye;for(Ye|=4,fe=e.current;fe!==null;){var s=fe,o=s.child;if(fe.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(fe=c;fe!==null;){var d=fe;switch(d.tag){case 0:case 11:case 15:Ho(8,d,s)}var h=d.child;if(h!==null)h.return=d,fe=h;else for(;fe!==null;){d=fe;var f=d.sibling,p=d.return;if(Xb(d),d===c){fe=null;break}if(f!==null){f.return=p,fe=f;break}fe=p}}}var m=s.alternate;if(m!==null){var y=m.child;if(y!==null){m.child=null;do{var b=y.sibling;y.sibling=null,y=b}while(y!==null)}}fe=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,fe=o;else e:for(;fe!==null;){if(s=fe,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Ho(9,s,s.return)}var _=s.sibling;if(_!==null){_.return=s.return,fe=_;break e}fe=s.return}}var v=e.current;for(fe=v;fe!==null;){o=fe;var g=o.child;if(o.subtreeFlags&2064&&g!==null)g.return=o,fe=g;else e:for(o=v;fe!==null;){if(a=fe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Ac(9,a)}}catch(C){kt(a,a.return,C)}if(a===o){fe=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,fe=S;break e}fe=a.return}}if(Ye=i,ji(),Nr&&typeof Nr.onPostCommitFiberRoot=="function")try{Nr.onPostCommitFiberRoot(Ec,e)}catch{}r=!0}return r}finally{Ze=n,er.transition=t}}return!1}function hg(e,t,n){t=Gs(n,t),t=Bb(e,t,1),e=_i(e,t,1),t=_n(),e!==null&&(ba(e,1,t),Rn(e,t))}function kt(e,t,n){if(e.tag===3)hg(e,e,n);else for(;t!==null;){if(t.tag===3){hg(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(vi===null||!vi.has(r))){e=Gs(n,e),e=Fb(t,e,1),t=_i(t,e,1),e=_n(),t!==null&&(ba(t,1,e),Rn(t,e));break}}t=t.return}}function yk(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=_n(),e.pingedLanes|=e.suspendedLanes&n,Jt===e&&(nn&n)===n&&(Wt===4||Wt===3&&(nn&130023424)===nn&&500>Tt()-np?Yi(e,0):tp|=n),Rn(e,t)}function ow(e,t){t===0&&(e.mode&1?(t=za,za<<=1,!(za&130023424)&&(za=4194304)):t=1);var n=_n();e=Vr(e,t),e!==null&&(ba(e,t,n),Rn(e,n))}function _k(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ow(e,n)}function vk(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(G(314))}r!==null&&r.delete(t),ow(e,n)}var aw;aw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Nn.current)En=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return En=!1,ok(e,t,n);En=!!(e.flags&131072)}else En=!1,dt&&t.flags&1048576&&hb(t,Zl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;kl(e,t),e=t.pendingProps;var i=Vs(t,dn.current);Bs(t,n),i=Gf(null,t,r,e,i,n);var s=Xf();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,jn(r)?(s=!0,Xl(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Uf(t),i.updater=Lc,t.stateNode=i,i._reactInternals=t,Qh(t,r,e,n),t=nd(null,t,r,!0,s,n)):(t.tag=0,dt&&s&&Of(t),gn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(kl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=wk(r),e=lr(r,e),i){case 0:t=td(null,t,r,e,n);break e;case 1:t=tg(null,t,r,e,n);break e;case 11:t=Qm(null,t,r,e,n);break e;case 14:t=eg(null,t,r,lr(r.type,e),n);break e}throw Error(G(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:lr(r,i),td(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:lr(r,i),tg(e,t,r,i,n);case 3:e:{if(Ub(t),e===null)throw Error(G(387));r=t.pendingProps,s=t.memoizedState,i=s.element,yb(e,t),tc(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=Gs(Error(G(423)),t),t=ng(e,t,r,n,i);break e}else if(r!==i){i=Gs(Error(G(424)),t),t=ng(e,t,r,n,i);break e}else for(Mn=yi(t.stateNode.containerInfo.firstChild),On=t,dt=!0,ur=null,n=mb(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(qs(),r===i){t=qr(e,t,n);break e}gn(e,t,r,n)}t=t.child}return t;case 5:return _b(t),e===null&&Xh(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Vh(r,i)?o=null:s!==null&&Vh(r,s)&&(t.flags|=32),Wb(e,t),gn(e,t,o,n),t.child;case 6:return e===null&&Xh(t),null;case 13:return Vb(e,t,n);case 4:return Vf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ks(t,null,r,n):gn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:lr(r,i),Qm(e,t,r,i,n);case 7:return gn(e,t,t.pendingProps,n),t.child;case 8:return gn(e,t,t.pendingProps.children,n),t.child;case 12:return gn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,ot(Ql,r._currentValue),r._currentValue=o,s!==null)if(mr(s.value,o)){if(s.children===i.children&&!Nn.current){t=qr(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=$r(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Jh(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(G(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Jh(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}gn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Bs(t,n),i=nr(i),r=r(i),t.flags|=1,gn(e,t,r,n),t.child;case 14:return r=t.type,i=lr(r,t.pendingProps),i=lr(r.type,i),eg(e,t,r,i,n);case 15:return $b(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:lr(r,i),kl(e,t),t.tag=1,jn(r)?(e=!0,Xl(t)):e=!1,Bs(t,n),zb(t,r,i),Qh(t,r,i,n),nd(null,t,r,!0,e,n);case 19:return qb(e,t,n);case 22:return Hb(e,t,n)}throw Error(G(156,t.tag))};function lw(e,t){return Iv(e,t)}function bk(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(e,t,n,r){return new bk(e,t,n,r)}function op(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wk(e){if(typeof e=="function")return op(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Cf)return 11;if(e===Ef)return 14}return 2}function wi(e,t){var n=e.alternate;return n===null?(n=Qn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Nl(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")op(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ss:return Gi(n.children,i,s,t);case kf:o=8,i|=8;break;case xh:return e=Qn(12,n,t,i|2),e.elementType=xh,e.lanes=s,e;case kh:return e=Qn(13,n,t,i),e.elementType=kh,e.lanes=s,e;case Ch:return e=Qn(19,n,t,i),e.elementType=Ch,e.lanes=s,e;case _v:return Mc(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case gv:o=10;break e;case yv:o=9;break e;case Cf:o=11;break e;case Ef:o=14;break e;case oi:o=16,r=null;break e}throw Error(G(130,e==null?e:typeof e,""))}return t=Qn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Gi(e,t,n,r){return e=Qn(7,e,r,t),e.lanes=n,e}function Mc(e,t,n,r){return e=Qn(22,e,r,t),e.elementType=_v,e.lanes=n,e.stateNode={isHidden:!1},e}function Du(e,t,n){return e=Qn(6,e,null,t),e.lanes=n,e}function Pu(e,t,n){return t=Qn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Sk(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=du(0),this.expirationTimes=du(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=du(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function ap(e,t,n,r,i,s,o,a,l){return e=new Sk(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Qn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Uf(s),e}function xk(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ws,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function cw(e){if(!e)return ki;e=e._reactInternals;e:{if(cs(e)!==e||e.tag!==1)throw Error(G(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(jn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(G(171))}if(e.tag===1){var n=e.type;if(jn(n))return cb(e,n,t)}return t}function uw(e,t,n,r,i,s,o,a,l){return e=ap(n,r,!0,e,i,s,o,a,l),e.context=cw(null),n=e.current,r=_n(),i=bi(n),s=$r(r,i),s.callback=t??null,_i(n,s,i),e.current.lanes=i,ba(e,i,r),Rn(e,r),e}function Oc(e,t,n,r){var i=t.current,s=_n(),o=bi(i);return n=cw(n),t.context===null?t.context=n:t.pendingContext=n,t=$r(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=_i(i,t,o),e!==null&&(dr(e,i,o,s),wl(e,i,o)),o}function cc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function dg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function lp(e,t){dg(e,t),(e=e.alternate)&&dg(e,t)}function kk(){return null}var hw=typeof reportError=="function"?reportError:function(e){console.error(e)};function cp(e){this._internalRoot=e}zc.prototype.render=cp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));Oc(e,t,null,null)};zc.prototype.unmount=cp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ns(function(){Oc(null,e,null,null)}),t[Ur]=null}};function zc(e){this._internalRoot=e}zc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Hv();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ci.length&&t!==0&&t<ci[n].priority;n++);ci.splice(n,0,e),n===0&&Uv(e)}};function up(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Bc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function fg(){}function Ck(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=cc(o);s.call(c)}}var o=uw(t,r,e,0,null,!1,!1,"",fg);return e._reactRootContainer=o,e[Ur]=o.current,ia(e.nodeType===8?e.parentNode:e),ns(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=cc(l);a.call(c)}}var l=ap(e,0,!1,null,null,!1,!1,"",fg);return e._reactRootContainer=l,e[Ur]=l.current,ia(e.nodeType===8?e.parentNode:e),ns(function(){Oc(t,l,n,r)}),l}function Fc(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=cc(o);a.call(l)}}Oc(t,o,e,i)}else o=Ck(n,t,e,i,r);return cc(o)}Fv=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=jo(t.pendingLanes);n!==0&&(Rf(t,n|1),Rn(t,Tt()),!(Ye&6)&&(Xs=Tt()+500,ji()))}break;case 13:ns(function(){var r=Vr(e,1);if(r!==null){var i=_n();dr(r,e,1,i)}}),lp(e,1)}};Tf=function(e){if(e.tag===13){var t=Vr(e,134217728);if(t!==null){var n=_n();dr(t,e,134217728,n)}lp(e,134217728)}};$v=function(e){if(e.tag===13){var t=bi(e),n=Vr(e,t);if(n!==null){var r=_n();dr(n,e,t,r)}lp(e,t)}};Hv=function(){return Ze};Wv=function(e,t){var n=Ze;try{return Ze=e,t()}finally{Ze=n}};Ih=function(e,t,n){switch(t){case"input":if(jh(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=Tc(r);if(!i)throw Error(G(90));bv(r),jh(r,i)}}}break;case"textarea":Sv(e,n);break;case"select":t=n.value,t!=null&&Is(e,!!n.multiple,t,!1)}};Rv=rp;Tv=ns;var Ek={usingClientEntryPoint:!1,Events:[Sa,Es,Tc,Nv,jv,rp]},mo={findFiberByHostInstance:Wi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Nk={bundleType:mo.bundleType,version:mo.version,rendererPackageName:mo.rendererPackageName,rendererConfig:mo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Kr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Lv(e),e===null?null:e.stateNode},findFiberByHostInstance:mo.findFiberByHostInstance||kk,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ga=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ga.isDisabled&&Ga.supportsFiber)try{Ec=Ga.inject(Nk),Nr=Ga}catch{}}Fn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ek;Fn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!up(t))throw Error(G(200));return xk(e,t,null,n)};Fn.createRoot=function(e,t){if(!up(e))throw Error(G(299));var n=!1,r="",i=hw;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=ap(e,1,!1,null,null,n,!1,r,i),e[Ur]=t.current,ia(e.nodeType===8?e.parentNode:e),new cp(t)};Fn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(G(188)):(e=Object.keys(e).join(","),Error(G(268,e)));return e=Lv(t),e=e===null?null:e.stateNode,e};Fn.flushSync=function(e){return ns(e)};Fn.hydrate=function(e,t,n){if(!Bc(t))throw Error(G(200));return Fc(null,e,t,!0,n)};Fn.hydrateRoot=function(e,t,n){if(!up(e))throw Error(G(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=hw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=uw(t,null,e,1,n??null,i,!1,s,o),e[Ur]=t.current,ia(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new zc(t)};Fn.render=function(e,t,n){if(!Bc(t))throw Error(G(200));return Fc(null,e,t,!1,n)};Fn.unmountComponentAtNode=function(e){if(!Bc(e))throw Error(G(40));return e._reactRootContainer?(ns(function(){Fc(null,null,e,!1,function(){e._reactRootContainer=null,e[Ur]=null})}),!0):!1};Fn.unstable_batchedUpdates=rp;Fn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Bc(n))throw Error(G(200));if(e==null||e._reactInternals===void 0)throw Error(G(38));return Fc(e,t,n,!1,r)};Fn.version="18.3.1-next-f1338f8080-20240426";function dw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dw)}catch(e){console.error(e)}}dw(),dv.exports=Fn;var fw=dv.exports;const pw=_a(fw);var pg=fw;wh.createRoot=pg.createRoot,wh.hydrateRoot=pg.hydrateRoot;function jk(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Rk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Tk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dk={};function mg(e,t){return(Dk.jsx?Tk:Rk).test(e)}const Pk=/[ \t\n\f\r]/g;function Lk(e){return typeof e=="object"?e.type==="text"?gg(e.value):!1:gg(e)}function gg(e){return e.replace(Pk,"")===""}class ka{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ka.prototype.normal={};ka.prototype.property={};ka.prototype.space=void 0;function mw(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ka(n,r,t)}function pd(e){return e.toLowerCase()}class Tn{constructor(t,n){this.attribute=n,this.property=t}}Tn.prototype.attribute="";Tn.prototype.booleanish=!1;Tn.prototype.boolean=!1;Tn.prototype.commaOrSpaceSeparated=!1;Tn.prototype.commaSeparated=!1;Tn.prototype.defined=!1;Tn.prototype.mustUseProperty=!1;Tn.prototype.number=!1;Tn.prototype.overloadedBoolean=!1;Tn.prototype.property="";Tn.prototype.spaceSeparated=!1;Tn.prototype.space=void 0;let Ak=0;const Ie=us(),Lt=us(),md=us(),Z=us(),st=us(),$s=us(),An=us();function us(){return 2**++Ak}const gd=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Lt,commaOrSpaceSeparated:An,commaSeparated:$s,number:Z,overloadedBoolean:md,spaceSeparated:st},Symbol.toStringTag,{value:"Module"})),Lu=Object.keys(gd);class hp extends Tn{constructor(t,n,r,i){let s=-1;if(super(t,n),yg(this,"space",i),typeof r=="number")for(;++s<Lu.length;){const o=Lu[s];yg(this,Lu[s],(r&gd[o])===gd[o])}}}hp.prototype.defined=!0;function yg(e,t,n){n&&(e[t]=n)}function no(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new hp(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[pd(r)]=r,n[pd(s.attribute)]=r}return new ka(t,n,e.space)}const gw=no({properties:{ariaActiveDescendant:null,ariaAtomic:Lt,ariaAutoComplete:null,ariaBusy:Lt,ariaChecked:Lt,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:st,ariaCurrent:null,ariaDescribedBy:st,ariaDetails:null,ariaDisabled:Lt,ariaDropEffect:st,ariaErrorMessage:null,ariaExpanded:Lt,ariaFlowTo:st,ariaGrabbed:Lt,ariaHasPopup:null,ariaHidden:Lt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:st,ariaLevel:Z,ariaLive:null,ariaModal:Lt,ariaMultiLine:Lt,ariaMultiSelectable:Lt,ariaOrientation:null,ariaOwns:st,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:Lt,ariaReadOnly:Lt,ariaRelevant:null,ariaRequired:Lt,ariaRoleDescription:st,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:Lt,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function yw(e,t){return t in e?e[t]:t}function _w(e,t){return yw(e,t.toLowerCase())}const Ik=no({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$s,acceptCharset:st,accessKey:st,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:st,autoFocus:Ie,autoPlay:Ie,blocking:st,capture:null,charSet:null,checked:Ie,cite:null,className:st,cols:Z,colSpan:null,content:null,contentEditable:Lt,controls:Ie,controlsList:st,coords:Z|$s,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:md,draggable:Lt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:st,height:Z,hidden:md,high:Z,href:null,hrefLang:null,htmlFor:st,httpEquiv:st,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:st,itemRef:st,itemScope:Ie,itemType:st,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ie,optimum:Z,pattern:null,ping:st,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:st,required:Ie,reversed:Ie,rows:Z,rowSpan:Z,sandbox:st,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:Lt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Lt,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:st,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:Lt,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ie,disableRemotePlayback:Ie,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:_w}),Mk=no({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:An,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:st,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:$s,g2:$s,glyphName:$s,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:An,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:st,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:An,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:An,rev:An,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:An,requiredFeatures:An,requiredFonts:An,requiredFormats:An,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:An,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:An,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:An,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:yw}),vw=no({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),bw=no({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_w}),ww=no({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Ok={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},zk=/[A-Z]/g,_g=/-[a-z]/g,Bk=/^data[-\w.:]+$/i;function Fk(e,t){const n=pd(t);let r=t,i=Tn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Bk.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(_g,Hk);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!_g.test(s)){let o=s.replace(zk,$k);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=hp}return new i(r,t)}function $k(e){return"-"+e.toLowerCase()}function Hk(e){return e.charAt(1).toUpperCase()}const Wk=mw([gw,Ik,vw,bw,ww],"html"),dp=mw([gw,Mk,vw,bw,ww],"svg");function Uk(e){return e.join(" ").trim()}var fp={},vg=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Vk=/\n/g,qk=/^\s*/,Kk=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Yk=/^:\s*/,Gk=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Xk=/^[;\s]*/,Jk=/^\s+|\s+$/g,Zk=`
40
+ `+s.stack}return{value:e,source:t,stack:i,digest:null}}function Ru(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ed(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var rk=typeof WeakMap=="function"?WeakMap:Map;function Bb(e,t,n){n=$r(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){oc||(oc=!0,ud=r),ed(e,t)},n}function Fb(e,t,n){n=$r(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ed(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){ed(e,t),typeof r!="function"&&(vi===null?vi=new Set([this]):vi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Xm(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new rk;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=yk.bind(null,e,t,n),t.then(e,e))}function Jm(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Zm(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=$r(-1,1),t.tag=2,_i(n,t,1))),n.lanes|=1),e)}var ik=Kr.ReactCurrentOwner,En=!1;function gn(e,t,n,r){t.child=e===null?mb(t,null,n,r):Ks(t,e.child,n,r)}function Qm(e,t,n,r,i){n=n.render;var s=t.ref;return Bs(t,i),r=Gf(e,t,n,r,s,i),n=Xf(),e!==null&&!En?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,qr(e,t,i)):(dt&&n&&Of(t),t.flags|=1,gn(e,t,r,i),t.child)}function eg(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!op(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,$b(e,t,s,r,i)):(e=Nl(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:ra,n(o,r)&&e.ref===t.ref)return qr(e,t,i)}return t.flags|=1,e=wi(s,r),e.ref=t.ref,e.return=t,t.child=e}function $b(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(ra(s,r)&&e.ref===t.ref)if(En=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(En=!0);else return t.lanes=e.lanes,qr(e,t,i)}return td(e,t,n,r,i)}function Hb(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ot(Ps,In),In|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ot(Ps,In),In|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,ot(Ps,In),In|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,ot(Ps,In),In|=r;return gn(e,t,i,n),t.child}function Wb(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function td(e,t,n,r,i){var s=jn(n)?Zi:dn.current;return s=Vs(t,s),Bs(t,i),n=Gf(e,t,n,r,s,i),r=Xf(),e!==null&&!En?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,qr(e,t,i)):(dt&&r&&Of(t),t.flags|=1,gn(e,t,n,i),t.child)}function tg(e,t,n,r,i){if(jn(n)){var s=!0;Xl(t)}else s=!1;if(Bs(t,i),t.stateNode===null)kl(e,t),zb(t,n,r),Qh(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=nr(c):(c=jn(n)?Zi:dn.current,c=Vs(t,c));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&Gm(t,o,r,c),ai=!1;var f=t.memoizedState;o.state=f,tc(t,r,o,i),l=t.memoizedState,a!==r||f!==l||Nn.current||ai?(typeof d=="function"&&(Zh(t,n,d,r),l=t.memoizedState),(a=ai||Ym(t,n,a,r,f,l,c))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,yb(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:lr(t.type,a),o.props=c,h=t.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=nr(l):(l=jn(n)?Zi:dn.current,l=Vs(t,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||f!==l)&&Gm(t,o,r,l),ai=!1,f=t.memoizedState,o.state=f,tc(t,r,o,i);var m=t.memoizedState;a!==h||f!==m||Nn.current||ai?(typeof p=="function"&&(Zh(t,n,p,r),m=t.memoizedState),(c=ai||Ym(t,n,c,r,f,m,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return nd(e,t,n,r,s,i)}function nd(e,t,n,r,i,s){Wb(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Fm(t,n,!1),qr(e,t,s);r=t.stateNode,ik.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ks(t,e.child,null,s),t.child=Ks(t,null,a,s)):gn(e,t,a,s),t.memoizedState=r.state,i&&Fm(t,n,!0),t.child}function Ub(e){var t=e.stateNode;t.pendingContext?Bm(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Bm(e,t.context,!1),Vf(e,t.containerInfo)}function ng(e,t,n,r,i){return qs(),Bf(i),t.flags|=256,gn(e,t,n,r),t.child}var rd={dehydrated:null,treeContext:null,retryLane:0};function id(e){return{baseLanes:e,cachePool:null,transitions:null}}function Vb(e,t,n){var r=t.pendingProps,i=vt.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ot(vt,i&1),e===null)return Xh(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Mc(o,r,0,null),e=Gi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=id(n),t.memoizedState=rd,e):Qf(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return sk(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=wi(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=wi(a,s):(s=Gi(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?id(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=rd,r}return s=e.child,e=s.sibling,r=wi(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Qf(e,t){return t=Mc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function qa(e,t,n,r){return r!==null&&Bf(r),Ks(t,e.child,null,n),e=Qf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sk(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=Ru(Error(X(422))),qa(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=Mc({mode:"visible",children:r.children},i,0,null),s=Gi(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Ks(t,e.child,null,o),t.child.memoizedState=id(o),t.memoizedState=rd,s);if(!(t.mode&1))return qa(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(X(419)),r=Ru(s,r,void 0),qa(e,t,o,r)}if(a=(o&e.childLanes)!==0,En||a){if(r=Jt,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Vr(e,i),dr(r,e,i,-1))}return sp(),r=Ru(Error(X(421))),qa(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=_k.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,Mn=yi(i.nextSibling),On=t,dt=!0,ur=null,e!==null&&(Xn[Jn++]=zr,Xn[Jn++]=Br,Xn[Jn++]=Qi,zr=e.id,Br=e.overflow,Qi=t),t=Qf(t,r.children),t.flags|=4096,t)}function rg(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Jh(e.return,t,n)}function Tu(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function qb(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(gn(e,t,r.children,n),r=vt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rg(e,n,t);else if(e.tag===19)rg(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ot(vt,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&nc(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tu(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&nc(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tu(t,!0,n,null,s);break;case"together":Tu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function kl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function qr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ts|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(X(153));if(t.child!==null){for(e=t.child,n=wi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=wi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ok(e,t,n){switch(t.tag){case 3:Ub(t),qs();break;case 5:_b(t);break;case 1:jn(t.type)&&Xl(t);break;case 4:Vf(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ot(Ql,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ot(vt,vt.current&1),t.flags|=128,null):n&t.child.childLanes?Vb(e,t,n):(ot(vt,vt.current&1),e=qr(e,t,n),e!==null?e.sibling:null);ot(vt,vt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return qb(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ot(vt,vt.current),r)break;return null;case 22:case 23:return t.lanes=0,Hb(e,t,n)}return qr(e,t,n)}var Kb,sd,Yb,Gb;Kb=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};sd=function(){};Yb=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Vi(jr.current);var s=null;switch(n){case"input":i=Nh(e,i),r=Nh(e,r),s=[];break;case"select":i=wt({},i,{value:void 0}),r=wt({},r,{value:void 0}),s=[];break;case"textarea":i=Th(e,i),r=Th(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Yl)}Ph(n,r);var o;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Xo.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Xo.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ct("scroll",e),s||a===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};Gb=function(e,t,n,r){n!==r&&(t.flags|=4)};function po(e,t){if(!dt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function an(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ak(e,t,n){var r=t.pendingProps;switch(zf(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return an(t),null;case 1:return jn(t.type)&&Gl(),an(t),null;case 3:return r=t.stateNode,Ys(),ht(Nn),ht(dn),Kf(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ua(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ur!==null&&(fd(ur),ur=null))),sd(e,t),an(t),null;case 5:qf(t);var i=Vi(la.current);if(n=t.type,e!==null&&t.stateNode!=null)Yb(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(X(166));return an(t),null}if(e=Vi(jr.current),Ua(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Cr]=t,r[oa]=s,e=(t.mode&1)!==0,n){case"dialog":ct("cancel",r),ct("close",r);break;case"iframe":case"object":case"embed":ct("load",r);break;case"video":case"audio":for(i=0;i<Ro.length;i++)ct(Ro[i],r);break;case"source":ct("error",r);break;case"img":case"image":case"link":ct("error",r),ct("load",r);break;case"details":ct("toggle",r);break;case"input":dm(r,s),ct("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ct("invalid",r);break;case"textarea":pm(r,s),ct("invalid",r)}Ph(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Wa(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Wa(r.textContent,a,e),i=["children",""+a]):Xo.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ct("scroll",r)}switch(n){case"input":Ia(r),fm(r,s,!0);break;case"textarea":Ia(r),mm(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Yl)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=xv(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Cr]=t,e[oa]=r,Kb(e,t,!1,!1),t.stateNode=e;e:{switch(o=Lh(n,r),n){case"dialog":ct("cancel",e),ct("close",e),i=r;break;case"iframe":case"object":case"embed":ct("load",e),i=r;break;case"video":case"audio":for(i=0;i<Ro.length;i++)ct(Ro[i],e);i=r;break;case"source":ct("error",e),i=r;break;case"img":case"image":case"link":ct("error",e),ct("load",e),i=r;break;case"details":ct("toggle",e),i=r;break;case"input":dm(e,r),i=Nh(e,r),ct("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=wt({},r,{value:void 0}),ct("invalid",e);break;case"textarea":pm(e,r),i=Th(e,r),ct("invalid",e);break;default:i=r}Ph(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?Ev(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&kv(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Jo(e,l):typeof l=="number"&&Jo(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Xo.hasOwnProperty(s)?l!=null&&s==="onScroll"&&ct("scroll",e):l!=null&&xf(e,s,l,o))}switch(n){case"input":Ia(e),fm(e,r,!1);break;case"textarea":Ia(e),mm(e);break;case"option":r.value!=null&&e.setAttribute("value",""+xi(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Is(e,!!r.multiple,s,!1):r.defaultValue!=null&&Is(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Yl)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return an(t),null;case 6:if(e&&t.stateNode!=null)Gb(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(X(166));if(n=Vi(la.current),Vi(jr.current),Ua(t)){if(r=t.stateNode,n=t.memoizedProps,r[Cr]=t,(s=r.nodeValue!==n)&&(e=On,e!==null))switch(e.tag){case 3:Wa(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Wa(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Cr]=t,t.stateNode=r}return an(t),null;case 13:if(ht(vt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(dt&&Mn!==null&&t.mode&1&&!(t.flags&128))fb(),qs(),t.flags|=98560,s=!1;else if(s=Ua(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(X(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(X(317));s[Cr]=t}else qs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;an(t),s=!1}else ur!==null&&(fd(ur),ur=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||vt.current&1?Wt===0&&(Wt=3):sp())),t.updateQueue!==null&&(t.flags|=4),an(t),null);case 4:return Ys(),sd(e,t),e===null&&ia(t.stateNode.containerInfo),an(t),null;case 10:return Hf(t.type._context),an(t),null;case 17:return jn(t.type)&&Gl(),an(t),null;case 19:if(ht(vt),s=t.memoizedState,s===null)return an(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)po(s,!1);else{if(Wt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=nc(e),o!==null){for(t.flags|=128,po(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ot(vt,vt.current&1|2),t.child}e=e.sibling}s.tail!==null&&Tt()>Xs&&(t.flags|=128,r=!0,po(s,!1),t.lanes=4194304)}else{if(!r)if(e=nc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),po(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!dt)return an(t),null}else 2*Tt()-s.renderingStartTime>Xs&&n!==1073741824&&(t.flags|=128,r=!0,po(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Tt(),t.sibling=null,n=vt.current,ot(vt,r?n&1|2:n&1),t):(an(t),null);case 22:case 23:return ip(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?In&1073741824&&(an(t),t.subtreeFlags&6&&(t.flags|=8192)):an(t),null;case 24:return null;case 25:return null}throw Error(X(156,t.tag))}function lk(e,t){switch(zf(t),t.tag){case 1:return jn(t.type)&&Gl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ys(),ht(Nn),ht(dn),Kf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qf(t),null;case 13:if(ht(vt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(X(340));qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ht(vt),null;case 4:return Ys(),null;case 10:return Hf(t.type._context),null;case 22:case 23:return ip(),null;case 24:return null;default:return null}}var Ka=!1,un=!1,ck=typeof WeakSet=="function"?WeakSet:Set,fe=null;function Ds(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){kt(e,t,r)}else n.current=null}function od(e,t,n){try{n()}catch(r){kt(e,t,r)}}var ig=!1;function uk(e,t){if(Wh=Vl,e=eb(),Mf(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,d=0,h=e,f=null;t:for(;;){for(var p;h!==n||i!==0&&h.nodeType!==3||(a=o+i),h!==s||r!==0&&h.nodeType!==3||(l=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(p=h.firstChild)!==null;)f=h,h=p;for(;;){if(h===e)break t;if(f===n&&++c===i&&(a=o),f===s&&++d===r&&(l=o),(p=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Uh={focusedElem:e,selectionRange:n},Vl=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,b=m.memoizedState,_=t.stateNode,v=_.getSnapshotBeforeUpdate(t.elementType===t.type?y:lr(t.type,y),b);_.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(X(163))}}catch(S){kt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return m=ig,ig=!1,m}function Ho(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&od(t,n,s)}i=i.next}while(i!==r)}}function Ac(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ad(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Xb(e){var t=e.alternate;t!==null&&(e.alternate=null,Xb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Cr],delete t[oa],delete t[Kh],delete t[q1],delete t[K1])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Jb(e){return e.tag===5||e.tag===3||e.tag===4}function sg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jb(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ld(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Yl));else if(r!==4&&(e=e.child,e!==null))for(ld(e,t,n),e=e.sibling;e!==null;)ld(e,t,n),e=e.sibling}function cd(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(cd(e,t,n),e=e.sibling;e!==null;)cd(e,t,n),e=e.sibling}var Qt=null,cr=!1;function Qr(e,t,n){for(n=n.child;n!==null;)Zb(e,t,n),n=n.sibling}function Zb(e,t,n){if(Nr&&typeof Nr.onCommitFiberUnmount=="function")try{Nr.onCommitFiberUnmount(Ec,n)}catch{}switch(n.tag){case 5:un||Ds(n,t);case 6:var r=Qt,i=cr;Qt=null,Qr(e,t,n),Qt=r,cr=i,Qt!==null&&(cr?(e=Qt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Qt.removeChild(n.stateNode));break;case 18:Qt!==null&&(cr?(e=Qt,n=n.stateNode,e.nodeType===8?xu(e.parentNode,n):e.nodeType===1&&xu(e,n),ta(e)):xu(Qt,n.stateNode));break;case 4:r=Qt,i=cr,Qt=n.stateNode.containerInfo,cr=!0,Qr(e,t,n),Qt=r,cr=i;break;case 0:case 11:case 14:case 15:if(!un&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&od(n,t,o),i=i.next}while(i!==r)}Qr(e,t,n);break;case 1:if(!un&&(Ds(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){kt(n,t,a)}Qr(e,t,n);break;case 21:Qr(e,t,n);break;case 22:n.mode&1?(un=(r=un)||n.memoizedState!==null,Qr(e,t,n),un=r):Qr(e,t,n);break;default:Qr(e,t,n)}}function og(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ck),t.forEach(function(r){var i=vk.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function sr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Qt=a.stateNode,cr=!1;break e;case 3:Qt=a.stateNode.containerInfo,cr=!0;break e;case 4:Qt=a.stateNode.containerInfo,cr=!0;break e}a=a.return}if(Qt===null)throw Error(X(160));Zb(s,o,i),Qt=null,cr=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){kt(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Qb(t,e),t=t.sibling}function Qb(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(sr(t,e),yr(e),r&4){try{Ho(3,e,e.return),Ac(3,e)}catch(y){kt(e,e.return,y)}try{Ho(5,e,e.return)}catch(y){kt(e,e.return,y)}}break;case 1:sr(t,e),yr(e),r&512&&n!==null&&Ds(n,n.return);break;case 5:if(sr(t,e),yr(e),r&512&&n!==null&&Ds(n,n.return),e.flags&32){var i=e.stateNode;try{Jo(i,"")}catch(y){kt(e,e.return,y)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&wv(i,s),Lh(a,o);var c=Lh(a,s);for(o=0;o<l.length;o+=2){var d=l[o],h=l[o+1];d==="style"?Ev(i,h):d==="dangerouslySetInnerHTML"?kv(i,h):d==="children"?Jo(i,h):xf(i,d,h,c)}switch(a){case"input":jh(i,s);break;case"textarea":Sv(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?Is(i,!!s.multiple,p,!1):f!==!!s.multiple&&(s.defaultValue!=null?Is(i,!!s.multiple,s.defaultValue,!0):Is(i,!!s.multiple,s.multiple?[]:"",!1))}i[oa]=s}catch(y){kt(e,e.return,y)}}break;case 6:if(sr(t,e),yr(e),r&4){if(e.stateNode===null)throw Error(X(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(y){kt(e,e.return,y)}}break;case 3:if(sr(t,e),yr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ta(t.containerInfo)}catch(y){kt(e,e.return,y)}break;case 4:sr(t,e),yr(e);break;case 13:sr(t,e),yr(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(np=Tt())),r&4&&og(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(un=(c=un)||d,sr(t,e),un=c):sr(t,e),yr(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(fe=e,d=e.child;d!==null;){for(h=fe=d;fe!==null;){switch(f=fe,p=f.child,f.tag){case 0:case 11:case 14:case 15:Ho(4,f,f.return);break;case 1:Ds(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(y){kt(r,n,y)}}break;case 5:Ds(f,f.return);break;case 22:if(f.memoizedState!==null){lg(h);continue}}p!==null?(p.return=f,fe=p):lg(h)}d=d.sibling}e:for(d=null,h=e;;){if(h.tag===5){if(d===null){d=h;try{i=h.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=h.stateNode,l=h.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Cv("display",o))}catch(y){kt(e,e.return,y)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(y){kt(e,e.return,y)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:sr(t,e),yr(e),r&4&&og(e);break;case 21:break;default:sr(t,e),yr(e)}}function yr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Jb(n)){var r=n;break e}n=n.return}throw Error(X(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Jo(i,""),r.flags&=-33);var s=sg(e);cd(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=sg(e);ld(e,a,o);break;default:throw Error(X(161))}}catch(l){kt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hk(e,t,n){fe=e,ew(e)}function ew(e,t,n){for(var r=(e.mode&1)!==0;fe!==null;){var i=fe,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Ka;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||un;a=Ka;var c=un;if(Ka=o,(un=l)&&!c)for(fe=i;fe!==null;)o=fe,l=o.child,o.tag===22&&o.memoizedState!==null?cg(i):l!==null?(l.return=o,fe=l):cg(i);for(;s!==null;)fe=s,ew(s),s=s.sibling;fe=i,Ka=a,un=c}ag(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,fe=s):ag(e)}}function ag(e){for(;fe!==null;){var t=fe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:un||Ac(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!un)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:lr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Vm(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Vm(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&ta(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(X(163))}un||t.flags&512&&ad(t)}catch(f){kt(t,t.return,f)}}if(t===e){fe=null;break}if(n=t.sibling,n!==null){n.return=t.return,fe=n;break}fe=t.return}}function lg(e){for(;fe!==null;){var t=fe;if(t===e){fe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,fe=n;break}fe=t.return}}function cg(e){for(;fe!==null;){var t=fe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ac(4,t)}catch(l){kt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){kt(t,i,l)}}var s=t.return;try{ad(t)}catch(l){kt(t,s,l)}break;case 5:var o=t.return;try{ad(t)}catch(l){kt(t,o,l)}}}catch(l){kt(t,t.return,l)}if(t===e){fe=null;break}var a=t.sibling;if(a!==null){a.return=t.return,fe=a;break}fe=t.return}}var dk=Math.ceil,sc=Kr.ReactCurrentDispatcher,ep=Kr.ReactCurrentOwner,er=Kr.ReactCurrentBatchConfig,Ye=0,Jt=null,Mt=null,nn=0,In=0,Ps=Ni(0),Wt=0,da=null,ts=0,Ic=0,tp=0,Wo=null,Cn=null,np=0,Xs=1/0,Ir=null,oc=!1,ud=null,vi=null,Ya=!1,di=null,ac=0,Uo=0,hd=null,Cl=-1,El=0;function _n(){return Ye&6?Tt():Cl!==-1?Cl:Cl=Tt()}function bi(e){return e.mode&1?Ye&2&&nn!==0?nn&-nn:G1.transition!==null?(El===0&&(El=zv()),El):(e=Ze,e!==0||(e=window.event,e=e===void 0?16:Vv(e.type)),e):1}function dr(e,t,n,r){if(50<Uo)throw Uo=0,hd=null,Error(X(185));ba(e,n,r),(!(Ye&2)||e!==Jt)&&(e===Jt&&(!(Ye&2)&&(Ic|=n),Wt===4&&ui(e,nn)),Rn(e,r),n===1&&Ye===0&&!(t.mode&1)&&(Xs=Tt()+500,Dc&&ji()))}function Rn(e,t){var n=e.callbackNode;G0(e,t);var r=Ul(e,e===Jt?nn:0);if(r===0)n!==null&&_m(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&_m(n),t===1)e.tag===0?Y1(ug.bind(null,e)):ub(ug.bind(null,e)),U1(function(){!(Ye&6)&&ji()}),n=null;else{switch(Bv(r)){case 1:n=jf;break;case 4:n=Mv;break;case 16:n=Wl;break;case 536870912:n=Ov;break;default:n=Wl}n=lw(n,tw.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function tw(e,t){if(Cl=-1,El=0,Ye&6)throw Error(X(327));var n=e.callbackNode;if(Fs()&&e.callbackNode!==n)return null;var r=Ul(e,e===Jt?nn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=lc(e,r);else{t=r;var i=Ye;Ye|=2;var s=rw();(Jt!==e||nn!==t)&&(Ir=null,Xs=Tt()+500,Yi(e,t));do try{mk();break}catch(a){nw(e,a)}while(!0);$f(),sc.current=s,Ye=i,Mt!==null?t=0:(Jt=null,nn=0,t=Wt)}if(t!==0){if(t===2&&(i=zh(e),i!==0&&(r=i,t=dd(e,i))),t===1)throw n=da,Yi(e,0),ui(e,r),Rn(e,Tt()),n;if(t===6)ui(e,r);else{if(i=e.current.alternate,!(r&30)&&!fk(i)&&(t=lc(e,r),t===2&&(s=zh(e),s!==0&&(r=s,t=dd(e,s))),t===1))throw n=da,Yi(e,0),ui(e,r),Rn(e,Tt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(X(345));case 2:zi(e,Cn,Ir);break;case 3:if(ui(e,r),(r&130023424)===r&&(t=np+500-Tt(),10<t)){if(Ul(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){_n(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=qh(zi.bind(null,e,Cn,Ir),t);break}zi(e,Cn,Ir);break;case 4:if(ui(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-hr(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=Tt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*dk(r/1960))-r,10<r){e.timeoutHandle=qh(zi.bind(null,e,Cn,Ir),r);break}zi(e,Cn,Ir);break;case 5:zi(e,Cn,Ir);break;default:throw Error(X(329))}}}return Rn(e,Tt()),e.callbackNode===n?tw.bind(null,e):null}function dd(e,t){var n=Wo;return e.current.memoizedState.isDehydrated&&(Yi(e,t).flags|=256),e=lc(e,t),e!==2&&(t=Cn,Cn=n,t!==null&&fd(t)),e}function fd(e){Cn===null?Cn=e:Cn.push.apply(Cn,e)}function fk(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!mr(s(),i))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 ui(e,t){for(t&=~tp,t&=~Ic,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-hr(t),r=1<<n;e[n]=-1,t&=~r}}function ug(e){if(Ye&6)throw Error(X(327));Fs();var t=Ul(e,0);if(!(t&1))return Rn(e,Tt()),null;var n=lc(e,t);if(e.tag!==0&&n===2){var r=zh(e);r!==0&&(t=r,n=dd(e,r))}if(n===1)throw n=da,Yi(e,0),ui(e,t),Rn(e,Tt()),n;if(n===6)throw Error(X(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,zi(e,Cn,Ir),Rn(e,Tt()),null}function rp(e,t){var n=Ye;Ye|=1;try{return e(t)}finally{Ye=n,Ye===0&&(Xs=Tt()+500,Dc&&ji())}}function ns(e){di!==null&&di.tag===0&&!(Ye&6)&&Fs();var t=Ye;Ye|=1;var n=er.transition,r=Ze;try{if(er.transition=null,Ze=1,e)return e()}finally{Ze=r,er.transition=n,Ye=t,!(Ye&6)&&ji()}}function ip(){In=Ps.current,ht(Ps)}function Yi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,W1(n)),Mt!==null)for(n=Mt.return;n!==null;){var r=n;switch(zf(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Gl();break;case 3:Ys(),ht(Nn),ht(dn),Kf();break;case 5:qf(r);break;case 4:Ys();break;case 13:ht(vt);break;case 19:ht(vt);break;case 10:Hf(r.type._context);break;case 22:case 23:ip()}n=n.return}if(Jt=e,Mt=e=wi(e.current,null),nn=In=t,Wt=0,da=null,tp=Ic=ts=0,Cn=Wo=null,Ui!==null){for(t=0;t<Ui.length;t++)if(n=Ui[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}Ui=null}return e}function nw(e,t){do{var n=Mt;try{if($f(),Sl.current=ic,rc){for(var r=bt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}rc=!1}if(es=0,Kt=Ht=bt=null,$o=!1,ca=0,ep.current=null,n===null||n.return===null){Wt=1,da=t,Mt=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=nn,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=Jm(o);if(p!==null){p.flags&=-257,Zm(p,o,a,s,t),p.mode&1&&Xm(s,c,t),t=p,l=c;var m=t.updateQueue;if(m===null){var y=new Set;y.add(l),t.updateQueue=y}else m.add(l);break e}else{if(!(t&1)){Xm(s,c,t),sp();break e}l=Error(X(426))}}else if(dt&&a.mode&1){var b=Jm(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Zm(b,o,a,s,t),Bf(Gs(l,a));break e}}s=l=Gs(l,a),Wt!==4&&(Wt=2),Wo===null?Wo=[s]:Wo.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var _=Bb(s,l,t);Um(s,_);break e;case 1:a=l;var v=s.type,g=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(vi===null||!vi.has(g)))){s.flags|=65536,t&=-t,s.lanes|=t;var S=Fb(s,a,t);Um(s,S);break e}}s=s.return}while(s!==null)}sw(n)}catch(C){t=C,Mt===n&&n!==null&&(Mt=n=n.return);continue}break}while(!0)}function rw(){var e=sc.current;return sc.current=ic,e===null?ic:e}function sp(){(Wt===0||Wt===3||Wt===2)&&(Wt=4),Jt===null||!(ts&268435455)&&!(Ic&268435455)||ui(Jt,nn)}function lc(e,t){var n=Ye;Ye|=2;var r=rw();(Jt!==e||nn!==t)&&(Ir=null,Yi(e,t));do try{pk();break}catch(i){nw(e,i)}while(!0);if($f(),Ye=n,sc.current=r,Mt!==null)throw Error(X(261));return Jt=null,nn=0,Wt}function pk(){for(;Mt!==null;)iw(Mt)}function mk(){for(;Mt!==null&&!F0();)iw(Mt)}function iw(e){var t=aw(e.alternate,e,In);e.memoizedProps=e.pendingProps,t===null?sw(e):Mt=t,ep.current=null}function sw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=lk(n,t),n!==null){n.flags&=32767,Mt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Wt=6,Mt=null;return}}else if(n=ak(n,t,In),n!==null){Mt=n;return}if(t=t.sibling,t!==null){Mt=t;return}Mt=t=e}while(t!==null);Wt===0&&(Wt=5)}function zi(e,t,n){var r=Ze,i=er.transition;try{er.transition=null,Ze=1,gk(e,t,n,r)}finally{er.transition=i,Ze=r}return null}function gk(e,t,n,r){do Fs();while(di!==null);if(Ye&6)throw Error(X(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(X(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(X0(e,s),e===Jt&&(Mt=Jt=null,nn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ya||(Ya=!0,lw(Wl,function(){return Fs(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=er.transition,er.transition=null;var o=Ze;Ze=1;var a=Ye;Ye|=4,ep.current=null,uk(e,n),Qb(n,e),M1(Uh),Vl=!!Wh,Uh=Wh=null,e.current=n,hk(n),$0(),Ye=a,Ze=o,er.transition=s}else e.current=n;if(Ya&&(Ya=!1,di=e,ac=i),s=e.pendingLanes,s===0&&(vi=null),U0(n.stateNode),Rn(e,Tt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(oc)throw oc=!1,e=ud,ud=null,e;return ac&1&&e.tag!==0&&Fs(),s=e.pendingLanes,s&1?e===hd?Uo++:(Uo=0,hd=e):Uo=0,ji(),null}function Fs(){if(di!==null){var e=Bv(ac),t=er.transition,n=Ze;try{if(er.transition=null,Ze=16>e?16:e,di===null)var r=!1;else{if(e=di,di=null,ac=0,Ye&6)throw Error(X(331));var i=Ye;for(Ye|=4,fe=e.current;fe!==null;){var s=fe,o=s.child;if(fe.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(fe=c;fe!==null;){var d=fe;switch(d.tag){case 0:case 11:case 15:Ho(8,d,s)}var h=d.child;if(h!==null)h.return=d,fe=h;else for(;fe!==null;){d=fe;var f=d.sibling,p=d.return;if(Xb(d),d===c){fe=null;break}if(f!==null){f.return=p,fe=f;break}fe=p}}}var m=s.alternate;if(m!==null){var y=m.child;if(y!==null){m.child=null;do{var b=y.sibling;y.sibling=null,y=b}while(y!==null)}}fe=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,fe=o;else e:for(;fe!==null;){if(s=fe,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Ho(9,s,s.return)}var _=s.sibling;if(_!==null){_.return=s.return,fe=_;break e}fe=s.return}}var v=e.current;for(fe=v;fe!==null;){o=fe;var g=o.child;if(o.subtreeFlags&2064&&g!==null)g.return=o,fe=g;else e:for(o=v;fe!==null;){if(a=fe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Ac(9,a)}}catch(C){kt(a,a.return,C)}if(a===o){fe=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,fe=S;break e}fe=a.return}}if(Ye=i,ji(),Nr&&typeof Nr.onPostCommitFiberRoot=="function")try{Nr.onPostCommitFiberRoot(Ec,e)}catch{}r=!0}return r}finally{Ze=n,er.transition=t}}return!1}function hg(e,t,n){t=Gs(n,t),t=Bb(e,t,1),e=_i(e,t,1),t=_n(),e!==null&&(ba(e,1,t),Rn(e,t))}function kt(e,t,n){if(e.tag===3)hg(e,e,n);else for(;t!==null;){if(t.tag===3){hg(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(vi===null||!vi.has(r))){e=Gs(n,e),e=Fb(t,e,1),t=_i(t,e,1),e=_n(),t!==null&&(ba(t,1,e),Rn(t,e));break}}t=t.return}}function yk(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=_n(),e.pingedLanes|=e.suspendedLanes&n,Jt===e&&(nn&n)===n&&(Wt===4||Wt===3&&(nn&130023424)===nn&&500>Tt()-np?Yi(e,0):tp|=n),Rn(e,t)}function ow(e,t){t===0&&(e.mode&1?(t=za,za<<=1,!(za&130023424)&&(za=4194304)):t=1);var n=_n();e=Vr(e,t),e!==null&&(ba(e,t,n),Rn(e,n))}function _k(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ow(e,n)}function vk(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(X(314))}r!==null&&r.delete(t),ow(e,n)}var aw;aw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Nn.current)En=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return En=!1,ok(e,t,n);En=!!(e.flags&131072)}else En=!1,dt&&t.flags&1048576&&hb(t,Zl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;kl(e,t),e=t.pendingProps;var i=Vs(t,dn.current);Bs(t,n),i=Gf(null,t,r,e,i,n);var s=Xf();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,jn(r)?(s=!0,Xl(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Uf(t),i.updater=Lc,t.stateNode=i,i._reactInternals=t,Qh(t,r,e,n),t=nd(null,t,r,!0,s,n)):(t.tag=0,dt&&s&&Of(t),gn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(kl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=wk(r),e=lr(r,e),i){case 0:t=td(null,t,r,e,n);break e;case 1:t=tg(null,t,r,e,n);break e;case 11:t=Qm(null,t,r,e,n);break e;case 14:t=eg(null,t,r,lr(r.type,e),n);break e}throw Error(X(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:lr(r,i),td(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:lr(r,i),tg(e,t,r,i,n);case 3:e:{if(Ub(t),e===null)throw Error(X(387));r=t.pendingProps,s=t.memoizedState,i=s.element,yb(e,t),tc(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=Gs(Error(X(423)),t),t=ng(e,t,r,n,i);break e}else if(r!==i){i=Gs(Error(X(424)),t),t=ng(e,t,r,n,i);break e}else for(Mn=yi(t.stateNode.containerInfo.firstChild),On=t,dt=!0,ur=null,n=mb(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(qs(),r===i){t=qr(e,t,n);break e}gn(e,t,r,n)}t=t.child}return t;case 5:return _b(t),e===null&&Xh(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Vh(r,i)?o=null:s!==null&&Vh(r,s)&&(t.flags|=32),Wb(e,t),gn(e,t,o,n),t.child;case 6:return e===null&&Xh(t),null;case 13:return Vb(e,t,n);case 4:return Vf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ks(t,null,r,n):gn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:lr(r,i),Qm(e,t,r,i,n);case 7:return gn(e,t,t.pendingProps,n),t.child;case 8:return gn(e,t,t.pendingProps.children,n),t.child;case 12:return gn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,ot(Ql,r._currentValue),r._currentValue=o,s!==null)if(mr(s.value,o)){if(s.children===i.children&&!Nn.current){t=qr(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=$r(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Jh(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(X(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Jh(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}gn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Bs(t,n),i=nr(i),r=r(i),t.flags|=1,gn(e,t,r,n),t.child;case 14:return r=t.type,i=lr(r,t.pendingProps),i=lr(r.type,i),eg(e,t,r,i,n);case 15:return $b(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:lr(r,i),kl(e,t),t.tag=1,jn(r)?(e=!0,Xl(t)):e=!1,Bs(t,n),zb(t,r,i),Qh(t,r,i,n),nd(null,t,r,!0,e,n);case 19:return qb(e,t,n);case 22:return Hb(e,t,n)}throw Error(X(156,t.tag))};function lw(e,t){return Iv(e,t)}function bk(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(e,t,n,r){return new bk(e,t,n,r)}function op(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wk(e){if(typeof e=="function")return op(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Cf)return 11;if(e===Ef)return 14}return 2}function wi(e,t){var n=e.alternate;return n===null?(n=Qn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Nl(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")op(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ss:return Gi(n.children,i,s,t);case kf:o=8,i|=8;break;case xh:return e=Qn(12,n,t,i|2),e.elementType=xh,e.lanes=s,e;case kh:return e=Qn(13,n,t,i),e.elementType=kh,e.lanes=s,e;case Ch:return e=Qn(19,n,t,i),e.elementType=Ch,e.lanes=s,e;case _v:return Mc(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case gv:o=10;break e;case yv:o=9;break e;case Cf:o=11;break e;case Ef:o=14;break e;case oi:o=16,r=null;break e}throw Error(X(130,e==null?e:typeof e,""))}return t=Qn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Gi(e,t,n,r){return e=Qn(7,e,r,t),e.lanes=n,e}function Mc(e,t,n,r){return e=Qn(22,e,r,t),e.elementType=_v,e.lanes=n,e.stateNode={isHidden:!1},e}function Du(e,t,n){return e=Qn(6,e,null,t),e.lanes=n,e}function Pu(e,t,n){return t=Qn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Sk(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=du(0),this.expirationTimes=du(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=du(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function ap(e,t,n,r,i,s,o,a,l){return e=new Sk(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Qn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Uf(s),e}function xk(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ws,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function cw(e){if(!e)return ki;e=e._reactInternals;e:{if(cs(e)!==e||e.tag!==1)throw Error(X(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(jn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(X(171))}if(e.tag===1){var n=e.type;if(jn(n))return cb(e,n,t)}return t}function uw(e,t,n,r,i,s,o,a,l){return e=ap(n,r,!0,e,i,s,o,a,l),e.context=cw(null),n=e.current,r=_n(),i=bi(n),s=$r(r,i),s.callback=t??null,_i(n,s,i),e.current.lanes=i,ba(e,i,r),Rn(e,r),e}function Oc(e,t,n,r){var i=t.current,s=_n(),o=bi(i);return n=cw(n),t.context===null?t.context=n:t.pendingContext=n,t=$r(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=_i(i,t,o),e!==null&&(dr(e,i,o,s),wl(e,i,o)),o}function cc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function dg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function lp(e,t){dg(e,t),(e=e.alternate)&&dg(e,t)}function kk(){return null}var hw=typeof reportError=="function"?reportError:function(e){console.error(e)};function cp(e){this._internalRoot=e}zc.prototype.render=cp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(X(409));Oc(e,t,null,null)};zc.prototype.unmount=cp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ns(function(){Oc(null,e,null,null)}),t[Ur]=null}};function zc(e){this._internalRoot=e}zc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Hv();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ci.length&&t!==0&&t<ci[n].priority;n++);ci.splice(n,0,e),n===0&&Uv(e)}};function up(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Bc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function fg(){}function Ck(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=cc(o);s.call(c)}}var o=uw(t,r,e,0,null,!1,!1,"",fg);return e._reactRootContainer=o,e[Ur]=o.current,ia(e.nodeType===8?e.parentNode:e),ns(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=cc(l);a.call(c)}}var l=ap(e,0,!1,null,null,!1,!1,"",fg);return e._reactRootContainer=l,e[Ur]=l.current,ia(e.nodeType===8?e.parentNode:e),ns(function(){Oc(t,l,n,r)}),l}function Fc(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=cc(o);a.call(l)}}Oc(t,o,e,i)}else o=Ck(n,t,e,i,r);return cc(o)}Fv=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=jo(t.pendingLanes);n!==0&&(Rf(t,n|1),Rn(t,Tt()),!(Ye&6)&&(Xs=Tt()+500,ji()))}break;case 13:ns(function(){var r=Vr(e,1);if(r!==null){var i=_n();dr(r,e,1,i)}}),lp(e,1)}};Tf=function(e){if(e.tag===13){var t=Vr(e,134217728);if(t!==null){var n=_n();dr(t,e,134217728,n)}lp(e,134217728)}};$v=function(e){if(e.tag===13){var t=bi(e),n=Vr(e,t);if(n!==null){var r=_n();dr(n,e,t,r)}lp(e,t)}};Hv=function(){return Ze};Wv=function(e,t){var n=Ze;try{return Ze=e,t()}finally{Ze=n}};Ih=function(e,t,n){switch(t){case"input":if(jh(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=Tc(r);if(!i)throw Error(X(90));bv(r),jh(r,i)}}}break;case"textarea":Sv(e,n);break;case"select":t=n.value,t!=null&&Is(e,!!n.multiple,t,!1)}};Rv=rp;Tv=ns;var Ek={usingClientEntryPoint:!1,Events:[Sa,Es,Tc,Nv,jv,rp]},mo={findFiberByHostInstance:Wi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Nk={bundleType:mo.bundleType,version:mo.version,rendererPackageName:mo.rendererPackageName,rendererConfig:mo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Kr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Lv(e),e===null?null:e.stateNode},findFiberByHostInstance:mo.findFiberByHostInstance||kk,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ga=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ga.isDisabled&&Ga.supportsFiber)try{Ec=Ga.inject(Nk),Nr=Ga}catch{}}Fn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ek;Fn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!up(t))throw Error(X(200));return xk(e,t,null,n)};Fn.createRoot=function(e,t){if(!up(e))throw Error(X(299));var n=!1,r="",i=hw;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=ap(e,1,!1,null,null,n,!1,r,i),e[Ur]=t.current,ia(e.nodeType===8?e.parentNode:e),new cp(t)};Fn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(X(188)):(e=Object.keys(e).join(","),Error(X(268,e)));return e=Lv(t),e=e===null?null:e.stateNode,e};Fn.flushSync=function(e){return ns(e)};Fn.hydrate=function(e,t,n){if(!Bc(t))throw Error(X(200));return Fc(null,e,t,!0,n)};Fn.hydrateRoot=function(e,t,n){if(!up(e))throw Error(X(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=hw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=uw(t,null,e,1,n??null,i,!1,s,o),e[Ur]=t.current,ia(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new zc(t)};Fn.render=function(e,t,n){if(!Bc(t))throw Error(X(200));return Fc(null,e,t,!1,n)};Fn.unmountComponentAtNode=function(e){if(!Bc(e))throw Error(X(40));return e._reactRootContainer?(ns(function(){Fc(null,null,e,!1,function(){e._reactRootContainer=null,e[Ur]=null})}),!0):!1};Fn.unstable_batchedUpdates=rp;Fn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Bc(n))throw Error(X(200));if(e==null||e._reactInternals===void 0)throw Error(X(38));return Fc(e,t,n,!1,r)};Fn.version="18.3.1-next-f1338f8080-20240426";function dw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dw)}catch(e){console.error(e)}}dw(),dv.exports=Fn;var fw=dv.exports;const pw=_a(fw);var pg=fw;wh.createRoot=pg.createRoot,wh.hydrateRoot=pg.hydrateRoot;function jk(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Rk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Tk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dk={};function mg(e,t){return(Dk.jsx?Tk:Rk).test(e)}const Pk=/[ \t\n\f\r]/g;function Lk(e){return typeof e=="object"?e.type==="text"?gg(e.value):!1:gg(e)}function gg(e){return e.replace(Pk,"")===""}class ka{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ka.prototype.normal={};ka.prototype.property={};ka.prototype.space=void 0;function mw(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ka(n,r,t)}function pd(e){return e.toLowerCase()}class Tn{constructor(t,n){this.attribute=n,this.property=t}}Tn.prototype.attribute="";Tn.prototype.booleanish=!1;Tn.prototype.boolean=!1;Tn.prototype.commaOrSpaceSeparated=!1;Tn.prototype.commaSeparated=!1;Tn.prototype.defined=!1;Tn.prototype.mustUseProperty=!1;Tn.prototype.number=!1;Tn.prototype.overloadedBoolean=!1;Tn.prototype.property="";Tn.prototype.spaceSeparated=!1;Tn.prototype.space=void 0;let Ak=0;const Ie=us(),Lt=us(),md=us(),Z=us(),st=us(),$s=us(),An=us();function us(){return 2**++Ak}const gd=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Lt,commaOrSpaceSeparated:An,commaSeparated:$s,number:Z,overloadedBoolean:md,spaceSeparated:st},Symbol.toStringTag,{value:"Module"})),Lu=Object.keys(gd);class hp extends Tn{constructor(t,n,r,i){let s=-1;if(super(t,n),yg(this,"space",i),typeof r=="number")for(;++s<Lu.length;){const o=Lu[s];yg(this,Lu[s],(r&gd[o])===gd[o])}}}hp.prototype.defined=!0;function yg(e,t,n){n&&(e[t]=n)}function no(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new hp(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[pd(r)]=r,n[pd(s.attribute)]=r}return new ka(t,n,e.space)}const gw=no({properties:{ariaActiveDescendant:null,ariaAtomic:Lt,ariaAutoComplete:null,ariaBusy:Lt,ariaChecked:Lt,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:st,ariaCurrent:null,ariaDescribedBy:st,ariaDetails:null,ariaDisabled:Lt,ariaDropEffect:st,ariaErrorMessage:null,ariaExpanded:Lt,ariaFlowTo:st,ariaGrabbed:Lt,ariaHasPopup:null,ariaHidden:Lt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:st,ariaLevel:Z,ariaLive:null,ariaModal:Lt,ariaMultiLine:Lt,ariaMultiSelectable:Lt,ariaOrientation:null,ariaOwns:st,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:Lt,ariaReadOnly:Lt,ariaRelevant:null,ariaRequired:Lt,ariaRoleDescription:st,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:Lt,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function yw(e,t){return t in e?e[t]:t}function _w(e,t){return yw(e,t.toLowerCase())}const Ik=no({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$s,acceptCharset:st,accessKey:st,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:st,autoFocus:Ie,autoPlay:Ie,blocking:st,capture:null,charSet:null,checked:Ie,cite:null,className:st,cols:Z,colSpan:null,content:null,contentEditable:Lt,controls:Ie,controlsList:st,coords:Z|$s,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:md,draggable:Lt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:st,height:Z,hidden:md,high:Z,href:null,hrefLang:null,htmlFor:st,httpEquiv:st,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:st,itemRef:st,itemScope:Ie,itemType:st,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ie,optimum:Z,pattern:null,ping:st,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:st,required:Ie,reversed:Ie,rows:Z,rowSpan:Z,sandbox:st,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:Lt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Lt,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:st,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:Lt,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ie,disableRemotePlayback:Ie,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:_w}),Mk=no({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:An,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:st,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:$s,g2:$s,glyphName:$s,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:An,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:st,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:An,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:An,rev:An,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:An,requiredFeatures:An,requiredFonts:An,requiredFormats:An,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:An,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:An,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:An,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:yw}),vw=no({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),bw=no({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_w}),ww=no({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Ok={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},zk=/[A-Z]/g,_g=/-[a-z]/g,Bk=/^data[-\w.:]+$/i;function Fk(e,t){const n=pd(t);let r=t,i=Tn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Bk.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(_g,Hk);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!_g.test(s)){let o=s.replace(zk,$k);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=hp}return new i(r,t)}function $k(e){return"-"+e.toLowerCase()}function Hk(e){return e.charAt(1).toUpperCase()}const Wk=mw([gw,Ik,vw,bw,ww],"html"),dp=mw([gw,Mk,vw,bw,ww],"svg");function Uk(e){return e.join(" ").trim()}var fp={},vg=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Vk=/\n/g,qk=/^\s*/,Kk=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Yk=/^:\s*/,Gk=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Xk=/^[;\s]*/,Jk=/^\s+|\s+$/g,Zk=`
41
41
  `,bg="/",wg="*",Hi="",Qk="comment",eC="declaration";function tC(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var y=m.match(Vk);y&&(n+=y.length);var b=m.lastIndexOf(Zk);r=~b?m.length-b:r+m.length}function s(){var m={line:n,column:r};return function(y){return y.position=new o(m),c(),y}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(m){var y=new Error(t.source+":"+n+":"+r+": "+m);if(y.reason=m,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(m){var y=m.exec(e);if(y){var b=y[0];return i(b),e=e.slice(b.length),y}}function c(){l(qk)}function d(m){var y;for(m=m||[];y=h();)y!==!1&&m.push(y);return m}function h(){var m=s();if(!(bg!=e.charAt(0)||wg!=e.charAt(1))){for(var y=2;Hi!=e.charAt(y)&&(wg!=e.charAt(y)||bg!=e.charAt(y+1));)++y;if(y+=2,Hi===e.charAt(y-1))return a("End of comment missing");var b=e.slice(2,y-2);return r+=2,i(b),e=e.slice(y),r+=2,m({type:Qk,comment:b})}}function f(){var m=s(),y=l(Kk);if(y){if(h(),!l(Yk))return a("property missing ':'");var b=l(Gk),_=m({type:eC,property:Sg(y[0].replace(vg,Hi)),value:b?Sg(b[0].replace(vg,Hi)):Hi});return l(Xk),_}}function p(){var m=[];d(m);for(var y;y=f();)y!==!1&&(m.push(y),d(m));return m}return c(),p()}function Sg(e){return e?e.replace(Jk,Hi):Hi}var nC=tC,rC=Bl&&Bl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fp,"__esModule",{value:!0});fp.default=sC;const iC=rC(nC);function sC(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,iC.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?t(o,a,s):a&&(n=n||{},n[o]=a)}),n}var $c={};Object.defineProperty($c,"__esModule",{value:!0});$c.camelCase=void 0;var oC=/^--[a-zA-Z0-9_-]+$/,aC=/-([a-z])/g,lC=/^[^-]+$/,cC=/^-(webkit|moz|ms|o|khtml)-/,uC=/^-(ms)-/,hC=function(e){return!e||lC.test(e)||oC.test(e)},dC=function(e,t){return t.toUpperCase()},xg=function(e,t){return"".concat(t,"-")},fC=function(e,t){return t===void 0&&(t={}),hC(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(uC,xg):e=e.replace(cC,xg),e.replace(aC,dC))};$c.camelCase=fC;var pC=Bl&&Bl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},mC=pC(fp),gC=$c;function yd(e,t){var n={};return!e||typeof e!="string"||(0,mC.default)(e,function(r,i){r&&i&&(n[(0,gC.camelCase)(r,t)]=i)}),n}yd.default=yd;var yC=yd;const _C=_a(yC),Sw=xw("end"),pp=xw("start");function xw(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function vC(e){const t=pp(e),n=Sw(e);if(t&&n)return{start:t,end:n}}function Vo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?kg(e.position):"start"in e||"end"in e?kg(e):"line"in e||"column"in e?_d(e):""}function _d(e){return Cg(e&&e.line)+":"+Cg(e&&e.column)}function kg(e){return _d(e&&e.start)+"-"+_d(e&&e.end)}function Cg(e){return e&&typeof e=="number"?e:1}class fn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Vo(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}fn.prototype.file="";fn.prototype.name="";fn.prototype.reason="";fn.prototype.message="";fn.prototype.stack="";fn.prototype.column=void 0;fn.prototype.line=void 0;fn.prototype.ancestors=void 0;fn.prototype.cause=void 0;fn.prototype.fatal=void 0;fn.prototype.place=void 0;fn.prototype.ruleId=void 0;fn.prototype.source=void 0;const mp={}.hasOwnProperty,bC=new Map,wC=/[A-Z]/g,SC=new Set(["table","tbody","thead","tfoot","tr"]),xC=new Set(["td","th"]),kw="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function kC(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=PC(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=DC(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?dp:Wk,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Cw(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Cw(e,t,n){if(t.type==="element")return CC(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return EC(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return jC(e,t,n);if(t.type==="mdxjsEsm")return NC(e,t);if(t.type==="root")return RC(e,t,n);if(t.type==="text")return TC(e,t)}function CC(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=dp,e.schema=i),e.ancestors.push(t);const s=Nw(e,t.tagName,!1),o=LC(e,t);let a=yp(e,t);return SC.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!Lk(l):!0})),Ew(e,o,s,t),gp(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function EC(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}fa(e,t.position)}function NC(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);fa(e,t.position)}function jC(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=dp,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Nw(e,t.name,!0),o=AC(e,t),a=yp(e,t);return Ew(e,o,s,t),gp(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function RC(e,t,n){const r={};return gp(r,yp(e,t)),e.create(t,e.Fragment,r,n)}function TC(e,t){return t.value}function Ew(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function gp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function DC(e,t,n){return r;function r(i,s,o,a){const c=Array.isArray(o.children)?n:t;return a?c(s,o,a):c(s,o)}}function PC(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=pp(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function LC(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&mp.call(t.properties,i)){const s=IC(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&xC.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function AC(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else fa(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else fa(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function yp(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:bC;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;o=l+"-"+c,i.set(l,c+1)}}const a=Cw(e,s,o);a!==void 0&&n.push(a)}return n}function IC(e,t,n){const r=Fk(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?jk(n):Uk(n)),r.property==="style"){let i=typeof n=="object"?n:MC(e,String(n));return e.stylePropertyNameCase==="css"&&(i=OC(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Ok[r.property]||r.property:r.attribute,n]}}function MC(e,t){try{return _C(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new fn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=kw+"#cannot-parse-style-attribute",i}}function Nw(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=mg(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=mg(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return mp.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);fa(e)}function fa(e,t){const n=new fn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=kw+"#cannot-handle-mdx-estrees-without-createevaluater",n}function OC(e){const t={};let n;for(n in e)mp.call(e,n)&&(t[zC(n)]=e[n]);return t}function zC(e){let t=e.replace(wC,BC);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function BC(e){return"-"+e.toLowerCase()}const Au={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},FC={};function _p(e,t){const n=FC,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return jw(e,r,i)}function jw(e,t,n){if($C(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Eg(e.children,t,n)}return Array.isArray(e)?Eg(e,t,n):""}function Eg(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=jw(e[i],t,n);return r.join("")}function $C(e){return!!(e&&typeof e=="object")}const Ng=document.createElement("i");function vp(e){const t="&"+e+";";Ng.innerHTML=t;const n=Ng.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function zn(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function Zn(e,t){return e.length>0?(zn(e,e.length,0,t),e):t}const jg={}.hasOwnProperty;function Rw(e){const t={};let n=-1;for(;++n<e.length;)HC(t,e[n]);return t}function HC(e,t){let n;for(n in t){const i=(jg.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){jg.call(i,o)||(i[o]=[]);const a=s[o];WC(i[o],Array.isArray(a)?a:a?[a]:[])}}}function WC(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);zn(e,0,0,r)}function Tw(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function fr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const yn=Ri(/[A-Za-z]/),hn=Ri(/[\dA-Za-z]/),UC=Ri(/[#-'*+\--9=?A-Z^-~]/);function uc(e){return e!==null&&(e<32||e===127)}const vd=Ri(/\d/),VC=Ri(/[\dA-Fa-f]/),qC=Ri(/[!-/:-@[-`{-~]/);function we(e){return e!==null&&e<-2}function tt(e){return e!==null&&(e<0||e===32)}function He(e){return e===-2||e===-1||e===32}const Hc=Ri(new RegExp("\\p{P}|\\p{S}","u")),rs=Ri(/\s/);function Ri(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ro(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&hn(e.charCodeAt(n+1))&&hn(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function qe(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return He(l)?(e.enter(n),a(l)):t(l)}function a(l){return He(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const KC={tokenize:YC};function YC(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),qe(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return we(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const GC={tokenize:XC},Rg={tokenize:JC};function XC(e){const t=this,n=[];let r=0,i,s,o;return a;function a(g){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,c)(g)}return c(g)}function l(g){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const S=t.events.length;let C=S,x;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){x=t.events[C][1].end;break}_(r);let T=S;for(;T<t.events.length;)t.events[T][1].end={...x},T++;return zn(t.events,C+1,0,t.events.slice(S)),t.events.length=T,c(g)}return a(g)}function c(g){if(r===n.length){if(!i)return f(g);if(i.currentConstruct&&i.currentConstruct.concrete)return m(g);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Rg,d,h)(g)}function d(g){return i&&v(),_(r),f(g)}function h(g){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(g)}function f(g){return t.containerState={},e.attempt(Rg,p,m)(g)}function p(g){return r++,n.push([t.currentConstruct,t.containerState]),f(g)}function m(g){if(g===null){i&&v(),_(0),e.consume(g);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),y(g)}function y(g){if(g===null){b(e.exit("chunkFlow"),!0),_(0),e.consume(g);return}return we(g)?(e.consume(g),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(g),y)}function b(g,S){const C=t.sliceStream(g);if(S&&C.push(null),g.previous=s,s&&(s.next=g),s=g,i.defineSkip(g.start),i.write(C),t.parser.lazy[g.start.line]){let x=i.events.length;for(;x--;)if(i.events[x][1].start.offset<o&&(!i.events[x][1].end||i.events[x][1].end.offset>o))return;const T=t.events.length;let P=T,B,j;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(B){j=t.events[P][1].end;break}B=!0}for(_(r),x=T;x<t.events.length;)t.events[x][1].end={...j},x++;zn(t.events,P+1,0,t.events.slice(T)),t.events.length=x}}function _(g){let S=n.length;for(;S-- >g;){const C=n[S];t.containerState=C[1],C[0].exit.call(t,e)}n.length=g}function v(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function JC(e,t,n){return qe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Js(e){if(e===null||tt(e)||rs(e))return 1;if(Hc(e))return 2}function Wc(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const bd={name:"attention",resolveAll:ZC,tokenize:QC};function ZC(e,t){let n=-1,r,i,s,o,a,l,c,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},f={...e[n][1].start};Tg(h,-l),Tg(f,l),o={type:l>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Zn(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Zn(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=Zn(c,Wc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Zn(c,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=Zn(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,zn(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function QC(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Js(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const c=e.exit("attentionSequence"),d=Js(l),h=!d||d===2&&i||n.includes(l),f=!i||i===2&&d||n.includes(r);return c._open=!!(s===42?h:h&&(i||!f)),c._close=!!(s===42?f:f&&(d||!h)),t(l)}}function Tg(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const eE={name:"autolink",tokenize:tE};function tE(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return yn(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||hn(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||hn(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||uc(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),d):UC(p)?(e.consume(p),c):n(p)}function d(p){return hn(p)?h(p):n(p)}function h(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||hn(p))&&r++<63){const m=p===45?f:h;return e.consume(p),m}return n(p)}}const Ca={partial:!0,tokenize:nE};function nE(e,t,n){return r;function r(s){return He(s)?qe(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||we(s)?t(s):n(s)}}const Dw={continuation:{tokenize:iE},exit:sE,name:"blockQuote",tokenize:rE};function rE(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return He(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function iE(e,t,n){const r=this;return i;function i(o){return He(o)?qe(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(Dw,t,n)(o)}}function sE(e){e.exit("blockQuote")}const Pw={name:"characterEscape",tokenize:oE};function oE(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return qC(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Lw={name:"characterReference",tokenize:aE};function aE(e,t,n){const r=this;let i=0,s,o;return a;function a(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),l}function l(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,o=hn,d(h))}function c(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=VC,d):(e.enter("characterReferenceValue"),s=7,o=vd,d(h))}function d(h){if(h===59&&i){const f=e.exit("characterReferenceValue");return o===hn&&!vp(r.sliceSerialize(f))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(h)&&i++<s?(e.consume(h),d):n(h)}}const Dg={partial:!0,tokenize:cE},Pg={concrete:!0,name:"codeFenced",tokenize:lE};function lE(e,t,n){const r=this,i={partial:!0,tokenize:C};let s=0,o=0,a;return l;function l(x){return c(x)}function c(x){const T=r.events[r.events.length-1];return s=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,a=x,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(x)}function d(x){return x===a?(o++,e.consume(x),d):o<3?n(x):(e.exit("codeFencedFenceSequence"),He(x)?qe(e,h,"whitespace")(x):h(x))}function h(x){return x===null||we(x)?(e.exit("codeFencedFence"),r.interrupt?t(x):e.check(Dg,y,S)(x)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(x))}function f(x){return x===null||we(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(x)):He(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qe(e,p,"whitespace")(x)):x===96&&x===a?n(x):(e.consume(x),f)}function p(x){return x===null||we(x)?h(x):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||we(x)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(x)):x===96&&x===a?n(x):(e.consume(x),m)}function y(x){return e.attempt(i,S,b)(x)}function b(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),_}function _(x){return s>0&&He(x)?qe(e,v,"linePrefix",s+1)(x):v(x)}function v(x){return x===null||we(x)?e.check(Dg,y,S)(x):(e.enter("codeFlowValue"),g(x))}function g(x){return x===null||we(x)?(e.exit("codeFlowValue"),v(x)):(e.consume(x),g)}function S(x){return e.exit("codeFenced"),t(x)}function C(x,T,P){let B=0;return j;function j(N){return x.enter("lineEnding"),x.consume(N),x.exit("lineEnding"),$}function $(N){return x.enter("codeFencedFence"),He(N)?qe(x,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):I(N)}function I(N){return N===a?(x.enter("codeFencedFenceSequence"),R(N)):P(N)}function R(N){return N===a?(B++,x.consume(N),R):B>=o?(x.exit("codeFencedFenceSequence"),He(N)?qe(x,A,"whitespace")(N):A(N)):P(N)}function A(N){return N===null||we(N)?(x.exit("codeFencedFence"),T(N)):P(N)}}}function cE(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Iu={name:"codeIndented",tokenize:hE},uE={partial:!0,tokenize:dE};function hE(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),qe(e,s,"linePrefix",5)(c)}function s(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):we(c)?e.attempt(uE,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||we(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function dE(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):we(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):qe(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):we(o)?i(o):n(o)}}const fE={name:"codeText",previous:mE,resolve:pE,tokenize:gE};function pE(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function mE(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function gE(e,t,n){let r=0,i,s;return o;function o(h){return e.enter("codeText"),e.enter("codeTextSequence"),a(h)}function a(h){return h===96?(e.consume(h),r++,a):(e.exit("codeTextSequence"),l(h))}function l(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),l):h===96?(s=e.enter("codeTextSequence"),i=0,d(h)):we(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||we(h)?(e.exit("codeTextData"),l(h)):(e.consume(h),c)}function d(h){return h===96?(e.consume(h),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(s.type="codeTextData",c(h))}}class yE{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&go(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),go(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),go(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);go(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);go(this.left,n.reverse())}}}function go(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Aw(e){const t={};let n=-1,r,i,s,o,a,l,c;const d=new yE(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,_E(d,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=d.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},a=d.slice(i,n),a.unshift(r),d.splice(i,n-i+1,a))}}return zn(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function _E(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let d,h,f=-1,p=n,m=0,y=0;const b=[y];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),h&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=n;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(y=f+1,b.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):b.pop(),f=b.length;f--;){const _=a.slice(b[f],b[f+1]),v=s.pop();l.push([v,v+_.length-1]),e.splice(v,2,_)}for(l.reverse(),f=-1;++f<l.length;)c[m+l[f][0]]=m+l[f][1],m+=l[f][1]-l[f][0]-1;return c}const vE={resolve:wE,tokenize:SE},bE={partial:!0,tokenize:xE};function wE(e){return Aw(e),e}function SE(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):we(a)?e.check(bE,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function xE(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),qe(e,s,"linePrefix")}function s(o){if(o===null||we(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Iw(e,t,n,r,i,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return h;function h(_){return _===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(_),e.exit(s),f):_===null||_===32||_===41||uc(_)?n(_):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),y(_))}function f(_){return _===62?(e.enter(s),e.consume(_),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===62?(e.exit("chunkString"),e.exit(a),f(_)):_===null||_===60||we(_)?n(_):(e.consume(_),_===92?m:p)}function m(_){return _===60||_===62||_===92?(e.consume(_),p):p(_)}function y(_){return!d&&(_===null||_===41||tt(_))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(_)):d<c&&_===40?(e.consume(_),d++,y):_===41?(e.consume(_),d--,y):_===null||_===32||_===40||uc(_)?n(_):(e.consume(_),_===92?b:y)}function b(_){return _===40||_===41||_===92?(e.consume(_),y):y(_)}}function Mw(e,t,n,r,i,s){const o=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(s),d}function d(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):we(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||we(p)||a++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!He(p)),p===92?f:h)}function f(p){return p===91||p===92||p===93?(e.consume(p),a++,h):h(p)}}function Ow(e,t,n,r,i,s){let o;return a;function a(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),o=f===40?41:f,l):n(f)}function l(f){return f===o?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(s),c(f))}function c(f){return f===o?(e.exit(s),l(o)):f===null?n(f):we(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),qe(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===o||f===null||we(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?h:d)}function h(f){return f===o||f===92?(e.consume(f),d):d(f)}}function qo(e,t){let n;return r;function r(i){return we(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):He(i)?qe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const kE={name:"definition",tokenize:EE},CE={partial:!0,tokenize:NE};function EE(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return Mw.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=fr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return tt(p)?qo(e,c)(p):c(p)}function c(p){return Iw(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(CE,h,h)(p)}function h(p){return He(p)?qe(e,f,"whitespace")(p):f(p)}function f(p){return p===null||we(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function NE(e,t,n){return r;function r(a){return tt(a)?qo(e,i)(a):n(a)}function i(a){return Ow(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return He(a)?qe(e,o,"whitespace")(a):o(a)}function o(a){return a===null||we(a)?t(a):n(a)}}const jE={name:"hardBreakEscape",tokenize:RE};function RE(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return we(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const TE={name:"headingAtx",resolve:DE,tokenize:PE};function DE(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},zn(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function PE(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||tt(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||we(d)?(e.exit("atxHeading"),t(d)):He(d)?qe(e,a,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function c(d){return d===null||d===35||tt(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),c)}}const LE=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Lg=["pre","script","style","textarea"],AE={concrete:!0,name:"htmlFlow",resolveTo:OE,tokenize:zE},IE={partial:!0,tokenize:FE},ME={partial:!0,tokenize:BE};function OE(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function zE(e,t,n){const r=this;let i,s,o,a,l;return c;function c(E){return d(E)}function d(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),h}function h(E){return E===33?(e.consume(E),f):E===47?(e.consume(E),s=!0,y):E===63?(e.consume(E),i=3,r.interrupt?t:k):yn(E)?(e.consume(E),o=String.fromCharCode(E),b):n(E)}function f(E){return E===45?(e.consume(E),i=2,p):E===91?(e.consume(E),i=5,a=0,m):yn(E)?(e.consume(E),i=4,r.interrupt?t:k):n(E)}function p(E){return E===45?(e.consume(E),r.interrupt?t:k):n(E)}function m(E){const ce="CDATA[";return E===ce.charCodeAt(a++)?(e.consume(E),a===ce.length?r.interrupt?t:I:m):n(E)}function y(E){return yn(E)?(e.consume(E),o=String.fromCharCode(E),b):n(E)}function b(E){if(E===null||E===47||E===62||tt(E)){const ce=E===47,_e=o.toLowerCase();return!ce&&!s&&Lg.includes(_e)?(i=1,r.interrupt?t(E):I(E)):LE.includes(o.toLowerCase())?(i=6,ce?(e.consume(E),_):r.interrupt?t(E):I(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):s?v(E):g(E))}return E===45||hn(E)?(e.consume(E),o+=String.fromCharCode(E),b):n(E)}function _(E){return E===62?(e.consume(E),r.interrupt?t:I):n(E)}function v(E){return He(E)?(e.consume(E),v):j(E)}function g(E){return E===47?(e.consume(E),j):E===58||E===95||yn(E)?(e.consume(E),S):He(E)?(e.consume(E),g):j(E)}function S(E){return E===45||E===46||E===58||E===95||hn(E)?(e.consume(E),S):C(E)}function C(E){return E===61?(e.consume(E),x):He(E)?(e.consume(E),C):g(E)}function x(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),l=E,T):He(E)?(e.consume(E),x):P(E)}function T(E){return E===l?(e.consume(E),l=null,B):E===null||we(E)?n(E):(e.consume(E),T)}function P(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||tt(E)?C(E):(e.consume(E),P)}function B(E){return E===47||E===62||He(E)?g(E):n(E)}function j(E){return E===62?(e.consume(E),$):n(E)}function $(E){return E===null||we(E)?I(E):He(E)?(e.consume(E),$):n(E)}function I(E){return E===45&&i===2?(e.consume(E),z):E===60&&i===1?(e.consume(E),U):E===62&&i===4?(e.consume(E),Q):E===63&&i===3?(e.consume(E),k):E===93&&i===5?(e.consume(E),O):we(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(IE,ne,R)(E)):E===null||we(E)?(e.exit("htmlFlowData"),R(E)):(e.consume(E),I)}function R(E){return e.check(ME,A,ne)(E)}function A(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),N}function N(E){return E===null||we(E)?R(E):(e.enter("htmlFlowData"),I(E))}function z(E){return E===45?(e.consume(E),k):I(E)}function U(E){return E===47?(e.consume(E),o="",D):I(E)}function D(E){if(E===62){const ce=o.toLowerCase();return Lg.includes(ce)?(e.consume(E),Q):I(E)}return yn(E)&&o.length<8?(e.consume(E),o+=String.fromCharCode(E),D):I(E)}function O(E){return E===93?(e.consume(E),k):I(E)}function k(E){return E===62?(e.consume(E),Q):E===45&&i===2?(e.consume(E),k):I(E)}function Q(E){return E===null||we(E)?(e.exit("htmlFlowData"),ne(E)):(e.consume(E),Q)}function ne(E){return e.exit("htmlFlow"),t(E)}}function BE(e,t,n){const r=this;return i;function i(o){return we(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function FE(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ca,t,n)}}const $E={name:"htmlText",tokenize:HE};function HE(e,t,n){const r=this;let i,s,o;return a;function a(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),l}function l(k){return k===33?(e.consume(k),c):k===47?(e.consume(k),C):k===63?(e.consume(k),g):yn(k)?(e.consume(k),P):n(k)}function c(k){return k===45?(e.consume(k),d):k===91?(e.consume(k),s=0,m):yn(k)?(e.consume(k),v):n(k)}function d(k){return k===45?(e.consume(k),p):n(k)}function h(k){return k===null?n(k):k===45?(e.consume(k),f):we(k)?(o=h,U(k)):(e.consume(k),h)}function f(k){return k===45?(e.consume(k),p):h(k)}function p(k){return k===62?z(k):k===45?f(k):h(k)}function m(k){const Q="CDATA[";return k===Q.charCodeAt(s++)?(e.consume(k),s===Q.length?y:m):n(k)}function y(k){return k===null?n(k):k===93?(e.consume(k),b):we(k)?(o=y,U(k)):(e.consume(k),y)}function b(k){return k===93?(e.consume(k),_):y(k)}function _(k){return k===62?z(k):k===93?(e.consume(k),_):y(k)}function v(k){return k===null||k===62?z(k):we(k)?(o=v,U(k)):(e.consume(k),v)}function g(k){return k===null?n(k):k===63?(e.consume(k),S):we(k)?(o=g,U(k)):(e.consume(k),g)}function S(k){return k===62?z(k):g(k)}function C(k){return yn(k)?(e.consume(k),x):n(k)}function x(k){return k===45||hn(k)?(e.consume(k),x):T(k)}function T(k){return we(k)?(o=T,U(k)):He(k)?(e.consume(k),T):z(k)}function P(k){return k===45||hn(k)?(e.consume(k),P):k===47||k===62||tt(k)?B(k):n(k)}function B(k){return k===47?(e.consume(k),z):k===58||k===95||yn(k)?(e.consume(k),j):we(k)?(o=B,U(k)):He(k)?(e.consume(k),B):z(k)}function j(k){return k===45||k===46||k===58||k===95||hn(k)?(e.consume(k),j):$(k)}function $(k){return k===61?(e.consume(k),I):we(k)?(o=$,U(k)):He(k)?(e.consume(k),$):B(k)}function I(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,R):we(k)?(o=I,U(k)):He(k)?(e.consume(k),I):(e.consume(k),A)}function R(k){return k===i?(e.consume(k),i=void 0,N):k===null?n(k):we(k)?(o=R,U(k)):(e.consume(k),R)}function A(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||tt(k)?B(k):(e.consume(k),A)}function N(k){return k===47||k===62||tt(k)?B(k):n(k)}function z(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function U(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),D}function D(k){return He(k)?qe(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):O(k)}function O(k){return e.enter("htmlTextData"),o(k)}}const bp={name:"labelEnd",resolveAll:qE,resolveTo:KE,tokenize:YE},WE={tokenize:GE},UE={tokenize:XE},VE={tokenize:JE};function qE(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&zn(e,0,e.length,n),e}function KE(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=Zn(a,e.slice(s+1,s+r+3)),a=Zn(a,[["enter",d,t]]),a=Zn(a,Wc(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=Zn(a,[["exit",d,t],e[o-2],e[o-1],["exit",c,t]]),a=Zn(a,e.slice(o+1)),a=Zn(a,[["exit",l,t]]),zn(e,s,e.length,a),e}function YE(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(f){return s?s._inactive?h(f):(o=r.parser.defined.includes(fr(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):n(f)}function l(f){return f===40?e.attempt(WE,d,o?d:h)(f):f===91?e.attempt(UE,d,o?c:h)(f):o?d(f):h(f)}function c(f){return e.attempt(VE,d,h)(f)}function d(f){return t(f)}function h(f){return s._balanced=!0,n(f)}}function GE(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return tt(h)?qo(e,s)(h):s(h)}function s(h){return h===41?d(h):Iw(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function o(h){return tt(h)?qo(e,l)(h):d(h)}function a(h){return n(h)}function l(h){return h===34||h===39||h===40?Ow(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function c(h){return tt(h)?qo(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function XE(e,t,n){const r=this;return i;function i(a){return Mw.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(fr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function JE(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const ZE={name:"labelStartImage",resolveAll:bp.resolveAll,tokenize:QE};function QE(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const eN={name:"labelStartLink",resolveAll:bp.resolveAll,tokenize:tN};function tN(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Mu={name:"lineEnding",tokenize:nN};function nN(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),qe(e,t,"linePrefix")}}const jl={name:"thematicBreak",tokenize:rN};function rN(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||we(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),He(c)?qe(e,a,"whitespace")(c):a(c))}}const kn={continuation:{tokenize:aN},exit:cN,name:"list",tokenize:oN},iN={partial:!0,tokenize:uN},sN={partial:!0,tokenize:lN};function oN(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:vd(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(jl,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return vd(p)&&++o<10?(e.consume(p),l):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ca,r.interrupt?n:d,e.attempt(iN,f,h))}function d(p){return r.containerState.initialBlankLine=!0,s++,f(p)}function h(p){return He(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):n(p)}function f(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function aN(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ca,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,qe(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!He(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(sN,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,qe(e,e.attempt(kn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function lN(e,t,n){const r=this;return qe(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function cN(e){e.exit(this.containerState.type)}function uN(e,t,n){const r=this;return qe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!He(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Ag={name:"setextUnderline",resolveTo:hN,tokenize:dN};function hN(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function dN(e,t,n){const r=this;let i;return s;function s(c){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),He(c)?qe(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||we(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const fN={tokenize:pN};function pN(e){const t=this,n=e.attempt(Ca,r,e.attempt(this.parser.constructs.flowInitial,i,qe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(vE,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const mN={resolveAll:Bw()},gN=zw("string"),yN=zw("text");function zw(e){return{resolveAll:Bw(e==="text"?_N:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(d){return c(d)?s(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return c(d)?(n.exit("data"),s(d)):(n.consume(d),l)}function c(d){if(d===null)return!0;const h=i[d];let f=-1;if(h)for(;++f<h.length;){const p=h[f];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function Bw(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function _N(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const vN={42:kn,43:kn,45:kn,48:kn,49:kn,50:kn,51:kn,52:kn,53:kn,54:kn,55:kn,56:kn,57:kn,62:Dw},bN={91:kE},wN={[-2]:Iu,[-1]:Iu,32:Iu},SN={35:TE,42:jl,45:[Ag,jl],60:AE,61:Ag,95:jl,96:Pg,126:Pg},xN={38:Lw,92:Pw},kN={[-5]:Mu,[-4]:Mu,[-3]:Mu,33:ZE,38:Lw,42:bd,60:[eE,$E],91:eN,92:[jE,Pw],93:bp,95:bd,96:fE},CN={null:[bd,mN]},EN={null:[42,95]},NN={null:[]},jN=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:EN,contentInitial:bN,disable:NN,document:vN,flow:SN,flowInitial:wN,insideSpan:CN,string:xN,text:kN},Symbol.toStringTag,{value:"Module"}));function RN(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],a=[];const l={attempt:T(C),check:T(x),consume:v,enter:g,exit:S,interrupt:T(x,{interrupt:!0})},c={code:null,containerState:{},defineSkip:y,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:h};let d=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function h($){return o=Zn(o,$),b(),o[o.length-1]!==null?[]:(P(t,0),c.events=Wc(s,c.events,c),c.events)}function f($,I){return DN(p($),I)}function p($){return TN(o,$)}function m(){const{_bufferIndex:$,_index:I,line:R,column:A,offset:N}=r;return{_bufferIndex:$,_index:I,line:R,column:A,offset:N}}function y($){i[$.line]=$.column,j()}function b(){let $;for(;r._index<o.length;){const I=o[r._index];if(typeof I=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<I.length;)_(I.charCodeAt(r._bufferIndex));else _(I)}}function _($){d=d($)}function v($){we($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,j()):$!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=$}function g($,I){const R=I||{};return R.type=$,R.start=m(),c.events.push(["enter",R,c]),a.push(R),R}function S($){const I=a.pop();return I.end=m(),c.events.push(["exit",I,c]),I}function C($,I){P($,I.from)}function x($,I){I.restore()}function T($,I){return R;function R(A,N,z){let U,D,O,k;return Array.isArray(A)?ne(A):"tokenize"in A?ne([A]):Q(A);function Q(te){return ae;function ae(se){const he=se!==null&&te[se],Pe=se!==null&&te.null,be=[...Array.isArray(he)?he:he?[he]:[],...Array.isArray(Pe)?Pe:Pe?[Pe]:[]];return ne(be)(se)}}function ne(te){return U=te,D=0,te.length===0?z:E(te[D])}function E(te){return ae;function ae(se){return k=B(),O=te,te.partial||(c.currentConstruct=te),te.name&&c.parser.constructs.disable.null.includes(te.name)?_e():te.tokenize.call(I?Object.assign(Object.create(c),I):c,l,ce,_e)(se)}}function ce(te){return $(O,k),N}function _e(te){return k.restore(),++D<U.length?E(U[D]):z}}}function P($,I){$.resolveAll&&!s.includes($)&&s.push($),$.resolve&&zn(c.events,I,c.events.length-I,$.resolve(c.events.slice(I),c)),$.resolveTo&&(c.events=$.resolveTo(c.events,c))}function B(){const $=m(),I=c.previous,R=c.currentConstruct,A=c.events.length,N=Array.from(a);return{from:A,restore:z};function z(){r=$,c.previous=I,c.currentConstruct=R,c.events.length=A,a=N,j()}}function j(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function TN(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function DN(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
42
42
  `;break}case-3:{o=`\r
43
43
  `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function PN(e){const r={constructs:Rw([jN,...(e||{}).extensions||[]]),content:i(KC),defined:[],document:i(GC),flow:i(fN),lazy:{},string:i(gN),text:i(yN)};return r;function i(s){return o;function o(a){return RN(r,s,a)}}}function LN(e){for(;!Aw(e););return e}const Ig=/[\0\t\n\r]/g;function AN(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let c,d,h,f,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),h=0,t="",n&&(s.charCodeAt(0)===65279&&h++,n=void 0);h<s.length;){if(Ig.lastIndex=h,c=Ig.exec(s),f=c&&c.index!==void 0?c.index:s.length,p=s.charCodeAt(f),!c){t=s.slice(h);break}if(p===10&&h===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),h<f&&(l.push(s.slice(h,f)),e+=f-h),p){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}h=f+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const IN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function MN(e){return e.replace(IN,ON)}function ON(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Tw(n.slice(s?2:1),s?16:10)}return vp(n)||e}const Fw={}.hasOwnProperty;function zN(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),BN(n)(LN(PN(n).document().write(AN()(e,t,!0))))}function BN(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Y),autolinkProtocol:B,autolinkEmail:B,atxHeading:s(oe),blockQuote:s(Pe),characterEscape:B,characterReference:B,codeFenced:s(be),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(be,o),codeText:s(Se,o),codeTextData:B,data:B,codeFlowValue:B,definition:s(L),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(ge),hardBreakEscape:s(ye),hardBreakTrailing:s(ye),htmlFlow:s(Te,o),htmlFlowData:B,htmlText:s(Te,o),htmlTextData:B,image:s(Le),label:o,link:s(Y),listItem:s(Ae),listItemValue:f,listOrdered:s(pe,h),listUnordered:s(pe),paragraph:s(Ke),reference:E,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(oe),strong:s(Et),thematicBreak:s(pt)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:he,autolinkProtocol:se,blockQuote:l(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:_e,characterReferenceMarkerNumeric:_e,characterReferenceValue:te,characterReference:ae,codeFenced:l(b),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:j,codeIndented:l(_),codeText:l(N),codeTextData:j,data:j,definition:l(),definitionDestinationString:S,definitionLabelString:v,definitionTitleString:g,emphasis:l(),hardBreakEscape:l(I),hardBreakTrailing:l(I),htmlFlow:l(R),htmlFlowData:j,htmlText:l(A),htmlTextData:j,image:l(U),label:O,labelText:D,lineEnding:$,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ce,resourceDestinationString:k,resourceTitleString:Q,resource:ne,setextHeading:l(P),setextHeadingLineSequence:T,setextHeadingText:x,strong:l(),thematicBreak:l()}};$w(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(M){let H={type:"root",children:[]};const ue={stack:[H],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:d,data:n},Ce=[];let De=-1;for(;++De<M.length;)if(M[De][1].type==="listOrdered"||M[De][1].type==="listUnordered")if(M[De][0]==="enter")Ce.push(De);else{const nt=Ce.pop();De=i(M,nt,De)}for(De=-1;++De<M.length;){const nt=t[M[De][0]];Fw.call(nt,M[De][1].type)&&nt[M[De][1].type].call(Object.assign({sliceSerialize:M[De][2].sliceSerialize},ue),M[De][1])}if(ue.tokenStack.length>0){const nt=ue.tokenStack[ue.tokenStack.length-1];(nt[1]||Mg).call(ue,void 0,nt[0])}for(H.position={start:ei(M.length>0?M[0][1].start:{line:1,column:1,offset:0}),end:ei(M.length>0?M[M.length-2][1].end:{line:1,column:1,offset:0})},De=-1;++De<t.transforms.length;)H=t.transforms[De](H)||H;return H}function i(M,H,ue){let Ce=H-1,De=-1,nt=!1,mt,Dt,sn,Ot;for(;++Ce<=ue;){const at=M[Ce];switch(at[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{at[0]==="enter"?De++:De--,Ot=void 0;break}case"lineEndingBlank":{at[0]==="enter"&&(mt&&!Ot&&!De&&!sn&&(sn=Ce),Ot=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ot=void 0}if(!De&&at[0]==="enter"&&at[1].type==="listItemPrefix"||De===-1&&at[0]==="exit"&&(at[1].type==="listUnordered"||at[1].type==="listOrdered")){if(mt){let rt=Ce;for(Dt=void 0;rt--;){const Vt=M[rt];if(Vt[1].type==="lineEnding"||Vt[1].type==="lineEndingBlank"){if(Vt[0]==="exit")continue;Dt&&(M[Dt][1].type="lineEndingBlank",nt=!0),Vt[1].type="lineEnding",Dt=rt}else if(!(Vt[1].type==="linePrefix"||Vt[1].type==="blockQuotePrefix"||Vt[1].type==="blockQuotePrefixWhitespace"||Vt[1].type==="blockQuoteMarker"||Vt[1].type==="listItemIndent"))break}sn&&(!Dt||sn<Dt)&&(mt._spread=!0),mt.end=Object.assign({},Dt?M[Dt][1].start:at[1].end),M.splice(Dt||Ce,0,["exit",mt,at[2]]),Ce++,ue++}if(at[1].type==="listItemPrefix"){const rt={type:"listItem",_spread:!1,start:Object.assign({},at[1].start),end:void 0};mt=rt,M.splice(Ce,0,["enter",rt,at[2]]),Ce++,ue++,sn=void 0,Ot=!0}}}return M[H][1]._spread=nt,ue}function s(M,H){return ue;function ue(Ce){a.call(this,M(Ce),Ce),H&&H.call(this,Ce)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(M,H,ue){this.stack[this.stack.length-1].children.push(M),this.stack.push(M),this.tokenStack.push([H,ue||void 0]),M.position={start:ei(H.start),end:void 0}}function l(M){return H;function H(ue){M&&M.call(this,ue),c.call(this,ue)}}function c(M,H){const ue=this.stack.pop(),Ce=this.tokenStack.pop();if(Ce)Ce[0].type!==M.type&&(H?H.call(this,M,Ce[0]):(Ce[1]||Mg).call(this,M,Ce[0]));else throw new Error("Cannot close `"+M.type+"` ("+Vo({start:M.start,end:M.end})+"): it’s not open");ue.position.end=ei(M.end)}function d(){return _p(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function f(M){if(this.data.expectingFirstListItemValue){const H=this.stack[this.stack.length-2];H.start=Number.parseInt(this.sliceSerialize(M),10),this.data.expectingFirstListItemValue=void 0}}function p(){const M=this.resume(),H=this.stack[this.stack.length-1];H.lang=M}function m(){const M=this.resume(),H=this.stack[this.stack.length-1];H.meta=M}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const M=this.resume(),H=this.stack[this.stack.length-1];H.value=M.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const M=this.resume(),H=this.stack[this.stack.length-1];H.value=M.replace(/(\r?\n|\r)$/g,"")}function v(M){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.label=H,ue.identifier=fr(this.sliceSerialize(M)).toLowerCase()}function g(){const M=this.resume(),H=this.stack[this.stack.length-1];H.title=M}function S(){const M=this.resume(),H=this.stack[this.stack.length-1];H.url=M}function C(M){const H=this.stack[this.stack.length-1];if(!H.depth){const ue=this.sliceSerialize(M).length;H.depth=ue}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function T(M){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(M).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function B(M){const ue=this.stack[this.stack.length-1].children;let Ce=ue[ue.length-1];(!Ce||Ce.type!=="text")&&(Ce=ir(),Ce.position={start:ei(M.start),end:void 0},ue.push(Ce)),this.stack.push(Ce)}function j(M){const H=this.stack.pop();H.value+=this.sliceSerialize(M),H.position.end=ei(M.end)}function $(M){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ue=H.children[H.children.length-1];ue.position.end=ei(M.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(B.call(this,M),j.call(this,M))}function I(){this.data.atHardBreak=!0}function R(){const M=this.resume(),H=this.stack[this.stack.length-1];H.value=M}function A(){const M=this.resume(),H=this.stack[this.stack.length-1];H.value=M}function N(){const M=this.resume(),H=this.stack[this.stack.length-1];H.value=M}function z(){const M=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";M.type+="Reference",M.referenceType=H,delete M.url,delete M.title}else delete M.identifier,delete M.label;this.data.referenceType=void 0}function U(){const M=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";M.type+="Reference",M.referenceType=H,delete M.url,delete M.title}else delete M.identifier,delete M.label;this.data.referenceType=void 0}function D(M){const H=this.sliceSerialize(M),ue=this.stack[this.stack.length-2];ue.label=MN(H),ue.identifier=fr(H).toLowerCase()}function O(){const M=this.stack[this.stack.length-1],H=this.resume(),ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,ue.type==="link"){const Ce=M.children;ue.children=Ce}else ue.alt=H}function k(){const M=this.resume(),H=this.stack[this.stack.length-1];H.url=M}function Q(){const M=this.resume(),H=this.stack[this.stack.length-1];H.title=M}function ne(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function ce(M){const H=this.resume(),ue=this.stack[this.stack.length-1];ue.label=H,ue.identifier=fr(this.sliceSerialize(M)).toLowerCase(),this.data.referenceType="full"}function _e(M){this.data.characterReferenceType=M.type}function te(M){const H=this.sliceSerialize(M),ue=this.data.characterReferenceType;let Ce;ue?(Ce=Tw(H,ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=vp(H);const De=this.stack[this.stack.length-1];De.value+=Ce}function ae(M){const H=this.stack.pop();H.position.end=ei(M.end)}function se(M){j.call(this,M);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(M)}function he(M){j.call(this,M);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(M)}function Pe(){return{type:"blockquote",children:[]}}function be(){return{type:"code",lang:null,meta:null,value:""}}function Se(){return{type:"inlineCode",value:""}}function L(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ge(){return{type:"emphasis",children:[]}}function oe(){return{type:"heading",depth:0,children:[]}}function ye(){return{type:"break"}}function Te(){return{type:"html",value:""}}function Le(){return{type:"image",title:null,url:"",alt:null}}function Y(){return{type:"link",title:null,url:"",children:[]}}function pe(M){return{type:"list",ordered:M.type==="listOrdered",start:null,spread:M._spread,children:[]}}function Ae(M){return{type:"listItem",spread:M._spread,checked:null,children:[]}}function Ke(){return{type:"paragraph",children:[]}}function Et(){return{type:"strong",children:[]}}function ir(){return{type:"text",value:""}}function pt(){return{type:"thematicBreak"}}}function ei(e){return{line:e.line,column:e.column,offset:e.offset}}function $w(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?$w(e,r):FN(e,r)}}function FN(e,t){let n;for(n in t)if(Fw.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Mg(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Vo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Vo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Vo({start:t.start,end:t.end})+") is still open")}function $N(e){const t=this;t.parser=n;function n(r){return zN(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function HN(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function WN(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
@@ -88,7 +88,7 @@ prismjs/prism.js:
88
88
  … (truncated)`:n,s=n.split(`
89
89
  `).find(o=>o.trim())||(t?"error":"done");return u.jsxs("details",{className:`tool-result ${t?"err":""}`,open:t,children:[u.jsxs("summary",{children:[t?"✗ ":"",s.slice(0,140)]}),u.jsx("pre",{children:i})]})}function FD({block:e}){const{name:t,input:n={},result:r,done:i,isError:s}=e,o=MD[t]||{icon:"⚙",verb:t},a=OD(t,n),l=i?s?"error":"done":"running";return u.jsxs("div",{className:`tool-card ${l}`,"data-testid":"tool-card","data-tool":t,children:[u.jsxs("div",{className:"tool-head",children:[u.jsx("span",{className:"tool-icon",children:o.icon}),u.jsx("span",{className:"tool-verb",children:o.verb}),a&&u.jsx("code",{className:"tool-target",children:a}),t==="Edit"&&n.replace_all&&u.jsx("span",{className:"tool-tag",children:"all"}),u.jsx("span",{className:"tool-status","data-status":l,children:l==="running"?u.jsx("span",{className:"tool-spinner","aria-label":"running"}):l==="error"?"✗":"✓"})]}),u.jsx(zD,{name:t,input:n}),u.jsx(BD,{content:r,isError:s})]})}function NS(e={}){var s,o;const t=(s=e.vetting)==null?void 0:s.verdict;let n,r;if(t==="auto"||t==="reviewed")n="Verified",r="ok";else if(t==="scanned")n="Scanned",r="ok";else if(t==="flagged")n="Flagged",r="warn";else if(t==="unscanned"||t==="unvetted")n="New",r="neutral";else{const a=e.safetyBadge;a==="verified"?(n="Verified",r="ok"):a==="tested"?(n="Tested",r="ok"):(n="New",r="neutral")}const i=((o=e.attestation)==null?void 0:o.privacy)==="not-attested"?"This producer hasn't confirmed how it handles your data's privacy.":null;return{label:n,tone:r,note:i}}function my(e={}){const t=Array.isArray(e.builtFrom)?e.builtFrom[0]:null;return(t==null?void 0:t.note)||null}function jS(e){return`$${(Number(e)||0).toFixed(2)}`}const Pp=()=>u.jsx("span",{className:"bz-represented",title:"No real money moves yet — this is a preview of how earnings would work.",children:"represented · settles later"});function $D({block:e,bazaarState:t,canReply:n,onQuickReply:r}){var l;const{tool:i,phase:s,data:o}=e;if(s!=="result")return u.jsx(UD,{tool:i,input:e.input});if(!o||o.kind==="error")return null;switch(i){case"search_shelf":return u.jsx(VD,{data:o});case"open_recipe":return u.jsx(qD,{data:o});case"launch_preview":return u.jsx(KD,{data:o});case"record_use":return u.jsxs(u.Fragment,{children:[((l=o.recipe)==null?void 0:l.riskClass)==="C"&&u.jsx(YD,{recipe:o.recipe}),u.jsx(GD,{data:o,bazaarState:t})]});case"publish_listing":case"publish_draft":return u.jsx(XD,{data:o});case"draft_recipe":return u.jsx(JD,{data:o,canReply:n,onQuickReply:r});default:return null}}const HD={search_shelf:"Searching the bazaar shelf",open_recipe:"Absorbing the recipe",launch_preview:"Opening your live preview",record_use:"Recording the build",publish_listing:"Packaging for the shelf",draft_recipe:"Drafting a recipe from your work",publish_draft:"Publishing to the shelf"},WD={search_shelf:"🛒",open_recipe:"📖",launch_preview:"▶️",record_use:"🧾",publish_listing:"📦",draft_recipe:"📝",publish_draft:"📦"};function UD({tool:e,input:t}){return u.jsxs("div",{className:"bazaar-card bz-call","data-testid":`bazaar-${e}-call`,children:[u.jsx("span",{className:"bz-icon",children:WD[e]||"🛍️"}),u.jsxs("span",{className:"bz-call-label",children:[HD[e]||"Bazaar","…"]}),e==="search_shelf"&&(t==null?void 0:t.need)&&u.jsxs("span",{className:"bz-call-need",children:["“",t.need,"”"]}),u.jsxs("span",{className:"bz-dots",children:[u.jsx("i",{}),u.jsx("i",{}),u.jsx("i",{})]})]})}function gy(e){return`${Math.round((Number(e)||0)*100)}%`}function VD({data:e}){var r;const t=e.hits||[];if(!t.length)return u.jsxs("div",{className:"bazaar-card bz-empty","data-testid":"bazaar-search-result",children:[u.jsx("span",{className:"bz-icon",children:"🛒"}),u.jsx("span",{children:"Checked the shelf — nothing proven fit this one, so I'll build it from scratch."})]});const n=t[0];return u.jsxs("div",{className:"bazaar-card bz-search","data-testid":"bazaar-search-result",children:[u.jsxs("div",{className:"bz-head",children:[u.jsx("span",{className:"bz-icon",children:"🛒"}),u.jsx("span",{className:"bz-head-title",children:"Found a proven recipe on the shelf"})]}),u.jsxs("div",{className:"bz-hit bz-hit-top",children:[u.jsxs("div",{className:"bz-hit-main",children:[u.jsx("span",{className:"bz-hit-title",children:n.title}),u.jsxs("span",{className:"bz-hit-by",children:["by ",((r=n.producer)==null?void 0:r.name)||"a producer"]})]}),u.jsxs("div",{className:"bz-outcome",title:"How often this recipe actually gets people a working result",children:[u.jsx("strong",{children:gy(n.outcomeScore)})," of builds worked"]})]}),n.pitch&&u.jsx("p",{className:"bz-hit-pitch",children:n.pitch}),t.length>1&&u.jsxs("div",{className:"bz-others",children:["also on the shelf:"," ",t.slice(1,3).map((i,s)=>u.jsxs("span",{children:[s>0&&" · ",i.title," (",gy(i.outcomeScore),")"]},i.id))]})]})}function qD({data:e}){var n;const t=e.card||{};return u.jsxs("div",{className:"bazaar-card bz-recipe","data-testid":"bazaar-recipe",children:[u.jsx("span",{className:"bz-icon",children:"📖"}),u.jsxs("span",{className:"bz-recipe-text",children:["Absorbed ",u.jsx("strong",{children:t.title})," — ",((n=t.producer)==null?void 0:n.name)||"the producer","'s know-how",(()=>{const r=NS(t);return u.jsx("span",{className:`bz-badge bz-trust-${r.tone}`,title:r.note||void 0,children:r.label})})()]})]})}function KD({data:e}){return u.jsxs("div",{className:"bazaar-card bz-preview","data-testid":"bazaar-preview",children:[u.jsx("span",{className:"bz-icon",children:"▶️"}),u.jsx("span",{children:"Your live preview is open — try it on the right."})]})}function YD({recipe:e}){var c,d;const t=e.dataTouched||{},n=e.attestation||{},r=((c=e.vetting)==null?void 0:c.stakes)==="high",i=((d=e.producer)==null?void 0:d.name)||"a connected service",s=t.egress||[],o=t.paid||{},a=o.model&&o.model!=="none",l=n.privacy==="not-attested";return u.jsxs("div",{className:`bazaar-card bz-receipt${r?" bz-receipt-high":""}`,"data-testid":"bazaar-receipt",children:[u.jsxs("div",{className:"bz-receipt-head",children:[u.jsx("span",{className:"bz-icon",children:r?"⚠️":"🔌"}),u.jsx("span",{className:"bz-receipt-title",children:r?`Heads up before ${i} goes live`:`Now using ${i} — here's what that means`})]}),u.jsxs("ul",{className:"bz-receipt-lines",children:[s.length>0&&u.jsxs("li",{"data-testid":"bazaar-receipt-egress",children:[u.jsx("strong",{children:"Leaves your machine:"})," ",s.join(", ")," — sent to ",i,"."]}),a&&u.jsxs("li",{children:[u.jsx("strong",{children:"Cost:"})," ",o.note||o.model,". ",u.jsx(Pp,{})]}),u.jsxs("li",{"data-testid":"bazaar-receipt-privacy",className:l?"bz-receipt-warn":"",children:[u.jsx("strong",{children:"Privacy:"})," ",l?`${i} hasn't confirmed how it handles your data's privacy.`:`${i} has attested how it handles your data.`]}),u.jsx("li",{className:"bz-receipt-foot",children:"You can switch this off anytime — review it later in one place."})]}),r&&u.jsx("div",{className:"bz-receipt-confirm","data-testid":"bazaar-receipt-confirm",children:"This service moves money or takes a real-world action — make sure you're happy before it runs."})]})}function GD({data:e,bazaarState:t}){var c;const n=e.threeWay||{},r=(c=e.recipe)==null?void 0:c.producer,i=e.credit||{},s=((t==null?void 0:t.earnings)||[]).find(d=>d.handle===(r==null?void 0:r.handle)),o=(s==null?void 0:s.total)??i.oneTime??0,a=(s==null?void 0:s.matches)??0,l=!!e.service;return u.jsxs("div",{className:"bazaar-card bz-threeway","data-testid":"bazaar-threeway",children:[u.jsxs("div",{className:"bz-tw-head",children:[u.jsx("span",{className:"bz-tw-spark",children:"✦"})," Everyone just won"]}),u.jsxs("div",{className:"bz-tw-cols",children:[u.jsxs("div",{className:"bz-tw-col bz-tw-you",children:[u.jsx("div",{className:"bz-tw-who",children:"👤 You"}),u.jsx("div",{className:"bz-tw-what",children:n.you})]}),u.jsxs("div",{className:"bz-tw-col bz-tw-producer",children:[u.jsxs("div",{className:"bz-tw-who",children:["🏷️ ",(r==null?void 0:r.name)||"The producer"]}),u.jsx("div",{className:"bz-tw-what",children:n.producer}),u.jsxs("div",{className:"bz-tw-meter","data-testid":"bazaar-meter",children:[u.jsx("span",{className:"bz-meter-amount",children:jS(o)}),u.jsx("span",{className:"bz-meter-sub",children:l?`${a} ${a===1?"match":"matches"} so far`:"one-time"})]}),u.jsx(Pp,{})]}),u.jsxs("div",{className:"bz-tw-col bz-tw-vw",children:[u.jsx("div",{className:"bz-tw-who",children:"🟣 VentureWild"}),u.jsx("div",{className:"bz-tw-what",children:n.platform})]})]})]})}function XD({data:e}){const t=e.listing||{},n=e.earning||{};return u.jsxs("div",{className:"bazaar-card bz-publish","data-testid":"bazaar-publish",children:[u.jsxs("div",{className:"bz-head",children:[u.jsx("span",{className:"bz-icon",children:"📦"}),u.jsx("span",{className:"bz-head-title",children:"You're a producer now"})]}),u.jsxs("p",{className:"bz-publish-text",children:[u.jsx("strong",{children:t.title})," is on the shelf. You'll earn when other people build on it."]}),u.jsxs("div",{className:"bz-tw-meter",children:[u.jsx("span",{className:"bz-meter-amount",children:jS(n.oneTimeValue)}),u.jsxs("span",{className:"bz-meter-sub",children:["per build · ",u.jsx(Pp,{})]})]})]})}function JD({data:e,canReply:t,onQuickReply:n}){var i;const r=e.draft||{};return u.jsxs("div",{className:"bazaar-card bz-draft","data-testid":"bazaar-draft",children:[u.jsxs("div",{className:"bz-head",children:[u.jsx("span",{className:"bz-icon",children:"📝"}),u.jsx("span",{className:"bz-head-title",children:"Draft recipe — review before it goes on the shelf"})]}),u.jsx("div",{className:"bz-hit-main",children:u.jsx("span",{className:"bz-hit-title",children:r.title})}),r.pitch&&u.jsx("p",{className:"bz-hit-pitch",children:r.pitch}),r.sourceNote&&u.jsxs("div",{className:"bz-draft-source",children:["Generalized from: ",r.sourceNote]}),((i=r.tags)==null?void 0:i.length)>0&&u.jsx("div",{className:"bz-others",children:r.tags.slice(0,8).join(" · ")}),r.knowHow&&u.jsxs("details",{className:"bz-draft-knowhow",children:[u.jsx("summary",{children:"Preview the know-how — check it for any client specifics"}),u.jsx("pre",{children:r.knowHow})]}),n?u.jsxs("div",{className:"bz-draft-actions",children:[u.jsx("button",{type:"button",className:"bz-build-btn",disabled:!t,"data-testid":"bazaar-draft-publish",onClick:()=>t&&n(`Publish the “${r.title}” draft to my shelf.`),children:"Publish to my shelf →"}),u.jsx("button",{type:"button",className:"bz-draft-skip",disabled:!t,"data-testid":"bazaar-draft-skip",onClick:()=>t&&n(`Skip the “${r.title}” draft — don't publish that one.`),children:"Skip this one"}),u.jsx("span",{className:"bz-draft-hint",children:"Nothing's published until you choose."})]}):u.jsx("div",{className:"bz-draft-hint",children:"Nothing's published yet — tell me which drafts to put on your shelf."})]})}const ps=[{who:"Two HR people",occ:"recruiting team",built:"an AI platform that matches candidates to roles — no engineers on the team"},{who:"A freight-forwarding team",occ:"logistics",built:"an analytics brain that answers plain-language questions about their shipments"},{who:"A game-studio founder",occ:"games",built:"a world of AI agents that play and learn together"},{who:"A solo consultant",occ:"business consulting",built:"turned a year of client work into a product — this one"}],ZD="Most of the people building here have never written a line of code.",QD=4200;function eP(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Lp({variant:e="ambient"}){const t=e==="ambient"&&ps.length>1&&!eP(),[n,r]=w.useState(()=>Math.floor(Math.random()*ps.length));w.useEffect(()=>{if(!t)return;const s=setInterval(()=>r(o=>(o+1)%ps.length),QD);return()=>clearInterval(s)},[t]);const i=e==="block"?ps:[ps[n%ps.length]];return u.jsxs("div",{className:`peer-stream peer-stream-${e}`,"data-testid":"peer-stream",children:[i.map((s,o)=>u.jsxs("div",{className:"peer-item",children:[u.jsxs("span",{className:"peer-who",children:[s.who,s.occ?u.jsxs("span",{className:"peer-occ",children:[" · ",s.occ]}):null]}),u.jsx("span",{className:"peer-built",children:s.quote?`“${s.quote}”`:s.built})]},`${s.who}-${o}-${e==="ambient"?n:"all"}`)),u.jsx("p",{className:"peer-honest",children:ZD})]})}const mc="wild-workspace.chat.v2";function Yu({id:e,isDefault:t}={},n){const r=t||!e?mc:`${mc}:${e}`;return n?`${r}:${n}`:r}function tP({messageId:e,userText:t,agentText:n}={}){return!e||!t||!n?[]:[{id:`u-${e}`,role:"user",text:t},{id:e,role:"agent",blocks:[{type:"text",text:n}]}]}function nP(e,t=globalThis.localStorage,n=mc){const r=tP(e);if(!r.length||!t)return!1;try{const i=t.getItem(n),s=i?JSON.parse(i):[];return Array.isArray(s)&&s.length>0?!1:(t.setItem(n,JSON.stringify(r)),!0)}catch{return!1}}const Ed="wild:workspace:id";let Hs=null;try{Hs=typeof sessionStorage<"u"&&sessionStorage.getItem(Ed)||null}catch{Hs=null}function Yo(){return Hs}function rP(e){Hs=e||null;try{Hs?sessionStorage.setItem(Ed,Hs):sessionStorage.removeItem(Ed)}catch{}}function iP(e,t){var i;const n=e.blocks?e.blocks.slice():[],r=n[n.length-1];switch(t.type){case"text":return r&&r.type==="text"?n[n.length-1]={...r,text:r.text+t.text}:n.push({type:"text",text:t.text}),{...e,blocks:n};case"thinking":return r&&r.type==="thinking"?n[n.length-1]={...r,text:r.text+t.text}:n.push({type:"thinking",text:t.text}),{...e,blocks:n};case"tool-use":return n.push({type:"tool",id:t.id,name:t.name,input:t.input||{},done:!1}),{...e,blocks:n};case"tool-result":{const s=n.findIndex(o=>o.type==="tool"&&o.id===t.id);return s>=0&&(n[s]={...n[s],result:t.content,isError:t.isError,done:!0}),{...e,blocks:n}}case"usage":return{...e,usage:t.usage,costUsd:(i=t.usage)==null?void 0:i.cost_usd,durationMs:t.durationMs};case"error":return n.push({type:"error",text:t.message||"agent error"}),{...e,blocks:n};case"bazaar":{if(t.phase==="call")return n.push({type:"bazaar",id:t.id,tool:t.tool,phase:"call",input:t.input||{}}),{...e,blocks:n};if(t.phase==="result"){const s=n.findIndex(o=>o.type==="bazaar"&&o.id===t.id);return s>=0?n[s]={...n[s],phase:"result",data:t.data,isError:t.isError}:n.push({type:"bazaar",id:t.id,tool:t.tool,phase:"result",data:t.data}),{...e,blocks:n}}return e}case"canvas":{if(t.phase==="call")return n.push({type:"canvas",id:t.id,tool:t.tool,phase:"call"}),{...e,blocks:n};if(t.phase==="result"){const s=n.findIndex(a=>a.type==="canvas"&&a.id===t.id),o={type:"canvas",id:t.id,tool:t.tool,phase:"result",data:t.data,isError:t.isError};return s>=0?n[s]={...n[s],...o}:n.push(o),{...e,blocks:n}}return e}default:return e}}function yy(e,t,n){const r=e.findIndex(s=>s.id===t);if(r<0)return e;const i=e.slice();return i[r]=iP(i[r],n),i}function sP(e,t,n){if(!n||!n.trim())return e;const r=e.findIndex(s=>s.id===t);if(r<0)return e;const i=e.slice();return i[r]={...i[r],stderr:(i[r].stderr||"")+n},i}function oP({role:e,capabilities:t,mode:n,token:r,onBazaarEvent:i,inject:s,agentName:o,storageKey:a,threadId:l}){const c=a||mc,[d,h]=w.useState(()=>{try{const O=localStorage.getItem(c);if(O)return JSON.parse(O)}catch{}return[]}),[f,p]=w.useState(null),[m,y]=w.useState(!1),[b,_]=w.useState(""),[v,g]=w.useState(!1),[S,C]=w.useState(null),x=w.useRef(null),T=w.useRef(null),P=w.useRef(!0),B=w.useRef(i),j=w.useRef(null),$=w.useRef(null),I=w.useRef(null);w.useEffect(()=>{B.current=i},[i]),w.useEffect(()=>{try{localStorage.setItem(c,JSON.stringify(d.slice(-120)))}catch{}},[d]),w.useEffect(()=>{const O=T.current;O&&P.current&&(O.scrollTop=O.scrollHeight)},[d]);function R(){const O=T.current;O&&(P.current=O.scrollHeight-O.scrollTop-O.clientHeight<90)}w.useEffect(()=>{let O=!1,k=0,Q=null,ne=null;const E=()=>{if(O)return;const ce=window.location.protocol==="https:"?"wss":"ws",_e=new URL(`${ce}://${window.location.host}/ws/chat`);r&&_e.searchParams.set("t",r);const te=Yo();te&&_e.searchParams.set("workspace",te),l&&_e.searchParams.set("thread",l),ne=new WebSocket(_e.toString()),x.current=ne,ne.onopen=()=>{k=0,g(!0)},ne.onmessage=ae=>{var he,Pe,be,Se,L,ge,oe,ye,Te,Le;let se;try{se=JSON.parse(ae.data)}catch{return}if(!(se.threadId&&se.threadId!==l)){if(se.type==="chunk"){const Y=se.chunk;if(h(pe=>yy(pe,se.messageId,Y)),(Y==null?void 0:Y.type)==="bazaar"&&Y.phase==="result"&&!Y.isError){const pe=Y.data||{};if(Y.tool==="launch_preview"||Y.tool==="record_use"&&pe.preview){const Ae=pe.url||((he=pe.preview)==null?void 0:he.url)||"/preview/";(Pe=B.current)==null||Pe.call(B,{type:"preview",url:Ae,ts:Date.now()}),j.current=Ae}}(Y==null?void 0:Y.type)==="canvas"&&Y.phase==="result"&&!Y.isError&&((be=Y.data)==null?void 0:be.kind)==="block"&&Y.data.block&&((Se=B.current)==null||Se.call(B,{type:"block",op:Y.data.op||"make",block:Y.data.block})),(Y==null?void 0:Y.type)==="canvas"&&Y.phase==="result"&&!Y.isError&&((L=Y.data)==null?void 0:L.kind)==="theme"&&Y.data.op==="set"&&Y.data.theme&&((ge=B.current)==null||ge.call(B,{type:"theme",theme:Y.data.theme})),(Y==null?void 0:Y.type)==="bazaar"&&Y.phase==="result"&&!Y.isError&&((oe=Y.data)==null?void 0:oe.kind)==="theme-applied"&&Y.data.theme&&((ye=B.current)==null||ye.call(B,{type:"theme",theme:Y.data.theme}))}else if(se.type==="bazaar")se.phase==="meter"&&(C(se.state),(Te=B.current)==null||Te.call(B,{type:"meter",state:se.state}));else if(se.type==="usage")(Le=B.current)==null||Le.call(B,{type:"usage",state:se.state});else if(se.type==="stderr")h(Y=>sP(Y,se.messageId,se.text));else if(se.type==="end"){if(p(null),y(!1),j.current){let Y=j.current;j.current=null;try{Y=new URL(Y,window.location.origin).href}catch{}h(pe=>[...pe,{id:`win-${Date.now()}`,role:"win",url:Y}])}}else if(se.type==="error")p(null),y(!1),j.current=null,se.messageId?h(Y=>yy(Y,se.messageId,{type:"error",message:se.message||"agent error"})):h(Y=>[...Y,{id:`err-${Date.now()}`,role:"error",text:se.message||"agent error"}]);else if(se.type==="turn-begin")j.current=null,h(Y=>{if(Y.some(Ae=>Ae.id===se.messageId))return Y;const pe=[];return se.userText&&pe.push({id:`u-${se.messageId}`,role:"user",text:se.userText}),se.note&&pe.push({id:`note-${se.messageId}`,role:"system",text:se.note}),pe.push({id:se.messageId,role:"agent",blocks:[]}),[...Y,...pe]}),p(se.messageId),y(!0);else if(se.type==="reset"){h([]),p(null),y(!1),j.current=null;try{localStorage.removeItem(c)}catch{}}}},ne.onerror=()=>y(!1),ne.onclose=()=>{if(g(!1),y(!1),p(null),O)return;const ae=Math.min(1e3*2**k,1e4);k+=1,Q=setTimeout(E,ae)}};return E(),()=>{O=!0,clearTimeout(Q);try{ne==null||ne.close()}catch{}}},[r,l]);function A(O,k){if(!t.chatWrite)return;const Q=(typeof O=="string"?O:b).trim();if(!Q||m)return;const ne=typeof k=="string"&&k.trim()||Q,E=x.current,ce=E==null?void 0:E.readyState;if(!E||ce!==WebSocket.OPEN&&ce!==WebSocket.CONNECTING){h(ae=>[...ae,{id:`err-${Date.now()}`,role:"error",text:"reconnecting to your agent — try again in a few seconds"}]);return}const _e=`m-${Date.now()}`;P.current=!0,h(ae=>[...ae,{id:`u-${_e}`,role:"user",text:ne},{id:_e,role:"agent",blocks:[]}]),p(_e),y(!0),_("");const te=JSON.stringify({type:"send",text:Q,mode:n,messageId:_e,...l?{threadId:l}:{}});ce===WebSocket.OPEN?E.send(te):E.addEventListener("open",()=>{try{E.send(te)}catch{}},{once:!0})}$.current=A,w.useEffect(()=>{var O;!(s!=null&&s.text)||I.current===s.ts||(I.current=s.ts,P.current=!0,(O=$.current)==null||O.call($,s.text))},[s]);function N(){var O;((O=x.current)==null?void 0:O.readyState)===WebSocket.OPEN&&x.current.send(JSON.stringify({type:"cancel",...l?{threadId:l}:{}})),y(!1),p(null)}function z(){var O;((O=x.current)==null?void 0:O.readyState)===WebSocket.OPEN&&x.current.send(JSON.stringify({type:"reset",...l?{threadId:l}:{}})),h([]),p(null),y(!1),j.current=null;try{localStorage.removeItem(c)}catch{}}function U(O){O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),A())}const D=d.length===0;return u.jsxs(u.Fragment,{children:[!D&&t.chatWrite&&u.jsx("div",{className:"chat-toolbar","data-testid":"chat-toolbar",children:u.jsx("button",{className:"chat-newbtn",onClick:z,disabled:m,"data-testid":"new-chat-btn",title:"Start a fresh conversation — the agent forgets the current thread",children:"+ New chat"})}),u.jsxs("div",{className:"chat-messages",ref:T,onScroll:R,"data-testid":"chat-messages",children:[D&&u.jsx(mP,{role:e,connected:v,agentName:o,canSend:t.chatWrite&&!m,onSend:A}),d.map(O=>u.jsx(aP,{message:O,streaming:O.id===f,bazaarState:S,canReply:t.chatWrite&&!m,onQuickReply:A},O.id))]}),t.chatWrite&&u.jsxs("div",{className:"chat-input","data-testid":"chat-input",children:[u.jsx("textarea",{"data-testid":"chat-textarea",placeholder:e==="client"?"Describe the change you’d like…":"Ask the agent to build, fix, or explain something — Enter to send",value:b,onChange:O=>_(O.target.value),onKeyDown:U,disabled:m,rows:2}),m?u.jsx("button",{onClick:N,"data-testid":"cancel-btn",children:"Stop"}):u.jsx("button",{className:"primary send-btn",onClick:A,disabled:!b.trim(),"data-testid":"send-btn",children:"Send"})]}),!t.chatWrite&&e==="viewer"&&u.jsx("div",{className:"chat-readonly-banner",children:"You’re viewing a shared workspace (read-only)."})]})}function aP({message:e,streaming:t,bazaarState:n,canReply:r,onQuickReply:i}){if(e.role==="user")return u.jsx("div",{className:"chat-msg user","data-testid":"chat-msg-user",children:u.jsx("div",{className:"msg-plain",children:e.text})});if(e.role==="system")return u.jsx("div",{className:"chat-msg system","data-testid":"chat-msg-system",children:e.text});if(e.role==="win")return u.jsx(dP,{url:e.url});if(e.role==="error")return u.jsxs("div",{className:"chat-msg error","data-testid":"chat-msg-error",children:["⚠ ",e.text]});const s=e.blocks||[],o=s[s.length-1],a=t&&(o==null?void 0:o.type)==="text"?s.length-1:-1,l=t&&(s.length===0||(o==null?void 0:o.type)==="tool"&&o.done);return u.jsxs("div",{className:"chat-msg agent","data-testid":"chat-msg-agent",children:[s.map((c,d)=>u.jsx(lP,{block:c,cursor:d===a,bazaarState:n,canReply:r,onQuickReply:i},c.id||`${c.type}-${d}`)),l&&u.jsx(fP,{}),e.usage&&u.jsx(pP,{usage:e.usage,costUsd:e.costUsd,durationMs:e.durationMs}),e.stderr&&u.jsxs("details",{className:"stderr-block",children:[u.jsx("summary",{children:"stderr"}),u.jsx("pre",{children:e.stderr})]})]})}function lP({block:e,cursor:t,bazaarState:n,canReply:r,onQuickReply:i}){var s;return e.type==="bazaar"?u.jsx($D,{block:e,bazaarState:n,canReply:r,onQuickReply:i}):e.type==="text"?u.jsxs("div",{className:"agent-text",children:[u.jsx(ES,{text:e.text}),t&&u.jsx("span",{className:"stream-cursor"})]}):e.type==="thinking"?u.jsxs("details",{className:"thinking-block",children:[u.jsx("summary",{children:"💭 Thought process"}),u.jsx("div",{className:"thinking-body",children:e.text})]}):e.type==="tool"?e.name==="AskUserQuestion"&&Array.isArray((s=e.input)==null?void 0:s.questions)&&e.input.questions.length?u.jsx(uP,{block:e,canReply:r,onQuickReply:i}):u.jsx(FD,{block:e}):e.type==="canvas"?u.jsx(cP,{block:e}):e.type==="error"?u.jsxs("div",{className:"agent-error",children:["⚠ ",e.text]}):null}function cP({block:e}){var r,i,s,o;if(e.phase==="result"&&!e.isError&&((r=e.data)==null?void 0:r.kind)==="theme"&&e.data.op==="set"){const a=(i=e.data.theme)==null?void 0:i.name;return u.jsxs("div",{className:"canvas-card","data-testid":"canvas-card",children:[u.jsx("span",{className:"canvas-card-icon",children:"🎨"}),u.jsxs("span",{className:"canvas-card-text",children:["Restyled your workspace",a?u.jsxs(u.Fragment,{children:[" — ",u.jsx("strong",{children:a})]}):null]})]})}const t=(s=e.data)==null?void 0:s.block;if(e.phase==="call"||!t)return u.jsx("div",{className:"canvas-card is-pending","data-testid":"canvas-card",children:"🧩 Building a block…"});if(e.isError)return u.jsx("div",{className:"canvas-card is-error","data-testid":"canvas-card",children:"⚠ Couldn’t build that block."});const n=((o=e.data)==null?void 0:o.op)==="update"?"Updated":"Added";return u.jsxs("div",{className:"canvas-card","data-testid":"canvas-card",children:[u.jsx("span",{className:"canvas-card-icon",children:t.icon||"🧩"}),u.jsxs("span",{className:"canvas-card-text",children:[n," ",u.jsx("strong",{children:t.title})," to your canvas"]})]})}function uP({block:e,canReply:t,onQuickReply:n}){const r=e.input.questions;return u.jsxs("div",{className:"ask-card","data-testid":"ask-card",children:[u.jsxs("div",{className:"ask-head",children:[u.jsx("span",{className:"ask-icon",children:"🤔"}),u.jsx("span",{children:"Your call"})]}),r.map((i,s)=>u.jsx(hP,{q:i,canReply:t,onQuickReply:n},s)),u.jsx("div",{className:"ask-foot",children:"…or just type your answer below."})]})}function hP({q:e,canReply:t,onQuickReply:n}){const[r,i]=w.useState([]),s=!!e.multiSelect,o=Array.isArray(e.options)?e.options:[],a=l=>i(c=>c.includes(l)?c.filter(d=>d!==l):[...c,l]);return u.jsxs("div",{className:"ask-q",children:[e.header&&u.jsx("span",{className:"ask-q-header",children:e.header}),e.question&&u.jsx("p",{className:"ask-q-text",children:e.question}),u.jsx("div",{className:"ask-options",children:o.map((l,c)=>s?u.jsxs("button",{type:"button",className:`ask-opt${r.includes(l.label)?" sel":""}`,disabled:!t,onClick:()=>a(l.label),title:l.description||"",children:[u.jsx("span",{className:"ask-opt-check",children:r.includes(l.label)?"☑":"☐"}),u.jsxs("span",{className:"ask-opt-main",children:[u.jsx("span",{className:"ask-opt-label",children:l.label}),l.description&&u.jsx("span",{className:"ask-opt-desc",children:l.description})]})]},c):u.jsxs("button",{type:"button",className:"ask-opt",disabled:!t,onClick:()=>t&&n(l.label),title:l.description||"",children:[u.jsxs("span",{className:"ask-opt-main",children:[u.jsx("span",{className:"ask-opt-label",children:l.label}),l.description&&u.jsx("span",{className:"ask-opt-desc",children:l.description})]}),u.jsx("span",{className:"ask-opt-go",children:"→"})]},c))}),s&&u.jsxs("button",{type:"button",className:"primary ask-send",disabled:!t||!r.length,onClick:()=>t&&r.length&&n(r.join(", ")),children:["Send",r.length?` (${r.length})`:""]})]})}function dP({url:e}){let t=e;try{const n=new URL(e);t=`${n.host}${n.pathname==="/"?"":n.pathname}`}catch{}return u.jsxs("div",{className:"chat-msg win-card","data-testid":"win-card",children:[u.jsx("span",{className:"win-spark",children:"✨"}),u.jsxs("div",{className:"win-body",children:[u.jsx("span",{className:"win-lead",children:"It’s live — this is yours:"}),u.jsx("a",{className:"win-url",href:e,target:"_blank",rel:"noreferrer",children:t}),u.jsx("span",{className:"win-sub",children:"Open it, or send it to someone."})]})]})}function fP(){return u.jsxs("div",{className:"agent-working","data-testid":"agent-working",children:[u.jsxs("span",{className:"dots",children:[u.jsx("i",{}),u.jsx("i",{}),u.jsx("i",{})]}),"working"]})}function pP({usage:e,costUsd:t,durationMs:n}){const r=typeof t=="number"?t:e==null?void 0:e.cost_usd;return u.jsxs("div",{className:"usage-footer","data-testid":"usage-footer",children:[(e==null?void 0:e.output_tokens)!=null&&u.jsxs("span",{title:"output tokens",children:["↑ ",e.output_tokens.toLocaleString()]}),typeof r=="number"&&r>0&&u.jsxs("span",{title:"cost (USD)",children:["$",r.toFixed(4)]}),n!=null&&u.jsxs("span",{children:[(n/1e3).toFixed(1),"s"]})]})}function mP({role:e,connected:t,agentName:n,canSend:r,onSend:i}){if(e==="client")return u.jsxs("div",{className:"chat-empty","data-testid":"chat-empty",children:[u.jsx("div",{className:"chat-empty-mark",children:"✦"}),u.jsx("p",{className:"chat-empty-title",children:"Describe what you’d like changed"}),u.jsx("p",{className:"chat-empty-sub",children:"The team’s AI agent will pick it up and you’ll see it here."}),!t&&u.jsx("p",{className:"chat-empty-warn",children:"connecting to the agent bridge…"})]});const s=n&&n!=="Chat"?n:null,o=[{label:"✦ Build my workspace for me",display:"Build my workspace for me.",primary:!0,prompt:"Set up a friendly starter workspace for me. Use your canvas tools to add a couple of useful blocks — for example a short welcome note, a quick getting-started checklist, and maybe a tips block — and pick a warm, welcoming theme if you'd like. Narrate as you go in short plain lines (one line per step, no jargon) so I can watch it come together. Then say a brief, friendly hello telling me what you set up. Keep it light."},{label:"Show me around",display:"Show me around.",prompt:"What's in this workspace? Give me a quick, friendly tour."},{label:"Make something I can show off",display:"Make something I can show off.",prompt:"Build me a simple, good-looking landing page, and put a Live view on my canvas so I can watch it come together. Narrate as you go in short plain lines — one line per step, no jargon. When it’s done, tell me where to see it."}];return u.jsxs("div",{className:"chat-empty","data-testid":"chat-empty",children:[u.jsx("div",{className:"chat-empty-mark",children:"✦"}),u.jsx("p",{className:"chat-empty-title",children:s?`Hi — I’m ${s}.`:"Hi — I’m your agent."}),u.jsx("p",{className:"chat-empty-sub",children:"Tell me what you’re working on and I’ll set it up for you — I can build, write, and arrange your workspace as we go. Not sure where to start?"}),u.jsx("div",{className:"chat-empty-starters",children:o.map(a=>u.jsx("button",{type:"button",className:`chat-empty-starter${a.primary?" primary":""}`,onClick:()=>i==null?void 0:i(a.prompt,a.display),disabled:!r||!t,"data-testid":"chat-empty-starter",children:a.label},a.label))}),!t&&u.jsx("p",{className:"chat-empty-warn",children:"connecting to the agent bridge…"}),u.jsx(Lp,{variant:"ambient"})]})}function gP(e){var n;const t=(n=e==null?void 0:e.session)==null?void 0:n.source;return t==="localhost"||t==="loopback"}function yP(e){return(String(e||"?").split("@")[0].replace(/[^a-zA-Z0-9]/g,"").slice(0,2)||"?").toUpperCase()}function _P(e){let t=0;const n=String(e||"");for(let r=0;r<n.length;r+=1)t=(t*31+n.charCodeAt(r))%360;return`hsl(${t} 52% 42%)`}function vP({session:e,onEnter:t,onClose:n}){var Se;const[r,i]=w.useState(null),[s,o]=w.useState(null),[a,l]=w.useState(!1),[c,d]=w.useState(0),[h,f]=w.useState(""),[p,m]=w.useState(""),[y,b]=w.useState(!1),[_,v]=w.useState(null),[g,S]=w.useState(null),[C,x]=w.useState(""),[T,P]=w.useState(null),[B,j]=w.useState(null),[$,I]=w.useState(""),[R,A]=w.useState(""),[N,z]=w.useState(null),[U,D]=w.useState({}),O=w.useRef(null),k=gP(e),Q=!!((Se=e==null?void 0:e.account)!=null&&Se.email);async function ne(){try{const L=await fetch("/api/lobby/workspaces");if(!L.ok)throw new Error(`HTTP ${L.status}`);const ge=await L.json();i(Array.isArray(ge.workspaces)?ge.workspaces:[])}catch(L){o(String((L==null?void 0:L.message)||L)),i([])}}w.useEffect(()=>{ne()},[]),w.useEffect(()=>{var L;r&&r.length&&((L=O.current)==null||L.focus())},[r]);async function E(L){if(!(!L||a)){if(L.joinable){ae(L);return}l(!0);try{await fetch(`/api/lobby/workspaces/${encodeURIComponent(L.id)}/open`,{method:"POST"})}catch{}t(L.id)}}async function ce({name:L,dir:ge}){if(!a){l(!0),o(null);try{const oe=await fetch("/api/lobby/workspaces",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(L?{name:L}:{dir:ge})}),ye=await oe.json().catch(()=>null);if(!oe.ok){o((ye==null?void 0:ye.message)||(ye==null?void 0:ye.error)||`create failed (HTTP ${oe.status})`),l(!1);return}t(ye.workspace.id)}catch(oe){o(String((oe==null?void 0:oe.message)||oe)),l(!1)}}}async function _e(L){if(!a){l(!0),o(null);try{const ge=await fetch(`/api/lobby/workspaces/${encodeURIComponent(L.id)}/share`,{method:"POST"}),oe=await ge.json().catch(()=>null);if(!ge.ok){o((oe==null?void 0:oe.message)||(oe==null?void 0:oe.error)||`couldn’t share (HTTP ${ge.status})`);return}v(null),await ne(),S(L.id),P(null),x("")}catch(ge){o(String((ge==null?void 0:ge.message)||ge))}finally{l(!1)}}}async function te(L){const ge=C.trim();if(!(!ge||a)){l(!0),P(null);try{const oe=await fetch(`/api/lobby/workspaces/${encodeURIComponent(L.id)}/invite`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({email:ge})}),ye=await oe.json().catch(()=>null);if(!oe.ok){P({ok:!1,text:(ye==null?void 0:ye.message)||(ye==null?void 0:ye.error)||`invite failed (HTTP ${oe.status})`});return}P({ok:!0,text:ye!=null&&ye.pending?`Invited ${ge}. They’ll see this workspace the next time they sign in to VentureWild — just let them know to sign in.`:`${ge} is in — they’ll see this workspace when they sign in.`}),x("")}catch(oe){P({ok:!1,text:String((oe==null?void 0:oe.message)||oe)})}finally{l(!1)}}}function ae(L){j(ge=>ge===L.id?null:L.id),I(L.name||""),A(""),o(null)}async function se(L){const ge=N!==L.id;if(z(ge?L.id:null),!(!ge||U[L.id])){D(oe=>({...oe,[L.id]:{loading:!0,members:[]}}));try{const ye=await(await fetch(`/api/lobby/workspaces/${encodeURIComponent(L.id)}/members`)).json().catch(()=>null);D(Te=>({...Te,[L.id]:{loading:!1,members:Array.isArray(ye==null?void 0:ye.members)?ye.members:[]}}))}catch{D(oe=>({...oe,[L.id]:{loading:!1,members:[]}}))}}}async function he(L){var ge;if(!a){l(!0),o(null);try{const oe=R.trim(),ye={slug:((ge=L.shared)==null?void 0:ge.slug)||L.slug};oe?ye.dir=oe:ye.name=$.trim()||L.name;const Te=await fetch("/api/lobby/workspaces/join",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(ye)}),Le=await Te.json().catch(()=>null);if(!Te.ok){o((Le==null?void 0:Le.message)||(Le==null?void 0:Le.error)||`couldn’t join (HTTP ${Te.status})`);return}t(Le.workspace.id)}catch(oe){o(String((oe==null?void 0:oe.message)||oe))}finally{l(!1)}}}function Pe(L){var ge;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{..._y,...kP},children:[u.jsxs("div",{style:{...vy,cursor:"default"},children:[u.jsx("span",{style:{fontWeight:600},children:L.name}),u.jsx("span",{"data-testid":`lobby-shared-${L.id}`,style:by,children:"shared"}),u.jsx("span",{style:{flex:1}}),u.jsx("span",{style:{color:"var(--text-muted)",fontSize:12},children:(ge=L.shared)!=null&&ge.ownerEmail?`invited by ${L.shared.ownerEmail}`:"shared with you"})]}),k?u.jsx("button",{"data-testid":`lobby-join-${L.id}`,onClick:()=>ae(L),disabled:a,style:el,title:"Save it to a folder on this computer",children:"Join"}):u.jsx("span",{style:{fontSize:12,color:"var(--text-muted)",paddingRight:4},children:"join from your computer"})]}),B===L.id&&u.jsxs("div",{"data-testid":`lobby-join-panel-${L.id}`,style:tl,children:[u.jsxs("p",{style:{margin:"0 0 8px",fontSize:13,lineHeight:1.5},children:["Pick where ",u.jsx("strong",{children:L.name})," lives on this computer — your agent here joins the shared brain."]}),u.jsxs("div",{style:{display:"flex",gap:8},children:[u.jsx("input",{"data-testid":`lobby-join-name-${L.id}`,value:$,onChange:oe=>I(oe.target.value),onKeyDown:oe=>{oe.key==="Enter"&&he(L)},placeholder:"Folder name…",style:_o,disabled:a}),u.jsx("button",{className:"primary","data-testid":`lobby-join-confirm-${L.id}`,onClick:()=>he(L),disabled:a,children:"Join"})]}),u.jsx("input",{"data-testid":`lobby-join-path-${L.id}`,value:R,onChange:oe=>A(oe.target.value),placeholder:"…or paste an existing folder path",style:{..._o,marginTop:8,width:"100%"},disabled:a})]})]})}function be(L){!r||!r.length||(L.key==="ArrowDown"?(L.preventDefault(),d(ge=>Math.min(r.length-1,ge+1))):L.key==="ArrowUp"?(L.preventDefault(),d(ge=>Math.max(0,ge-1))):L.key==="Enter"&&(L.preventDefault(),E(r[c])))}return u.jsx("div",{className:"app lobby","data-testid":"lobby",style:bP,children:u.jsxs("div",{style:wP,children:[u.jsxs("header",{style:{marginBottom:18},children:[u.jsx("h1",{style:{margin:0,fontSize:22},children:"Your workspaces"}),u.jsxs("p",{style:{margin:"6px 0 0",color:"var(--text-muted)",fontSize:13},children:["Pick one to dive in",k?", or start a new one":"",". Each keeps its own files and its own agent."]})]}),s&&u.jsx("p",{"data-testid":"lobby-error",style:{color:"var(--error)",fontSize:13},children:s}),r===null?u.jsxs("div",{style:{color:"var(--text-muted)",padding:12},children:[u.jsx("span",{className:"spinner"})," Loading…"]}):r.length===0?u.jsxs("div",{"data-testid":"lobby-empty",style:SP,children:[u.jsx("div",{style:{fontSize:26,marginBottom:6},children:"✦"}),u.jsx("p",{style:{margin:"0 0 4px",fontSize:16,fontWeight:600},children:k?"Let's create your first workspace":"No workspaces here yet"}),u.jsx("p",{style:{margin:0,color:"var(--text-muted)",fontSize:13,lineHeight:1.5},children:k?"A workspace is just a folder your agent works in. Name one below — your agent meets you inside.":"Create one on your computer to get started; its files live there."})]}):u.jsx("ul",{ref:O,tabIndex:0,onKeyDown:be,"data-testid":"lobby-list",style:{listStyle:"none",margin:0,padding:0,outline:"none"},children:r.map((L,ge)=>{var oe,ye,Te,Le;return u.jsx("li",{children:L.joinable?Pe(L):u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{..._y,...ge===c?xP:null},children:[u.jsxs("button",{"data-testid":`lobby-card-${L.id}`,onClick:()=>{d(ge),E(L)},disabled:a,style:vy,children:[u.jsx("span",{style:{fontWeight:600},children:L.name}),L.isDefault&&u.jsx("span",{style:CP,children:"default"}),L.kind==="shared"&&u.jsx("span",{"data-testid":`lobby-shared-${L.id}`,style:by,children:"shared"}),L.kind==="shared"&&u.jsx("span",{"data-testid":`lobby-sync-${L.id}`,style:(oe=L.shared)!=null&&oe.projectCode?RS:EP,title:(ye=L.shared)!=null&&ye.projectCode?"Files replicate to teammates via VentureWild":"File sync starts when this computer’s sync service is online",children:(Te=L.shared)!=null&&Te.projectCode?"⟳ synced":"sync pending"}),u.jsx("span",{style:{flex:1}}),u.jsx("span",{style:{color:"var(--text-muted)",fontSize:12},children:L.dir})]}),k&&Q&&L.kind!=="shared"&&u.jsx("button",{"data-testid":`lobby-share-${L.id}`,onClick:()=>{v(L.id),S(null)},disabled:a,style:el,title:"Make this a shared workspace",children:"Share"}),k&&Q&&L.kind==="shared"&&((Le=L.shared)==null?void 0:Le.role)==="owner"&&u.jsx("button",{"data-testid":`lobby-invite-toggle-${L.id}`,onClick:()=>{S(Y=>Y===L.id?null:L.id),P(null)},disabled:a,style:el,title:"Invite a teammate",children:"+ Invite"}),Q&&L.kind==="shared"&&u.jsx("button",{"data-testid":`lobby-members-toggle-${L.id}`,onClick:()=>se(L),disabled:a,style:el,title:"See who's in this workspace",children:"Members"})]}),N===L.id&&L.kind==="shared"&&u.jsx("div",{"data-testid":`lobby-roster-${L.id}`,style:tl,children:(()=>{const Y=U[L.id];return!Y||Y.loading?u.jsx("p",{style:wy,children:"Loading members…"}):Y.members.length?u.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:Y.members.map((pe,Ae)=>{const Ke=pe.status==="invited";return u.jsxs("div",{"data-testid":`lobby-roster-member-${L.id}-${Ae}`,style:{display:"flex",alignItems:"center",gap:8},children:[u.jsx("span",{"aria-hidden":!0,style:{...jP,background:_P(pe.email),opacity:Ke?.5:1},children:yP(pe.email)}),u.jsx("span",{style:NP,children:pe.email}),u.jsx("span",{style:Ke?DP:pe.role==="owner"?RP:TP,children:Ke?"invited":pe.role})]},pe.account_id||pe.email||Ae)})}):u.jsx("p",{style:wy,children:"Just you so far — invite a teammate to grow the team."})})()}),_===L.id&&u.jsxs("div",{"data-testid":`lobby-share-prompt-${L.id}`,style:tl,children:[u.jsxs("p",{style:{margin:"0 0 8px",fontSize:13,lineHeight:1.5},children:["Make ",u.jsx("strong",{children:L.name})," a shared workspace? Teammates you invite become ",u.jsx("strong",{children:"equal members"})," — they get the files ",u.jsx("strong",{children:"and"})," ","everything your agent has learned about this work. That shared memory is the point."]}),u.jsxs("div",{style:{display:"flex",gap:8},children:[u.jsx("button",{className:"primary","data-testid":`lobby-share-confirm-${L.id}`,onClick:()=>_e(L),disabled:a,children:"Share it"}),u.jsx("button",{onClick:()=>v(null),disabled:a,children:"Cancel"})]})]}),g===L.id&&L.kind==="shared"&&u.jsxs("div",{"data-testid":`lobby-invite-${L.id}`,style:tl,children:[u.jsxs("div",{style:{display:"flex",gap:8},children:[u.jsx("input",{"data-testid":`lobby-invite-email-${L.id}`,type:"email",value:C,onChange:Y=>x(Y.target.value),onKeyDown:Y=>{Y.key==="Enter"&&C.trim()&&te(L)},placeholder:"teammate@email.com",style:_o,disabled:a}),u.jsx("button",{className:"primary","data-testid":`lobby-invite-send-${L.id}`,onClick:()=>te(L),disabled:a||!C.trim(),children:"Send invite"})]}),T&&u.jsx("p",{"data-testid":`lobby-invite-msg-${L.id}`,style:{margin:"8px 0 0",fontSize:12,color:T.ok?"var(--accent, #0891b2)":"var(--error)"},children:T.text})]})]})},L.id)})}),k&&u.jsxs("div",{style:{marginTop:18,borderTop:"1px solid var(--border)",paddingTop:16},children:[u.jsxs("div",{style:{display:"flex",gap:8},children:[u.jsx("input",{"data-testid":"lobby-new-name",value:h,onChange:L=>f(L.target.value),onKeyDown:L=>{L.key==="Enter"&&h.trim()&&ce({name:h.trim()})},placeholder:"Name a new workspace…",style:_o,disabled:a}),u.jsx("button",{className:"primary","data-testid":"lobby-create",onClick:()=>h.trim()&&ce({name:h.trim()}),disabled:a||!h.trim(),children:"+ New workspace"})]}),y?u.jsxs("div",{style:{display:"flex",gap:8,marginTop:8},children:[u.jsx("input",{"data-testid":"lobby-open-path",value:p,onChange:L=>m(L.target.value),onKeyDown:L=>{L.key==="Enter"&&p.trim()&&ce({dir:p.trim()})},placeholder:"…or paste the path to an existing folder",style:_o,disabled:a}),u.jsx("button",{"data-testid":"lobby-open",onClick:()=>p.trim()&&ce({dir:p.trim()}),disabled:a||!p.trim(),children:"Open folder"})]}):u.jsx("button",{"data-testid":"lobby-open-toggle",onClick:()=>b(!0),style:{marginTop:8,background:"none",border:"none",color:"var(--accent, #4a90d9)",cursor:"pointer",fontSize:13,padding:0},children:"or open an existing folder →"})]}),n&&u.jsx("div",{style:{marginTop:18},children:u.jsx("button",{"data-testid":"lobby-close",onClick:n,children:"← Back to my workspace"})})]})})}const bP={display:"flex",alignItems:"flex-start",justifyContent:"center",padding:"8vh 16px",height:"100%",overflow:"auto"},wP={width:"100%",maxWidth:640},SP={textAlign:"center",padding:"20px 16px 24px",border:"1px dashed var(--border)",borderRadius:12,marginBottom:8},_y={display:"flex",alignItems:"center",gap:8,width:"100%",marginBottom:8,borderRadius:10,border:"1px solid var(--border)",background:"var(--surface, transparent)",paddingRight:10},vy={display:"flex",alignItems:"center",gap:10,flex:1,minWidth:0,textAlign:"left",padding:"12px 14px",background:"none",border:"none",borderRadius:10,color:"inherit",font:"inherit",cursor:"pointer"},xP={border:"1px solid var(--accent, #4a90d9)",boxShadow:"0 0 0 1px var(--accent, #4a90d9)"},kP={borderStyle:"dashed"},CP={fontSize:11,padding:"1px 6px",borderRadius:6,border:"1px solid var(--border)",color:"var(--text-muted)"},by={fontSize:11,padding:"1px 6px",borderRadius:6,border:"1px solid var(--accent, #0891b2)",color:"var(--accent, #0891b2)"},RS={fontSize:11,padding:"1px 6px",borderRadius:6,color:"var(--text-muted)"},EP={...RS,fontStyle:"italic",opacity:.75},el={fontSize:12,padding:"5px 10px",borderRadius:8,border:"1px solid var(--border)",background:"var(--surface, transparent)",color:"inherit",cursor:"pointer",whiteSpace:"nowrap"},tl={margin:"-2px 0 10px",padding:"10px 12px",borderRadius:10,border:"1px solid var(--border)",background:"var(--surface-2, var(--surface, transparent))"},_o={flex:1,padding:"8px 10px",borderRadius:8,border:"1px solid var(--border)",background:"var(--surface, transparent)",color:"inherit"},wy={margin:0,fontSize:12,color:"var(--text-muted)"},NP={fontSize:13,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},jP={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:999,flexShrink:0,fontSize:10,fontWeight:700,color:"#fff",letterSpacing:.3},Ap={fontSize:10,padding:"1px 6px",borderRadius:6,whiteSpace:"nowrap"},RP={...Ap,border:"1px solid var(--accent, #0891b2)",color:"var(--accent, #0891b2)"},TP={...Ap,border:"1px solid var(--border)",color:"var(--text-muted)"},DP={...Ap,border:"1px dashed var(--border)",color:"var(--text-muted)",fontStyle:"italic"};function is(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function xr(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function nl(e,t,n,r,i,s,o){const{margin:a,containerPadding:l,rowHeight:c}=e,d=is(e);let h,f,p,m;if(o?(h=Math.round(o.width),f=Math.round(o.height)):(h=xr(r,d,a[0]),f=xr(i,c,a[1])),s?(p=Math.round(s.top),m=Math.round(s.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((c+a[1])*n+l[1]),m=Math.round((d+a[0])*t+l[0])),!s&&!o){if(Number.isFinite(r)){const b=Math.round((d+a[0])*(t+r)+l[0])-m-h;b!==a[0]&&(h+=b-a[0])}if(Number.isFinite(i)){const b=Math.round((c+a[1])*(n+i)+l[1])-p-f;b!==a[1]&&(f+=b-a[1])}}return{top:p,left:m,width:h,height:f}}function PP(e,t,n,r,i){const{margin:s,containerPadding:o,cols:a,rowHeight:l,maxRows:c}=e,d=is(e);let h=Math.round((n-o[0])/(d+s[0])),f=Math.round((t-o[1])/(l+s[1]));return h=gc(h,0,a-r),f=gc(f,0,c-i),{x:h,y:f}}function rl(e,t,n){const{margin:r,containerPadding:i,rowHeight:s}=e,o=is(e),a=Math.round((n-i[0])/(o+r[0])),l=Math.round((t-i[1])/(s+r[1]));return{x:a,y:l}}function LP(e,t,n){const{margin:r,rowHeight:i}=e,s=is(e),o=Math.max(1,Math.round((t+r[0])/(s+r[0]))),a=Math.max(1,Math.round((n+r[1])/(i+r[1])));return{w:o,h:a}}function gc(e,t,n){return Math.max(Math.min(e,n),t)}function Ip(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Xi(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0&&Ip(r,t))return r}}function TS(e,t){return e.filter(n=>Ip(n,t))}function AP(e,t){return t==="horizontal"?DS(e):t==="vertical"||t==="wrap"?Nd(e):[...e]}function Nd(e){return[...e].sort((t,n)=>t.y!==n.y?t.y-n.y:t.x-n.x)}function DS(e){return[...e].sort((t,n)=>t.x!==n.x?t.x-n.x:t.y-n.y)}function Gc(e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0){const i=r.y+r.h;i>t&&(t=i)}}return t}function Bi(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0&&r.i===t)return r}}function Xc(e){return e.filter(t=>t.static===!0)}function ss(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function Ci(e){const t=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];r!==void 0&&(t[n]=ss(r))}return t}function IP(e,t){const n=new Array(e.length);for(let r=0;r<e.length;r++){const i=e[r];i!==void 0&&(t.i===i.i?n[r]=t:n[r]=i)}return n}function MP(e,t,n){let r=Bi(e,t);return r?(r=n(ss(r)),[IP(e,r),r]):[[...e],null]}function Mp(e,t){const n=Xc(e);for(let r=0;r<e.length;r++){const i=e[r];if(i!==void 0)if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Xi(n,i);)i.y++}return e}function qi(e,t,n,r,i,s,o,a,l){if(t.static&&t.isDraggable!==!0)return[...e];if(t.y===r&&t.x===n)return[...e];const c=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let h=AP(e,o);(o==="vertical"&&typeof r=="number"?d>=r:o==="horizontal"&&typeof n=="number"?c>=n:!1)&&(h=h.reverse());const p=TS(h,t),m=p.length>0;if(m&&l)return Ci(e);if(m&&s)return t.x=c,t.y=d,t.moved=!1,e;let y=[...e];for(let b=0;b<p.length;b++){const _=p[b];_!==void 0&&(_.moved||(_.static?y=Sy(y,_,t,i,o):y=Sy(y,t,_,i,o)))}return y}function Sy(e,t,n,r,i,s){const o=i==="horizontal",a=i==="vertical",l=t.static;if(r){r=!1;const h={x:o?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},f=Xi(e,h),p=f!==void 0&&f.y+f.h>t.y,m=f!==void 0&&t.x+t.w>f.x;if(!f)return qi(e,n,o?h.x:void 0,a?h.y:void 0,r,l,i);if(p&&a)return qi(e,n,void 0,n.y+1,r,l,i);if(p&&i===null)return t.y=n.y,n.y=n.y+n.h,[...e];if(m&&o)return qi(e,t,n.x,void 0,r,l,i)}const c=o?n.x+1:void 0,d=a?n.y+1:void 0;return c===void 0&&d===void 0?[...e]:qi(e,n,c,d,r,l,i)}function Ls(e,t,n){return Math.max(t,Math.min(n,e))}var OP={name:"gridBounds",constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:Ls(t,0,Math.max(0,r-e.w)),y:Ls(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:s}){const o=r==="w"||r==="nw"||r==="sw"?e.x+e.w:i-e.x,a=r==="n"||r==="nw"||r==="ne"?e.y+e.h:s-e.y;return{w:Ls(t,1,Math.max(1,o)),h:Ls(n,1,Math.max(1,a))}}},zP={name:"minMaxSize",constrainSize(e,t,n){return{w:Ls(t,e.minW??1,e.maxW??1/0),h:Ls(n,e.minH??1,e.maxH??1/0)}}},PS=[OP,zP];function il(e,t,n,r,i){let s={x:n,y:r};for(const o of e)o.constrainPosition&&(s=o.constrainPosition(t,s.x,s.y,i));if(t.constraints)for(const o of t.constraints)o.constrainPosition&&(s=o.constrainPosition(t,s.x,s.y,i));return s}function BP(e,t,n,r,i,s){let o={w:n,h:r};for(const a of e)a.constrainSize&&(o=a.constrainSize(t,o.w,o.h,i,s));if(t.constraints)for(const a of t.constraints)a.constrainSize&&(o=a.constrainSize(t,o.w,o.h,i,s));return o}function Op({top:e,left:t,width:n,height:r}){const i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:"absolute"}}function LS({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:"absolute"}}function xy(e){return e*100+"%"}function FP(e,t,n,r){return e+n>r?t:n}function AS(e,t,n){return e<0?t:n}function $P(e){return Math.max(0,e)}function yc(e){return Math.max(0,e)}var zp=(e,t,n)=>{const{left:r,height:i,width:s}=t,o=e.top-(i-e.height);return{left:r,width:s,height:AS(o,e.height,i),top:yc(o)}},Bp=(e,t,n)=>{const{top:r,left:i,height:s,width:o}=t;return{top:r,height:s,width:FP(e.left,e.width,o,n),left:$P(i)}},Fp=(e,t,n)=>{const{top:r,height:i,width:s}=t,o=e.left+e.width-s;return o<0?{height:i,width:e.left+e.width,top:yc(r),left:0}:{height:i,width:s,top:yc(r),left:o}},$p=(e,t,n)=>{const{top:r,left:i,height:s,width:o}=t;return{width:o,left:i,height:AS(r,e.height,s),top:yc(r)}},HP=(e,t,n)=>zp(e,Bp(e,t,n)),WP=(e,t,n)=>zp(e,Fp(e,t)),UP=(e,t,n)=>$p(e,Bp(e,t,n)),VP=(e,t,n)=>$p(e,Fp(e,t)),qP={n:zp,ne:HP,e:Bp,se:UP,s:$p,sw:VP,w:Fp,nw:WP};function KP(e,t,n,r){const i=qP[e];return i?i(t,{...t,...n},r):n}var IS={type:"transform",scale:1,calcStyle(e){return Op(e)}},YP={type:"absolute",scale:1,calcStyle(e){return LS(e)}};function GP(e){return{type:"transform",scale:e,calcStyle(t){return Op(t)},calcDragPosition(t,n,r,i){return{left:(t-r)/e,top:(n-i)/e}}}}var XP=IS,JP={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},ZP={enabled:!0,bounded:!1,threshold:3},QP={enabled:!0,handles:["se"]},eL={enabled:!1,defaultItem:{w:1,h:1}};function Hp(e,t,n,r,i){const s=r==="x"?"w":"h";t[r]+=1;const o=e.findIndex(l=>l.i===t.i),a=i??Xc(e).length>0;for(let l=o+1;l<e.length;l++){const c=e[l];if(c!==void 0&&!c.static){if(!a&&c.y>t.y+t.h)break;Ip(t,c)&&Hp(e,c,n+t[s],r,a)}}t[r]=n}function tL(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!Xi(e,t);)t.y--;let i;for(;(i=Xi(e,t))!==void 0;)Hp(n,t,i.y+i.h,"y");return t.y=Math.max(t.y,0),t}function nL(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!Xi(e,t);)t.x--;let i;for(;(i=Xi(e,t))!==void 0;)if(Hp(r,t,i.x+i.w,"x"),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!Xi(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var MS={type:"vertical",allowOverlap:!1,compact(e,t){const n=Xc(e);let r=Gc(n);const i=Nd(e),s=new Array(e.length);for(let o=0;o<i.length;o++){const a=i[o];if(a===void 0)continue;let l=ss(a);l.static||(l=tL(n,l,i,r),r=Math.max(r,l.y+l.h),n.push(l));const c=e.indexOf(a);s[c]=l,l.moved=!1}return s}},OS={type:"horizontal",allowOverlap:!1,compact(e,t){const n=Xc(e),r=DS(e),i=new Array(e.length);for(let s=0;s<r.length;s++){const o=r[s];if(o===void 0)continue;let a=ss(o);a.static||(a=nL(n,a,t,r),n.push(a));const l=e.indexOf(o);i[l]=a,a.moved=!1}return i}},zS={type:null,allowOverlap:!1,compact(e,t){return Ci(e)}},rL={...MS,allowOverlap:!0,compact(e,t){return Ci(e)}},iL={...OS,allowOverlap:!0,compact(e,t){return Ci(e)}},sL={...zS,allowOverlap:!0};function Jc(e,t=!1,n=!1){let r;return t?e==="vertical"?r=rL:e==="horizontal"?r=iL:r=sL:e==="vertical"?r=MS:e==="horizontal"?r=OS:r=zS,n?{...r,preventCollision:n}:r}function BS(e){return Object.keys(e).sort((n,r)=>e[n]-e[r])}function ky(e,t){const n=BS(e);let r=n[0];if(r===void 0)throw new Error("No breakpoints defined");for(let i=1;i<n.length;i++){const s=n[i];if(s===void 0)continue;const o=e[s];t>o&&(r=s)}return r}function Cy(e,t){const n=t[e];if(n===void 0)throw new Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function Gu(e,t,n,r,i,s){const o=e[n];if(o)return Ci(o);let a=e[r];const l=BS(t),c=l.slice(l.indexOf(n));for(let p=0;p<c.length;p++){const m=c[p];if(m===void 0)continue;const y=e[m];if(y){a=y;break}}const d=Ci(a||[]),h=Mp(d,{cols:i});return(typeof s=="object"&&s!==null?s:Jc(s)).compact(h,i)}function sl(e,t){if(Array.isArray(e))return e;const n=e,r=n[t];if(r!==void 0)return r;const i=Object.keys(n);for(const s of i){const o=n[s];if(o!==void 0)return o}return[10,10]}var FS={exports:{}},oL="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",aL=oL,lL=aL;function $S(){}function HS(){}HS.resetWarningCache=$S;var cL=function(){function e(r,i,s,o,a,l){if(l!==lL){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:HS,resetWarningCache:$S};return n.PropTypes=n,n};FS.exports=cL();var Wp=FS.exports;const Oe=_a(Wp);var uL={};function jd(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function Ey(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function To(e){return typeof e=="number"&&!isNaN(e)}function cn(e){return parseInt(e,10)}function Ws(e,t,n){if(e[t])return new Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)}var Xu=["Moz","Webkit","O","ms"];function hL(e="transform"){var t,n;if(typeof window>"u")return"";const r=(n=(t=window.document)==null?void 0:t.documentElement)==null?void 0:n.style;if(!r||e in r)return"";for(let i=0;i<Xu.length;i++)if(WS(e,Xu[i])in r)return Xu[i];return""}function WS(e,t){return t?`${t}${dL(e)}`:e}function dL(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}var fL=hL(),Ju="";function pL(e,t){var n;Ju||(Ju=(n=jd(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(i){return Ey(e[i])}))!=null?n:"");const r=e[Ju];return Ey(r)?!!r.call(e,t):!1}function Ny(e,t,n){let r=e;do{if(pL(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Zu(e,t,n,r){if(!e)return;const i={capture:!0,...r},s=n;e.addEventListener?e.addEventListener(t,s,i):e.attachEvent?e.attachEvent("on"+t,s):e["on"+t]=s}function Ai(e,t,n,r){if(!e)return;const i={capture:!0,...r},s=n;e.removeEventListener?e.removeEventListener(t,s,i):e.detachEvent?e.detachEvent("on"+t,s):e["on"+t]=null}function mL(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=cn(n.borderTopWidth),t+=cn(n.borderBottomWidth),t}function gL(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=cn(n.borderLeftWidth),t+=cn(n.borderRightWidth),t}function yL(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=cn(n.paddingTop),t-=cn(n.paddingBottom),t}function _L(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=cn(n.paddingLeft),t-=cn(n.paddingRight),t}function vL(e,t,n){const i=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),s=(e.clientX+t.scrollLeft-i.left)/n,o=(e.clientY+t.scrollTop-i.top)/n;return{x:s,y:o}}function bL(e,t){const n=US(e,t,"px");return{[WS("transform",fL)]:n}}function wL(e,t){return US(e,t,"")}function US({x:e,y:t},n,r){let i=`translate(${e}${r},${t}${r})`;if(n){const s=`${typeof n.x=="string"?n.x:n.x+r}`,o=`${typeof n.y=="string"?n.y:n.y+r}`;i=`translate(${s}, ${o})`+i}return i}function SL(e,t){return e.targetTouches&&jd(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&jd(e.changedTouches,n=>t===n.identifier)}function xL(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function kL(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
90
90
  `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
91
- `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&CL(e.body,"react-draggable-transparent-selection")}function jy(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{Ry(e)}):Ry(e)}function Ry(e){if(e)try{e.body&&EL(e.body,"react-draggable-transparent-selection");const t=e.selection;if(t)t.empty();else{const n=(e.defaultView||window).getSelection();n&&n.type!=="Caret"&&n.removeAllRanges()}}catch{}}function CL(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function EL(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(`(?:^|\\s)${t}(?!\\S)`,"g"),"")}function NL(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:TL(r);const i=Up(e);if(typeof r=="string"){const{ownerDocument:s}=i,o=s.defaultView;if(!o)throw new Error("Cannot resolve the owner window of the draggable node.");let a;if(r==="parent"?a=i.parentNode:a=i.getRootNode().querySelector(r),!(a instanceof o.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=o.getComputedStyle(i),d=o.getComputedStyle(l);r={left:-i.offsetLeft+cn(d.paddingLeft)+cn(c.marginLeft),top:-i.offsetTop+cn(d.paddingTop)+cn(c.marginTop),right:_L(l)-gL(i)-i.offsetLeft+cn(d.paddingRight)-cn(c.marginRight),bottom:yL(l)-mL(i)-i.offsetTop+cn(d.paddingBottom)-cn(c.marginBottom)}}return To(r.right)&&(t=Math.min(t,r.right)),To(r.bottom)&&(n=Math.min(n,r.bottom)),To(r.left)&&(t=Math.max(t,r.left)),To(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Ty(e,t,n){const r=Math.round(t/e[0])*e[0],i=Math.round(n/e[1])*e[1];return[r,i]}function jL(e){return e.props.axis==="both"||e.props.axis==="x"}function RL(e){return e.props.axis==="both"||e.props.axis==="y"}function Qu(e,t,n){const r=typeof t=="number"?SL(e,t):null;if(typeof t=="number"&&!r)return null;const i=Up(n),s=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return vL(r||e,s,n.props.scale)}function eh(e,t,n){const r=!To(e.lastX),i=Up(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function th(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function TL(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Up(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}function kr(...e){uL.DRAGGABLE_DEBUG&&console.log(...e)}var or={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},ti=or.mouse,Ti=class extends w.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button=="number"&&e.button!==0||e.ctrlKey))return!1;const t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!Ny(e.target,this.props.handle,t)||this.props.cancel&&Ny(e.target,this.props.cancel,t))return;e.type==="touchstart"&&!this.props.allowMobileScroll&&e.preventDefault();const r=xL(e);this.touchIdentifier=r;const i=Qu(e,r,this);if(i==null)return;const{x:s,y:o}=i,a=eh(this,s,o);kr("DraggableCore: handleDragStart: %j",a),kr("calling",this.props.onStart),!(this.props.onStart(e,a)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&kL(n),this.dragging=!0,this.lastX=s,this.lastY=o,Zu(n,ti.move,this.handleDrag),Zu(n,ti.stop,this.handleDragStop))},this.handleDrag=e=>{const t=Qu(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let o=n-this.lastX,a=r-this.lastY;if([o,a]=Ty(this.props.grid,o,a),!o&&!a)return;n=this.lastX+o,r=this.lastY+a}const i=eh(this,n,r);if(kr("DraggableCore: handleDrag: %j",i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const o=document.createEvent("MouseEvents");o.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(o)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;const t=Qu(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let a=n-this.lastX||0,l=r-this.lastY||0;[a,l]=Ty(this.props.grid,a,l),n=this.lastX+a,r=this.lastY+l}const i=eh(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;const o=this.findDOMNode();o&&this.props.enableUserSelectHack&&jy(o.ownerDocument),kr("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,o&&(kr("DraggableCore: Removing handlers"),Ai(o.ownerDocument,ti.move,this.handleDrag),Ai(o.ownerDocument,ti.stop,this.handleDragStop))},this.onMouseDown=e=>(ti=or.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(ti=or.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(ti=or.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(ti=or.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&Zu(e,or.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:t}=e;Ai(t,or.mouse.move,this.handleDrag),Ai(t,or.touch.move,this.handleDrag),Ai(t,or.mouse.stop,this.handleDragStop),Ai(t,or.touch.stop,this.handleDragStop),Ai(e,or.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&jy(t)}}findDOMNode(){var e;if((e=this.props)!=null&&e.nodeRef)return this.props.nodeRef.current;const t=pw;return typeof t.findDOMNode=="function"?t.findDOMNode(this):(kr("react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef"),null)}render(){return w.cloneElement(w.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Ti.displayName="DraggableCore";Ti.propTypes={allowAnyClick:Oe.bool,allowMobileScroll:Oe.bool,children:Oe.node.isRequired,disabled:Oe.bool,enableUserSelectHack:Oe.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Oe.arrayOf(Oe.number),handle:Oe.string,cancel:Oe.string,nodeRef:Oe.object,onStart:Oe.func,onDrag:Oe.func,onStop:Oe.func,onMouseDown:Oe.func,scale:Oe.number,className:Ws,style:Ws,transform:Ws};Ti.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Zc=class extends w.Component{constructor(e){super(e),this.onDragStart=(t,n)=>{if(kr("Draggable: onDragStart: %j",n),this.props.onStart(t,th(this,n))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(t,n)=>{if(!this.state.dragging)return!1;kr("Draggable: onDrag: %j",n);const r=th(this,n),i={x:r.x,y:r.y,slackX:0,slackY:0};if(this.props.bounds){const{x:o,y:a}=i;i.x+=this.state.slackX,i.y+=this.state.slackY;const[l,c]=NL(this,i.x,i.y);i.x=l,i.y=c,i.slackX=this.state.slackX+(o-i.x),i.slackY=this.state.slackY+(a-i.y),r.x=i.x,r.y=i.y,r.deltaX=i.x-this.state.x,r.deltaY=i.y-this.state.y}if(this.props.onDrag(t,r)===!1)return!1;this.setState(i)},this.onDragStop=(t,n)=>{if(!this.state.dragging||this.props.onStop(t,th(this,n))===!1)return!1;kr("Draggable: onDragStop: %j",n);const i={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:o,y:a}=this.props.position;i.x=o,i.y=a}this.setState(i)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(kr("Draggable: getDerivedStateFromProps %j",{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var e;if((e=this.props)!=null&&e.nodeRef)return this.props.nodeRef.current;const t=pw;return typeof t.findDOMNode=="function"?t.findDOMNode(this):null}render(){const{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:s,defaultClassNameDragged:o,position:a,positionOffset:l,scale:c,...d}=this.props;let h={},f=null;const m=!!!a||this.state.dragging,y=a||r,b={x:jL(this)&&m?this.state.x:y.x,y:RL(this)&&m?this.state.y:y.y};this.state.isElementSVG?f=wL(b,l):h=bL(b,l);const _=w.Children.only(n),v=io(_.props.className||"",i,{[s]:this.state.dragging,[o]:this.state.dragged});return w.createElement(Ti,{...d,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},w.cloneElement(_,{className:v,style:{..._.props.style,...h},transform:f}))}};Zc.displayName="Draggable";Zc.propTypes={...Ti.propTypes,axis:Oe.oneOf(["both","x","y","none"]),bounds:Oe.oneOfType([Oe.shape({left:Oe.number,right:Oe.number,top:Oe.number,bottom:Oe.number}),Oe.string,Oe.oneOf([!1])]),defaultClassName:Oe.string,defaultClassNameDragging:Oe.string,defaultClassNameDragged:Oe.string,defaultPosition:Oe.shape({x:Oe.number,y:Oe.number}),positionOffset:Oe.shape({x:Oe.oneOfType([Oe.number,Oe.string]),y:Oe.oneOfType([Oe.number,Oe.string])}),position:Oe.shape({x:Oe.number,y:Oe.number}),className:Ws,style:Ws,transform:Ws};Zc.defaultProps={...Ti.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1};var DL=Zc;const PL=Object.freeze(Object.defineProperty({__proto__:null,DraggableCore:Ti,default:DL},Symbol.toStringTag,{value:"Module"}));var Vp={exports:{}},Na={};const LL=n0(PL);var qp={};qp.__esModule=!0;qp.cloneElement=BL;var AL=IL(w);function IL(e){return e&&e.__esModule?e:{default:e}}function Dy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Py(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dy(Object(n),!0).forEach(function(r){ML(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ML(e,t,n){return(t=OL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OL(e){var t=zL(e,"string");return typeof t=="symbol"?t:t+""}function zL(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function BL(e,t){return t.style&&e.props.style&&(t.style=Py(Py({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),AL.default.cloneElement(e,t)}var ja={};ja.__esModule=!0;ja.resizableProps=void 0;var Me=FL(Wp);function FL(e){return e&&e.__esModule?e:{default:e}}ja.resizableProps={axis:Me.default.oneOf(["both","x","y","none"]),className:Me.default.string,children:Me.default.element.isRequired,draggableOpts:Me.default.shape({allowAnyClick:Me.default.bool,cancel:Me.default.string,children:Me.default.node,disabled:Me.default.bool,enableUserSelectHack:Me.default.bool,offsetParent:typeof Element<"u"?Me.default.instanceOf(Element):Me.default.any,grid:Me.default.arrayOf(Me.default.number),handle:Me.default.string,nodeRef:Me.default.object,onStart:Me.default.func,onDrag:Me.default.func,onStop:Me.default.func,onMouseDown:Me.default.func,scale:Me.default.number}),height:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t[0];return r.axis==="both"||r.axis==="y"?Me.default.number.isRequired(...t):Me.default.number(...t)},handle:Me.default.oneOfType([Me.default.node,Me.default.func]),handleSize:Me.default.arrayOf(Me.default.number),lockAspectRatio:Me.default.bool,maxConstraints:Me.default.arrayOf(Me.default.number),minConstraints:Me.default.arrayOf(Me.default.number),onResizeStop:Me.default.func,onResizeStart:Me.default.func,onResize:Me.default.func,resizeHandles:Me.default.arrayOf(Me.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:Me.default.number,width:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t[0];return r.axis==="both"||r.axis==="x"?Me.default.number.isRequired(...t):Me.default.number(...t)}};Na.__esModule=!0;Na.default=void 0;var ms=VS(w),$L=LL,HL=qp,WL=ja;const UL=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function VS(e,t){if(typeof WeakMap=="function")var n=new WeakMap,r=new WeakMap;return(VS=function(i,s){if(!s&&i&&i.__esModule)return i;var o,a,l={__proto__:null,default:i};if(i===null||typeof i!="object"&&typeof i!="function")return l;if(o=s?r:n){if(o.has(i))return o.get(i);o.set(i,l)}for(const c in i)c!=="default"&&{}.hasOwnProperty.call(i,c)&&((a=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,c))&&(a.get||a.set)?o(l,c,a):l[c]=i[c]);return l})(e,t)}function Rd(){return Rd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rd.apply(null,arguments)}function VL(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ly(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ly(Object(n),!0).forEach(function(r){qL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ly(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qL(e,t,n){return(t=KL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KL(e){var t=YL(e,"string");return typeof t=="symbol"?t:t+""}function YL(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}let Kp=class extends ms.Component{constructor(){super(...arguments),this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints(t,n){const r=this.props,i=r.minConstraints,s=r.maxConstraints,o=r.lockAspectRatio;if(!i&&!s&&!o)return[t,n];if(o){const f=this.props.width/this.props.height,p=t-this.props.width,m=n-this.props.height;Math.abs(p)>Math.abs(m*f)?n=t/f:t=n*f}const a=t,l=n;let c=this.slack||[0,0],d=c[0],h=c[1];return t+=d,n+=h,i&&(t=Math.max(i[0],t),n=Math.max(i[1],n)),s&&(t=Math.min(s[0],t),n=Math.min(s[1],n)),this.slack=[d+(a-t),h+(l-n)],[t,n]}resizeHandler(t,n){return(r,i)=>{var s,o,a,l;let c=i.node,d=i.deltaX,h=i.deltaY;t==="onResizeStart"&&this.resetData();const f=(this.props.axis==="both"||this.props.axis==="x")&&n!=="n"&&n!=="s",p=(this.props.axis==="both"||this.props.axis==="y")&&n!=="e"&&n!=="w";if(!f&&!p)return;const m=n[0],y=n[n.length-1],b=c.getBoundingClientRect();if(this.lastHandleRect!=null){if(y==="w"){const j=b.left-this.lastHandleRect.left;d+=j}if(m==="n"){const j=b.top-this.lastHandleRect.top;h+=j}}this.lastHandleRect=b,y==="w"&&(d=-d),m==="n"&&(h=-h);const _=(s=(o=this.lastSize)==null?void 0:o.width)!=null?s:this.props.width,v=(a=(l=this.lastSize)==null?void 0:l.height)!=null?a:this.props.height;let g=_+(f?d/this.props.transformScale:0),S=v+(p?h/this.props.transformScale:0);var C=this.runConstraints(g,S);if(g=C[0],S=C[1],t==="onResizeStop"&&this.lastSize){var x=this.lastSize;g=x.width,S=x.height}const T=g!==_||S!==v;t!=="onResizeStop"&&(this.lastSize={width:g,height:S});const P=typeof this.props[t]=="function"?this.props[t]:null;P&&!(t==="onResize"&&!T)&&(r.persist==null||r.persist(),P(r,{node:c,size:{width:g,height:S},handle:n})),t==="onResizeStop"&&this.resetData()}}renderResizeHandle(t,n){const r=this.props.handle;if(!r)return ms.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+t,ref:n});if(typeof r=="function")return r(t,n);const i=typeof r.type=="string",s=nh({ref:n},i?{}:{handleAxis:t});return ms.cloneElement(r,s)}render(){const t=this.props,n=t.children,r=t.className,i=t.draggableOpts;t.width,t.height,t.handle,t.handleSize,t.lockAspectRatio,t.axis,t.minConstraints,t.maxConstraints,t.onResize,t.onResizeStop,t.onResizeStart;const s=t.resizeHandles;t.transformScale;const o=VL(t,UL);return(0,HL.cloneElement)(n,nh(nh({},o),{},{className:(r?r+" ":"")+"react-resizable",children:[...ms.Children.toArray(n.props.children),...s.map(a=>{var l;const c=(l=this.handleRefs[a])!=null?l:this.handleRefs[a]=ms.createRef();return ms.createElement($L.DraggableCore,Rd({},i,{nodeRef:c,key:"resizableHandle-"+a,onStop:this.resizeHandler("onResizeStop",a),onStart:this.resizeHandler("onResizeStart",a),onDrag:this.resizeHandler("onResize",a)}),this.renderResizeHandle(a,c))})]}))}};Na.default=Kp;Kp.propTypes=WL.resizableProps;Kp.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Qc={};Qc.__esModule=!0;Qc.default=void 0;var rh=KS(w),GL=qS(Wp),XL=qS(Na),JL=ja;const ZL=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function qS(e){return e&&e.__esModule?e:{default:e}}function KS(e,t){if(typeof WeakMap=="function")var n=new WeakMap,r=new WeakMap;return(KS=function(i,s){if(!s&&i&&i.__esModule)return i;var o,a,l={__proto__:null,default:i};if(i===null||typeof i!="object"&&typeof i!="function")return l;if(o=s?r:n){if(o.has(i))return o.get(i);o.set(i,l)}for(const c in i)c!=="default"&&{}.hasOwnProperty.call(i,c)&&((a=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,c))&&(a.get||a.set)?o(l,c,a):l[c]=i[c]);return l})(e,t)}function Td(){return Td=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Td.apply(null,arguments)}function Ay(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _c(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ay(Object(n),!0).forEach(function(r){QL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ay(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QL(e,t,n){return(t=eA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eA(e){var t=tA(e,"string");return typeof t=="symbol"?t:t+""}function tA(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nA(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}class YS extends rh.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(t,n)=>{const r=n.size;this.props.onResize?(t.persist==null||t.persist(),this.setState(r,()=>this.props.onResize&&this.props.onResize(t,n))):this.setState(r)}}static getDerivedStateFromProps(t,n){return n.propsWidth!==t.width||n.propsHeight!==t.height?{width:t.width,height:t.height,propsWidth:t.width,propsHeight:t.height}:null}render(){const t=this.props,n=t.handle,r=t.handleSize;t.onResize;const i=t.onResizeStart,s=t.onResizeStop,o=t.draggableOpts,a=t.minConstraints,l=t.maxConstraints,c=t.lockAspectRatio,d=t.axis;t.width,t.height;const h=t.resizeHandles,f=t.style,p=t.transformScale,m=nA(t,ZL);return rh.createElement(XL.default,{axis:d,draggableOpts:o,handle:n,handleSize:r,height:this.state.height,lockAspectRatio:c,maxConstraints:l,minConstraints:a,onResizeStart:i,onResize:this.onResize,onResizeStop:s,resizeHandles:h,transformScale:p,width:this.state.width},rh.createElement("div",Td({},m,{style:_c(_c({},f),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}}Qc.default=YS;YS.propTypes=_c(_c({},JL.resizableProps),{},{children:GL.default.element});Vp.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};var rA=Vp.exports.Resizable=Na.default;Vp.exports.ResizableBox=Qc.default;function GS(e){return function(n,r,i,s,o,a,l){return e(n,r,l)}}function eu(e){return function(n,r,i,s){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i,s);var o=s.get(n),a=s.get(r);if(o&&a)return o===r&&a===n;s.set(n,r),s.set(r,n);var l=e(n,r,i,s);return s.delete(n),s.delete(r),l}}function XS(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function Iy(e){return e.constructor===Object||e.constructor==null}function My(e){return typeof e.then=="function"}function tu(e,t){return e===t||e!==e&&t!==t}var iA="[object Arguments]",sA="[object Boolean]",oA="[object Date]",aA="[object RegExp]",lA="[object Map]",cA="[object Number]",uA="[object Object]",hA="[object Set]",dA="[object String]",Oy=Object.prototype.toString;function nu(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,s=e.areRegExpsEqual,o=e.areSetsEqual,a=e.createIsNestedEqual,l=a(c);function c(d,h,f){if(d===h)return!0;if(!d||!h||typeof d!="object"||typeof h!="object")return d!==d&&h!==h;if(Iy(d)&&Iy(h))return i(d,h,l,f);var p=Array.isArray(d),m=Array.isArray(h);if(p||m)return p===m&&t(d,h,l,f);var y=Oy.call(d);return y!==Oy.call(h)?!1:y===oA?n(d,h,l,f):y===aA?s(d,h,l,f):y===lA?r(d,h,l,f):y===hA?o(d,h,l,f):y===uA||y===iA?My(d)||My(h)?!1:i(d,h,l,f):y===sA||y===cA||y===dA?tu(d.valueOf(),h.valueOf()):!1}return c}function JS(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-- >0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var fA=eu(JS);function ZS(e,t){return tu(e.valueOf(),t.valueOf())}function QS(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var s={},o=0;return e.forEach(function(a,l){if(i){var c=!1,d=0;t.forEach(function(h,f){!c&&!s[d]&&(c=n(l,f,o,d,e,t,r)&&n(a,h,l,f,e,t,r))&&(s[d]=!0),d++}),o++,i=c}}),i}var pA=eu(QS),mA="_owner",gA=Object.prototype.hasOwnProperty;function ex(e,t,n,r){var i=Object.keys(e),s=i.length;if(Object.keys(t).length!==s)return!1;for(var o;s-- >0;){if(o=i[s],o===mA){var a=!!e.$$typeof,l=!!t.$$typeof;if((a||l)&&a!==l)return!1}if(!gA.call(t,o)||!n(e[o],t[o],o,o,e,t,r))return!1}return!0}var yA=eu(ex);function tx(e,t){return e.source===t.source&&e.flags===t.flags}function nx(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var s={};return e.forEach(function(o,a){if(i){var l=!1,c=0;t.forEach(function(d,h){!l&&!s[c]&&(l=n(o,d,a,h,e,t,r))&&(s[c]=!0),c++}),i=l}}),i}var _A=eu(nx),rx=Object.freeze({areArraysEqual:JS,areDatesEqual:ZS,areMapsEqual:QS,areObjectsEqual:ex,areRegExpsEqual:tx,areSetsEqual:nx,createIsNestedEqual:GS}),ix=Object.freeze({areArraysEqual:fA,areDatesEqual:ZS,areMapsEqual:pA,areObjectsEqual:yA,areRegExpsEqual:tx,areSetsEqual:_A,createIsNestedEqual:GS}),vA=nu(rx);function Or(e,t){return vA(e,t,void 0)}nu(XS(rx,{createIsNestedEqual:function(){return tu}}));nu(ix);nu(XS(ix,{createIsNestedEqual:function(){return tu}}));function zy(e){const{children:t,cols:n,containerWidth:r,margin:i,containerPadding:s,rowHeight:o,maxRows:a,isDraggable:l,isResizable:c,isBounded:d,static:h,useCSSTransforms:f=!0,usePercentages:p=!1,transformScale:m=1,positionStrategy:y,dragThreshold:b=0,droppingPosition:_,className:v="",style:g,handle:S="",cancel:C="",x,y:T,w:P,h:B,minW:j=1,maxW:$=1/0,minH:I=1,maxH:R=1/0,i:A,resizeHandles:N,resizeHandle:z,constraints:U=PS,layoutItem:D,layout:O=[],onDragStart:k,onDrag:Q,onDragStop:ne,onResizeStart:E,onResize:ce,onResizeStop:_e}=e,[te,ae]=w.useState(!1),[se,he]=w.useState(!1),Pe=w.useRef(null),be=w.useRef({left:0,top:0}),Se=w.useRef({top:0,left:0,width:0,height:0}),L=w.useRef(void 0),ge=w.useRef(O);ge.current=O;const oe=w.useRef(null),ye=w.useRef(null),Te=w.useRef(!1),Le=w.useRef({x:0,y:0}),Y=w.useRef(!1),pe=w.useMemo(()=>({cols:n,containerPadding:s,containerWidth:r,margin:i,maxRows:a,rowHeight:o}),[n,s,r,i,a,o]),Ae=w.useMemo(()=>({cols:n,maxRows:a,containerWidth:r,containerHeight:0,rowHeight:o,margin:i,layout:[]}),[n,a,r,o,i]),Ke=w.useCallback(()=>({...Ae,layout:ge.current}),[Ae]),Et=w.useMemo(()=>D??{i:A,x,y:T,w:P,h:B,minW:j,maxW:$,minH:I,maxH:R},[D,A,x,T,P,B,j,$,I,R]),ir=w.useCallback(Ue=>{if(y!=null&&y.calcStyle)return y.calcStyle(Ue);if(f)return Op(Ue);const Ve=LS(Ue);return p?{...Ve,left:xy(Ue.left/r),width:xy(Ue.width/r)}:Ve},[y,f,p,r]),pt=w.useCallback((Ue,{node:Ve})=>{if(!k)return;const{offsetParent:$e}=Ve;if(!$e)return;const Ge=$e.getBoundingClientRect(),lt=Ve.getBoundingClientRect(),St=lt.left/m,Nt=Ge.left/m,it=lt.top/m,F=Ge.top/m;let ie;if(y!=null&&y.calcDragPosition){const ke=Ue;ie=y.calcDragPosition(ke.clientX,ke.clientY,ke.clientX-lt.left,ke.clientY-lt.top)}else ie={left:St-Nt+$e.scrollLeft,top:it-F+$e.scrollTop};if(be.current=ie,b>0){const ke=Ue;Le.current={x:ke.clientX,y:ke.clientY},Te.current=!0,Y.current=!1,ae(!0);return}ae(!0);const ve=rl(pe,ie.top,ie.left),{x:xe,y:J}=il(U,Et,ve.x,ve.y,Ke());k(A,xe,J,{e:Ue,node:Ve,newPosition:ie})},[k,m,pe,y,b,U,Et,Ke,A]),M=w.useCallback((Ue,{node:Ve,deltaX:$e,deltaY:Ge})=>{if(!Q||!te)return;const lt=Ue;if(Te.current&&!Y.current){const xe=lt.clientX-Le.current.x,J=lt.clientY-Le.current.y;if(Math.hypot(xe,J)<b)return;if(Y.current=!0,Te.current=!1,k){const de=rl(pe,be.current.top,be.current.left),{x:je,y:Ee}=il(U,Et,de.x,de.y,Ke());k(A,je,Ee,{e:Ue,node:Ve,newPosition:be.current})}}let St=be.current.top+Ge,Nt=be.current.left+$e;if(d){const{offsetParent:xe}=Ve;if(xe){const J=xe.clientHeight-xr(B,o,i[1]);St=gc(St,0,J);const ke=is(pe),de=r-xr(P,ke,i[0]);Nt=gc(Nt,0,de)}}const it={top:St,left:Nt};be.current=it;const F=rl(pe,St,Nt),{x:ie,y:ve}=il(U,Et,F.x,F.y,Ke());Q(A,ie,ve,{e:Ue,node:Ve,newPosition:it})},[Q,k,te,b,d,B,o,i,pe,r,P,A,U,Et,Ke]),H=w.useCallback((Ue,{node:Ve})=>{if(!ne||!te)return;const $e=Te.current;if(Te.current=!1,Y.current=!1,Le.current={x:0,y:0},$e){ae(!1),be.current={left:0,top:0};return}const{left:Ge,top:lt}=be.current,St={top:lt,left:Ge};ae(!1),be.current={left:0,top:0};const Nt=rl(pe,lt,Ge),{x:it,y:F}=il(U,Et,Nt.x,Nt.y,Ke());ne(A,it,F,{e:Ue,node:Ve,newPosition:St})},[ne,te,pe,U,Et,Ke,A]);oe.current=pt,ye.current=M;const ue=w.useCallback((Ue,{node:Ve,size:$e,handle:Ge},lt,St)=>{const Nt=St==="onResizeStart"?E:St==="onResize"?ce:_e;if(!Nt)return;let it;Ve?it=KP(Ge,lt,$e,r):it={...$e,top:lt.top,left:lt.left},Se.current=it;const F=LP(pe,it.width,it.height),{w:ie,h:ve}=BP(U,Et,F.w,F.h,Ge,Ke());Nt(A,ie,ve,{e:Ue.nativeEvent,node:Ve,size:it,handle:Ge})},[E,ce,_e,r,pe,A,U,Et,Ke]),Ce=w.useCallback((Ue,Ve)=>{he(!0);const $e=nl(pe,x,T,P,B),Ge={...Ve,handle:Ve.handle};ue(Ue,Ge,$e,"onResizeStart")},[ue,pe,x,T,P,B]),De=w.useCallback((Ue,Ve)=>{const $e=nl(pe,x,T,P,B),Ge={...Ve,handle:Ve.handle};ue(Ue,Ge,$e,"onResize")},[ue,pe,x,T,P,B]),nt=w.useCallback((Ue,Ve)=>{he(!1),Se.current={top:0,left:0,width:0,height:0};const $e=nl(pe,x,T,P,B),Ge={...Ve,handle:Ve.handle};ue(Ue,Ge,$e,"onResizeStop")},[ue,pe,x,T,P,B]);w.useEffect(()=>{var Ge,lt;if(!_)return;const Ue=Pe.current;if(!Ue)return;const Ve=L.current||{left:0,top:0},$e=te&&(_.left!==Ve.left||_.top!==Ve.top);if(te){if($e){const St=_.left-be.current.left,Nt=_.top-be.current.top,it={node:Ue,deltaX:St,deltaY:Nt,lastX:be.current.left,lastY:be.current.top,x:_.left,y:_.top};(lt=ye.current)==null||lt.call(ye,_.e,it)}}else{const St={node:Ue,deltaX:_.left,deltaY:_.top,lastX:0,lastY:0,x:_.left,y:_.top};(Ge=oe.current)==null||Ge.call(oe,_.e,St)}L.current=_},[_,te,A]);const mt=nl(pe,x,T,P,B,te?be.current:null,se?Se.current:null),Dt=pr.Children.only(t),sn=is(pe),Ot=[xr(j,sn,i[0]),xr(I,o,i[1])],at=[xr($,sn,i[0]),xr(R,o,i[1])],rt=Dt.props,Vt=rt.className,Hn=rt.style;let Wn=pr.cloneElement(Dt,{ref:Pe,className:io("react-grid-item",Vt,v,{static:h,resizing:se,"react-draggable":l,"react-draggable-dragging":te,dropping:!!_,cssTransforms:f}),style:{...g,...Hn,...ir(mt)}});const gr=z;return Wn=u.jsx(rA,{draggableOpts:{disabled:!c},className:c?void 0:"react-resizable-hide",width:mt.width,height:mt.height,minConstraints:Ot,maxConstraints:at,onResizeStart:Ce,onResize:De,onResizeStop:nt,transformScale:m,resizeHandles:N,handle:gr,children:Wn}),Wn=u.jsx(Ti,{disabled:!l,onStart:pt,onDrag:M,onStop:H,handle:S,cancel:".react-resizable-handle"+(C?","+C:""),scale:m,nodeRef:Pe,children:Wn}),Wn}var Lr=()=>{},By="react-grid-layout",sx=!1;try{sx=/firefox/i.test(navigator.userAgent)}catch{}function bA(e,t){const n=pr.Children.toArray(e),r=pr.Children.toArray(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++){const s=n[i],o=r[i];if((s==null?void 0:s.key)!==(o==null?void 0:o.key))return!1}return!0}function Fy(e,t,n,r){const i=[],s=new Set;pr.Children.forEach(t,a=>{if(!pr.isValidElement(a)||a.key===null)return;const l=String(a.key);s.add(l);const c=e.find(d=>d.i===l);if(c)i.push(ss(c));else{const h=a.props["data-grid"];h?i.push({i:l,x:h.x??0,y:h.y??0,w:h.w??1,h:h.h??1,minW:h.minW,maxW:h.maxW,minH:h.minH,maxH:h.maxH,static:h.static,isDraggable:h.isDraggable,isResizable:h.isResizable,resizeHandles:h.resizeHandles,isBounded:h.isBounded}):i.push({i:l,x:0,y:Gc(i),w:1,h:1})}});const o=Mp(i,{cols:n});return r.compact(o,n)}function wA(e){const{children:t,width:n,gridConfig:r,dragConfig:i,resizeConfig:s,dropConfig:o,positionStrategy:a=XP,compactor:l,constraints:c=PS,layout:d=[],droppingItem:h,autoSize:f=!0,className:p="",style:m={},innerRef:y,onLayoutChange:b=Lr,onDragStart:_=Lr,onDrag:v=Lr,onDragStop:g=Lr,onResizeStart:S=Lr,onResize:C=Lr,onResizeStop:x=Lr,onDrop:T=Lr,onDropDragOver:P=Lr}=e,B=w.useMemo(()=>({...JP,...r}),[r]),j=w.useMemo(()=>({...ZP,...i}),[i]),$=w.useMemo(()=>({...QP,...s}),[s]),I=w.useMemo(()=>({...eL,...o}),[o]),{cols:R,rowHeight:A,maxRows:N,margin:z,containerPadding:U}=B,{enabled:D,bounded:O,handle:k,cancel:Q,threshold:ne}=j,{enabled:E,handles:ce,handleComponent:_e}=$,{enabled:te,defaultItem:ae,onDragOver:se}=I,he=l??Jc("vertical"),Pe=he.type,be=he.allowOverlap,Se=he.preventCollision??!1,L=w.useMemo(()=>h??{i:"__dropping-elem__",...ae},[h,ae]),ge=a.type==="transform",oe=a.scale,ye=U??z,[Te,Le]=w.useState(!1),[Y,pe]=w.useState(()=>Fy(d,t,R,he)),[Ae,Ke]=w.useState(null),[Et,ir]=w.useState(!1),[pt,M]=w.useState(null),[H,ue]=w.useState(),Ce=w.useRef(null),De=w.useRef(null),nt=w.useRef(null),mt=w.useRef(0),Dt=w.useRef(Y),sn=w.useRef(d),Ot=w.useRef(t),at=w.useRef(Pe),rt=w.useRef(Y);rt.current=Y,w.useEffect(()=>{Le(!0),Or(Y,d)||b(Y)},[]),w.useEffect(()=>{if(Ae||pt)return;const J=!Or(d,sn.current),ke=!bA(t,Ot.current),de=Pe!==at.current;if(J||ke||de){const Ee=Fy(J?d:Y,t,R,he);Or(Ee,Y)||pe(Ee)}sn.current=d,Ot.current=t,at.current=Pe},[d,t,R,Pe,he,Ae,pt,Y]),w.useEffect(()=>{if(!Ae&&!Or(Y,Dt.current)){Dt.current=Y;const J=Y.filter(ke=>ke.i!==L.i);b(J)}},[Y,Ae,b,L.i]);const Vt=w.useMemo(()=>{if(!f)return;const J=Gc(Y),ke=ye[1];return J*A+(J-1)*z[1]+ke*2+"px"},[f,Y,A,z,ye]),Hn=w.useCallback((J,ke,de,je)=>{const Ee=rt.current,Re=Bi(Ee,J);if(!Re)return;const Je={w:Re.w,h:Re.h,x:Re.x,y:Re.y,i:J};Ce.current=ss(Re),nt.current=Ee,Ke(Je),_(Ee,Re,Re,null,je.e,je.node)},[_]),Wn=w.useCallback((J,ke,de,je)=>{const Ee=rt.current,Re=Ce.current,Je=Bi(Ee,J);if(!Je)return;const gt={w:Je.w,h:Je.h,x:Je.x,y:Je.y,i:J},et=qi(Ee,Je,ke,de,!0,Se,Pe,R,be);v(et,Re,Je,gt,je.e,je.node),pe(he.compact(et,R)),Ke(gt)},[Se,Pe,R,be,he,v]),gr=w.useCallback((J,ke,de,je)=>{if(!Ae)return;const Ee=rt.current,Re=Ce.current,Je=Bi(Ee,J);if(!Je)return;const gt=qi(Ee,Je,ke,de,!0,Se,Pe,R,be),et=he.compact(gt,R);g(et,Re,Je,null,je.e,je.node);const zt=nt.current;Ce.current=null,nt.current=null,Ke(null),pe(et),zt&&!Or(zt,et)&&b(et)},[Ae,Se,Pe,R,be,he,g,b]),Ue=w.useCallback((J,ke,de,je)=>{const Ee=rt.current,Re=Bi(Ee,J);Re&&(De.current=ss(Re),nt.current=Ee,ir(!0),S(Ee,Re,Re,null,je.e,je.node))},[S]),Ve=w.useCallback((J,ke,de,je)=>{const Ee=rt.current,Re=De.current,{handle:Je}=je;let gt=!1,et,zt;const[Di,Un]=MP(Ee,J,K=>(et=K.x,zt=K.y,["sw","w","nw","n","ne"].includes(Je)&&(["sw","nw","w"].includes(Je)&&(et=K.x+(K.w-ke),ke=K.x!==et&&et<0?K.w:ke,et=et<0?0:et),["ne","n","nw"].includes(Je)&&(zt=K.y+(K.h-de),de=K.y!==zt&&zt<0?K.h:de,zt=zt<0?0:zt),gt=!0),Se&&!be&&TS(Ee,{...K,w:ke,h:de,x:et??K.x,y:zt??K.y}).filter(re=>re.i!==K.i).length>0&&(zt=K.y,de=K.h,et=K.x,ke=K.w,gt=!1),K.w=ke,K.h=de,K));if(!Un)return;let Jr=Di;gt&&et!==void 0&&zt!==void 0&&(Jr=qi(Di,Un,et,zt,!0,Se,Pe,R,be));const W={w:Un.w,h:Un.h,x:Un.x,y:Un.y,i:J,static:!0};C(Jr,Re,Un,W,je.e,je.node),pe(he.compact(Jr,R)),Ke(W)},[Se,Pe,R,be,he,C]),$e=w.useCallback((J,ke,de,je)=>{const Ee=rt.current,Re=De.current,Je=Bi(Ee,J),gt=he.compact(Ee,R);x(gt,Re,Je??null,null,je.e,je.node);const et=nt.current;De.current=null,nt.current=null,Ke(null),ir(!1),pe(gt),et&&!Or(et,gt)&&b(gt)},[R,he,x,b]),Ge=w.useCallback(()=>{const J=rt.current;if(!J.some(je=>je.i===L.i)){M(null),Ke(null),ue(void 0);return}const de=he.compact(J.filter(je=>je.i!==L.i),R);pe(de),M(null),Ke(null),ue(void 0)},[L.i,R,he]),lt=w.useCallback(J=>{var Xe;if(J.preventDefault(),J.stopPropagation(),sx&&!((Xe=J.nativeEvent.target)!=null&&Xe.classList.contains(By)))return!1;const ke=se?se(J.nativeEvent):P(J);if(ke===!1)return pt&&Ge(),!1;const{dragOffsetX:de=0,dragOffsetY:je=0,...Ee}=ke??{},Re={...L,...Ee},Je=J.currentTarget.getBoundingClientRect(),gt={cols:R,margin:z,maxRows:N,rowHeight:A,containerWidth:n,containerPadding:ye},et=is(gt),zt=xr(Re.w,et,z[0]),Di=xr(Re.h,A,z[1]),Un=zt/2,Jr=Di/2,W=J.clientX-Je.left+de-Un,K=J.clientY-Je.top+je-Jr,X=Math.max(0,W),re=Math.max(0,K),me={left:X/oe,top:re/oe,e:J.nativeEvent};if(pt)H&&(H.left!==me.left||H.top!==me.top)&&ue(me);else{const ze=PP(gt,re,X,Re.w,Re.h);M(u.jsx("div",{},Re.i)),ue(me);const Pt=rt.current.filter(Vn=>Vn.i!==Re.i);pe([...Pt,{...Re,x:ze.x,y:ze.y,static:!1,isDraggable:!0}])}},[pt,H,L,se,P,Ge,oe,R,z,N,A,n,ye]),St=w.useCallback(J=>{J.preventDefault(),J.stopPropagation(),mt.current--,mt.current<0&&(mt.current=0),mt.current===0&&Ge()},[Ge]),Nt=w.useCallback(J=>{J.preventDefault(),J.stopPropagation(),mt.current++},[]),it=w.useCallback(J=>{J.preventDefault(),J.stopPropagation();const ke=rt.current,de=ke.find(je=>je.i===L.i);mt.current=0,Ge(),T(ke,de,J.nativeEvent)},[L.i,Ge,T]),F=w.useCallback((J,ke)=>{if(!J||!J.key)return null;const de=Bi(Y,String(J.key));if(!de)return null;const je=typeof de.isDraggable=="boolean"?de.isDraggable:!de.static&&D,Ee=typeof de.isResizable=="boolean"?de.isResizable:!de.static&&E,Re=de.resizeHandles||[...ce],Je=je&&O&&de.isBounded!==!1,gt=_e;return u.jsx(zy,{containerWidth:n,cols:R,margin:z,containerPadding:ye,maxRows:N,rowHeight:A,cancel:Q,handle:k,onDragStart:Hn,onDrag:Wn,onDragStop:gr,onResizeStart:Ue,onResize:Ve,onResizeStop:$e,isDraggable:je,isResizable:Ee,isBounded:Je,useCSSTransforms:ge&&Te,usePercentages:!Te,transformScale:oe,positionStrategy:a,dragThreshold:ne,w:de.w,h:de.h,x:de.x,y:de.y,i:de.i,minH:de.minH,minW:de.minW,maxH:de.maxH,maxW:de.maxW,static:de.static,droppingPosition:ke?H:void 0,resizeHandles:Re,resizeHandle:gt,constraints:c,layoutItem:de,layout:Y,children:J},de.i)},[Y,n,R,z,ye,N,A,Q,k,Hn,Wn,gr,Ue,Ve,$e,D,E,O,ge,Te,oe,a,ne,H,ce,_e,c]),ie=()=>Ae?u.jsx(zy,{w:Ae.w,h:Ae.h,x:Ae.x,y:Ae.y,i:Ae.i,className:`react-grid-placeholder ${Et?"placeholder-resizing":""}`,containerWidth:n,cols:R,margin:z,containerPadding:ye,maxRows:N,rowHeight:A,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:ge,transformScale:oe,constraints:c,layout:Y,children:u.jsx("div",{})}):null,ve=io(By,p),xe={height:Vt,...m};return u.jsxs("div",{ref:y,className:ve,style:xe,onDrop:te?it:void 0,onDragLeave:te?St:void 0,onDragEnter:te?Nt:void 0,onDragOver:te?lt:void 0,children:[pr.Children.map(t,J=>pr.isValidElement(J)?F(J):null),te&&pt&&F(pt,!0),ie()]})}var SA={lg:1200,md:996,sm:768,xs:480,xxs:0},xA={lg:12,md:10,sm:6,xs:4,xxs:2},ih=()=>{};function kA(e,t,n,r){const i=[];pr.Children.forEach(t,o=>{if(!pr.isValidElement(o)||o.key===null)return;const a=String(o.key),l=e.find(c=>c.i===a);if(l)i.push({...l,i:a});else{const d=o.props["data-grid"];d?i.push({i:a,x:d.x??0,y:d.y??0,w:d.w??1,h:d.h??1,minW:d.minW,maxW:d.maxW,minH:d.minH,maxH:d.maxH,static:d.static,isDraggable:d.isDraggable,isResizable:d.isResizable,resizeHandles:d.resizeHandles,isBounded:d.isBounded}):i.push({i:a,x:0,y:Gc(i),w:1,h:1})}});const s=Mp(i,{cols:n});return r.compact(s,n)}function CA(e){const{children:t,width:n,breakpoint:r,breakpoints:i=SA,cols:s=xA,layouts:o={},rowHeight:a=150,maxRows:l=1/0,margin:c=[10,10],containerPadding:d=null,compactor:h,onBreakpointChange:f=ih,onLayoutChange:p=ih,onWidthChange:m=ih,...y}=e,b=h??Jc("vertical"),_=b.type,v=b.allowOverlap,g=w.useMemo(()=>r??ky(i,n),[]),S=w.useMemo(()=>Cy(g,s),[g,s]),C=w.useMemo(()=>Gu(o,i,g,g,S,_),[]),[x,T]=w.useState(g),[P,B]=w.useState(S),[j,$]=w.useState(C),[I,R]=w.useState(o),A=w.useRef(n),N=w.useRef(r),z=w.useRef(i),U=w.useRef(s),D=w.useRef(o),O=w.useRef(_),k=w.useRef(I);w.useEffect(()=>{k.current=I},[I]);const Q=w.useMemo(()=>Or(o,D.current)?null:Gu(o,i,x,x,P,b),[o,i,x,P,b]),ne=Q??j;w.useEffect(()=>{Q!==null&&($(Q),R(o),k.current=o,D.current=o)},[Q,o]),w.useEffect(()=>{if(_!==O.current){const ae=b.compact(Ci(ne),P),se={...k.current,[x]:ae};$(ae),R(se),k.current=se,p(ae,se),O.current=_}},[_,b,ne,P,v,x,p]),w.useEffect(()=>{const ae=n!==A.current,se=r!==N.current,he=!Or(i,z.current),Pe=!Or(s,U.current);if(ae||se||he||Pe){const be=r??ky(i,n),Se=Cy(be,s),L=x;if(L!==be||he||Pe){const ye={...k.current};ye[L]||(ye[L]=Ci(j));let Te=Gu(ye,i,be,L,Se,b);Te=kA(Te,t,Se,b),ye[be]=Te,T(be),B(Se),$(Te),R(ye),k.current=ye,f(be,Se),p(Te,ye)}const ge=sl(c,be),oe=d?sl(d,be):null;m(n,ge,Se,oe),A.current=n,N.current=r,z.current=i,U.current=s}},[n,r,i,s,x,P,j,t,b,_,v,c,d,f,p,m]);const E=w.useCallback(ae=>{const he={...k.current,[x]:ae};$(ae),R(he),k.current=he,p(ae,he)},[x,p]),ce=w.useMemo(()=>sl(c,x),[c,x]),_e=w.useMemo(()=>d===null?null:sl(d,x),[d,x]),te=w.useMemo(()=>({cols:P,rowHeight:a,maxRows:l,margin:ce,containerPadding:_e}),[P,a,l,ce,_e]);return u.jsx(wA,{...y,width:n,gridConfig:te,compactor:b,onLayoutChange:E,layout:ne,children:t})}function ox(e){const{children:t,width:n,breakpoint:r,breakpoints:i,cols:s,layouts:o,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,rowHeight:d,maxRows:h,margin:f,containerPadding:p,droppingItem:m,compactType:y,preventCollision:b=!1,allowOverlap:_=!1,verticalCompact:v,isDraggable:g=!0,isBounded:S=!1,draggableHandle:C,draggableCancel:x,isResizable:T=!0,resizeHandles:P=["se"],resizeHandle:B,isDroppable:j=!1,useCSSTransforms:$=!0,transformScale:I=1,autoSize:R,className:A,style:N,innerRef:z,onDragStart:U,onDrag:D,onDragStop:O,onResizeStart:k,onResize:Q,onResizeStop:ne,onDrop:E,onDropDragOver:ce}=e;let _e=y===void 0?"vertical":y;v===!1&&(_e=null);const te={enabled:g,bounded:S,handle:C,cancel:x},ae={enabled:T,handles:P,handleComponent:B},se={enabled:j};let he;$?I!==1?he=GP(I):he=IS:he=YP;const Pe=Jc(_e,_,b);return u.jsx(CA,{width:n,breakpoint:r,breakpoints:i,cols:s,layouts:o,rowHeight:d,maxRows:h,margin:f,containerPadding:p,compactor:Pe,dragConfig:te,resizeConfig:ae,dropConfig:se,positionStrategy:he,droppingItem:m,autoSize:R,className:A,style:N,innerRef:z,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,onDragStart:U,onDrag:D,onDragStop:O,onResizeStart:k,onResize:Q,onResizeStop:ne,onDrop:E,onDropDragOver:ce,children:t})}ox.displayName="ResponsiveReactGridLayout";var EA=ox,NA="react-grid-layout";function jA(e){function t(n){const{measureBeforeMount:r=!1,className:i,style:s,...o}=n,[a,l]=w.useState(1280),[c,d]=w.useState(!1),h=w.useRef(null),f=w.useRef(null);return w.useEffect(()=>{d(!0)},[]),w.useEffect(()=>{const p=h.current;if(!(p instanceof HTMLElement))return;let m=null;const y=new ResizeObserver(b=>{if(b[0]){const _=b[0].contentRect.width;m!==null&&cancelAnimationFrame(m),m=requestAnimationFrame(()=>{l(_),m=null})}});return y.observe(p),f.current=y,()=>{m!==null&&cancelAnimationFrame(m),y.unobserve(p),y.disconnect()}},[c]),r&&!c?u.jsx("div",{className:io(i,NA),style:s,ref:h}):u.jsx(e,{innerRef:h,className:i,style:s,...o,width:a})}return t.displayName=`WidthProvider(${e.displayName||e.name||"Component"})`,t}const RA=jA(EA),TA={lg:12,xxs:1},DA={lg:640,xxs:0},$y=12,Dd=20,Dl=16;function PA(e){const t=e-Dd*2-($y-1)*Dl;return Math.max(16,t/$y)}function LA({blocks:e,layouts:t,mode:n,onLayoutChange:r,renderBlock:i,blockMeta:s,onRemove:o,onDuplicate:a,canRemove:l=()=>!0,canDuplicate:c=()=>!0}){const d=n==="layout",h=w.useRef(null),[f,p]=w.useState(46);return w.useLayoutEffect(()=>{const m=h.current;if(!m)return;const y=()=>p(PA(m.clientHeight));if(y(),typeof ResizeObserver>"u")return;const b=new ResizeObserver(y);return b.observe(m),()=>b.disconnect()},[]),u.jsx("div",{ref:h,className:`block-canvas ${d?"arranging":""}`,style:{"--row-pitch":`${f+Dl}px`},"data-testid":"block-canvas",children:u.jsx(RA,{className:"rgl",layouts:t,breakpoints:DA,cols:TA,rowHeight:f,margin:[Dl,Dl],containerPadding:[Dd,Dd],isDraggable:d,isResizable:d,draggableHandle:".block-handle",onLayoutChange:(m,y)=>r(y),compactType:"vertical",useCSSTransforms:!0,children:e.map(m=>{const y=s(m);return u.jsxs("div",{className:`block ${d?"is-arranging":""}`,"data-testid":`block-${m.type}`,"data-rgl-id":m.id,children:[u.jsxs("div",{className:`block-header ${d?"block-handle":""}`,children:[u.jsx("span",{className:"block-icon",children:y.icon}),u.jsx("span",{className:"block-title",children:y.title}),u.jsx("span",{className:"spacer"}),d&&u.jsxs("span",{className:"block-actions",children:[c(m)&&u.jsx("button",{title:"Duplicate",onClick:()=>a(m.id),"data-testid":"block-duplicate",children:"⧉"}),l(m)?u.jsx("button",{title:"Remove",onClick:()=>o(m.id),"data-testid":"block-remove",children:"✕"}):u.jsx("span",{className:"block-pin",title:"Chat is always here",children:"📌"})]})]}),u.jsx("div",{className:"block-body",children:i(m)})]},m.id)})})})}function AA({blocks:e,activeId:t,setActiveId:n,mode:r,renderBlock:i,blockMeta:s,onRemove:o,canRemove:a=()=>!0}){const l=e.find(d=>d.id===t)||e[0],c=r==="layout";return u.jsxs("div",{className:"mobile-canvas","data-testid":"mobile-canvas",children:[u.jsx("div",{className:"mobile-tabs","data-testid":"mobile-tabs",children:e.map(d=>{const h=s(d);return u.jsxs("button",{className:`mtab ${d.id===(l==null?void 0:l.id)?"active":""}`,onClick:()=>n(d.id),"data-testid":`mtab-${d.type}`,children:[u.jsx("span",{className:"mtab-icon",children:h.icon}),u.jsx("span",{className:"mtab-label",children:h.title}),c&&a(d)&&u.jsx("span",{className:"mtab-x",role:"button",title:"Remove",onClick:f=>{f.stopPropagation(),o(d.id)},children:"✕"})]},d.id)})}),u.jsx("div",{className:"mobile-block",children:l&&u.jsx("div",{className:"block",children:u.jsx("div",{className:"block-body",children:i(l)})})})]})}function IA({items:e,bazaarItems:t=[],onAdd:n,onClose:r}){return u.jsx("div",{className:"modal-backdrop",onClick:r,"data-testid":"add-gallery-backdrop",children:u.jsxs("div",{className:"modal add-gallery",onClick:i=>i.stopPropagation(),"data-testid":"add-gallery",children:[u.jsx("h2",{children:"Add a block"}),u.jsx("p",{className:"muted",children:"Build your space — drop in whatever's useful. Move and resize it however you like."}),u.jsx("div",{className:"gallery-grid",children:e.map(i=>u.jsxs("button",{className:"gallery-item",disabled:i.soon,onClick:()=>!i.soon&&n(i.type),"data-testid":`gallery-add-${i.type}`,children:[u.jsx("span",{className:"gallery-glyph",children:i.icon}),u.jsx("span",{className:"gallery-name",children:i.title}),u.jsx("span",{className:"gallery-desc",children:i.desc}),i.soon&&u.jsx("span",{className:"gallery-soon",children:"soon"})]},i.type))}),t.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"gallery-section",children:"🛍️ from the Bazaar"}),u.jsx("div",{className:"gallery-grid",children:t.map(i=>u.jsxs("button",{className:"gallery-item bazaar",onClick:()=>n(i.type),"data-testid":`gallery-add-${i.type}`,children:[u.jsx("span",{className:"gallery-glyph",children:i.icon}),u.jsx("span",{className:"gallery-name",children:i.title}),u.jsx("span",{className:"gallery-desc",children:i.desc})]},i.type))})]}),u.jsxs("div",{className:"gallery-agent-hint","data-testid":"gallery-agent-hint",children:["✨ Or ask your agent in chat — ",u.jsx("em",{children:"“make me a block that shows today’s signups”"})," — and it builds one for you."]}),u.jsx("div",{className:"actions",children:u.jsx("button",{onClick:r,children:"Done"})})]})})}const MA={chat:{icon:"🗨️",label:"Chat"},liveview:{icon:"👁️",label:"Live view"},notes:{icon:"📝",label:"Notes"},earnings:{icon:"💸",label:"Earnings"},analytics:{icon:"📊",label:"Analytics"},usage:{icon:"🔋",label:"Usage"},powers:{icon:"🧰",label:"Powers"}};function Hy({blocks:e}){return u.jsx("span",{className:"tpl-chips",children:e.map((t,n)=>{const r=MA[t.type]||{icon:"▫️",label:t.type};return u.jsxs("span",{className:"tpl-chip",title:r.label,children:[u.jsx("span",{className:"tpl-chip-icon",children:r.icon}),r.label]},n)})})}function OA({builtins:e=[],saved:t=[],onApply:n,onSaveCurrent:r,onDelete:i,onClose:s}){const[o,a]=w.useState("");function l(){const c=o.trim();c&&(r(c),a(""))}return u.jsx("div",{className:"modal-backdrop",onClick:s,"data-testid":"template-gallery-backdrop",children:u.jsxs("div",{className:"modal template-gallery",onClick:c=>c.stopPropagation(),"data-testid":"template-gallery",children:[u.jsx("h2",{children:"Start from a template"}),u.jsx("p",{className:"muted",children:"Pick a layout to start from — it swaps your current blocks for the template's. Chat always stays."}),u.jsx("div",{className:"gallery-grid",children:e.map(c=>u.jsxs("button",{className:"gallery-item template-card",onClick:()=>n(c),"data-testid":`template-${c.id}`,children:[u.jsx("span",{className:"gallery-glyph",children:c.icon}),u.jsx("span",{className:"gallery-name",children:c.name}),u.jsx("span",{className:"gallery-desc",children:c.desc}),u.jsx(Hy,{blocks:c.blocks})]},c.id))}),t.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"gallery-section",children:"⭐ your templates"}),u.jsx("div",{className:"gallery-grid",children:t.map(c=>u.jsxs("div",{className:"gallery-item template-card saved","data-testid":`template-${c.id}`,children:[u.jsxs("button",{className:"tpl-apply",onClick:()=>n(c),"data-testid":`template-apply-${c.id}`,children:[u.jsx("span",{className:"gallery-glyph",children:c.icon||"⭐"}),u.jsx("span",{className:"gallery-name",children:c.name}),u.jsx(Hy,{blocks:c.blocks})]}),u.jsx("button",{className:"tpl-del",title:"Delete this template",onClick:()=>i(c.id),"data-testid":`template-delete-${c.id}`,children:"✕"})]},c.id))})]}),u.jsxs("div",{className:"tpl-save-row",children:[u.jsx("input",{className:"tpl-save-input",value:o,onChange:c=>a(c.target.value),onKeyDown:c=>c.key==="Enter"&&l(),placeholder:"Save current layout as…","data-testid":"template-save-name",maxLength:40}),u.jsx("button",{className:"primary",onClick:l,disabled:!o.trim(),"data-testid":"template-save-btn",children:"Save layout"})]}),u.jsx("div",{className:"actions",children:u.jsx("button",{onClick:s,children:"Done"})})]})})}const ax="wild:theme",Pd=[{id:"cyan",name:"VentureWild",accent:"#0891b2",hot:"#0e7490"},{id:"teal",name:"Teal",accent:"#0d9488",hot:"#0f766e"},{id:"blue",name:"Blue",accent:"#2563eb",hot:"#1d4ed8"},{id:"violet",name:"Violet",accent:"#7c3aed",hot:"#6d28d9"},{id:"emerald",name:"Emerald",accent:"#059669",hot:"#047857"},{id:"amber",name:"Amber",accent:"#d97706",hot:"#b45309"},{id:"rose",name:"Rose",accent:"#e11d48",hot:"#be123c"}],zA=[{id:"light",name:"Light",glyph:"☀️",desc:"Bright & warm (default)"},{id:"dark",name:"Dark",glyph:"🌙",desc:"The venturewild.llc look"}],lx={bg:"--bg",bgElev:"--bg-elev",surface:"--surface",border:"--border",text:"--text",textMuted:"--text-muted",canvas1:"--canvas-1",canvas2:"--canvas-2",canvas3:"--canvas-3"},Pl={mode:"light",accent:Pd[0].accent,hot:Pd[0].hot,accentManual:!1,tokens:{}};function Hr(e){if(typeof e!="string")return null;const t=e.trim();return/^#([0-9a-f]{6})$/i.test(t)?t.toLowerCase():null}function cx(e){const t=Hr(e)||"#000000";return[parseInt(t.slice(1,3),16),parseInt(t.slice(3,5),16),parseInt(t.slice(5,7),16)]}function Yp(e,t=.16){const[n,r,i]=cx(e),s=1-t,o=a=>Math.max(0,Math.min(255,Math.round(a*s)));return`#${[o(n),o(r),o(i)].map(a=>a.toString(16).padStart(2,"0")).join("")}`}function ux(e){const[t,n,r]=cx(e).map(s=>{const o=s/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r>.42?"#08232b":"#ffffff"}function Gp(e){const t={};if(e&&typeof e=="object")for(const n of Object.keys(lx)){const r=Hr(e[n]);r&&(t[n]=r)}return t}function BA(e,t,n){const r=t&&typeof t=="object"?t:{},i=n?e.accent:Hr(r.accent)||e.accent,s=n?e.hot:Hr(r.hot)||Hr(r.accent)||e.hot;return{...e,mode:r.mode==="dark"?"dark":"light",accent:i,hot:s,tokens:Gp(r.tokens),accentManual:!0}}function FA(){try{const e=localStorage.getItem(ax);if(!e)return{...Pl};const t=JSON.parse(e),n=Hr(t.accent)||Pl.accent;return{mode:t.mode==="dark"?"dark":"light",accent:n,hot:Hr(t.hot)||Yp(n),accentManual:!!t.accentManual,tokens:Gp(t.tokens)}}catch{return{...Pl}}}function $A(e){try{localStorage.setItem(ax,JSON.stringify(e))}catch{}}function HA(e){const t=document.documentElement;e.mode==="dark"?t.dataset.theme="dark":delete t.dataset.theme;const n=Hr(e.accent)||Pl.accent;t.style.setProperty("--accent",n),t.style.setProperty("--accent-hot",Hr(e.hot)||Yp(n)),t.style.setProperty("--accent-ink",ux(n));const r=Gp(e.tokens);for(const[i,s]of Object.entries(lx))r[i]?t.style.setProperty(s,r[i]):t.style.removeProperty(s)}function WA({theme:e,onChange:t,onClose:n,onPublish:r,remixOf:i}){const[s,o]=w.useState(e.accent),[a,l]=w.useState(i?`${i.title} (remix)`:""),[c,d]=w.useState(""),[h,f]=w.useState(!1),[p,m]=w.useState(null);async function y(){var S;const g=a.trim();if(!(!g||h)){f(!0),m(null);try{const C=await r({title:g,pitch:c.trim()});C&&C.ok?m({ok:!0,text:`✓ “${((S=C.listing)==null?void 0:S.title)||g}” is on your Themes shelf.`}):m({ok:!1,text:C&&C.error?C.error:"Could not publish — try again."})}catch(C){m({ok:!1,text:C.message||"Could not publish — try again."})}finally{f(!1)}}}function b(g){t({...e,mode:g,tokens:{}})}function _(g){o(g.accent),t({...e,accent:g.accent,hot:g.hot,accentManual:!0})}function v(g){o(g),/^#([0-9a-f]{6})$/i.test(g)&&t({...e,accent:g,hot:Yp(g),accentManual:!0})}return u.jsx("div",{className:"modal-backdrop",onClick:n,"data-testid":"theme-picker-backdrop",children:u.jsxs("div",{className:"modal theme-picker",onClick:g=>g.stopPropagation(),"data-testid":"theme-picker",children:[u.jsx("h2",{children:"Make it yours"}),u.jsx("p",{className:"muted",children:"Pick a look. Changes apply live and follow you across your workspaces."}),i&&u.jsxs("p",{className:"theme-remixing muted","data-testid":"theme-remixing",children:["✦ Remixing “",i.title,"” — tweak it below, then publish it as your own."]}),u.jsx("div",{className:"theme-section",children:"Mode"}),u.jsx("div",{className:"theme-modes",children:zA.map(g=>u.jsxs("button",{className:`theme-mode ${e.mode===g.id?"active":""}`,onClick:()=>b(g.id),"data-testid":`theme-mode-${g.id}`,"aria-pressed":e.mode===g.id,children:[u.jsx("span",{className:"theme-mode-glyph",children:g.glyph}),u.jsx("span",{className:"theme-mode-name",children:g.name}),u.jsx("span",{className:"theme-mode-desc",children:g.desc})]},g.id))}),u.jsx("div",{className:"theme-section",children:"Accent"}),u.jsx("div",{className:"theme-swatches",children:Pd.map(g=>{const S=e.accent.toLowerCase()===g.accent.toLowerCase();return u.jsx("button",{className:`theme-swatch ${S?"active":""}`,style:{background:g.accent,color:ux(g.accent)},onClick:()=>_(g),title:g.name,"data-testid":`theme-accent-${g.id}`,"aria-pressed":S,children:S?"✓":""},g.id)})}),u.jsxs("div",{className:"theme-custom",children:[u.jsx("label",{htmlFor:"theme-hex",className:"muted",children:"Custom"}),u.jsx("input",{id:"theme-hex",type:"color",value:/^#([0-9a-f]{6})$/i.test(s)?s:"#0891b2",onChange:g=>v(g.target.value),"data-testid":"theme-custom-color","aria-label":"Custom accent color"}),u.jsx("input",{className:"theme-hex-input",value:s,onChange:g=>v(g.target.value),placeholder:"#0891b2",maxLength:7,spellCheck:!1,"data-testid":"theme-custom-hex"})]}),r&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"theme-section",children:"Share your look"}),u.jsx("p",{className:"muted theme-publish-sub",children:"Put this theme on your Bazaar shelf so others can wear it — you earn each time they do."}),u.jsxs("div",{className:"theme-publish","data-testid":"theme-publish",children:[u.jsx("input",{className:"theme-hex-input theme-publish-title",value:a,onChange:g=>l(g.target.value),placeholder:"Name your look — e.g. Midnight Focus",maxLength:60,"data-testid":"theme-publish-title","aria-label":"Theme name"}),u.jsx("input",{className:"theme-hex-input theme-publish-pitch",value:c,onChange:g=>d(g.target.value),placeholder:"One line — what's the vibe? (optional)",maxLength:120,"data-testid":"theme-publish-pitch","aria-label":"Theme pitch"}),u.jsx("button",{className:"primary",onClick:y,disabled:!a.trim()||h,"data-testid":"theme-publish-btn",children:h?"Publishing…":"Publish my look"})]}),p&&u.jsx("p",{className:`theme-publish-msg ${p.ok?"ok":"err"}`,"data-testid":"theme-publish-msg",children:p.text})]}),u.jsx("div",{className:"actions",children:u.jsx("button",{className:"primary",onClick:n,"data-testid":"theme-done",children:"Done"})})]})})}const ol=[{tier:1,label:"Read-only (diagnostics + logs)"},{tier:2,label:"Diagnostics & fixes (recommended)"},{tier:3,label:"Operate my agent",operate:!0},{tier:4,label:"Run shell commands",operate:!0}],UA=[{minutes:30,label:"30 minutes"},{minutes:120,label:"2 hours"},{minutes:480,label:"8 hours"}];function VA(e){const t=Math.round(e/6e4);return t<=0?"expiring":t<60?`${t} min`:`${Math.floor(t/60)}h ${t%60}m`}function qA({token:e}){var v;const[t,n]=w.useState(null),[r,i]=w.useState(2),[s,o]=w.useState(30),[a,l]=w.useState(!1),[c,d]=w.useState(!1),h=w.useCallback(()=>e?{Authorization:`Bearer ${e}`}:{},[e]),f=w.useCallback(async()=>{try{const g=await fetch("/api/support/status",{headers:h()});if(!g.ok)return;n(await g.json())}catch{}},[h]);w.useEffect(()=>{f();const g=setInterval(f,1e4);return()=>clearInterval(g)},[f]);const p=w.useCallback(async()=>{var g;l(!0);try{const S=(g=ol.find(C=>C.tier===r))==null?void 0:g.operate;await fetch("/api/support/grant",{method:"POST",headers:{"content-type":"application/json",...h()},body:JSON.stringify({tier:r,minutes:s,confirmOperate:!!S})})}catch{}l(!1),f()},[h,f,r,s]),m=w.useCallback(async()=>{d(!0);try{await fetch("/api/support/revoke",{method:"POST",headers:h()})}catch{}d(!1),f()},[h,f]);if(!t||typeof t.enabled!="boolean")return null;const y=t.enabled||t.active||!!t.operate;if(!y&&!t.canGrant)return null;const b=ol.find(g=>g.tier===r),_=t.maxTier||4;return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"set-section",children:"Support access"}),y?u.jsxs("div",{className:"set-support","data-testid":"support-access",children:[u.jsxs("span",{children:["🛟 ",u.jsx("strong",{children:"Allowed"})," —"," ",((v=ol.find(g=>g.tier===t.tier))==null?void 0:v.label)||`tier ${t.tier}`,t.remainingMs>0&&u.jsxs(u.Fragment,{children:[" · auto-expires in ",VA(t.remainingMs)]})]}),u.jsx("button",{type:"button",onClick:m,disabled:c,"data-testid":"support-revoke",children:c?"Revoking…":"Revoke"})]}):u.jsxs("div",{className:"set-support","data-testid":"support-access",children:[u.jsxs("label",{children:["Let support",u.jsx("select",{"aria-label":"support level",value:r,onChange:g=>i(Number(g.target.value)),children:ol.filter(g=>g.tier<=_).map(g=>u.jsx("option",{value:g.tier,children:g.label},g.tier))})]}),u.jsxs("label",{children:["for",u.jsx("select",{"aria-label":"duration",value:s,onChange:g=>o(Number(g.target.value)),children:UA.map(g=>u.jsx("option",{value:g.minutes,children:g.label},g.minutes))})]}),(b==null?void 0:b.operate)&&u.jsxs("span",{className:"set-support-warn","data-testid":"support-operate-warn",children:["⚠ lets support ",r>=4?"run shell commands on":"operate the agent on"," your machine"]}),u.jsx("button",{type:"button",onClick:p,disabled:a,"data-testid":"support-allow",children:a?"Allowing…":"Allow"})]}),u.jsx("p",{className:"muted small",children:"Off by default and time-boxed. While it’s allowed, a banner stays on screen with a one-tap Stop/Revoke."})]})}const Wy=[{id:"check",title:"Check with me",emoji:"🪧",build:!0,desc:"Your agent proposes first — it only acts after you approve. Read-only until you say go."},{id:"work",title:"Work, then show me",emoji:"🛠️",build:!1,desc:"Builds and edits freely, shows you the diff — but still confirms the risky stuff (deploy, delete, send, spend)."},{id:"full",title:"Full autonomy",emoji:"🚀",build:!0,desc:"Does everything on its own, never asks. Fastest — and the least guarded."}];function KA({token:e,session:t,onClose:n,onOpenTheme:r}){var _,v;const[i,s]=w.useState(null),[o,a]=w.useState(""),[l,c]=w.useState(!1),d=e?{Authorization:`Bearer ${e}`}:{};w.useEffect(()=>{let g=!0;return fetch("/api/settings",{headers:d}).then(S=>S.ok?S.json():null).then(S=>{g&&S&&(s(S),a(S.conversationTitle||""))}).catch(()=>{}),()=>{g=!1}},[e]);async function h(g){const S=await fetch("/api/settings",{method:"POST",headers:{...d,"Content-Type":"application/json"},body:JSON.stringify(g)}).then(C=>C.ok?C.json():null).catch(()=>null);return S&&s(S),S}function f(g){const S=Wy.find(C=>C.id===g);!S||!S.build||(s(C=>({...C||{},autonomyLevel:g})),h({autonomyLevel:g}))}async function p(){c(!0);try{await h({conversationTitle:o})}finally{c(!1)}}const m=(i==null?void 0:i.autonomyLevel)??null,y=(t==null?void 0:t.account)||null,b=((_=t==null?void 0:t.identity)==null?void 0:_.name)||((v=t==null?void 0:t.agent)==null?void 0:v.label)||"your agent";return u.jsx("div",{className:"modal-backdrop",onClick:n,"data-testid":"settings-backdrop",children:u.jsxs("div",{className:"modal settings-menu",onClick:g=>g.stopPropagation(),"data-testid":"settings-menu",children:[u.jsx("h2",{children:"Settings"}),u.jsx("p",{className:"muted",children:"The everyday knobs. Your agent handles the rest."}),u.jsx("div",{className:"set-section",children:"Permissions — what can your agent do on its own?"}),u.jsx("div",{className:"autonomy-dial","data-testid":"autonomy-dial",children:Wy.map(g=>{const S=m===g.id;return u.jsxs("button",{className:`autonomy-tier ${S?"selected":""} ${g.build?"":"coming-soon"}`,onClick:()=>f(g.id),disabled:!g.build,"aria-pressed":S,"data-testid":`autonomy-${g.id}`,children:[u.jsx("span",{className:"autonomy-emoji",children:g.emoji}),u.jsxs("span",{className:"autonomy-body",children:[u.jsxs("span",{className:"autonomy-title",children:[g.title,!g.build&&u.jsx("span",{className:"autonomy-soon","data-testid":"autonomy-coming-soon",children:"coming soon"}),S&&u.jsx("span",{className:"autonomy-check",children:"✓"})]}),u.jsx("span",{className:"autonomy-desc",children:g.desc})]})]},g.id)})}),m===null&&u.jsxs("p",{className:"autonomy-note","data-testid":"autonomy-default-note",children:["Default — your agent follows the per-message ",u.jsx("strong",{children:"Build / Plan"})," toggle. Pick a setting above to lock it."]}),u.jsx("div",{className:"set-section",children:"Conversation name"}),u.jsxs("div",{className:"set-rename",children:[u.jsx("input",{type:"text",value:o,placeholder:"Auto-named from your chat",onChange:g=>a(g.target.value),"data-testid":"rename-input",maxLength:120}),u.jsx("button",{onClick:p,disabled:l,"data-testid":"rename-save",children:l?"Saving…":"Save"})]}),u.jsx("p",{className:"muted small",children:"Overrides the name we auto-pick for this workspace’s presence label."}),u.jsx("div",{className:"set-section",children:"Appearance"}),u.jsx("button",{className:"set-row",onClick:()=>{r==null||r(),n==null||n()},"data-testid":"settings-open-theme",children:"🎨 Theme — light / dark + accent"}),u.jsx(qA,{token:e}),u.jsx("div",{className:"set-section",children:"Account"}),u.jsxs("div",{className:"set-account","data-testid":"settings-account",children:[u.jsxs("span",{className:"set-account-agent",children:["Your agent: ",u.jsx("strong",{children:b})]}),y!=null&&y.email?u.jsxs("span",{className:"set-account-email",children:["Signed in as ",y.email]}):u.jsx("span",{className:"set-account-email muted",children:"Signed in on this device"})]}),u.jsx("div",{className:"actions",children:u.jsx("button",{onClick:n,"data-testid":"settings-done",children:"Done"})})]})})}function YA({bazaarPreview:e}){const[t,n]=w.useState(null);w.useEffect(()=>{let i=!1;async function s(){var c;const a=await fetch("/api/preview/ports").catch(()=>null);if(!a||i)return;const l=await a.json().catch(()=>({}));i||!t&&((c=l.ports)==null?void 0:c.length)>0&&n(l.ports[0].port)}s();const o=setInterval(s,4e3);return()=>{i=!0,clearInterval(o)}},[t]);const r=e!=null&&e.url?`${e.url}${e.url.includes("?")?"&":"?"}_=${e.ts||""}`:null;return r?u.jsx("iframe",{className:"liveview-frame",src:r,title:"Live view","data-testid":"liveview-frame",sandbox:"allow-scripts"},`bz-${e.ts}`):t?u.jsx("iframe",{className:"liveview-frame",src:`http://localhost:${t}`,title:"Live view","data-testid":"liveview-frame"},t):u.jsxs("div",{className:"liveview-empty","data-testid":"liveview-empty",children:[u.jsx("div",{className:"liveview-empty-mark",children:"👁️"}),u.jsx("p",{className:"liveview-empty-title",children:"Nothing to show yet"}),u.jsx("p",{className:"liveview-empty-sub",children:"When your agent builds something, it appears here — live, as it works."}),u.jsx(Lp,{variant:"ambient"})]})}function GA({id:e}){const t=`wild:notes:${e}`,[n,r]=w.useState(()=>{try{return localStorage.getItem(t)||""}catch{return""}});return w.useEffect(()=>{try{localStorage.setItem(t,n)}catch{}},[t,n]),u.jsx("textarea",{className:"notes-block",value:n,onChange:i=>r(i.target.value),placeholder:"Jot anything — a plan, a link, a reminder…","data-testid":"notes-block"})}function XA(e){return`$${(Number(e)||0).toFixed(2)}`}function JA(e=[],t=[]){if(!e.length)return t.length?{name:"You",handle:"you",total:0,uses:0,matches:0,serviceCalls:0}:null;const n=e[0];return(n.total||0)===0&&e.find(r=>r.handle==="you")||n}function ZA({live:e,token:t}){const[n,r]=w.useState(e||null);w.useEffect(()=>{let m=!1;const y=t?{Authorization:`Bearer ${t}`}:{};return fetch("/api/bazaar/state",{headers:y}).then(b=>b.ok?b.json():null).then(b=>{!m&&b&&r(_=>_||b)}).catch(()=>{}),()=>{m=!0}},[t]),w.useEffect(()=>{e&&r(e)},[e]);const i=w.useMemo(()=>JA(n==null?void 0:n.earnings,n==null?void 0:n.listings),[n]),s=i==null?void 0:i.handle,o=(i==null?void 0:i.total)??0,a=w.useRef({handle:null,total:null}),[l,c]=w.useState([]);if(w.useEffect(()=>{const m=a.current;if(m.handle!==s){a.current={handle:s,total:o},c([]);return}if(m.total===null){a.current={handle:s,total:o};return}const y=o-m.total;a.current={handle:s,total:o},y>0&&c(b=>[...b,y].slice(-28))},[s,o]),!i)return u.jsxs("div",{className:"earn-empty","data-testid":"earnings-empty",children:[u.jsx("div",{className:"earn-empty-mark",children:"💸"}),u.jsx("p",{className:"earn-empty-title",children:"No earnings yet"}),u.jsx("p",{className:"earn-empty-sub",children:"When someone builds on what you share — or uses a tool you wired in — represented earnings show up here, live."})]});const d=i.handle==="you",h=(i.serviceCalls||0)>0||(i.matches||0)>0,f=h?i.matches||0:i.uses||0,p=h?f===1?"match":"matches":f===1?"build":"builds";return u.jsxs("div",{className:"earn-block","data-testid":"earnings-block",children:[u.jsxs("div",{className:"earn-who",children:[u.jsxs("span",{className:"earn-name",children:[i.name,d&&u.jsx("span",{className:"earn-you-tag",children:"you"})]}),u.jsx("span",{className:"earn-sub",children:d?"your producer earnings":"a producer's earnings, live"})]}),u.jsx("div",{className:"earn-amount","data-testid":"earnings-amount",children:XA(o)}),u.jsxs("div",{className:"earn-meta",children:[u.jsxs("span",{children:[u.jsx("strong",{children:f})," ",p]}),u.jsx("span",{className:"earn-rep",title:"No real money moves yet — a preview of how earnings would work.",children:"represented · settles later"})]}),u.jsx(QA,{values:l})]})}function QA({values:e}){const t=e&&e.length>0,n=t?e:Array.from({length:16},()=>0),r=t?Math.max(...e):1;return u.jsxs("div",{className:`earn-spark ${t?"":"is-baseline"}`,"data-testid":"earnings-spark","aria-hidden":"true",children:[u.jsx("div",{className:"earn-bars",children:n.map((i,s)=>u.jsx("span",{className:"earn-bar",style:{height:`${t?8+Math.round(i/r*92):6}%`}},s))}),u.jsx("span",{className:"earn-spark-live",children:"live"})]})}function hx(e){const t=Math.max(0,Math.min(100,Number(e)||0));return Math.round(t)}function Uy(e,t){if(!e)return"";const n=Date.parse(e);if(!Number.isFinite(n))return"";let r=Math.floor((n-t)/1e3);if(r<=0)return"resetting…";const i=Math.floor(r/86400);r-=i*86400;const s=Math.floor(r/3600);r-=s*3600;const o=Math.floor(r/60);return i>0?`resets in ${i}d ${s}h`:s>0?`resets in ${s}h ${o}m`:`resets in ${o}m`}function sh({label:e,value:t,sub:n,tone:r="accent",testid:i}){const s=hx(t);return u.jsxs("div",{className:"usage-gauge","data-testid":i,children:[u.jsxs("div",{className:"usage-gauge-head",children:[u.jsx("span",{className:"usage-gauge-label",children:e}),u.jsxs("span",{className:"usage-gauge-val",children:[s,"%"]})]}),u.jsx("div",{className:"usage-bar",children:u.jsx("span",{className:`usage-bar-fill tone-${r}`,style:{width:`${s}%`}})}),n?u.jsx("div",{className:"usage-gauge-sub",children:n}):null]})}function eI({live:e,token:t}){var b,_,v,g,S;const[n,r]=w.useState(e||null),[i,s]=w.useState(!1),[o,a]=w.useState(()=>Date.now()),l=w.useRef(!0),c=t?{Authorization:`Bearer ${t}`}:{};w.useEffect(()=>(l.current=!0,fetch("/api/usage/state",{headers:c}).then(C=>C.ok?C.json():null).then(C=>{l.current&&C&&r(x=>x?{...x,...C}:C)}).catch(()=>{}),()=>{l.current=!1}),[t]),w.useEffect(()=>{e&&r(e)},[e]),w.useEffect(()=>{const C=setInterval(()=>a(Date.now()),3e4);return()=>clearInterval(C)},[]);async function d(){s(!0);try{await fetch("/api/usage/ack",{method:"POST",headers:c});const C=await fetch("/api/usage/refresh",{method:"POST",headers:c}).then(x=>x.ok?x.json():null).catch(()=>null);l.current&&r(x=>({...x||{},...C||{},disclosed:!0}))}finally{l.current&&s(!1)}}if(n&&n.disclosed===!1)return u.jsxs("div",{className:"usage-block usage-disclose","data-testid":"usage-disclosure",children:[u.jsx("div",{className:"usage-disclose-mark",children:"📊"}),u.jsx("p",{className:"usage-disclose-title",children:"Show your Claude usage?"}),u.jsxs("p",{className:"usage-disclose-body",children:["To show your plan usage, your workspace reads your Claude login ",u.jsx("strong",{children:"locally"})," and asks Anthropic for your numbers. It never leaves this machine except to Anthropic."]}),u.jsx("button",{className:"usage-disclose-ok",onClick:d,disabled:i,"data-testid":"usage-disclose-ok",children:i?"One sec…":"OK, show my usage"})]});if(!n)return u.jsxs("div",{className:"usage-block","data-testid":"usage-loading",children:[u.jsx("div",{className:"usage-skeleton"}),u.jsx("div",{className:"usage-skeleton"}),u.jsx("div",{className:"usage-skeleton short"})]});const h=n.plan||null,f=n.context||null,p=n.status||"loading",m=!h||p==="unavailable",y=p==="stale";return u.jsxs("div",{className:`usage-block ${y?"is-stale":""}`,"data-testid":"usage-block",children:[y&&u.jsx("div",{className:"usage-stale-note","data-testid":"usage-stale",children:"couldn't refresh — showing last known"}),h?u.jsxs(u.Fragment,{children:[u.jsx(sh,{label:"Session",value:(b=h.five_hour)==null?void 0:b.utilization,sub:Uy((_=h.five_hour)==null?void 0:_.resets_at,o),tone:"accent",testid:"usage-session"}),u.jsx(sh,{label:"Weekly",value:(v=h.seven_day)==null?void 0:v.utilization,sub:Uy((g=h.seven_day)==null?void 0:g.resets_at,o),tone:"weekly",testid:"usage-weekly"}),(S=h.extra_usage)!=null&&S.is_enabled?u.jsxs("div",{className:"usage-extra","data-testid":"usage-extra",children:["extra usage · ",hx(h.extra_usage.utilization),"% of $",h.extra_usage.monthly_limit]}):null]}):u.jsxs("div",{className:"usage-unavailable","data-testid":"usage-unavailable",children:[u.jsx("span",{className:"usage-unavailable-title",children:"Plan usage unavailable"}),u.jsx("span",{className:"usage-unavailable-sub",children:p==="unavailable"?"Sign in to Claude (or a non-Claude model is active).":"Couldn’t reach Anthropic just now."})]}),f?u.jsx(sh,{label:"Working memory",value:f.pct,sub:`${Math.round((f.used||0)/1e3)}k / ${Math.round((f.window||0)/1e3)}k tokens`,tone:"memory",testid:"usage-context"}):null,u.jsxs("div",{className:"usage-foot",children:[u.jsx("span",{className:"usage-live-dot","data-status":p}),u.jsx("span",{children:p==="live"?"live":p})]})]})}function tI({token:e,onRun:t}){const[n,r]=w.useState(null),[i,s]=w.useState(!1),[o,a]=w.useState(null),l=w.useRef(!0),c=e?{Authorization:`Bearer ${e}`}:{};w.useEffect(()=>(l.current=!0,fetch("/api/powers/state",{headers:c}).then(g=>g.ok?g.json():null).then(g=>{l.current&&g&&r(g)}).catch(()=>{}),()=>{l.current=!1}),[e]);function d(){const g=((n==null?void 0:n.skills)||[]).map(C=>C.name),S=((n==null?void 0:n.skills)||[]).filter(C=>C.hidden).map(C=>C.name);a({order:g,hidden:S}),s(!0)}async function h(){const g=o||{order:[],hidden:[]},S=await fetch("/api/powers/curation",{method:"POST",headers:{...c,"Content-Type":"application/json"},body:JSON.stringify(g)}).then(x=>x.ok?x.json():null).catch(()=>null),C=await fetch("/api/powers/state",{headers:c}).then(x=>x.ok?x.json():null).catch(()=>null);return l.current&&(C&&r(C),s(!1),a(null)),S}function f(g){a(S=>{const C=new Set(S.hidden);return C.has(g)?C.delete(g):C.add(g),{...S,hidden:[...C]}})}function p(g,S){a(C=>{const x=[...C.order],T=x.indexOf(g),P=T+S;return T<0||P<0||P>=x.length?C:([x[T],x[P]]=[x[P],x[T]],{...C,order:x})})}if(!n)return u.jsxs("div",{className:"powers-block","data-testid":"powers-loading",children:[u.jsx("div",{className:"powers-skel"}),u.jsx("div",{className:"powers-skel"})]});const m=n.skills||[],y=new Set(i&&o?o.hidden:m.filter(g=>g.hidden).map(g=>g.name)),b=new Map((i&&o?o.order:m.map(g=>g.name)).map((g,S)=>[g,S])),_=[...m].sort((g,S)=>(b.get(g.name)??99)-(b.get(S.name)??99)),v=_.filter(g=>!y.has(g.name));return u.jsxs("div",{className:"powers-block","data-testid":"powers-block",children:[u.jsxs("div",{className:"powers-head",children:[u.jsx("span",{className:"powers-title",children:"Powers"}),m.length>0&&u.jsx("button",{className:"powers-edit",onClick:i?h:d,"data-testid":i?"powers-save":"powers-edit-toggle",children:i?"Done":"Customize"})]}),m.length===0?u.jsxs("div",{className:"powers-empty","data-testid":"powers-empty",children:[u.jsx("div",{className:"powers-empty-mark",children:"🧰"}),u.jsx("p",{className:"powers-empty-title",children:"No powers yet"}),u.jsxs("p",{className:"powers-empty-sub",children:["Skills you add to ",u.jsx("code",{children:".claude/skills"})," — your own or a teammate's — show up here as one-tap actions."]})]}):i?u.jsx("div",{className:"powers-list","data-testid":"powers-edit-list",children:_.map(g=>{const S=y.has(g.name);return u.jsxs("div",{className:`powers-row edit ${S?"is-hidden":""}`,"data-testid":`powers-row-${g.name}`,children:[u.jsxs("span",{className:"powers-reorder",children:[u.jsx("button",{onClick:()=>p(g.name,-1),title:"Move up","data-testid":`powers-up-${g.name}`,children:"▲"}),u.jsx("button",{onClick:()=>p(g.name,1),title:"Move down","data-testid":`powers-down-${g.name}`,children:"▼"})]}),u.jsxs("span",{className:"powers-row-name",children:["/",g.name]}),u.jsx("button",{className:"powers-hide",onClick:()=>f(g.name),"data-testid":`powers-hide-${g.name}`,children:S?"Show":"Hide"})]},g.name)})}):u.jsx("div",{className:"powers-list","data-testid":"powers-run-list",children:v.length===0?u.jsx("p",{className:"powers-allhidden",children:"All powers hidden — tap Customize to bring some back."}):v.map(g=>u.jsxs("button",{className:"powers-run",onClick:()=>t==null?void 0:t(g.name),title:g.description||`Run /${g.name}`,"data-testid":`powers-run-${g.name}`,children:[u.jsxs("span",{className:"powers-run-name",children:["/",g.name]}),g.description?u.jsx("span",{className:"powers-run-desc",children:g.description}):null,g.source==="user"?u.jsx("span",{className:"powers-tag",children:"yours"}):null]},g.name))}),u.jsxs("div",{className:"powers-bazaar","data-testid":"powers-bazaar-locked",children:[u.jsx("div",{className:"powers-divider",children:"─ from Bazaar ─"}),u.jsx("p",{className:"powers-bazaar-note",children:"🔒 Verified marketplace skills land here — coming soon."})]})]})}function Vy(e){return`$${(Number(e)||0).toFixed(2)}`}function nI({live:e,token:t}){const[n,r]=w.useState(e||null);w.useEffect(()=>{let c=!1;const d=t?{Authorization:`Bearer ${t}`}:{};return fetch("/api/bazaar/state",{headers:d}).then(h=>h.ok?h.json():null).then(h=>{!c&&h&&r(f=>f||h)}).catch(()=>{}),()=>{c=!0}},[t]),w.useEffect(()=>{e&&r(e)},[e]);const i=(n==null?void 0:n.earnings)||[],s=(n==null?void 0:n.totals)||{creditPaid:0},o=i.reduce((c,d)=>c+(d.matches||0),0),a=i.reduce((c,d)=>c+(d.uses||0),0),l=Math.max(1,...i.map(c=>c.total||0));return i.length?u.jsxs("div",{className:"analytics-block","data-testid":"analytics-block",children:[u.jsxs("div",{className:"an-stats",children:[u.jsxs("div",{className:"an-stat",children:[u.jsx("span",{className:"an-stat-num",children:Vy(s.creditPaid)}),u.jsx("span",{className:"an-stat-lbl",children:"represented"})]}),u.jsxs("div",{className:"an-stat",children:[u.jsx("span",{className:"an-stat-num",children:o||a}),u.jsx("span",{className:"an-stat-lbl",children:o?"matches":"builds"})]}),u.jsxs("div",{className:"an-stat",children:[u.jsx("span",{className:"an-stat-num",children:i.length}),u.jsx("span",{className:"an-stat-lbl",children:i.length===1?"producer":"producers"})]})]}),u.jsx("div",{className:"an-board",children:i.slice(0,6).map(c=>u.jsxs("div",{className:"an-row","data-testid":`analytics-row-${c.handle}`,children:[u.jsxs("span",{className:"an-row-name",children:[c.name,c.handle==="you"&&u.jsx("span",{className:"earn-you-tag",children:"you"})]}),u.jsx("span",{className:"an-row-bar",children:u.jsx("span",{className:"an-row-fill",style:{width:`${Math.round((c.total||0)/l*100)}%`}})}),u.jsx("span",{className:"an-row-val",children:Vy(c.total)})]},c.handle))}),u.jsx("div",{className:"an-foot",children:"represented · settles later"})]}):u.jsxs("div",{className:"earn-empty","data-testid":"analytics-empty",children:[u.jsx("div",{className:"earn-empty-mark",children:"📊"}),u.jsx("p",{className:"earn-empty-title",children:"No activity yet"}),u.jsx("p",{className:"earn-empty-sub",children:"Once builds and matches start flowing across the shelf, you'll see who's earning and how much, here."})]})}function rI({token:e,selectedFile:t,onOpenFile:n}){const[r,i]=w.useState(null),[s,o]=w.useState(null),[a,l]=w.useState(()=>new Set);w.useEffect(()=>{let h=!1;const f=e?{Authorization:`Bearer ${e}`}:{};return fetch("/api/workspace/tree",{headers:f}).then(p=>p.json()).then(p=>{h||(p.error?o(p.error):i(p.entries||[]))}).catch(p=>!h&&o(p.message||String(p))),()=>{h=!0}},[e]);function c(h){l(f=>{const p=new Set(f);return p.has(h)?p.delete(h):p.add(h),p})}function d(h,f=0){var b;const p=h.type==="dir",m=a.has(h.path),y=!p&&h.path===t;return u.jsxs("div",{children:[u.jsxs("div",{className:`fnode ${p?"dir":""} ${y?"sel":""}`,onClick:()=>p?c(h.path):n==null?void 0:n(h.path),style:{paddingLeft:f*12+6},"data-testid":`files-node-${h.path}`,title:h.path,children:[u.jsx("span",{className:"fnode-tw",children:p?m?"▾":"▸":""}),u.jsx("span",{className:"fnode-ic",children:p?"📁":"📄"}),u.jsx("span",{className:"fnode-nm",children:h.name})]}),p&&m&&((b=h.children)==null?void 0:b.map(_=>d(_,f+1)))]},h.path)}return u.jsxs("div",{className:"files-block","data-testid":"files-block",children:[s&&u.jsx("div",{className:"files-msg err",children:s==="forbidden"?"Files aren't available on this view.":s}),!r&&!s&&u.jsxs("div",{className:"files-msg",children:[u.jsx("span",{className:"spinner"})," loading…"]}),(r==null?void 0:r.length)===0&&u.jsx("div",{className:"files-msg",children:"Empty workspace"}),r==null?void 0:r.map(h=>d(h,0))]})}const iI={js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",json:"json",md:"markdown",markdown:"markdown",css:"css",scss:"scss",html:"markup",xml:"markup",svg:"markup",py:"python",rs:"rust",go:"go",sh:"bash",bash:"bash",zsh:"bash",yml:"yaml",yaml:"yaml",toml:"toml",sql:"sql",java:"java",c:"c",h:"c",cpp:"cpp",rb:"ruby",php:"php"};function sI(e){const t=String(e||"").split(".").pop().toLowerCase();return iI[t]||"text"}function oI({path:e,token:t,onPickFile:n}){const[r,i]=w.useState(e||""),[s,o]=w.useState({loading:!1});w.useEffect(()=>{i(e||"")},[e]),w.useEffect(()=>{if(!e){o({loading:!1});return}let l=!1;o({loading:!0});const c=t?{Authorization:`Bearer ${t}`}:{};return fetch(`/api/workspace/file?path=${encodeURIComponent(e)}`,{headers:c}).then(d=>d.json()).then(d=>{l||o({loading:!1,...d})}).catch(d=>{l||o({loading:!1,error:d.message||String(d)})}),()=>{l=!0}},[e,t]);const a=sI(e);return u.jsxs("div",{className:"codeblock","data-testid":"code-view-block",children:[u.jsxs("div",{className:"codeblock-bar",children:[u.jsx("input",{className:"codeblock-path",value:r,onChange:l=>i(l.target.value),onKeyDown:l=>l.key==="Enter"&&(n==null?void 0:n(r.trim())),placeholder:"path/to/file",spellCheck:!1,"data-testid":"code-path"}),s.truncated&&u.jsx("span",{className:"codeblock-trunc",title:"Large file — showing the start",children:"truncated"})]}),u.jsxs("div",{className:"codeblock-body",children:[!e&&u.jsx("div",{className:"codeblock-msg",children:"Pick a file in the Files block — or type a path above — to view it here."}),e&&s.loading&&u.jsxs("div",{className:"codeblock-msg",children:[u.jsx("span",{className:"spinner"})," loading…"]}),e&&s.error&&u.jsx("div",{className:"codeblock-msg err",children:s.error==="forbidden"?"Files aren't available on this view.":s.error}),e&&!s.loading&&!s.error&&typeof s.content=="string"&&u.jsx(CS,{theme:Dp.vsDark,code:s.content,language:a,children:({tokens:l,getLineProps:c,getTokenProps:d})=>u.jsx("pre",{className:"codeblock-pre",children:l.map((h,f)=>u.jsxs("div",{...c({line:h}),className:"codeblock-line",children:[u.jsx("span",{className:"codeblock-ln",children:f+1}),u.jsx("span",{className:"codeblock-lc",children:h.map((p,m)=>u.jsx("span",{...d({token:p})},m))})]},f))})})]})]})}function aI({id:e}){const t=`wild:todo:${e}`,[n,r]=w.useState(()=>{try{const d=JSON.parse(localStorage.getItem(t)||"[]");return Array.isArray(d)?d:[]}catch{return[]}}),[i,s]=w.useState("");w.useEffect(()=>{try{localStorage.setItem(t,JSON.stringify(n))}catch{}},[t,n]);function o(){const d=i.trim();d&&(r(h=>[...h,{id:`${Date.now().toString(36)}-${h.length}`,text:d,done:!1}]),s(""))}function a(d){r(h=>h.map(f=>f.id===d?{...f,done:!f.done}:f))}function l(d){r(h=>h.filter(f=>f.id!==d))}const c=n.filter(d=>!d.done).length;return u.jsxs("div",{className:"todo-block","data-testid":"todo-block",children:[u.jsxs("div",{className:"todo-add",children:[u.jsx("input",{value:i,onChange:d=>s(d.target.value),onKeyDown:d=>d.key==="Enter"&&o(),placeholder:"Add a to-do…","data-testid":"todo-input"}),u.jsx("button",{onClick:o,disabled:!i.trim(),"data-testid":"todo-add-btn",children:"Add"})]}),u.jsxs("div",{className:"todo-list",children:[n.length===0&&u.jsx("div",{className:"todo-msg",children:"Nothing yet — add your first to-do above."}),n.map(d=>u.jsxs("div",{className:`todo-item ${d.done?"done":""}`,"data-testid":"todo-item",children:[u.jsxs("label",{children:[u.jsx("input",{type:"checkbox",checked:d.done,onChange:()=>a(d.id)}),u.jsx("span",{className:"todo-text",children:d.text})]}),u.jsx("button",{className:"todo-del",title:"Remove",onClick:()=>l(d.id),children:"✕"})]},d.id))]}),n.length>0&&u.jsxs("div",{className:"todo-foot",children:[c," left · ",n.length-c," done"]})]})}const lI=4e3,cI="server";function uI({token:e}){const[t,n]=w.useState(null),[r,i]=w.useState(null),[s,o]=w.useState(null),[a,l]=w.useState(null),c=w.useRef(null);return w.useEffect(()=>{let d=!1;const h=e?{Authorization:`Bearer ${e}`}:{};return fetch("/api/workspace/logs",{headers:h}).then(f=>f.json()).then(f=>{if(d)return;if(f.error){l(f.error);return}const p=f.logs||[];n(p);const m=p.filter(b=>b.exists),y=m.find(b=>b.name===cI)||m[0]||p[0];y&&i(y.name)}).catch(f=>!d&&l(f.message||String(f))),()=>{d=!0}},[e]),w.useEffect(()=>{if(!r)return;let d=!1;const h=e?{Authorization:`Bearer ${e}`}:{},f=()=>{typeof document<"u"&&document.hidden||fetch(`/api/workspace/logs?name=${encodeURIComponent(r)}&lines=300`,{headers:h}).then(m=>m.json()).then(m=>{d||(m.error?l(m.error):(l(null),o(m.body||"")))}).catch(m=>!d&&l(m.message||String(m)))};o(null),f();const p=setInterval(f,lI);return()=>{d=!0,clearInterval(p)}},[r,e]),w.useEffect(()=>{const d=c.current;d&&(d.scrollTop=d.scrollHeight)},[s]),a?u.jsx("div",{className:"logs-block","data-testid":"logs-block",children:u.jsx("div",{className:"logs-msg err",children:a==="forbidden"?"Logs aren't available on this view.":String(a)})}):u.jsxs("div",{className:"logs-block","data-testid":"logs-block",children:[t&&u.jsxs("div",{className:"logs-bar",children:[u.jsx("select",{className:"logs-select","data-testid":"logs-select",value:r||"",onChange:d=>i(d.target.value),children:t.map(d=>u.jsxs("option",{value:d.name,children:[d.name,d.exists?"":" · empty"]},d.name))}),u.jsx("span",{className:"logs-hint",children:"live · auto-refresh"})]}),u.jsxs("div",{className:"logs-body",children:[s===null&&u.jsxs("div",{className:"logs-msg",children:[u.jsx("span",{className:"spinner"})," loading…"]}),s===""&&u.jsx("div",{className:"logs-msg",children:"No log output yet."}),s&&u.jsx("pre",{className:"logs-out","data-testid":"logs-out",ref:c,children:s})]})]})}const al=100;function hI(e){const t=[];let n=[],r="",i=!1;for(let s=0;s<e.length;s+=1){const o=e[s];i?o==='"'?e[s+1]==='"'?(r+='"',s+=1):i=!1:r+=o:o==='"'?i=!0:o===","?(n.push(r),r=""):o===`
91
+ `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&CL(e.body,"react-draggable-transparent-selection")}function jy(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{Ry(e)}):Ry(e)}function Ry(e){if(e)try{e.body&&EL(e.body,"react-draggable-transparent-selection");const t=e.selection;if(t)t.empty();else{const n=(e.defaultView||window).getSelection();n&&n.type!=="Caret"&&n.removeAllRanges()}}catch{}}function CL(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function EL(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(`(?:^|\\s)${t}(?!\\S)`,"g"),"")}function NL(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:TL(r);const i=Up(e);if(typeof r=="string"){const{ownerDocument:s}=i,o=s.defaultView;if(!o)throw new Error("Cannot resolve the owner window of the draggable node.");let a;if(r==="parent"?a=i.parentNode:a=i.getRootNode().querySelector(r),!(a instanceof o.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=o.getComputedStyle(i),d=o.getComputedStyle(l);r={left:-i.offsetLeft+cn(d.paddingLeft)+cn(c.marginLeft),top:-i.offsetTop+cn(d.paddingTop)+cn(c.marginTop),right:_L(l)-gL(i)-i.offsetLeft+cn(d.paddingRight)-cn(c.marginRight),bottom:yL(l)-mL(i)-i.offsetTop+cn(d.paddingBottom)-cn(c.marginBottom)}}return To(r.right)&&(t=Math.min(t,r.right)),To(r.bottom)&&(n=Math.min(n,r.bottom)),To(r.left)&&(t=Math.max(t,r.left)),To(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Ty(e,t,n){const r=Math.round(t/e[0])*e[0],i=Math.round(n/e[1])*e[1];return[r,i]}function jL(e){return e.props.axis==="both"||e.props.axis==="x"}function RL(e){return e.props.axis==="both"||e.props.axis==="y"}function Qu(e,t,n){const r=typeof t=="number"?SL(e,t):null;if(typeof t=="number"&&!r)return null;const i=Up(n),s=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return vL(r||e,s,n.props.scale)}function eh(e,t,n){const r=!To(e.lastX),i=Up(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function th(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function TL(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Up(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}function kr(...e){uL.DRAGGABLE_DEBUG&&console.log(...e)}var or={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},ti=or.mouse,Ti=class extends w.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button=="number"&&e.button!==0||e.ctrlKey))return!1;const t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!Ny(e.target,this.props.handle,t)||this.props.cancel&&Ny(e.target,this.props.cancel,t))return;e.type==="touchstart"&&!this.props.allowMobileScroll&&e.preventDefault();const r=xL(e);this.touchIdentifier=r;const i=Qu(e,r,this);if(i==null)return;const{x:s,y:o}=i,a=eh(this,s,o);kr("DraggableCore: handleDragStart: %j",a),kr("calling",this.props.onStart),!(this.props.onStart(e,a)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&kL(n),this.dragging=!0,this.lastX=s,this.lastY=o,Zu(n,ti.move,this.handleDrag),Zu(n,ti.stop,this.handleDragStop))},this.handleDrag=e=>{const t=Qu(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let o=n-this.lastX,a=r-this.lastY;if([o,a]=Ty(this.props.grid,o,a),!o&&!a)return;n=this.lastX+o,r=this.lastY+a}const i=eh(this,n,r);if(kr("DraggableCore: handleDrag: %j",i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const o=document.createEvent("MouseEvents");o.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(o)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;const t=Qu(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let a=n-this.lastX||0,l=r-this.lastY||0;[a,l]=Ty(this.props.grid,a,l),n=this.lastX+a,r=this.lastY+l}const i=eh(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;const o=this.findDOMNode();o&&this.props.enableUserSelectHack&&jy(o.ownerDocument),kr("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,o&&(kr("DraggableCore: Removing handlers"),Ai(o.ownerDocument,ti.move,this.handleDrag),Ai(o.ownerDocument,ti.stop,this.handleDragStop))},this.onMouseDown=e=>(ti=or.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(ti=or.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(ti=or.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(ti=or.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&Zu(e,or.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:t}=e;Ai(t,or.mouse.move,this.handleDrag),Ai(t,or.touch.move,this.handleDrag),Ai(t,or.mouse.stop,this.handleDragStop),Ai(t,or.touch.stop,this.handleDragStop),Ai(e,or.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&jy(t)}}findDOMNode(){var e;if((e=this.props)!=null&&e.nodeRef)return this.props.nodeRef.current;const t=pw;return typeof t.findDOMNode=="function"?t.findDOMNode(this):(kr("react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef"),null)}render(){return w.cloneElement(w.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Ti.displayName="DraggableCore";Ti.propTypes={allowAnyClick:Oe.bool,allowMobileScroll:Oe.bool,children:Oe.node.isRequired,disabled:Oe.bool,enableUserSelectHack:Oe.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Oe.arrayOf(Oe.number),handle:Oe.string,cancel:Oe.string,nodeRef:Oe.object,onStart:Oe.func,onDrag:Oe.func,onStop:Oe.func,onMouseDown:Oe.func,scale:Oe.number,className:Ws,style:Ws,transform:Ws};Ti.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Zc=class extends w.Component{constructor(e){super(e),this.onDragStart=(t,n)=>{if(kr("Draggable: onDragStart: %j",n),this.props.onStart(t,th(this,n))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(t,n)=>{if(!this.state.dragging)return!1;kr("Draggable: onDrag: %j",n);const r=th(this,n),i={x:r.x,y:r.y,slackX:0,slackY:0};if(this.props.bounds){const{x:o,y:a}=i;i.x+=this.state.slackX,i.y+=this.state.slackY;const[l,c]=NL(this,i.x,i.y);i.x=l,i.y=c,i.slackX=this.state.slackX+(o-i.x),i.slackY=this.state.slackY+(a-i.y),r.x=i.x,r.y=i.y,r.deltaX=i.x-this.state.x,r.deltaY=i.y-this.state.y}if(this.props.onDrag(t,r)===!1)return!1;this.setState(i)},this.onDragStop=(t,n)=>{if(!this.state.dragging||this.props.onStop(t,th(this,n))===!1)return!1;kr("Draggable: onDragStop: %j",n);const i={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:o,y:a}=this.props.position;i.x=o,i.y=a}this.setState(i)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(kr("Draggable: getDerivedStateFromProps %j",{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var e;if((e=this.props)!=null&&e.nodeRef)return this.props.nodeRef.current;const t=pw;return typeof t.findDOMNode=="function"?t.findDOMNode(this):null}render(){const{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:s,defaultClassNameDragged:o,position:a,positionOffset:l,scale:c,...d}=this.props;let h={},f=null;const m=!!!a||this.state.dragging,y=a||r,b={x:jL(this)&&m?this.state.x:y.x,y:RL(this)&&m?this.state.y:y.y};this.state.isElementSVG?f=wL(b,l):h=bL(b,l);const _=w.Children.only(n),v=io(_.props.className||"",i,{[s]:this.state.dragging,[o]:this.state.dragged});return w.createElement(Ti,{...d,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},w.cloneElement(_,{className:v,style:{..._.props.style,...h},transform:f}))}};Zc.displayName="Draggable";Zc.propTypes={...Ti.propTypes,axis:Oe.oneOf(["both","x","y","none"]),bounds:Oe.oneOfType([Oe.shape({left:Oe.number,right:Oe.number,top:Oe.number,bottom:Oe.number}),Oe.string,Oe.oneOf([!1])]),defaultClassName:Oe.string,defaultClassNameDragging:Oe.string,defaultClassNameDragged:Oe.string,defaultPosition:Oe.shape({x:Oe.number,y:Oe.number}),positionOffset:Oe.shape({x:Oe.oneOfType([Oe.number,Oe.string]),y:Oe.oneOfType([Oe.number,Oe.string])}),position:Oe.shape({x:Oe.number,y:Oe.number}),className:Ws,style:Ws,transform:Ws};Zc.defaultProps={...Ti.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1};var DL=Zc;const PL=Object.freeze(Object.defineProperty({__proto__:null,DraggableCore:Ti,default:DL},Symbol.toStringTag,{value:"Module"}));var Vp={exports:{}},Na={};const LL=n0(PL);var qp={};qp.__esModule=!0;qp.cloneElement=BL;var AL=IL(w);function IL(e){return e&&e.__esModule?e:{default:e}}function Dy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Py(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dy(Object(n),!0).forEach(function(r){ML(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ML(e,t,n){return(t=OL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OL(e){var t=zL(e,"string");return typeof t=="symbol"?t:t+""}function zL(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function BL(e,t){return t.style&&e.props.style&&(t.style=Py(Py({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),AL.default.cloneElement(e,t)}var ja={};ja.__esModule=!0;ja.resizableProps=void 0;var Me=FL(Wp);function FL(e){return e&&e.__esModule?e:{default:e}}ja.resizableProps={axis:Me.default.oneOf(["both","x","y","none"]),className:Me.default.string,children:Me.default.element.isRequired,draggableOpts:Me.default.shape({allowAnyClick:Me.default.bool,cancel:Me.default.string,children:Me.default.node,disabled:Me.default.bool,enableUserSelectHack:Me.default.bool,offsetParent:typeof Element<"u"?Me.default.instanceOf(Element):Me.default.any,grid:Me.default.arrayOf(Me.default.number),handle:Me.default.string,nodeRef:Me.default.object,onStart:Me.default.func,onDrag:Me.default.func,onStop:Me.default.func,onMouseDown:Me.default.func,scale:Me.default.number}),height:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t[0];return r.axis==="both"||r.axis==="y"?Me.default.number.isRequired(...t):Me.default.number(...t)},handle:Me.default.oneOfType([Me.default.node,Me.default.func]),handleSize:Me.default.arrayOf(Me.default.number),lockAspectRatio:Me.default.bool,maxConstraints:Me.default.arrayOf(Me.default.number),minConstraints:Me.default.arrayOf(Me.default.number),onResizeStop:Me.default.func,onResizeStart:Me.default.func,onResize:Me.default.func,resizeHandles:Me.default.arrayOf(Me.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:Me.default.number,width:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t[0];return r.axis==="both"||r.axis==="x"?Me.default.number.isRequired(...t):Me.default.number(...t)}};Na.__esModule=!0;Na.default=void 0;var ms=VS(w),$L=LL,HL=qp,WL=ja;const UL=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function VS(e,t){if(typeof WeakMap=="function")var n=new WeakMap,r=new WeakMap;return(VS=function(i,s){if(!s&&i&&i.__esModule)return i;var o,a,l={__proto__:null,default:i};if(i===null||typeof i!="object"&&typeof i!="function")return l;if(o=s?r:n){if(o.has(i))return o.get(i);o.set(i,l)}for(const c in i)c!=="default"&&{}.hasOwnProperty.call(i,c)&&((a=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,c))&&(a.get||a.set)?o(l,c,a):l[c]=i[c]);return l})(e,t)}function Rd(){return Rd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rd.apply(null,arguments)}function VL(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ly(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ly(Object(n),!0).forEach(function(r){qL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ly(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qL(e,t,n){return(t=KL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KL(e){var t=YL(e,"string");return typeof t=="symbol"?t:t+""}function YL(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}let Kp=class extends ms.Component{constructor(){super(...arguments),this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints(t,n){const r=this.props,i=r.minConstraints,s=r.maxConstraints,o=r.lockAspectRatio;if(!i&&!s&&!o)return[t,n];if(o){const f=this.props.width/this.props.height,p=t-this.props.width,m=n-this.props.height;Math.abs(p)>Math.abs(m*f)?n=t/f:t=n*f}const a=t,l=n;let c=this.slack||[0,0],d=c[0],h=c[1];return t+=d,n+=h,i&&(t=Math.max(i[0],t),n=Math.max(i[1],n)),s&&(t=Math.min(s[0],t),n=Math.min(s[1],n)),this.slack=[d+(a-t),h+(l-n)],[t,n]}resizeHandler(t,n){return(r,i)=>{var s,o,a,l;let c=i.node,d=i.deltaX,h=i.deltaY;t==="onResizeStart"&&this.resetData();const f=(this.props.axis==="both"||this.props.axis==="x")&&n!=="n"&&n!=="s",p=(this.props.axis==="both"||this.props.axis==="y")&&n!=="e"&&n!=="w";if(!f&&!p)return;const m=n[0],y=n[n.length-1],b=c.getBoundingClientRect();if(this.lastHandleRect!=null){if(y==="w"){const j=b.left-this.lastHandleRect.left;d+=j}if(m==="n"){const j=b.top-this.lastHandleRect.top;h+=j}}this.lastHandleRect=b,y==="w"&&(d=-d),m==="n"&&(h=-h);const _=(s=(o=this.lastSize)==null?void 0:o.width)!=null?s:this.props.width,v=(a=(l=this.lastSize)==null?void 0:l.height)!=null?a:this.props.height;let g=_+(f?d/this.props.transformScale:0),S=v+(p?h/this.props.transformScale:0);var C=this.runConstraints(g,S);if(g=C[0],S=C[1],t==="onResizeStop"&&this.lastSize){var x=this.lastSize;g=x.width,S=x.height}const T=g!==_||S!==v;t!=="onResizeStop"&&(this.lastSize={width:g,height:S});const P=typeof this.props[t]=="function"?this.props[t]:null;P&&!(t==="onResize"&&!T)&&(r.persist==null||r.persist(),P(r,{node:c,size:{width:g,height:S},handle:n})),t==="onResizeStop"&&this.resetData()}}renderResizeHandle(t,n){const r=this.props.handle;if(!r)return ms.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+t,ref:n});if(typeof r=="function")return r(t,n);const i=typeof r.type=="string",s=nh({ref:n},i?{}:{handleAxis:t});return ms.cloneElement(r,s)}render(){const t=this.props,n=t.children,r=t.className,i=t.draggableOpts;t.width,t.height,t.handle,t.handleSize,t.lockAspectRatio,t.axis,t.minConstraints,t.maxConstraints,t.onResize,t.onResizeStop,t.onResizeStart;const s=t.resizeHandles;t.transformScale;const o=VL(t,UL);return(0,HL.cloneElement)(n,nh(nh({},o),{},{className:(r?r+" ":"")+"react-resizable",children:[...ms.Children.toArray(n.props.children),...s.map(a=>{var l;const c=(l=this.handleRefs[a])!=null?l:this.handleRefs[a]=ms.createRef();return ms.createElement($L.DraggableCore,Rd({},i,{nodeRef:c,key:"resizableHandle-"+a,onStop:this.resizeHandler("onResizeStop",a),onStart:this.resizeHandler("onResizeStart",a),onDrag:this.resizeHandler("onResize",a)}),this.renderResizeHandle(a,c))})]}))}};Na.default=Kp;Kp.propTypes=WL.resizableProps;Kp.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Qc={};Qc.__esModule=!0;Qc.default=void 0;var rh=KS(w),GL=qS(Wp),XL=qS(Na),JL=ja;const ZL=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function qS(e){return e&&e.__esModule?e:{default:e}}function KS(e,t){if(typeof WeakMap=="function")var n=new WeakMap,r=new WeakMap;return(KS=function(i,s){if(!s&&i&&i.__esModule)return i;var o,a,l={__proto__:null,default:i};if(i===null||typeof i!="object"&&typeof i!="function")return l;if(o=s?r:n){if(o.has(i))return o.get(i);o.set(i,l)}for(const c in i)c!=="default"&&{}.hasOwnProperty.call(i,c)&&((a=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,c))&&(a.get||a.set)?o(l,c,a):l[c]=i[c]);return l})(e,t)}function Td(){return Td=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Td.apply(null,arguments)}function Ay(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _c(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ay(Object(n),!0).forEach(function(r){QL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ay(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QL(e,t,n){return(t=eA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eA(e){var t=tA(e,"string");return typeof t=="symbol"?t:t+""}function tA(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nA(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}class YS extends rh.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(t,n)=>{const r=n.size;this.props.onResize?(t.persist==null||t.persist(),this.setState(r,()=>this.props.onResize&&this.props.onResize(t,n))):this.setState(r)}}static getDerivedStateFromProps(t,n){return n.propsWidth!==t.width||n.propsHeight!==t.height?{width:t.width,height:t.height,propsWidth:t.width,propsHeight:t.height}:null}render(){const t=this.props,n=t.handle,r=t.handleSize;t.onResize;const i=t.onResizeStart,s=t.onResizeStop,o=t.draggableOpts,a=t.minConstraints,l=t.maxConstraints,c=t.lockAspectRatio,d=t.axis;t.width,t.height;const h=t.resizeHandles,f=t.style,p=t.transformScale,m=nA(t,ZL);return rh.createElement(XL.default,{axis:d,draggableOpts:o,handle:n,handleSize:r,height:this.state.height,lockAspectRatio:c,maxConstraints:l,minConstraints:a,onResizeStart:i,onResize:this.onResize,onResizeStop:s,resizeHandles:h,transformScale:p,width:this.state.width},rh.createElement("div",Td({},m,{style:_c(_c({},f),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}}Qc.default=YS;YS.propTypes=_c(_c({},JL.resizableProps),{},{children:GL.default.element});Vp.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};var rA=Vp.exports.Resizable=Na.default;Vp.exports.ResizableBox=Qc.default;function GS(e){return function(n,r,i,s,o,a,l){return e(n,r,l)}}function eu(e){return function(n,r,i,s){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i,s);var o=s.get(n),a=s.get(r);if(o&&a)return o===r&&a===n;s.set(n,r),s.set(r,n);var l=e(n,r,i,s);return s.delete(n),s.delete(r),l}}function XS(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function Iy(e){return e.constructor===Object||e.constructor==null}function My(e){return typeof e.then=="function"}function tu(e,t){return e===t||e!==e&&t!==t}var iA="[object Arguments]",sA="[object Boolean]",oA="[object Date]",aA="[object RegExp]",lA="[object Map]",cA="[object Number]",uA="[object Object]",hA="[object Set]",dA="[object String]",Oy=Object.prototype.toString;function nu(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,s=e.areRegExpsEqual,o=e.areSetsEqual,a=e.createIsNestedEqual,l=a(c);function c(d,h,f){if(d===h)return!0;if(!d||!h||typeof d!="object"||typeof h!="object")return d!==d&&h!==h;if(Iy(d)&&Iy(h))return i(d,h,l,f);var p=Array.isArray(d),m=Array.isArray(h);if(p||m)return p===m&&t(d,h,l,f);var y=Oy.call(d);return y!==Oy.call(h)?!1:y===oA?n(d,h,l,f):y===aA?s(d,h,l,f):y===lA?r(d,h,l,f):y===hA?o(d,h,l,f):y===uA||y===iA?My(d)||My(h)?!1:i(d,h,l,f):y===sA||y===cA||y===dA?tu(d.valueOf(),h.valueOf()):!1}return c}function JS(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-- >0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var fA=eu(JS);function ZS(e,t){return tu(e.valueOf(),t.valueOf())}function QS(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var s={},o=0;return e.forEach(function(a,l){if(i){var c=!1,d=0;t.forEach(function(h,f){!c&&!s[d]&&(c=n(l,f,o,d,e,t,r)&&n(a,h,l,f,e,t,r))&&(s[d]=!0),d++}),o++,i=c}}),i}var pA=eu(QS),mA="_owner",gA=Object.prototype.hasOwnProperty;function ex(e,t,n,r){var i=Object.keys(e),s=i.length;if(Object.keys(t).length!==s)return!1;for(var o;s-- >0;){if(o=i[s],o===mA){var a=!!e.$$typeof,l=!!t.$$typeof;if((a||l)&&a!==l)return!1}if(!gA.call(t,o)||!n(e[o],t[o],o,o,e,t,r))return!1}return!0}var yA=eu(ex);function tx(e,t){return e.source===t.source&&e.flags===t.flags}function nx(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var s={};return e.forEach(function(o,a){if(i){var l=!1,c=0;t.forEach(function(d,h){!l&&!s[c]&&(l=n(o,d,a,h,e,t,r))&&(s[c]=!0),c++}),i=l}}),i}var _A=eu(nx),rx=Object.freeze({areArraysEqual:JS,areDatesEqual:ZS,areMapsEqual:QS,areObjectsEqual:ex,areRegExpsEqual:tx,areSetsEqual:nx,createIsNestedEqual:GS}),ix=Object.freeze({areArraysEqual:fA,areDatesEqual:ZS,areMapsEqual:pA,areObjectsEqual:yA,areRegExpsEqual:tx,areSetsEqual:_A,createIsNestedEqual:GS}),vA=nu(rx);function Or(e,t){return vA(e,t,void 0)}nu(XS(rx,{createIsNestedEqual:function(){return tu}}));nu(ix);nu(XS(ix,{createIsNestedEqual:function(){return tu}}));function zy(e){const{children:t,cols:n,containerWidth:r,margin:i,containerPadding:s,rowHeight:o,maxRows:a,isDraggable:l,isResizable:c,isBounded:d,static:h,useCSSTransforms:f=!0,usePercentages:p=!1,transformScale:m=1,positionStrategy:y,dragThreshold:b=0,droppingPosition:_,className:v="",style:g,handle:S="",cancel:C="",x,y:T,w:P,h:B,minW:j=1,maxW:$=1/0,minH:I=1,maxH:R=1/0,i:A,resizeHandles:N,resizeHandle:z,constraints:U=PS,layoutItem:D,layout:O=[],onDragStart:k,onDrag:Q,onDragStop:ne,onResizeStart:E,onResize:ce,onResizeStop:_e}=e,[te,ae]=w.useState(!1),[se,he]=w.useState(!1),Pe=w.useRef(null),be=w.useRef({left:0,top:0}),Se=w.useRef({top:0,left:0,width:0,height:0}),L=w.useRef(void 0),ge=w.useRef(O);ge.current=O;const oe=w.useRef(null),ye=w.useRef(null),Te=w.useRef(!1),Le=w.useRef({x:0,y:0}),Y=w.useRef(!1),pe=w.useMemo(()=>({cols:n,containerPadding:s,containerWidth:r,margin:i,maxRows:a,rowHeight:o}),[n,s,r,i,a,o]),Ae=w.useMemo(()=>({cols:n,maxRows:a,containerWidth:r,containerHeight:0,rowHeight:o,margin:i,layout:[]}),[n,a,r,o,i]),Ke=w.useCallback(()=>({...Ae,layout:ge.current}),[Ae]),Et=w.useMemo(()=>D??{i:A,x,y:T,w:P,h:B,minW:j,maxW:$,minH:I,maxH:R},[D,A,x,T,P,B,j,$,I,R]),ir=w.useCallback(Ue=>{if(y!=null&&y.calcStyle)return y.calcStyle(Ue);if(f)return Op(Ue);const Ve=LS(Ue);return p?{...Ve,left:xy(Ue.left/r),width:xy(Ue.width/r)}:Ve},[y,f,p,r]),pt=w.useCallback((Ue,{node:Ve})=>{if(!k)return;const{offsetParent:$e}=Ve;if(!$e)return;const Ge=$e.getBoundingClientRect(),lt=Ve.getBoundingClientRect(),St=lt.left/m,Nt=Ge.left/m,it=lt.top/m,F=Ge.top/m;let ie;if(y!=null&&y.calcDragPosition){const ke=Ue;ie=y.calcDragPosition(ke.clientX,ke.clientY,ke.clientX-lt.left,ke.clientY-lt.top)}else ie={left:St-Nt+$e.scrollLeft,top:it-F+$e.scrollTop};if(be.current=ie,b>0){const ke=Ue;Le.current={x:ke.clientX,y:ke.clientY},Te.current=!0,Y.current=!1,ae(!0);return}ae(!0);const ve=rl(pe,ie.top,ie.left),{x:xe,y:J}=il(U,Et,ve.x,ve.y,Ke());k(A,xe,J,{e:Ue,node:Ve,newPosition:ie})},[k,m,pe,y,b,U,Et,Ke,A]),M=w.useCallback((Ue,{node:Ve,deltaX:$e,deltaY:Ge})=>{if(!Q||!te)return;const lt=Ue;if(Te.current&&!Y.current){const xe=lt.clientX-Le.current.x,J=lt.clientY-Le.current.y;if(Math.hypot(xe,J)<b)return;if(Y.current=!0,Te.current=!1,k){const de=rl(pe,be.current.top,be.current.left),{x:je,y:Ee}=il(U,Et,de.x,de.y,Ke());k(A,je,Ee,{e:Ue,node:Ve,newPosition:be.current})}}let St=be.current.top+Ge,Nt=be.current.left+$e;if(d){const{offsetParent:xe}=Ve;if(xe){const J=xe.clientHeight-xr(B,o,i[1]);St=gc(St,0,J);const ke=is(pe),de=r-xr(P,ke,i[0]);Nt=gc(Nt,0,de)}}const it={top:St,left:Nt};be.current=it;const F=rl(pe,St,Nt),{x:ie,y:ve}=il(U,Et,F.x,F.y,Ke());Q(A,ie,ve,{e:Ue,node:Ve,newPosition:it})},[Q,k,te,b,d,B,o,i,pe,r,P,A,U,Et,Ke]),H=w.useCallback((Ue,{node:Ve})=>{if(!ne||!te)return;const $e=Te.current;if(Te.current=!1,Y.current=!1,Le.current={x:0,y:0},$e){ae(!1),be.current={left:0,top:0};return}const{left:Ge,top:lt}=be.current,St={top:lt,left:Ge};ae(!1),be.current={left:0,top:0};const Nt=rl(pe,lt,Ge),{x:it,y:F}=il(U,Et,Nt.x,Nt.y,Ke());ne(A,it,F,{e:Ue,node:Ve,newPosition:St})},[ne,te,pe,U,Et,Ke,A]);oe.current=pt,ye.current=M;const ue=w.useCallback((Ue,{node:Ve,size:$e,handle:Ge},lt,St)=>{const Nt=St==="onResizeStart"?E:St==="onResize"?ce:_e;if(!Nt)return;let it;Ve?it=KP(Ge,lt,$e,r):it={...$e,top:lt.top,left:lt.left},Se.current=it;const F=LP(pe,it.width,it.height),{w:ie,h:ve}=BP(U,Et,F.w,F.h,Ge,Ke());Nt(A,ie,ve,{e:Ue.nativeEvent,node:Ve,size:it,handle:Ge})},[E,ce,_e,r,pe,A,U,Et,Ke]),Ce=w.useCallback((Ue,Ve)=>{he(!0);const $e=nl(pe,x,T,P,B),Ge={...Ve,handle:Ve.handle};ue(Ue,Ge,$e,"onResizeStart")},[ue,pe,x,T,P,B]),De=w.useCallback((Ue,Ve)=>{const $e=nl(pe,x,T,P,B),Ge={...Ve,handle:Ve.handle};ue(Ue,Ge,$e,"onResize")},[ue,pe,x,T,P,B]),nt=w.useCallback((Ue,Ve)=>{he(!1),Se.current={top:0,left:0,width:0,height:0};const $e=nl(pe,x,T,P,B),Ge={...Ve,handle:Ve.handle};ue(Ue,Ge,$e,"onResizeStop")},[ue,pe,x,T,P,B]);w.useEffect(()=>{var Ge,lt;if(!_)return;const Ue=Pe.current;if(!Ue)return;const Ve=L.current||{left:0,top:0},$e=te&&(_.left!==Ve.left||_.top!==Ve.top);if(te){if($e){const St=_.left-be.current.left,Nt=_.top-be.current.top,it={node:Ue,deltaX:St,deltaY:Nt,lastX:be.current.left,lastY:be.current.top,x:_.left,y:_.top};(lt=ye.current)==null||lt.call(ye,_.e,it)}}else{const St={node:Ue,deltaX:_.left,deltaY:_.top,lastX:0,lastY:0,x:_.left,y:_.top};(Ge=oe.current)==null||Ge.call(oe,_.e,St)}L.current=_},[_,te,A]);const mt=nl(pe,x,T,P,B,te?be.current:null,se?Se.current:null),Dt=pr.Children.only(t),sn=is(pe),Ot=[xr(j,sn,i[0]),xr(I,o,i[1])],at=[xr($,sn,i[0]),xr(R,o,i[1])],rt=Dt.props,Vt=rt.className,Hn=rt.style;let Wn=pr.cloneElement(Dt,{ref:Pe,className:io("react-grid-item",Vt,v,{static:h,resizing:se,"react-draggable":l,"react-draggable-dragging":te,dropping:!!_,cssTransforms:f}),style:{...g,...Hn,...ir(mt)}});const gr=z;return Wn=u.jsx(rA,{draggableOpts:{disabled:!c},className:c?void 0:"react-resizable-hide",width:mt.width,height:mt.height,minConstraints:Ot,maxConstraints:at,onResizeStart:Ce,onResize:De,onResizeStop:nt,transformScale:m,resizeHandles:N,handle:gr,children:Wn}),Wn=u.jsx(Ti,{disabled:!l,onStart:pt,onDrag:M,onStop:H,handle:S,cancel:".react-resizable-handle"+(C?","+C:""),scale:m,nodeRef:Pe,children:Wn}),Wn}var Lr=()=>{},By="react-grid-layout",sx=!1;try{sx=/firefox/i.test(navigator.userAgent)}catch{}function bA(e,t){const n=pr.Children.toArray(e),r=pr.Children.toArray(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++){const s=n[i],o=r[i];if((s==null?void 0:s.key)!==(o==null?void 0:o.key))return!1}return!0}function Fy(e,t,n,r){const i=[],s=new Set;pr.Children.forEach(t,a=>{if(!pr.isValidElement(a)||a.key===null)return;const l=String(a.key);s.add(l);const c=e.find(d=>d.i===l);if(c)i.push(ss(c));else{const h=a.props["data-grid"];h?i.push({i:l,x:h.x??0,y:h.y??0,w:h.w??1,h:h.h??1,minW:h.minW,maxW:h.maxW,minH:h.minH,maxH:h.maxH,static:h.static,isDraggable:h.isDraggable,isResizable:h.isResizable,resizeHandles:h.resizeHandles,isBounded:h.isBounded}):i.push({i:l,x:0,y:Gc(i),w:1,h:1})}});const o=Mp(i,{cols:n});return r.compact(o,n)}function wA(e){const{children:t,width:n,gridConfig:r,dragConfig:i,resizeConfig:s,dropConfig:o,positionStrategy:a=XP,compactor:l,constraints:c=PS,layout:d=[],droppingItem:h,autoSize:f=!0,className:p="",style:m={},innerRef:y,onLayoutChange:b=Lr,onDragStart:_=Lr,onDrag:v=Lr,onDragStop:g=Lr,onResizeStart:S=Lr,onResize:C=Lr,onResizeStop:x=Lr,onDrop:T=Lr,onDropDragOver:P=Lr}=e,B=w.useMemo(()=>({...JP,...r}),[r]),j=w.useMemo(()=>({...ZP,...i}),[i]),$=w.useMemo(()=>({...QP,...s}),[s]),I=w.useMemo(()=>({...eL,...o}),[o]),{cols:R,rowHeight:A,maxRows:N,margin:z,containerPadding:U}=B,{enabled:D,bounded:O,handle:k,cancel:Q,threshold:ne}=j,{enabled:E,handles:ce,handleComponent:_e}=$,{enabled:te,defaultItem:ae,onDragOver:se}=I,he=l??Jc("vertical"),Pe=he.type,be=he.allowOverlap,Se=he.preventCollision??!1,L=w.useMemo(()=>h??{i:"__dropping-elem__",...ae},[h,ae]),ge=a.type==="transform",oe=a.scale,ye=U??z,[Te,Le]=w.useState(!1),[Y,pe]=w.useState(()=>Fy(d,t,R,he)),[Ae,Ke]=w.useState(null),[Et,ir]=w.useState(!1),[pt,M]=w.useState(null),[H,ue]=w.useState(),Ce=w.useRef(null),De=w.useRef(null),nt=w.useRef(null),mt=w.useRef(0),Dt=w.useRef(Y),sn=w.useRef(d),Ot=w.useRef(t),at=w.useRef(Pe),rt=w.useRef(Y);rt.current=Y,w.useEffect(()=>{Le(!0),Or(Y,d)||b(Y)},[]),w.useEffect(()=>{if(Ae||pt)return;const J=!Or(d,sn.current),ke=!bA(t,Ot.current),de=Pe!==at.current;if(J||ke||de){const Ee=Fy(J?d:Y,t,R,he);Or(Ee,Y)||pe(Ee)}sn.current=d,Ot.current=t,at.current=Pe},[d,t,R,Pe,he,Ae,pt,Y]),w.useEffect(()=>{if(!Ae&&!Or(Y,Dt.current)){Dt.current=Y;const J=Y.filter(ke=>ke.i!==L.i);b(J)}},[Y,Ae,b,L.i]);const Vt=w.useMemo(()=>{if(!f)return;const J=Gc(Y),ke=ye[1];return J*A+(J-1)*z[1]+ke*2+"px"},[f,Y,A,z,ye]),Hn=w.useCallback((J,ke,de,je)=>{const Ee=rt.current,Re=Bi(Ee,J);if(!Re)return;const Je={w:Re.w,h:Re.h,x:Re.x,y:Re.y,i:J};Ce.current=ss(Re),nt.current=Ee,Ke(Je),_(Ee,Re,Re,null,je.e,je.node)},[_]),Wn=w.useCallback((J,ke,de,je)=>{const Ee=rt.current,Re=Ce.current,Je=Bi(Ee,J);if(!Je)return;const gt={w:Je.w,h:Je.h,x:Je.x,y:Je.y,i:J},et=qi(Ee,Je,ke,de,!0,Se,Pe,R,be);v(et,Re,Je,gt,je.e,je.node),pe(he.compact(et,R)),Ke(gt)},[Se,Pe,R,be,he,v]),gr=w.useCallback((J,ke,de,je)=>{if(!Ae)return;const Ee=rt.current,Re=Ce.current,Je=Bi(Ee,J);if(!Je)return;const gt=qi(Ee,Je,ke,de,!0,Se,Pe,R,be),et=he.compact(gt,R);g(et,Re,Je,null,je.e,je.node);const zt=nt.current;Ce.current=null,nt.current=null,Ke(null),pe(et),zt&&!Or(zt,et)&&b(et)},[Ae,Se,Pe,R,be,he,g,b]),Ue=w.useCallback((J,ke,de,je)=>{const Ee=rt.current,Re=Bi(Ee,J);Re&&(De.current=ss(Re),nt.current=Ee,ir(!0),S(Ee,Re,Re,null,je.e,je.node))},[S]),Ve=w.useCallback((J,ke,de,je)=>{const Ee=rt.current,Re=De.current,{handle:Je}=je;let gt=!1,et,zt;const[Di,Un]=MP(Ee,J,K=>(et=K.x,zt=K.y,["sw","w","nw","n","ne"].includes(Je)&&(["sw","nw","w"].includes(Je)&&(et=K.x+(K.w-ke),ke=K.x!==et&&et<0?K.w:ke,et=et<0?0:et),["ne","n","nw"].includes(Je)&&(zt=K.y+(K.h-de),de=K.y!==zt&&zt<0?K.h:de,zt=zt<0?0:zt),gt=!0),Se&&!be&&TS(Ee,{...K,w:ke,h:de,x:et??K.x,y:zt??K.y}).filter(re=>re.i!==K.i).length>0&&(zt=K.y,de=K.h,et=K.x,ke=K.w,gt=!1),K.w=ke,K.h=de,K));if(!Un)return;let Jr=Di;gt&&et!==void 0&&zt!==void 0&&(Jr=qi(Di,Un,et,zt,!0,Se,Pe,R,be));const W={w:Un.w,h:Un.h,x:Un.x,y:Un.y,i:J,static:!0};C(Jr,Re,Un,W,je.e,je.node),pe(he.compact(Jr,R)),Ke(W)},[Se,Pe,R,be,he,C]),$e=w.useCallback((J,ke,de,je)=>{const Ee=rt.current,Re=De.current,Je=Bi(Ee,J),gt=he.compact(Ee,R);x(gt,Re,Je??null,null,je.e,je.node);const et=nt.current;De.current=null,nt.current=null,Ke(null),ir(!1),pe(gt),et&&!Or(et,gt)&&b(gt)},[R,he,x,b]),Ge=w.useCallback(()=>{const J=rt.current;if(!J.some(je=>je.i===L.i)){M(null),Ke(null),ue(void 0);return}const de=he.compact(J.filter(je=>je.i!==L.i),R);pe(de),M(null),Ke(null),ue(void 0)},[L.i,R,he]),lt=w.useCallback(J=>{var Xe;if(J.preventDefault(),J.stopPropagation(),sx&&!((Xe=J.nativeEvent.target)!=null&&Xe.classList.contains(By)))return!1;const ke=se?se(J.nativeEvent):P(J);if(ke===!1)return pt&&Ge(),!1;const{dragOffsetX:de=0,dragOffsetY:je=0,...Ee}=ke??{},Re={...L,...Ee},Je=J.currentTarget.getBoundingClientRect(),gt={cols:R,margin:z,maxRows:N,rowHeight:A,containerWidth:n,containerPadding:ye},et=is(gt),zt=xr(Re.w,et,z[0]),Di=xr(Re.h,A,z[1]),Un=zt/2,Jr=Di/2,W=J.clientX-Je.left+de-Un,K=J.clientY-Je.top+je-Jr,G=Math.max(0,W),re=Math.max(0,K),me={left:G/oe,top:re/oe,e:J.nativeEvent};if(pt)H&&(H.left!==me.left||H.top!==me.top)&&ue(me);else{const ze=PP(gt,re,G,Re.w,Re.h);M(u.jsx("div",{},Re.i)),ue(me);const Pt=rt.current.filter(Vn=>Vn.i!==Re.i);pe([...Pt,{...Re,x:ze.x,y:ze.y,static:!1,isDraggable:!0}])}},[pt,H,L,se,P,Ge,oe,R,z,N,A,n,ye]),St=w.useCallback(J=>{J.preventDefault(),J.stopPropagation(),mt.current--,mt.current<0&&(mt.current=0),mt.current===0&&Ge()},[Ge]),Nt=w.useCallback(J=>{J.preventDefault(),J.stopPropagation(),mt.current++},[]),it=w.useCallback(J=>{J.preventDefault(),J.stopPropagation();const ke=rt.current,de=ke.find(je=>je.i===L.i);mt.current=0,Ge(),T(ke,de,J.nativeEvent)},[L.i,Ge,T]),F=w.useCallback((J,ke)=>{if(!J||!J.key)return null;const de=Bi(Y,String(J.key));if(!de)return null;const je=typeof de.isDraggable=="boolean"?de.isDraggable:!de.static&&D,Ee=typeof de.isResizable=="boolean"?de.isResizable:!de.static&&E,Re=de.resizeHandles||[...ce],Je=je&&O&&de.isBounded!==!1,gt=_e;return u.jsx(zy,{containerWidth:n,cols:R,margin:z,containerPadding:ye,maxRows:N,rowHeight:A,cancel:Q,handle:k,onDragStart:Hn,onDrag:Wn,onDragStop:gr,onResizeStart:Ue,onResize:Ve,onResizeStop:$e,isDraggable:je,isResizable:Ee,isBounded:Je,useCSSTransforms:ge&&Te,usePercentages:!Te,transformScale:oe,positionStrategy:a,dragThreshold:ne,w:de.w,h:de.h,x:de.x,y:de.y,i:de.i,minH:de.minH,minW:de.minW,maxH:de.maxH,maxW:de.maxW,static:de.static,droppingPosition:ke?H:void 0,resizeHandles:Re,resizeHandle:gt,constraints:c,layoutItem:de,layout:Y,children:J},de.i)},[Y,n,R,z,ye,N,A,Q,k,Hn,Wn,gr,Ue,Ve,$e,D,E,O,ge,Te,oe,a,ne,H,ce,_e,c]),ie=()=>Ae?u.jsx(zy,{w:Ae.w,h:Ae.h,x:Ae.x,y:Ae.y,i:Ae.i,className:`react-grid-placeholder ${Et?"placeholder-resizing":""}`,containerWidth:n,cols:R,margin:z,containerPadding:ye,maxRows:N,rowHeight:A,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:ge,transformScale:oe,constraints:c,layout:Y,children:u.jsx("div",{})}):null,ve=io(By,p),xe={height:Vt,...m};return u.jsxs("div",{ref:y,className:ve,style:xe,onDrop:te?it:void 0,onDragLeave:te?St:void 0,onDragEnter:te?Nt:void 0,onDragOver:te?lt:void 0,children:[pr.Children.map(t,J=>pr.isValidElement(J)?F(J):null),te&&pt&&F(pt,!0),ie()]})}var SA={lg:1200,md:996,sm:768,xs:480,xxs:0},xA={lg:12,md:10,sm:6,xs:4,xxs:2},ih=()=>{};function kA(e,t,n,r){const i=[];pr.Children.forEach(t,o=>{if(!pr.isValidElement(o)||o.key===null)return;const a=String(o.key),l=e.find(c=>c.i===a);if(l)i.push({...l,i:a});else{const d=o.props["data-grid"];d?i.push({i:a,x:d.x??0,y:d.y??0,w:d.w??1,h:d.h??1,minW:d.minW,maxW:d.maxW,minH:d.minH,maxH:d.maxH,static:d.static,isDraggable:d.isDraggable,isResizable:d.isResizable,resizeHandles:d.resizeHandles,isBounded:d.isBounded}):i.push({i:a,x:0,y:Gc(i),w:1,h:1})}});const s=Mp(i,{cols:n});return r.compact(s,n)}function CA(e){const{children:t,width:n,breakpoint:r,breakpoints:i=SA,cols:s=xA,layouts:o={},rowHeight:a=150,maxRows:l=1/0,margin:c=[10,10],containerPadding:d=null,compactor:h,onBreakpointChange:f=ih,onLayoutChange:p=ih,onWidthChange:m=ih,...y}=e,b=h??Jc("vertical"),_=b.type,v=b.allowOverlap,g=w.useMemo(()=>r??ky(i,n),[]),S=w.useMemo(()=>Cy(g,s),[g,s]),C=w.useMemo(()=>Gu(o,i,g,g,S,_),[]),[x,T]=w.useState(g),[P,B]=w.useState(S),[j,$]=w.useState(C),[I,R]=w.useState(o),A=w.useRef(n),N=w.useRef(r),z=w.useRef(i),U=w.useRef(s),D=w.useRef(o),O=w.useRef(_),k=w.useRef(I);w.useEffect(()=>{k.current=I},[I]);const Q=w.useMemo(()=>Or(o,D.current)?null:Gu(o,i,x,x,P,b),[o,i,x,P,b]),ne=Q??j;w.useEffect(()=>{Q!==null&&($(Q),R(o),k.current=o,D.current=o)},[Q,o]),w.useEffect(()=>{if(_!==O.current){const ae=b.compact(Ci(ne),P),se={...k.current,[x]:ae};$(ae),R(se),k.current=se,p(ae,se),O.current=_}},[_,b,ne,P,v,x,p]),w.useEffect(()=>{const ae=n!==A.current,se=r!==N.current,he=!Or(i,z.current),Pe=!Or(s,U.current);if(ae||se||he||Pe){const be=r??ky(i,n),Se=Cy(be,s),L=x;if(L!==be||he||Pe){const ye={...k.current};ye[L]||(ye[L]=Ci(j));let Te=Gu(ye,i,be,L,Se,b);Te=kA(Te,t,Se,b),ye[be]=Te,T(be),B(Se),$(Te),R(ye),k.current=ye,f(be,Se),p(Te,ye)}const ge=sl(c,be),oe=d?sl(d,be):null;m(n,ge,Se,oe),A.current=n,N.current=r,z.current=i,U.current=s}},[n,r,i,s,x,P,j,t,b,_,v,c,d,f,p,m]);const E=w.useCallback(ae=>{const he={...k.current,[x]:ae};$(ae),R(he),k.current=he,p(ae,he)},[x,p]),ce=w.useMemo(()=>sl(c,x),[c,x]),_e=w.useMemo(()=>d===null?null:sl(d,x),[d,x]),te=w.useMemo(()=>({cols:P,rowHeight:a,maxRows:l,margin:ce,containerPadding:_e}),[P,a,l,ce,_e]);return u.jsx(wA,{...y,width:n,gridConfig:te,compactor:b,onLayoutChange:E,layout:ne,children:t})}function ox(e){const{children:t,width:n,breakpoint:r,breakpoints:i,cols:s,layouts:o,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,rowHeight:d,maxRows:h,margin:f,containerPadding:p,droppingItem:m,compactType:y,preventCollision:b=!1,allowOverlap:_=!1,verticalCompact:v,isDraggable:g=!0,isBounded:S=!1,draggableHandle:C,draggableCancel:x,isResizable:T=!0,resizeHandles:P=["se"],resizeHandle:B,isDroppable:j=!1,useCSSTransforms:$=!0,transformScale:I=1,autoSize:R,className:A,style:N,innerRef:z,onDragStart:U,onDrag:D,onDragStop:O,onResizeStart:k,onResize:Q,onResizeStop:ne,onDrop:E,onDropDragOver:ce}=e;let _e=y===void 0?"vertical":y;v===!1&&(_e=null);const te={enabled:g,bounded:S,handle:C,cancel:x},ae={enabled:T,handles:P,handleComponent:B},se={enabled:j};let he;$?I!==1?he=GP(I):he=IS:he=YP;const Pe=Jc(_e,_,b);return u.jsx(CA,{width:n,breakpoint:r,breakpoints:i,cols:s,layouts:o,rowHeight:d,maxRows:h,margin:f,containerPadding:p,compactor:Pe,dragConfig:te,resizeConfig:ae,dropConfig:se,positionStrategy:he,droppingItem:m,autoSize:R,className:A,style:N,innerRef:z,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,onDragStart:U,onDrag:D,onDragStop:O,onResizeStart:k,onResize:Q,onResizeStop:ne,onDrop:E,onDropDragOver:ce,children:t})}ox.displayName="ResponsiveReactGridLayout";var EA=ox,NA="react-grid-layout";function jA(e){function t(n){const{measureBeforeMount:r=!1,className:i,style:s,...o}=n,[a,l]=w.useState(1280),[c,d]=w.useState(!1),h=w.useRef(null),f=w.useRef(null);return w.useEffect(()=>{d(!0)},[]),w.useEffect(()=>{const p=h.current;if(!(p instanceof HTMLElement))return;let m=null;const y=new ResizeObserver(b=>{if(b[0]){const _=b[0].contentRect.width;m!==null&&cancelAnimationFrame(m),m=requestAnimationFrame(()=>{l(_),m=null})}});return y.observe(p),f.current=y,()=>{m!==null&&cancelAnimationFrame(m),y.unobserve(p),y.disconnect()}},[c]),r&&!c?u.jsx("div",{className:io(i,NA),style:s,ref:h}):u.jsx(e,{innerRef:h,className:i,style:s,...o,width:a})}return t.displayName=`WidthProvider(${e.displayName||e.name||"Component"})`,t}const RA=jA(EA),TA={lg:12,xxs:1},DA={lg:640,xxs:0},$y=12,Dd=20,Dl=16;function PA(e){const t=e-Dd*2-($y-1)*Dl;return Math.max(16,t/$y)}function LA({blocks:e,layouts:t,mode:n,onLayoutChange:r,renderBlock:i,blockMeta:s,onRemove:o,onDuplicate:a,canRemove:l=()=>!0,canDuplicate:c=()=>!0}){const d=n==="layout",h=w.useRef(null),[f,p]=w.useState(46);return w.useLayoutEffect(()=>{const m=h.current;if(!m)return;const y=()=>p(PA(m.clientHeight));if(y(),typeof ResizeObserver>"u")return;const b=new ResizeObserver(y);return b.observe(m),()=>b.disconnect()},[]),u.jsx("div",{ref:h,className:`block-canvas ${d?"arranging":""}`,style:{"--row-pitch":`${f+Dl}px`},"data-testid":"block-canvas",children:u.jsx(RA,{className:"rgl",layouts:t,breakpoints:DA,cols:TA,rowHeight:f,margin:[Dl,Dl],containerPadding:[Dd,Dd],isDraggable:d,isResizable:d,draggableHandle:".block-handle",onLayoutChange:(m,y)=>r(y),compactType:"vertical",useCSSTransforms:!0,children:e.map(m=>{const y=s(m);return u.jsxs("div",{className:`block ${d?"is-arranging":""}`,"data-testid":`block-${m.type}`,"data-rgl-id":m.id,children:[u.jsxs("div",{className:`block-header ${d?"block-handle":""}`,children:[u.jsx("span",{className:"block-icon",children:y.icon}),u.jsx("span",{className:"block-title",children:y.title}),u.jsx("span",{className:"spacer"}),d&&u.jsxs("span",{className:"block-actions",children:[c(m)&&u.jsx("button",{title:"Duplicate",onClick:()=>a(m.id),"data-testid":"block-duplicate",children:"⧉"}),l(m)?u.jsx("button",{title:"Remove",onClick:()=>o(m.id),"data-testid":"block-remove",children:"✕"}):u.jsx("span",{className:"block-pin",title:"Chat is always here",children:"📌"})]})]}),u.jsx("div",{className:"block-body",children:i(m)})]},m.id)})})})}function AA({blocks:e,activeId:t,setActiveId:n,mode:r,renderBlock:i,blockMeta:s,onRemove:o,canRemove:a=()=>!0}){const l=e.find(d=>d.id===t)||e[0],c=r==="layout";return u.jsxs("div",{className:"mobile-canvas","data-testid":"mobile-canvas",children:[u.jsx("div",{className:"mobile-tabs","data-testid":"mobile-tabs",children:e.map(d=>{const h=s(d);return u.jsxs("button",{className:`mtab ${d.id===(l==null?void 0:l.id)?"active":""}`,onClick:()=>n(d.id),"data-testid":`mtab-${d.type}`,children:[u.jsx("span",{className:"mtab-icon",children:h.icon}),u.jsx("span",{className:"mtab-label",children:h.title}),c&&a(d)&&u.jsx("span",{className:"mtab-x",role:"button",title:"Remove",onClick:f=>{f.stopPropagation(),o(d.id)},children:"✕"})]},d.id)})}),u.jsx("div",{className:"mobile-block",children:l&&u.jsx("div",{className:"block",children:u.jsx("div",{className:"block-body",children:i(l)})})})]})}function IA({items:e,bazaarItems:t=[],onAdd:n,onClose:r}){return u.jsx("div",{className:"modal-backdrop",onClick:r,"data-testid":"add-gallery-backdrop",children:u.jsxs("div",{className:"modal add-gallery",onClick:i=>i.stopPropagation(),"data-testid":"add-gallery",children:[u.jsx("h2",{children:"Add a block"}),u.jsx("p",{className:"muted",children:"Build your space — drop in whatever's useful. Move and resize it however you like."}),u.jsx("div",{className:"gallery-grid",children:e.map(i=>u.jsxs("button",{className:"gallery-item",disabled:i.soon,onClick:()=>!i.soon&&n(i.type),"data-testid":`gallery-add-${i.type}`,children:[u.jsx("span",{className:"gallery-glyph",children:i.icon}),u.jsx("span",{className:"gallery-name",children:i.title}),u.jsx("span",{className:"gallery-desc",children:i.desc}),i.soon&&u.jsx("span",{className:"gallery-soon",children:"soon"})]},i.type))}),t.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"gallery-section",children:"🛍️ from the Bazaar"}),u.jsx("div",{className:"gallery-grid",children:t.map(i=>u.jsxs("button",{className:"gallery-item bazaar",onClick:()=>n(i.type),"data-testid":`gallery-add-${i.type}`,children:[u.jsx("span",{className:"gallery-glyph",children:i.icon}),u.jsx("span",{className:"gallery-name",children:i.title}),u.jsx("span",{className:"gallery-desc",children:i.desc})]},i.type))})]}),u.jsxs("div",{className:"gallery-agent-hint","data-testid":"gallery-agent-hint",children:["✨ Or ask your agent in chat — ",u.jsx("em",{children:"“make me a block that shows today’s signups”"})," — and it builds one for you."]}),u.jsx("div",{className:"actions",children:u.jsx("button",{onClick:r,children:"Done"})})]})})}const MA={chat:{icon:"🗨️",label:"Chat"},liveview:{icon:"👁️",label:"Live view"},notes:{icon:"📝",label:"Notes"},earnings:{icon:"💸",label:"Earnings"},analytics:{icon:"📊",label:"Analytics"},usage:{icon:"🔋",label:"Usage"},powers:{icon:"🧰",label:"Powers"}};function Hy({blocks:e}){return u.jsx("span",{className:"tpl-chips",children:e.map((t,n)=>{const r=MA[t.type]||{icon:"▫️",label:t.type};return u.jsxs("span",{className:"tpl-chip",title:r.label,children:[u.jsx("span",{className:"tpl-chip-icon",children:r.icon}),r.label]},n)})})}function OA({builtins:e=[],saved:t=[],onApply:n,onSaveCurrent:r,onDelete:i,onClose:s}){const[o,a]=w.useState("");function l(){const c=o.trim();c&&(r(c),a(""))}return u.jsx("div",{className:"modal-backdrop",onClick:s,"data-testid":"template-gallery-backdrop",children:u.jsxs("div",{className:"modal template-gallery",onClick:c=>c.stopPropagation(),"data-testid":"template-gallery",children:[u.jsx("h2",{children:"Start from a template"}),u.jsx("p",{className:"muted",children:"Pick a layout to start from — it swaps your current blocks for the template's. Chat always stays."}),u.jsx("div",{className:"gallery-grid",children:e.map(c=>u.jsxs("button",{className:"gallery-item template-card",onClick:()=>n(c),"data-testid":`template-${c.id}`,children:[u.jsx("span",{className:"gallery-glyph",children:c.icon}),u.jsx("span",{className:"gallery-name",children:c.name}),u.jsx("span",{className:"gallery-desc",children:c.desc}),u.jsx(Hy,{blocks:c.blocks})]},c.id))}),t.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"gallery-section",children:"⭐ your templates"}),u.jsx("div",{className:"gallery-grid",children:t.map(c=>u.jsxs("div",{className:"gallery-item template-card saved","data-testid":`template-${c.id}`,children:[u.jsxs("button",{className:"tpl-apply",onClick:()=>n(c),"data-testid":`template-apply-${c.id}`,children:[u.jsx("span",{className:"gallery-glyph",children:c.icon||"⭐"}),u.jsx("span",{className:"gallery-name",children:c.name}),u.jsx(Hy,{blocks:c.blocks})]}),u.jsx("button",{className:"tpl-del",title:"Delete this template",onClick:()=>i(c.id),"data-testid":`template-delete-${c.id}`,children:"✕"})]},c.id))})]}),u.jsxs("div",{className:"tpl-save-row",children:[u.jsx("input",{className:"tpl-save-input",value:o,onChange:c=>a(c.target.value),onKeyDown:c=>c.key==="Enter"&&l(),placeholder:"Save current layout as…","data-testid":"template-save-name",maxLength:40}),u.jsx("button",{className:"primary",onClick:l,disabled:!o.trim(),"data-testid":"template-save-btn",children:"Save layout"})]}),u.jsx("div",{className:"actions",children:u.jsx("button",{onClick:s,children:"Done"})})]})})}const ax="wild:theme",Pd=[{id:"cyan",name:"VentureWild",accent:"#0891b2",hot:"#0e7490"},{id:"teal",name:"Teal",accent:"#0d9488",hot:"#0f766e"},{id:"blue",name:"Blue",accent:"#2563eb",hot:"#1d4ed8"},{id:"violet",name:"Violet",accent:"#7c3aed",hot:"#6d28d9"},{id:"emerald",name:"Emerald",accent:"#059669",hot:"#047857"},{id:"amber",name:"Amber",accent:"#d97706",hot:"#b45309"},{id:"rose",name:"Rose",accent:"#e11d48",hot:"#be123c"}],zA=[{id:"light",name:"Light",glyph:"☀️",desc:"Bright & warm (default)"},{id:"dark",name:"Dark",glyph:"🌙",desc:"The venturewild.llc look"}],lx={bg:"--bg",bgElev:"--bg-elev",surface:"--surface",border:"--border",text:"--text",textMuted:"--text-muted",canvas1:"--canvas-1",canvas2:"--canvas-2",canvas3:"--canvas-3"},Pl={mode:"light",accent:Pd[0].accent,hot:Pd[0].hot,accentManual:!1,tokens:{}};function Hr(e){if(typeof e!="string")return null;const t=e.trim();return/^#([0-9a-f]{6})$/i.test(t)?t.toLowerCase():null}function cx(e){const t=Hr(e)||"#000000";return[parseInt(t.slice(1,3),16),parseInt(t.slice(3,5),16),parseInt(t.slice(5,7),16)]}function Yp(e,t=.16){const[n,r,i]=cx(e),s=1-t,o=a=>Math.max(0,Math.min(255,Math.round(a*s)));return`#${[o(n),o(r),o(i)].map(a=>a.toString(16).padStart(2,"0")).join("")}`}function ux(e){const[t,n,r]=cx(e).map(s=>{const o=s/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r>.42?"#08232b":"#ffffff"}function Gp(e){const t={};if(e&&typeof e=="object")for(const n of Object.keys(lx)){const r=Hr(e[n]);r&&(t[n]=r)}return t}function BA(e,t,n){const r=t&&typeof t=="object"?t:{},i=n?e.accent:Hr(r.accent)||e.accent,s=n?e.hot:Hr(r.hot)||Hr(r.accent)||e.hot;return{...e,mode:r.mode==="dark"?"dark":"light",accent:i,hot:s,tokens:Gp(r.tokens),accentManual:!0}}function FA(){try{const e=localStorage.getItem(ax);if(!e)return{...Pl};const t=JSON.parse(e),n=Hr(t.accent)||Pl.accent;return{mode:t.mode==="dark"?"dark":"light",accent:n,hot:Hr(t.hot)||Yp(n),accentManual:!!t.accentManual,tokens:Gp(t.tokens)}}catch{return{...Pl}}}function $A(e){try{localStorage.setItem(ax,JSON.stringify(e))}catch{}}function HA(e){const t=document.documentElement;e.mode==="dark"?t.dataset.theme="dark":delete t.dataset.theme;const n=Hr(e.accent)||Pl.accent;t.style.setProperty("--accent",n),t.style.setProperty("--accent-hot",Hr(e.hot)||Yp(n)),t.style.setProperty("--accent-ink",ux(n));const r=Gp(e.tokens);for(const[i,s]of Object.entries(lx))r[i]?t.style.setProperty(s,r[i]):t.style.removeProperty(s)}function WA({theme:e,onChange:t,onClose:n,onPublish:r,remixOf:i}){const[s,o]=w.useState(e.accent),[a,l]=w.useState(i?`${i.title} (remix)`:""),[c,d]=w.useState(""),[h,f]=w.useState(!1),[p,m]=w.useState(null);async function y(){var S;const g=a.trim();if(!(!g||h)){f(!0),m(null);try{const C=await r({title:g,pitch:c.trim()});C&&C.ok?m({ok:!0,text:`✓ “${((S=C.listing)==null?void 0:S.title)||g}” is on your Themes shelf.`}):m({ok:!1,text:C&&C.error?C.error:"Could not publish — try again."})}catch(C){m({ok:!1,text:C.message||"Could not publish — try again."})}finally{f(!1)}}}function b(g){t({...e,mode:g,tokens:{}})}function _(g){o(g.accent),t({...e,accent:g.accent,hot:g.hot,accentManual:!0})}function v(g){o(g),/^#([0-9a-f]{6})$/i.test(g)&&t({...e,accent:g,hot:Yp(g),accentManual:!0})}return u.jsx("div",{className:"modal-backdrop",onClick:n,"data-testid":"theme-picker-backdrop",children:u.jsxs("div",{className:"modal theme-picker",onClick:g=>g.stopPropagation(),"data-testid":"theme-picker",children:[u.jsx("h2",{children:"Make it yours"}),u.jsx("p",{className:"muted",children:"Pick a look. Changes apply live and follow you across your workspaces."}),i&&u.jsxs("p",{className:"theme-remixing muted","data-testid":"theme-remixing",children:["✦ Remixing “",i.title,"” — tweak it below, then publish it as your own."]}),u.jsx("div",{className:"theme-section",children:"Mode"}),u.jsx("div",{className:"theme-modes",children:zA.map(g=>u.jsxs("button",{className:`theme-mode ${e.mode===g.id?"active":""}`,onClick:()=>b(g.id),"data-testid":`theme-mode-${g.id}`,"aria-pressed":e.mode===g.id,children:[u.jsx("span",{className:"theme-mode-glyph",children:g.glyph}),u.jsx("span",{className:"theme-mode-name",children:g.name}),u.jsx("span",{className:"theme-mode-desc",children:g.desc})]},g.id))}),u.jsx("div",{className:"theme-section",children:"Accent"}),u.jsx("div",{className:"theme-swatches",children:Pd.map(g=>{const S=e.accent.toLowerCase()===g.accent.toLowerCase();return u.jsx("button",{className:`theme-swatch ${S?"active":""}`,style:{background:g.accent,color:ux(g.accent)},onClick:()=>_(g),title:g.name,"data-testid":`theme-accent-${g.id}`,"aria-pressed":S,children:S?"✓":""},g.id)})}),u.jsxs("div",{className:"theme-custom",children:[u.jsx("label",{htmlFor:"theme-hex",className:"muted",children:"Custom"}),u.jsx("input",{id:"theme-hex",type:"color",value:/^#([0-9a-f]{6})$/i.test(s)?s:"#0891b2",onChange:g=>v(g.target.value),"data-testid":"theme-custom-color","aria-label":"Custom accent color"}),u.jsx("input",{className:"theme-hex-input",value:s,onChange:g=>v(g.target.value),placeholder:"#0891b2",maxLength:7,spellCheck:!1,"data-testid":"theme-custom-hex"})]}),r&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"theme-section",children:"Share your look"}),u.jsx("p",{className:"muted theme-publish-sub",children:"Put this theme on your Bazaar shelf so others can wear it — you earn each time they do."}),u.jsxs("div",{className:"theme-publish","data-testid":"theme-publish",children:[u.jsx("input",{className:"theme-hex-input theme-publish-title",value:a,onChange:g=>l(g.target.value),placeholder:"Name your look — e.g. Midnight Focus",maxLength:60,"data-testid":"theme-publish-title","aria-label":"Theme name"}),u.jsx("input",{className:"theme-hex-input theme-publish-pitch",value:c,onChange:g=>d(g.target.value),placeholder:"One line — what's the vibe? (optional)",maxLength:120,"data-testid":"theme-publish-pitch","aria-label":"Theme pitch"}),u.jsx("button",{className:"primary",onClick:y,disabled:!a.trim()||h,"data-testid":"theme-publish-btn",children:h?"Publishing…":"Publish my look"})]}),p&&u.jsx("p",{className:`theme-publish-msg ${p.ok?"ok":"err"}`,"data-testid":"theme-publish-msg",children:p.text})]}),u.jsx("div",{className:"actions",children:u.jsx("button",{className:"primary",onClick:n,"data-testid":"theme-done",children:"Done"})})]})})}const ol=[{tier:1,label:"Read-only (diagnostics + logs)"},{tier:2,label:"Diagnostics & fixes (recommended)"},{tier:3,label:"Operate my agent",operate:!0},{tier:4,label:"Run shell commands",operate:!0}],UA=[{minutes:30,label:"30 minutes"},{minutes:120,label:"2 hours"},{minutes:480,label:"8 hours"}];function VA(e){const t=Math.round(e/6e4);return t<=0?"expiring":t<60?`${t} min`:`${Math.floor(t/60)}h ${t%60}m`}function qA({token:e}){var v;const[t,n]=w.useState(null),[r,i]=w.useState(2),[s,o]=w.useState(30),[a,l]=w.useState(!1),[c,d]=w.useState(!1),h=w.useCallback(()=>e?{Authorization:`Bearer ${e}`}:{},[e]),f=w.useCallback(async()=>{try{const g=await fetch("/api/support/status",{headers:h()});if(!g.ok)return;n(await g.json())}catch{}},[h]);w.useEffect(()=>{f();const g=setInterval(f,1e4);return()=>clearInterval(g)},[f]);const p=w.useCallback(async()=>{var g;l(!0);try{const S=(g=ol.find(C=>C.tier===r))==null?void 0:g.operate;await fetch("/api/support/grant",{method:"POST",headers:{"content-type":"application/json",...h()},body:JSON.stringify({tier:r,minutes:s,confirmOperate:!!S})})}catch{}l(!1),f()},[h,f,r,s]),m=w.useCallback(async()=>{d(!0);try{await fetch("/api/support/revoke",{method:"POST",headers:h()})}catch{}d(!1),f()},[h,f]);if(!t||typeof t.enabled!="boolean")return null;const y=t.enabled||t.active||!!t.operate;if(!y&&!t.canGrant)return null;const b=ol.find(g=>g.tier===r),_=t.maxTier||4;return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"set-section",children:"Support access"}),y?u.jsxs("div",{className:"set-support","data-testid":"support-access",children:[u.jsxs("span",{children:["🛟 ",u.jsx("strong",{children:"Allowed"})," —"," ",((v=ol.find(g=>g.tier===t.tier))==null?void 0:v.label)||`tier ${t.tier}`,t.remainingMs>0&&u.jsxs(u.Fragment,{children:[" · auto-expires in ",VA(t.remainingMs)]})]}),u.jsx("button",{type:"button",onClick:m,disabled:c,"data-testid":"support-revoke",children:c?"Revoking…":"Revoke"})]}):u.jsxs("div",{className:"set-support","data-testid":"support-access",children:[u.jsxs("label",{children:["Let support",u.jsx("select",{"aria-label":"support level",value:r,onChange:g=>i(Number(g.target.value)),children:ol.filter(g=>g.tier<=_).map(g=>u.jsx("option",{value:g.tier,children:g.label},g.tier))})]}),u.jsxs("label",{children:["for",u.jsx("select",{"aria-label":"duration",value:s,onChange:g=>o(Number(g.target.value)),children:UA.map(g=>u.jsx("option",{value:g.minutes,children:g.label},g.minutes))})]}),(b==null?void 0:b.operate)&&u.jsxs("span",{className:"set-support-warn","data-testid":"support-operate-warn",children:["⚠ lets support ",r>=4?"run shell commands on":"operate the agent on"," your machine"]}),u.jsx("button",{type:"button",onClick:p,disabled:a,"data-testid":"support-allow",children:a?"Allowing…":"Allow"})]}),u.jsx("p",{className:"muted small",children:"Off by default and time-boxed. While it’s allowed, a banner stays on screen with a one-tap Stop/Revoke."})]})}const Wy=[{id:"check",title:"Check with me",emoji:"🪧",build:!0,desc:"Your agent proposes first — it only acts after you approve. Read-only until you say go."},{id:"work",title:"Work, then show me",emoji:"🛠️",build:!1,desc:"Builds and edits freely, shows you the diff — but still confirms the risky stuff (deploy, delete, send, spend)."},{id:"full",title:"Full autonomy",emoji:"🚀",build:!0,desc:"Does everything on its own, never asks. Fastest — and the least guarded."}];function KA({token:e,session:t,onClose:n,onOpenTheme:r}){var _,v;const[i,s]=w.useState(null),[o,a]=w.useState(""),[l,c]=w.useState(!1),d=e?{Authorization:`Bearer ${e}`}:{};w.useEffect(()=>{let g=!0;return fetch("/api/settings",{headers:d}).then(S=>S.ok?S.json():null).then(S=>{g&&S&&(s(S),a(S.conversationTitle||""))}).catch(()=>{}),()=>{g=!1}},[e]);async function h(g){const S=await fetch("/api/settings",{method:"POST",headers:{...d,"Content-Type":"application/json"},body:JSON.stringify(g)}).then(C=>C.ok?C.json():null).catch(()=>null);return S&&s(S),S}function f(g){const S=Wy.find(C=>C.id===g);!S||!S.build||(s(C=>({...C||{},autonomyLevel:g})),h({autonomyLevel:g}))}async function p(){c(!0);try{await h({conversationTitle:o})}finally{c(!1)}}const m=(i==null?void 0:i.autonomyLevel)??null,y=(t==null?void 0:t.account)||null,b=((_=t==null?void 0:t.identity)==null?void 0:_.name)||((v=t==null?void 0:t.agent)==null?void 0:v.label)||"your agent";return u.jsx("div",{className:"modal-backdrop",onClick:n,"data-testid":"settings-backdrop",children:u.jsxs("div",{className:"modal settings-menu",onClick:g=>g.stopPropagation(),"data-testid":"settings-menu",children:[u.jsx("h2",{children:"Settings"}),u.jsx("p",{className:"muted",children:"The everyday knobs. Your agent handles the rest."}),u.jsx("div",{className:"set-section",children:"Permissions — what can your agent do on its own?"}),u.jsx("div",{className:"autonomy-dial","data-testid":"autonomy-dial",children:Wy.map(g=>{const S=m===g.id;return u.jsxs("button",{className:`autonomy-tier ${S?"selected":""} ${g.build?"":"coming-soon"}`,onClick:()=>f(g.id),disabled:!g.build,"aria-pressed":S,"data-testid":`autonomy-${g.id}`,children:[u.jsx("span",{className:"autonomy-emoji",children:g.emoji}),u.jsxs("span",{className:"autonomy-body",children:[u.jsxs("span",{className:"autonomy-title",children:[g.title,!g.build&&u.jsx("span",{className:"autonomy-soon","data-testid":"autonomy-coming-soon",children:"coming soon"}),S&&u.jsx("span",{className:"autonomy-check",children:"✓"})]}),u.jsx("span",{className:"autonomy-desc",children:g.desc})]})]},g.id)})}),m===null&&u.jsxs("p",{className:"autonomy-note","data-testid":"autonomy-default-note",children:["Default — your agent follows the per-message ",u.jsx("strong",{children:"Build / Plan"})," toggle. Pick a setting above to lock it."]}),u.jsx("div",{className:"set-section",children:"Conversation name"}),u.jsxs("div",{className:"set-rename",children:[u.jsx("input",{type:"text",value:o,placeholder:"Auto-named from your chat",onChange:g=>a(g.target.value),"data-testid":"rename-input",maxLength:120}),u.jsx("button",{onClick:p,disabled:l,"data-testid":"rename-save",children:l?"Saving…":"Save"})]}),u.jsx("p",{className:"muted small",children:"Overrides the name we auto-pick for this workspace’s presence label."}),u.jsx("div",{className:"set-section",children:"Appearance"}),u.jsx("button",{className:"set-row",onClick:()=>{r==null||r(),n==null||n()},"data-testid":"settings-open-theme",children:"🎨 Theme — light / dark + accent"}),u.jsx(qA,{token:e}),u.jsx("div",{className:"set-section",children:"Account"}),u.jsxs("div",{className:"set-account","data-testid":"settings-account",children:[u.jsxs("span",{className:"set-account-agent",children:["Your agent: ",u.jsx("strong",{children:b})]}),y!=null&&y.email?u.jsxs("span",{className:"set-account-email",children:["Signed in as ",y.email]}):u.jsx("span",{className:"set-account-email muted",children:"Signed in on this device"})]}),u.jsx("div",{className:"actions",children:u.jsx("button",{onClick:n,"data-testid":"settings-done",children:"Done"})})]})})}function YA({bazaarPreview:e}){const[t,n]=w.useState(null);w.useEffect(()=>{let i=!1;async function s(){var c;const a=await fetch("/api/preview/ports").catch(()=>null);if(!a||i)return;const l=await a.json().catch(()=>({}));i||!t&&((c=l.ports)==null?void 0:c.length)>0&&n(l.ports[0].port)}s();const o=setInterval(s,4e3);return()=>{i=!0,clearInterval(o)}},[t]);const r=e!=null&&e.url?`${e.url}${e.url.includes("?")?"&":"?"}_=${e.ts||""}`:null;return r?u.jsx("iframe",{className:"liveview-frame",src:r,title:"Live view","data-testid":"liveview-frame",sandbox:"allow-scripts"},`bz-${e.ts}`):t?u.jsx("iframe",{className:"liveview-frame",src:`http://localhost:${t}`,title:"Live view","data-testid":"liveview-frame"},t):u.jsxs("div",{className:"liveview-empty","data-testid":"liveview-empty",children:[u.jsx("div",{className:"liveview-empty-mark",children:"👁️"}),u.jsx("p",{className:"liveview-empty-title",children:"Nothing to show yet"}),u.jsx("p",{className:"liveview-empty-sub",children:"When your agent builds something, it appears here — live, as it works."}),u.jsx(Lp,{variant:"ambient"})]})}function GA({id:e}){const t=`wild:notes:${e}`,[n,r]=w.useState(()=>{try{return localStorage.getItem(t)||""}catch{return""}});return w.useEffect(()=>{try{localStorage.setItem(t,n)}catch{}},[t,n]),u.jsx("textarea",{className:"notes-block",value:n,onChange:i=>r(i.target.value),placeholder:"Jot anything — a plan, a link, a reminder…","data-testid":"notes-block"})}function XA(e){return`$${(Number(e)||0).toFixed(2)}`}function JA(e=[],t=[]){if(!e.length)return t.length?{name:"You",handle:"you",total:0,uses:0,matches:0,serviceCalls:0}:null;const n=e[0];return(n.total||0)===0&&e.find(r=>r.handle==="you")||n}function ZA({live:e,token:t}){const[n,r]=w.useState(e||null);w.useEffect(()=>{let m=!1;const y=t?{Authorization:`Bearer ${t}`}:{};return fetch("/api/bazaar/state",{headers:y}).then(b=>b.ok?b.json():null).then(b=>{!m&&b&&r(_=>_||b)}).catch(()=>{}),()=>{m=!0}},[t]),w.useEffect(()=>{e&&r(e)},[e]);const i=w.useMemo(()=>JA(n==null?void 0:n.earnings,n==null?void 0:n.listings),[n]),s=i==null?void 0:i.handle,o=(i==null?void 0:i.total)??0,a=w.useRef({handle:null,total:null}),[l,c]=w.useState([]);if(w.useEffect(()=>{const m=a.current;if(m.handle!==s){a.current={handle:s,total:o},c([]);return}if(m.total===null){a.current={handle:s,total:o};return}const y=o-m.total;a.current={handle:s,total:o},y>0&&c(b=>[...b,y].slice(-28))},[s,o]),!i)return u.jsxs("div",{className:"earn-empty","data-testid":"earnings-empty",children:[u.jsx("div",{className:"earn-empty-mark",children:"💸"}),u.jsx("p",{className:"earn-empty-title",children:"No earnings yet"}),u.jsx("p",{className:"earn-empty-sub",children:"When someone builds on what you share — or uses a tool you wired in — represented earnings show up here, live."})]});const d=i.handle==="you",h=(i.serviceCalls||0)>0||(i.matches||0)>0,f=h?i.matches||0:i.uses||0,p=h?f===1?"match":"matches":f===1?"build":"builds";return u.jsxs("div",{className:"earn-block","data-testid":"earnings-block",children:[u.jsxs("div",{className:"earn-who",children:[u.jsxs("span",{className:"earn-name",children:[i.name,d&&u.jsx("span",{className:"earn-you-tag",children:"you"})]}),u.jsx("span",{className:"earn-sub",children:d?"your producer earnings":"a producer's earnings, live"})]}),u.jsx("div",{className:"earn-amount","data-testid":"earnings-amount",children:XA(o)}),u.jsxs("div",{className:"earn-meta",children:[u.jsxs("span",{children:[u.jsx("strong",{children:f})," ",p]}),u.jsx("span",{className:"earn-rep",title:"No real money moves yet — a preview of how earnings would work.",children:"represented · settles later"})]}),u.jsx(QA,{values:l})]})}function QA({values:e}){const t=e&&e.length>0,n=t?e:Array.from({length:16},()=>0),r=t?Math.max(...e):1;return u.jsxs("div",{className:`earn-spark ${t?"":"is-baseline"}`,"data-testid":"earnings-spark","aria-hidden":"true",children:[u.jsx("div",{className:"earn-bars",children:n.map((i,s)=>u.jsx("span",{className:"earn-bar",style:{height:`${t?8+Math.round(i/r*92):6}%`}},s))}),u.jsx("span",{className:"earn-spark-live",children:"live"})]})}function hx(e){const t=Math.max(0,Math.min(100,Number(e)||0));return Math.round(t)}function Uy(e,t){if(!e)return"";const n=Date.parse(e);if(!Number.isFinite(n))return"";let r=Math.floor((n-t)/1e3);if(r<=0)return"resetting…";const i=Math.floor(r/86400);r-=i*86400;const s=Math.floor(r/3600);r-=s*3600;const o=Math.floor(r/60);return i>0?`resets in ${i}d ${s}h`:s>0?`resets in ${s}h ${o}m`:`resets in ${o}m`}function sh({label:e,value:t,sub:n,tone:r="accent",testid:i}){const s=hx(t);return u.jsxs("div",{className:"usage-gauge","data-testid":i,children:[u.jsxs("div",{className:"usage-gauge-head",children:[u.jsx("span",{className:"usage-gauge-label",children:e}),u.jsxs("span",{className:"usage-gauge-val",children:[s,"%"]})]}),u.jsx("div",{className:"usage-bar",children:u.jsx("span",{className:`usage-bar-fill tone-${r}`,style:{width:`${s}%`}})}),n?u.jsx("div",{className:"usage-gauge-sub",children:n}):null]})}function eI({live:e,token:t}){var b,_,v,g,S;const[n,r]=w.useState(e||null),[i,s]=w.useState(!1),[o,a]=w.useState(()=>Date.now()),l=w.useRef(!0),c=t?{Authorization:`Bearer ${t}`}:{};w.useEffect(()=>(l.current=!0,fetch("/api/usage/state",{headers:c}).then(C=>C.ok?C.json():null).then(C=>{l.current&&C&&r(x=>x?{...x,...C}:C)}).catch(()=>{}),()=>{l.current=!1}),[t]),w.useEffect(()=>{e&&r(e)},[e]),w.useEffect(()=>{const C=setInterval(()=>a(Date.now()),3e4);return()=>clearInterval(C)},[]);async function d(){s(!0);try{await fetch("/api/usage/ack",{method:"POST",headers:c});const C=await fetch("/api/usage/refresh",{method:"POST",headers:c}).then(x=>x.ok?x.json():null).catch(()=>null);l.current&&r(x=>({...x||{},...C||{},disclosed:!0}))}finally{l.current&&s(!1)}}if(n&&n.disclosed===!1)return u.jsxs("div",{className:"usage-block usage-disclose","data-testid":"usage-disclosure",children:[u.jsx("div",{className:"usage-disclose-mark",children:"📊"}),u.jsx("p",{className:"usage-disclose-title",children:"Show your Claude usage?"}),u.jsxs("p",{className:"usage-disclose-body",children:["To show your plan usage, your workspace reads your Claude login ",u.jsx("strong",{children:"locally"})," and asks Anthropic for your numbers. It never leaves this machine except to Anthropic."]}),u.jsx("button",{className:"usage-disclose-ok",onClick:d,disabled:i,"data-testid":"usage-disclose-ok",children:i?"One sec…":"OK, show my usage"})]});if(!n)return u.jsxs("div",{className:"usage-block","data-testid":"usage-loading",children:[u.jsx("div",{className:"usage-skeleton"}),u.jsx("div",{className:"usage-skeleton"}),u.jsx("div",{className:"usage-skeleton short"})]});const h=n.plan||null,f=n.context||null,p=n.status||"loading",m=!h||p==="unavailable",y=p==="stale";return u.jsxs("div",{className:`usage-block ${y?"is-stale":""}`,"data-testid":"usage-block",children:[y&&u.jsx("div",{className:"usage-stale-note","data-testid":"usage-stale",children:"couldn't refresh — showing last known"}),h?u.jsxs(u.Fragment,{children:[u.jsx(sh,{label:"Session",value:(b=h.five_hour)==null?void 0:b.utilization,sub:Uy((_=h.five_hour)==null?void 0:_.resets_at,o),tone:"accent",testid:"usage-session"}),u.jsx(sh,{label:"Weekly",value:(v=h.seven_day)==null?void 0:v.utilization,sub:Uy((g=h.seven_day)==null?void 0:g.resets_at,o),tone:"weekly",testid:"usage-weekly"}),(S=h.extra_usage)!=null&&S.is_enabled?u.jsxs("div",{className:"usage-extra","data-testid":"usage-extra",children:["extra usage · ",hx(h.extra_usage.utilization),"% of $",h.extra_usage.monthly_limit]}):null]}):u.jsxs("div",{className:"usage-unavailable","data-testid":"usage-unavailable",children:[u.jsx("span",{className:"usage-unavailable-title",children:"Plan usage unavailable"}),u.jsx("span",{className:"usage-unavailable-sub",children:p==="unavailable"?"Sign in to Claude (or a non-Claude model is active).":"Couldn’t reach Anthropic just now."})]}),f?u.jsx(sh,{label:"Working memory",value:f.pct,sub:`${Math.round((f.used||0)/1e3)}k / ${Math.round((f.window||0)/1e3)}k tokens`,tone:"memory",testid:"usage-context"}):null,u.jsxs("div",{className:"usage-foot",children:[u.jsx("span",{className:"usage-live-dot","data-status":p}),u.jsx("span",{children:p==="live"?"live":p})]})]})}function tI({token:e,onRun:t}){const[n,r]=w.useState(null),[i,s]=w.useState(!1),[o,a]=w.useState(null),l=w.useRef(!0),c=e?{Authorization:`Bearer ${e}`}:{};w.useEffect(()=>(l.current=!0,fetch("/api/powers/state",{headers:c}).then(g=>g.ok?g.json():null).then(g=>{l.current&&g&&r(g)}).catch(()=>{}),()=>{l.current=!1}),[e]);function d(){const g=((n==null?void 0:n.skills)||[]).map(C=>C.name),S=((n==null?void 0:n.skills)||[]).filter(C=>C.hidden).map(C=>C.name);a({order:g,hidden:S}),s(!0)}async function h(){const g=o||{order:[],hidden:[]},S=await fetch("/api/powers/curation",{method:"POST",headers:{...c,"Content-Type":"application/json"},body:JSON.stringify(g)}).then(x=>x.ok?x.json():null).catch(()=>null),C=await fetch("/api/powers/state",{headers:c}).then(x=>x.ok?x.json():null).catch(()=>null);return l.current&&(C&&r(C),s(!1),a(null)),S}function f(g){a(S=>{const C=new Set(S.hidden);return C.has(g)?C.delete(g):C.add(g),{...S,hidden:[...C]}})}function p(g,S){a(C=>{const x=[...C.order],T=x.indexOf(g),P=T+S;return T<0||P<0||P>=x.length?C:([x[T],x[P]]=[x[P],x[T]],{...C,order:x})})}if(!n)return u.jsxs("div",{className:"powers-block","data-testid":"powers-loading",children:[u.jsx("div",{className:"powers-skel"}),u.jsx("div",{className:"powers-skel"})]});const m=n.skills||[],y=new Set(i&&o?o.hidden:m.filter(g=>g.hidden).map(g=>g.name)),b=new Map((i&&o?o.order:m.map(g=>g.name)).map((g,S)=>[g,S])),_=[...m].sort((g,S)=>(b.get(g.name)??99)-(b.get(S.name)??99)),v=_.filter(g=>!y.has(g.name));return u.jsxs("div",{className:"powers-block","data-testid":"powers-block",children:[u.jsxs("div",{className:"powers-head",children:[u.jsx("span",{className:"powers-title",children:"Powers"}),m.length>0&&u.jsx("button",{className:"powers-edit",onClick:i?h:d,"data-testid":i?"powers-save":"powers-edit-toggle",children:i?"Done":"Customize"})]}),m.length===0?u.jsxs("div",{className:"powers-empty","data-testid":"powers-empty",children:[u.jsx("div",{className:"powers-empty-mark",children:"🧰"}),u.jsx("p",{className:"powers-empty-title",children:"No powers yet"}),u.jsxs("p",{className:"powers-empty-sub",children:["Skills you add to ",u.jsx("code",{children:".claude/skills"})," — your own or a teammate's — show up here as one-tap actions."]})]}):i?u.jsx("div",{className:"powers-list","data-testid":"powers-edit-list",children:_.map(g=>{const S=y.has(g.name);return u.jsxs("div",{className:`powers-row edit ${S?"is-hidden":""}`,"data-testid":`powers-row-${g.name}`,children:[u.jsxs("span",{className:"powers-reorder",children:[u.jsx("button",{onClick:()=>p(g.name,-1),title:"Move up","data-testid":`powers-up-${g.name}`,children:"▲"}),u.jsx("button",{onClick:()=>p(g.name,1),title:"Move down","data-testid":`powers-down-${g.name}`,children:"▼"})]}),u.jsxs("span",{className:"powers-row-name",children:["/",g.name]}),u.jsx("button",{className:"powers-hide",onClick:()=>f(g.name),"data-testid":`powers-hide-${g.name}`,children:S?"Show":"Hide"})]},g.name)})}):u.jsx("div",{className:"powers-list","data-testid":"powers-run-list",children:v.length===0?u.jsx("p",{className:"powers-allhidden",children:"All powers hidden — tap Customize to bring some back."}):v.map(g=>u.jsxs("button",{className:"powers-run",onClick:()=>t==null?void 0:t(g.name),title:g.description||`Run /${g.name}`,"data-testid":`powers-run-${g.name}`,children:[u.jsxs("span",{className:"powers-run-name",children:["/",g.name]}),g.description?u.jsx("span",{className:"powers-run-desc",children:g.description}):null,g.source==="user"?u.jsx("span",{className:"powers-tag",children:"yours"}):null]},g.name))}),u.jsxs("div",{className:"powers-bazaar","data-testid":"powers-bazaar-locked",children:[u.jsx("div",{className:"powers-divider",children:"─ from Bazaar ─"}),u.jsx("p",{className:"powers-bazaar-note",children:"🔒 Verified marketplace skills land here — coming soon."})]})]})}function Vy(e){return`$${(Number(e)||0).toFixed(2)}`}function nI({live:e,token:t}){const[n,r]=w.useState(e||null);w.useEffect(()=>{let c=!1;const d=t?{Authorization:`Bearer ${t}`}:{};return fetch("/api/bazaar/state",{headers:d}).then(h=>h.ok?h.json():null).then(h=>{!c&&h&&r(f=>f||h)}).catch(()=>{}),()=>{c=!0}},[t]),w.useEffect(()=>{e&&r(e)},[e]);const i=(n==null?void 0:n.earnings)||[],s=(n==null?void 0:n.totals)||{creditPaid:0},o=i.reduce((c,d)=>c+(d.matches||0),0),a=i.reduce((c,d)=>c+(d.uses||0),0),l=Math.max(1,...i.map(c=>c.total||0));return i.length?u.jsxs("div",{className:"analytics-block","data-testid":"analytics-block",children:[u.jsxs("div",{className:"an-stats",children:[u.jsxs("div",{className:"an-stat",children:[u.jsx("span",{className:"an-stat-num",children:Vy(s.creditPaid)}),u.jsx("span",{className:"an-stat-lbl",children:"represented"})]}),u.jsxs("div",{className:"an-stat",children:[u.jsx("span",{className:"an-stat-num",children:o||a}),u.jsx("span",{className:"an-stat-lbl",children:o?"matches":"builds"})]}),u.jsxs("div",{className:"an-stat",children:[u.jsx("span",{className:"an-stat-num",children:i.length}),u.jsx("span",{className:"an-stat-lbl",children:i.length===1?"producer":"producers"})]})]}),u.jsx("div",{className:"an-board",children:i.slice(0,6).map(c=>u.jsxs("div",{className:"an-row","data-testid":`analytics-row-${c.handle}`,children:[u.jsxs("span",{className:"an-row-name",children:[c.name,c.handle==="you"&&u.jsx("span",{className:"earn-you-tag",children:"you"})]}),u.jsx("span",{className:"an-row-bar",children:u.jsx("span",{className:"an-row-fill",style:{width:`${Math.round((c.total||0)/l*100)}%`}})}),u.jsx("span",{className:"an-row-val",children:Vy(c.total)})]},c.handle))}),u.jsx("div",{className:"an-foot",children:"represented · settles later"})]}):u.jsxs("div",{className:"earn-empty","data-testid":"analytics-empty",children:[u.jsx("div",{className:"earn-empty-mark",children:"📊"}),u.jsx("p",{className:"earn-empty-title",children:"No activity yet"}),u.jsx("p",{className:"earn-empty-sub",children:"Once builds and matches start flowing across the shelf, you'll see who's earning and how much, here."})]})}function rI({token:e,selectedFile:t,onOpenFile:n}){const[r,i]=w.useState(null),[s,o]=w.useState(null),[a,l]=w.useState(()=>new Set);w.useEffect(()=>{let h=!1;const f=e?{Authorization:`Bearer ${e}`}:{};return fetch("/api/workspace/tree",{headers:f}).then(p=>p.json()).then(p=>{h||(p.error?o(p.error):i(p.entries||[]))}).catch(p=>!h&&o(p.message||String(p))),()=>{h=!0}},[e]);function c(h){l(f=>{const p=new Set(f);return p.has(h)?p.delete(h):p.add(h),p})}function d(h,f=0){var b;const p=h.type==="dir",m=a.has(h.path),y=!p&&h.path===t;return u.jsxs("div",{children:[u.jsxs("div",{className:`fnode ${p?"dir":""} ${y?"sel":""}`,onClick:()=>p?c(h.path):n==null?void 0:n(h.path),style:{paddingLeft:f*12+6},"data-testid":`files-node-${h.path}`,title:h.path,children:[u.jsx("span",{className:"fnode-tw",children:p?m?"▾":"▸":""}),u.jsx("span",{className:"fnode-ic",children:p?"📁":"📄"}),u.jsx("span",{className:"fnode-nm",children:h.name})]}),p&&m&&((b=h.children)==null?void 0:b.map(_=>d(_,f+1)))]},h.path)}return u.jsxs("div",{className:"files-block","data-testid":"files-block",children:[s&&u.jsx("div",{className:"files-msg err",children:s==="forbidden"?"Files aren't available on this view.":s}),!r&&!s&&u.jsxs("div",{className:"files-msg",children:[u.jsx("span",{className:"spinner"})," loading…"]}),(r==null?void 0:r.length)===0&&u.jsx("div",{className:"files-msg",children:"Empty workspace"}),r==null?void 0:r.map(h=>d(h,0))]})}const iI={js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",json:"json",md:"markdown",markdown:"markdown",css:"css",scss:"scss",html:"markup",xml:"markup",svg:"markup",py:"python",rs:"rust",go:"go",sh:"bash",bash:"bash",zsh:"bash",yml:"yaml",yaml:"yaml",toml:"toml",sql:"sql",java:"java",c:"c",h:"c",cpp:"cpp",rb:"ruby",php:"php"};function sI(e){const t=String(e||"").split(".").pop().toLowerCase();return iI[t]||"text"}function oI({path:e,token:t,onPickFile:n}){const[r,i]=w.useState(e||""),[s,o]=w.useState({loading:!1});w.useEffect(()=>{i(e||"")},[e]),w.useEffect(()=>{if(!e){o({loading:!1});return}let l=!1;o({loading:!0});const c=t?{Authorization:`Bearer ${t}`}:{};return fetch(`/api/workspace/file?path=${encodeURIComponent(e)}`,{headers:c}).then(d=>d.json()).then(d=>{l||o({loading:!1,...d})}).catch(d=>{l||o({loading:!1,error:d.message||String(d)})}),()=>{l=!0}},[e,t]);const a=sI(e);return u.jsxs("div",{className:"codeblock","data-testid":"code-view-block",children:[u.jsxs("div",{className:"codeblock-bar",children:[u.jsx("input",{className:"codeblock-path",value:r,onChange:l=>i(l.target.value),onKeyDown:l=>l.key==="Enter"&&(n==null?void 0:n(r.trim())),placeholder:"path/to/file",spellCheck:!1,"data-testid":"code-path"}),s.truncated&&u.jsx("span",{className:"codeblock-trunc",title:"Large file — showing the start",children:"truncated"})]}),u.jsxs("div",{className:"codeblock-body",children:[!e&&u.jsx("div",{className:"codeblock-msg",children:"Pick a file in the Files block — or type a path above — to view it here."}),e&&s.loading&&u.jsxs("div",{className:"codeblock-msg",children:[u.jsx("span",{className:"spinner"})," loading…"]}),e&&s.error&&u.jsx("div",{className:"codeblock-msg err",children:s.error==="forbidden"?"Files aren't available on this view.":s.error}),e&&!s.loading&&!s.error&&typeof s.content=="string"&&u.jsx(CS,{theme:Dp.vsDark,code:s.content,language:a,children:({tokens:l,getLineProps:c,getTokenProps:d})=>u.jsx("pre",{className:"codeblock-pre",children:l.map((h,f)=>u.jsxs("div",{...c({line:h}),className:"codeblock-line",children:[u.jsx("span",{className:"codeblock-ln",children:f+1}),u.jsx("span",{className:"codeblock-lc",children:h.map((p,m)=>u.jsx("span",{...d({token:p})},m))})]},f))})})]})]})}function aI({id:e}){const t=`wild:todo:${e}`,[n,r]=w.useState(()=>{try{const d=JSON.parse(localStorage.getItem(t)||"[]");return Array.isArray(d)?d:[]}catch{return[]}}),[i,s]=w.useState("");w.useEffect(()=>{try{localStorage.setItem(t,JSON.stringify(n))}catch{}},[t,n]);function o(){const d=i.trim();d&&(r(h=>[...h,{id:`${Date.now().toString(36)}-${h.length}`,text:d,done:!1}]),s(""))}function a(d){r(h=>h.map(f=>f.id===d?{...f,done:!f.done}:f))}function l(d){r(h=>h.filter(f=>f.id!==d))}const c=n.filter(d=>!d.done).length;return u.jsxs("div",{className:"todo-block","data-testid":"todo-block",children:[u.jsxs("div",{className:"todo-add",children:[u.jsx("input",{value:i,onChange:d=>s(d.target.value),onKeyDown:d=>d.key==="Enter"&&o(),placeholder:"Add a to-do…","data-testid":"todo-input"}),u.jsx("button",{onClick:o,disabled:!i.trim(),"data-testid":"todo-add-btn",children:"Add"})]}),u.jsxs("div",{className:"todo-list",children:[n.length===0&&u.jsx("div",{className:"todo-msg",children:"Nothing yet — add your first to-do above."}),n.map(d=>u.jsxs("div",{className:`todo-item ${d.done?"done":""}`,"data-testid":"todo-item",children:[u.jsxs("label",{children:[u.jsx("input",{type:"checkbox",checked:d.done,onChange:()=>a(d.id)}),u.jsx("span",{className:"todo-text",children:d.text})]}),u.jsx("button",{className:"todo-del",title:"Remove",onClick:()=>l(d.id),children:"✕"})]},d.id))]}),n.length>0&&u.jsxs("div",{className:"todo-foot",children:[c," left · ",n.length-c," done"]})]})}const lI=4e3,cI="server";function uI({token:e}){const[t,n]=w.useState(null),[r,i]=w.useState(null),[s,o]=w.useState(null),[a,l]=w.useState(null),c=w.useRef(null);return w.useEffect(()=>{let d=!1;const h=e?{Authorization:`Bearer ${e}`}:{};return fetch("/api/workspace/logs",{headers:h}).then(f=>f.json()).then(f=>{if(d)return;if(f.error){l(f.error);return}const p=f.logs||[];n(p);const m=p.filter(b=>b.exists),y=m.find(b=>b.name===cI)||m[0]||p[0];y&&i(y.name)}).catch(f=>!d&&l(f.message||String(f))),()=>{d=!0}},[e]),w.useEffect(()=>{if(!r)return;let d=!1;const h=e?{Authorization:`Bearer ${e}`}:{},f=()=>{typeof document<"u"&&document.hidden||fetch(`/api/workspace/logs?name=${encodeURIComponent(r)}&lines=300`,{headers:h}).then(m=>m.json()).then(m=>{d||(m.error?l(m.error):(l(null),o(m.body||"")))}).catch(m=>!d&&l(m.message||String(m)))};o(null),f();const p=setInterval(f,lI);return()=>{d=!0,clearInterval(p)}},[r,e]),w.useEffect(()=>{const d=c.current;d&&(d.scrollTop=d.scrollHeight)},[s]),a?u.jsx("div",{className:"logs-block","data-testid":"logs-block",children:u.jsx("div",{className:"logs-msg err",children:a==="forbidden"?"Logs aren't available on this view.":String(a)})}):u.jsxs("div",{className:"logs-block","data-testid":"logs-block",children:[t&&u.jsxs("div",{className:"logs-bar",children:[u.jsx("select",{className:"logs-select","data-testid":"logs-select",value:r||"",onChange:d=>i(d.target.value),children:t.map(d=>u.jsxs("option",{value:d.name,children:[d.name,d.exists?"":" · empty"]},d.name))}),u.jsx("span",{className:"logs-hint",children:"live · auto-refresh"})]}),u.jsxs("div",{className:"logs-body",children:[s===null&&u.jsxs("div",{className:"logs-msg",children:[u.jsx("span",{className:"spinner"})," loading…"]}),s===""&&u.jsx("div",{className:"logs-msg",children:"No log output yet."}),s&&u.jsx("pre",{className:"logs-out","data-testid":"logs-out",ref:c,children:s})]})]})}const al=100;function hI(e){const t=[];let n=[],r="",i=!1;for(let s=0;s<e.length;s+=1){const o=e[s];i?o==='"'?e[s+1]==='"'?(r+='"',s+=1):i=!1:r+=o:o==='"'?i=!0:o===","?(n.push(r),r=""):o===`
92
92
  `?(n.push(r),r="",t.push(n),n=[]):o!=="\r"&&(r+=o)}return(r!==""||n.length>0)&&(n.push(r),t.push(n)),t.filter(s=>!(s.length===1&&s[0]===""))}function dI(e,t){const n=e.trim();if(t.endsWith(".json")||!t.endsWith(".csv")&&!t.endsWith(".tsv")&&/^[[{]/.test(n)){let a;try{a=JSON.parse(n)}catch(h){throw new Error(`Invalid JSON: ${h.message}`)}let l=Array.isArray(a)?a:[a];if(l.every(h=>h===null||typeof h!="object"))return{columns:["value"],rows:l.map(h=>({value:h}))};const d=[];for(const h of l)if(h&&typeof h=="object"&&!Array.isArray(h))for(const f of Object.keys(h))d.includes(f)||d.push(f);return d.length===0&&d.push("value"),l=l.map(h=>h&&typeof h=="object"&&!Array.isArray(h)?h:{value:h}),{columns:d,rows:l}}const i=hI(e);if(i.length===0)return{columns:[],rows:[]};const s=i[0].map((a,l)=>a||`col${l+1}`),o=i.slice(1).map(a=>{const l={};return s.forEach((c,d)=>{l[c]=a[d]??""}),l});return{columns:s,rows:o}}function ll(e){return e==null?"":typeof e=="object"?JSON.stringify(e):String(e)}function fI({token:e}){const[t,n]=w.useState(""),[r,i]=w.useState(""),[s,o]=w.useState(null),[a,l]=w.useState(null),[c,d]=w.useState(!1),[h,f]=w.useState(""),[p,m]=w.useState(null);function y(v){const g=r.trim();if(!g)return;n(g),d(!0),l(null),o(null),f(""),m(null);const S=e?{Authorization:`Bearer ${e}`}:{};fetch(`/api/workspace/file?path=${encodeURIComponent(g)}`,{headers:S}).then(C=>C.json()).then(C=>{if(C.error){l(C.error==="forbidden"?"Data files aren't available on this view.":C.error);return}try{o(dI(C.content||"",g))}catch(x){l(x.message||String(x))}}).catch(C=>l(C.message||String(C))).finally(()=>d(!1))}function b(v){m(g=>!g||g.col!==v?{col:v,dir:"asc"}:g.dir==="asc"?{col:v,dir:"desc"}:null)}const _=w.useMemo(()=>{if(!s)return null;let v=s.rows;const g=h.trim().toLowerCase();if(g&&(v=v.filter(S=>s.columns.some(C=>ll(S[C]).toLowerCase().includes(g)))),p){const{col:S,dir:C}=p;v=[...v].sort((x,T)=>{const P=x[S],B=T[S],j=Number(P),$=Number(B);let I;return P!==""&&B!==""&&!Number.isNaN(j)&&!Number.isNaN($)?I=j-$:I=ll(P).localeCompare(ll(B)),C==="asc"?I:-I})}return{total:v.length,rows:v.slice(0,al)}},[s,h,p]);return u.jsxs("div",{className:"dtable-block","data-testid":"datatable-block",children:[u.jsxs("div",{className:"dtable-bar",children:[u.jsx("input",{className:"dtable-path","data-testid":"datatable-path",value:r,onChange:v=>i(v.target.value),onKeyDown:v=>{v.key==="Enter"&&y()},placeholder:"data.csv or records.json","aria-label":"File path"}),u.jsx("button",{className:"dtable-load","data-testid":"datatable-load",onClick:()=>y(),disabled:!r.trim()||c,children:c?"…":"Load"}),s&&u.jsx("input",{className:"dtable-filter","data-testid":"datatable-filter",value:h,onChange:v=>f(v.target.value),placeholder:"Filter rows…","aria-label":"Filter rows"})]}),u.jsxs("div",{className:"dtable-body",children:[a&&u.jsx("div",{className:"dtable-msg err","data-testid":"datatable-error",children:a}),c&&u.jsxs("div",{className:"dtable-msg",children:[u.jsx("span",{className:"spinner"})," loading ",t,"…"]}),!c&&!a&&!s&&u.jsx("div",{className:"dtable-msg","data-testid":"datatable-empty",children:"Enter a CSV or JSON file path from your workspace to load it as a table."}),!c&&!a&&s&&s.columns.length===0&&u.jsx("div",{className:"dtable-msg",children:"That file has no rows to show."}),!c&&!a&&_&&s.columns.length>0&&u.jsxs(u.Fragment,{children:[_.total===0?u.jsxs("div",{className:"dtable-msg","data-testid":"datatable-nomatch",children:["No rows match “",h,"”."]}):u.jsx("div",{className:"dtable-scroll",children:u.jsxs("table",{className:"dtable","data-testid":"datatable",children:[u.jsx("thead",{children:u.jsx("tr",{children:s.columns.map(v=>u.jsxs("th",{onClick:()=>b(v),"data-testid":`datatable-th-${v}`,title:"Click to sort",children:[v,(p==null?void 0:p.col)===v?p.dir==="asc"?" ▲":" ▼":""]},v))})}),u.jsx("tbody",{children:_.rows.map((v,g)=>u.jsx("tr",{children:s.columns.map(S=>u.jsx("td",{children:ll(v[S])},S))},g))})]})}),_.total>0&&u.jsxs("div",{className:"dtable-foot",children:["showing ",Math.min(_.total,al)," of ",_.total," row",_.total===1?"":"s",_.total>al?` (capped at ${al})`:""]})]})]})]})}function pI({canDeploy:e,onSetup:t}){return u.jsxs("div",{className:"deploy-block","data-testid":"deploy-block",children:[u.jsxs("div",{className:"deploy-empty",children:[u.jsx("div",{className:"deploy-icon",children:"🚀"}),u.jsx("p",{className:"deploy-title",children:"No deploy target connected yet"}),u.jsx("p",{className:"deploy-sub",children:"When you’re ready to put this build online, your agent handles the deploy — wiring up a target, building, and shipping it. Nothing here is faked."}),e?u.jsx("button",{className:"deploy-btn primary","data-testid":"deploy-setup",onClick:()=>t==null?void 0:t(),children:"Set up deployment"}):u.jsx("p",{className:"deploy-note","data-testid":"deploy-locked",children:"Ask the workspace owner to set up a deploy target."})]}),u.jsxs("div",{className:"deploy-history",children:[u.jsx("div",{className:"deploy-history-h",children:"Recent deploys"}),u.jsx("div",{className:"deploy-msg","data-testid":"deploy-history-empty",children:"No deployments yet."})]})]})}/**
93
93
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
94
94
  * @license MIT
@@ -128,4 +128,4 @@ WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){t
128
128
  * Copyright (c) 2011 Fabrice Bellard
129
129
  */var kz=2,Cz=1,Ez=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var h;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((h=this._terminal.options.overviewRuler)==null?void 0:h.width)||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue("height")),i=Math.max(0,parseInt(n.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),o={top:parseInt(s.getPropertyValue("padding-top")),bottom:parseInt(s.getPropertyValue("padding-bottom")),right:parseInt(s.getPropertyValue("padding-right")),left:parseInt(s.getPropertyValue("padding-left"))},a=o.top+o.bottom,l=o.right+o.left,c=r-a,d=i-l-t;return{cols:Math.max(kz,Math.floor(d/e.css.cell.width)),rows:Math.max(Cz,Math.floor(c/e.css.cell.height))}}};function Nz({token:e}){const t=w.useRef(null),[n,r]=w.useState("connecting"),[i,s]=w.useState(null);return w.useEffect(()=>{const o=t.current;if(!o)return;const a=new xz({fontSize:13,fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",cursorBlink:!0,theme:{background:"#1e1e1e",foreground:"#d4d4d4"}}),l=new Ez;a.loadAddon(l),a.open(o);try{l.fit()}catch{}const c=window.location.protocol==="https:"?"wss":"ws",d=new URL(`${c}://${window.location.host}/ws/pty`);e&&d.searchParams.set("t",e);const h=new WebSocket(d.toString()),f=()=>{h.readyState===WebSocket.OPEN&&h.send(JSON.stringify({type:"resize",cols:a.cols,rows:a.rows}))};h.onopen=()=>{r("open");try{l.fit()}catch{}f(),a.focus()},h.onmessage=y=>{let b;try{b=JSON.parse(y.data)}catch{return}b.type==="data"?a.write(b.data):b.type==="error"?(r("error"),s(b.message||"terminal not available")):b.type==="exit"&&(r("closed"),a.write(`\r
130
130
  [session ended${b.code!=null?` (exit ${b.code})`:""}]\r
131
- `))},h.onclose=()=>r(y=>y==="error"?y:"closed"),h.onerror=()=>{r("error"),s("connection failed")};const p=a.onData(y=>{h.readyState===WebSocket.OPEN&&h.send(JSON.stringify({type:"data",data:y}))});let m;try{m=new ResizeObserver(()=>{try{l.fit(),f()}catch{}}),m.observe(o)}catch{}return()=>{try{m==null||m.disconnect()}catch{}try{p.dispose()}catch{}try{h.close()}catch{}try{a.dispose()}catch{}}},[e]),u.jsxs("div",{className:"terminal-block","data-testid":"terminal-block",children:[n==="error"&&u.jsx("div",{className:"terminal-msg err","data-testid":"terminal-error",children:i||"terminal not available"}),u.jsx("div",{className:"terminal-host",ref:t,"data-testid":"terminal-host"})]})}function jz({spec:e}){if(!e||!e.kind)return u.jsx("div",{className:"cb-empty","data-testid":"custom-empty",children:"This block has nothing to show yet."});const{kind:t,note:n,data:r={}}=e;return u.jsxs("div",{className:"cb-block","data-testid":"custom-block","data-kind":t,children:[n&&u.jsx("p",{className:"cb-note",children:n}),t==="metric"&&u.jsx(Rz,{data:r}),t==="list"&&u.jsx(Tz,{data:r}),t==="table"&&u.jsx(Dz,{data:r}),t==="markdown"&&u.jsx(Pz,{data:r})]})}function Rz({data:e}){const t=["up","down","flat"].includes(e.trend)?e.trend:null;return u.jsxs("div",{className:"cb-metric","data-testid":"custom-metric",children:[u.jsx("div",{className:"cb-metric-value",children:e.value??"—"}),e.label&&u.jsx("div",{className:"cb-metric-label",children:e.label}),e.delta&&u.jsxs("div",{className:`cb-metric-delta ${t?`is-${t}`:""}`,"data-testid":"custom-delta",children:[t==="up"?"▲ ":t==="down"?"▼ ":"",e.delta]}),Array.isArray(e.spark)&&e.spark.length>0&&u.jsx(Lz,{values:e.spark})]})}function Tz({data:e}){const t=Array.isArray(e.items)?e.items:[];return t.length?u.jsx("ul",{className:"cb-list","data-testid":"custom-list",children:t.map((n,r)=>u.jsxs("li",{className:"cb-list-row",children:[u.jsx("span",{className:"cb-list-label",children:n.label}),n.value!==void 0&&n.value!==""&&u.jsx("span",{className:"cb-list-value",children:n.value})]},r))}):u.jsx("div",{className:"cb-empty","data-testid":"custom-empty",children:"Empty list."})}function Dz({data:e}){const t=Array.isArray(e.columns)?e.columns:[],n=Array.isArray(e.rows)?e.rows:[];return n.length?u.jsx("div",{className:"cb-table-wrap",children:u.jsxs("table",{className:"cb-table","data-testid":"custom-table",children:[t.length>0&&u.jsx("thead",{children:u.jsx("tr",{children:t.map((r,i)=>u.jsx("th",{children:r},i))})}),u.jsx("tbody",{children:n.map((r,i)=>u.jsx("tr",{children:(Array.isArray(r)?r:[r]).map((s,o)=>u.jsx("td",{children:s},o))},i))})]})}):u.jsx("div",{className:"cb-empty","data-testid":"custom-empty",children:"No rows."})}function Pz({data:e}){const t=typeof e.text=="string"?e.text:"";return t?u.jsx("div",{className:"cb-markdown","data-testid":"custom-markdown",children:u.jsx(ES,{text:t})}):u.jsx("div",{className:"cb-empty","data-testid":"custom-empty",children:"Empty note."})}function Lz({values:e}){const t=Math.max(...e,1);return u.jsx("div",{className:"cb-spark","data-testid":"custom-spark","aria-hidden":"true",children:e.map((n,r)=>u.jsx("span",{className:"cb-spark-bar",style:{height:`${8+Math.round(Math.max(0,n)/t*92)}%`}},r))})}function Az({onClose:e}){const[t,n]=w.useState("viewer"),[r,i]=w.useState(24),[s,o]=w.useState(""),[a,l]=w.useState(null),[c,d]=w.useState([]),[h,f]=w.useState(null),[p,m]=w.useState(!1);w.useEffect(()=>{y()},[]);async function y(){const g=await fetch("/api/share").catch(()=>null);if(!g||!g.ok)return;const S=await g.json();d(S.tokens||[])}async function b(){f(null),m(!0);try{const g=await fetch("/api/share",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({role:t,ttlSeconds:Math.max(60,Number(r)*3600),label:s})}),S=await g.json();if(!g.ok)throw new Error(S.error||`HTTP ${g.status}`);l(S),y()}catch(g){f(g.message||String(g))}finally{m(!1)}}async function _(g){await fetch(`/api/share/${encodeURIComponent(g)}`,{method:"DELETE"}),y()}async function v(g){try{await navigator.clipboard.writeText(g)}catch{}}return u.jsx("div",{className:"modal-backdrop",onClick:e,children:u.jsxs("div",{className:"modal",onClick:g=>g.stopPropagation(),"data-testid":"share-dialog",children:[u.jsx("h2",{children:"Share workspace"}),u.jsx("p",{className:"muted",children:"Issue a token-protected URL. Anyone with the link opens this workspace in their browser with the role you choose."}),u.jsx("label",{children:"Role"}),u.jsx("div",{className:"row",children:u.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,color:"var(--text)"},children:[u.jsx("input",{type:"radio",name:"role",value:"viewer",checked:t==="viewer",onChange:()=>n("viewer"),"data-testid":"share-role-viewer"}),u.jsx("span",{children:"Viewer — read-only chat + preview"})]})}),u.jsx("div",{className:"row",children:u.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,color:"var(--text)"},children:[u.jsx("input",{type:"radio",name:"role",value:"client",checked:t==="client",onChange:()=>n("client"),"data-testid":"share-role-client"}),u.jsx("span",{children:"Client — can chat and request changes"})]})}),u.jsxs("div",{className:"row",children:[u.jsxs("div",{children:[u.jsx("label",{children:"Expires in"}),u.jsx("input",{type:"number",min:"1",value:r,onChange:g=>i(g.target.value),style:{width:80,background:"var(--bg)",color:"var(--text)",border:"1px solid var(--border)",padding:"4px 8px",borderRadius:6},"data-testid":"share-ttl"}),u.jsx("span",{style:{marginLeft:6,color:"var(--text-muted)",fontSize:12},children:"hours"})]}),u.jsxs("div",{style:{flex:1},children:[u.jsx("label",{children:"Label (optional)"}),u.jsx("input",{value:s,onChange:g=>o(g.target.value),placeholder:"e.g. Mel preview",style:{width:"100%",background:"var(--bg)",color:"var(--text)",border:"1px solid var(--border)",padding:"4px 8px",borderRadius:6},"data-testid":"share-label"})]})]}),h&&u.jsx("div",{style:{color:"var(--error)",fontSize:12,marginBottom:8},"data-testid":"share-error",children:h}),a&&u.jsxs(u.Fragment,{children:[u.jsx("label",{children:"Share URL"}),u.jsx("div",{className:"url-output","data-testid":"share-url",children:a.shareUrl}),u.jsxs("div",{style:{display:"flex",gap:8},children:[u.jsx("button",{onClick:()=>v(a.shareUrl),"data-testid":"share-copy",children:"Copy"}),u.jsx("a",{href:a.shareUrl,target:"_blank",rel:"noreferrer",children:u.jsx("button",{children:"Open"})})]})]}),c.length>0&&u.jsxs("div",{style:{marginTop:16},children:[u.jsx("label",{children:"Active share tokens"}),u.jsx("div",{style:{maxHeight:140,overflow:"auto",border:"1px solid var(--border)",borderRadius:6},children:c.map(g=>u.jsxs("div",{style:{padding:"6px 10px",borderBottom:"1px solid var(--border)",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:12},"data-testid":`active-token-${g.sub}`,children:[u.jsxs("div",{children:[u.jsx("strong",{children:g.label||g.role})," ",u.jsxs("span",{style:{color:"var(--text-muted)"},children:["(",g.role,", expires ",new Date(g.exp*1e3).toLocaleString(),")"]})]}),u.jsx("button",{onClick:()=>_(g.sub),style:{fontSize:11},"data-testid":`revoke-${g.sub}`,children:"Revoke"})]},g.sub))})]}),u.jsxs("div",{className:"actions",children:[u.jsx("button",{onClick:e,"data-testid":"share-close",children:"Close"}),u.jsx("button",{className:"primary",onClick:b,disabled:p,"data-testid":"share-issue",children:p?u.jsx("span",{className:"spinner"}):"Issue URL"})]})]})})}function Iz({onClose:e,token:t}){var $,I;const[n,r]=w.useState(null),[i,s]=w.useState(!1),[o,a]=w.useState(null),[l,c]=w.useState(!1),[d,h]=w.useState(""),[f,p]=w.useState(""),[m,y]=w.useState(168),[b,_]=w.useState(null);w.useEffect(()=>{g()},[]);function v(R,A={}){const N={...A.headers||{}};return t&&(N.Authorization=`Bearer ${t}`),fetch(R,{...A,headers:N})}async function g(){a(null),s(!1);const R=await v("/api/sync/status").catch(()=>null);if(!R||!R.ok){s(!0);return}r(await R.json())}async function S(R){a(null),c(!0);try{await R()}catch(A){a(A.message||String(A))}finally{c(!1)}}const C=()=>S(async()=>{const R=await v("/api/sync/pair",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({inviteCode:d})}),A=await R.json();if(!R.ok)throw new Error(A.error||`HTTP ${R.status}`);h(""),await g()}),x=()=>S(async()=>{var N,z;const R=await v("/api/sync/invite",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectCode:(z=(N=n==null?void 0:n.workspaces)==null?void 0:N[0])==null?void 0:z.projectId,displayName:f,expiresHours:Math.max(1,Number(m)||168)})}),A=await R.json();if(!R.ok)throw new Error(A.error||`HTTP ${R.status}`);_(A.invite)}),T=()=>S(async()=>{var N,z;const R=await v("/api/sync/detach",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({workspaceId:(z=(N=n==null?void 0:n.workspaces)==null?void 0:N[0])==null?void 0:z.workspaceId})}),A=await R.json();if(!R.ok)throw new Error(A.error||`HTTP ${R.status}`);_(null),await g()});async function P(R){try{await navigator.clipboard.writeText(R)}catch{}}const B=(($=n==null?void 0:n.workspaces)==null?void 0:$[0])||null,j=!!n&&!((I=n.daemon)!=null&&I.running);return u.jsx("div",{className:"modal-backdrop",onClick:e,children:u.jsxs("div",{className:"modal",onClick:R=>R.stopPropagation(),"data-testid":"sync-dialog",children:[u.jsx("h2",{children:"Collaborate on this folder"}),u.jsx("p",{className:"muted",children:"bmo-sync keeps this workspace folder identical across machines — yours and a collaborator's. Both of you edit; changes flow both ways. Like a shared drive, but built for workspaces."}),!n&&!i&&u.jsxs("div",{className:"muted",children:[u.jsx("span",{className:"spinner"})," Checking sync status…"]}),i&&u.jsxs("div",{className:"sync-state warn","data-testid":"sync-load-failed",children:[u.jsx("strong",{children:"Couldn't load sync status."}),u.jsx("span",{className:"muted",children:"The workspace server didn't answer. Try again."})]}),j&&u.jsxs("div",{className:"sync-state warn","data-testid":"sync-daemon-down",children:[u.jsx("strong",{children:"The bmo-sync daemon isn't running."}),u.jsx("span",{className:"muted",children:"Folder sharing needs the background sync service running on this machine. Start it, then recheck."})]}),n&&!j&&!B&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"sync-state","data-testid":"sync-unpaired",children:[u.jsxs("strong",{children:[n.workspaceName," isn't shared yet."]}),u.jsx("span",{className:"muted",children:"Got an invite code from a collaborator? Paste it to sync this folder with theirs."})]}),u.jsx("label",{children:"Invite code"}),u.jsxs("div",{className:"row",children:[u.jsx("input",{className:"sync-input",style:{flex:1},value:d,onChange:R=>h(R.target.value),placeholder:"e.g. CAFE-MILANO-A8X3","data-testid":"sync-invite-input"}),u.jsx("button",{className:"primary",onClick:C,disabled:l||!d.trim(),"data-testid":"sync-join",children:l?u.jsx("span",{className:"spinner"}):"Connect folder"})]})]}),n&&!j&&B&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"sync-state ok","data-testid":"sync-paired",children:[u.jsxs("strong",{children:["✓ Synced — ",B.projectName||B.projectId]}),u.jsxs("span",{className:"muted",children:["This folder is shared. Edits sync both ways automatically",B.conflictCount?` · ${B.conflictCount} conflict${B.conflictCount>1?"s":""} resolved`:"","."]})]}),n.canInvite?u.jsxs(u.Fragment,{children:[u.jsx("label",{children:"Invite a collaborator"}),u.jsxs("div",{className:"row",children:[u.jsx("input",{className:"sync-input",style:{flex:1},value:f,onChange:R=>p(R.target.value),placeholder:"Their name — e.g. Mel","data-testid":"sync-invite-name"}),u.jsx("input",{className:"sync-input",style:{width:64},type:"number",min:"1",value:m,onChange:R=>y(R.target.value),title:"Invite expires in (hours)"}),u.jsx("button",{onClick:x,disabled:l,"data-testid":"sync-create-invite",children:l?u.jsx("span",{className:"spinner"}):"Create invite"})]}),b&&u.jsxs(u.Fragment,{children:[u.jsx("label",{children:"Send this code to your collaborator"}),u.jsx("div",{className:"url-output","data-testid":"sync-invite-code",children:b.code}),u.jsxs("div",{className:"row",style:{marginBottom:0},children:[u.jsx("button",{onClick:()=>P(b.code),"data-testid":"sync-copy-code",children:"Copy code"}),b.expiresAt&&u.jsxs("span",{className:"muted",style:{margin:0},children:["expires ",new Date(b.expiresAt*1e3).toLocaleDateString()]})]})]})]}):u.jsxs("p",{className:"muted","data-testid":"sync-no-invite",children:["Inviting from here needs a bmo-sync admin key (set"," ",u.jsx("span",{className:"md-code-inline",children:"BMO_SYNC_ADMIN_KEY"}),"). Without it, anyone you've already invited can still join with their own code."]})]}),o&&u.jsx("div",{style:{color:"var(--error)",fontSize:12,marginTop:8},"data-testid":"sync-error",children:o}),u.jsxs("div",{className:"actions",children:[(j||i)&&u.jsx("button",{onClick:g,disabled:l,"data-testid":"sync-recheck",children:"Recheck"}),B&&!j&&u.jsx("button",{onClick:T,disabled:l,"data-testid":"sync-disconnect",children:"Disconnect"}),u.jsx("button",{onClick:e,"data-testid":"sync-close",children:"Close"})]})]})})}function Mz({alert:e,onDismiss:t}){if(!e)return null;const n=e.kind==="fatal";return u.jsxs("div",{className:"conflict-banner","data-testid":"conflict-banner",role:"status",children:[u.jsx("span",{className:"ico",children:n?"⛔":"⚠️"}),n?u.jsxs("span",{children:[u.jsx("strong",{children:"Sync stopped."})," ",e.message||"The sync engine hit a fatal error."," Reconnect from the Collaborate dialog."]}):u.jsxs("span",{children:[u.jsx("strong",{children:"Sync conflict"})," on ",u.jsx("code",{children:e.path||"a file"})," — bmo-sync kept ",u.jsx("strong",{children:e.resolution||"the latest edit"}),e.user?` (also edited by ${e.user})`:"","."]}),u.jsx("span",{className:"spacer"}),u.jsx("button",{onClick:t,"data-testid":"conflict-dismiss",children:"Dismiss"})]})}function Oz({urlToken:e,onClose:t}){const[n,r]=w.useState([]),[i,s]=w.useState(!0),[o,a]=w.useState(null),[l,c]=w.useState(null),[d,h]=w.useState({}),[f,p]=w.useState(null),m=e?{Authorization:`Bearer ${e}`}:{};function y(){s(!0),fetch("/api/conflicts",{headers:m}).then(g=>g.ok?g.json():{conflicts:[]}).then(g=>{r(Array.isArray(g==null?void 0:g.conflicts)?g.conflicts:[]),a(null)}).catch(g=>a(String((g==null?void 0:g.message)||g))).finally(()=>s(!1))}w.useEffect(y,[]);function b(g){return`${g.workspaceId}:${g.path}`}async function _(g){const S=b(g);if(d[S])return;const C=new URL("/api/conflicts/view",window.location.origin);C.searchParams.set("workspaceId",g.workspaceId),C.searchParams.set("path",g.path);const x=await fetch(C.toString(),{headers:m});if(!x.ok){a(`Could not load ${g.path} (HTTP ${x.status})`);return}const T=await x.json().catch(()=>null);T&&h(P=>({...P,[S]:{mine:F_(T.mine),theirs:F_(T.theirs),conflict:T.conflict}}))}async function v(g,S){const C=b(g);p(C);try{const x=await fetch("/api/conflicts/resolve",{method:"POST",headers:{"content-type":"application/json",...m},body:JSON.stringify({workspaceId:g.workspaceId,path:g.path,action:S})});if(!x.ok){const T=await x.json().catch(()=>({}));a((T==null?void 0:T.error)||`Resolve failed (HTTP ${x.status}).`);return}y(),c(null)}finally{p(null)}}return u.jsxs("div",{className:"conflict-panel","data-testid":"conflict-panel",role:"dialog","aria-label":"Open conflicts",children:[u.jsxs("header",{className:"conflict-panel-header",children:[u.jsx("strong",{children:"Open conflicts"})," ",u.jsxs("span",{className:"muted",children:["(",n.length,") · changes saved to the daemon back-office until you resolve"]}),u.jsx("span",{className:"spacer"}),u.jsx("button",{onClick:y,children:"Refresh"}),u.jsx("button",{onClick:t,children:"Close"})]}),i&&u.jsx("div",{className:"muted",children:"Loading…"}),o&&u.jsx("div",{className:"conflict-panel-error",children:o}),!i&&n.length===0&&u.jsx("div",{className:"muted",children:"No open conflicts."}),u.jsx("ul",{className:"conflict-list",children:n.map(g=>{const S=b(g),C=l===S,x=d[S];return u.jsxs("li",{className:"conflict-row",children:[u.jsxs("div",{className:"conflict-row-head",onClick:()=>{C?c(null):(c(S),g.resolution!=="remote_announced"&&_(g))},children:[u.jsx("code",{children:g.path}),u.jsxs("span",{className:"muted",children:["·"," ",g.resolution==="remote_announced"?`${g.conflictingUser||"peer"} flagged`:g.conflictingUser||"peer"," ","·"," ",new Date((g.detectedAt||0)*1e3).toLocaleTimeString()]}),u.jsx("span",{className:"spacer"}),u.jsx("span",{className:"muted",children:C?"▲":"▼"})]}),C&&g.resolution==="remote_announced"&&u.jsxs("div",{className:"conflict-row-body",children:[u.jsxs("div",{className:"muted",children:[g.conflictingUser||"A peer"," reported a conflict on this file. Your local copy is unchanged here — open it, decide whether to keep your version or pull theirs, save, and the next sync will reconcile."]}),u.jsx("div",{className:"conflict-actions",children:u.jsx("button",{disabled:f===S,onClick:()=>v(g,"keep_mine"),"data-testid":"conflict-acknowledge",children:"Acknowledge"})})]}),C&&g.resolution!=="remote_announced"&&u.jsxs("div",{className:"conflict-row-body",children:[!x&&u.jsx("div",{className:"muted",children:"Loading diff…"}),x&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"conflict-meta",children:[u.jsxs("span",{children:["mine: ",u.jsx("code",{children:vh(g.mineSha256)})]}),u.jsxs("span",{children:["theirs: ",u.jsx("code",{children:vh(g.theirsSha256)})]}),g.baseSha256&&u.jsxs("span",{children:["base: ",u.jsx("code",{children:vh(g.baseSha256)})]})]}),u.jsx(zz,{mine:x.mine,theirs:x.theirs}),u.jsxs("div",{className:"conflict-actions",children:[u.jsx("button",{disabled:f===S,onClick:()=>v(g,"keep_mine"),"data-testid":"conflict-keep-mine",children:"Keep mine"}),u.jsx("button",{disabled:f===S,onClick:()=>v(g,"take_theirs"),"data-testid":"conflict-take-theirs",children:"Take theirs"})]})]})]})]},S)})})]})}function F_(e){if(typeof e!="string")return null;try{const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return new TextDecoder().decode(n)}catch{return null}}function vh(e){return typeof e!="string"?"∅":e.length>12?`${e.slice(0,12)}…`:e}function zz({mine:e,theirs:t}){return e==null&&t==null?u.jsx("div",{className:"muted",children:"Both versions unavailable on disk."}):e==null||t==null?u.jsx("div",{className:"muted",children:"Only one side is available — the other was deleted before resolution."}):u.jsx(Tl,{oldText:t,newText:e})}function Bz({role:e,urlToken:t,onSyncAlert:n,onOpenConflicts:r}){const[i,s]=w.useState([]),[o,a]=w.useState({tokensIn:0,tokensOut:0,costUsd:0}),[l,c]=w.useState([]),[d,h]=w.useState(!1),[f,p]=w.useState(null),[m,y]=w.useState(0);w.useEffect(()=>{if(e!=="partner")return;const S=t?{Authorization:`Bearer ${t}`}:{};fetch("/api/sync/status",{headers:S}).then(C=>C.ok?C.json():null).then(C=>{var x;C&&p({paired:!!C.paired,daemonRunning:!!((x=C.daemon)!=null&&x.running),peer:null})}).catch(()=>{}),fetch("/api/conflicts",{headers:S}).then(C=>C.ok?C.json():{conflicts:[]}).then(C=>y(Array.isArray(C==null?void 0:C.conflicts)?C.conflicts.length:0)).catch(()=>{})},[e,t]),w.useEffect(()=>{const S=window.location.protocol==="https:"?"wss":"ws",C=new URL(`${S}://${window.location.host}/ws/activity`);t&&C.searchParams.set("t",t);const x=new WebSocket(C.toString());return x.onopen=()=>h(!0),x.onclose=()=>h(!1),x.onmessage=T=>{let P;try{P=JSON.parse(T.data)}catch{return}P.type==="snapshot"?(s(P.snapshot.presence||[]),a(P.snapshot.usage||{tokensIn:0,tokensOut:0,costUsd:0}),c(P.snapshot.recent||[])):(c(B=>[...B.slice(-49),P]),b(P))},()=>{try{x.close()}catch{}}},[t]);function b(S){S.type==="daemon-status"?p(C=>({...C||{paired:!1},daemonRunning:!!S.connected})):S.type==="sync-paired"?p(C=>({...C||{},paired:!0,daemonRunning:!0})):S.type==="sync-detached"?p(C=>({...C||{},paired:!1,peer:null})):S.type==="remote-presence"?p(C=>({...C||{paired:!0},peer:S.user||null})):S.type==="sync-conflict"?(n==null||n({kind:"conflict",path:S.path,resolution:S.resolution,user:S.conflictingUser}),(S.resolution==="local_pre_write_guard"||S.resolution==="remote_announced")&&y(C=>C+1)):S.type==="sync-conflict-resolved"?y(C=>Math.max(0,C-1)):S.type==="sync-fatal"&&(n==null||n({kind:"fatal",message:S.message}))}const _=[...l].reverse().find(S=>S.type==="chat-stream"||S.type==="chat-user"||S.type==="chat-end"),v=l.find(S=>S.type==="inbox-change");let g=null;return f!=null&&f.paired&&(g=f.daemonRunning?u.jsxs("span",{className:"pill synced","data-testid":"activity-sync",children:["⇄ Synced",f.peer?` · with ${f.peer}`:""]}):u.jsx("span",{className:"pill sync-off","data-testid":"activity-sync",children:"⇄ Sync paused"})),u.jsxs("footer",{className:"bottombar","data-testid":"activity-bar",children:[u.jsx("span",{className:`pill ${d?"live":""}`,"data-testid":"activity-connected",children:d?"live":"reconnecting…"}),u.jsxs("span",{className:"pill","data-testid":"activity-presence",children:["👥 ",i.length," viewing"]}),g,e==="partner"&&m>0&&u.jsxs("button",{type:"button",className:"pill conflict-badge","data-testid":"activity-conflicts",onClick:()=>r==null?void 0:r(),title:"Resolve open sync conflicts",children:["🛑 ",m," conflict",m===1?"":"s"]}),u.jsxs("span",{className:"pill","data-testid":"activity-usage",children:["↓",o.tokensIn," ↑",o.tokensOut," · $",(o.costUsd||0).toFixed(3)]}),_&&u.jsx("span",{className:"pill",style:{maxWidth:380,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"data-testid":"activity-last",children:_.type==="chat-end"?"✓ agent finished":"… agent streaming"}),v&&u.jsx("span",{className:"pill","data-testid":"activity-inbox",children:"📦 inbox updated"}),u.jsx("span",{style:{flex:1}}),u.jsxs("span",{style:{fontSize:11},children:["v0.1.0 · ",e]})]})}function Fz(){var r;const[e,t]=w.useState(null);if(w.useEffect(()=>{let i=!1;async function s(){try{const l=await(await fetch("/api/inbox")).json();i||t(l)}catch{}}s();const o=setInterval(s,5e3);return()=>{i=!0,clearInterval(o)}},[]),!e||!e.hasInbox||!((r=e.imports)!=null&&r.length))return null;const n=e.imports.filter(i=>{var o;const s=Object.keys(e.installed||{}).find(a=>a.startsWith(i.replace(/-v[\d.]+$/,"")));return s?((o=e.installed[s])==null?void 0:o.integrated)!==!0:!0});return n.length===0?null:u.jsxs("div",{className:"inbox-card","data-testid":"inbox-card",children:["📦 ",u.jsx("strong",{children:"Component inbox"}),": ",n.length," pending integration",n.length!==1?"s":"",": ",n.join(", "),".",u.jsxs("span",{className:"muted",children:["Ask the agent: ",u.jsxs("em",{children:["“walk me through integrating ",n[0],"”"]})]})]})}function $_(e){return`${Math.round((Number(e)||0)*100)}%`}function H_(e){return`$${(Number(e)||0).toFixed(2)}`}function W_(e){const t=Math.max(0,Math.min(5,Math.round(Number(e)||0)));return"★★★★★".slice(0,t)+"☆☆☆☆☆".slice(0,5-t)}function ml(e){var t,n;return((t=e.producer)==null?void 0:t.handle)==="you"||((n=e.producer)==null?void 0:n.kind)==="me"}function $z(e){const t=`${e.title} ${(e.tags||[]).join(" ")} ${e.pitch||""}`.toLowerCase(),n=[[/match|candidate|recruit|\bhir|screen|talent/,"🎯"],[/\bcv\b|resume|parse|extract/,"📄"],[/kanban|board|pipeline|stage|drag/,"🗂️"],[/deploy|cloudflare|worker|\bhost|ship|edge|serverless/,"🚀"],[/landing|waitlist|subscription|launch|checkout/,"🌱"],[/portfolio|personal site/,"🖼️"],[/receipt|expense|invoice|account/,"🧾"],[/feedback|survey|\bform\b/,"💬"],[/book|slot|appointment|schedul|calendar/,"📅"]];for(const[r,i]of n)if(r.test(t))return i;return"🧩"}function U_(e){var n,r,i,s;const t=(((n=e.reward)==null?void 0:n.unit)||"").toLowerCase();return e.hasService||((r=e.reward)==null?void 0:r.model)==="recurring"||/match|use/.test(t)?"earns per use":((i=e.reward)==null?void 0:i.model)==="one-time"?"one-time reward":(s=e.reward)!=null&&s.model?`${e.reward.model} reward`:null}function Hz(e,t){var n;return t?`I want to build "${e.title}" from my own recipe.`:`I want to build "${e.title}". Use ${((n=e.producer)==null?void 0:n.name)||"the producer"}'s recipe.`}function Wz({theme:e}){const t=(e==null?void 0:e.tokens)||{},n=`radial-gradient(120% 80% at 15% 0%, ${t.canvas1||"#e8f7f0"}, transparent 60%),radial-gradient(120% 90% at 100% 0%, ${t.canvas2||"#e7f0fb"}, transparent 55%),linear-gradient(160deg, ${t.canvas3||"#fef8ee"}, ${t.bg||"#ffffff"} 75%)`;return u.jsxs("div",{className:"bz-theme-swatch",style:{background:n},"aria-hidden":!0,children:[u.jsxs("span",{className:"bz-theme-card",style:{background:t.surface||"#fff",borderColor:t.border||"#e2e6ee"},children:[u.jsx("span",{className:"bz-theme-line",style:{background:t.text||"#1d2430"}}),u.jsx("span",{className:"bz-theme-line short",style:{background:t.textMuted||"#687083"}})]}),u.jsx("span",{className:"bz-theme-dot",style:{background:(e==null?void 0:e.accent)||"#0891b2"}})]})}function Uz({onClose:e,onBuild:t,onApplyTheme:n,onRemixTheme:r,token:i}){const[s,o]=w.useState([]),[a,l]=w.useState(null),[c,d]=w.useState(null),[h,f]=w.useState(!0),[p,m]=w.useState(null),[y,b]=w.useState(null),[_,v]=w.useState(null),[g,S]=w.useState({});async function C(N){if(!g[N.id]){S(z=>({...z,[N.id]:!0}));try{const z={"content-type":"application/json",...i?{Authorization:`Bearer ${i}`}:{}};await fetch(`/api/bazaar/themes/${encodeURIComponent(N.id)}/report`,{method:"POST",headers:z,body:JSON.stringify({reason:""})})}catch{}}}async function x(N){if(!(!n||_)){v(N.id);try{const z=i?{Authorization:`Bearer ${i}`}:{},U=await fetch(`/api/bazaar/themes/${encodeURIComponent(N.id)}/apply`,{method:"POST",headers:z}),D=U.ok?await U.json():null,O=(D==null?void 0:D.theme)||N.theme;O?(n(O),e==null||e()):m("Could not apply that theme.")}catch(z){m(String(z.message||z))}finally{v(null)}}}w.useEffect(()=>{let N=!1;async function z(){try{const[U,D]=await Promise.all([fetch("/api/bazaar/shelf"),fetch("/api/bazaar/state")]);if(N)return;const O=await U.json(),k=await D.json();if(N)return;const Q=(O.recipes||[]).slice().sort((ne,E)=>(E.outcomeScore||0)-(ne.outcomeScore||0));o(Q),d(O.network||null),l(k)}catch(U){N||m(String(U.message||U))}finally{N||f(!1)}}return z(),()=>{N=!0}},[]);const T=c?c.capable?c.lastSyncOk===!1?{tone:"offline",text:"Community looks are offline right now — showing the seeds and your own."}:c.poolCount===0?{tone:"empty",text:"No community looks yet — publish one and you'll be the first."}:{tone:"live",text:`${c.poolCount} ${c.poolCount===1?"look":"looks"} from the community.`}:{tone:"info",text:"Sign in to discover and share looks across VentureWild."}:null,P=((a==null?void 0:a.earnings)||[]).filter(N=>N.total>0),B=s.filter(N=>N.kind==="theme"),j=B.filter(ml),$=s.filter(N=>N.kind!=="theme"),I=$.filter(ml),R=P.find(N=>N.handle==="you"),A=new Set(s.map(N=>{var z,U;return((z=N.producer)==null?void 0:z.handle)||((U=N.producer)==null?void 0:U.name)||"?"})).size;return u.jsx("div",{className:"modal-backdrop",onClick:e,children:u.jsxs("div",{className:"modal bazaar-modal",onClick:N=>N.stopPropagation(),"data-testid":"bazaar-shelf",children:[u.jsxs("div",{className:"bz-store-head",children:[u.jsxs("div",{className:"bz-store-headings",children:[u.jsx("h2",{children:"🛍️ The bazaar"}),u.jsx("p",{className:"muted bz-store-sub",children:"Proven recipes from a network of producers. Your agent reaches onto this shelf for you — ranked by how often each one actually gets a working result, not by marketing."})]}),u.jsxs("div",{className:"bz-store-stats","data-testid":"bazaar-store-stats",children:[u.jsxs("span",{className:"bz-stat",children:[u.jsx("strong",{children:$.length}),"recipes"]}),B.length>0&&u.jsxs("span",{className:"bz-stat",children:[u.jsx("strong",{children:B.length}),"themes"]}),u.jsxs("span",{className:"bz-stat",children:[u.jsx("strong",{children:A}),"producers"]})]})]}),p&&u.jsx("div",{className:"bz-err",children:p}),h&&s.length===0&&u.jsx("div",{className:"muted bz-loading","data-testid":"bazaar-loading",children:"Loading the shelf…"}),I.length>0&&u.jsxs("div",{className:"bz-you-banner","data-testid":"bazaar-you-banner",children:[u.jsx("span",{className:"bz-you-spark",children:"✦"}),u.jsxs("span",{children:["You're a producer here — ",u.jsx("strong",{children:I.length})," ",I.length===1?"of your recipes is":"of your recipes are"," on the shelf",R&&u.jsxs(u.Fragment,{children:[" · earning ",u.jsx("strong",{children:H_(R.total)}),u.jsx("span",{className:"bz-represented",children:" represented"})]})]})]}),B.length>0&&u.jsxs("div",{className:"bz-theme-section","data-testid":"bazaar-themes",children:[u.jsxs("div",{className:"bz-theme-section-head",children:[u.jsx("span",{className:"gallery-section",children:"🎨 themes — make your workspace yours"}),u.jsx("span",{className:"muted bz-theme-section-sub",children:"Pure colour, applies in one tap. The maker earns when you wear it."}),T&&u.jsx("span",{className:`bz-net-note bz-net-${T.tone}`,"data-testid":"bazaar-network-note",children:T.text}),j.length>0&&u.jsx("span",{className:"bz-earn-honesty muted","data-testid":"bazaar-earn-honesty",children:"Your apply counts are tracked on this device — cross-user applies aren't tallied yet."})]}),u.jsx("div",{className:"bz-theme-grid",children:B.map(N=>{var U,D,O;const z=ml(N);return u.jsxs("div",{className:`bz-theme-card-wrap${z?" mine":""}`,"data-testid":`shelf-theme-${N.id}`,children:[u.jsx(Wz,{theme:N.theme}),u.jsxs("div",{className:"bz-theme-meta",children:[u.jsx("span",{className:"bz-theme-title",children:N.title}),u.jsxs("span",{className:"bz-theme-by",children:["by ",((U=N.producer)==null?void 0:U.name)||"a maker",z&&" (you)"]}),N.pitch&&u.jsx("span",{className:"bz-theme-pitch",children:N.pitch}),u.jsxs("div",{className:"bz-theme-foot",children:[((D=N.rating)==null?void 0:D.count)>0&&u.jsx("span",{className:"bz-theme-rating",children:W_(N.rating.stars)}),u.jsxs("span",{className:"bz-reward-pill",children:[H_((O=N.reward)==null?void 0:O.oneTimeValue)," · per apply"]})]})]}),u.jsxs("div",{className:"bz-theme-actions",children:[u.jsx("button",{type:"button",className:"bz-theme-apply","data-testid":`shelf-apply-theme-${N.id}`,disabled:_===N.id,onClick:()=>x(N),children:_===N.id?"Applying…":"Apply"}),r&&N.theme&&u.jsx("button",{type:"button",className:"bz-theme-remix","data-testid":`shelf-remix-theme-${N.id}`,title:"Load this look into the Theme picker to tweak + republish as your own",onClick:()=>{r(N),e==null||e()},children:"✦ Remix"}),N.source==="rails"&&!z&&u.jsx("button",{type:"button",className:"bz-theme-report","data-testid":`shelf-report-theme-${N.id}`,disabled:!!g[N.id],title:"Report this look to VentureWild",onClick:()=>C(N),children:g[N.id]?"Reported ✓":"⚐ Report"})]}),my(N)&&u.jsxs("span",{className:"bz-theme-lineage","data-testid":`shelf-theme-lineage-${N.id}`,children:["remixed from ",my(N)]})]},N.id)})})]}),u.jsx("div",{className:"bz-shelf-grid","data-testid":"bazaar-shelf-grid",children:$.map(N=>{var k,Q,ne,E,ce,_e;const z=ml(N),U=((k=N.outcomeStats)==null?void 0:k.builds)||0,D=U===0||N.safetyBadge==="new",O=y===N.id;return u.jsxs("div",{className:`bz-card${z?" mine":""}${O?" open":""}`,"data-testid":`shelf-recipe-${N.id}`,onClick:()=>b(O?null:N.id),children:[u.jsxs("div",{className:"bz-card-head",children:[u.jsx("span",{className:"bz-card-glyph","aria-hidden":!0,children:$z(N)}),u.jsxs("div",{className:"bz-card-titles",children:[u.jsx("span",{className:"bz-card-title",children:N.title}),u.jsxs("span",{className:"bz-card-by",children:["by ",((Q=N.producer)==null?void 0:Q.name)||"a producer",u.jsx("span",{className:`bz-kind bz-kind-${z?"you":((ne=N.producer)==null?void 0:ne.kind)||"maker"}`,children:z?"you":((E=N.producer)==null?void 0:E.kind)==="vendor"?"vendor":"maker"}),N.hasService&&u.jsx("span",{className:"bz-kind bz-kind-tool",children:"tool"})]})]}),u.jsx("div",{className:"bz-card-score",children:D?u.jsx("span",{className:"bz-new",title:"Just listed — earns its rank by working",children:"NEW"}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"bz-score-pct",children:$_(N.outcomeScore)}),u.jsx("span",{className:"bz-score-label",children:"works"})]})})]}),!D&&u.jsx("div",{className:"bz-score-bar",title:"Measured: how often this recipe reaches a working result",children:u.jsx("i",{style:{width:$_(N.outcomeScore)}})}),N.pitch&&u.jsx("p",{className:"bz-card-pitch",children:N.pitch}),u.jsxs("div",{className:"bz-card-foot",children:[(()=>{const te=NS(N);return te.label!=="New"?u.jsx("span",{className:`bz-badge bz-trust-${te.tone}`,"data-testid":`shelf-trust-${N.id}`,title:te.note||void 0,children:te.label}):null})(),((ce=N.rating)==null?void 0:ce.count)>0&&u.jsxs("span",{className:"bz-card-rating",title:`${N.rating.stars} from ${N.rating.count}`,children:[W_(N.rating.stars)," ",u.jsxs("span",{className:"muted",children:["(",N.rating.count,")"]})]}),U_(N)&&u.jsx("span",{className:"bz-reward-pill",children:U_(N)}),u.jsx("span",{className:"bz-card-expand",children:O?"▾":"▸"})]}),O&&u.jsxs("div",{className:"bz-card-detail","data-testid":`shelf-detail-${N.id}`,children:[N.summary&&u.jsx("p",{className:"bz-detail-summary",children:N.summary}),!D&&U>0&&u.jsxs("p",{className:"muted bz-detail-stat",children:[N.outcomeStats.working," of ",U," builds reached a working result."]}),u.jsxs("p",{className:"bz-detail-hint",children:["Your agent builds this for you and credits"," ",z?"you":((_e=N.producer)==null?void 0:_e.name)||"the producer"," when it does."]}),t&&u.jsx("button",{type:"button",className:"bz-build-btn","data-testid":`shelf-build-${N.id}`,onClick:te=>{te.stopPropagation(),t(Hz(N,z))},children:"Build this →"})]})]},N.id)})}),u.jsx("div",{className:"actions",children:u.jsx("button",{onClick:e,"data-testid":"bazaar-shelf-close",children:"Close"})})]})})}const Vz=[{id:"concise",label:"Concise",sample:"Got it. Done."},{id:"playful",label:"Playful",sample:"Oh nice — let's go!"},{id:"formal",label:"Formal",sample:"Understood. Proceeding now."},{id:"dry",label:"Dry",sample:"Sure. If we must."}],V_=["#22d3ee","#a78bfa","#f472b6","#facc15","#34d399","#fb7185"],qz=[{id:"drive",label:"Google Drive",note:"Files & docs"},{id:"notion",label:"Notion",note:"Wiki & notes"},{id:"gmail",label:"Gmail",note:"Inbox & threads"},{id:"calendar",label:"Calendar",note:"Schedule"},{id:"canva",label:"Canva",note:"Designs"},{id:"github",label:"GitHub",note:"Code & PRs"}],Kz=new Set(["login","missing","subscribe"]),Yz=new Set(["login","missing"]),q_={missing:{title:"Almost there — I need Claude installed before I can think.",subtitle:"That's the brain I run on. Install it once, then come back here.",cmdLabel:"Run this in your terminal",cmd:"curl -fsSL https://claude.ai/install.sh | bash",after:"Then come back and press the button below.",retry:"Still don't see Claude on this machine. Make sure the install finished, then try again."},login:{title:"One quick thing before we dig in — sign me in to Claude.",subtitle:"It's a one-time sign-in to your own Claude account — it runs on your machine, on your plan. After this you won't be asked again.",cmdLabel:"Run this once in your terminal",cmd:"claude auth login",after:"A browser window opens — sign in with your Claude account, then come back and press the button.",retry:"Hmm — still not signed in. Finish the sign-in in your browser, then press it again."},subscribe:{title:"You're in — I just need an active Claude plan to start thinking.",subtitle:"Claude Code runs on a Claude Pro plan (or higher). Grab one on your own account, then come back — you won’t be asked again.",cmdLabel:"Get a plan, then come back",link:"https://claude.ai/upgrade",linkLabel:"Open claude.ai →",after:"Subscribe at claude.ai, then come back and press the button.",retry:"Still no active plan showing. Give it a moment after subscribing, then try again."}},Gz=new Set(["md","txt","json","yml","yaml","toml","js","mjs","cjs","ts","tsx","jsx","py","rb","go","rs","java","kt","swift","c","h","cpp","cc","hpp","css","scss","html","sh","env","sql","xml","svg","csv"]);function Xz(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t+1).toLowerCase():""}function Jz(e){if(!e)return null;try{const t=new URL(e);return t.hostname==="localhost"||t.hostname==="127.0.0.1"?null:t.protocol==="http:"&&(t.port===""||t.port==="80")||t.protocol==="https:"&&(t.port===""||t.port==="443")?t.hostname:`${t.hostname}:${t.port}`}catch{return null}}async function Zz(e){const t=Array.from(e||[]).slice(0,200);if(t.length===0)return{folderName:null,files:[]};const n=(t[0].webkitRelativePath||t[0].name).split("/")[0]||"folder",r=40,i=600,s=[];for(const a of t){if(s.length>=r)break;const l=a.webkitRelativePath||a.name,c=Xz(a.name);if(!Gz.has(c)){s.push({path:l,head:""});continue}if(a.size>100*1024){s.push({path:l,head:""});continue}try{const f=await a.slice(0,i).text();s.push({path:l,head:f})}catch{s.push({path:l,head:""})}}const o=Math.max(t.length-s.length,0);return{folderName:n,files:s,totalFiles:t.length,untouched:o}}function Qz({peekSummary:e,services:t,agentName:n}){const r=[],i=e!=null&&e.folderName?` (you just glanced at "${e.folderName}")`:"";return r.push({kind:"survey",title:"Tell me what's in my workspace",sub:e!=null&&e.folderName?"I'll read the workspace I'm running in and summarize.":"I'll read what's here and summarize the project."}),(t==null?void 0:t.size)>0?r.push({kind:"startup",title:"Help me start something new",sub:`${n} will ask one question to figure out what to build.`}):r.push({kind:"startup",title:"Help me start a project",sub:"Tell me the rough idea — I'll scaffold it."}),r.push({kind:"chat",title:"Just chat — find me work",sub:"No agenda yet. Get me into the workspace."}),r}function K_(e,t=55,n=380){const[r,i]=w.useState(""),[s,o]=w.useState(!1),[a,l]=w.useState(!1);return w.useEffect(()=>{if(!e){i(""),o(!1),l(!1);return}i(""),o(!1),l(!1);let c=0,d=null;const h=setTimeout(()=>{l(!0),d=setInterval(()=>{c+=1,i(e.slice(0,c)),c>=e.length&&(clearInterval(d),o(!0))},t)},n);return()=>{clearTimeout(h),d&&clearInterval(d)}},[e,t,n]),[r,s,a]}function si({children:e,from:t="agent",accent:n,streaming:r=!1}){return u.jsx("div",{className:`ob-bubble ob-bubble-${t}${r?" ob-bubble-streaming":""}`,style:t==="user"?{borderColor:n}:void 0,children:e})}function _s(){return u.jsx("span",{className:"ob-caret","aria-hidden":"true",children:"▍"})}function Y_(e){const t=Math.random().toString(36).slice(2,8);return`${e}-${Date.now().toString(36)}-${t}`}function eB({session:e,token:t,onComplete:n}){var lt,St,Nt,it;const[r,i]=w.useState(1),s=w.useMemo(()=>Jz(e==null?void 0:e.shareBaseUrl),[e==null?void 0:e.shareBaseUrl]),[o,a]=w.useState(((lt=e==null?void 0:e.identity)==null?void 0:lt.name)||""),[l,c]=w.useState(((St=e==null?void 0:e.identity)==null?void 0:St.tone)||"concise"),[d,h]=w.useState(((Nt=e==null?void 0:e.identity)==null?void 0:Nt.color)||V_[0]),[f,p]=w.useState(!1),[m,y]=w.useState(null),[b,_]=w.useState(null),[v,g]=w.useState(!1),[S,C]=w.useState(!1),[x,T]=w.useState(null),[P,B]=w.useState(""),[j,$]=w.useState(new Set(((it=e==null?void 0:e.identity)==null?void 0:it.connectedServices)||[])),[I,R]=w.useState(!1),[A,N]=w.useState(null),[z,U]=w.useState(null),[D,O]=w.useState(!1),k=w.useRef(null),Q=w.useRef(null),ne=w.useRef({}),[E,ce]=w.useState({}),_e=w.useCallback((F,ie,ve)=>{F&&ce(xe=>{const J=xe[F]||{text:"",done:!1,error:null},ke=ie==="text"?J.text+(ve||""):J.text,de={...xe,[F]:{...J,text:ke}};return ne.current[F]=ke,de})},[]),te=w.useCallback((F,ie)=>{F&&ce(ve=>{const xe=ve[F]||{text:"",done:!1,error:null};return{...ve,[F]:{...xe,done:!0,error:ie||xe.error}}})},[]);w.useEffect(()=>{let F=!1,ie=0,ve=null,xe=null;const J=()=>{if(F)return;const ke=window.location.protocol==="https:"?"wss":"ws",de=new URL(`${ke}://${window.location.host}/ws/chat`);t&&de.searchParams.set("t",t),xe=new WebSocket(de.toString()),Q.current=xe,xe.onmessage=je=>{var Re;let Ee;try{Ee=JSON.parse(je.data)}catch{return}Ee.type==="chunk"&&((Re=Ee.chunk)==null?void 0:Re.type)==="text"?_e(Ee.messageId,"text",Ee.chunk.text):Ee.type==="end"?te(Ee.messageId,null):Ee.type==="error"&&te(Ee.messageId,Ee.message||"agent error")},xe.onopen=()=>{ie=0},xe.onclose=()=>{if(Q.current=null,F)return;const je=Math.min(1e3*2**ie,8e3);ie+=1,ve=setTimeout(J,je)},xe.onerror=()=>{}};return J(),()=>{F=!0,clearTimeout(ve);try{xe==null||xe.close()}catch{}}},[t,_e,te]),w.useEffect(()=>{document.documentElement.style.setProperty("--accent",d),document.documentElement.style.setProperty("--accent-hot",d)},[d]);const ae=w.useMemo(()=>{const F={"content-type":"application/json"};return t&&(F.Authorization=`Bearer ${t}`),F},[t]);async function se(F){const ie=await fetch("/api/agent/identity",{method:"POST",headers:ae,body:JSON.stringify({name:o,tone:l,color:d,...F})});if(!ie.ok){const ve=await ie.json().catch(()=>({}));throw new Error(ve.error||`save failed (${ie.status})`)}return ie.json()}const he=w.useCallback(async(F=!1)=>{g(!0);try{const ie=await fetch(`/api/agent/readiness${F?"?fresh=1":""}`,{headers:ae});return ie.ok?await ie.json():{status:"unknown"}}catch{return{status:"unknown"}}finally{g(!1)}},[ae]);async function Pe(){if(y(null),!o.trim()){y("Pick a name — even just one syllable.");return}p(!0);try{await se({});const F=await he(!1);if(Kz.has(F.status)){_(F);return}i(2)}catch(F){y(String(F.message||F))}finally{p(!1)}}async function be(){const F=await he(!0);if(C(!0),F.status==="login"||F.status==="missing"){_(F);return}_(null),i(2)}async function Se(){const F=await he(!0);if(F.status==="ready"||F.status==="unknown"){T(null),_(null),i(2);return}T(null),_(F)}async function L(){C(!1),T({status:"starting",url:null,error:null});try{const ie=await(await fetch("/api/agent/login/start",{method:"POST",headers:ae})).json();T(ie),ie.status==="success"&&Se()}catch{T({status:"error",url:null,error:"Could not start sign-in."})}}async function ge(){const F=P.trim();if(F){B("");try{const ie=await fetch("/api/agent/login/code",{method:"POST",headers:{...ae,"content-type":"application/json"},body:JSON.stringify({code:F})});T(await ie.json())}catch{}}}w.useEffect(()=>{if(!(x&&["starting","awaiting-browser","awaiting-code"].includes(x.status)))return;let ie=!0;const ve=setInterval(async()=>{try{const J=await(await fetch("/api/agent/login/status",{headers:ae})).json();if(!ie)return;T(J),J.status==="success"&&(clearInterval(ve),Se())}catch{}},2e3);return()=>{ie=!1,clearInterval(ve)}},[x==null?void 0:x.status,ae]);const[oe,ye]=w.useState(null),Te=oe?E[oe]:null;async function Le(F){if(U(null),!(!F||F.length===0)){R(!0);try{const ie=await Zz(F);if(ie.files.length===0){U("That folder looks empty — try another?"),R(!1);return}N(ie);const ve=Y_("peek");ye(ve),ce(J=>({...J,[ve]:{text:"",done:!1,error:null}}));const xe=await fetch("/api/onboarding/peek",{method:"POST",headers:ae,body:JSON.stringify({folderName:ie.folderName,files:ie.files,totalFiles:ie.totalFiles,messageId:ve})});if(!xe.ok){const J=await xe.json().catch(()=>({}));throw new Error(J.error||`peek failed (${xe.status})`)}}catch(ie){U(String(ie.message||ie))}finally{R(!1)}}}function Y(F){$(ie=>{const ve=new Set(ie);return ve.has(F)?ve.delete(F):ve.add(F),ve})}const[pe,Ae]=w.useState(null),[Ke,Et]=w.useState(null),[ir,pt]=w.useState(null),M=pe?E[pe]:null,[H,ue]=w.useState(null),[Ce,De]=w.useState(!1);async function nt(){pt(null),Et("remix"),De(!0);try{const ve=((await(await fetch("/api/bazaar/shelf",{headers:ae})).json()).recipes||[]).slice().sort((xe,J)=>(J.outcomeScore||0)-(xe.outcomeScore||0)).slice(0,3);ue(ve)}catch{ue([])}finally{De(!1)}}async function mt(F){var ve;const ie=`Build me “${F.title}”. Use ${((ve=F.producer)==null?void 0:ve.name)||"the producer"}'s recipe.`;try{await se({connectedServices:[...j]}),await fetch("/api/agent/onboarded",{method:"POST",headers:ae}),n==null||n({build:ie})}catch(xe){pt(String(xe.message||xe))}}async function Dt(F){pt(null),Et(F);const ie=Y_("job");Ae(ie),ce(ve=>({...ve,[ie]:{text:"",done:!1,error:null}}));try{await se({connectedServices:[...j]});const ve=await fetch("/api/onboarding/start-job",{method:"POST",headers:ae,body:JSON.stringify({kind:F,messageId:ie,peekFolderName:(A==null?void 0:A.folderName)||null})});if(!ve.ok){const xe=await ve.json().catch(()=>({}));throw new Error(xe.error||`start-job failed (${ve.status})`)}}catch(ve){pt(String(ve.message||ve)),Ae(null),Et(null)}}async function sn(){var F;try{await se({connectedServices:[...j]});const ie=await fetch("/api/agent/onboarded",{method:"POST",headers:ae});if(!ie.ok){const xe=await ie.json().catch(()=>({}));throw new Error(xe.error||`mark-onboarded failed (${ie.status})`)}let ve=null;if(pe&&(M!=null&&M.done)&&M.text&&!M.error){const xe=((F=Ve.find(J=>J.kind===Ke))==null?void 0:F.title)||"Let’s get started";ve={messageId:pe,userText:xe,agentText:M.text}}n==null||n(ve?{seedChat:ve}:void 0)}catch(ie){y(String(ie.message||ie))}}const Ot=o.trim()||"your agent",at="Hey. I'm new here.",rt="Before we start — what should I call myself?",[Vt,Hn]=K_(r===1?at:"",65,420),[Wn,gr]=K_(r===1&&Hn?rt:"",48,520),Ue=r===1?gr:!0,Ve=w.useMemo(()=>Qz({peekSummary:A,services:j,agentName:Ot}),[A,j,Ot]),$e=b?q_[b.status]||q_.login:null,Ge=b?Yz.has(b.status):!1;return u.jsx("div",{className:"ob-root",children:u.jsxs("div",{className:"ob-stage",children:[u.jsxs("div",{className:"ob-brand",children:[u.jsx("span",{className:"ob-brand-mark",children:"✦"})," VentureWild"]}),u.jsxs("header",{className:"ob-header",children:[u.jsx("div",{className:"ob-step-dots","aria-label":`Step ${r} of 4`,children:[1,2,3,4].map(F=>u.jsx("span",{className:`ob-dot ${F===r?"active":""} ${F<r?"done":""}`},F))}),r>1&&!b&&u.jsx("button",{className:"ob-back",onClick:()=>i(r-1),children:"← Back"})]}),b&&$e&&u.jsxs("section",{className:"ob-step",children:[u.jsxs(si,{children:[u.jsx("p",{className:"ob-bubble-text",children:$e.title}),u.jsx("p",{className:"ob-bubble-subtle",children:$e.subtitle})]}),u.jsxs("div",{className:"ob-card ob-reveal",children:[b.status==="login"?u.jsxs("div",{className:"ob-login-inapp",children:[(!x||x.status==="idle")&&u.jsx("button",{className:"ob-next primary",onClick:L,children:"Sign in to Claude →"}),x&&(x.status==="starting"||x.status==="awaiting-browser")&&u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"ob-bubble-text",children:"Opening Claude in your browser…"}),u.jsx("p",{className:"ob-bubble-subtle",children:"Sign in there with your Claude account — I'll detect it automatically, nothing to come back and click."}),x.url&&u.jsx("a",{className:"ob-login-link",href:x.url,target:"_blank",rel:"noreferrer",children:"If the browser didn't open, click here →"})]}),x&&x.status==="awaiting-code"&&u.jsxs("div",{className:"ob-login-code",children:[u.jsx("label",{className:"ob-label",children:"Paste the code from your browser"}),u.jsxs("div",{className:"ob-actions",children:[u.jsx("input",{className:"ob-input",value:P,onChange:F=>B(F.target.value),placeholder:"code from claude.ai"}),u.jsx("button",{className:"ob-next primary",onClick:ge,children:"Submit"})]})]}),x&&(x.status==="error"||x.status==="unsupported")&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"ob-error",children:[x.error||"I couldn't run the in-app sign-in."," You can sign in from a terminal instead:"]}),u.jsx("div",{className:"ob-login-cmd",children:u.jsx("code",{children:$e.cmd})}),u.jsx("p",{className:"ob-bubble-subtle",style:{marginTop:10},children:$e.after})]})]}):u.jsxs(u.Fragment,{children:[u.jsx("label",{className:"ob-label",children:$e.cmdLabel}),$e.cmd?u.jsx("div",{className:"ob-login-cmd",children:u.jsx("code",{children:$e.cmd})}):u.jsx("a",{className:"ob-login-link",href:$e.link,target:"_blank",rel:"noreferrer",children:$e.linkLabel}),u.jsx("p",{className:"ob-bubble-subtle",style:{marginTop:10},children:$e.after})]}),S&&u.jsx("div",{className:"ob-error",style:{marginTop:12},children:$e.retry}),u.jsx("div",{className:"ob-actions",children:u.jsx("button",{className:"ob-next primary",onClick:be,disabled:v,children:v?"Checking…":"I've done it — continue →"})}),!Ge&&u.jsx("div",{className:"ob-actions",children:u.jsx("button",{className:"ob-skip",onClick:()=>{_(null),i(2)},children:"I already have a plan — continue"})})]})]}),r===1&&!b&&u.jsxs("section",{className:"ob-step",children:[u.jsxs(si,{streaming:!Hn||!gr,children:[u.jsxs("p",{className:"ob-bubble-text",children:[Vt,!Hn&&u.jsx(_s,{})]}),Hn&&u.jsxs("p",{className:"ob-bubble-text",children:[Wn,!gr&&u.jsx(_s,{})]})]}),Ue&&u.jsxs("div",{className:"ob-card ob-reveal",children:[u.jsx("label",{className:"ob-label",children:"Name"}),u.jsx("input",{autoFocus:!0,className:"ob-input",placeholder:"Echo, Pip, Atlas, Sage…",value:o,onChange:F=>a(F.target.value),onKeyDown:F=>{F.key==="Enter"&&Pe()},maxLength:40}),u.jsx("label",{className:"ob-label",children:"Voice"}),u.jsx("div",{className:"ob-tone-grid",children:Vz.map(F=>u.jsxs("button",{className:`ob-tone ${l===F.id?"selected":""}`,onClick:()=>c(F.id),children:[u.jsx("span",{className:"ob-tone-label",children:F.label}),u.jsx("span",{className:"ob-tone-sample",children:F.sample})]},F.id))}),u.jsx("label",{className:"ob-label",children:"Color"}),u.jsx("div",{className:"ob-color-row",children:V_.map(F=>u.jsx("button",{className:`ob-color-swatch ${d===F?"selected":""}`,style:{background:F},onClick:()=>h(F),"aria-label":`Pick ${F}`},F))}),m&&u.jsx("div",{className:"ob-error",children:m}),u.jsx("div",{className:"ob-actions",children:u.jsx("button",{className:"ob-next primary",onClick:Pe,disabled:f||!o.trim(),children:f?"Saving…":`I'm ${Ot}. Let's go →`})})]})]}),r===2&&u.jsxs("section",{className:"ob-step",children:[u.jsxs(si,{children:[u.jsx("p",{className:"ob-bubble-text",children:"Cool. Now — show me something you're working on. Drag a folder onto me."}),u.jsx("p",{className:"ob-bubble-subtle",children:"I'll read filenames + a short sample of each text file (≤40 files, ≤600 bytes each) so I can react. Files stay on your machine; the sample goes to Anthropic the same way every chat turn does. Pick something you'd be OK talking about in chat."})]}),u.jsxs("div",{className:`ob-dropzone ${D?"over":""} ${I?"peeking":""}`,onDragOver:F=>{F.preventDefault(),O(!0)},onDragLeave:()=>O(!1),onDrop:async F=>{var ve,xe;F.preventDefault(),O(!1);const ie=(ve=F.dataTransfer)==null?void 0:ve.items;if(ie&&ie.length>0&&ie[0].webkitGetAsEntry){const J=[],ke=async(de,je="")=>{if(de.isFile)await new Promise(Ee=>de.file(Re=>{try{Object.defineProperty(Re,"webkitRelativePath",{value:`${je}${Re.name}`})}catch{}J.push(Re),Ee()},Ee));else if(de.isDirectory){const Ee=de.createReader();await new Promise(Re=>Ee.readEntries(async Je=>{for(const gt of Je)await ke(gt,`${je}${de.name}/`);Re()},Re))}};for(const de of ie){const je=de.webkitGetAsEntry();je&&await ke(je)}if(J.length>0){await Le(J);return}}await Le((xe=F.dataTransfer)==null?void 0:xe.files)},onClick:()=>{var F;return(F=k.current)==null?void 0:F.click()},children:[u.jsx("input",{ref:k,type:"file",webkitdirectory:"",directory:"",multiple:!0,style:{display:"none"},onChange:F=>Le(F.target.files)}),I?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"ob-drop-icon",children:"👀"}),u.jsx("div",{className:"ob-drop-title",children:"Looking…"})]}):A?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"ob-drop-icon",children:"📁"}),u.jsx("div",{className:"ob-drop-title",children:A.folderName}),u.jsxs("div",{className:"ob-drop-sub",children:[A.totalFiles," file",A.totalFiles===1?"":"s"," · sampled ",A.files.length]})]}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"ob-drop-icon",children:"📂"}),u.jsx("div",{className:"ob-drop-title",children:"Drop a folder here"}),u.jsx("div",{className:"ob-drop-sub",children:"or click to pick one"})]})]}),Te&&u.jsxs(si,{streaming:!Te.done,children:[Te.text?u.jsxs("p",{className:"ob-bubble-text",children:[Te.text,!Te.done&&u.jsx(_s,{})]}):u.jsxs("p",{className:"ob-bubble-subtle",children:["👀 ",Ot," is reading…",!Te.done&&u.jsx(_s,{})]}),Te.error&&u.jsx("p",{className:"ob-bubble-subtle ob-bubble-error",children:Te.error})]}),z&&u.jsx("div",{className:"ob-error",children:z}),u.jsxs("div",{className:"ob-actions",children:[u.jsx("button",{className:"ob-skip",onClick:()=>i(3),children:"Skip — I'd rather just chat"}),u.jsx("button",{className:"ob-next primary",onClick:()=>i(3),disabled:!A&&!z,children:"Next →"})]})]}),r===3&&u.jsxs("section",{className:"ob-step",children:[u.jsxs(si,{children:[u.jsx("p",{className:"ob-bubble-text",children:"Anything I should keep an eye on?"}),u.jsx("p",{className:"ob-bubble-subtle",children:"Totally optional. Flag what lives in your world and I'll wire it up when these land — you can always add more later."})]}),u.jsx("div",{className:"ob-tile-grid",children:qz.map(F=>u.jsxs("button",{className:`ob-tile ${j.has(F.id)?"selected":""}`,onClick:()=>Y(F.id),children:[u.jsx("span",{className:"ob-tile-label",children:F.label}),u.jsx("span",{className:"ob-tile-note",children:F.note}),j.has(F.id)&&u.jsx("span",{className:"ob-tile-check",children:"✓"})]},F.id))}),u.jsxs("div",{className:"ob-soon",children:["These connection flows are landing soon — your picks are saved. And I don't live on one device:",s?u.jsxs(u.Fragment,{children:[" open ",u.jsx("code",{children:s})," on your phone with the same login"]}):u.jsx(u.Fragment,{children:" sign in on any device with the same login"})," ","and I'm right there — same memory, same conversation."]}),u.jsxs("div",{className:"ob-actions",children:[u.jsx("button",{className:"ob-skip",onClick:()=>i(4),children:"Skip →"}),u.jsx("button",{className:"ob-next primary",onClick:()=>i(4),children:"Next: first job →"})]})]}),r===4&&u.jsxs("section",{className:"ob-step",children:[u.jsxs(si,{children:[u.jsx("p",{className:"ob-bubble-text",children:"Right — what should I actually do for you first?"}),u.jsx("p",{className:"ob-bubble-subtle",children:"Pick one and I'll start now. Or close this and just talk to me."})]}),H?u.jsxs("div",{className:"ob-remix",children:[u.jsx(si,{children:u.jsx("p",{className:"ob-bubble-text",children:"Here's what other builders already got working. Pick one — I'll build it for you the moment you land in your workspace."})}),H.length===0?u.jsx("div",{className:"ob-error",children:"The shelf is empty right now — start from scratch instead."}):H.map(F=>{var ie;return u.jsxs("button",{className:"ob-remix-card",onClick:()=>mt(F),children:[u.jsxs("div",{className:"ob-remix-main",children:[u.jsx("span",{className:"ob-remix-title",children:F.title}),u.jsxs("span",{className:"ob-remix-by",children:["by ",((ie=F.producer)==null?void 0:ie.name)||"a builder"]}),F.pitch&&u.jsx("span",{className:"ob-remix-pitch",children:F.pitch})]}),u.jsxs("div",{className:"ob-remix-stat",children:[u.jsxs("span",{className:"ob-remix-pct",children:[Math.round((F.outcomeScore||0)*100),"%"]}),u.jsx("span",{className:"ob-remix-pct-sub",children:"worked"})]})]},F.id)}),u.jsx("div",{className:"ob-actions",children:u.jsx("button",{className:"ob-skip",onClick:()=>{ue(null),Et(null)},children:"← Pick a different job"})})]}):pe?u.jsxs(u.Fragment,{children:[u.jsxs(si,{streaming:!M||!M.done,children:[M!=null&&M.text?u.jsxs("p",{className:"ob-bubble-text",children:[M.text,!M.done&&u.jsx(_s,{})]}):u.jsxs("p",{className:"ob-bubble-subtle",children:[Ot," is on it…",(!M||!M.done)&&u.jsx(_s,{})]}),(M==null?void 0:M.error)&&u.jsx("p",{className:"ob-bubble-subtle ob-bubble-error",children:M.error})]}),u.jsxs("div",{className:"ob-actions",children:[u.jsx("button",{className:"ob-skip",onClick:()=>{Ae(null),Et(null)},children:"← Pick a different job"}),u.jsx("button",{className:"ob-next primary",onClick:sn,disabled:!M||!M.done&&!M.error,children:M!=null&&M.done?"Open my workspace →":"Streaming…"})]})]}):u.jsxs("div",{className:"ob-jobs",children:[u.jsxs("button",{className:"ob-job ob-job-remix",onClick:nt,disabled:Ce,children:[u.jsx("div",{className:"ob-job-title",children:"✦ Remix a proven build"}),u.jsx("div",{className:"ob-job-sub",children:Ce?"Pulling up what others have made…":"Start from something other builders already got working — I'll build one for you now."})]}),Ve.map(F=>u.jsxs("button",{className:"ob-job",onClick:()=>Dt(F.kind),children:[u.jsx("div",{className:"ob-job-title",children:F.title}),u.jsx("div",{className:"ob-job-sub",children:F.sub})]},F.kind))]}),(m||ir)&&u.jsx("div",{className:"ob-error",children:m||ir}),!pe&&!H&&u.jsx("div",{className:"ob-actions",children:u.jsx("button",{className:"ob-skip",onClick:sn,children:"Skip to chat →"})})]}),!b&&u.jsx("p",{className:"ob-consent-note",children:"I quietly share how I'm doing — what's working, what breaks, my setup health — with the Venturewild team so they can help if you ever get stuck. Never your words or files. You can turn this off anytime."})]})})}const tB={display:"grid",placeItems:"center",minHeight:"100vh",padding:24,textAlign:"center"},nB={maxWidth:420,display:"grid",gap:16,justifyItems:"center"},rB={fontSize:44,letterSpacing:"0.18em",fontWeight:700,fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",color:"var(--accent, #22d3ee)"};function iB(e){return e&&e.length===6?`${e.slice(0,3)} ${e.slice(3)}`:e}function G_(e=typeof window<"u"?window.location:null){if(!e)return null;const t=String(e.hostname||"");if(!t.endsWith(".venturewild.llc"))return null;const n=t.split(".")[0];return n?`https://sync.venturewild.llc/auth/google/start?slug=${encodeURIComponent(n)}`:null}const sB={display:"inline-flex",alignItems:"center",gap:10,padding:"11px 18px",borderRadius:10,background:"#fff",color:"#1f2937",fontWeight:600,textDecoration:"none",border:"1px solid #dadce0",boxShadow:"0 1px 2px rgba(0,0,0,0.08)"};function oB(){const[e,t]=w.useState("starting"),[n,r]=w.useState(null),[i,s]=w.useState(null),[o,a]=w.useState(0),[l,c]=w.useState(0),d=w.useRef({requestId:null,pollAfterMs:2500}),h=w.useCallback(async()=>{t("starting"),r(null);try{const f=await fetch("/api/auth/pair/start",{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(f.status===429){t("error"),r("Too many sign-in attempts right now. Wait a minute, then try again.");return}if(!f.ok){t("error"),r("Could not start sign-in. Please try again.");return}const p=await f.json();d.current={requestId:p.requestId,pollAfterMs:p.pollAfterMs||2500},s(p.code),a(p.expiresAt||0),t("waiting")}catch{t("error"),r("Network error. Check your connection and try again.")}},[]);return w.useEffect(()=>{h()},[h]),w.useEffect(()=>{if(e!=="waiting")return;let f=!1,p=null;const{requestId:m,pollAfterMs:y}=d.current;async function b(){try{const _=await fetch("/api/auth/pair/status",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({requestId:m})});if(f)return;const v=await _.json().catch(()=>({}));if(v.status==="approved"&&v.token){if((await fetch("/api/auth/exchange",{method:"POST",headers:{Authorization:`Bearer ${v.token}`}})).ok){window.location.reload();return}t("error"),r("Almost there — sign-in completed but the session could not be saved. Try again.");return}if(v.status==="denied"){t("error"),r("This device was denied.");return}if(v.status==="expired"){t("error"),r("The code expired before it was approved.");return}p=setTimeout(b,y)}catch{f||(p=setTimeout(b,y))}}return p=setTimeout(b,y),()=>{f=!0,clearTimeout(p)}},[e]),w.useEffect(()=>{if(e!=="waiting"||!o)return;const f=()=>c(Math.max(0,Math.round((o-Date.now())/1e3)));f();const p=setInterval(f,1e3);return()=>clearInterval(p)},[e,o]),u.jsx("div",{className:"app",style:{gridTemplateRows:"1fr"},children:u.jsx("div",{style:tB,children:u.jsxs("div",{style:nB,children:[u.jsx("h2",{style:{margin:0},children:"Sign in to this workspace"}),G_()&&u.jsxs(u.Fragment,{children:[u.jsxs("a",{href:G_(),style:sB,"data-testid":"google-signin",children:[u.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18","aria-hidden":"true",children:[u.jsx("path",{fill:"#4285F4",d:"M17.64 9.2c0-.64-.06-1.25-.16-1.84H9v3.48h4.84a4.14 4.14 0 0 1-1.8 2.72v2.26h2.92c1.71-1.57 2.68-3.89 2.68-6.62z"}),u.jsx("path",{fill:"#34A853",d:"M9 18c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.81.54-1.84.86-3.04.86-2.34 0-4.32-1.58-5.03-3.7H.96v2.33A9 9 0 0 0 9 18z"}),u.jsx("path",{fill:"#FBBC05",d:"M3.97 10.72A5.41 5.41 0 0 1 3.68 9c0-.6.1-1.18.29-1.72V4.95H.96A9 9 0 0 0 0 9c0 1.45.35 2.82.96 4.05l3.01-2.33z"}),u.jsx("path",{fill:"#EA4335",d:"M9 3.58c1.32 0 2.5.45 3.44 1.35l2.58-2.59C13.46.89 11.43 0 9 0A9 9 0 0 0 .96 4.95l3.01 2.33C4.68 5.16 6.66 3.58 9 3.58z"})]}),"Continue with Google"]}),u.jsx("div",{style:{color:"var(--text-muted)",fontSize:12},children:"or approve from another device you’re signed in on:"})]}),e==="starting"&&u.jsxs("p",{style:{color:"var(--text-muted)"},children:[u.jsx("span",{className:"spinner"})," Preparing…"]}),e==="waiting"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{style:{color:"var(--text-muted)",margin:0},children:"On a device where you’re already signed in, open this workspace and approve this code:"}),u.jsx("div",{style:rB,"data-testid":"pair-code",children:iB(i)}),u.jsxs("p",{style:{color:"var(--text-muted)",fontSize:13,margin:0},children:["Waiting for approval",l?` · expires in ${l}s`:"","…"]})]}),e==="error"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{style:{color:"var(--error)"},children:n}),u.jsx("button",{onClick:h,children:"Try again"})]})]})})})}const aB={position:"fixed",top:12,left:"50%",transform:"translateX(-50%)",zIndex:1e3,background:"var(--surface, #1e293b)",border:"1px solid var(--accent, #22d3ee)",borderRadius:10,padding:"12px 16px",boxShadow:"0 8px 24px rgba(0,0,0,0.35)",display:"grid",gap:10,maxWidth:460},lB={display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},cB={fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",letterSpacing:"0.12em",fontWeight:700,color:"var(--accent, #22d3ee)"};function uB(e){return e&&e.length===6?`${e.slice(0,3)} ${e.slice(3)}`:e}function hB({token:e}){const[t,n]=w.useState([]),[r,i]=w.useState(null),[s,o]=w.useState(null),a=w.useRef(!0),l=w.useCallback((h={})=>e?{Authorization:`Bearer ${e}`,...h}:h,[e]),c=w.useCallback(async()=>{try{const h=await fetch("/api/auth/pair/requests",{headers:l()});if(!h.ok)return;const f=await h.json();a.current&&n(Array.isArray(f.requests)?f.requests:[])}catch{}},[l]);w.useEffect(()=>{a.current=!0,c();const h=setInterval(c,5e3);return()=>{a.current=!1,clearInterval(h)}},[c]);async function d(h,f,p){if(!r){i(h),o(null);try{const m=await fetch(`/api/auth/pair/${f}`,{method:"POST",headers:l({"content-type":"application/json"}),body:JSON.stringify({requestId:h})});m.ok&&f==="approve"?o({ok:!0,text:`Approved ${p}.`}):m.ok||o({ok:!1,text:"That request is no longer waiting."})}catch{o({ok:!1,text:"Network error."})}finally{i(null),c()}}}return t.length===0?null:u.jsxs("div",{style:aB,"data-testid":"pair-approvals",children:[u.jsx("strong",{style:{fontSize:13},children:t.length===1?"A device wants to sign in":`${t.length} devices want to sign in`}),u.jsx("span",{style:{fontSize:12,color:"var(--text-muted)"},children:"Check that the code matches the one on that device, then approve."}),t.map(h=>u.jsxs("div",{style:lB,children:[u.jsx("span",{style:{fontSize:13},children:h.label}),u.jsx("span",{style:cB,"data-testid":"pair-request-code",children:uB(h.code)}),u.jsx("span",{className:"spacer",style:{flex:1}}),u.jsx("button",{onClick:()=>d(h.requestId,"approve",h.label),disabled:r===h.requestId,"data-testid":"pair-approve-btn",children:r===h.requestId?"Approving…":"Approve"}),u.jsx("button",{onClick:()=>d(h.requestId,"deny",h.label),disabled:r===h.requestId,style:{background:"transparent",color:"var(--text-muted)"},children:"Deny"})]},h.requestId)),s&&u.jsx("span",{style:{fontSize:12,color:s.ok?"var(--accent, #22d3ee)":"var(--error)"},children:s.text})]})}const dB=15e3,fB=2500;function pB(e){const t=Math.round(e/6e4);return t<=0?"expiring":t<60?`${t} min`:`${Math.floor(t/60)}h ${t%60}m`}function mB({token:e}){var g;const[t,n]=w.useState(null),[r,i]=w.useState(!1),[s,o]=w.useState(!1),a=w.useRef(null),l=w.useRef(null),c=w.useCallback(()=>e?{Authorization:`Bearer ${e}`}:{},[e]),d=w.useCallback(async()=>{try{const S=await fetch("/api/support/status",{headers:c()});if(!S.ok)return;n(await S.json())}catch{}},[c]),h=!!((g=t==null?void 0:t.operate)!=null&&g.active);w.useEffect(()=>{d();const S=h?fB:dB;return a.current=setInterval(d,S),()=>clearInterval(a.current)},[d,h]),w.useLayoutEffect(()=>{const S=()=>{const C=l.current?l.current.offsetHeight:0;document.documentElement.style.setProperty("--support-banner-h",`${C}px`)};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)}),w.useEffect(()=>()=>document.documentElement.style.setProperty("--support-banner-h","0px"),[]);const f=w.useCallback(async()=>{i(!0);try{await fetch("/api/support/revoke",{method:"POST",headers:c()})}catch{}i(!1),d()},[c,d]),p=w.useCallback(async()=>{o(!0);try{await fetch("/api/support/operate/cancel",{method:"POST",headers:c()})}catch{}o(!1),d()},[c,d]);if(!t)return null;const m=t.operate||null;if(!t.enabled&&!t.active&&!m)return null;if(m){const S=(m.lines||[]).slice(-6);return u.jsxs("div",{ref:l,role:"status","aria-live":"polite",style:X_(!0),children:[u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,width:"100%"},children:[u.jsx("span",{"aria-hidden":"true",children:"⚙️"}),u.jsx("span",{style:{fontWeight:600},children:m.active?"VentureWild support is operating your agent":"VentureWild support finished helping"}),m.active&&u.jsx("button",{type:"button",onClick:p,disabled:s,style:bh,children:s?"Stopping…":"Stop"}),u.jsx("button",{type:"button",onClick:f,disabled:r,style:{...bh,marginLeft:m.active?0:"auto"},children:r?"Revoking…":"Revoke access"})]}),S.length>0&&u.jsx("div",{"data-testid":"operate-transcript",style:{width:"100%",marginTop:4,maxHeight:96,overflowY:"auto",font:"12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace",opacity:.92,whiteSpace:"pre-wrap"},children:S.map((C,x)=>u.jsx("div",{children:C.text},`${C.ts}-${x}`))})]})}const b=t.active,_=b?"VentureWild support is connected":`Support access allowed (tier ${t.tier})`,v=b?t.lastAction?`last action: ${t.lastAction.action}`:"a support session is live":`auto-expires in ${pB(t.remainingMs)}`;return u.jsxs("div",{ref:l,role:"status","aria-live":"polite",style:X_(b),children:[u.jsx("span",{"aria-hidden":"true",children:b?"🟢":"🛟"}),u.jsx("span",{style:{fontWeight:600},children:_}),u.jsxs("span",{style:{opacity:.8},children:["· ",v]}),u.jsx("button",{type:"button",onClick:f,disabled:r,style:{...bh,marginLeft:"auto"},children:r?"Revoking…":"Revoke"})]})}function X_(e){return{position:"fixed",top:0,left:0,right:0,zIndex:9999,display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"6px 14px",background:e?"var(--accent, #0891b2)":"var(--surface-2, #f4f4f5)",color:e?"var(--accent-ink, #fff)":"var(--text, #222)",borderBottom:"1px solid var(--border, #e4e4e7)",boxShadow:"0 1px 6px rgba(0,0,0,0.12)",font:"13px/1.4 -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"}}const bh={padding:"3px 12px",borderRadius:6,border:"1px solid currentColor",background:"transparent",color:"inherit",cursor:"pointer",fontWeight:600},gB={partner:"Partner",viewer:"Viewer",client:"Client"},bs=12,Mi=[{id:"chat-1",type:"chat"}],yB={lg:[{i:"chat-1",x:0,y:0,w:8,h:bs,minW:3,minH:4}]},_B={chat:{w:5,h:12},liveview:{w:4,h:12},notes:{w:3,h:6},earnings:{w:3,h:5},analytics:{w:4,h:7},usage:{w:3,h:6},powers:{w:3,h:7},files:{w:3,h:12},code:{w:5,h:12},todo:{w:3,h:7},logs:{w:4,h:8},datatable:{w:6,h:8},deploy:{w:4,h:7},peers:{w:3,h:6}},vB=[{type:"liveview",title:"Live view",icon:"👁️",desc:"See what your agent builds, live."},{type:"files",title:"Files",icon:"📁",desc:"Browse your workspace files.",cap:"fileTree"},{type:"code",title:"Code",icon:"💻",desc:"View a file, with highlighting.",cap:"fileTree"},{type:"notes",title:"Notes",icon:"📝",desc:"A place to jot anything."},{type:"todo",title:"To-do",icon:"✅",desc:"A simple checklist."},{type:"logs",title:"Logs",icon:"📋",desc:"Tail your workspace logs, live.",cap:"fileTree"},{type:"datatable",title:"Data table",icon:"🗂️",desc:"View a CSV or JSON file as a sortable table.",cap:"fileTree"},{type:"deploy",title:"Deploy",icon:"🚀",desc:"Put your build online (agent-driven)."},{type:"usage",title:"Usage",icon:"🔋",desc:"Your plan usage + working memory, live."},{type:"powers",title:"Powers",icon:"🧰",desc:"Your skills — one tap to run."},{type:"peers",title:"Builders like you",icon:"🌱",desc:"Real things real people built here."},{type:"chat",title:"Another chat",icon:"🗨️",desc:"A second, independent conversation."}],bB=[{type:"earnings",title:"Producer earnings",icon:"💸",desc:"Watch represented earnings tick in, live."},{type:"analytics",title:"Shelf analytics",icon:"📊",desc:"Who's earning across the marketplace."}],wB=[{id:"just-chat",name:"Just chat",icon:"💬",desc:"Only the conversation — clean and focused.",blocks:[{type:"chat",l:{x:0,y:0,w:8,h:12,minW:3,minH:4}}]},{id:"build",name:"Build",icon:"🔨",desc:"Chat, a live view, and your powers.",blocks:[{type:"chat",l:{x:0,y:0,w:6,h:12,minW:3,minH:4}},{type:"liveview",l:{x:6,y:0,w:6,h:8,minW:3,minH:3}},{type:"powers",l:{x:6,y:8,w:6,h:4,minW:3,minH:3}}]},{id:"producer",name:"Producer",icon:"💸",desc:"Chat + your earnings, usage, and the shelf.",blocks:[{type:"chat",l:{x:0,y:0,w:6,h:12,minW:3,minH:4}},{type:"earnings",l:{x:6,y:0,w:6,h:4,minW:3,minH:3}},{type:"usage",l:{x:6,y:4,w:6,h:4,minW:3,minH:3}},{type:"analytics",l:{x:6,y:8,w:6,h:4,minW:3,minH:3}}]},{id:"workspace",name:"Workspace",icon:"📝",desc:"Chat, a live view, your usage, and notes.",blocks:[{type:"chat",l:{x:0,y:0,w:6,h:12,minW:3,minH:4}},{type:"liveview",l:{x:6,y:0,w:6,h:6,minW:3,minH:3}},{type:"usage",l:{x:6,y:6,w:6,h:3,minW:3,minH:3}},{type:"notes",l:{x:6,y:9,w:6,h:3,minW:3,minH:3}}]},{id:"code",name:"Code",icon:"💻",desc:"Chat with a file browser and a code view.",cap:"fileTree",blocks:[{type:"chat",l:{x:0,y:0,w:4,h:12,minW:3,minH:4}},{type:"files",l:{x:4,y:0,w:3,h:12,minW:2,minH:4}},{type:"code",l:{x:7,y:0,w:5,h:12,minW:3,minH:4}}]}];let J_=0;function Co(e){return J_+=1,`${e}-${Date.now().toString(36)}-${J_}`}function SB(e=640){const[t,n]=w.useState(()=>typeof window<"u"&&window.innerWidth<=e);return w.useEffect(()=>{if(typeof window>"u")return;const r=window.matchMedia(`(max-width: ${e}px)`),i=()=>n(r.matches);return i(),r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[e]),t}function xB(){var gt,et,zt,Di,Un,Jr;const[e,t]=w.useState(null),[n,r]=w.useState(null),[i,s]=w.useState(!1),[o,a]=w.useState(()=>!Yo()),[l,c]=w.useState(()=>Yo()),[d,h]=w.useState(!1),[f,p]=w.useState(!1),[m,y]=w.useState(null),[b,_]=w.useState(!1),[v,g]=w.useState(!1),[S,C]=w.useState(!1),[x,T]=w.useState("build"),[P,B]=w.useState({}),[j,$]=w.useState(null),[I,R]=w.useState(null),[A,N]=w.useState(null),[z,U]=w.useState(null),[D,O]=w.useState(!1),[k,Q]=w.useState(null),[ne,E]=w.useState("use"),[ce,_e]=w.useState(!1),[te,ae]=w.useState(!1),[se,he]=w.useState(!1),[Pe,be]=w.useState(!1),[Se,L]=w.useState(()=>typeof window<"u"?FA():{mode:"light",accent:"#0891b2",hot:"#0e7490",accentManual:!1}),[ge,oe]=w.useState(null),[ye,Te]=w.useState(()=>{try{const W=JSON.parse(localStorage.getItem("wild:templates")||"[]");return Array.isArray(W)?W:[]}catch{return[]}}),[Le,Y]=w.useState(Mi),[pe,Ae]=w.useState(yB),[Ke,Et]=w.useState(!1),[ir,pt]=w.useState("chat-1"),M=SB(),H=w.useMemo(()=>typeof window>"u"?null:new URLSearchParams(window.location.search).get("t"),[]);w.useEffect(()=>{async function W(){try{const K={};H&&(K.Authorization=`Bearer ${H}`);const X=await fetch("/api/session",{headers:K});if(X.status===401){s(!0);return}if(!X.ok)throw new Error(`session fetch failed: ${X.status}`);const re=await X.json();t(re)}catch(K){r(K.message||String(K))}}W()},[H,l]),w.useEffect(()=>{HA(Se),$A(Se)},[Se]),w.useEffect(()=>{var K;const W=(K=e==null?void 0:e.identity)==null?void 0:K.color;W&&!Se.accentManual&&L(X=>X.accentManual?X:{...X,accent:W,hot:W})},[(gt=e==null?void 0:e.identity)==null?void 0:gt.color,Se.accentManual]);const ue=e!=null&&e.workspaceId?`wild:canvas:v2:${e.workspaceId}:${e.personKey||"local"}`:null,Ce=w.useRef(null);function De(W){clearTimeout(Ce.current),Ce.current=setTimeout(()=>{const K={"Content-Type":"application/json"};H&&(K.Authorization=`Bearer ${H}`),fetch("/api/canvas/state",{method:"POST",headers:K,body:JSON.stringify(W)}).catch(()=>{})},800)}w.useEffect(()=>{if(!ue||Ke)return;let W=!1;const K=H?{Authorization:`Bearer ${H}`}:{};return(async()=>{var X,re,me,Xe,ze,Pt,Vn,Pi;try{const qn=await fetch("/api/canvas/state",{headers:K});if(!qn.ok)throw new Error(qn.status);const jt=await qn.json();if(W)return;let pn=null;try{pn=JSON.parse(localStorage.getItem(ue))}catch{}if((re=(X=jt.layout)==null?void 0:X.blocks)!=null&&re.length||(ze=(Xe=(me=jt.layout)==null?void 0:me.layouts)==null?void 0:Xe.lg)!=null&&ze.length){let Bt=Array.isArray(jt.layout.blocks)&&jt.layout.blocks.length?jt.layout.blocks:Mi;Bt.some(Zr=>Zr.type==="chat")||(Bt=[...Mi,...Bt]),Y(Bt),(Pt=jt.layout.layouts)!=null&&Pt.lg&&Ae(jt.layout.layouts);try{localStorage.setItem(ue,JSON.stringify({blocks:Bt,layouts:jt.layout.layouts}))}catch{}}else if((Vn=pn==null?void 0:pn.blocks)!=null&&Vn.length){let Bt=Array.isArray(pn.blocks)&&pn.blocks.length?pn.blocks:Mi;Bt.some(Zr=>Zr.type==="chat")||(Bt=[...Mi,...Bt]),Y(Bt),(Pi=pn.layouts)!=null&&Pi.lg&&Ae(pn.layouts),De({layout:{blocks:Bt,layouts:pn.layouts||{lg:[]}}})}if(Array.isArray(jt.templates)&&jt.templates.length){Te(jt.templates);try{localStorage.setItem("wild:templates",JSON.stringify(jt.templates))}catch{}}if(jt.userTheme){const Bt=jt.userTheme;L(Zr=>({...Zr,mode:Bt.mode==="dark"?"dark":"light",accent:Bt.accent||Zr.accent,hot:Bt.hot||Zr.hot,accentManual:Bt.accentManual??Zr.accentManual,tokens:Bt.tokens||{}}))}}catch{if(W)return;try{const qn=localStorage.getItem(ue);if(qn){const jt=JSON.parse(qn);let pn=Array.isArray(jt.blocks)&&jt.blocks.length?jt.blocks:Mi;pn.some(Bt=>Bt.type==="chat")||(pn=[...Mi,...pn]),Y(pn),jt.layouts&&jt.layouts.lg&&Ae(jt.layouts)}}catch{}}W||Et(!0)})(),()=>{W=!0,clearTimeout(Ce.current)}},[ue]),w.useEffect(()=>{if(!(!ue||!Ke)){try{localStorage.setItem(ue,JSON.stringify({blocks:Le,layouts:pe}))}catch{}De({layout:{blocks:Le,layouts:pe}})}},[ue,Ke,Le,pe]);const nt=w.useRef(null);w.useEffect(()=>{if(Ke)return clearTimeout(nt.current),nt.current=setTimeout(()=>{De({userTheme:Se})},800),()=>clearTimeout(nt.current)},[Ke,Se]),w.useEffect(()=>{var X;if(!Ke||!((X=e==null?void 0:e.capabilities)!=null&&X.chat))return;let W=!1;const K=H?{Authorization:`Bearer ${H}`}:{};return fetch("/api/canvas/blocks",{headers:K}).then(re=>re.ok?re.json():null).then(re=>{W||!Array.isArray(re==null?void 0:re.blocks)||!re.blocks.length||(Y(me=>{const Xe=new Set(me.map(Pt=>Pt.id)),ze=re.blocks.filter(Pt=>Pt.id&&!Xe.has(Pt.id));return ze.length?[...me,...ze.map(Pt=>({id:Pt.id,type:"custom",spec:Pt}))]:me}),Ae(me=>{const Xe=me.lg||[],ze=new Set(Xe.map(Vn=>Vn.i)),Pt=re.blocks.filter(Vn=>Vn.id&&!ze.has(Vn.id));return Pt.length?{lg:[...Xe,...Pt.map((Vn,Pi)=>({i:Vn.id,x:8,y:Pi*6,w:4,h:6,minW:3,minH:3}))]}:me}))}).catch(()=>{}),()=>{W=!0}},[Ke,(et=e==null?void 0:e.capabilities)==null?void 0:et.chat,H]),w.useEffect(()=>{var X;if(!((X=e==null?void 0:e.capabilities)!=null&&X.chat)||Se.accentManual)return;let W=!1;const K=H?{Authorization:`Bearer ${H}`}:{};return fetch("/api/canvas/theme",{headers:K}).then(re=>re.ok?re.json():null).then(re=>{W||!(re!=null&&re.theme)||L(me=>me.accentManual?me:{...me,mode:re.theme.mode==="dark"?"dark":"light",accent:re.theme.accent||me.accent,hot:re.theme.hot||re.theme.accent||me.hot,tokens:re.theme.tokens||{}})}).catch(()=>{}),()=>{W=!0}},[(zt=e==null?void 0:e.capabilities)==null?void 0:zt.chat,H]);function mt(W){const K=Co(W),X=_B[W]||{w:4,h:12};if(Y(re=>[...re,{id:K,type:W}]),Ae(re=>({lg:[...re.lg||[],{i:K,x:Math.max(0,12-X.w),y:0,w:X.w,h:X.h,minW:3,minH:3}]})),pt(K),_e(!1),typeof window<"u"){const re=me=>{var Xe;return(Xe=document.querySelector(`[data-rgl-id="${K}"]`))==null?void 0:Xe.scrollIntoView({behavior:me,block:"nearest"})};setTimeout(()=>re("smooth"),300),setTimeout(()=>re("auto"),750)}}function Dt(W){const K=Le.find(X=>X.id===W);if(Y(X=>X.filter(re=>re.id!==W)),Ae(X=>({lg:(X.lg||[]).filter(re=>re.i!==W)})),pt(X=>{var re;return X===W?((re=Le.find(me=>me.type==="chat"))==null?void 0:re.id)||"chat-1":X}),(K==null?void 0:K.type)==="custom"){const X=H?{Authorization:`Bearer ${H}`}:{};fetch(`/api/canvas/blocks/${encodeURIComponent(W)}`,{method:"DELETE",headers:X}).catch(()=>{})}}function sn(W){const K=Le.find(X=>X.id===W);K&&mt(K.type)}const Ot=w.useRef(Le);Ot.current=Le;const at=w.useRef(null),rt=w.useRef(null),Vt=w.useRef(!1);w.useEffect(()=>{var me;if(!((me=e==null?void 0:e.capabilities)!=null&&me.chat)||M)return;let W=!1,K=null;const X=H?{Authorization:`Bearer ${H}`}:{},re=async()=>{var Pi;if(W||Vt.current||document.hidden)return;const Xe=await fetch("/api/preview/ports",{headers:X}).catch(()=>null);if(!Xe||W)return;const Pt=((await Xe.json().catch(()=>({}))).ports||[]).map(qn=>qn.port);if(rt.current===null){rt.current=new Set(Pt);return}Pt.some(qn=>!rt.current.has(qn))&&!Ot.current.some(qn=>qn.type==="liveview")&&(Vt.current=!0,clearInterval(K),(Pi=at.current)==null||Pi.call(at))};return re(),K=setInterval(re,5e3),()=>{W=!0,clearInterval(K)}},[(Di=e==null?void 0:e.capabilities)==null?void 0:Di.chat,H,M]);function Hn(){if(Le.some(K=>K.type==="liveview"))return;const W=Co("liveview");Y(K=>K.some(X=>X.type==="liveview")?K:[...K,{id:W,type:"liveview"}]),Ae(K=>{const X=(K.lg||[]).map(re=>re.i.startsWith("chat")?{...re,w:6,x:0,h:bs}:re);return X.push({i:W,x:6,y:0,w:6,h:bs,minW:3,minH:4}),{lg:X}})}at.current=Hn;function Wn(W){if(U(W),Le.some(X=>X.type==="code"))return;const K=Co("code");Y(X=>X.some(re=>re.type==="code")?X:[...X,{id:K,type:"code"}]),Ae(X=>({lg:[...X.lg||[],{i:K,x:6,y:0,w:6,h:bs,minW:3,minH:4}]}))}function gr(W,K){if(W!=null&&W.id&&(Y(X=>{const re=X.findIndex(me=>me.id===W.id);if(re>=0){const me=X.slice();return me[re]={...me[re],type:"custom",spec:W},me}return[...X,{id:W.id,type:"custom",spec:W}]}),Ae(X=>{const re=X.lg||[];return re.some(me=>me.i===W.id)?X:{lg:[...re,{i:W.id,x:8,y:0,w:4,h:6,minW:3,minH:3}]}}),K!=="update"&&(pt(W.id),typeof window<"u"))){const X=re=>{var me;return(me=document.querySelector(`[data-rgl-id="${W.id}"]`))==null?void 0:me.scrollIntoView({behavior:re,block:"nearest"})};setTimeout(()=>X("smooth"),300),setTimeout(()=>X("auto"),750)}}function Ue(W){!W||typeof W!="object"||L(K=>{var X;return BA(K,W,K.accentManual||!!((X=e==null?void 0:e.identity)!=null&&X.color))})}async function Ve({title:W,pitch:K}){const X={"content-type":"application/json",...H?{Authorization:`Bearer ${H}`}:{}},re={title:W,pitch:K,theme:{mode:Se.mode,accent:Se.accent,hot:Se.hot,tokens:Se.tokens||{}},builtFrom:ge?{id:ge.id,title:ge.title}:null};return(await fetch("/api/bazaar/themes/publish",{method:"POST",headers:X,body:JSON.stringify(re)})).json().catch(()=>({ok:!1,error:"bad-response"}))}function $e(W){const K=W&&W.theme||{};L(X=>({...X,mode:K.mode==="dark"?"dark":"light",accent:K.accent||X.accent,hot:K.hot||K.accent||X.hot,tokens:K.tokens||{},accentManual:!0})),oe({id:W.id,title:W.title}),he(!0)}function Ge(W){var re;const K=[],X=W.blocks.map(me=>{const Xe=Co(me.type);return K.push({i:Xe,...me.l||{x:0,y:0,w:4,h:bs,minW:3,minH:3}}),{id:Xe,type:me.type}});if(!X.some(me=>me.type==="chat")){const me=Co("chat");X.unshift({id:me,type:"chat"}),K.unshift({i:me,x:0,y:0,w:8,h:bs,minW:3,minH:4})}Y(X),Ae({lg:K}),pt(((re=X[0])==null?void 0:re.id)||"chat-1"),ae(!1),typeof window<"u"&&setTimeout(()=>{var me;return(me=document.querySelector(".block-canvas"))==null?void 0:me.scrollTo({top:0,behavior:"smooth"})},60)}function lt(W){try{localStorage.setItem("wild:templates",JSON.stringify(W))}catch{}return De({templates:W}),W}function St(W){const K=pe.lg||[],X=Le.map(me=>{const Xe=K.find(ze=>ze.i===me.id);return{type:me.type,l:Xe?{x:Xe.x,y:Xe.y,w:Xe.w,h:Xe.h,minW:Xe.minW??3,minH:Xe.minH??4}:{x:0,y:0,w:4,h:10,minW:3,minH:4}}}),re={id:`saved-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,name:W,icon:"⭐",desc:"Your saved layout",blocks:X,custom:!0};Te(me=>lt([...me,re]))}function Nt(W){Te(K=>lt(K.filter(X=>X.id!==W)))}if(i)return u.jsx(oB,{});if(n)return u.jsx("div",{className:"app",style:{gridTemplateRows:"1fr",alignItems:"center",justifyItems:"center"},children:u.jsxs("div",{style:{padding:24},children:[u.jsx("h2",{children:"wild-workspace"}),u.jsxs("p",{style:{color:"var(--error)"},children:["Could not load session: ",n]}),u.jsx("p",{style:{color:"var(--text-muted)",fontSize:13},children:"Verify the server is running and the share URL token is valid."})]})});if(!e)return u.jsx("div",{className:"app",style:{gridTemplateRows:"1fr",alignItems:"center",justifyItems:"center"},children:u.jsxs("div",{style:{padding:24,color:"var(--text-muted)"},children:[u.jsx("span",{className:"spinner"})," Loading workspace…"]})});if((Un=e.capabilities)!=null&&Un.chatWrite&&!e.onboarded)return u.jsx(eB,{session:e,token:H,onComplete:async W=>{W!=null&&W.seedChat&&nP(W.seedChat,void 0,Yu(e.currentWorkspace));try{const K={};H&&(K.Authorization=`Bearer ${H}`);const X=await fetch("/api/session",{headers:K});X.ok?t(await X.json()):t({...e,onboarded:!0})}catch{t({...e,onboarded:!0})}W!=null&&W.build&&Q({text:W.build,ts:Date.now()})}});if(o)return u.jsx(vP,{session:e,onEnter:W=>{W!==l&&(rP(W),c(W),U(null),Q(null)),a(!1)},onClose:Yo()?()=>a(!1):null});const{role:it,capabilities:F,workspace:ie,workspaceId:ve,agent:xe,identity:J}=e,ke=(J==null?void 0:J.name)||(xe==null?void 0:xe.label)||"Chat",de=e.currentWorkspace||{},je=de.id||"default";Yu(de);const Ee=(Jr=Le.find(W=>W.type==="chat"))==null?void 0:Jr.id;function Re(W){var K,X;switch(W.type){case"chat":return{title:ke,icon:"🗨️"};case"liveview":return{title:"Live view",icon:"👁️"};case"notes":return{title:"Notes",icon:"📝"};case"usage":return{title:"Usage",icon:"🔋"};case"powers":return{title:"Powers",icon:"🧰"};case"earnings":return{title:"Producer earnings",icon:"💸"};case"analytics":return{title:"Shelf analytics",icon:"📊"};case"files":return{title:"Files",icon:"📁"};case"code":return{title:"Code",icon:"💻"};case"todo":return{title:"To-do",icon:"✅"};case"logs":return{title:"Logs",icon:"📋"};case"datatable":return{title:"Data table",icon:"🗂️"};case"deploy":return{title:"Deploy",icon:"🚀"};case"peers":return{title:"Builders like you",icon:"🌱"};case"custom":return{title:((K=W.spec)==null?void 0:K.title)||"Block",icon:((X=W.spec)==null?void 0:X.icon)||"🧩"};default:return{title:W.type,icon:"▫️"}}}function Je(W){switch(W.type){case"chat":{const K=W.id===Ee,X=K?void 0:W.id,re=Yu(de,X),me=K?x:P[W.id]||"build",Xe=K?T:ze=>B(Pt=>({...Pt,[W.id]:ze}));return u.jsxs(u.Fragment,{children:[F.chatWrite&&u.jsx("div",{className:"chat-block-bar",children:u.jsxs("span",{className:"chat-mode-toggle","data-testid":"mode-toggle",children:[u.jsx("button",{className:me==="build"?"active":"",onClick:()=>Xe("build"),"data-testid":"mode-build",children:"Build"}),u.jsx("button",{className:me==="plan"?"active":"",onClick:()=>Xe("plan"),"data-testid":"mode-plan",children:"Plan"})]})}),K&&F.inbox&&u.jsx(Fz,{}),u.jsx(oP,{storageKey:re,threadId:X,role:it,capabilities:F,mode:me,token:H,inject:K?k:void 0,agentName:ke,onBazaarEvent:ze=>{(ze==null?void 0:ze.type)==="preview"?($({url:ze.url,ts:ze.ts}),Hn()):(ze==null?void 0:ze.type)==="meter"?R(ze.state):(ze==null?void 0:ze.type)==="usage"?N(ze.state):(ze==null?void 0:ze.type)==="block"?gr(ze.block,ze.op):(ze==null?void 0:ze.type)==="theme"&&Ue(ze.theme)}},`chat-${re}`)]})}case"liveview":return u.jsx(YA,{bazaarPreview:j});case"notes":return u.jsx(GA,{id:W.id});case"usage":return u.jsx(eI,{live:A,token:H});case"powers":return u.jsx(tI,{token:H,onRun:K=>Q({text:`/${K}`,ts:Date.now()})});case"earnings":return u.jsx(ZA,{live:I,token:H});case"analytics":return u.jsx(nI,{live:I,token:H});case"files":return u.jsx(rI,{token:H,selectedFile:z,onOpenFile:Wn},`files-${je}`);case"code":return u.jsx(oI,{path:z,token:H,onPickFile:U},`code-${je}`);case"todo":return u.jsx(aI,{id:W.id});case"logs":return u.jsx(uI,{token:H});case"datatable":return u.jsx(fI,{token:H});case"deploy":return u.jsx(pI,{canDeploy:F.chatWrite,onSetup:()=>Q({text:"Help me deploy this project — set up a deploy target and ship it.",ts:Date.now()})});case"peers":return u.jsx(Lp,{variant:"block"});case"custom":return u.jsx(jz,{spec:W.spec});default:return null}}return u.jsxs("div",{className:"app",children:[u.jsx(mB,{token:H}),F.share&&u.jsx(hB,{token:H}),u.jsxs("header",{className:"topbar","data-testid":"topbar",children:[u.jsx("span",{className:"brand",children:"wild-workspace"}),u.jsx("span",{className:`badge ${it}`,"data-testid":"role-badge",children:gB[it]||it}),u.jsxs("button",{className:"badge","data-testid":"workspace-switcher",onClick:()=>a(!0),title:"Switch workspace",style:{cursor:"pointer"},children:[de.name||(ie==null?void 0:ie.name)||ve," ▾"]}),J!=null&&J.name?u.jsx("span",{className:"badge","data-testid":"agent-name",style:{borderColor:J.color,color:J.color},children:J.name}):xe&&u.jsx("span",{className:"badge","data-testid":"agent-name",children:xe.label||xe.id}),u.jsx("span",{className:"spacer"}),u.jsx("button",{onClick:()=>he(!0),"data-testid":"theme-btn",title:"Theme — make it yours (light/dark + accent)",children:"🎨 Theme"}),F.chatWrite&&u.jsx("button",{onClick:()=>ae(!0),"data-testid":"templates-btn",title:"Start from a template layout",children:"▾ Templates"}),F.chatWrite&&u.jsx("button",{className:ne==="layout"?"primary":"",onClick:()=>E(W=>W==="layout"?"use":"layout"),"data-testid":"arrange-toggle",title:"Rearrange your blocks",children:ne==="layout"?"✓ Done":"✥ Arrange"}),F.chat&&u.jsx("button",{onClick:()=>O(!0),"data-testid":"bazaar-btn",title:"Browse the marketplace shelf",children:"🛍️ Bazaar"}),F.chatWrite&&u.jsx("button",{onClick:()=>be(!0),"data-testid":"settings-btn",title:"Settings — agent autonomy, name, appearance",children:"⚙️ Settings"}),(()=>{const W=F.sync&&u.jsx("button",{onClick:()=>p(!0),"data-testid":"collaborate-btn",children:"Collaborate"},"collab"),K=F.share&&u.jsx("button",{onClick:()=>h(!0),"data-testid":"share-btn",children:"Share"},"share"),X=F.terminal&&u.jsx("button",{onClick:()=>g(me=>!me),"data-testid":"terminal-toggle",children:v?"Hide terminal":"Terminal"},"term"),re=[W,K,X].filter(Boolean);return re.length===0?null:M?u.jsxs("div",{className:"topbar-more","data-testid":"topbar-more",children:[u.jsx("button",{onClick:()=>C(me=>!me),"data-testid":"more-toggle","aria-haspopup":"menu","aria-expanded":S,title:"More actions",children:"⋯"}),S&&u.jsx("div",{className:"more-menu",role:"menu","data-testid":"more-menu",onClick:()=>C(!1),children:re})]}):u.jsx(u.Fragment,{children:re})})()]}),u.jsxs("main",{className:"canvas-wrap","data-testid":"canvas-wrap",children:[ne==="layout"&&u.jsxs("div",{className:"arrange-bar","data-testid":"arrange-bar",children:[u.jsx("span",{className:"arrange-hint",children:"✥ Arranging your space — drag a block's header, resize from its corner, or add a new one."}),u.jsx("span",{className:"spacer"}),u.jsx("button",{className:"primary",onClick:()=>_e(!0),"data-testid":"add-block-btn",children:"+ Add block"}),u.jsx("button",{onClick:()=>E("use"),children:"Done"})]}),M?u.jsx(AA,{blocks:Le,activeId:ir,setActiveId:pt,mode:ne,renderBlock:Je,blockMeta:Re,onRemove:Dt,canRemove:W=>W.type!=="chat"||W.id!==Ee}):u.jsx(LA,{blocks:Le,layouts:pe,mode:ne,onLayoutChange:Ae,renderBlock:Je,blockMeta:Re,onRemove:Dt,onDuplicate:sn,canRemove:W=>W.type!=="chat"||W.id!==Ee,canDuplicate:W=>W.type!=="custom"})]}),u.jsx(Bz,{role:it,capabilities:F,session:e,urlToken:H,onSyncAlert:y,onOpenConflicts:()=>_(!0)}),u.jsx(Mz,{alert:m,onDismiss:()=>y(null)}),b&&u.jsx(Oz,{urlToken:H,onClose:()=>_(!1)}),ce&&u.jsx(IA,{items:vB.filter(W=>!W.cap||F[W.cap]),bazaarItems:bB,onAdd:mt,onClose:()=>_e(!1)}),te&&u.jsx(OA,{builtins:wB.filter(W=>!W.cap||F[W.cap]),saved:ye,onApply:Ge,onSaveCurrent:St,onDelete:Nt,onClose:()=>ae(!1)}),se&&u.jsx(WA,{theme:Se,onChange:L,onClose:()=>{he(!1),oe(null)},onPublish:F.chatWrite?Ve:void 0,remixOf:ge}),Pe&&u.jsx(KA,{token:H,session:e,onClose:()=>be(!1),onOpenTheme:()=>he(!0)}),D&&u.jsx(Uz,{token:H,onApplyTheme:Ue,onRemixTheme:F.chatWrite?$e:void 0,onClose:()=>O(!1),onBuild:W=>{Q({text:W,ts:Date.now()}),O(!1)}}),d&&u.jsx(Az,{onClose:()=>h(!1),workspaceId:ve}),f&&u.jsx(Iz,{onClose:()=>p(!1),token:H}),v&&u.jsxs("div",{className:"terminal-overlay","data-testid":"terminal-overlay",children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Terminal"}),u.jsx("button",{onClick:()=>g(!1),children:"close"})]}),u.jsx(Nz,{token:H})]})]})}function kB(e){const t=window.fetch.bind(window);window.fetch=(n,r={})=>{const i=typeof n=="string"?n:(n==null?void 0:n.url)||"";if(!(i.startsWith("/api/")||i.includes("://")===!1&&i.startsWith("api/")))return t(n,r);const o=new Headers(r.headers||{});return o.has("Authorization")||o.set("Authorization",`Bearer ${e}`),t(n,{...r,headers:o})}}function CB(){const e=window.fetch.bind(window);window.fetch=(t,n={})=>{const r=typeof t=="string"?t:(t==null?void 0:t.url)||"",i=r.startsWith("/api/")||r.includes("://")===!1&&r.startsWith("api/"),s=Yo();if(!i||!s)return e(t,n);const o=new Headers(n.headers||{});return o.has("X-Workspace-Id")||o.set("X-Workspace-Id",s),e(t,{...n,headers:o})}}function EB(){wh.createRoot(document.getElementById("root")).render(u.jsx(pr.StrictMode,{children:u.jsx(xB,{})}))}async function NB(){const e=typeof window<"u"&&window.fetch,t=e?new URLSearchParams(window.location.search).get("t"):null;if(t){let r=!1;try{const i=await window.fetch("/api/auth/exchange",{method:"POST",headers:{Authorization:`Bearer ${t}`}});r=i.ok&&(await i.json().catch(()=>({}))).cookie===!0}catch{}if(r){const i=new URLSearchParams(window.location.search);i.delete("t");const s=i.toString(),o=window.location.pathname+(s?`?${s}`:"")+window.location.hash;window.history.replaceState(null,"",o)}else kB(t)}CB();const n=e?new URLSearchParams(window.location.search).get("gv"):null;if(n){try{await window.fetch("/api/auth/google",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({vouch:n})})}catch{}const r=new URLSearchParams(window.location.search);r.delete("gv");const i=r.toString(),s=window.location.pathname+(i?`?${i}`:"")+window.location.hash;window.history.replaceState(null,"",s)}EB()}NB();
131
+ `))},h.onclose=()=>r(y=>y==="error"?y:"closed"),h.onerror=()=>{r("error"),s("connection failed")};const p=a.onData(y=>{h.readyState===WebSocket.OPEN&&h.send(JSON.stringify({type:"data",data:y}))});let m;try{m=new ResizeObserver(()=>{try{l.fit(),f()}catch{}}),m.observe(o)}catch{}return()=>{try{m==null||m.disconnect()}catch{}try{p.dispose()}catch{}try{h.close()}catch{}try{a.dispose()}catch{}}},[e]),u.jsxs("div",{className:"terminal-block","data-testid":"terminal-block",children:[n==="error"&&u.jsx("div",{className:"terminal-msg err","data-testid":"terminal-error",children:i||"terminal not available"}),u.jsx("div",{className:"terminal-host",ref:t,"data-testid":"terminal-host"})]})}function jz({spec:e}){if(!e||!e.kind)return u.jsx("div",{className:"cb-empty","data-testid":"custom-empty",children:"This block has nothing to show yet."});const{kind:t,note:n,data:r={}}=e;return u.jsxs("div",{className:"cb-block","data-testid":"custom-block","data-kind":t,children:[n&&u.jsx("p",{className:"cb-note",children:n}),t==="metric"&&u.jsx(Rz,{data:r}),t==="list"&&u.jsx(Tz,{data:r}),t==="table"&&u.jsx(Dz,{data:r}),t==="markdown"&&u.jsx(Pz,{data:r})]})}function Rz({data:e}){const t=["up","down","flat"].includes(e.trend)?e.trend:null;return u.jsxs("div",{className:"cb-metric","data-testid":"custom-metric",children:[u.jsx("div",{className:"cb-metric-value",children:e.value??"—"}),e.label&&u.jsx("div",{className:"cb-metric-label",children:e.label}),e.delta&&u.jsxs("div",{className:`cb-metric-delta ${t?`is-${t}`:""}`,"data-testid":"custom-delta",children:[t==="up"?"▲ ":t==="down"?"▼ ":"",e.delta]}),Array.isArray(e.spark)&&e.spark.length>0&&u.jsx(Lz,{values:e.spark})]})}function Tz({data:e}){const t=Array.isArray(e.items)?e.items:[];return t.length?u.jsx("ul",{className:"cb-list","data-testid":"custom-list",children:t.map((n,r)=>u.jsxs("li",{className:"cb-list-row",children:[u.jsx("span",{className:"cb-list-label",children:n.label}),n.value!==void 0&&n.value!==""&&u.jsx("span",{className:"cb-list-value",children:n.value})]},r))}):u.jsx("div",{className:"cb-empty","data-testid":"custom-empty",children:"Empty list."})}function Dz({data:e}){const t=Array.isArray(e.columns)?e.columns:[],n=Array.isArray(e.rows)?e.rows:[];return n.length?u.jsx("div",{className:"cb-table-wrap",children:u.jsxs("table",{className:"cb-table","data-testid":"custom-table",children:[t.length>0&&u.jsx("thead",{children:u.jsx("tr",{children:t.map((r,i)=>u.jsx("th",{children:r},i))})}),u.jsx("tbody",{children:n.map((r,i)=>u.jsx("tr",{children:(Array.isArray(r)?r:[r]).map((s,o)=>u.jsx("td",{children:s},o))},i))})]})}):u.jsx("div",{className:"cb-empty","data-testid":"custom-empty",children:"No rows."})}function Pz({data:e}){const t=typeof e.text=="string"?e.text:"";return t?u.jsx("div",{className:"cb-markdown","data-testid":"custom-markdown",children:u.jsx(ES,{text:t})}):u.jsx("div",{className:"cb-empty","data-testid":"custom-empty",children:"Empty note."})}function Lz({values:e}){const t=Math.max(...e,1);return u.jsx("div",{className:"cb-spark","data-testid":"custom-spark","aria-hidden":"true",children:e.map((n,r)=>u.jsx("span",{className:"cb-spark-bar",style:{height:`${8+Math.round(Math.max(0,n)/t*92)}%`}},r))})}function Az({onClose:e}){const[t,n]=w.useState("viewer"),[r,i]=w.useState(24),[s,o]=w.useState(""),[a,l]=w.useState(null),[c,d]=w.useState([]),[h,f]=w.useState(null),[p,m]=w.useState(!1);w.useEffect(()=>{y()},[]);async function y(){const g=await fetch("/api/share").catch(()=>null);if(!g||!g.ok)return;const S=await g.json();d(S.tokens||[])}async function b(){f(null),m(!0);try{const g=await fetch("/api/share",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({role:t,ttlSeconds:Math.max(60,Number(r)*3600),label:s})}),S=await g.json();if(!g.ok)throw new Error(S.error||`HTTP ${g.status}`);l(S),y()}catch(g){f(g.message||String(g))}finally{m(!1)}}async function _(g){await fetch(`/api/share/${encodeURIComponent(g)}`,{method:"DELETE"}),y()}async function v(g){try{await navigator.clipboard.writeText(g)}catch{}}return u.jsx("div",{className:"modal-backdrop",onClick:e,children:u.jsxs("div",{className:"modal",onClick:g=>g.stopPropagation(),"data-testid":"share-dialog",children:[u.jsx("h2",{children:"Share workspace"}),u.jsx("p",{className:"muted",children:"Issue a token-protected URL. Anyone with the link opens this workspace in their browser with the role you choose."}),u.jsx("label",{children:"Role"}),u.jsx("div",{className:"row",children:u.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,color:"var(--text)"},children:[u.jsx("input",{type:"radio",name:"role",value:"viewer",checked:t==="viewer",onChange:()=>n("viewer"),"data-testid":"share-role-viewer"}),u.jsx("span",{children:"Viewer — read-only chat + preview"})]})}),u.jsx("div",{className:"row",children:u.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,color:"var(--text)"},children:[u.jsx("input",{type:"radio",name:"role",value:"client",checked:t==="client",onChange:()=>n("client"),"data-testid":"share-role-client"}),u.jsx("span",{children:"Client — can chat and request changes"})]})}),u.jsxs("div",{className:"row",children:[u.jsxs("div",{children:[u.jsx("label",{children:"Expires in"}),u.jsx("input",{type:"number",min:"1",value:r,onChange:g=>i(g.target.value),style:{width:80,background:"var(--bg)",color:"var(--text)",border:"1px solid var(--border)",padding:"4px 8px",borderRadius:6},"data-testid":"share-ttl"}),u.jsx("span",{style:{marginLeft:6,color:"var(--text-muted)",fontSize:12},children:"hours"})]}),u.jsxs("div",{style:{flex:1},children:[u.jsx("label",{children:"Label (optional)"}),u.jsx("input",{value:s,onChange:g=>o(g.target.value),placeholder:"e.g. Mel preview",style:{width:"100%",background:"var(--bg)",color:"var(--text)",border:"1px solid var(--border)",padding:"4px 8px",borderRadius:6},"data-testid":"share-label"})]})]}),h&&u.jsx("div",{style:{color:"var(--error)",fontSize:12,marginBottom:8},"data-testid":"share-error",children:h}),a&&u.jsxs(u.Fragment,{children:[u.jsx("label",{children:"Share URL"}),u.jsx("div",{className:"url-output","data-testid":"share-url",children:a.shareUrl}),u.jsxs("div",{style:{display:"flex",gap:8},children:[u.jsx("button",{onClick:()=>v(a.shareUrl),"data-testid":"share-copy",children:"Copy"}),u.jsx("a",{href:a.shareUrl,target:"_blank",rel:"noreferrer",children:u.jsx("button",{children:"Open"})})]})]}),c.length>0&&u.jsxs("div",{style:{marginTop:16},children:[u.jsx("label",{children:"Active share tokens"}),u.jsx("div",{style:{maxHeight:140,overflow:"auto",border:"1px solid var(--border)",borderRadius:6},children:c.map(g=>u.jsxs("div",{style:{padding:"6px 10px",borderBottom:"1px solid var(--border)",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:12},"data-testid":`active-token-${g.sub}`,children:[u.jsxs("div",{children:[u.jsx("strong",{children:g.label||g.role})," ",u.jsxs("span",{style:{color:"var(--text-muted)"},children:["(",g.role,", expires ",new Date(g.exp*1e3).toLocaleString(),")"]})]}),u.jsx("button",{onClick:()=>_(g.sub),style:{fontSize:11},"data-testid":`revoke-${g.sub}`,children:"Revoke"})]},g.sub))})]}),u.jsxs("div",{className:"actions",children:[u.jsx("button",{onClick:e,"data-testid":"share-close",children:"Close"}),u.jsx("button",{className:"primary",onClick:b,disabled:p,"data-testid":"share-issue",children:p?u.jsx("span",{className:"spinner"}):"Issue URL"})]})]})})}function Iz({onClose:e,token:t}){var $,I;const[n,r]=w.useState(null),[i,s]=w.useState(!1),[o,a]=w.useState(null),[l,c]=w.useState(!1),[d,h]=w.useState(""),[f,p]=w.useState(""),[m,y]=w.useState(168),[b,_]=w.useState(null);w.useEffect(()=>{g()},[]);function v(R,A={}){const N={...A.headers||{}};return t&&(N.Authorization=`Bearer ${t}`),fetch(R,{...A,headers:N})}async function g(){a(null),s(!1);const R=await v("/api/sync/status").catch(()=>null);if(!R||!R.ok){s(!0);return}r(await R.json())}async function S(R){a(null),c(!0);try{await R()}catch(A){a(A.message||String(A))}finally{c(!1)}}const C=()=>S(async()=>{const R=await v("/api/sync/pair",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({inviteCode:d})}),A=await R.json();if(!R.ok)throw new Error(A.error||`HTTP ${R.status}`);h(""),await g()}),x=()=>S(async()=>{var N,z;const R=await v("/api/sync/invite",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectCode:(z=(N=n==null?void 0:n.workspaces)==null?void 0:N[0])==null?void 0:z.projectId,displayName:f,expiresHours:Math.max(1,Number(m)||168)})}),A=await R.json();if(!R.ok)throw new Error(A.error||`HTTP ${R.status}`);_(A.invite)}),T=()=>S(async()=>{var N,z;const R=await v("/api/sync/detach",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({workspaceId:(z=(N=n==null?void 0:n.workspaces)==null?void 0:N[0])==null?void 0:z.workspaceId})}),A=await R.json();if(!R.ok)throw new Error(A.error||`HTTP ${R.status}`);_(null),await g()});async function P(R){try{await navigator.clipboard.writeText(R)}catch{}}const B=(($=n==null?void 0:n.workspaces)==null?void 0:$[0])||null,j=!!n&&!((I=n.daemon)!=null&&I.running);return u.jsx("div",{className:"modal-backdrop",onClick:e,children:u.jsxs("div",{className:"modal",onClick:R=>R.stopPropagation(),"data-testid":"sync-dialog",children:[u.jsx("h2",{children:"Collaborate on this folder"}),u.jsx("p",{className:"muted",children:"bmo-sync keeps this workspace folder identical across machines — yours and a collaborator's. Both of you edit; changes flow both ways. Like a shared drive, but built for workspaces."}),!n&&!i&&u.jsxs("div",{className:"muted",children:[u.jsx("span",{className:"spinner"})," Checking sync status…"]}),i&&u.jsxs("div",{className:"sync-state warn","data-testid":"sync-load-failed",children:[u.jsx("strong",{children:"Couldn't load sync status."}),u.jsx("span",{className:"muted",children:"The workspace server didn't answer. Try again."})]}),j&&u.jsxs("div",{className:"sync-state warn","data-testid":"sync-daemon-down",children:[u.jsx("strong",{children:"The bmo-sync daemon isn't running."}),u.jsx("span",{className:"muted",children:"Folder sharing needs the background sync service running on this machine. Start it, then recheck."})]}),n&&!j&&!B&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"sync-state","data-testid":"sync-unpaired",children:[u.jsxs("strong",{children:[n.workspaceName," isn't shared yet."]}),u.jsx("span",{className:"muted",children:"Got an invite code from a collaborator? Paste it to sync this folder with theirs."})]}),u.jsx("label",{children:"Invite code"}),u.jsxs("div",{className:"row",children:[u.jsx("input",{className:"sync-input",style:{flex:1},value:d,onChange:R=>h(R.target.value),placeholder:"e.g. CAFE-MILANO-A8X3","data-testid":"sync-invite-input"}),u.jsx("button",{className:"primary",onClick:C,disabled:l||!d.trim(),"data-testid":"sync-join",children:l?u.jsx("span",{className:"spinner"}):"Connect folder"})]})]}),n&&!j&&B&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"sync-state ok","data-testid":"sync-paired",children:[u.jsxs("strong",{children:["✓ Synced — ",B.projectName||B.projectId]}),u.jsxs("span",{className:"muted",children:["This folder is shared. Edits sync both ways automatically",B.conflictCount?` · ${B.conflictCount} conflict${B.conflictCount>1?"s":""} resolved`:"","."]})]}),n.canInvite?u.jsxs(u.Fragment,{children:[u.jsx("label",{children:"Invite a collaborator"}),u.jsxs("div",{className:"row",children:[u.jsx("input",{className:"sync-input",style:{flex:1},value:f,onChange:R=>p(R.target.value),placeholder:"Their name — e.g. Mel","data-testid":"sync-invite-name"}),u.jsx("input",{className:"sync-input",style:{width:64},type:"number",min:"1",value:m,onChange:R=>y(R.target.value),title:"Invite expires in (hours)"}),u.jsx("button",{onClick:x,disabled:l,"data-testid":"sync-create-invite",children:l?u.jsx("span",{className:"spinner"}):"Create invite"})]}),b&&u.jsxs(u.Fragment,{children:[u.jsx("label",{children:"Send this code to your collaborator"}),u.jsx("div",{className:"url-output","data-testid":"sync-invite-code",children:b.code}),u.jsxs("div",{className:"row",style:{marginBottom:0},children:[u.jsx("button",{onClick:()=>P(b.code),"data-testid":"sync-copy-code",children:"Copy code"}),b.expiresAt&&u.jsxs("span",{className:"muted",style:{margin:0},children:["expires ",new Date(b.expiresAt*1e3).toLocaleDateString()]})]})]})]}):u.jsxs("p",{className:"muted","data-testid":"sync-no-invite",children:["Inviting from here needs a bmo-sync admin key (set"," ",u.jsx("span",{className:"md-code-inline",children:"BMO_SYNC_ADMIN_KEY"}),"). Without it, anyone you've already invited can still join with their own code."]})]}),o&&u.jsx("div",{style:{color:"var(--error)",fontSize:12,marginTop:8},"data-testid":"sync-error",children:o}),u.jsxs("div",{className:"actions",children:[(j||i)&&u.jsx("button",{onClick:g,disabled:l,"data-testid":"sync-recheck",children:"Recheck"}),B&&!j&&u.jsx("button",{onClick:T,disabled:l,"data-testid":"sync-disconnect",children:"Disconnect"}),u.jsx("button",{onClick:e,"data-testid":"sync-close",children:"Close"})]})]})})}function Mz({alert:e,onDismiss:t}){if(!e)return null;const n=e.kind==="fatal";return u.jsxs("div",{className:"conflict-banner","data-testid":"conflict-banner",role:"status",children:[u.jsx("span",{className:"ico",children:n?"⛔":"⚠️"}),n?u.jsxs("span",{children:[u.jsx("strong",{children:"Sync stopped."})," ",e.message||"The sync engine hit a fatal error."," Reconnect from the Collaborate dialog."]}):u.jsxs("span",{children:[u.jsx("strong",{children:"Sync conflict"})," on ",u.jsx("code",{children:e.path||"a file"})," — bmo-sync kept ",u.jsx("strong",{children:e.resolution||"the latest edit"}),e.user?` (also edited by ${e.user})`:"","."]}),u.jsx("span",{className:"spacer"}),u.jsx("button",{onClick:t,"data-testid":"conflict-dismiss",children:"Dismiss"})]})}function Oz({urlToken:e,onClose:t}){const[n,r]=w.useState([]),[i,s]=w.useState(!0),[o,a]=w.useState(null),[l,c]=w.useState(null),[d,h]=w.useState({}),[f,p]=w.useState(null),m=e?{Authorization:`Bearer ${e}`}:{};function y(){s(!0),fetch("/api/conflicts",{headers:m}).then(g=>g.ok?g.json():{conflicts:[]}).then(g=>{r(Array.isArray(g==null?void 0:g.conflicts)?g.conflicts:[]),a(null)}).catch(g=>a(String((g==null?void 0:g.message)||g))).finally(()=>s(!1))}w.useEffect(y,[]);function b(g){return`${g.workspaceId}:${g.path}`}async function _(g){const S=b(g);if(d[S])return;const C=new URL("/api/conflicts/view",window.location.origin);C.searchParams.set("workspaceId",g.workspaceId),C.searchParams.set("path",g.path);const x=await fetch(C.toString(),{headers:m});if(!x.ok){a(`Could not load ${g.path} (HTTP ${x.status})`);return}const T=await x.json().catch(()=>null);T&&h(P=>({...P,[S]:{mine:F_(T.mine),theirs:F_(T.theirs),conflict:T.conflict}}))}async function v(g,S){const C=b(g);p(C);try{const x=await fetch("/api/conflicts/resolve",{method:"POST",headers:{"content-type":"application/json",...m},body:JSON.stringify({workspaceId:g.workspaceId,path:g.path,action:S})});if(!x.ok){const T=await x.json().catch(()=>({}));a((T==null?void 0:T.error)||`Resolve failed (HTTP ${x.status}).`);return}y(),c(null)}finally{p(null)}}return u.jsxs("div",{className:"conflict-panel","data-testid":"conflict-panel",role:"dialog","aria-label":"Open conflicts",children:[u.jsxs("header",{className:"conflict-panel-header",children:[u.jsx("strong",{children:"Open conflicts"})," ",u.jsxs("span",{className:"muted",children:["(",n.length,") · changes saved to the daemon back-office until you resolve"]}),u.jsx("span",{className:"spacer"}),u.jsx("button",{onClick:y,children:"Refresh"}),u.jsx("button",{onClick:t,children:"Close"})]}),i&&u.jsx("div",{className:"muted",children:"Loading…"}),o&&u.jsx("div",{className:"conflict-panel-error",children:o}),!i&&n.length===0&&u.jsx("div",{className:"muted",children:"No open conflicts."}),u.jsx("ul",{className:"conflict-list",children:n.map(g=>{const S=b(g),C=l===S,x=d[S];return u.jsxs("li",{className:"conflict-row",children:[u.jsxs("div",{className:"conflict-row-head",onClick:()=>{C?c(null):(c(S),g.resolution!=="remote_announced"&&_(g))},children:[u.jsx("code",{children:g.path}),u.jsxs("span",{className:"muted",children:["·"," ",g.resolution==="remote_announced"?`${g.conflictingUser||"peer"} flagged`:g.conflictingUser||"peer"," ","·"," ",new Date((g.detectedAt||0)*1e3).toLocaleTimeString()]}),u.jsx("span",{className:"spacer"}),u.jsx("span",{className:"muted",children:C?"▲":"▼"})]}),C&&g.resolution==="remote_announced"&&u.jsxs("div",{className:"conflict-row-body",children:[u.jsxs("div",{className:"muted",children:[g.conflictingUser||"A peer"," reported a conflict on this file. Your local copy is unchanged here — open it, decide whether to keep your version or pull theirs, save, and the next sync will reconcile."]}),u.jsx("div",{className:"conflict-actions",children:u.jsx("button",{disabled:f===S,onClick:()=>v(g,"keep_mine"),"data-testid":"conflict-acknowledge",children:"Acknowledge"})})]}),C&&g.resolution!=="remote_announced"&&u.jsxs("div",{className:"conflict-row-body",children:[!x&&u.jsx("div",{className:"muted",children:"Loading diff…"}),x&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"conflict-meta",children:[u.jsxs("span",{children:["mine: ",u.jsx("code",{children:vh(g.mineSha256)})]}),u.jsxs("span",{children:["theirs: ",u.jsx("code",{children:vh(g.theirsSha256)})]}),g.baseSha256&&u.jsxs("span",{children:["base: ",u.jsx("code",{children:vh(g.baseSha256)})]})]}),u.jsx(zz,{mine:x.mine,theirs:x.theirs}),u.jsxs("div",{className:"conflict-actions",children:[u.jsx("button",{disabled:f===S,onClick:()=>v(g,"keep_mine"),"data-testid":"conflict-keep-mine",children:"Keep mine"}),u.jsx("button",{disabled:f===S,onClick:()=>v(g,"take_theirs"),"data-testid":"conflict-take-theirs",children:"Take theirs"})]})]})]})]},S)})})]})}function F_(e){if(typeof e!="string")return null;try{const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return new TextDecoder().decode(n)}catch{return null}}function vh(e){return typeof e!="string"?"∅":e.length>12?`${e.slice(0,12)}…`:e}function zz({mine:e,theirs:t}){return e==null&&t==null?u.jsx("div",{className:"muted",children:"Both versions unavailable on disk."}):e==null||t==null?u.jsx("div",{className:"muted",children:"Only one side is available — the other was deleted before resolution."}):u.jsx(Tl,{oldText:t,newText:e})}function Bz({role:e,urlToken:t,onSyncAlert:n,onOpenConflicts:r}){const[i,s]=w.useState([]),[o,a]=w.useState({tokensIn:0,tokensOut:0,costUsd:0}),[l,c]=w.useState([]),[d,h]=w.useState(!1),[f,p]=w.useState(null),[m,y]=w.useState(0);w.useEffect(()=>{if(e!=="partner")return;const S=t?{Authorization:`Bearer ${t}`}:{};fetch("/api/sync/status",{headers:S}).then(C=>C.ok?C.json():null).then(C=>{var x;C&&p({paired:!!C.paired,daemonRunning:!!((x=C.daemon)!=null&&x.running),peer:null})}).catch(()=>{}),fetch("/api/conflicts",{headers:S}).then(C=>C.ok?C.json():{conflicts:[]}).then(C=>y(Array.isArray(C==null?void 0:C.conflicts)?C.conflicts.length:0)).catch(()=>{})},[e,t]),w.useEffect(()=>{const S=window.location.protocol==="https:"?"wss":"ws",C=new URL(`${S}://${window.location.host}/ws/activity`);t&&C.searchParams.set("t",t);const x=new WebSocket(C.toString());return x.onopen=()=>h(!0),x.onclose=()=>h(!1),x.onmessage=T=>{let P;try{P=JSON.parse(T.data)}catch{return}P.type==="snapshot"?(s(P.snapshot.presence||[]),a(P.snapshot.usage||{tokensIn:0,tokensOut:0,costUsd:0}),c(P.snapshot.recent||[])):(c(B=>[...B.slice(-49),P]),b(P))},()=>{try{x.close()}catch{}}},[t]);function b(S){S.type==="daemon-status"?p(C=>({...C||{paired:!1},daemonRunning:!!S.connected})):S.type==="sync-paired"?p(C=>({...C||{},paired:!0,daemonRunning:!0})):S.type==="sync-detached"?p(C=>({...C||{},paired:!1,peer:null})):S.type==="remote-presence"?p(C=>({...C||{paired:!0},peer:S.user||null})):S.type==="sync-conflict"?(n==null||n({kind:"conflict",path:S.path,resolution:S.resolution,user:S.conflictingUser}),(S.resolution==="local_pre_write_guard"||S.resolution==="remote_announced")&&y(C=>C+1)):S.type==="sync-conflict-resolved"?y(C=>Math.max(0,C-1)):S.type==="sync-fatal"&&(n==null||n({kind:"fatal",message:S.message}))}const _=[...l].reverse().find(S=>S.type==="chat-stream"||S.type==="chat-user"||S.type==="chat-end"),v=l.find(S=>S.type==="inbox-change");let g=null;return f!=null&&f.paired&&(g=f.daemonRunning?u.jsxs("span",{className:"pill synced","data-testid":"activity-sync",children:["⇄ Synced",f.peer?` · with ${f.peer}`:""]}):u.jsx("span",{className:"pill sync-off","data-testid":"activity-sync",children:"⇄ Sync paused"})),u.jsxs("footer",{className:"bottombar","data-testid":"activity-bar",children:[u.jsx("span",{className:`pill ${d?"live":""}`,"data-testid":"activity-connected",children:d?"live":"reconnecting…"}),u.jsxs("span",{className:"pill","data-testid":"activity-presence",children:["👥 ",i.length," viewing"]}),g,e==="partner"&&m>0&&u.jsxs("button",{type:"button",className:"pill conflict-badge","data-testid":"activity-conflicts",onClick:()=>r==null?void 0:r(),title:"Resolve open sync conflicts",children:["🛑 ",m," conflict",m===1?"":"s"]}),u.jsxs("span",{className:"pill","data-testid":"activity-usage",children:["↓",o.tokensIn," ↑",o.tokensOut," · $",(o.costUsd||0).toFixed(3)]}),_&&u.jsx("span",{className:"pill",style:{maxWidth:380,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"data-testid":"activity-last",children:_.type==="chat-end"?"✓ agent finished":"… agent streaming"}),v&&u.jsx("span",{className:"pill","data-testid":"activity-inbox",children:"📦 inbox updated"}),u.jsx("span",{style:{flex:1}}),u.jsxs("span",{style:{fontSize:11},children:["v0.1.0 · ",e]})]})}function Fz(){var r;const[e,t]=w.useState(null);if(w.useEffect(()=>{let i=!1;async function s(){try{const l=await(await fetch("/api/inbox")).json();i||t(l)}catch{}}s();const o=setInterval(s,5e3);return()=>{i=!0,clearInterval(o)}},[]),!e||!e.hasInbox||!((r=e.imports)!=null&&r.length))return null;const n=e.imports.filter(i=>{var o;const s=Object.keys(e.installed||{}).find(a=>a.startsWith(i.replace(/-v[\d.]+$/,"")));return s?((o=e.installed[s])==null?void 0:o.integrated)!==!0:!0});return n.length===0?null:u.jsxs("div",{className:"inbox-card","data-testid":"inbox-card",children:["📦 ",u.jsx("strong",{children:"Component inbox"}),": ",n.length," pending integration",n.length!==1?"s":"",": ",n.join(", "),".",u.jsxs("span",{className:"muted",children:["Ask the agent: ",u.jsxs("em",{children:["“walk me through integrating ",n[0],"”"]})]})]})}function $_(e){return`${Math.round((Number(e)||0)*100)}%`}function H_(e){return`$${(Number(e)||0).toFixed(2)}`}function W_(e){const t=Math.max(0,Math.min(5,Math.round(Number(e)||0)));return"★★★★★".slice(0,t)+"☆☆☆☆☆".slice(0,5-t)}function ml(e){var t,n;return((t=e.producer)==null?void 0:t.handle)==="you"||((n=e.producer)==null?void 0:n.kind)==="me"}function $z(e){const t=`${e.title} ${(e.tags||[]).join(" ")} ${e.pitch||""}`.toLowerCase(),n=[[/match|candidate|recruit|\bhir|screen|talent/,"🎯"],[/\bcv\b|resume|parse|extract/,"📄"],[/kanban|board|pipeline|stage|drag/,"🗂️"],[/deploy|cloudflare|worker|\bhost|ship|edge|serverless/,"🚀"],[/landing|waitlist|subscription|launch|checkout/,"🌱"],[/portfolio|personal site/,"🖼️"],[/receipt|expense|invoice|account/,"🧾"],[/feedback|survey|\bform\b/,"💬"],[/book|slot|appointment|schedul|calendar/,"📅"]];for(const[r,i]of n)if(r.test(t))return i;return"🧩"}function U_(e){var n,r,i,s;const t=(((n=e.reward)==null?void 0:n.unit)||"").toLowerCase();return e.hasService||((r=e.reward)==null?void 0:r.model)==="recurring"||/match|use/.test(t)?"earns per use":((i=e.reward)==null?void 0:i.model)==="one-time"?"one-time reward":(s=e.reward)!=null&&s.model?`${e.reward.model} reward`:null}function Hz(e,t){var n;return t?`I want to build "${e.title}" from my own recipe.`:`I want to build "${e.title}". Use ${((n=e.producer)==null?void 0:n.name)||"the producer"}'s recipe.`}function Wz({theme:e}){const t=(e==null?void 0:e.tokens)||{},n=`radial-gradient(120% 80% at 15% 0%, ${t.canvas1||"#e8f7f0"}, transparent 60%),radial-gradient(120% 90% at 100% 0%, ${t.canvas2||"#e7f0fb"}, transparent 55%),linear-gradient(160deg, ${t.canvas3||"#fef8ee"}, ${t.bg||"#ffffff"} 75%)`;return u.jsxs("div",{className:"bz-theme-swatch",style:{background:n},"aria-hidden":!0,children:[u.jsxs("span",{className:"bz-theme-card",style:{background:t.surface||"#fff",borderColor:t.border||"#e2e6ee"},children:[u.jsx("span",{className:"bz-theme-line",style:{background:t.text||"#1d2430"}}),u.jsx("span",{className:"bz-theme-line short",style:{background:t.textMuted||"#687083"}})]}),u.jsx("span",{className:"bz-theme-dot",style:{background:(e==null?void 0:e.accent)||"#0891b2"}})]})}function Uz({onClose:e,onBuild:t,onApplyTheme:n,onRemixTheme:r,token:i}){const[s,o]=w.useState([]),[a,l]=w.useState(null),[c,d]=w.useState(null),[h,f]=w.useState(!0),[p,m]=w.useState(null),[y,b]=w.useState(null),[_,v]=w.useState(null),[g,S]=w.useState({});async function C(N){if(!g[N.id]){S(z=>({...z,[N.id]:!0}));try{const z={"content-type":"application/json",...i?{Authorization:`Bearer ${i}`}:{}};await fetch(`/api/bazaar/themes/${encodeURIComponent(N.id)}/report`,{method:"POST",headers:z,body:JSON.stringify({reason:""})})}catch{}}}async function x(N){if(!(!n||_)){v(N.id);try{const z=i?{Authorization:`Bearer ${i}`}:{},U=await fetch(`/api/bazaar/themes/${encodeURIComponent(N.id)}/apply`,{method:"POST",headers:z}),D=U.ok?await U.json():null,O=(D==null?void 0:D.theme)||N.theme;O?(n(O),e==null||e()):m("Could not apply that theme.")}catch(z){m(String(z.message||z))}finally{v(null)}}}w.useEffect(()=>{let N=!1;async function z(){try{const[U,D]=await Promise.all([fetch("/api/bazaar/shelf"),fetch("/api/bazaar/state")]);if(N)return;const O=await U.json(),k=await D.json();if(N)return;const Q=(O.recipes||[]).slice().sort((ne,E)=>(E.outcomeScore||0)-(ne.outcomeScore||0));o(Q),d(O.network||null),l(k)}catch(U){N||m(String(U.message||U))}finally{N||f(!1)}}return z(),()=>{N=!0}},[]);const T=c?c.capable?c.lastSyncOk===!1?{tone:"offline",text:"Community looks are offline right now — showing the seeds and your own."}:c.poolCount===0&&c.lastSyncOk==null?{tone:"info",text:"Checking for community looks…"}:c.poolCount===0?{tone:"empty",text:"No community looks yet — publish one and you'll be the first."}:{tone:"live",text:`${c.poolCount} ${c.poolCount===1?"look":"looks"} from the community.`}:{tone:"info",text:"Sign in to discover and share looks across VentureWild."}:null,P=((a==null?void 0:a.earnings)||[]).filter(N=>N.total>0),B=s.filter(N=>N.kind==="theme"),j=B.filter(ml),$=s.filter(N=>N.kind!=="theme"),I=$.filter(ml),R=P.find(N=>N.handle==="you"),A=new Set(s.map(N=>{var z,U;return((z=N.producer)==null?void 0:z.handle)||((U=N.producer)==null?void 0:U.name)||"?"})).size;return u.jsx("div",{className:"modal-backdrop",onClick:e,children:u.jsxs("div",{className:"modal bazaar-modal",onClick:N=>N.stopPropagation(),"data-testid":"bazaar-shelf",children:[u.jsxs("div",{className:"bz-store-head",children:[u.jsxs("div",{className:"bz-store-headings",children:[u.jsx("h2",{children:"🛍️ The bazaar"}),u.jsx("p",{className:"muted bz-store-sub",children:"Proven recipes from a network of producers. Your agent reaches onto this shelf for you — ranked by how often each one actually gets a working result, not by marketing."})]}),u.jsxs("div",{className:"bz-store-stats","data-testid":"bazaar-store-stats",children:[u.jsxs("span",{className:"bz-stat",children:[u.jsx("strong",{children:$.length}),"recipes"]}),B.length>0&&u.jsxs("span",{className:"bz-stat",children:[u.jsx("strong",{children:B.length}),"themes"]}),u.jsxs("span",{className:"bz-stat",children:[u.jsx("strong",{children:A}),"producers"]})]})]}),p&&u.jsx("div",{className:"bz-err",children:p}),h&&s.length===0&&u.jsx("div",{className:"muted bz-loading","data-testid":"bazaar-loading",children:"Loading the shelf…"}),I.length>0&&u.jsxs("div",{className:"bz-you-banner","data-testid":"bazaar-you-banner",children:[u.jsx("span",{className:"bz-you-spark",children:"✦"}),u.jsxs("span",{children:["You're a producer here — ",u.jsx("strong",{children:I.length})," ",I.length===1?"of your recipes is":"of your recipes are"," on the shelf",R&&u.jsxs(u.Fragment,{children:[" · earning ",u.jsx("strong",{children:H_(R.total)}),u.jsx("span",{className:"bz-represented",children:" represented"})]})]})]}),B.length>0&&u.jsxs("div",{className:"bz-theme-section","data-testid":"bazaar-themes",children:[u.jsxs("div",{className:"bz-theme-section-head",children:[u.jsx("span",{className:"gallery-section",children:"🎨 themes — make your workspace yours"}),u.jsx("span",{className:"muted bz-theme-section-sub",children:"Pure colour, applies in one tap. The maker earns when you wear it."}),T&&u.jsx("span",{className:`bz-net-note bz-net-${T.tone}`,"data-testid":"bazaar-network-note",children:T.text}),j.length>0&&u.jsx("span",{className:"bz-earn-honesty muted","data-testid":"bazaar-earn-honesty",children:"Your apply counts are tracked on this device — cross-user applies aren't tallied yet."})]}),u.jsx("div",{className:"bz-theme-grid",children:B.map(N=>{var U,D,O;const z=ml(N);return u.jsxs("div",{className:`bz-theme-card-wrap${z?" mine":""}`,"data-testid":`shelf-theme-${N.id}`,children:[u.jsx(Wz,{theme:N.theme}),u.jsxs("div",{className:"bz-theme-meta",children:[u.jsx("span",{className:"bz-theme-title",children:N.title}),u.jsxs("span",{className:"bz-theme-by",children:["by ",((U=N.producer)==null?void 0:U.name)||"a maker",z&&" (you)"]}),N.pitch&&u.jsx("span",{className:"bz-theme-pitch",children:N.pitch}),u.jsxs("div",{className:"bz-theme-foot",children:[((D=N.rating)==null?void 0:D.count)>0&&u.jsx("span",{className:"bz-theme-rating",children:W_(N.rating.stars)}),u.jsxs("span",{className:"bz-reward-pill",children:[H_((O=N.reward)==null?void 0:O.oneTimeValue)," · per apply"]})]})]}),u.jsxs("div",{className:"bz-theme-actions",children:[u.jsx("button",{type:"button",className:"bz-theme-apply","data-testid":`shelf-apply-theme-${N.id}`,disabled:_===N.id,onClick:()=>x(N),children:_===N.id?"Applying…":"Apply"}),r&&N.theme&&u.jsx("button",{type:"button",className:"bz-theme-remix","data-testid":`shelf-remix-theme-${N.id}`,title:"Load this look into the Theme picker to tweak + republish as your own",onClick:()=>{r(N),e==null||e()},children:"✦ Remix"}),N.source==="rails"&&!z&&u.jsx("button",{type:"button",className:"bz-theme-report","data-testid":`shelf-report-theme-${N.id}`,disabled:!!g[N.id],title:"Report this look to VentureWild",onClick:()=>C(N),children:g[N.id]?"Reported ✓":"⚐ Report"})]}),my(N)&&u.jsxs("span",{className:"bz-theme-lineage","data-testid":`shelf-theme-lineage-${N.id}`,children:["remixed from ",my(N)]})]},N.id)})})]}),u.jsx("div",{className:"bz-shelf-grid","data-testid":"bazaar-shelf-grid",children:$.map(N=>{var k,Q,ne,E,ce,_e;const z=ml(N),U=((k=N.outcomeStats)==null?void 0:k.builds)||0,D=U===0||N.safetyBadge==="new",O=y===N.id;return u.jsxs("div",{className:`bz-card${z?" mine":""}${O?" open":""}`,"data-testid":`shelf-recipe-${N.id}`,onClick:()=>b(O?null:N.id),children:[u.jsxs("div",{className:"bz-card-head",children:[u.jsx("span",{className:"bz-card-glyph","aria-hidden":!0,children:$z(N)}),u.jsxs("div",{className:"bz-card-titles",children:[u.jsx("span",{className:"bz-card-title",children:N.title}),u.jsxs("span",{className:"bz-card-by",children:["by ",((Q=N.producer)==null?void 0:Q.name)||"a producer",u.jsx("span",{className:`bz-kind bz-kind-${z?"you":((ne=N.producer)==null?void 0:ne.kind)||"maker"}`,children:z?"you":((E=N.producer)==null?void 0:E.kind)==="vendor"?"vendor":"maker"}),N.hasService&&u.jsx("span",{className:"bz-kind bz-kind-tool",children:"tool"})]})]}),u.jsx("div",{className:"bz-card-score",children:D?u.jsx("span",{className:"bz-new",title:"Just listed — earns its rank by working",children:"NEW"}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"bz-score-pct",children:$_(N.outcomeScore)}),u.jsx("span",{className:"bz-score-label",children:"works"})]})})]}),!D&&u.jsx("div",{className:"bz-score-bar",title:"Measured: how often this recipe reaches a working result",children:u.jsx("i",{style:{width:$_(N.outcomeScore)}})}),N.pitch&&u.jsx("p",{className:"bz-card-pitch",children:N.pitch}),u.jsxs("div",{className:"bz-card-foot",children:[(()=>{const te=NS(N);return te.label!=="New"?u.jsx("span",{className:`bz-badge bz-trust-${te.tone}`,"data-testid":`shelf-trust-${N.id}`,title:te.note||void 0,children:te.label}):null})(),((ce=N.rating)==null?void 0:ce.count)>0&&u.jsxs("span",{className:"bz-card-rating",title:`${N.rating.stars} from ${N.rating.count}`,children:[W_(N.rating.stars)," ",u.jsxs("span",{className:"muted",children:["(",N.rating.count,")"]})]}),U_(N)&&u.jsx("span",{className:"bz-reward-pill",children:U_(N)}),u.jsx("span",{className:"bz-card-expand",children:O?"▾":"▸"})]}),O&&u.jsxs("div",{className:"bz-card-detail","data-testid":`shelf-detail-${N.id}`,children:[N.summary&&u.jsx("p",{className:"bz-detail-summary",children:N.summary}),!D&&U>0&&u.jsxs("p",{className:"muted bz-detail-stat",children:[N.outcomeStats.working," of ",U," builds reached a working result."]}),u.jsxs("p",{className:"bz-detail-hint",children:["Your agent builds this for you and credits"," ",z?"you":((_e=N.producer)==null?void 0:_e.name)||"the producer"," when it does."]}),t&&u.jsx("button",{type:"button",className:"bz-build-btn","data-testid":`shelf-build-${N.id}`,onClick:te=>{te.stopPropagation(),t(Hz(N,z))},children:"Build this →"})]})]},N.id)})}),u.jsx("div",{className:"actions",children:u.jsx("button",{onClick:e,"data-testid":"bazaar-shelf-close",children:"Close"})})]})})}const Vz=[{id:"concise",label:"Concise",sample:"Got it. Done."},{id:"playful",label:"Playful",sample:"Oh nice — let's go!"},{id:"formal",label:"Formal",sample:"Understood. Proceeding now."},{id:"dry",label:"Dry",sample:"Sure. If we must."}],V_=["#22d3ee","#a78bfa","#f472b6","#facc15","#34d399","#fb7185"],qz=[{id:"drive",label:"Google Drive",note:"Files & docs"},{id:"notion",label:"Notion",note:"Wiki & notes"},{id:"gmail",label:"Gmail",note:"Inbox & threads"},{id:"calendar",label:"Calendar",note:"Schedule"},{id:"canva",label:"Canva",note:"Designs"},{id:"github",label:"GitHub",note:"Code & PRs"}],Kz=new Set(["login","missing","subscribe"]),Yz=new Set(["login","missing"]),q_={missing:{title:"Almost there — I need Claude installed before I can think.",subtitle:"That's the brain I run on. Install it once, then come back here.",cmdLabel:"Run this in your terminal",cmd:"curl -fsSL https://claude.ai/install.sh | bash",after:"Then come back and press the button below.",retry:"Still don't see Claude on this machine. Make sure the install finished, then try again."},login:{title:"One quick thing before we dig in — sign me in to Claude.",subtitle:"It's a one-time sign-in to your own Claude account — it runs on your machine, on your plan. After this you won't be asked again.",cmdLabel:"Run this once in your terminal",cmd:"claude auth login",after:"A browser window opens — sign in with your Claude account, then come back and press the button.",retry:"Hmm — still not signed in. Finish the sign-in in your browser, then press it again."},subscribe:{title:"You're in — I just need an active Claude plan to start thinking.",subtitle:"Claude Code runs on a Claude Pro plan (or higher). Grab one on your own account, then come back — you won’t be asked again.",cmdLabel:"Get a plan, then come back",link:"https://claude.ai/upgrade",linkLabel:"Open claude.ai →",after:"Subscribe at claude.ai, then come back and press the button.",retry:"Still no active plan showing. Give it a moment after subscribing, then try again."}},Gz=new Set(["md","txt","json","yml","yaml","toml","js","mjs","cjs","ts","tsx","jsx","py","rb","go","rs","java","kt","swift","c","h","cpp","cc","hpp","css","scss","html","sh","env","sql","xml","svg","csv"]);function Xz(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t+1).toLowerCase():""}function Jz(e){if(!e)return null;try{const t=new URL(e);return t.hostname==="localhost"||t.hostname==="127.0.0.1"?null:t.protocol==="http:"&&(t.port===""||t.port==="80")||t.protocol==="https:"&&(t.port===""||t.port==="443")?t.hostname:`${t.hostname}:${t.port}`}catch{return null}}async function Zz(e){const t=Array.from(e||[]).slice(0,200);if(t.length===0)return{folderName:null,files:[]};const n=(t[0].webkitRelativePath||t[0].name).split("/")[0]||"folder",r=40,i=600,s=[];for(const a of t){if(s.length>=r)break;const l=a.webkitRelativePath||a.name,c=Xz(a.name);if(!Gz.has(c)){s.push({path:l,head:""});continue}if(a.size>100*1024){s.push({path:l,head:""});continue}try{const f=await a.slice(0,i).text();s.push({path:l,head:f})}catch{s.push({path:l,head:""})}}const o=Math.max(t.length-s.length,0);return{folderName:n,files:s,totalFiles:t.length,untouched:o}}function Qz({peekSummary:e,services:t,agentName:n}){const r=[],i=e!=null&&e.folderName?` (you just glanced at "${e.folderName}")`:"";return r.push({kind:"survey",title:"Tell me what's in my workspace",sub:e!=null&&e.folderName?"I'll read the workspace I'm running in and summarize.":"I'll read what's here and summarize the project."}),(t==null?void 0:t.size)>0?r.push({kind:"startup",title:"Help me start something new",sub:`${n} will ask one question to figure out what to build.`}):r.push({kind:"startup",title:"Help me start a project",sub:"Tell me the rough idea — I'll scaffold it."}),r.push({kind:"chat",title:"Just chat — find me work",sub:"No agenda yet. Get me into the workspace."}),r}function K_(e,t=55,n=380){const[r,i]=w.useState(""),[s,o]=w.useState(!1),[a,l]=w.useState(!1);return w.useEffect(()=>{if(!e){i(""),o(!1),l(!1);return}i(""),o(!1),l(!1);let c=0,d=null;const h=setTimeout(()=>{l(!0),d=setInterval(()=>{c+=1,i(e.slice(0,c)),c>=e.length&&(clearInterval(d),o(!0))},t)},n);return()=>{clearTimeout(h),d&&clearInterval(d)}},[e,t,n]),[r,s,a]}function si({children:e,from:t="agent",accent:n,streaming:r=!1}){return u.jsx("div",{className:`ob-bubble ob-bubble-${t}${r?" ob-bubble-streaming":""}`,style:t==="user"?{borderColor:n}:void 0,children:e})}function _s(){return u.jsx("span",{className:"ob-caret","aria-hidden":"true",children:"▍"})}function Y_(e){const t=Math.random().toString(36).slice(2,8);return`${e}-${Date.now().toString(36)}-${t}`}function eB({session:e,token:t,onComplete:n}){var lt,St,Nt,it;const[r,i]=w.useState(1),s=w.useMemo(()=>Jz(e==null?void 0:e.shareBaseUrl),[e==null?void 0:e.shareBaseUrl]),[o,a]=w.useState(((lt=e==null?void 0:e.identity)==null?void 0:lt.name)||""),[l,c]=w.useState(((St=e==null?void 0:e.identity)==null?void 0:St.tone)||"concise"),[d,h]=w.useState(((Nt=e==null?void 0:e.identity)==null?void 0:Nt.color)||V_[0]),[f,p]=w.useState(!1),[m,y]=w.useState(null),[b,_]=w.useState(null),[v,g]=w.useState(!1),[S,C]=w.useState(!1),[x,T]=w.useState(null),[P,B]=w.useState(""),[j,$]=w.useState(new Set(((it=e==null?void 0:e.identity)==null?void 0:it.connectedServices)||[])),[I,R]=w.useState(!1),[A,N]=w.useState(null),[z,U]=w.useState(null),[D,O]=w.useState(!1),k=w.useRef(null),Q=w.useRef(null),ne=w.useRef({}),[E,ce]=w.useState({}),_e=w.useCallback((F,ie,ve)=>{F&&ce(xe=>{const J=xe[F]||{text:"",done:!1,error:null},ke=ie==="text"?J.text+(ve||""):J.text,de={...xe,[F]:{...J,text:ke}};return ne.current[F]=ke,de})},[]),te=w.useCallback((F,ie)=>{F&&ce(ve=>{const xe=ve[F]||{text:"",done:!1,error:null};return{...ve,[F]:{...xe,done:!0,error:ie||xe.error}}})},[]);w.useEffect(()=>{let F=!1,ie=0,ve=null,xe=null;const J=()=>{if(F)return;const ke=window.location.protocol==="https:"?"wss":"ws",de=new URL(`${ke}://${window.location.host}/ws/chat`);t&&de.searchParams.set("t",t),xe=new WebSocket(de.toString()),Q.current=xe,xe.onmessage=je=>{var Re;let Ee;try{Ee=JSON.parse(je.data)}catch{return}Ee.type==="chunk"&&((Re=Ee.chunk)==null?void 0:Re.type)==="text"?_e(Ee.messageId,"text",Ee.chunk.text):Ee.type==="end"?te(Ee.messageId,null):Ee.type==="error"&&te(Ee.messageId,Ee.message||"agent error")},xe.onopen=()=>{ie=0},xe.onclose=()=>{if(Q.current=null,F)return;const je=Math.min(1e3*2**ie,8e3);ie+=1,ve=setTimeout(J,je)},xe.onerror=()=>{}};return J(),()=>{F=!0,clearTimeout(ve);try{xe==null||xe.close()}catch{}}},[t,_e,te]),w.useEffect(()=>{document.documentElement.style.setProperty("--accent",d),document.documentElement.style.setProperty("--accent-hot",d)},[d]);const ae=w.useMemo(()=>{const F={"content-type":"application/json"};return t&&(F.Authorization=`Bearer ${t}`),F},[t]);async function se(F){const ie=await fetch("/api/agent/identity",{method:"POST",headers:ae,body:JSON.stringify({name:o,tone:l,color:d,...F})});if(!ie.ok){const ve=await ie.json().catch(()=>({}));throw new Error(ve.error||`save failed (${ie.status})`)}return ie.json()}const he=w.useCallback(async(F=!1)=>{g(!0);try{const ie=await fetch(`/api/agent/readiness${F?"?fresh=1":""}`,{headers:ae});return ie.ok?await ie.json():{status:"unknown"}}catch{return{status:"unknown"}}finally{g(!1)}},[ae]);async function Pe(){if(y(null),!o.trim()){y("Pick a name — even just one syllable.");return}p(!0);try{await se({});const F=await he(!1);if(Kz.has(F.status)){_(F);return}i(2)}catch(F){y(String(F.message||F))}finally{p(!1)}}async function be(){const F=await he(!0);if(C(!0),F.status==="login"||F.status==="missing"){_(F);return}_(null),i(2)}async function Se(){const F=await he(!0);if(F.status==="ready"||F.status==="unknown"){T(null),_(null),i(2);return}T(null),_(F)}async function L(){C(!1),T({status:"starting",url:null,error:null});try{const ie=await(await fetch("/api/agent/login/start",{method:"POST",headers:ae})).json();T(ie),ie.status==="success"&&Se()}catch{T({status:"error",url:null,error:"Could not start sign-in."})}}async function ge(){const F=P.trim();if(F){B("");try{const ie=await fetch("/api/agent/login/code",{method:"POST",headers:{...ae,"content-type":"application/json"},body:JSON.stringify({code:F})});T(await ie.json())}catch{}}}w.useEffect(()=>{if(!(x&&["starting","awaiting-browser","awaiting-code"].includes(x.status)))return;let ie=!0;const ve=setInterval(async()=>{try{const J=await(await fetch("/api/agent/login/status",{headers:ae})).json();if(!ie)return;T(J),J.status==="success"&&(clearInterval(ve),Se())}catch{}},2e3);return()=>{ie=!1,clearInterval(ve)}},[x==null?void 0:x.status,ae]);const[oe,ye]=w.useState(null),Te=oe?E[oe]:null;async function Le(F){if(U(null),!(!F||F.length===0)){R(!0);try{const ie=await Zz(F);if(ie.files.length===0){U("That folder looks empty — try another?"),R(!1);return}N(ie);const ve=Y_("peek");ye(ve),ce(J=>({...J,[ve]:{text:"",done:!1,error:null}}));const xe=await fetch("/api/onboarding/peek",{method:"POST",headers:ae,body:JSON.stringify({folderName:ie.folderName,files:ie.files,totalFiles:ie.totalFiles,messageId:ve})});if(!xe.ok){const J=await xe.json().catch(()=>({}));throw new Error(J.error||`peek failed (${xe.status})`)}}catch(ie){U(String(ie.message||ie))}finally{R(!1)}}}function Y(F){$(ie=>{const ve=new Set(ie);return ve.has(F)?ve.delete(F):ve.add(F),ve})}const[pe,Ae]=w.useState(null),[Ke,Et]=w.useState(null),[ir,pt]=w.useState(null),M=pe?E[pe]:null,[H,ue]=w.useState(null),[Ce,De]=w.useState(!1);async function nt(){pt(null),Et("remix"),De(!0);try{const ve=((await(await fetch("/api/bazaar/shelf",{headers:ae})).json()).recipes||[]).slice().sort((xe,J)=>(J.outcomeScore||0)-(xe.outcomeScore||0)).slice(0,3);ue(ve)}catch{ue([])}finally{De(!1)}}async function mt(F){var ve;const ie=`Build me “${F.title}”. Use ${((ve=F.producer)==null?void 0:ve.name)||"the producer"}'s recipe.`;try{await se({connectedServices:[...j]}),await fetch("/api/agent/onboarded",{method:"POST",headers:ae}),n==null||n({build:ie})}catch(xe){pt(String(xe.message||xe))}}async function Dt(F){pt(null),Et(F);const ie=Y_("job");Ae(ie),ce(ve=>({...ve,[ie]:{text:"",done:!1,error:null}}));try{await se({connectedServices:[...j]});const ve=await fetch("/api/onboarding/start-job",{method:"POST",headers:ae,body:JSON.stringify({kind:F,messageId:ie,peekFolderName:(A==null?void 0:A.folderName)||null})});if(!ve.ok){const xe=await ve.json().catch(()=>({}));throw new Error(xe.error||`start-job failed (${ve.status})`)}}catch(ve){pt(String(ve.message||ve)),Ae(null),Et(null)}}async function sn(){var F;try{await se({connectedServices:[...j]});const ie=await fetch("/api/agent/onboarded",{method:"POST",headers:ae});if(!ie.ok){const xe=await ie.json().catch(()=>({}));throw new Error(xe.error||`mark-onboarded failed (${ie.status})`)}let ve=null;if(pe&&(M!=null&&M.done)&&M.text&&!M.error){const xe=((F=Ve.find(J=>J.kind===Ke))==null?void 0:F.title)||"Let’s get started";ve={messageId:pe,userText:xe,agentText:M.text}}n==null||n(ve?{seedChat:ve}:void 0)}catch(ie){y(String(ie.message||ie))}}const Ot=o.trim()||"your agent",at="Hey. I'm new here.",rt="Before we start — what should I call myself?",[Vt,Hn]=K_(r===1?at:"",65,420),[Wn,gr]=K_(r===1&&Hn?rt:"",48,520),Ue=r===1?gr:!0,Ve=w.useMemo(()=>Qz({peekSummary:A,services:j,agentName:Ot}),[A,j,Ot]),$e=b?q_[b.status]||q_.login:null,Ge=b?Yz.has(b.status):!1;return u.jsx("div",{className:"ob-root",children:u.jsxs("div",{className:"ob-stage",children:[u.jsxs("div",{className:"ob-brand",children:[u.jsx("span",{className:"ob-brand-mark",children:"✦"})," VentureWild"]}),u.jsxs("header",{className:"ob-header",children:[u.jsx("div",{className:"ob-step-dots","aria-label":`Step ${r} of 4`,children:[1,2,3,4].map(F=>u.jsx("span",{className:`ob-dot ${F===r?"active":""} ${F<r?"done":""}`},F))}),r>1&&!b&&u.jsx("button",{className:"ob-back",onClick:()=>i(r-1),children:"← Back"})]}),b&&$e&&u.jsxs("section",{className:"ob-step",children:[u.jsxs(si,{children:[u.jsx("p",{className:"ob-bubble-text",children:$e.title}),u.jsx("p",{className:"ob-bubble-subtle",children:$e.subtitle})]}),u.jsxs("div",{className:"ob-card ob-reveal",children:[b.status==="login"?u.jsxs("div",{className:"ob-login-inapp",children:[(!x||x.status==="idle")&&u.jsx("button",{className:"ob-next primary",onClick:L,children:"Sign in to Claude →"}),x&&(x.status==="starting"||x.status==="awaiting-browser")&&u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"ob-bubble-text",children:"Opening Claude in your browser…"}),u.jsx("p",{className:"ob-bubble-subtle",children:"Sign in there with your Claude account — I'll detect it automatically, nothing to come back and click."}),x.url&&u.jsx("a",{className:"ob-login-link",href:x.url,target:"_blank",rel:"noreferrer",children:"If the browser didn't open, click here →"})]}),x&&x.status==="awaiting-code"&&u.jsxs("div",{className:"ob-login-code",children:[u.jsx("label",{className:"ob-label",children:"Paste the code from your browser"}),u.jsxs("div",{className:"ob-actions",children:[u.jsx("input",{className:"ob-input",value:P,onChange:F=>B(F.target.value),placeholder:"code from claude.ai"}),u.jsx("button",{className:"ob-next primary",onClick:ge,children:"Submit"})]})]}),x&&(x.status==="error"||x.status==="unsupported")&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"ob-error",children:[x.error||"I couldn't run the in-app sign-in."," You can sign in from a terminal instead:"]}),u.jsx("div",{className:"ob-login-cmd",children:u.jsx("code",{children:$e.cmd})}),u.jsx("p",{className:"ob-bubble-subtle",style:{marginTop:10},children:$e.after})]})]}):u.jsxs(u.Fragment,{children:[u.jsx("label",{className:"ob-label",children:$e.cmdLabel}),$e.cmd?u.jsx("div",{className:"ob-login-cmd",children:u.jsx("code",{children:$e.cmd})}):u.jsx("a",{className:"ob-login-link",href:$e.link,target:"_blank",rel:"noreferrer",children:$e.linkLabel}),u.jsx("p",{className:"ob-bubble-subtle",style:{marginTop:10},children:$e.after})]}),S&&u.jsx("div",{className:"ob-error",style:{marginTop:12},children:$e.retry}),u.jsx("div",{className:"ob-actions",children:u.jsx("button",{className:"ob-next primary",onClick:be,disabled:v,children:v?"Checking…":"I've done it — continue →"})}),!Ge&&u.jsx("div",{className:"ob-actions",children:u.jsx("button",{className:"ob-skip",onClick:()=>{_(null),i(2)},children:"I already have a plan — continue"})})]})]}),r===1&&!b&&u.jsxs("section",{className:"ob-step",children:[u.jsxs(si,{streaming:!Hn||!gr,children:[u.jsxs("p",{className:"ob-bubble-text",children:[Vt,!Hn&&u.jsx(_s,{})]}),Hn&&u.jsxs("p",{className:"ob-bubble-text",children:[Wn,!gr&&u.jsx(_s,{})]})]}),Ue&&u.jsxs("div",{className:"ob-card ob-reveal",children:[u.jsx("label",{className:"ob-label",children:"Name"}),u.jsx("input",{autoFocus:!0,className:"ob-input",placeholder:"Echo, Pip, Atlas, Sage…",value:o,onChange:F=>a(F.target.value),onKeyDown:F=>{F.key==="Enter"&&Pe()},maxLength:40}),u.jsx("label",{className:"ob-label",children:"Voice"}),u.jsx("div",{className:"ob-tone-grid",children:Vz.map(F=>u.jsxs("button",{className:`ob-tone ${l===F.id?"selected":""}`,onClick:()=>c(F.id),children:[u.jsx("span",{className:"ob-tone-label",children:F.label}),u.jsx("span",{className:"ob-tone-sample",children:F.sample})]},F.id))}),u.jsx("label",{className:"ob-label",children:"Color"}),u.jsx("div",{className:"ob-color-row",children:V_.map(F=>u.jsx("button",{className:`ob-color-swatch ${d===F?"selected":""}`,style:{background:F},onClick:()=>h(F),"aria-label":`Pick ${F}`},F))}),m&&u.jsx("div",{className:"ob-error",children:m}),u.jsx("div",{className:"ob-actions",children:u.jsx("button",{className:"ob-next primary",onClick:Pe,disabled:f||!o.trim(),children:f?"Saving…":`I'm ${Ot}. Let's go →`})})]})]}),r===2&&u.jsxs("section",{className:"ob-step",children:[u.jsxs(si,{children:[u.jsx("p",{className:"ob-bubble-text",children:"Cool. Now — show me something you're working on. Drag a folder onto me."}),u.jsx("p",{className:"ob-bubble-subtle",children:"I'll read filenames + a short sample of each text file (≤40 files, ≤600 bytes each) so I can react. Files stay on your machine; the sample goes to Anthropic the same way every chat turn does. Pick something you'd be OK talking about in chat."})]}),u.jsxs("div",{className:`ob-dropzone ${D?"over":""} ${I?"peeking":""}`,onDragOver:F=>{F.preventDefault(),O(!0)},onDragLeave:()=>O(!1),onDrop:async F=>{var ve,xe;F.preventDefault(),O(!1);const ie=(ve=F.dataTransfer)==null?void 0:ve.items;if(ie&&ie.length>0&&ie[0].webkitGetAsEntry){const J=[],ke=async(de,je="")=>{if(de.isFile)await new Promise(Ee=>de.file(Re=>{try{Object.defineProperty(Re,"webkitRelativePath",{value:`${je}${Re.name}`})}catch{}J.push(Re),Ee()},Ee));else if(de.isDirectory){const Ee=de.createReader();await new Promise(Re=>Ee.readEntries(async Je=>{for(const gt of Je)await ke(gt,`${je}${de.name}/`);Re()},Re))}};for(const de of ie){const je=de.webkitGetAsEntry();je&&await ke(je)}if(J.length>0){await Le(J);return}}await Le((xe=F.dataTransfer)==null?void 0:xe.files)},onClick:()=>{var F;return(F=k.current)==null?void 0:F.click()},children:[u.jsx("input",{ref:k,type:"file",webkitdirectory:"",directory:"",multiple:!0,style:{display:"none"},onChange:F=>Le(F.target.files)}),I?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"ob-drop-icon",children:"👀"}),u.jsx("div",{className:"ob-drop-title",children:"Looking…"})]}):A?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"ob-drop-icon",children:"📁"}),u.jsx("div",{className:"ob-drop-title",children:A.folderName}),u.jsxs("div",{className:"ob-drop-sub",children:[A.totalFiles," file",A.totalFiles===1?"":"s"," · sampled ",A.files.length]})]}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"ob-drop-icon",children:"📂"}),u.jsx("div",{className:"ob-drop-title",children:"Drop a folder here"}),u.jsx("div",{className:"ob-drop-sub",children:"or click to pick one"})]})]}),Te&&u.jsxs(si,{streaming:!Te.done,children:[Te.text?u.jsxs("p",{className:"ob-bubble-text",children:[Te.text,!Te.done&&u.jsx(_s,{})]}):u.jsxs("p",{className:"ob-bubble-subtle",children:["👀 ",Ot," is reading…",!Te.done&&u.jsx(_s,{})]}),Te.error&&u.jsx("p",{className:"ob-bubble-subtle ob-bubble-error",children:Te.error})]}),z&&u.jsx("div",{className:"ob-error",children:z}),u.jsxs("div",{className:"ob-actions",children:[u.jsx("button",{className:"ob-skip",onClick:()=>i(3),children:"Skip — I'd rather just chat"}),u.jsx("button",{className:"ob-next primary",onClick:()=>i(3),disabled:!A&&!z,children:"Next →"})]})]}),r===3&&u.jsxs("section",{className:"ob-step",children:[u.jsxs(si,{children:[u.jsx("p",{className:"ob-bubble-text",children:"Anything I should keep an eye on?"}),u.jsx("p",{className:"ob-bubble-subtle",children:"Totally optional. Flag what lives in your world and I'll wire it up when these land — you can always add more later."})]}),u.jsx("div",{className:"ob-tile-grid",children:qz.map(F=>u.jsxs("button",{className:`ob-tile ${j.has(F.id)?"selected":""}`,onClick:()=>Y(F.id),children:[u.jsx("span",{className:"ob-tile-label",children:F.label}),u.jsx("span",{className:"ob-tile-note",children:F.note}),j.has(F.id)&&u.jsx("span",{className:"ob-tile-check",children:"✓"})]},F.id))}),u.jsxs("div",{className:"ob-soon",children:["These connection flows are landing soon — your picks are saved. And I don't live on one device:",s?u.jsxs(u.Fragment,{children:[" open ",u.jsx("code",{children:s})," on your phone with the same login"]}):u.jsx(u.Fragment,{children:" sign in on any device with the same login"})," ","and I'm right there — same memory, same conversation."]}),u.jsxs("div",{className:"ob-actions",children:[u.jsx("button",{className:"ob-skip",onClick:()=>i(4),children:"Skip →"}),u.jsx("button",{className:"ob-next primary",onClick:()=>i(4),children:"Next: first job →"})]})]}),r===4&&u.jsxs("section",{className:"ob-step",children:[u.jsxs(si,{children:[u.jsx("p",{className:"ob-bubble-text",children:"Right — what should I actually do for you first?"}),u.jsx("p",{className:"ob-bubble-subtle",children:"Pick one and I'll start now. Or close this and just talk to me."})]}),H?u.jsxs("div",{className:"ob-remix",children:[u.jsx(si,{children:u.jsx("p",{className:"ob-bubble-text",children:"Here's what other builders already got working. Pick one — I'll build it for you the moment you land in your workspace."})}),H.length===0?u.jsx("div",{className:"ob-error",children:"The shelf is empty right now — start from scratch instead."}):H.map(F=>{var ie;return u.jsxs("button",{className:"ob-remix-card",onClick:()=>mt(F),children:[u.jsxs("div",{className:"ob-remix-main",children:[u.jsx("span",{className:"ob-remix-title",children:F.title}),u.jsxs("span",{className:"ob-remix-by",children:["by ",((ie=F.producer)==null?void 0:ie.name)||"a builder"]}),F.pitch&&u.jsx("span",{className:"ob-remix-pitch",children:F.pitch})]}),u.jsxs("div",{className:"ob-remix-stat",children:[u.jsxs("span",{className:"ob-remix-pct",children:[Math.round((F.outcomeScore||0)*100),"%"]}),u.jsx("span",{className:"ob-remix-pct-sub",children:"worked"})]})]},F.id)}),u.jsx("div",{className:"ob-actions",children:u.jsx("button",{className:"ob-skip",onClick:()=>{ue(null),Et(null)},children:"← Pick a different job"})})]}):pe?u.jsxs(u.Fragment,{children:[u.jsxs(si,{streaming:!M||!M.done,children:[M!=null&&M.text?u.jsxs("p",{className:"ob-bubble-text",children:[M.text,!M.done&&u.jsx(_s,{})]}):u.jsxs("p",{className:"ob-bubble-subtle",children:[Ot," is on it…",(!M||!M.done)&&u.jsx(_s,{})]}),(M==null?void 0:M.error)&&u.jsx("p",{className:"ob-bubble-subtle ob-bubble-error",children:M.error})]}),u.jsxs("div",{className:"ob-actions",children:[u.jsx("button",{className:"ob-skip",onClick:()=>{Ae(null),Et(null)},children:"← Pick a different job"}),u.jsx("button",{className:"ob-next primary",onClick:sn,disabled:!M||!M.done&&!M.error,children:M!=null&&M.done?"Open my workspace →":"Streaming…"})]})]}):u.jsxs("div",{className:"ob-jobs",children:[u.jsxs("button",{className:"ob-job ob-job-remix",onClick:nt,disabled:Ce,children:[u.jsx("div",{className:"ob-job-title",children:"✦ Remix a proven build"}),u.jsx("div",{className:"ob-job-sub",children:Ce?"Pulling up what others have made…":"Start from something other builders already got working — I'll build one for you now."})]}),Ve.map(F=>u.jsxs("button",{className:"ob-job",onClick:()=>Dt(F.kind),children:[u.jsx("div",{className:"ob-job-title",children:F.title}),u.jsx("div",{className:"ob-job-sub",children:F.sub})]},F.kind))]}),(m||ir)&&u.jsx("div",{className:"ob-error",children:m||ir}),!pe&&!H&&u.jsx("div",{className:"ob-actions",children:u.jsx("button",{className:"ob-skip",onClick:sn,children:"Skip to chat →"})})]}),!b&&u.jsx("p",{className:"ob-consent-note",children:"I quietly share how I'm doing — what's working, what breaks, my setup health — with the Venturewild team so they can help if you ever get stuck. Never your words or files. You can turn this off anytime."})]})})}const tB={display:"grid",placeItems:"center",minHeight:"100vh",padding:24,textAlign:"center"},nB={maxWidth:420,display:"grid",gap:16,justifyItems:"center"},rB={fontSize:44,letterSpacing:"0.18em",fontWeight:700,fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",color:"var(--accent, #22d3ee)"};function iB(e){return e&&e.length===6?`${e.slice(0,3)} ${e.slice(3)}`:e}function G_(e=typeof window<"u"?window.location:null){if(!e)return null;const t=String(e.hostname||"");if(!t.endsWith(".venturewild.llc"))return null;const n=t.split(".")[0];return n?`https://sync.venturewild.llc/auth/google/start?slug=${encodeURIComponent(n)}`:null}const sB={display:"inline-flex",alignItems:"center",gap:10,padding:"11px 18px",borderRadius:10,background:"#fff",color:"#1f2937",fontWeight:600,textDecoration:"none",border:"1px solid #dadce0",boxShadow:"0 1px 2px rgba(0,0,0,0.08)"};function oB(){const[e,t]=w.useState("starting"),[n,r]=w.useState(null),[i,s]=w.useState(null),[o,a]=w.useState(0),[l,c]=w.useState(0),d=w.useRef({requestId:null,pollAfterMs:2500}),h=w.useCallback(async()=>{t("starting"),r(null);try{const f=await fetch("/api/auth/pair/start",{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(f.status===429){t("error"),r("Too many sign-in attempts right now. Wait a minute, then try again.");return}if(!f.ok){t("error"),r("Could not start sign-in. Please try again.");return}const p=await f.json();d.current={requestId:p.requestId,pollAfterMs:p.pollAfterMs||2500},s(p.code),a(p.expiresAt||0),t("waiting")}catch{t("error"),r("Network error. Check your connection and try again.")}},[]);return w.useEffect(()=>{h()},[h]),w.useEffect(()=>{if(e!=="waiting")return;let f=!1,p=null;const{requestId:m,pollAfterMs:y}=d.current;async function b(){try{const _=await fetch("/api/auth/pair/status",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({requestId:m})});if(f)return;const v=await _.json().catch(()=>({}));if(v.status==="approved"&&v.token){if((await fetch("/api/auth/exchange",{method:"POST",headers:{Authorization:`Bearer ${v.token}`}})).ok){window.location.reload();return}t("error"),r("Almost there — sign-in completed but the session could not be saved. Try again.");return}if(v.status==="denied"){t("error"),r("This device was denied.");return}if(v.status==="expired"){t("error"),r("The code expired before it was approved.");return}p=setTimeout(b,y)}catch{f||(p=setTimeout(b,y))}}return p=setTimeout(b,y),()=>{f=!0,clearTimeout(p)}},[e]),w.useEffect(()=>{if(e!=="waiting"||!o)return;const f=()=>c(Math.max(0,Math.round((o-Date.now())/1e3)));f();const p=setInterval(f,1e3);return()=>clearInterval(p)},[e,o]),u.jsx("div",{className:"app",style:{gridTemplateRows:"1fr"},children:u.jsx("div",{style:tB,children:u.jsxs("div",{style:nB,children:[u.jsx("h2",{style:{margin:0},children:"Sign in to this workspace"}),G_()&&u.jsxs(u.Fragment,{children:[u.jsxs("a",{href:G_(),style:sB,"data-testid":"google-signin",children:[u.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18","aria-hidden":"true",children:[u.jsx("path",{fill:"#4285F4",d:"M17.64 9.2c0-.64-.06-1.25-.16-1.84H9v3.48h4.84a4.14 4.14 0 0 1-1.8 2.72v2.26h2.92c1.71-1.57 2.68-3.89 2.68-6.62z"}),u.jsx("path",{fill:"#34A853",d:"M9 18c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.81.54-1.84.86-3.04.86-2.34 0-4.32-1.58-5.03-3.7H.96v2.33A9 9 0 0 0 9 18z"}),u.jsx("path",{fill:"#FBBC05",d:"M3.97 10.72A5.41 5.41 0 0 1 3.68 9c0-.6.1-1.18.29-1.72V4.95H.96A9 9 0 0 0 0 9c0 1.45.35 2.82.96 4.05l3.01-2.33z"}),u.jsx("path",{fill:"#EA4335",d:"M9 3.58c1.32 0 2.5.45 3.44 1.35l2.58-2.59C13.46.89 11.43 0 9 0A9 9 0 0 0 .96 4.95l3.01 2.33C4.68 5.16 6.66 3.58 9 3.58z"})]}),"Continue with Google"]}),u.jsx("div",{style:{color:"var(--text-muted)",fontSize:12},children:"or approve from another device you’re signed in on:"})]}),e==="starting"&&u.jsxs("p",{style:{color:"var(--text-muted)"},children:[u.jsx("span",{className:"spinner"})," Preparing…"]}),e==="waiting"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{style:{color:"var(--text-muted)",margin:0},children:"On a device where you’re already signed in, open this workspace and approve this code:"}),u.jsx("div",{style:rB,"data-testid":"pair-code",children:iB(i)}),u.jsxs("p",{style:{color:"var(--text-muted)",fontSize:13,margin:0},children:["Waiting for approval",l?` · expires in ${l}s`:"","…"]})]}),e==="error"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{style:{color:"var(--error)"},children:n}),u.jsx("button",{onClick:h,children:"Try again"})]})]})})})}const aB={position:"fixed",top:12,left:"50%",transform:"translateX(-50%)",zIndex:1e3,background:"var(--surface, #1e293b)",border:"1px solid var(--accent, #22d3ee)",borderRadius:10,padding:"12px 16px",boxShadow:"0 8px 24px rgba(0,0,0,0.35)",display:"grid",gap:10,maxWidth:460},lB={display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},cB={fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",letterSpacing:"0.12em",fontWeight:700,color:"var(--accent, #22d3ee)"};function uB(e){return e&&e.length===6?`${e.slice(0,3)} ${e.slice(3)}`:e}function hB({token:e}){const[t,n]=w.useState([]),[r,i]=w.useState(null),[s,o]=w.useState(null),a=w.useRef(!0),l=w.useCallback((h={})=>e?{Authorization:`Bearer ${e}`,...h}:h,[e]),c=w.useCallback(async()=>{try{const h=await fetch("/api/auth/pair/requests",{headers:l()});if(!h.ok)return;const f=await h.json();a.current&&n(Array.isArray(f.requests)?f.requests:[])}catch{}},[l]);w.useEffect(()=>{a.current=!0,c();const h=setInterval(c,5e3);return()=>{a.current=!1,clearInterval(h)}},[c]);async function d(h,f,p){if(!r){i(h),o(null);try{const m=await fetch(`/api/auth/pair/${f}`,{method:"POST",headers:l({"content-type":"application/json"}),body:JSON.stringify({requestId:h})});m.ok&&f==="approve"?o({ok:!0,text:`Approved ${p}.`}):m.ok||o({ok:!1,text:"That request is no longer waiting."})}catch{o({ok:!1,text:"Network error."})}finally{i(null),c()}}}return t.length===0?null:u.jsxs("div",{style:aB,"data-testid":"pair-approvals",children:[u.jsx("strong",{style:{fontSize:13},children:t.length===1?"A device wants to sign in":`${t.length} devices want to sign in`}),u.jsx("span",{style:{fontSize:12,color:"var(--text-muted)"},children:"Check that the code matches the one on that device, then approve."}),t.map(h=>u.jsxs("div",{style:lB,children:[u.jsx("span",{style:{fontSize:13},children:h.label}),u.jsx("span",{style:cB,"data-testid":"pair-request-code",children:uB(h.code)}),u.jsx("span",{className:"spacer",style:{flex:1}}),u.jsx("button",{onClick:()=>d(h.requestId,"approve",h.label),disabled:r===h.requestId,"data-testid":"pair-approve-btn",children:r===h.requestId?"Approving…":"Approve"}),u.jsx("button",{onClick:()=>d(h.requestId,"deny",h.label),disabled:r===h.requestId,style:{background:"transparent",color:"var(--text-muted)"},children:"Deny"})]},h.requestId)),s&&u.jsx("span",{style:{fontSize:12,color:s.ok?"var(--accent, #22d3ee)":"var(--error)"},children:s.text})]})}const dB=15e3,fB=2500;function pB(e){const t=Math.round(e/6e4);return t<=0?"expiring":t<60?`${t} min`:`${Math.floor(t/60)}h ${t%60}m`}function mB({token:e}){var g;const[t,n]=w.useState(null),[r,i]=w.useState(!1),[s,o]=w.useState(!1),a=w.useRef(null),l=w.useRef(null),c=w.useCallback(()=>e?{Authorization:`Bearer ${e}`}:{},[e]),d=w.useCallback(async()=>{try{const S=await fetch("/api/support/status",{headers:c()});if(!S.ok)return;n(await S.json())}catch{}},[c]),h=!!((g=t==null?void 0:t.operate)!=null&&g.active);w.useEffect(()=>{d();const S=h?fB:dB;return a.current=setInterval(d,S),()=>clearInterval(a.current)},[d,h]),w.useLayoutEffect(()=>{const S=()=>{const C=l.current?l.current.offsetHeight:0;document.documentElement.style.setProperty("--support-banner-h",`${C}px`)};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)}),w.useEffect(()=>()=>document.documentElement.style.setProperty("--support-banner-h","0px"),[]);const f=w.useCallback(async()=>{i(!0);try{await fetch("/api/support/revoke",{method:"POST",headers:c()})}catch{}i(!1),d()},[c,d]),p=w.useCallback(async()=>{o(!0);try{await fetch("/api/support/operate/cancel",{method:"POST",headers:c()})}catch{}o(!1),d()},[c,d]);if(!t)return null;const m=t.operate||null;if(!t.enabled&&!t.active&&!m)return null;if(m){const S=(m.lines||[]).slice(-6);return u.jsxs("div",{ref:l,role:"status","aria-live":"polite",style:X_(!0),children:[u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,width:"100%"},children:[u.jsx("span",{"aria-hidden":"true",children:"⚙️"}),u.jsx("span",{style:{fontWeight:600},children:m.active?"VentureWild support is operating your agent":"VentureWild support finished helping"}),m.active&&u.jsx("button",{type:"button",onClick:p,disabled:s,style:bh,children:s?"Stopping…":"Stop"}),u.jsx("button",{type:"button",onClick:f,disabled:r,style:{...bh,marginLeft:m.active?0:"auto"},children:r?"Revoking…":"Revoke access"})]}),S.length>0&&u.jsx("div",{"data-testid":"operate-transcript",style:{width:"100%",marginTop:4,maxHeight:96,overflowY:"auto",font:"12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace",opacity:.92,whiteSpace:"pre-wrap"},children:S.map((C,x)=>u.jsx("div",{children:C.text},`${C.ts}-${x}`))})]})}const b=t.active,_=b?"VentureWild support is connected":`Support access allowed (tier ${t.tier})`,v=b?t.lastAction?`last action: ${t.lastAction.action}`:"a support session is live":`auto-expires in ${pB(t.remainingMs)}`;return u.jsxs("div",{ref:l,role:"status","aria-live":"polite",style:X_(b),children:[u.jsx("span",{"aria-hidden":"true",children:b?"🟢":"🛟"}),u.jsx("span",{style:{fontWeight:600},children:_}),u.jsxs("span",{style:{opacity:.8},children:["· ",v]}),u.jsx("button",{type:"button",onClick:f,disabled:r,style:{...bh,marginLeft:"auto"},children:r?"Revoking…":"Revoke"})]})}function X_(e){return{position:"fixed",top:0,left:0,right:0,zIndex:9999,display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"6px 14px",background:e?"var(--accent, #0891b2)":"var(--surface-2, #f4f4f5)",color:e?"var(--accent-ink, #fff)":"var(--text, #222)",borderBottom:"1px solid var(--border, #e4e4e7)",boxShadow:"0 1px 6px rgba(0,0,0,0.12)",font:"13px/1.4 -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"}}const bh={padding:"3px 12px",borderRadius:6,border:"1px solid currentColor",background:"transparent",color:"inherit",cursor:"pointer",fontWeight:600},gB={partner:"Partner",viewer:"Viewer",client:"Client"},bs=12,Mi=[{id:"chat-1",type:"chat"}],yB={lg:[{i:"chat-1",x:0,y:0,w:8,h:bs,minW:3,minH:4}]},_B={chat:{w:5,h:12},liveview:{w:4,h:12},notes:{w:3,h:6},earnings:{w:3,h:5},analytics:{w:4,h:7},usage:{w:3,h:6},powers:{w:3,h:7},files:{w:3,h:12},code:{w:5,h:12},todo:{w:3,h:7},logs:{w:4,h:8},datatable:{w:6,h:8},deploy:{w:4,h:7},peers:{w:3,h:6}},vB=[{type:"liveview",title:"Live view",icon:"👁️",desc:"See what your agent builds, live."},{type:"files",title:"Files",icon:"📁",desc:"Browse your workspace files.",cap:"fileTree"},{type:"code",title:"Code",icon:"💻",desc:"View a file, with highlighting.",cap:"fileTree"},{type:"notes",title:"Notes",icon:"📝",desc:"A place to jot anything."},{type:"todo",title:"To-do",icon:"✅",desc:"A simple checklist."},{type:"logs",title:"Logs",icon:"📋",desc:"Tail your workspace logs, live.",cap:"fileTree"},{type:"datatable",title:"Data table",icon:"🗂️",desc:"View a CSV or JSON file as a sortable table.",cap:"fileTree"},{type:"deploy",title:"Deploy",icon:"🚀",desc:"Put your build online (agent-driven)."},{type:"usage",title:"Usage",icon:"🔋",desc:"Your plan usage + working memory, live."},{type:"powers",title:"Powers",icon:"🧰",desc:"Your skills — one tap to run."},{type:"peers",title:"Builders like you",icon:"🌱",desc:"Real things real people built here."},{type:"chat",title:"Another chat",icon:"🗨️",desc:"A second, independent conversation."}],bB=[{type:"earnings",title:"Producer earnings",icon:"💸",desc:"Watch represented earnings tick in, live."},{type:"analytics",title:"Shelf analytics",icon:"📊",desc:"Who's earning across the marketplace."}],wB=[{id:"just-chat",name:"Just chat",icon:"💬",desc:"Only the conversation — clean and focused.",blocks:[{type:"chat",l:{x:0,y:0,w:8,h:12,minW:3,minH:4}}]},{id:"build",name:"Build",icon:"🔨",desc:"Chat, a live view, and your powers.",blocks:[{type:"chat",l:{x:0,y:0,w:6,h:12,minW:3,minH:4}},{type:"liveview",l:{x:6,y:0,w:6,h:8,minW:3,minH:3}},{type:"powers",l:{x:6,y:8,w:6,h:4,minW:3,minH:3}}]},{id:"producer",name:"Producer",icon:"💸",desc:"Chat + your earnings, usage, and the shelf.",blocks:[{type:"chat",l:{x:0,y:0,w:6,h:12,minW:3,minH:4}},{type:"earnings",l:{x:6,y:0,w:6,h:4,minW:3,minH:3}},{type:"usage",l:{x:6,y:4,w:6,h:4,minW:3,minH:3}},{type:"analytics",l:{x:6,y:8,w:6,h:4,minW:3,minH:3}}]},{id:"workspace",name:"Workspace",icon:"📝",desc:"Chat, a live view, your usage, and notes.",blocks:[{type:"chat",l:{x:0,y:0,w:6,h:12,minW:3,minH:4}},{type:"liveview",l:{x:6,y:0,w:6,h:6,minW:3,minH:3}},{type:"usage",l:{x:6,y:6,w:6,h:3,minW:3,minH:3}},{type:"notes",l:{x:6,y:9,w:6,h:3,minW:3,minH:3}}]},{id:"code",name:"Code",icon:"💻",desc:"Chat with a file browser and a code view.",cap:"fileTree",blocks:[{type:"chat",l:{x:0,y:0,w:4,h:12,minW:3,minH:4}},{type:"files",l:{x:4,y:0,w:3,h:12,minW:2,minH:4}},{type:"code",l:{x:7,y:0,w:5,h:12,minW:3,minH:4}}]}];let J_=0;function Co(e){return J_+=1,`${e}-${Date.now().toString(36)}-${J_}`}function SB(e=640){const[t,n]=w.useState(()=>typeof window<"u"&&window.innerWidth<=e);return w.useEffect(()=>{if(typeof window>"u")return;const r=window.matchMedia(`(max-width: ${e}px)`),i=()=>n(r.matches);return i(),r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[e]),t}function xB(){var gt,et,zt,Di,Un,Jr;const[e,t]=w.useState(null),[n,r]=w.useState(null),[i,s]=w.useState(!1),[o,a]=w.useState(()=>!Yo()),[l,c]=w.useState(()=>Yo()),[d,h]=w.useState(!1),[f,p]=w.useState(!1),[m,y]=w.useState(null),[b,_]=w.useState(!1),[v,g]=w.useState(!1),[S,C]=w.useState(!1),[x,T]=w.useState("build"),[P,B]=w.useState({}),[j,$]=w.useState(null),[I,R]=w.useState(null),[A,N]=w.useState(null),[z,U]=w.useState(null),[D,O]=w.useState(!1),[k,Q]=w.useState(null),[ne,E]=w.useState("use"),[ce,_e]=w.useState(!1),[te,ae]=w.useState(!1),[se,he]=w.useState(!1),[Pe,be]=w.useState(!1),[Se,L]=w.useState(()=>typeof window<"u"?FA():{mode:"light",accent:"#0891b2",hot:"#0e7490",accentManual:!1}),[ge,oe]=w.useState(null),[ye,Te]=w.useState(()=>{try{const W=JSON.parse(localStorage.getItem("wild:templates")||"[]");return Array.isArray(W)?W:[]}catch{return[]}}),[Le,Y]=w.useState(Mi),[pe,Ae]=w.useState(yB),[Ke,Et]=w.useState(!1),[ir,pt]=w.useState("chat-1"),M=SB(),H=w.useMemo(()=>typeof window>"u"?null:new URLSearchParams(window.location.search).get("t"),[]);w.useEffect(()=>{async function W(){try{const K={};H&&(K.Authorization=`Bearer ${H}`);const G=await fetch("/api/session",{headers:K});if(G.status===401){s(!0);return}if(!G.ok)throw new Error(`session fetch failed: ${G.status}`);const re=await G.json();t(re)}catch(K){r(K.message||String(K))}}W()},[H,l]),w.useEffect(()=>{HA(Se),$A(Se)},[Se]),w.useEffect(()=>{var K;const W=(K=e==null?void 0:e.identity)==null?void 0:K.color;W&&!Se.accentManual&&L(G=>G.accentManual?G:{...G,accent:W,hot:W})},[(gt=e==null?void 0:e.identity)==null?void 0:gt.color,Se.accentManual]);const ue=e!=null&&e.workspaceId?`wild:canvas:v2:${e.workspaceId}:${e.personKey||"local"}`:null,Ce=w.useRef(null);function De(W){clearTimeout(Ce.current),Ce.current=setTimeout(()=>{const K={"Content-Type":"application/json"};H&&(K.Authorization=`Bearer ${H}`),fetch("/api/canvas/state",{method:"POST",headers:K,body:JSON.stringify(W)}).catch(()=>{})},800)}w.useEffect(()=>{if(!ue||Ke)return;let W=!1;const K=H?{Authorization:`Bearer ${H}`}:{};return(async()=>{var G,re,me,Xe,ze,Pt,Vn,Pi;try{const qn=await fetch("/api/canvas/state",{headers:K});if(!qn.ok)throw new Error(qn.status);const jt=await qn.json();if(W)return;let pn=null;try{pn=JSON.parse(localStorage.getItem(ue))}catch{}if((re=(G=jt.layout)==null?void 0:G.blocks)!=null&&re.length||(ze=(Xe=(me=jt.layout)==null?void 0:me.layouts)==null?void 0:Xe.lg)!=null&&ze.length){let Bt=Array.isArray(jt.layout.blocks)&&jt.layout.blocks.length?jt.layout.blocks:Mi;Bt.some(Zr=>Zr.type==="chat")||(Bt=[...Mi,...Bt]),Y(Bt),(Pt=jt.layout.layouts)!=null&&Pt.lg&&Ae(jt.layout.layouts);try{localStorage.setItem(ue,JSON.stringify({blocks:Bt,layouts:jt.layout.layouts}))}catch{}}else if((Vn=pn==null?void 0:pn.blocks)!=null&&Vn.length){let Bt=Array.isArray(pn.blocks)&&pn.blocks.length?pn.blocks:Mi;Bt.some(Zr=>Zr.type==="chat")||(Bt=[...Mi,...Bt]),Y(Bt),(Pi=pn.layouts)!=null&&Pi.lg&&Ae(pn.layouts),De({layout:{blocks:Bt,layouts:pn.layouts||{lg:[]}}})}if(Array.isArray(jt.templates)&&jt.templates.length){Te(jt.templates);try{localStorage.setItem("wild:templates",JSON.stringify(jt.templates))}catch{}}if(jt.userTheme){const Bt=jt.userTheme;L(Zr=>({...Zr,mode:Bt.mode==="dark"?"dark":"light",accent:Bt.accent||Zr.accent,hot:Bt.hot||Zr.hot,accentManual:Bt.accentManual??Zr.accentManual,tokens:Bt.tokens||{}}))}}catch{if(W)return;try{const qn=localStorage.getItem(ue);if(qn){const jt=JSON.parse(qn);let pn=Array.isArray(jt.blocks)&&jt.blocks.length?jt.blocks:Mi;pn.some(Bt=>Bt.type==="chat")||(pn=[...Mi,...pn]),Y(pn),jt.layouts&&jt.layouts.lg&&Ae(jt.layouts)}}catch{}}W||Et(!0)})(),()=>{W=!0,clearTimeout(Ce.current)}},[ue]),w.useEffect(()=>{if(!(!ue||!Ke)){try{localStorage.setItem(ue,JSON.stringify({blocks:Le,layouts:pe}))}catch{}De({layout:{blocks:Le,layouts:pe}})}},[ue,Ke,Le,pe]);const nt=w.useRef(null);w.useEffect(()=>{if(Ke)return clearTimeout(nt.current),nt.current=setTimeout(()=>{De({userTheme:Se})},800),()=>clearTimeout(nt.current)},[Ke,Se]),w.useEffect(()=>{var G;if(!Ke||!((G=e==null?void 0:e.capabilities)!=null&&G.chat))return;let W=!1;const K=H?{Authorization:`Bearer ${H}`}:{};return fetch("/api/canvas/blocks",{headers:K}).then(re=>re.ok?re.json():null).then(re=>{W||!Array.isArray(re==null?void 0:re.blocks)||!re.blocks.length||(Y(me=>{const Xe=new Set(me.map(Pt=>Pt.id)),ze=re.blocks.filter(Pt=>Pt.id&&!Xe.has(Pt.id));return ze.length?[...me,...ze.map(Pt=>({id:Pt.id,type:"custom",spec:Pt}))]:me}),Ae(me=>{const Xe=me.lg||[],ze=new Set(Xe.map(Vn=>Vn.i)),Pt=re.blocks.filter(Vn=>Vn.id&&!ze.has(Vn.id));return Pt.length?{lg:[...Xe,...Pt.map((Vn,Pi)=>({i:Vn.id,x:8,y:Pi*6,w:4,h:6,minW:3,minH:3}))]}:me}))}).catch(()=>{}),()=>{W=!0}},[Ke,(et=e==null?void 0:e.capabilities)==null?void 0:et.chat,H]),w.useEffect(()=>{var G;if(!((G=e==null?void 0:e.capabilities)!=null&&G.chat)||Se.accentManual)return;let W=!1;const K=H?{Authorization:`Bearer ${H}`}:{};return fetch("/api/canvas/theme",{headers:K}).then(re=>re.ok?re.json():null).then(re=>{W||!(re!=null&&re.theme)||L(me=>me.accentManual?me:{...me,mode:re.theme.mode==="dark"?"dark":"light",accent:re.theme.accent||me.accent,hot:re.theme.hot||re.theme.accent||me.hot,tokens:re.theme.tokens||{}})}).catch(()=>{}),()=>{W=!0}},[(zt=e==null?void 0:e.capabilities)==null?void 0:zt.chat,H]);function mt(W){const K=Co(W),G=_B[W]||{w:4,h:12};if(Y(re=>[...re,{id:K,type:W}]),Ae(re=>({lg:[...re.lg||[],{i:K,x:Math.max(0,12-G.w),y:0,w:G.w,h:G.h,minW:3,minH:3}]})),pt(K),_e(!1),typeof window<"u"){const re=me=>{var Xe;return(Xe=document.querySelector(`[data-rgl-id="${K}"]`))==null?void 0:Xe.scrollIntoView({behavior:me,block:"nearest"})};setTimeout(()=>re("smooth"),300),setTimeout(()=>re("auto"),750)}}function Dt(W){const K=Le.find(G=>G.id===W);if(Y(G=>G.filter(re=>re.id!==W)),Ae(G=>({lg:(G.lg||[]).filter(re=>re.i!==W)})),pt(G=>{var re;return G===W?((re=Le.find(me=>me.type==="chat"))==null?void 0:re.id)||"chat-1":G}),B(G=>{if(!(W in G))return G;const re={...G};return delete re[W],re}),(K==null?void 0:K.type)==="custom"){const G=H?{Authorization:`Bearer ${H}`}:{};fetch(`/api/canvas/blocks/${encodeURIComponent(W)}`,{method:"DELETE",headers:G}).catch(()=>{})}}function sn(W){const K=Le.find(G=>G.id===W);K&&mt(K.type)}const Ot=w.useRef(Le);Ot.current=Le;const at=w.useRef(null),rt=w.useRef(null),Vt=w.useRef(!1);w.useEffect(()=>{var me;if(!((me=e==null?void 0:e.capabilities)!=null&&me.chat)||M)return;let W=!1,K=null;const G=H?{Authorization:`Bearer ${H}`}:{},re=async()=>{var Pi;if(W||Vt.current||document.hidden)return;const Xe=await fetch("/api/preview/ports",{headers:G}).catch(()=>null);if(!Xe||W)return;const Pt=((await Xe.json().catch(()=>({}))).ports||[]).map(qn=>qn.port);if(rt.current===null){rt.current=new Set(Pt);return}Pt.some(qn=>!rt.current.has(qn))&&!Ot.current.some(qn=>qn.type==="liveview")&&(Vt.current=!0,clearInterval(K),(Pi=at.current)==null||Pi.call(at))};return re(),K=setInterval(re,5e3),()=>{W=!0,clearInterval(K)}},[(Di=e==null?void 0:e.capabilities)==null?void 0:Di.chat,H,M]);function Hn(){if(Le.some(K=>K.type==="liveview"))return;const W=Co("liveview");Y(K=>K.some(G=>G.type==="liveview")?K:[...K,{id:W,type:"liveview"}]),Ae(K=>{const G=(K.lg||[]).map(re=>re.i.startsWith("chat")?{...re,w:6,x:0,h:bs}:re);return G.push({i:W,x:6,y:0,w:6,h:bs,minW:3,minH:4}),{lg:G}})}at.current=Hn;function Wn(W){if(U(W),Le.some(G=>G.type==="code"))return;const K=Co("code");Y(G=>G.some(re=>re.type==="code")?G:[...G,{id:K,type:"code"}]),Ae(G=>({lg:[...G.lg||[],{i:K,x:6,y:0,w:6,h:bs,minW:3,minH:4}]}))}function gr(W,K){if(W!=null&&W.id&&(Y(G=>{const re=G.findIndex(me=>me.id===W.id);if(re>=0){const me=G.slice();return me[re]={...me[re],type:"custom",spec:W},me}return[...G,{id:W.id,type:"custom",spec:W}]}),Ae(G=>{const re=G.lg||[];return re.some(me=>me.i===W.id)?G:{lg:[...re,{i:W.id,x:8,y:0,w:4,h:6,minW:3,minH:3}]}}),K!=="update"&&(pt(W.id),typeof window<"u"))){const G=re=>{var me;return(me=document.querySelector(`[data-rgl-id="${W.id}"]`))==null?void 0:me.scrollIntoView({behavior:re,block:"nearest"})};setTimeout(()=>G("smooth"),300),setTimeout(()=>G("auto"),750)}}function Ue(W){!W||typeof W!="object"||L(K=>{var G;return BA(K,W,K.accentManual||!!((G=e==null?void 0:e.identity)!=null&&G.color))})}async function Ve({title:W,pitch:K}){const G={"content-type":"application/json",...H?{Authorization:`Bearer ${H}`}:{}},re={title:W,pitch:K,theme:{mode:Se.mode,accent:Se.accent,hot:Se.hot,tokens:Se.tokens||{}},builtFrom:ge?{id:ge.id,title:ge.title}:null};return(await fetch("/api/bazaar/themes/publish",{method:"POST",headers:G,body:JSON.stringify(re)})).json().catch(()=>({ok:!1,error:"bad-response"}))}function $e(W){const K=W&&W.theme||{};L(G=>({...G,mode:K.mode==="dark"?"dark":"light",accent:K.accent||G.accent,hot:K.hot||K.accent||G.hot,tokens:K.tokens||{},accentManual:!0})),oe({id:W.id,title:W.title}),he(!0)}function Ge(W){var re;const K=[],G=W.blocks.map(me=>{const Xe=Co(me.type);return K.push({i:Xe,...me.l||{x:0,y:0,w:4,h:bs,minW:3,minH:3}}),{id:Xe,type:me.type}});if(!G.some(me=>me.type==="chat")){const me=Co("chat");G.unshift({id:me,type:"chat"}),K.unshift({i:me,x:0,y:0,w:8,h:bs,minW:3,minH:4})}Y(G),Ae({lg:K}),pt(((re=G[0])==null?void 0:re.id)||"chat-1"),ae(!1),typeof window<"u"&&setTimeout(()=>{var me;return(me=document.querySelector(".block-canvas"))==null?void 0:me.scrollTo({top:0,behavior:"smooth"})},60)}function lt(W){try{localStorage.setItem("wild:templates",JSON.stringify(W))}catch{}return De({templates:W}),W}function St(W){const K=pe.lg||[],G=Le.map(me=>{const Xe=K.find(ze=>ze.i===me.id);return{type:me.type,l:Xe?{x:Xe.x,y:Xe.y,w:Xe.w,h:Xe.h,minW:Xe.minW??3,minH:Xe.minH??4}:{x:0,y:0,w:4,h:10,minW:3,minH:4}}}),re={id:`saved-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,name:W,icon:"⭐",desc:"Your saved layout",blocks:G,custom:!0};Te(me=>lt([...me,re]))}function Nt(W){Te(K=>lt(K.filter(G=>G.id!==W)))}if(i)return u.jsx(oB,{});if(n)return u.jsx("div",{className:"app",style:{gridTemplateRows:"1fr",alignItems:"center",justifyItems:"center"},children:u.jsxs("div",{style:{padding:24},children:[u.jsx("h2",{children:"wild-workspace"}),u.jsxs("p",{style:{color:"var(--error)"},children:["Could not load session: ",n]}),u.jsx("p",{style:{color:"var(--text-muted)",fontSize:13},children:"Verify the server is running and the share URL token is valid."})]})});if(!e)return u.jsx("div",{className:"app",style:{gridTemplateRows:"1fr",alignItems:"center",justifyItems:"center"},children:u.jsxs("div",{style:{padding:24,color:"var(--text-muted)"},children:[u.jsx("span",{className:"spinner"})," Loading workspace…"]})});if((Un=e.capabilities)!=null&&Un.chatWrite&&!e.onboarded)return u.jsx(eB,{session:e,token:H,onComplete:async W=>{W!=null&&W.seedChat&&nP(W.seedChat,void 0,Yu(e.currentWorkspace));try{const K={};H&&(K.Authorization=`Bearer ${H}`);const G=await fetch("/api/session",{headers:K});G.ok?t(await G.json()):t({...e,onboarded:!0})}catch{t({...e,onboarded:!0})}W!=null&&W.build&&Q({text:W.build,ts:Date.now()})}});if(o)return u.jsx(vP,{session:e,onEnter:W=>{W!==l&&(rP(W),c(W),U(null),Q(null)),a(!1)},onClose:Yo()?()=>a(!1):null});const{role:it,capabilities:F,workspace:ie,workspaceId:ve,agent:xe,identity:J}=e,ke=(J==null?void 0:J.name)||(xe==null?void 0:xe.label)||"Chat",de=e.currentWorkspace||{},je=de.id||"default";Yu(de);const Ee=(Jr=Le.find(W=>W.type==="chat"))==null?void 0:Jr.id;function Re(W){var K,G;switch(W.type){case"chat":return{title:ke,icon:"🗨️"};case"liveview":return{title:"Live view",icon:"👁️"};case"notes":return{title:"Notes",icon:"📝"};case"usage":return{title:"Usage",icon:"🔋"};case"powers":return{title:"Powers",icon:"🧰"};case"earnings":return{title:"Producer earnings",icon:"💸"};case"analytics":return{title:"Shelf analytics",icon:"📊"};case"files":return{title:"Files",icon:"📁"};case"code":return{title:"Code",icon:"💻"};case"todo":return{title:"To-do",icon:"✅"};case"logs":return{title:"Logs",icon:"📋"};case"datatable":return{title:"Data table",icon:"🗂️"};case"deploy":return{title:"Deploy",icon:"🚀"};case"peers":return{title:"Builders like you",icon:"🌱"};case"custom":return{title:((K=W.spec)==null?void 0:K.title)||"Block",icon:((G=W.spec)==null?void 0:G.icon)||"🧩"};default:return{title:W.type,icon:"▫️"}}}function Je(W){switch(W.type){case"chat":{const K=W.id===Ee,G=K?void 0:W.id,re=Yu(de,G),me=K?x:P[W.id]||"build",Xe=K?T:ze=>B(Pt=>({...Pt,[W.id]:ze}));return u.jsxs(u.Fragment,{children:[F.chatWrite&&u.jsx("div",{className:"chat-block-bar",children:u.jsxs("span",{className:"chat-mode-toggle","data-testid":"mode-toggle",children:[u.jsx("button",{className:me==="build"?"active":"",onClick:()=>Xe("build"),"data-testid":"mode-build",children:"Build"}),u.jsx("button",{className:me==="plan"?"active":"",onClick:()=>Xe("plan"),"data-testid":"mode-plan",children:"Plan"})]})}),K&&F.inbox&&u.jsx(Fz,{}),u.jsx(oP,{storageKey:re,threadId:G,role:it,capabilities:F,mode:me,token:H,inject:K?k:void 0,agentName:ke,onBazaarEvent:ze=>{(ze==null?void 0:ze.type)==="preview"?($({url:ze.url,ts:ze.ts}),Hn()):(ze==null?void 0:ze.type)==="meter"?R(ze.state):(ze==null?void 0:ze.type)==="usage"?N(ze.state):(ze==null?void 0:ze.type)==="block"?gr(ze.block,ze.op):(ze==null?void 0:ze.type)==="theme"&&Ue(ze.theme)}},`chat-${re}`)]})}case"liveview":return u.jsx(YA,{bazaarPreview:j});case"notes":return u.jsx(GA,{id:W.id});case"usage":return u.jsx(eI,{live:A,token:H});case"powers":return u.jsx(tI,{token:H,onRun:K=>Q({text:`/${K}`,ts:Date.now()})});case"earnings":return u.jsx(ZA,{live:I,token:H});case"analytics":return u.jsx(nI,{live:I,token:H});case"files":return u.jsx(rI,{token:H,selectedFile:z,onOpenFile:Wn},`files-${je}`);case"code":return u.jsx(oI,{path:z,token:H,onPickFile:U},`code-${je}`);case"todo":return u.jsx(aI,{id:W.id});case"logs":return u.jsx(uI,{token:H});case"datatable":return u.jsx(fI,{token:H});case"deploy":return u.jsx(pI,{canDeploy:F.chatWrite,onSetup:()=>Q({text:"Help me deploy this project — set up a deploy target and ship it.",ts:Date.now()})});case"peers":return u.jsx(Lp,{variant:"block"});case"custom":return u.jsx(jz,{spec:W.spec});default:return null}}return u.jsxs("div",{className:"app",children:[u.jsx(mB,{token:H}),F.share&&u.jsx(hB,{token:H}),u.jsxs("header",{className:"topbar","data-testid":"topbar",children:[u.jsx("span",{className:"brand",children:"wild-workspace"}),u.jsx("span",{className:`badge ${it}`,"data-testid":"role-badge",children:gB[it]||it}),u.jsxs("button",{className:"badge","data-testid":"workspace-switcher",onClick:()=>a(!0),title:"Switch workspace",style:{cursor:"pointer"},children:[de.name||(ie==null?void 0:ie.name)||ve," ▾"]}),J!=null&&J.name?u.jsx("span",{className:"badge","data-testid":"agent-name",style:{borderColor:J.color,color:J.color},children:J.name}):xe&&u.jsx("span",{className:"badge","data-testid":"agent-name",children:xe.label||xe.id}),u.jsx("span",{className:"spacer"}),u.jsx("button",{onClick:()=>he(!0),"data-testid":"theme-btn",title:"Theme — make it yours (light/dark + accent)",children:"🎨 Theme"}),F.chatWrite&&u.jsx("button",{onClick:()=>ae(!0),"data-testid":"templates-btn",title:"Start from a template layout",children:"▾ Templates"}),F.chatWrite&&u.jsx("button",{className:ne==="layout"?"primary":"",onClick:()=>E(W=>W==="layout"?"use":"layout"),"data-testid":"arrange-toggle",title:"Rearrange your blocks",children:ne==="layout"?"✓ Done":"✥ Arrange"}),F.chat&&u.jsx("button",{onClick:()=>O(!0),"data-testid":"bazaar-btn",title:"Browse the marketplace shelf",children:"🛍️ Bazaar"}),F.chatWrite&&u.jsx("button",{onClick:()=>be(!0),"data-testid":"settings-btn",title:"Settings — agent autonomy, name, appearance",children:"⚙️ Settings"}),(()=>{const W=F.sync&&u.jsx("button",{onClick:()=>p(!0),"data-testid":"collaborate-btn",children:"Collaborate"},"collab"),K=F.share&&u.jsx("button",{onClick:()=>h(!0),"data-testid":"share-btn",children:"Share"},"share"),G=F.terminal&&u.jsx("button",{onClick:()=>g(me=>!me),"data-testid":"terminal-toggle",children:v?"Hide terminal":"Terminal"},"term"),re=[W,K,G].filter(Boolean);return re.length===0?null:M?u.jsxs("div",{className:"topbar-more","data-testid":"topbar-more",children:[u.jsx("button",{onClick:()=>C(me=>!me),"data-testid":"more-toggle","aria-haspopup":"menu","aria-expanded":S,title:"More actions",children:"⋯"}),S&&u.jsx("div",{className:"more-menu",role:"menu","data-testid":"more-menu",onClick:()=>C(!1),children:re})]}):u.jsx(u.Fragment,{children:re})})()]}),u.jsxs("main",{className:"canvas-wrap","data-testid":"canvas-wrap",children:[ne==="layout"&&u.jsxs("div",{className:"arrange-bar","data-testid":"arrange-bar",children:[u.jsx("span",{className:"arrange-hint",children:"✥ Arranging your space — drag a block's header, resize from its corner, or add a new one."}),u.jsx("span",{className:"spacer"}),u.jsx("button",{className:"primary",onClick:()=>_e(!0),"data-testid":"add-block-btn",children:"+ Add block"}),u.jsx("button",{onClick:()=>E("use"),children:"Done"})]}),M?u.jsx(AA,{blocks:Le,activeId:ir,setActiveId:pt,mode:ne,renderBlock:Je,blockMeta:Re,onRemove:Dt,canRemove:W=>W.type!=="chat"||W.id!==Ee}):u.jsx(LA,{blocks:Le,layouts:pe,mode:ne,onLayoutChange:Ae,renderBlock:Je,blockMeta:Re,onRemove:Dt,onDuplicate:sn,canRemove:W=>W.type!=="chat"||W.id!==Ee,canDuplicate:W=>W.type!=="custom"})]}),u.jsx(Bz,{role:it,capabilities:F,session:e,urlToken:H,onSyncAlert:y,onOpenConflicts:()=>_(!0)}),u.jsx(Mz,{alert:m,onDismiss:()=>y(null)}),b&&u.jsx(Oz,{urlToken:H,onClose:()=>_(!1)}),ce&&u.jsx(IA,{items:vB.filter(W=>!W.cap||F[W.cap]),bazaarItems:bB,onAdd:mt,onClose:()=>_e(!1)}),te&&u.jsx(OA,{builtins:wB.filter(W=>!W.cap||F[W.cap]),saved:ye,onApply:Ge,onSaveCurrent:St,onDelete:Nt,onClose:()=>ae(!1)}),se&&u.jsx(WA,{theme:Se,onChange:L,onClose:()=>{he(!1),oe(null)},onPublish:F.chatWrite?Ve:void 0,remixOf:ge}),Pe&&u.jsx(KA,{token:H,session:e,onClose:()=>be(!1),onOpenTheme:()=>he(!0)}),D&&u.jsx(Uz,{token:H,onApplyTheme:Ue,onRemixTheme:F.chatWrite?$e:void 0,onClose:()=>O(!1),onBuild:W=>{Q({text:W,ts:Date.now()}),O(!1)}}),d&&u.jsx(Az,{onClose:()=>h(!1),workspaceId:ve}),f&&u.jsx(Iz,{onClose:()=>p(!1),token:H}),v&&u.jsxs("div",{className:"terminal-overlay","data-testid":"terminal-overlay",children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Terminal"}),u.jsx("button",{onClick:()=>g(!1),children:"close"})]}),u.jsx(Nz,{token:H})]})]})}function kB(e){const t=window.fetch.bind(window);window.fetch=(n,r={})=>{const i=typeof n=="string"?n:(n==null?void 0:n.url)||"";if(!(i.startsWith("/api/")||i.includes("://")===!1&&i.startsWith("api/")))return t(n,r);const o=new Headers(r.headers||{});return o.has("Authorization")||o.set("Authorization",`Bearer ${e}`),t(n,{...r,headers:o})}}function CB(){const e=window.fetch.bind(window);window.fetch=(t,n={})=>{const r=typeof t=="string"?t:(t==null?void 0:t.url)||"",i=r.startsWith("/api/")||r.includes("://")===!1&&r.startsWith("api/"),s=Yo();if(!i||!s)return e(t,n);const o=new Headers(n.headers||{});return o.has("X-Workspace-Id")||o.set("X-Workspace-Id",s),e(t,{...n,headers:o})}}function EB(){wh.createRoot(document.getElementById("root")).render(u.jsx(pr.StrictMode,{children:u.jsx(xB,{})}))}async function NB(){const e=typeof window<"u"&&window.fetch,t=e?new URLSearchParams(window.location.search).get("t"):null;if(t){let r=!1;try{const i=await window.fetch("/api/auth/exchange",{method:"POST",headers:{Authorization:`Bearer ${t}`}});r=i.ok&&(await i.json().catch(()=>({}))).cookie===!0}catch{}if(r){const i=new URLSearchParams(window.location.search);i.delete("t");const s=i.toString(),o=window.location.pathname+(s?`?${s}`:"")+window.location.hash;window.history.replaceState(null,"",o)}else kB(t)}CB();const n=e?new URLSearchParams(window.location.search).get("gv"):null;if(n){try{await window.fetch("/api/auth/google",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({vouch:n})})}catch{}const r=new URLSearchParams(window.location.search);r.delete("gv");const i=r.toString(),s=window.location.pathname+(i?`?${i}`:"")+window.location.hash;window.history.replaceState(null,"",s)}EB()}NB();