devicely 2.3.3 → 2.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +168 -249
- package/bin/devicely.js +1 -1
- package/config/apps_presets.conf +19 -0
- package/lib/actionSchema.js +1 -0
- package/lib/advanced-logger.js +1 -1
- package/lib/aiProviders.js +1 -1
- package/lib/aiProvidersConfig.js +1 -1
- package/lib/androidDeviceDetection.js +1 -1
- package/lib/api/v1/auth.js +1 -0
- package/lib/api/v1/deviceResolver.js +1 -0
- package/lib/api/v1/index.js +1 -0
- package/lib/api/v1/operations.js +1 -0
- package/lib/api/v1/passcode.js +1 -0
- package/lib/api/v1/resultNormalizer.js +1 -0
- package/lib/api/v1/screenCapture.js +1 -0
- package/lib/api/v1/uiTree.js +1 -0
- package/lib/appListing.js +1 -0
- package/lib/appMappings.js +1 -1
- package/lib/cognitiveLocator.js +1 -1
- package/lib/commanderService.js +1 -1
- package/lib/deviceContextProvider.js +1 -0
- package/lib/deviceDetection.js +1 -1
- package/lib/deviceDriver.js +1 -0
- package/lib/deviceHealthMonitor.js +1 -0
- package/lib/devices.js +1 -1
- package/lib/doctor.js +1 -1
- package/lib/encryption.js +1 -1
- package/lib/executor.js +1 -1
- package/lib/frontend/asset-manifest.json +5 -7
- package/lib/frontend/index.html +1 -1
- package/lib/frontend/static/js/main.bd89f5ef.js +2 -0
- package/lib/hybridAI.js +1 -1
- package/lib/intelligentLocatorService.js +1 -1
- package/lib/lightweightAI.js +1 -1
- package/lib/localBuiltInAI.js +1 -1
- package/lib/localBuiltInAI_backup.js +1 -1
- package/lib/localBuiltInAI_simple.js +1 -1
- package/lib/locatorStrategy.js +1 -1
- package/lib/logger.js +1 -1
- package/lib/mcp/audit.js +1 -0
- package/lib/mcp/client.js +1 -0
- package/lib/mcp/clientConfigs.js +1 -0
- package/lib/mcp/format.js +1 -0
- package/lib/mcp/http.js +1 -0
- package/lib/mcp/index.js +1 -0
- package/lib/mcp/policy.js +1 -0
- package/lib/mcp/prompts.js +1 -0
- package/lib/mcp/resources.js +1 -0
- package/lib/mcp/schemas.js +1 -0
- package/lib/mcp/stdio.js +3 -0
- package/lib/mcp/tools/act.js +1 -0
- package/lib/mcp/tools/apps.js +1 -0
- package/lib/mcp/tools/devices.js +1 -0
- package/lib/mcp/tools/diagnostics.js +1 -0
- package/lib/mcp/tools/flow.js +1 -0
- package/lib/mcp/tools/multi.js +1 -0
- package/lib/mcp/tools/observe.js +1 -0
- package/lib/mcp/tools/recordings.js +1 -0
- package/lib/mjpegStream.js +1 -0
- package/lib/package.json +9 -1
- package/lib/quick-start-logger.js +1 -1
- package/lib/recordingSteps.js +1 -0
- package/lib/recordingStore.js +1 -0
- package/lib/replayEngine.js +1 -0
- package/lib/scriptLoader.js +1 -1
- package/lib/server.js +1 -1
- package/lib/tensorflowAI.js +1 -1
- package/lib/tinyAI.js +1 -1
- package/lib/universalSessionManager.js +1 -1
- package/lib/virtualDevices/androidEmulatorProvider.js +1 -0
- package/lib/virtualDevices/index.js +1 -0
- package/lib/virtualDevices/iosSimulatorCommands.js +1 -0
- package/lib/virtualDevices/iosSimulatorProvider.js +1 -0
- package/lib/virtualDevices/parsers.js +1 -0
- package/lib/virtualDevices/ports.js +1 -0
- package/lib/virtualDevices/toolchain.js +1 -0
- package/lib/virtualDevices/wdaSimulator.js +1 -0
- package/package.json +8 -14
- package/scripts/shell/android_device_control.enc +1 -1
- package/scripts/shell/connect_android_usb_multi_final.enc +1 -1
- package/scripts/shell/connect_ios_usb_multi_final.enc +1 -1
- package/scripts/shell/connect_ios_wireless_multi_final.enc +1 -1
- package/lib/.env.example +0 -20
- package/lib/aiProviders.js.strategic-backup +0 -657
- package/lib/devices.js.strategic-backup +0 -57
- package/lib/encryption.js.strategic-backup +0 -61
- package/lib/eslint.config.js +0 -1
- package/lib/executor.js.strategic-backup +0 -107
- package/lib/frontend/static/css/main.ed39ba12.css +0 -2
- package/lib/frontend/static/js/main.bb9425de.js +0 -3
- package/lib/jest.config.js +0 -1
- package/lib/logger-demo.js +0 -2
- package/lib/logger-integration-examples.js +0 -102
- package/lib/public/asset-manifest.json +0 -13
- package/lib/public/index.html +0 -1
- package/lib/public/static/css/main.ed39ba12.css +0 -2
- package/lib/public/voice-test.html +0 -156
- package/lib/server.js.strategic-backup +0 -6298
- package/lib/tensorflowAI.js.strategic-backup +0 -717
- package/lib/tests/__mocks__/logger.js +0 -12
- package/lib/tests/integration/deviceSync.test.js +0 -74
- package/lib/tests/setup/testSetup.js +0 -1
- package/lib/tests/unit/commanderService.test.js +0 -70
- package/lib/tsconfig.json +0 -18
- /package/lib/{public → frontend}/static/css/main.1bbcfef2.css +0 -0
- /package/lib/frontend/static/js/{main.bb9425de.js.LICENSE.txt → main.bd89f5ef.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see main.bd89f5ef.js.LICENSE.txt */
|
|
2
|
+
(()=>{var e={876(e,t,n){"use strict";var r=n(429),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,d=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(f){var o=p(n);o&&o!==f&&e(t,o,r)}var a=d(n);u&&(a=a.concat(u(n)));for(var s=l(t),m=l(n),g=0;g<a.length;++g){var v=a[g];if(!i[v]&&(!r||!r[v])&&(!m||!m[v])&&(!s||!s[v])){var x=h(n,v);try{c(t,v,x)}catch(b){}}}}return t}},992(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",a="[object Function]",s="[object Object]",l=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d[i]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d[a]=d["[object Map]"]=d["[object Number]"]=d[s]=d["[object RegExp]"]=d["[object Set]"]=d["[object String]"]=d["[object WeakMap]"]=!1;var u="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,h="object"==typeof self&&self&&self.Object===Object&&self,p=u||h||Function("return this")(),f=t&&!t.nodeType&&t,m=f&&e&&!e.nodeType&&e,g=m&&m.exports===f,v=g&&u.process,x=function(){try{var e=m&&m.require&&m.require("util").types;return e||v&&v.binding&&v.binding("util")}catch(t){}}(),b=x&&x.isTypedArray;var y,w,S=Array.prototype,j=Function.prototype,k=Object.prototype,C=p["__core-js_shared__"],E=j.toString,_=k.hasOwnProperty,z=function(){var e=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),R=k.toString,A=E.call(Object),T=RegExp("^"+E.call(_).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=g?p.Buffer:void 0,O=p.Symbol,L=p.Uint8Array,D=P?P.allocUnsafe:void 0,I=(y=Object.getPrototypeOf,w=Object,function(e){return y(w(e))}),N=Object.create,M=k.propertyIsEnumerable,F=S.splice,W=O?O.toStringTag:void 0,B=function(){try{var e=pe(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),U=P?P.isBuffer:void 0,V=Math.max,H=Date.now,q=pe(p,"Map"),$=pe(Object,"create"),Y=function(){function e(){}return function(t){if(!Ce(t))return{};if(N)return N(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function K(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function G(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function J(e){var t=this.__data__=new X(e);this.size=t.size}function Q(e,t){var n=ye(e),r=!n&&be(e),o=!n&&!r&&Se(e),i=!n&&!r&&!o&&_e(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var c in e)!t&&!_.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||fe(c,l))||s.push(c);return s}function Z(e,t,n){(void 0!==n&&!xe(e[t],n)||void 0===n&&!(t in e))&&ne(e,t,n)}function ee(e,t,n){var r=e[t];_.call(e,t)&&xe(r,n)&&(void 0!==n||t in e)||ne(e,t,n)}function te(e,t){for(var n=e.length;n--;)if(xe(e[n][0],t))return n;return-1}function ne(e,t,n){"__proto__"==t&&B?B(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}K.prototype.clear=function(){this.__data__=$?$(null):{},this.size=0},K.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},K.prototype.get=function(e){var t=this.__data__;if($){var n=t[e];return n===r?void 0:n}return _.call(t,e)?t[e]:void 0},K.prototype.has=function(e){var t=this.__data__;return $?void 0!==t[e]:_.call(t,e)},K.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=$&&void 0===t?r:t,this},X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,n=te(t,e);return!(n<0)&&(n==t.length-1?t.pop():F.call(t,n,1),--this.size,!0)},X.prototype.get=function(e){var t=this.__data__,n=te(t,e);return n<0?void 0:t[n][1]},X.prototype.has=function(e){return te(this.__data__,e)>-1},X.prototype.set=function(e,t){var n=this.__data__,r=te(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},G.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(q||X),string:new K}},G.prototype.delete=function(e){var t=he(this,e).delete(e);return this.size-=t?1:0,t},G.prototype.get=function(e){return he(this,e).get(e)},G.prototype.has=function(e){return he(this,e).has(e)},G.prototype.set=function(e,t){var n=he(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},J.prototype.clear=function(){this.__data__=new X,this.size=0},J.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},J.prototype.get=function(e){return this.__data__.get(e)},J.prototype.has=function(e){return this.__data__.has(e)},J.prototype.set=function(e,t){var n=this.__data__;if(n instanceof X){var r=n.__data__;if(!q||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new G(r)}return n.set(e,t),this.size=n.size,this};var re,oe=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[re?a:++r];if(!1===t(o[s],s,o))break}return e};function ie(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":W&&W in Object(e)?function(e){var t=_.call(e,W),n=e[W];try{e[W]=void 0;var r=!0}catch(i){}var o=R.call(e);r&&(t?e[W]=n:delete e[W]);return o}(e):function(e){return R.call(e)}(e)}function ae(e){return Ee(e)&&ie(e)==i}function se(e){return!(!Ce(e)||function(e){return!!z&&z in e}(e))&&(je(e)?T:l).test(function(e){if(null!=e){try{return E.call(e)}catch(t){}try{return e+""}catch(t){}}return""}(e))}function le(e){if(!Ce(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=me(e),n=[];for(var r in e)("constructor"!=r||!t&&_.call(e,r))&&n.push(r);return n}function ce(e,t,n,r,o){e!==t&&oe(t,function(i,a){if(o||(o=new J),Ce(i))!function(e,t,n,r,o,i,a){var l=ge(e,n),c=ge(t,n),d=a.get(c);if(d)return void Z(e,n,d);var u=i?i(l,c,n+"",e,t,a):void 0,h=void 0===u;if(h){var p=ye(c),f=!p&&Se(c),m=!p&&!f&&_e(c);u=c,p||f||m?ye(l)?u=l:Ee(g=l)&&we(g)?u=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(l):f?(h=!1,u=function(e,t){if(t)return e.slice();var n=e.length,r=D?D(n):new e.constructor(n);return e.copy(r),r}(c,!0)):m?(h=!1,u=function(e,t){var n=t?function(e){var t=new e.constructor(e.byteLength);return new L(t).set(new L(e)),t}(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(c,!0)):u=[]:function(e){if(!Ee(e)||ie(e)!=s)return!1;var t=I(e);if(null===t)return!0;var n=_.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&E.call(n)==A}(c)||be(c)?(u=l,be(l)?u=function(e){return function(e,t,n,r){var o=!n;n||(n={});var i=-1,a=t.length;for(;++i<a;){var s=t[i],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),o?ne(n,s,l):ee(n,s,l)}return n}(e,ze(e))}(l):Ce(l)&&!je(l)||(u=function(e){return"function"!=typeof e.constructor||me(e)?{}:Y(I(e))}(c))):h=!1}var g;h&&(a.set(c,u),o(u,c,r,i,a),a.delete(c));Z(e,n,u)}(e,t,a,n,ce,r,o);else{var l=r?r(ge(e,a),i,a+"",e,t,o):void 0;void 0===l&&(l=i),Z(e,a,l)}},ze)}function de(e,t){return ve(function(e,t,n){return t=V(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=V(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,s)}}(e,t,Te),e+"")}var ue=B?function(e,t){return B(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Te;function he(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function pe(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return se(n)?n:void 0}function fe(e,t){var n=typeof e;return!!(t=null==t?o:t)&&("number"==n||"symbol"!=n&&c.test(e))&&e>-1&&e%1==0&&e<t}function me(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||k)}function ge(e,t){if(("constructor"!==t||"function"!==typeof e[t])&&"__proto__"!=t)return e[t]}var ve=function(e){var t=0,n=0;return function(){var r=H(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ue);function xe(e,t){return e===t||e!==e&&t!==t}var be=ae(function(){return arguments}())?ae:function(e){return Ee(e)&&_.call(e,"callee")&&!M.call(e,"callee")},ye=Array.isArray;function we(e){return null!=e&&ke(e.length)&&!je(e)}var Se=U||function(){return!1};function je(e){if(!Ce(e))return!1;var t=ie(e);return t==a||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function Ce(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ee(e){return null!=e&&"object"==typeof e}var _e=b?function(e){return function(t){return e(t)}}(b):function(e){return Ee(e)&&ke(e.length)&&!!d[ie(e)]};function ze(e){return we(e)?Q(e,!0):le(e)}var Re,Ae=(Re=function(e,t,n,r){ce(e,t,n,r)},de(function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(o=Re.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(e,t,n){if(!Ce(n))return!1;var r=typeof t;return!!("number"==r?we(n)&&fe(t,n.length):"string"==r&&t in n)&&xe(n[t],e)}(t[0],t[1],i)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var a=t[n];a&&Re(e,a,n,o)}return e}));function Te(e){return e}e.exports=Ae},345(e,t,n){"use strict";var r=n(950),o=n(340);function i(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 a=new Set,s={};function l(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(s[e]=t,e=0;e<t.length;e++)a.add(t[e])}var d=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),u=Object.prototype.hasOwnProperty,h=/^[: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]*$/,p={},f={};function m(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){g[e]=new m(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];g[t]=new m(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){g[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){g[e]=new m(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){g[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){g[e]=new m(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){g[e]=new m(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){g[e]=new m(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){g[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}function b(e,t,n,r){var o=g.hasOwnProperty(t)?g[t]:null;(null!==o?0!==o.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!u.call(f,e)||!u.call(p,e)&&(h.test(e)?f[e]=!0:(p[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"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(v,x);g[t]=new m(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(v,x);g[t]=new m(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(v,x);g[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)}),g.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)});var y=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),S=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),_=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),P=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var O=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var L=Symbol.iterator;function D(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=L&&e[L]||e["@@iterator"])?e:null}var I,N=Object.assign;function M(e){if(void 0===I)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);I=t&&t[1]||""}return"\n"+I+e}var F=!1;function W(e,t){if(!e||F)return"";F=!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()}}),"object"===typeof Reflect&&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&&"string"===typeof c.stack){for(var o=c.stack.split("\n"),i=r.stack.split("\n"),a=o.length-1,s=i.length-1;1<=a&&0<=s&&o[a]!==i[s];)s--;for(;1<=a&&0<=s;a--,s--)if(o[a]!==i[s]){if(1!==a||1!==s)do{if(a--,0>--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{F=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?M(e):""}function B(e){switch(e.tag){case 5:return M(e.type);case 16:return M("Lazy");case 13:return M("Suspense");case 19:return M("SuspenseList");case 0:case 2:case 15:return e=W(e.type,!1);case 11:return e=W(e.type.render,!1);case 1:return e=W(e.type,!0);default:return""}}function U(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case j:return"Fragment";case S:return"Portal";case C:return"Profiler";case k:return"StrictMode";case R:return"Suspense";case A:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case _:return(e.displayName||"Context")+".Consumer";case E:return(e._context.displayName||"Context")+".Provider";case z:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case T:return null!==(t=e.displayName||null)?t:U(e.type)||"Memo";case P:t=e._payload,e=e._init;try{return U(e(t))}catch(n){}}return null}function V(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=(e=t.render).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 U(t);case 8:return t===k?"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("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function H(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function q(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function $(e){e._valueTracker||(e._valueTracker=function(e){var t=q(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Y(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=q(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function K(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function X(e,t){var n=t.checked;return N({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function G(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=H(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function J(e,t){null!=(t=t.checked)&&b(e,"checked",t,!1)}function Q(e,t){J(e,t);var n=H(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,H(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Z(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&K(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+H(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function re(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(i(91));return N({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function oe(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(i(92));if(te(n)){if(1<n.length)throw Error(i(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:H(n)}}function ie(e,t){var n=H(t.value),r=H(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ae(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function se(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 le(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?se(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,de,ue=(de=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return de(e,t)})}:de);function he(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var pe={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},fe=["Webkit","ms","Moz","O"];function me(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||pe.hasOwnProperty(e)&&pe[e]?(""+t).trim():t+"px"}function ge(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=me(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(pe).forEach(function(e){fe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pe[t]=pe[e]})});var ve=N({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 xe(e,t){if(t){if(ve[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(i(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(i(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(i(62))}}function be(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;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 ye=null;function we(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Se=null,je=null,ke=null;function Ce(e){if(e=yo(e)){if("function"!==typeof Se)throw Error(i(280));var t=e.stateNode;t&&(t=So(t),Se(e.stateNode,e.type,t))}}function Ee(e){je?ke?ke.push(e):ke=[e]:je=e}function _e(){if(je){var e=je,t=ke;if(ke=je=null,Ce(e),t)for(e=0;e<t.length;e++)Ce(t[e])}}function ze(e,t){return e(t)}function Re(){}var Ae=!1;function Te(e,t,n){if(Ae)return e(t,n);Ae=!0;try{return ze(e,t,n)}finally{Ae=!1,(null!==je||null!==ke)&&(Re(),_e())}}function Pe(e,t){var n=e.stateNode;if(null===n)return null;var r=So(n);if(null===r)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)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(i(231,t,typeof n));return n}var Oe=!1;if(d)try{var Le={};Object.defineProperty(Le,"passive",{get:function(){Oe=!0}}),window.addEventListener("test",Le,Le),window.removeEventListener("test",Le,Le)}catch(de){Oe=!1}function De(e,t,n,r,o,i,a,s,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var Ie=!1,Ne=null,Me=!1,Fe=null,We={onError:function(e){Ie=!0,Ne=e}};function Be(e,t,n,r,o,i,a,s,l){Ie=!1,Ne=null,De.apply(We,arguments)}function Ue(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Ve(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function He(e){if(Ue(e)!==e)throw Error(i(188))}function qe(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ue(e)))throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var a=o.alternate;if(null===a){if(null!==(r=o.return)){n=r;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===n)return He(o),e;if(a===r)return He(o),t;a=a.sibling}throw Error(i(188))}if(n.return!==r.return)n=o,r=a;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=a;break}if(l===r){s=!0,r=o,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=o;break}if(l===r){s=!0,r=a,n=o;break}l=l.sibling}if(!s)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(3!==n.tag)throw Error(i(188));return n.stateNode.current===n?e:t}(e))?$e(e):null}function $e(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=$e(e);if(null!==t)return t;e=e.sibling}return null}var Ye=o.unstable_scheduleCallback,Ke=o.unstable_cancelCallback,Xe=o.unstable_shouldYield,Ge=o.unstable_requestPaint,Je=o.unstable_now,Qe=o.unstable_getCurrentPriorityLevel,Ze=o.unstable_ImmediatePriority,et=o.unstable_UserBlockingPriority,tt=o.unstable_NormalPriority,nt=o.unstable_LowPriority,rt=o.unstable_IdlePriority,ot=null,it=null;var at=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(st(e)/lt|0)|0},st=Math.log,lt=Math.LN2;var ct=64,dt=4194304;function ut(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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ht(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=ut(s):0!==(i&=a)&&(r=ut(i))}else 0!==(a=n&~o)?r=ut(a):0!==i&&(r=ut(i));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&0!==(4194240&i)))return t;if(0!==(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-at(t)),r|=e[n],t&=~o;return r}function pt(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;default:return-1}}function ft(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function mt(){var e=ct;return 0===(4194240&(ct<<=1))&&(ct=64),e}function gt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-at(t)]=n}function xt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-at(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var bt=0;function yt(e){return 1<(e&=-e)?4<e?0!==(268435455&e)?16:536870912:4:1}var wt,St,jt,kt,Ct,Et=!1,_t=[],zt=null,Rt=null,At=null,Tt=new Map,Pt=new Map,Ot=[],Lt="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 Dt(e,t){switch(e){case"focusin":case"focusout":zt=null;break;case"dragenter":case"dragleave":Rt=null;break;case"mouseover":case"mouseout":At=null;break;case"pointerover":case"pointerout":Tt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pt.delete(t.pointerId)}}function It(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},null!==t&&(null!==(t=yo(t))&&St(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function Nt(e){var t=bo(e.target);if(null!==t){var n=Ue(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Ve(n)))return e.blockedOn=t,void Ct(e.priority,function(){jt(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Mt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Xt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=yo(n))&&St(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);ye=r,n.target.dispatchEvent(r),ye=null,t.shift()}return!0}function Ft(e,t,n){Mt(e)&&n.delete(t)}function Wt(){Et=!1,null!==zt&&Mt(zt)&&(zt=null),null!==Rt&&Mt(Rt)&&(Rt=null),null!==At&&Mt(At)&&(At=null),Tt.forEach(Ft),Pt.forEach(Ft)}function Bt(e,t){e.blockedOn===t&&(e.blockedOn=null,Et||(Et=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,Wt)))}function Ut(e){function t(t){return Bt(t,e)}if(0<_t.length){Bt(_t[0],e);for(var n=1;n<_t.length;n++){var r=_t[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==zt&&Bt(zt,e),null!==Rt&&Bt(Rt,e),null!==At&&Bt(At,e),Tt.forEach(t),Pt.forEach(t),n=0;n<Ot.length;n++)(r=Ot[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Ot.length&&null===(n=Ot[0]).blockedOn;)Nt(n),null===n.blockedOn&&Ot.shift()}var Vt=y.ReactCurrentBatchConfig,Ht=!0;function qt(e,t,n,r){var o=bt,i=Vt.transition;Vt.transition=null;try{bt=1,Yt(e,t,n,r)}finally{bt=o,Vt.transition=i}}function $t(e,t,n,r){var o=bt,i=Vt.transition;Vt.transition=null;try{bt=4,Yt(e,t,n,r)}finally{bt=o,Vt.transition=i}}function Yt(e,t,n,r){if(Ht){var o=Xt(e,t,n,r);if(null===o)Hr(e,t,r,Kt,n),Dt(e,r);else if(function(e,t,n,r,o){switch(t){case"focusin":return zt=It(zt,e,t,n,r,o),!0;case"dragenter":return Rt=It(Rt,e,t,n,r,o),!0;case"mouseover":return At=It(At,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Tt.set(i,It(Tt.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Pt.set(i,It(Pt.get(i)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r))r.stopPropagation();else if(Dt(e,r),4&t&&-1<Lt.indexOf(e)){for(;null!==o;){var i=yo(o);if(null!==i&&wt(i),null===(i=Xt(e,t,n,r))&&Hr(e,t,r,Kt,n),i===o)break;o=i}null!==o&&r.stopPropagation()}else Hr(e,t,r,null,n)}}var Kt=null;function Xt(e,t,n,r){if(Kt=null,null!==(e=bo(e=we(r))))if(null===(t=Ue(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=Ve(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Kt=e,null}function Gt(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(Qe()){case Ze:return 1;case et:return 4;case tt:case nt:return 16;case rt:return 536870912;default:return 16}default:return 16}}var Jt=null,Qt=null,Zt=null;function en(){if(Zt)return Zt;var e,t,n=Qt,r=n.length,o="value"in Jt?Jt.value:Jt.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return Zt=o.slice(e,1<t?1-t:void 0)}function tn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function nn(){return!0}function rn(){return!1}function on(e){function t(t,n,r,o,i){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?nn:rn,this.isPropagationStopped=rn,this}return N(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var an,sn,ln,cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dn=on(cn),un=N({},cn,{view:0,detail:0}),hn=on(un),pn=N({},un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ln&&(ln&&"mousemove"===e.type?(an=e.screenX-ln.screenX,sn=e.screenY-ln.screenY):sn=an=0,ln=e),an)},movementY:function(e){return"movementY"in e?e.movementY:sn}}),fn=on(pn),mn=on(N({},pn,{dataTransfer:0})),gn=on(N({},un,{relatedTarget:0})),vn=on(N({},cn,{animationName:0,elapsedTime:0,pseudoElement:0})),xn=N({},cn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bn=on(xn),yn=on(N({},cn,{data:0})),wn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sn={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"},jn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=jn[e])&&!!t[e]}function Cn(){return kn}var En=N({},un,{key:function(e){if(e.key){var t=wn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Sn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cn,charCode:function(e){return"keypress"===e.type?tn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),_n=on(En),zn=on(N({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=on(N({},un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cn})),An=on(N({},cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Tn=N({},pn,{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}),Pn=on(Tn),On=[9,13,27,32],Ln=d&&"CompositionEvent"in window,Dn=null;d&&"documentMode"in document&&(Dn=document.documentMode);var In=d&&"TextEvent"in window&&!Dn,Nn=d&&(!Ln||Dn&&8<Dn&&11>=Dn),Mn=String.fromCharCode(32),Fn=!1;function Wn(e,t){switch(e){case"keyup":return-1!==On.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Un=!1;var Vn={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 Hn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Vn[e.type]:"textarea"===t}function qn(e,t,n,r){Ee(r),0<(t=$r(t,"onChange")).length&&(n=new dn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var $n=null,Yn=null;function Kn(e){Mr(e,0)}function Xn(e){if(Y(wo(e)))return e}function Gn(e,t){if("change"===e)return t}var Jn=!1;if(d){var Qn;if(d){var Zn="oninput"in document;if(!Zn){var er=document.createElement("div");er.setAttribute("oninput","return;"),Zn="function"===typeof er.oninput}Qn=Zn}else Qn=!1;Jn=Qn&&(!document.documentMode||9<document.documentMode)}function tr(){$n&&($n.detachEvent("onpropertychange",nr),Yn=$n=null)}function nr(e){if("value"===e.propertyName&&Xn(Yn)){var t=[];qn(t,Yn,e,we(e)),Te(Kn,t)}}function rr(e,t,n){"focusin"===e?(tr(),Yn=n,($n=t).attachEvent("onpropertychange",nr)):"focusout"===e&&tr()}function or(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Xn(Yn)}function ir(e,t){if("click"===e)return Xn(t)}function ar(e,t){if("input"===e||"change"===e)return Xn(t)}var sr="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function lr(e,t){if(sr(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!u.call(t,o)||!sr(e[o],t[o]))return!1}return!0}function cr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dr(e,t){var n,r=cr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=cr(r)}}function ur(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?ur(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function hr(){for(var e=window,t=K();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=K((e=t.contentWindow).document)}return t}function pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function fr(e){var t=hr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ur(n.ownerDocument.documentElement,n)){if(null!==r&&pr(n))if(t=r.start,void 0===(e=r.end)&&(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).getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=void 0===r.end?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=dr(n,i);var a=dr(n,r);o&&a&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var mr=d&&"documentMode"in document&&11>=document.documentMode,gr=null,vr=null,xr=null,br=!1;function yr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;br||null==gr||gr!==K(r)||("selectionStart"in(r=gr)&&pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},xr&&lr(xr,r)||(xr=r,0<(r=$r(vr,"onSelect")).length&&(t=new dn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=gr)))}function wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Sr={animationend:wr("Animation","AnimationEnd"),animationiteration:wr("Animation","AnimationIteration"),animationstart:wr("Animation","AnimationStart"),transitionend:wr("Transition","TransitionEnd")},jr={},kr={};function Cr(e){if(jr[e])return jr[e];if(!Sr[e])return e;var t,n=Sr[e];for(t in n)if(n.hasOwnProperty(t)&&t in kr)return jr[e]=n[t];return e}d&&(kr=document.createElement("div").style,"AnimationEvent"in window||(delete Sr.animationend.animation,delete Sr.animationiteration.animation,delete Sr.animationstart.animation),"TransitionEvent"in window||delete Sr.transitionend.transition);var Er=Cr("animationend"),_r=Cr("animationiteration"),zr=Cr("animationstart"),Rr=Cr("transitionend"),Ar=new Map,Tr="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 Pr(e,t){Ar.set(e,t),l(t,[e])}for(var Or=0;Or<Tr.length;Or++){var Lr=Tr[Or];Pr(Lr.toLowerCase(),"on"+(Lr[0].toUpperCase()+Lr.slice(1)))}Pr(Er,"onAnimationEnd"),Pr(_r,"onAnimationIteration"),Pr(zr,"onAnimationStart"),Pr("dblclick","onDoubleClick"),Pr("focusin","onFocus"),Pr("focusout","onBlur"),Pr(Rr,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dr="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(" "),Ir=new Set("cancel close invalid load scroll toggle".split(" ").concat(Dr));function Nr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,o,a,s,l,c){if(Be.apply(this,arguments),Ie){if(!Ie)throw Error(i(198));var d=Ne;Ie=!1,Ne=null,Me||(Me=!0,Fe=d)}}(r,t,void 0,e),e.currentTarget=null}function Mr(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==i&&o.isPropagationStopped())break e;Nr(o,s,c),i=l}else for(a=0;a<r.length;a++){if(l=(s=r[a]).instance,c=s.currentTarget,s=s.listener,l!==i&&o.isPropagationStopped())break e;Nr(o,s,c),i=l}}}if(Me)throw e=Fe,Me=!1,Fe=null,e}function Fr(e,t){var n=t[go];void 0===n&&(n=t[go]=new Set);var r=e+"__bubble";n.has(r)||(Vr(t,e,2,!1),n.add(r))}function Wr(e,t,n){var r=0;t&&(r|=4),Vr(n,e,r,t)}var Br="_reactListening"+Math.random().toString(36).slice(2);function Ur(e){if(!e[Br]){e[Br]=!0,a.forEach(function(t){"selectionchange"!==t&&(Ir.has(t)||Wr(t,!1,e),Wr(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Br]||(t[Br]=!0,Wr("selectionchange",!1,t))}}function Vr(e,t,n,r){switch(Gt(t)){case 1:var o=qt;break;case 4:o=$t;break;default:o=Yt}n=o.bind(null,t,n,e),o=void 0,!Oe||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Hr(e,t,n,r,o){var i=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===o||8===s.nodeType&&s.parentNode===o)break;if(4===a)for(a=r.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===o||8===l.nodeType&&l.parentNode===o))return;a=a.return}for(;null!==s;){if(null===(a=bo(s)))return;if(5===(l=a.tag)||6===l){r=i=a;continue e}s=s.parentNode}}r=r.return}Te(function(){var r=i,o=we(n),a=[];e:{var s=Ar.get(e);if(void 0!==s){var l=dn,c=e;switch(e){case"keypress":if(0===tn(n))break e;case"keydown":case"keyup":l=_n;break;case"focusin":c="focus",l=gn;break;case"focusout":c="blur",l=gn;break;case"beforeblur":case"afterblur":l=gn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=fn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=mn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Rn;break;case Er:case _r:case zr:l=vn;break;case Rr:l=An;break;case"scroll":l=hn;break;case"wheel":l=Pn;break;case"copy":case"cut":case"paste":l=bn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=zn}var d=0!==(4&t),u=!d&&"scroll"===e,h=d?null!==s?s+"Capture":null:s;d=[];for(var p,f=r;null!==f;){var m=(p=f).stateNode;if(5===p.tag&&null!==m&&(p=m,null!==h&&(null!=(m=Pe(f,h))&&d.push(qr(f,m,p)))),u)break;f=f.return}0<d.length&&(s=new l(s,c,null,n,o),a.push({event:s,listeners:d}))}}if(0===(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===ye||!(c=n.relatedTarget||n.fromElement)||!bo(c)&&!c[mo])&&(l||s)&&(s=o.window===o?o:(s=o.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?bo(c):null)&&(c!==(u=Ue(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=r),l!==c)){if(d=fn,m="onMouseLeave",h="onMouseEnter",f="mouse","pointerout"!==e&&"pointerover"!==e||(d=zn,m="onPointerLeave",h="onPointerEnter",f="pointer"),u=null==l?s:wo(l),p=null==c?s:wo(c),(s=new d(m,f+"leave",l,n,o)).target=u,s.relatedTarget=p,m=null,bo(o)===r&&((d=new d(h,f+"enter",c,n,o)).target=p,d.relatedTarget=u,m=d),u=m,l&&c)e:{for(h=c,f=0,p=d=l;p;p=Yr(p))f++;for(p=0,m=h;m;m=Yr(m))p++;for(;0<f-p;)d=Yr(d),f--;for(;0<p-f;)h=Yr(h),p--;for(;f--;){if(d===h||null!==h&&d===h.alternate)break e;d=Yr(d),h=Yr(h)}d=null}else d=null;null!==l&&Kr(a,s,l,d,!1),null!==c&&null!==u&&Kr(a,u,c,d,!0)}if("select"===(l=(s=r?wo(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=Gn;else if(Hn(s))if(Jn)g=ar;else{g=or;var v=rr}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=ir);switch(g&&(g=g(e,r))?qn(a,g,n,o):(v&&v(e,s,r),"focusout"===e&&(v=s._wrapperState)&&v.controlled&&"number"===s.type&&ee(s,"number",s.value)),v=r?wo(r):window,e){case"focusin":(Hn(v)||"true"===v.contentEditable)&&(gr=v,vr=r,xr=null);break;case"focusout":xr=vr=gr=null;break;case"mousedown":br=!0;break;case"contextmenu":case"mouseup":case"dragend":br=!1,yr(a,n,o);break;case"selectionchange":if(mr)break;case"keydown":case"keyup":yr(a,n,o)}var x;if(Ln)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Un?Wn(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(Nn&&"ko"!==n.locale&&(Un||"onCompositionStart"!==b?"onCompositionEnd"===b&&Un&&(x=en()):(Qt="value"in(Jt=o)?Jt.value:Jt.textContent,Un=!0)),0<(v=$r(r,b)).length&&(b=new yn(b,e,null,n,o),a.push({event:b,listeners:v}),x?b.data=x:null!==(x=Bn(n))&&(b.data=x))),(x=In?function(e,t){switch(e){case"compositionend":return Bn(t);case"keypress":return 32!==t.which?null:(Fn=!0,Mn);case"textInput":return(e=t.data)===Mn&&Fn?null:e;default:return null}}(e,n):function(e,t){if(Un)return"compositionend"===e||!Ln&&Wn(e,t)?(e=en(),Zt=Qt=Jt=null,Un=!1,e):null;switch(e){case"paste":default: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 Nn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=$r(r,"onBeforeInput")).length&&(o=new yn("onBeforeInput","beforeinput",null,n,o),a.push({event:o,listeners:r}),o.data=x))}Mr(a,t)})}function qr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $r(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,i=o.stateNode;5===o.tag&&null!==i&&(o=i,null!=(i=Pe(e,n))&&r.unshift(qr(e,i,o)),null!=(i=Pe(e,t))&&r.push(qr(e,i,o))),e=e.return}return r}function Yr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Kr(e,t,n,r,o){for(var i=t._reactName,a=[];null!==n&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==c&&(s=c,o?null!=(l=Pe(n,i))&&a.unshift(qr(n,l,s)):o||null!=(l=Pe(n,i))&&a.push(qr(n,l,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var Xr=/\r\n?/g,Gr=/\u0000|\uFFFD/g;function Jr(e){return("string"===typeof e?e:""+e).replace(Xr,"\n").replace(Gr,"")}function Qr(e,t,n){if(t=Jr(t),Jr(e)!==t&&n)throw Error(i(425))}function Zr(){}var eo=null,to=null;function no(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ro="function"===typeof setTimeout?setTimeout:void 0,oo="function"===typeof clearTimeout?clearTimeout:void 0,io="function"===typeof Promise?Promise:void 0,ao="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof io?function(e){return io.resolve(null).then(e).catch(so)}:ro;function so(e){setTimeout(function(){throw e})}function lo(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)){if(0===r)return e.removeChild(o),void Ut(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=o}while(n);Ut(t)}function co(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function uo(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var ho=Math.random().toString(36).slice(2),po="__reactFiber$"+ho,fo="__reactProps$"+ho,mo="__reactContainer$"+ho,go="__reactEvents$"+ho,vo="__reactListeners$"+ho,xo="__reactHandles$"+ho;function bo(e){var t=e[po];if(t)return t;for(var n=e.parentNode;n;){if(t=n[mo]||n[po]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=uo(e);null!==e;){if(n=e[po])return n;e=uo(e)}return t}n=(e=n).parentNode}return null}function yo(e){return!(e=e[po]||e[mo])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function wo(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(i(33))}function So(e){return e[fo]||null}var jo=[],ko=-1;function Co(e){return{current:e}}function Eo(e){0>ko||(e.current=jo[ko],jo[ko]=null,ko--)}function _o(e,t){ko++,jo[ko]=e.current,e.current=t}var zo={},Ro=Co(zo),Ao=Co(!1),To=zo;function Po(e,t){var n=e.type.contextTypes;if(!n)return zo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Oo(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Lo(){Eo(Ao),Eo(Ro)}function Do(e,t,n){if(Ro.current!==zo)throw Error(i(168));_o(Ro,t),_o(Ao,n)}function Io(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in t))throw Error(i(108,V(e)||"Unknown",o));return N({},n,r)}function No(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zo,To=Ro.current,_o(Ro,e),_o(Ao,Ao.current),!0}function Mo(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=Io(e,t,To),r.__reactInternalMemoizedMergedChildContext=e,Eo(Ao),Eo(Ro),_o(Ro,e)):Eo(Ao),_o(Ao,n)}var Fo=null,Wo=!1,Bo=!1;function Uo(e){null===Fo?Fo=[e]:Fo.push(e)}function Vo(){if(!Bo&&null!==Fo){Bo=!0;var e=0,t=bt;try{var n=Fo;for(bt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Fo=null,Wo=!1}catch(o){throw null!==Fo&&(Fo=Fo.slice(e+1)),Ye(Ze,Vo),o}finally{bt=t,Bo=!1}}return null}var Ho=[],qo=0,$o=null,Yo=0,Ko=[],Xo=0,Go=null,Jo=1,Qo="";function Zo(e,t){Ho[qo++]=Yo,Ho[qo++]=$o,$o=e,Yo=t}function ei(e,t,n){Ko[Xo++]=Jo,Ko[Xo++]=Qo,Ko[Xo++]=Go,Go=e;var r=Jo;e=Qo;var o=32-at(r)-1;r&=~(1<<o),n+=1;var i=32-at(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Jo=1<<32-at(t)+o|n<<o|r,Qo=i+e}else Jo=1<<i|n<<o|r,Qo=e}function ti(e){null!==e.return&&(Zo(e,1),ei(e,1,0))}function ni(e){for(;e===$o;)$o=Ho[--qo],Ho[qo]=null,Yo=Ho[--qo],Ho[qo]=null;for(;e===Go;)Go=Ko[--Xo],Ko[Xo]=null,Qo=Ko[--Xo],Ko[Xo]=null,Jo=Ko[--Xo],Ko[Xo]=null}var ri=null,oi=null,ii=!1,ai=null;function si(e,t){var n=Ac(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function li(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ri=e,oi=co(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ri=e,oi=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Go?{id:Jo,overflow:Qo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Ac(18,null,null,0)).stateNode=t,n.return=e,e.child=n,ri=e,oi=null,!0);default:return!1}}function ci(e){return 0!==(1&e.mode)&&0===(128&e.flags)}function di(e){if(ii){var t=oi;if(t){var n=t;if(!li(e,t)){if(ci(e))throw Error(i(418));t=co(n.nextSibling);var r=ri;t&&li(e,t)?si(r,n):(e.flags=-4097&e.flags|2,ii=!1,ri=e)}}else{if(ci(e))throw Error(i(418));e.flags=-4097&e.flags|2,ii=!1,ri=e}}}function ui(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ri=e}function hi(e){if(e!==ri)return!1;if(!ii)return ui(e),ii=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!no(e.type,e.memoizedProps)),t&&(t=oi)){if(ci(e))throw pi(),Error(i(418));for(;t;)si(e,t),t=co(t.nextSibling)}if(ui(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){oi=co(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}oi=null}}else oi=ri?co(e.stateNode.nextSibling):null;return!0}function pi(){for(var e=oi;e;)e=co(e.nextSibling)}function fi(){oi=ri=null,ii=!1}function mi(e){null===ai?ai=[e]:ai.push(e)}var gi=y.ReactCurrentBatchConfig;function vi(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(i(309));var r=n.stateNode}if(!r)throw Error(i(147,e));var o=r,a=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=o.refs;null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!==typeof e)throw Error(i(284));if(!n._owner)throw Error(i(290,e))}return e}function xi(e,t){throw e=Object.prototype.toString.call(t),Error(i(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function bi(e){return(0,e._init)(e._payload)}function yi(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=Pc(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Ic(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function c(e,t,n,r){var i=n.type;return i===j?u(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===i||"object"===typeof i&&null!==i&&i.$$typeof===P&&bi(i)===t.type)?((r=o(t,n.props)).ref=vi(e,t,n),r.return=e,r):((r=Oc(n.type,n.key,n.props,null,e.mode,r)).ref=vi(e,t,n),r.return=e,r)}function d(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Nc(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function u(e,t,n,r,i){return null===t||7!==t.tag?((t=Lc(n,e.mode,r,i)).return=e,t):((t=o(t,n)).return=e,t)}function h(e,t,n){if("string"===typeof t&&""!==t||"number"===typeof t)return(t=Ic(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case w:return(n=Oc(t.type,t.key,t.props,null,e.mode,n)).ref=vi(e,null,t),n.return=e,n;case S:return(t=Nc(t,e.mode,n)).return=e,t;case P:return h(e,(0,t._init)(t._payload),n)}if(te(t)||D(t))return(t=Lc(t,e.mode,n,null)).return=e,t;xi(e,t)}return null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"===typeof n&&""!==n||"number"===typeof n)return null!==o?null:l(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case w:return n.key===o?c(e,t,n,r):null;case S:return n.key===o?d(e,t,n,r):null;case P:return p(e,t,(o=n._init)(n._payload),r)}if(te(n)||D(n))return null!==o?null:u(e,t,n,r,null);xi(e,n)}return null}function f(e,t,n,r,o){if("string"===typeof r&&""!==r||"number"===typeof r)return l(t,e=e.get(n)||null,""+r,o);if("object"===typeof r&&null!==r){switch(r.$$typeof){case w:return c(t,e=e.get(null===r.key?n:r.key)||null,r,o);case S:return d(t,e=e.get(null===r.key?n:r.key)||null,r,o);case P:return f(e,t,n,(0,r._init)(r._payload),o)}if(te(r)||D(r))return u(t,e=e.get(n)||null,r,o,null);xi(t,r)}return null}function m(o,i,s,l){for(var c=null,d=null,u=i,m=i=0,g=null;null!==u&&m<s.length;m++){u.index>m?(g=u,u=null):g=u.sibling;var v=p(o,u,s[m],l);if(null===v){null===u&&(u=g);break}e&&u&&null===v.alternate&&t(o,u),i=a(v,i,m),null===d?c=v:d.sibling=v,d=v,u=g}if(m===s.length)return n(o,u),ii&&Zo(o,m),c;if(null===u){for(;m<s.length;m++)null!==(u=h(o,s[m],l))&&(i=a(u,i,m),null===d?c=u:d.sibling=u,d=u);return ii&&Zo(o,m),c}for(u=r(o,u);m<s.length;m++)null!==(g=f(u,o,m,s[m],l))&&(e&&null!==g.alternate&&u.delete(null===g.key?m:g.key),i=a(g,i,m),null===d?c=g:d.sibling=g,d=g);return e&&u.forEach(function(e){return t(o,e)}),ii&&Zo(o,m),c}function g(o,s,l,c){var d=D(l);if("function"!==typeof d)throw Error(i(150));if(null==(l=d.call(l)))throw Error(i(151));for(var u=d=null,m=s,g=s=0,v=null,x=l.next();null!==m&&!x.done;g++,x=l.next()){m.index>g?(v=m,m=null):v=m.sibling;var b=p(o,m,x.value,c);if(null===b){null===m&&(m=v);break}e&&m&&null===b.alternate&&t(o,m),s=a(b,s,g),null===u?d=b:u.sibling=b,u=b,m=v}if(x.done)return n(o,m),ii&&Zo(o,g),d;if(null===m){for(;!x.done;g++,x=l.next())null!==(x=h(o,x.value,c))&&(s=a(x,s,g),null===u?d=x:u.sibling=x,u=x);return ii&&Zo(o,g),d}for(m=r(o,m);!x.done;g++,x=l.next())null!==(x=f(m,o,g,x.value,c))&&(e&&null!==x.alternate&&m.delete(null===x.key?g:x.key),s=a(x,s,g),null===u?d=x:u.sibling=x,u=x);return e&&m.forEach(function(e){return t(o,e)}),ii&&Zo(o,g),d}return function e(r,i,a,l){if("object"===typeof a&&null!==a&&a.type===j&&null===a.key&&(a=a.props.children),"object"===typeof a&&null!==a){switch(a.$$typeof){case w:e:{for(var c=a.key,d=i;null!==d;){if(d.key===c){if((c=a.type)===j){if(7===d.tag){n(r,d.sibling),(i=o(d,a.props.children)).return=r,r=i;break e}}else if(d.elementType===c||"object"===typeof c&&null!==c&&c.$$typeof===P&&bi(c)===d.type){n(r,d.sibling),(i=o(d,a.props)).ref=vi(r,d,a),i.return=r,r=i;break e}n(r,d);break}t(r,d),d=d.sibling}a.type===j?((i=Lc(a.props.children,r.mode,l,a.key)).return=r,r=i):((l=Oc(a.type,a.key,a.props,null,r.mode,l)).ref=vi(r,i,a),l.return=r,r=l)}return s(r);case S:e:{for(d=a.key;null!==i;){if(i.key===d){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){n(r,i.sibling),(i=o(i,a.children||[])).return=r,r=i;break e}n(r,i);break}t(r,i),i=i.sibling}(i=Nc(a,r.mode,l)).return=r,r=i}return s(r);case P:return e(r,i,(d=a._init)(a._payload),l)}if(te(a))return m(r,i,a,l);if(D(a))return g(r,i,a,l);xi(r,a)}return"string"===typeof a&&""!==a||"number"===typeof a?(a=""+a,null!==i&&6===i.tag?(n(r,i.sibling),(i=o(i,a)).return=r,r=i):(n(r,i),(i=Ic(a,r.mode,l)).return=r,r=i),s(r)):n(r,i)}}var wi=yi(!0),Si=yi(!1),ji=Co(null),ki=null,Ci=null,Ei=null;function _i(){Ei=Ci=ki=null}function zi(e){var t=ji.current;Eo(ji),e._currentValue=t}function Ri(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ai(e,t){ki=e,Ei=Ci=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(bs=!0),e.firstContext=null)}function Ti(e){var t=e._currentValue;if(Ei!==e)if(e={context:e,memoizedValue:t,next:null},null===Ci){if(null===ki)throw Error(i(308));Ci=e,ki.dependencies={lanes:0,firstContext:e}}else Ci=Ci.next=e;return t}var Pi=null;function Oi(e){null===Pi?Pi=[e]:Pi.push(e)}function Li(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,Oi(t)):(n.next=o.next,o.next=n),t.interleaved=n,Di(e,r)}function Di(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Ii=!1;function Ni(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mi(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 Fi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wi(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!==(2&_l)){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Di(e,n)}return null===(o=r.interleaved)?(t.next=t,Oi(r)):(t.next=o.next,o.next=t),r.interleaved=t,Di(e,n)}function Bi(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194240&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,xt(e,n)}}function Ui(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===i?o=i=a:i=i.next=a,n=n.next}while(null!==n);null===i?o=i=t:i=i.next=t}else o=i=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Vi(e,t,n,r){var o=e.updateQueue;Ii=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var l=s,c=l.next;l.next=null,null===a?i=c:a.next=c,a=l;var d=e.alternate;null!==d&&((s=(d=d.updateQueue).lastBaseUpdate)!==a&&(null===s?d.firstBaseUpdate=c:s.next=c,d.lastBaseUpdate=l))}if(null!==i){var u=o.baseState;for(a=0,d=c=l=null,s=i;;){var h=s.lane,p=s.eventTime;if((r&h)===h){null!==d&&(d=d.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var f=e,m=s;switch(h=t,p=n,m.tag){case 1:if("function"===typeof(f=m.payload)){u=f.call(p,u,h);break e}u=f;break e;case 3:f.flags=-65537&f.flags|128;case 0:if(null===(h="function"===typeof(f=m.payload)?f.call(p,u,h):f)||void 0===h)break e;u=N({},u,h);break e;case 2:Ii=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(h=o.effects)?o.effects=[s]:h.push(s))}else p={eventTime:p,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===d?(c=d=p,l=u):d=d.next=p,a|=h;if(null===(s=s.next)){if(null===(s=o.shared.pending))break;s=(h=s).next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}if(null===d&&(l=u),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=d,null!==(t=o.shared.interleaved)){o=t;do{a|=o.lane,o=o.next}while(o!==t)}else null===i&&(o.shared.lanes=0);Dl|=a,e.lanes=a,e.memoizedState=u}}function Hi(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(null!==o){if(r.callback=null,r=n,"function"!==typeof o)throw Error(i(191,o));o.call(r)}}}var qi={},$i=Co(qi),Yi=Co(qi),Ki=Co(qi);function Xi(e){if(e===qi)throw Error(i(174));return e}function Gi(e,t){switch(_o(Ki,t),_o(Yi,e),_o($i,qi),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Eo($i),_o($i,t)}function Ji(){Eo($i),Eo(Yi),Eo(Ki)}function Qi(e){Xi(Ki.current);var t=Xi($i.current),n=le(t,e.type);t!==n&&(_o(Yi,e),_o($i,n))}function Zi(e){Yi.current===e&&(Eo($i),Eo(Yi))}var ea=Co(0);function ta(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var na=[];function ra(){for(var e=0;e<na.length;e++)na[e]._workInProgressVersionPrimary=null;na.length=0}var oa=y.ReactCurrentDispatcher,ia=y.ReactCurrentBatchConfig,aa=0,sa=null,la=null,ca=null,da=!1,ua=!1,ha=0,pa=0;function fa(){throw Error(i(321))}function ma(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sr(e[n],t[n]))return!1;return!0}function ga(e,t,n,r,o,a){if(aa=a,sa=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,oa.current=null===e||null===e.memoizedState?Za:es,e=n(r,o),ua){a=0;do{if(ua=!1,ha=0,25<=a)throw Error(i(301));a+=1,ca=la=null,t.updateQueue=null,oa.current=ts,e=n(r,o)}while(ua)}if(oa.current=Qa,t=null!==la&&null!==la.next,aa=0,ca=la=sa=null,da=!1,t)throw Error(i(300));return e}function va(){var e=0!==ha;return ha=0,e}function xa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ca?sa.memoizedState=ca=e:ca=ca.next=e,ca}function ba(){if(null===la){var e=sa.alternate;e=null!==e?e.memoizedState:null}else e=la.next;var t=null===ca?sa.memoizedState:ca.next;if(null!==t)ca=t,la=e;else{if(null===e)throw Error(i(310));e={memoizedState:(la=e).memoizedState,baseState:la.baseState,baseQueue:la.baseQueue,queue:la.queue,next:null},null===ca?sa.memoizedState=ca=e:ca=ca.next=e}return ca}function ya(e,t){return"function"===typeof t?t(e):t}function wa(e){var t=ba(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=la,o=r.baseQueue,a=n.pending;if(null!==a){if(null!==o){var s=o.next;o.next=a.next,a.next=s}r.baseQueue=o=a,n.pending=null}if(null!==o){a=o.next,r=r.baseState;var l=s=null,c=null,d=a;do{var u=d.lane;if((aa&u)===u)null!==c&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var h={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};null===c?(l=c=h,s=r):c=c.next=h,sa.lanes|=u,Dl|=u}d=d.next}while(null!==d&&d!==a);null===c?s=r:c.next=l,sr(r,t.memoizedState)||(bs=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=c,n.lastRenderedState=r}if(null!==(e=n.interleaved)){o=e;do{a=o.lane,sa.lanes|=a,Dl|=a,o=o.next}while(o!==e)}else null===o&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Sa(e){var t=ba(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,a=t.memoizedState;if(null!==o){n.pending=null;var s=o=o.next;do{a=e(a,s.action),s=s.next}while(s!==o);sr(a,t.memoizedState)||(bs=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function ja(){}function ka(e,t){var n=sa,r=ba(),o=t(),a=!sr(r.memoizedState,o);if(a&&(r.memoizedState=o,bs=!0),r=r.queue,Ia(_a.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||null!==ca&&1&ca.memoizedState.tag){if(n.flags|=2048,Ta(9,Ea.bind(null,n,r,o,t),void 0,null),null===zl)throw Error(i(349));0!==(30&aa)||Ca(n,t,o)}return o}function Ca(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=sa.updateQueue)?(t={lastEffect:null,stores:null},sa.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ea(e,t,n,r){t.value=n,t.getSnapshot=r,za(t)&&Ra(e)}function _a(e,t,n){return n(function(){za(t)&&Ra(e)})}function za(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sr(e,n)}catch(r){return!0}}function Ra(e){var t=Di(e,1);null!==t&&tc(t,e,1,-1)}function Aa(e){var t=xa();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:e},t.queue=e,e=e.dispatch=Ka.bind(null,sa,e),[t.memoizedState,e]}function Ta(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=sa.updateQueue)?(t={lastEffect:null,stores:null},sa.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Pa(){return ba().memoizedState}function Oa(e,t,n,r){var o=xa();sa.flags|=e,o.memoizedState=Ta(1|t,n,void 0,void 0===r?null:r)}function La(e,t,n,r){var o=ba();r=void 0===r?null:r;var i=void 0;if(null!==la){var a=la.memoizedState;if(i=a.destroy,null!==r&&ma(r,a.deps))return void(o.memoizedState=Ta(t,n,i,r))}sa.flags|=e,o.memoizedState=Ta(1|t,n,i,r)}function Da(e,t){return Oa(8390656,8,e,t)}function Ia(e,t){return La(2048,8,e,t)}function Na(e,t){return La(4,2,e,t)}function Ma(e,t){return La(4,4,e,t)}function Fa(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Wa(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,La(4,4,Fa.bind(null,t,e),n)}function Ba(){}function Ua(e,t){var n=ba();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ma(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Va(e,t){var n=ba();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ma(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ha(e,t,n){return 0===(21&aa)?(e.baseState&&(e.baseState=!1,bs=!0),e.memoizedState=n):(sr(n,t)||(n=mt(),sa.lanes|=n,Dl|=n,e.baseState=!0),t)}function qa(e,t){var n=bt;bt=0!==n&&4>n?n:4,e(!0);var r=ia.transition;ia.transition={};try{e(!1),t()}finally{bt=n,ia.transition=r}}function $a(){return ba().memoizedState}function Ya(e,t,n){var r=ec(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Xa(e))Ga(t,n);else if(null!==(n=Li(e,t,n,r))){tc(n,e,r,Zl()),Ja(n,t,r)}}function Ka(e,t,n){var r=ec(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Xa(e))Ga(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,sr(s,a)){var l=t.interleaved;return null===l?(o.next=o,Oi(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(c){}null!==(n=Li(e,t,o,r))&&(tc(n,e,r,o=Zl()),Ja(n,t,r))}}function Xa(e){var t=e.alternate;return e===sa||null!==t&&t===sa}function Ga(e,t){ua=da=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ja(e,t,n){if(0!==(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,xt(e,n)}}var Qa={readContext:Ti,useCallback:fa,useContext:fa,useEffect:fa,useImperativeHandle:fa,useInsertionEffect:fa,useLayoutEffect:fa,useMemo:fa,useReducer:fa,useRef:fa,useState:fa,useDebugValue:fa,useDeferredValue:fa,useTransition:fa,useMutableSource:fa,useSyncExternalStore:fa,useId:fa,unstable_isNewReconciler:!1},Za={readContext:Ti,useCallback:function(e,t){return xa().memoizedState=[e,void 0===t?null:t],e},useContext:Ti,useEffect:Da,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Oa(4194308,4,Fa.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Oa(4194308,4,e,t)},useInsertionEffect:function(e,t){return Oa(4,2,e,t)},useMemo:function(e,t){var n=xa();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=xa();return t=void 0!==n?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=Ya.bind(null,sa,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},xa().memoizedState=e},useState:Aa,useDebugValue:Ba,useDeferredValue:function(e){return xa().memoizedState=e},useTransition:function(){var e=Aa(!1),t=e[0];return e=qa.bind(null,e[1]),xa().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=sa,o=xa();if(ii){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===zl)throw Error(i(349));0!==(30&aa)||Ca(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,Da(_a.bind(null,r,a,e),[e]),r.flags|=2048,Ta(9,Ea.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=xa(),t=zl.identifierPrefix;if(ii){var n=Qo;t=":"+t+"R"+(n=(Jo&~(1<<32-at(Jo)-1)).toString(32)+n),0<(n=ha++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=pa++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},es={readContext:Ti,useCallback:Ua,useContext:Ti,useEffect:Ia,useImperativeHandle:Wa,useInsertionEffect:Na,useLayoutEffect:Ma,useMemo:Va,useReducer:wa,useRef:Pa,useState:function(){return wa(ya)},useDebugValue:Ba,useDeferredValue:function(e){return Ha(ba(),la.memoizedState,e)},useTransition:function(){return[wa(ya)[0],ba().memoizedState]},useMutableSource:ja,useSyncExternalStore:ka,useId:$a,unstable_isNewReconciler:!1},ts={readContext:Ti,useCallback:Ua,useContext:Ti,useEffect:Ia,useImperativeHandle:Wa,useInsertionEffect:Na,useLayoutEffect:Ma,useMemo:Va,useReducer:Sa,useRef:Pa,useState:function(){return Sa(ya)},useDebugValue:Ba,useDeferredValue:function(e){var t=ba();return null===la?t.memoizedState=e:Ha(t,la.memoizedState,e)},useTransition:function(){return[Sa(ya)[0],ba().memoizedState]},useMutableSource:ja,useSyncExternalStore:ka,useId:$a,unstable_isNewReconciler:!1};function ns(e,t){if(e&&e.defaultProps){for(var n in t=N({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function rs(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:N({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var os={isMounted:function(e){return!!(e=e._reactInternals)&&Ue(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Zl(),o=ec(e),i=Fi(r,o);i.payload=t,void 0!==n&&null!==n&&(i.callback=n),null!==(t=Wi(e,i,o))&&(tc(t,e,o,r),Bi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Zl(),o=ec(e),i=Fi(r,o);i.tag=1,i.payload=t,void 0!==n&&null!==n&&(i.callback=n),null!==(t=Wi(e,i,o))&&(tc(t,e,o,r),Bi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Zl(),r=ec(e),o=Fi(n,r);o.tag=2,void 0!==t&&null!==t&&(o.callback=t),null!==(t=Wi(e,o,r))&&(tc(t,e,r,n),Bi(t,e,r))}};function is(e,t,n,r,o,i,a){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!t.prototype||!t.prototype.isPureReactComponent||(!lr(n,r)||!lr(o,i))}function as(e,t,n){var r=!1,o=zo,i=t.contextType;return"object"===typeof i&&null!==i?i=Ti(i):(o=Oo(t)?To:Ro.current,i=(r=null!==(r=t.contextTypes)&&void 0!==r)?Po(e,o):zo),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=os,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function ss(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&os.enqueueReplaceState(t,t.state,null)}function ls(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Ni(e);var i=t.contextType;"object"===typeof i&&null!==i?o.context=Ti(i):(i=Oo(t)?To:Ro.current,o.context=Po(e,i)),o.state=e.memoizedState,"function"===typeof(i=t.getDerivedStateFromProps)&&(rs(e,t,i,n),o.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof o.getSnapshotBeforeUpdate||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||(t=o.state,"function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&os.enqueueReplaceState(o,o.state,null),Vi(e,n,o,r),o.state=e.memoizedState),"function"===typeof o.componentDidMount&&(e.flags|=4194308)}function cs(e,t){try{var n="",r=t;do{n+=B(r),r=r.return}while(r);var o=n}catch(i){o="\nError generating stack: "+i.message+"\n"+i.stack}return{value:e,source:t,stack:o,digest:null}}function ds(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function us(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var hs="function"===typeof WeakMap?WeakMap:Map;function ps(e,t,n){(n=Fi(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Vl||(Vl=!0,Hl=r),us(0,t)},n}function fs(e,t,n){(n=Fi(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){us(0,t)}}var i=e.stateNode;return null!==i&&"function"===typeof i.componentDidCatch&&(n.callback=function(){us(0,t),"function"!==typeof r&&(null===ql?ql=new Set([this]):ql.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function ms(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hs;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=kc.bind(null,e,t,n),t.then(e,e))}function gs(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function vs(e,t,n,r,o){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Fi(-1,1)).tag=2,Wi(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var xs=y.ReactCurrentOwner,bs=!1;function ys(e,t,n,r){t.child=null===e?Si(t,null,n,r):wi(t,e.child,n,r)}function ws(e,t,n,r,o){n=n.render;var i=t.ref;return Ai(t,o),r=ga(e,t,n,r,i,o),n=va(),null===e||bs?(ii&&n&&ti(t),t.flags|=1,ys(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Vs(e,t,o))}function Ss(e,t,n,r,o){if(null===e){var i=n.type;return"function"!==typeof i||Tc(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Oc(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,js(e,t,i,r,o))}if(i=e.child,0===(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:lr)(a,r)&&e.ref===t.ref)return Vs(e,t,o)}return t.flags|=1,(e=Pc(i,r)).ref=t.ref,e.return=t,t.child=e}function js(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(lr(i,r)&&e.ref===t.ref){if(bs=!1,t.pendingProps=r=i,0===(e.lanes&o))return t.lanes=e.lanes,Vs(e,t,o);0!==(131072&e.flags)&&(bs=!0)}}return Es(e,t,n,r,o)}function ks(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},_o(Pl,Tl),Tl|=n;else{if(0===(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,_o(Pl,Tl),Tl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,_o(Pl,Tl),Tl|=r}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,_o(Pl,Tl),Tl|=r;return ys(e,t,o,n),t.child}function Cs(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Es(e,t,n,r,o){var i=Oo(n)?To:Ro.current;return i=Po(t,i),Ai(t,o),n=ga(e,t,n,r,i,o),r=va(),null===e||bs?(ii&&r&&ti(t),t.flags|=1,ys(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Vs(e,t,o))}function _s(e,t,n,r,o){if(Oo(n)){var i=!0;No(t)}else i=!1;if(Ai(t,o),null===t.stateNode)Us(e,t),as(t,n,r),ls(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;"object"===typeof c&&null!==c?c=Ti(c):c=Po(t,c=Oo(n)?To:Ro.current);var d=n.getDerivedStateFromProps,u="function"===typeof d||"function"===typeof a.getSnapshotBeforeUpdate;u||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==r||l!==c)&&ss(t,a,r,c),Ii=!1;var h=t.memoizedState;a.state=h,Vi(t,r,a,o),l=t.memoizedState,s!==r||h!==l||Ao.current||Ii?("function"===typeof d&&(rs(t,n,d,r),l=t.memoizedState),(s=Ii||is(t,n,s,r,h,l,c))?(u||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(t.flags|=4194308)):("function"===typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):("function"===typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Mi(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:ns(t.type,s),a.props=c,u=t.pendingProps,h=a.context,"object"===typeof(l=n.contextType)&&null!==l?l=Ti(l):l=Po(t,l=Oo(n)?To:Ro.current);var p=n.getDerivedStateFromProps;(d="function"===typeof p||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==u||h!==l)&&ss(t,a,r,l),Ii=!1,h=t.memoizedState,a.state=h,Vi(t,r,a,o);var f=t.memoizedState;s!==u||h!==f||Ao.current||Ii?("function"===typeof p&&(rs(t,n,p,r),f=t.memoizedState),(c=Ii||is(t,n,c,r,h,f,l)||!1)?(d||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(r,f,l),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,f,l)),"function"===typeof a.componentDidUpdate&&(t.flags|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=f),a.props=r,a.state=f,a.context=l,r=c):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return zs(e,t,n,r,i,o)}function zs(e,t,n,r,o,i){Cs(e,t);var a=0!==(128&t.flags);if(!r&&!a)return o&&Mo(t,n,!1),Vs(e,t,i);r=t.stateNode,xs.current=t;var s=a&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=wi(t,e.child,null,i),t.child=wi(t,null,s,i)):ys(e,t,s,i),t.memoizedState=r.state,o&&Mo(t,n,!0),t.child}function Rs(e){var t=e.stateNode;t.pendingContext?Do(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Do(0,t.context,!1),Gi(e,t.containerInfo)}function As(e,t,n,r,o){return fi(),mi(o),t.flags|=256,ys(e,t,n,r),t.child}var Ts,Ps,Os,Ls={dehydrated:null,treeContext:null,retryLane:0};function Ds(e){return{baseLanes:e,cachePool:null,transitions:null}}function Is(e,t,n){var r,o=t.pendingProps,a=ea.current,s=!1,l=0!==(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!==(2&a)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),_o(ea,1&a),null===e)return di(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(l=o.children,e=o.fallback,s?(o=t.mode,s=t.child,l={mode:"hidden",children:l},0===(1&o)&&null!==s?(s.childLanes=0,s.pendingProps=l):s=Dc(l,o,0,null),e=Lc(e,o,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Ds(n),t.memoizedState=Ls,e):Ns(t,l));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return function(e,t,n,r,o,a,s){if(n)return 256&t.flags?(t.flags&=-257,Ms(e,t,s,r=ds(Error(i(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=r.fallback,o=t.mode,r=Dc({mode:"visible",children:r.children},o,0,null),(a=Lc(a,o,s,null)).flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,0!==(1&t.mode)&&wi(t,e.child,null,s),t.child.memoizedState=Ds(s),t.memoizedState=Ls,a);if(0===(1&t.mode))return Ms(e,t,s,null);if("$!"===o.data){if(r=o.nextSibling&&o.nextSibling.dataset)var l=r.dgst;return r=l,Ms(e,t,s,r=ds(a=Error(i(419)),r,void 0))}if(l=0!==(s&e.childLanes),bs||l){if(null!==(r=zl)){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!==(o&(r.suspendedLanes|s))?0:o)&&o!==a.retryLane&&(a.retryLane=o,Di(e,o),tc(r,e,o,-1))}return fc(),Ms(e,t,s,r=ds(Error(i(421))))}return"$?"===o.data?(t.flags|=128,t.child=e.child,t=Ec.bind(null,e),o._reactRetry=t,null):(e=a.treeContext,oi=co(o.nextSibling),ri=t,ii=!0,ai=null,null!==e&&(Ko[Xo++]=Jo,Ko[Xo++]=Qo,Ko[Xo++]=Go,Jo=e.id,Qo=e.overflow,Go=t),t=Ns(t,r.children),t.flags|=4096,t)}(e,t,l,o,r,a,n);if(s){s=o.fallback,l=t.mode,r=(a=e.child).sibling;var c={mode:"hidden",children:o.children};return 0===(1&l)&&t.child!==a?((o=t.child).childLanes=0,o.pendingProps=c,t.deletions=null):(o=Pc(a,c)).subtreeFlags=14680064&a.subtreeFlags,null!==r?s=Pc(r,s):(s=Lc(s,l,n,null)).flags|=2,s.return=t,o.return=t,o.sibling=s,t.child=o,o=s,s=t.child,l=null===(l=e.child.memoizedState)?Ds(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Ls,o}return e=(s=e.child).sibling,o=Pc(s,{mode:"visible",children:o.children}),0===(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function Ns(e,t){return(t=Dc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Ms(e,t,n,r){return null!==r&&mi(r),wi(t,e.child,null,n),(e=Ns(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Fs(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Ri(e.return,t,n)}function Ws(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Bs(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(ys(e,t,r.children,n),0!==(2&(r=ea.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Fs(e,n,t);else if(19===e.tag)Fs(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(_o(ea,r),0===(1&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===ta(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ws(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===ta(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ws(t,!0,n,null,i);break;case"together":Ws(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Us(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Vs(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Dl|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=Pc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Pc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Hs(e,t){if(!ii)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function qs(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function $s(e,t,n){var r=t.pendingProps;switch(ni(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qs(t),null;case 1:case 17:return Oo(t.type)&&Lo(),qs(t),null;case 3:return r=t.stateNode,Ji(),Eo(Ao),Eo(Ro),ra(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(hi(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==ai&&(ic(ai),ai=null))),qs(t),null;case 5:Zi(t);var o=Xi(Ki.current);if(n=t.type,null!==e&&null!=t.stateNode)Ps(e,t,n,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(i(166));return qs(t),null}if(e=Xi($i.current),hi(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[po]=t,r[fo]=a,e=0!==(1&t.mode),n){case"dialog":Fr("cancel",r),Fr("close",r);break;case"iframe":case"object":case"embed":Fr("load",r);break;case"video":case"audio":for(o=0;o<Dr.length;o++)Fr(Dr[o],r);break;case"source":Fr("error",r);break;case"img":case"image":case"link":Fr("error",r),Fr("load",r);break;case"details":Fr("toggle",r);break;case"input":G(r,a),Fr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},Fr("invalid",r);break;case"textarea":oe(r,a),Fr("invalid",r)}for(var l in xe(n,a),o=null,a)if(a.hasOwnProperty(l)){var c=a[l];"children"===l?"string"===typeof c?r.textContent!==c&&(!0!==a.suppressHydrationWarning&&Qr(r.textContent,c,e),o=["children",c]):"number"===typeof c&&r.textContent!==""+c&&(!0!==a.suppressHydrationWarning&&Qr(r.textContent,c,e),o=["children",""+c]):s.hasOwnProperty(l)&&null!=c&&"onScroll"===l&&Fr("scroll",r)}switch(n){case"input":$(r),Z(r,a,!0);break;case"textarea":$(r),ae(r);break;case"select":case"option":break;default:"function"===typeof a.onClick&&(r.onclick=Zr)}r=o,t.updateQueue=r,null!==r&&(t.flags|=4)}else{l=9===o.nodeType?o:o.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=se(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),"select"===n&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[po]=t,e[fo]=r,Ts(e,t),t.stateNode=e;e:{switch(l=be(n,r),n){case"dialog":Fr("cancel",e),Fr("close",e),o=r;break;case"iframe":case"object":case"embed":Fr("load",e),o=r;break;case"video":case"audio":for(o=0;o<Dr.length;o++)Fr(Dr[o],e);o=r;break;case"source":Fr("error",e),o=r;break;case"img":case"image":case"link":Fr("error",e),Fr("load",e),o=r;break;case"details":Fr("toggle",e),o=r;break;case"input":G(e,r),o=X(e,r),Fr("invalid",e);break;case"option":default:o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=N({},r,{value:void 0}),Fr("invalid",e);break;case"textarea":oe(e,r),o=re(e,r),Fr("invalid",e)}for(a in xe(n,o),c=o)if(c.hasOwnProperty(a)){var d=c[a];"style"===a?ge(e,d):"dangerouslySetInnerHTML"===a?null!=(d=d?d.__html:void 0)&&ue(e,d):"children"===a?"string"===typeof d?("textarea"!==n||""!==d)&&he(e,d):"number"===typeof d&&he(e,""+d):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(s.hasOwnProperty(a)?null!=d&&"onScroll"===a&&Fr("scroll",e):null!=d&&b(e,a,d,l))}switch(n){case"input":$(e),Z(e,r,!1);break;case"textarea":$(e),ae(e);break;case"option":null!=r.value&&e.setAttribute("value",""+H(r.value));break;case"select":e.multiple=!!r.multiple,null!=(a=r.value)?ne(e,!!r.multiple,a,!1):null!=r.defaultValue&&ne(e,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof o.onClick&&(e.onclick=Zr)}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)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return qs(t),null;case 6:if(e&&null!=t.stateNode)Os(0,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(i(166));if(n=Xi(Ki.current),Xi($i.current),hi(t)){if(r=t.stateNode,n=t.memoizedProps,r[po]=t,(a=r.nodeValue!==n)&&null!==(e=ri))switch(e.tag){case 3:Qr(r.nodeValue,n,0!==(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Qr(r.nodeValue,n,0!==(1&e.mode))}a&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[po]=t,t.stateNode=r}return qs(t),null;case 13:if(Eo(ea),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(ii&&null!==oi&&0!==(1&t.mode)&&0===(128&t.flags))pi(),fi(),t.flags|=98560,a=!1;else if(a=hi(t),null!==r&&null!==r.dehydrated){if(null===e){if(!a)throw Error(i(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(i(317));a[po]=t}else fi(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;qs(t),a=!1}else null!==ai&&(ic(ai),ai=null),a=!0;if(!a)return 65536&t.flags?t:null}return 0!==(128&t.flags)?(t.lanes=n,t):((r=null!==r)!==(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,0!==(1&t.mode)&&(null===e||0!==(1&ea.current)?0===Ol&&(Ol=3):fc())),null!==t.updateQueue&&(t.flags|=4),qs(t),null);case 4:return Ji(),null===e&&Ur(t.stateNode.containerInfo),qs(t),null;case 10:return zi(t.type._context),qs(t),null;case 19:if(Eo(ea),null===(a=t.memoizedState))return qs(t),null;if(r=0!==(128&t.flags),null===(l=a.rendering))if(r)Hs(a,!1);else{if(0!==Ol||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(l=ta(e))){for(t.flags|=128,Hs(a,!1),null!==(r=l.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(a=n).flags&=14680066,null===(l=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,e=l.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return _o(ea,1&ea.current|2),t.child}e=e.sibling}null!==a.tail&&Je()>Bl&&(t.flags|=128,r=!0,Hs(a,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=ta(l))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Hs(a,!0),null===a.tail&&"hidden"===a.tailMode&&!l.alternate&&!ii)return qs(t),null}else 2*Je()-a.renderingStartTime>Bl&&1073741824!==n&&(t.flags|=128,r=!0,Hs(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=a.last)?n.sibling=l:t.child=l,a.last=l)}return null!==a.tail?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Je(),t.sibling=null,n=ea.current,_o(ea,r?1&n|2:1&n),t):(qs(t),null);case 22:case 23:return dc(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!==(1&t.mode)?0!==(1073741824&Tl)&&(qs(t),6&t.subtreeFlags&&(t.flags|=8192)):qs(t),null;case 24:case 25:return null}throw Error(i(156,t.tag))}function Ys(e,t){switch(ni(t),t.tag){case 1:return Oo(t.type)&&Lo(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Ji(),Eo(Ao),Eo(Ro),ra(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Zi(t),null;case 13:if(Eo(ea),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));fi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Eo(ea),null;case 4:return Ji(),null;case 10:return zi(t.type._context),null;case 22:case 23:return dc(),null;default:return null}}Ts=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ps=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Xi($i.current);var i,a=null;switch(n){case"input":o=X(e,o),r=X(e,r),a=[];break;case"select":o=N({},o,{value:void 0}),r=N({},r,{value:void 0}),a=[];break;case"textarea":o=re(e,o),r=re(e,r),a=[];break;default:"function"!==typeof o.onClick&&"function"===typeof r.onClick&&(e.onclick=Zr)}for(d in xe(n,r),n=null,o)if(!r.hasOwnProperty(d)&&o.hasOwnProperty(d)&&null!=o[d])if("style"===d){var l=o[d];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(s.hasOwnProperty(d)?a||(a=[]):(a=a||[]).push(d,null));for(d in r){var c=r[d];if(l=null!=o?o[d]:void 0,r.hasOwnProperty(d)&&c!==l&&(null!=c||null!=l))if("style"===d)if(l){for(i in l)!l.hasOwnProperty(i)||c&&c.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in c)c.hasOwnProperty(i)&&l[i]!==c[i]&&(n||(n={}),n[i]=c[i])}else n||(a||(a=[]),a.push(d,n)),n=c;else"dangerouslySetInnerHTML"===d?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(a=a||[]).push(d,c)):"children"===d?"string"!==typeof c&&"number"!==typeof c||(a=a||[]).push(d,""+c):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(s.hasOwnProperty(d)?(null!=c&&"onScroll"===d&&Fr("scroll",e),a||l===c||(a=[])):(a=a||[]).push(d,c))}n&&(a=a||[]).push("style",n);var d=a;(t.updateQueue=d)&&(t.flags|=4)}},Os=function(e,t,n,r){n!==r&&(t.flags|=4)};var Ks=!1,Xs=!1,Gs="function"===typeof WeakSet?WeakSet:Set,Js=null;function Qs(e,t){var n=e.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(r){jc(e,t,r)}else n.current=null}function Zs(e,t,n){try{n()}catch(r){jc(e,t,r)}}var el=!1;function tl(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&Zs(t,n,i)}o=o.next}while(o!==r)}}function nl(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect: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 rl(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"===typeof t?t(e):t.current=e}}function ol(e){var t=e.alternate;null!==t&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[po],delete t[fo],delete t[go],delete t[vo],delete t[xo])),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 il(e){return 5===e.tag||3===e.tag||4===e.tag}function al(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||il(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function sl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=Zr));else if(4!==r&&null!==(e=e.child))for(sl(e,t,n),e=e.sibling;null!==e;)sl(e,t,n),e=e.sibling}function ll(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(ll(e,t,n),e=e.sibling;null!==e;)ll(e,t,n),e=e.sibling}var cl=null,dl=!1;function ul(e,t,n){for(n=n.child;null!==n;)hl(e,t,n),n=n.sibling}function hl(e,t,n){if(it&&"function"===typeof it.onCommitFiberUnmount)try{it.onCommitFiberUnmount(ot,n)}catch(s){}switch(n.tag){case 5:Xs||Qs(n,t);case 6:var r=cl,o=dl;cl=null,ul(e,t,n),dl=o,null!==(cl=r)&&(dl?(e=cl,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):cl.removeChild(n.stateNode));break;case 18:null!==cl&&(dl?(e=cl,n=n.stateNode,8===e.nodeType?lo(e.parentNode,n):1===e.nodeType&&lo(e,n),Ut(e)):lo(cl,n.stateNode));break;case 4:r=cl,o=dl,cl=n.stateNode.containerInfo,dl=!0,ul(e,t,n),cl=r,dl=o;break;case 0:case 11:case 14:case 15:if(!Xs&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(0!==(2&i)||0!==(4&i))&&Zs(n,t,a),o=o.next}while(o!==r)}ul(e,t,n);break;case 1:if(!Xs&&(Qs(n,t),"function"===typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){jc(n,t,s)}ul(e,t,n);break;case 21:ul(e,t,n);break;case 22:1&n.mode?(Xs=(r=Xs)||null!==n.memoizedState,ul(e,t,n),Xs=r):ul(e,t,n);break;default:ul(e,t,n)}}function pl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Gs),t.forEach(function(t){var r=_c.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function fl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var o=n[r];try{var a=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 5:cl=l.stateNode,dl=!1;break e;case 3:case 4:cl=l.stateNode.containerInfo,dl=!0;break e}l=l.return}if(null===cl)throw Error(i(160));hl(a,s,o),cl=null,dl=!1;var c=o.alternate;null!==c&&(c.return=null),o.return=null}catch(d){jc(o,t,d)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)ml(t,e),t=t.sibling}function ml(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(fl(t,e),gl(e),4&r){try{tl(3,e,e.return),nl(3,e)}catch(g){jc(e,e.return,g)}try{tl(5,e,e.return)}catch(g){jc(e,e.return,g)}}break;case 1:fl(t,e),gl(e),512&r&&null!==n&&Qs(n,n.return);break;case 5:if(fl(t,e),gl(e),512&r&&null!==n&&Qs(n,n.return),32&e.flags){var o=e.stateNode;try{he(o,"")}catch(g){jc(e,e.return,g)}}if(4&r&&null!=(o=e.stateNode)){var a=e.memoizedProps,s=null!==n?n.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===l&&"radio"===a.type&&null!=a.name&&J(o,a),be(l,s);var d=be(l,a);for(s=0;s<c.length;s+=2){var u=c[s],h=c[s+1];"style"===u?ge(o,h):"dangerouslySetInnerHTML"===u?ue(o,h):"children"===u?he(o,h):b(o,u,h,d)}switch(l){case"input":Q(o,a);break;case"textarea":ie(o,a);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!a.multiple;var f=a.value;null!=f?ne(o,!!a.multiple,f,!1):p!==!!a.multiple&&(null!=a.defaultValue?ne(o,!!a.multiple,a.defaultValue,!0):ne(o,!!a.multiple,a.multiple?[]:"",!1))}o[fo]=a}catch(g){jc(e,e.return,g)}}break;case 6:if(fl(t,e),gl(e),4&r){if(null===e.stateNode)throw Error(i(162));o=e.stateNode,a=e.memoizedProps;try{o.nodeValue=a}catch(g){jc(e,e.return,g)}}break;case 3:if(fl(t,e),gl(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Ut(t.containerInfo)}catch(g){jc(e,e.return,g)}break;case 4:default:fl(t,e),gl(e);break;case 13:fl(t,e),gl(e),8192&(o=e.child).flags&&(a=null!==o.memoizedState,o.stateNode.isHidden=a,!a||null!==o.alternate&&null!==o.alternate.memoizedState||(Wl=Je())),4&r&&pl(e);break;case 22:if(u=null!==n&&null!==n.memoizedState,1&e.mode?(Xs=(d=Xs)||u,fl(t,e),Xs=d):fl(t,e),gl(e),8192&r){if(d=null!==e.memoizedState,(e.stateNode.isHidden=d)&&!u&&0!==(1&e.mode))for(Js=e,u=e.child;null!==u;){for(h=Js=u;null!==Js;){switch(f=(p=Js).child,p.tag){case 0:case 11:case 14:case 15:tl(4,p,p.return);break;case 1:Qs(p,p.return);var m=p.stateNode;if("function"===typeof m.componentWillUnmount){r=p,n=p.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){jc(r,n,g)}}break;case 5:Qs(p,p.return);break;case 22:if(null!==p.memoizedState){yl(h);continue}}null!==f?(f.return=p,Js=f):yl(h)}u=u.sibling}e:for(u=null,h=e;;){if(5===h.tag){if(null===u){u=h;try{o=h.stateNode,d?"function"===typeof(a=o.style).setProperty?a.setProperty("display","none","important"):a.display="none":(l=h.stateNode,s=void 0!==(c=h.memoizedProps.style)&&null!==c&&c.hasOwnProperty("display")?c.display:null,l.style.display=me("display",s))}catch(g){jc(e,e.return,g)}}}else if(6===h.tag){if(null===u)try{h.stateNode.nodeValue=d?"":h.memoizedProps}catch(g){jc(e,e.return,g)}}else if((22!==h.tag&&23!==h.tag||null===h.memoizedState||h===e)&&null!==h.child){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;null===h.sibling;){if(null===h.return||h.return===e)break e;u===h&&(u=null),h=h.return}u===h&&(u=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:fl(t,e),gl(e),4&r&&pl(e);case 21:}}function gl(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(il(n)){var r=n;break e}n=n.return}throw Error(i(160))}switch(r.tag){case 5:var o=r.stateNode;32&r.flags&&(he(o,""),r.flags&=-33),ll(e,al(e),o);break;case 3:case 4:var a=r.stateNode.containerInfo;sl(e,al(e),a);break;default:throw Error(i(161))}}catch(s){jc(e,e.return,s)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function vl(e,t,n){Js=e,xl(e,t,n)}function xl(e,t,n){for(var r=0!==(1&e.mode);null!==Js;){var o=Js,i=o.child;if(22===o.tag&&r){var a=null!==o.memoizedState||Ks;if(!a){var s=o.alternate,l=null!==s&&null!==s.memoizedState||Xs;s=Ks;var c=Xs;if(Ks=a,(Xs=l)&&!c)for(Js=o;null!==Js;)l=(a=Js).child,22===a.tag&&null!==a.memoizedState?wl(o):null!==l?(l.return=a,Js=l):wl(o);for(;null!==i;)Js=i,xl(i,t,n),i=i.sibling;Js=o,Ks=s,Xs=c}bl(e)}else 0!==(8772&o.subtreeFlags)&&null!==i?(i.return=o,Js=i):bl(e)}}function bl(e){for(;null!==Js;){var t=Js;if(0!==(8772&t.flags)){var n=t.alternate;try{if(0!==(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Xs||nl(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!Xs)if(null===n)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:ns(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&Hi(t,a,r);break;case 3:var s=t.updateQueue;if(null!==s){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}Hi(t,s,n)}break;case 5:var l=t.stateNode;if(null===n&&4&t.flags){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var d=t.alternate;if(null!==d){var u=d.memoizedState;if(null!==u){var h=u.dehydrated;null!==h&&Ut(h)}}}break;default:throw Error(i(163))}Xs||512&t.flags&&rl(t)}catch(p){jc(t,t.return,p)}}if(t===e){Js=null;break}if(null!==(n=t.sibling)){n.return=t.return,Js=n;break}Js=t.return}}function yl(e){for(;null!==Js;){var t=Js;if(t===e){Js=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Js=n;break}Js=t.return}}function wl(e){for(;null!==Js;){var t=Js;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{nl(4,t)}catch(l){jc(t,n,l)}break;case 1:var r=t.stateNode;if("function"===typeof r.componentDidMount){var o=t.return;try{r.componentDidMount()}catch(l){jc(t,o,l)}}var i=t.return;try{rl(t)}catch(l){jc(t,i,l)}break;case 5:var a=t.return;try{rl(t)}catch(l){jc(t,a,l)}}}catch(l){jc(t,t.return,l)}if(t===e){Js=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Js=s;break}Js=t.return}}var Sl,jl=Math.ceil,kl=y.ReactCurrentDispatcher,Cl=y.ReactCurrentOwner,El=y.ReactCurrentBatchConfig,_l=0,zl=null,Rl=null,Al=0,Tl=0,Pl=Co(0),Ol=0,Ll=null,Dl=0,Il=0,Nl=0,Ml=null,Fl=null,Wl=0,Bl=1/0,Ul=null,Vl=!1,Hl=null,ql=null,$l=!1,Yl=null,Kl=0,Xl=0,Gl=null,Jl=-1,Ql=0;function Zl(){return 0!==(6&_l)?Je():-1!==Jl?Jl:Jl=Je()}function ec(e){return 0===(1&e.mode)?1:0!==(2&_l)&&0!==Al?Al&-Al:null!==gi.transition?(0===Ql&&(Ql=mt()),Ql):0!==(e=bt)?e:e=void 0===(e=window.event)?16:Gt(e.type)}function tc(e,t,n,r){if(50<Xl)throw Xl=0,Gl=null,Error(i(185));vt(e,n,r),0!==(2&_l)&&e===zl||(e===zl&&(0===(2&_l)&&(Il|=n),4===Ol&&ac(e,Al)),nc(e,r),1===n&&0===_l&&0===(1&t.mode)&&(Bl=Je()+500,Wo&&Vo()))}function nc(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-at(i),s=1<<a,l=o[a];-1===l?0!==(s&n)&&0===(s&r)||(o[a]=pt(s,t)):l<=t&&(e.expiredLanes|=s),i&=~s}}(e,t);var r=ht(e,e===zl?Al:0);if(0===r)null!==n&&Ke(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Ke(n),1===t)0===e.tag?function(e){Wo=!0,Uo(e)}(sc.bind(null,e)):Uo(sc.bind(null,e)),ao(function(){0===(6&_l)&&Vo()}),n=null;else{switch(yt(r)){case 1:n=Ze;break;case 4:n=et;break;case 16:default:n=tt;break;case 536870912:n=rt}n=zc(n,rc.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function rc(e,t){if(Jl=-1,Ql=0,0!==(6&_l))throw Error(i(327));var n=e.callbackNode;if(wc()&&e.callbackNode!==n)return null;var r=ht(e,e===zl?Al:0);if(0===r)return null;if(0!==(30&r)||0!==(r&e.expiredLanes)||t)t=mc(e,r);else{t=r;var o=_l;_l|=2;var a=pc();for(zl===e&&Al===t||(Ul=null,Bl=Je()+500,uc(e,t));;)try{vc();break}catch(l){hc(e,l)}_i(),kl.current=a,_l=o,null!==Rl?t=0:(zl=null,Al=0,t=Ol)}if(0!==t){if(2===t&&(0!==(o=ft(e))&&(r=o,t=oc(e,o))),1===t)throw n=Ll,uc(e,0),ac(e,r),nc(e,Je()),n;if(6===t)ac(e,r);else{if(o=e.current.alternate,0===(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!sr(i(),o))return!1}catch(s){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(o)&&(2===(t=mc(e,r))&&(0!==(a=ft(e))&&(r=a,t=oc(e,a))),1===t))throw n=Ll,uc(e,0),ac(e,r),nc(e,Je()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(i(345));case 2:case 5:yc(e,Fl,Ul);break;case 3:if(ac(e,r),(130023424&r)===r&&10<(t=Wl+500-Je())){if(0!==ht(e,0))break;if(((o=e.suspendedLanes)&r)!==r){Zl(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ro(yc.bind(null,e,Fl,Ul),t);break}yc(e,Fl,Ul);break;case 4:if(ac(e,r),(4194240&r)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-at(r);a=1<<s,(s=t[s])>o&&(o=s),r&=~a}if(r=o,10<(r=(120>(r=Je()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*jl(r/1960))-r)){e.timeoutHandle=ro(yc.bind(null,e,Fl,Ul),r);break}yc(e,Fl,Ul);break;default:throw Error(i(329))}}}return nc(e,Je()),e.callbackNode===n?rc.bind(null,e):null}function oc(e,t){var n=Ml;return e.current.memoizedState.isDehydrated&&(uc(e,t).flags|=256),2!==(e=mc(e,t))&&(t=Fl,Fl=n,null!==t&&ic(t)),e}function ic(e){null===Fl?Fl=e:Fl.push.apply(Fl,e)}function ac(e,t){for(t&=~Nl,t&=~Il,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-at(t),r=1<<n;e[n]=-1,t&=~r}}function sc(e){if(0!==(6&_l))throw Error(i(327));wc();var t=ht(e,0);if(0===(1&t))return nc(e,Je()),null;var n=mc(e,t);if(0!==e.tag&&2===n){var r=ft(e);0!==r&&(t=r,n=oc(e,r))}if(1===n)throw n=Ll,uc(e,0),ac(e,t),nc(e,Je()),n;if(6===n)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,yc(e,Fl,Ul),nc(e,Je()),null}function lc(e,t){var n=_l;_l|=1;try{return e(t)}finally{0===(_l=n)&&(Bl=Je()+500,Wo&&Vo())}}function cc(e){null!==Yl&&0===Yl.tag&&0===(6&_l)&&wc();var t=_l;_l|=1;var n=El.transition,r=bt;try{if(El.transition=null,bt=1,e)return e()}finally{bt=r,El.transition=n,0===(6&(_l=t))&&Vo()}}function dc(){Tl=Pl.current,Eo(Pl)}function uc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,oo(n)),null!==Rl)for(n=Rl.return;null!==n;){var r=n;switch(ni(r),r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&Lo();break;case 3:Ji(),Eo(Ao),Eo(Ro),ra();break;case 5:Zi(r);break;case 4:Ji();break;case 13:case 19:Eo(ea);break;case 10:zi(r.type._context);break;case 22:case 23:dc()}n=n.return}if(zl=e,Rl=e=Pc(e.current,null),Al=Tl=t,Ol=0,Ll=null,Nl=Il=Dl=0,Fl=Ml=null,null!==Pi){for(t=0;t<Pi.length;t++)if(null!==(r=(n=Pi[t]).interleaved)){n.interleaved=null;var o=r.next,i=n.pending;if(null!==i){var a=i.next;i.next=o,r.next=a}n.pending=r}Pi=null}return e}function hc(e,t){for(;;){var n=Rl;try{if(_i(),oa.current=Qa,da){for(var r=sa.memoizedState;null!==r;){var o=r.queue;null!==o&&(o.pending=null),r=r.next}da=!1}if(aa=0,ca=la=sa=null,ua=!1,ha=0,Cl.current=null,null===n||null===n.return){Ol=1,Ll=t,Rl=null;break}e:{var a=e,s=n.return,l=n,c=t;if(t=Al,l.flags|=32768,null!==c&&"object"===typeof c&&"function"===typeof c.then){var d=c,u=l,h=u.tag;if(0===(1&u.mode)&&(0===h||11===h||15===h)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var f=gs(s);if(null!==f){f.flags&=-257,vs(f,s,l,0,t),1&f.mode&&ms(a,d,t),c=d;var m=(t=f).updateQueue;if(null===m){var g=new Set;g.add(c),t.updateQueue=g}else m.add(c);break e}if(0===(1&t)){ms(a,d,t),fc();break e}c=Error(i(426))}else if(ii&&1&l.mode){var v=gs(s);if(null!==v){0===(65536&v.flags)&&(v.flags|=256),vs(v,s,l,0,t),mi(cs(c,l));break e}}a=c=cs(c,l),4!==Ol&&(Ol=2),null===Ml?Ml=[a]:Ml.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t,Ui(a,ps(0,c,t));break e;case 1:l=c;var x=a.type,b=a.stateNode;if(0===(128&a.flags)&&("function"===typeof x.getDerivedStateFromError||null!==b&&"function"===typeof b.componentDidCatch&&(null===ql||!ql.has(b)))){a.flags|=65536,t&=-t,a.lanes|=t,Ui(a,fs(a,l,t));break e}}a=a.return}while(null!==a)}bc(n)}catch(y){t=y,Rl===n&&null!==n&&(Rl=n=n.return);continue}break}}function pc(){var e=kl.current;return kl.current=Qa,null===e?Qa:e}function fc(){0!==Ol&&3!==Ol&&2!==Ol||(Ol=4),null===zl||0===(268435455&Dl)&&0===(268435455&Il)||ac(zl,Al)}function mc(e,t){var n=_l;_l|=2;var r=pc();for(zl===e&&Al===t||(Ul=null,uc(e,t));;)try{gc();break}catch(o){hc(e,o)}if(_i(),_l=n,kl.current=r,null!==Rl)throw Error(i(261));return zl=null,Al=0,Ol}function gc(){for(;null!==Rl;)xc(Rl)}function vc(){for(;null!==Rl&&!Xe();)xc(Rl)}function xc(e){var t=Sl(e.alternate,e,Tl);e.memoizedProps=e.pendingProps,null===t?bc(e):Rl=t,Cl.current=null}function bc(e){var t=e;do{var n=t.alternate;if(e=t.return,0===(32768&t.flags)){if(null!==(n=$s(n,t,Tl)))return void(Rl=n)}else{if(null!==(n=Ys(n,t)))return n.flags&=32767,void(Rl=n);if(null===e)return Ol=6,void(Rl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Rl=t);Rl=t=e}while(null!==t);0===Ol&&(Ol=5)}function yc(e,t,n){var r=bt,o=El.transition;try{El.transition=null,bt=1,function(e,t,n,r){do{wc()}while(null!==Yl);if(0!==(6&_l))throw Error(i(327));n=e.finishedWork;var o=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-at(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}(e,a),e===zl&&(Rl=zl=null,Al=0),0===(2064&n.subtreeFlags)&&0===(2064&n.flags)||$l||($l=!0,zc(tt,function(){return wc(),null})),a=0!==(15990&n.flags),0!==(15990&n.subtreeFlags)||a){a=El.transition,El.transition=null;var s=bt;bt=1;var l=_l;_l|=4,Cl.current=null,function(e,t){if(eo=Ht,pr(e=hr())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var o=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch(w){n=null;break e}var s=0,l=-1,c=-1,d=0,u=0,h=e,p=null;t:for(;;){for(var f;h!==n||0!==o&&3!==h.nodeType||(l=s+o),h!==a||0!==r&&3!==h.nodeType||(c=s+r),3===h.nodeType&&(s+=h.nodeValue.length),null!==(f=h.firstChild);)p=h,h=f;for(;;){if(h===e)break t;if(p===n&&++d===o&&(l=s),p===a&&++u===r&&(c=s),null!==(f=h.nextSibling))break;p=(h=p).parentNode}h=f}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(to={focusedElem:e,selectionRange:n},Ht=!1,Js=t;null!==Js;)if(e=(t=Js).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,Js=e;else for(;null!==Js;){t=Js;try{var m=t.alternate;if(0!==(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==m){var g=m.memoizedProps,v=m.memoizedState,x=t.stateNode,b=x.getSnapshotBeforeUpdate(t.elementType===t.type?g:ns(t.type,g),v);x.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var y=t.stateNode.containerInfo;1===y.nodeType?y.textContent="":9===y.nodeType&&y.documentElement&&y.removeChild(y.documentElement);break;default:throw Error(i(163))}}catch(w){jc(t,t.return,w)}if(null!==(e=t.sibling)){e.return=t.return,Js=e;break}Js=t.return}m=el,el=!1}(e,n),ml(n,e),fr(to),Ht=!!eo,to=eo=null,e.current=n,vl(n,e,o),Ge(),_l=l,bt=s,El.transition=a}else e.current=n;if($l&&($l=!1,Yl=e,Kl=o),a=e.pendingLanes,0===a&&(ql=null),function(e){if(it&&"function"===typeof it.onCommitFiberRoot)try{it.onCommitFiberRoot(ot,e,void 0,128===(128&e.current.flags))}catch(t){}}(n.stateNode),nc(e,Je()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Vl)throw Vl=!1,e=Hl,Hl=null,e;0!==(1&Kl)&&0!==e.tag&&wc(),a=e.pendingLanes,0!==(1&a)?e===Gl?Xl++:(Xl=0,Gl=e):Xl=0,Vo()}(e,t,n,r)}finally{El.transition=o,bt=r}return null}function wc(){if(null!==Yl){var e=yt(Kl),t=El.transition,n=bt;try{if(El.transition=null,bt=16>e?16:e,null===Yl)var r=!1;else{if(e=Yl,Yl=null,Kl=0,0!==(6&_l))throw Error(i(331));var o=_l;for(_l|=4,Js=e.current;null!==Js;){var a=Js,s=a.child;if(0!==(16&Js.flags)){var l=a.deletions;if(null!==l){for(var c=0;c<l.length;c++){var d=l[c];for(Js=d;null!==Js;){var u=Js;switch(u.tag){case 0:case 11:case 15:tl(8,u,a)}var h=u.child;if(null!==h)h.return=u,Js=h;else for(;null!==Js;){var p=(u=Js).sibling,f=u.return;if(ol(u),u===d){Js=null;break}if(null!==p){p.return=f,Js=p;break}Js=f}}}var m=a.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(null!==g)}}Js=a}}if(0!==(2064&a.subtreeFlags)&&null!==s)s.return=a,Js=s;else e:for(;null!==Js;){if(0!==(2048&(a=Js).flags))switch(a.tag){case 0:case 11:case 15:tl(9,a,a.return)}var x=a.sibling;if(null!==x){x.return=a.return,Js=x;break e}Js=a.return}}var b=e.current;for(Js=b;null!==Js;){var y=(s=Js).child;if(0!==(2064&s.subtreeFlags)&&null!==y)y.return=s,Js=y;else e:for(s=b;null!==Js;){if(0!==(2048&(l=Js).flags))try{switch(l.tag){case 0:case 11:case 15:nl(9,l)}}catch(S){jc(l,l.return,S)}if(l===s){Js=null;break e}var w=l.sibling;if(null!==w){w.return=l.return,Js=w;break e}Js=l.return}}if(_l=o,Vo(),it&&"function"===typeof it.onPostCommitFiberRoot)try{it.onPostCommitFiberRoot(ot,e)}catch(S){}r=!0}return r}finally{bt=n,El.transition=t}}return!1}function Sc(e,t,n){e=Wi(e,t=ps(0,t=cs(n,t),1),1),t=Zl(),null!==e&&(vt(e,1,t),nc(e,t))}function jc(e,t,n){if(3===e.tag)Sc(e,e,n);else for(;null!==t;){if(3===t.tag){Sc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===ql||!ql.has(r))){t=Wi(t,e=fs(t,e=cs(n,e),1),1),e=Zl(),null!==t&&(vt(t,1,e),nc(t,e));break}}t=t.return}}function kc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Zl(),e.pingedLanes|=e.suspendedLanes&n,zl===e&&(Al&n)===n&&(4===Ol||3===Ol&&(130023424&Al)===Al&&500>Je()-Wl?uc(e,0):Nl|=n),nc(e,t)}function Cc(e,t){0===t&&(0===(1&e.mode)?t=1:(t=dt,0===(130023424&(dt<<=1))&&(dt=4194304)));var n=Zl();null!==(e=Di(e,t))&&(vt(e,t,n),nc(e,n))}function Ec(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Cc(e,n)}function _c(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(i(314))}null!==r&&r.delete(t),Cc(e,n)}function zc(e,t){return Ye(e,t)}function Rc(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 Ac(e,t,n,r){return new Rc(e,t,n,r)}function Tc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Pc(e,t){var n=e.alternate;return null===n?((n=Ac(e.tag,t,e.key,e.mode)).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=14680064&e.flags,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=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Oc(e,t,n,r,o,a){var s=2;if(r=e,"function"===typeof e)Tc(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case j:return Lc(n.children,o,a,t);case k:s=8,o|=8;break;case C:return(e=Ac(12,n,t,2|o)).elementType=C,e.lanes=a,e;case R:return(e=Ac(13,n,t,o)).elementType=R,e.lanes=a,e;case A:return(e=Ac(19,n,t,o)).elementType=A,e.lanes=a,e;case O:return Dc(n,o,a,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case E:s=10;break e;case _:s=9;break e;case z:s=11;break e;case T:s=14;break e;case P:s=16,r=null;break e}throw Error(i(130,null==e?e:typeof e,""))}return(t=Ac(s,n,t,o)).elementType=e,t.type=r,t.lanes=a,t}function Lc(e,t,n,r){return(e=Ac(7,e,r,t)).lanes=n,e}function Dc(e,t,n,r){return(e=Ac(22,e,r,t)).elementType=O,e.lanes=n,e.stateNode={isHidden:!1},e}function Ic(e,t,n){return(e=Ac(6,e,null,t)).lanes=n,e}function Nc(e,t,n){return(t=Ac(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Mc(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gt(0),this.expirationTimes=gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Fc(e,t,n,r,o,i,a,s,l){return e=new Mc(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=Ac(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ni(i),e}function Wc(e){if(!e)return zo;e:{if(Ue(e=e._reactInternals)!==e||1!==e.tag)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Oo(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(i(171))}if(1===e.tag){var n=e.type;if(Oo(n))return Io(e,n,t)}return t}function Bc(e,t,n,r,o,i,a,s,l){return(e=Fc(n,r,!0,e,0,i,0,s,l)).context=Wc(null),n=e.current,(i=Fi(r=Zl(),o=ec(n))).callback=void 0!==t&&null!==t?t:null,Wi(n,i,o),e.current.lanes=o,vt(e,o,r),nc(e,r),e}function Uc(e,t,n,r){var o=t.current,i=Zl(),a=ec(o);return n=Wc(n),null===t.context?t.context=n:t.pendingContext=n,(t=Fi(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Wi(o,t,a))&&(tc(e,o,a,i),Bi(e,o,a)),a}function Vc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Hc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function qc(e,t){Hc(e,t),(e=e.alternate)&&Hc(e,t)}Sl=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||Ao.current)bs=!0;else{if(0===(e.lanes&n)&&0===(128&t.flags))return bs=!1,function(e,t,n){switch(t.tag){case 3:Rs(t),fi();break;case 5:Qi(t);break;case 1:Oo(t.type)&&No(t);break;case 4:Gi(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;_o(ji,r._currentValue),r._currentValue=o;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(_o(ea,1&ea.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Is(e,t,n):(_o(ea,1&ea.current),null!==(e=Vs(e,t,n))?e.sibling:null);_o(ea,1&ea.current);break;case 19:if(r=0!==(n&t.childLanes),0!==(128&e.flags)){if(r)return Bs(e,t,n);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),_o(ea,ea.current),r)break;return null;case 22:case 23:return t.lanes=0,ks(e,t,n)}return Vs(e,t,n)}(e,t,n);bs=0!==(131072&e.flags)}else bs=!1,ii&&0!==(1048576&t.flags)&&ei(t,Yo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Us(e,t),e=t.pendingProps;var o=Po(t,Ro.current);Ai(t,n),o=ga(null,t,r,e,o,n);var a=va();return t.flags|=1,"object"===typeof o&&null!==o&&"function"===typeof o.render&&void 0===o.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Oo(r)?(a=!0,No(t)):a=!1,t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,Ni(t),o.updater=os,t.stateNode=o,o._reactInternals=t,ls(t,r,e,n),t=zs(null,t,r,!0,a,n)):(t.tag=0,ii&&a&&ti(t),ys(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Us(e,t),e=t.pendingProps,r=(o=r._init)(r._payload),t.type=r,o=t.tag=function(e){if("function"===typeof e)return Tc(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===z)return 11;if(e===T)return 14}return 2}(r),e=ns(r,e),o){case 0:t=Es(null,t,r,e,n);break e;case 1:t=_s(null,t,r,e,n);break e;case 11:t=ws(null,t,r,e,n);break e;case 14:t=Ss(null,t,r,ns(r.type,e),n);break e}throw Error(i(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,Es(e,t,r,o=t.elementType===r?o:ns(r,o),n);case 1:return r=t.type,o=t.pendingProps,_s(e,t,r,o=t.elementType===r?o:ns(r,o),n);case 3:e:{if(Rs(t),null===e)throw Error(i(387));r=t.pendingProps,o=(a=t.memoizedState).element,Mi(e,t),Vi(t,r,null,n);var s=t.memoizedState;if(r=s.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=As(e,t,r,n,o=cs(Error(i(423)),t));break e}if(r!==o){t=As(e,t,r,n,o=cs(Error(i(424)),t));break e}for(oi=co(t.stateNode.containerInfo.firstChild),ri=t,ii=!0,ai=null,n=Si(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(fi(),r===o){t=Vs(e,t,n);break e}ys(e,t,r,n)}t=t.child}return t;case 5:return Qi(t),null===e&&di(t),r=t.type,o=t.pendingProps,a=null!==e?e.memoizedProps:null,s=o.children,no(r,o)?s=null:null!==a&&no(r,a)&&(t.flags|=32),Cs(e,t),ys(e,t,s,n),t.child;case 6:return null===e&&di(t),null;case 13:return Is(e,t,n);case 4:return Gi(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=wi(t,null,r,n):ys(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,ws(e,t,r,o=t.elementType===r?o:ns(r,o),n);case 7:return ys(e,t,t.pendingProps,n),t.child;case 8:case 12:return ys(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,a=t.memoizedProps,s=o.value,_o(ji,r._currentValue),r._currentValue=s,null!==a)if(sr(a.value,s)){if(a.children===o.children&&!Ao.current){t=Vs(e,t,n);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var l=a.dependencies;if(null!==l){s=a.child;for(var c=l.firstContext;null!==c;){if(c.context===r){if(1===a.tag){(c=Fi(-1,n&-n)).tag=2;var d=a.updateQueue;if(null!==d){var u=(d=d.shared).pending;null===u?c.next=c:(c.next=u.next,u.next=c),d.pending=c}}a.lanes|=n,null!==(c=a.alternate)&&(c.lanes|=n),Ri(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(10===a.tag)s=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(s=a.return))throw Error(i(341));s.lanes|=n,null!==(l=s.alternate)&&(l.lanes|=n),Ri(s,n,t),s=a.sibling}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===t){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}ys(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Ai(t,n),r=r(o=Ti(o)),t.flags|=1,ys(e,t,r,n),t.child;case 14:return o=ns(r=t.type,t.pendingProps),Ss(e,t,r,o=ns(r.type,o),n);case 15:return js(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ns(r,o),Us(e,t),t.tag=1,Oo(r)?(e=!0,No(t)):e=!1,Ai(t,n),as(t,r,o),ls(t,r,o,n),zs(null,t,r,!0,e,n);case 19:return Bs(e,t,n);case 22:return ks(e,t,n)}throw Error(i(156,t.tag))};var $c="function"===typeof reportError?reportError:function(e){console.error(e)};function Yc(e){this._internalRoot=e}function Kc(e){this._internalRoot=e}function Xc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Gc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Jc(){}function Qc(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if("function"===typeof o){var s=o;o=function(){var e=Vc(a);s.call(e)}}Uc(t,a,e,o)}else a=function(e,t,n,r,o){if(o){if("function"===typeof r){var i=r;r=function(){var e=Vc(a);i.call(e)}}var a=Bc(t,r,e,0,null,!1,0,"",Jc);return e._reactRootContainer=a,e[mo]=a.current,Ur(8===e.nodeType?e.parentNode:e),cc(),a}for(;o=e.lastChild;)e.removeChild(o);if("function"===typeof r){var s=r;r=function(){var e=Vc(l);s.call(e)}}var l=Fc(e,0,!1,null,0,!1,0,"",Jc);return e._reactRootContainer=l,e[mo]=l.current,Ur(8===e.nodeType?e.parentNode:e),cc(function(){Uc(t,l,n,r)}),l}(n,t,e,o,r);return Vc(a)}Kc.prototype.render=Yc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(i(409));Uc(e,t,null,null)},Kc.prototype.unmount=Yc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;cc(function(){Uc(null,e,null,null)}),t[mo]=null}},Kc.prototype.unstable_scheduleHydration=function(e){if(e){var t=kt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ot.length&&0!==t&&t<Ot[n].priority;n++);Ot.splice(n,0,e),0===n&&Nt(e)}},wt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ut(t.pendingLanes);0!==n&&(xt(t,1|n),nc(t,Je()),0===(6&_l)&&(Bl=Je()+500,Vo()))}break;case 13:cc(function(){var t=Di(e,1);if(null!==t){var n=Zl();tc(t,e,1,n)}}),qc(e,1)}},St=function(e){if(13===e.tag){var t=Di(e,134217728);if(null!==t)tc(t,e,134217728,Zl());qc(e,134217728)}},jt=function(e){if(13===e.tag){var t=ec(e),n=Di(e,t);if(null!==n)tc(n,e,t,Zl());qc(e,t)}},kt=function(){return bt},Ct=function(e,t){var n=bt;try{return bt=e,t()}finally{bt=n}},Se=function(e,t,n){switch(t){case"input":if(Q(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=So(r);if(!o)throw Error(i(90));Y(r),Q(r,o)}}}break;case"textarea":ie(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},ze=lc,Re=cc;var Zc={usingClientEntryPoint:!1,Events:[yo,wo,So,Ee,_e,lc]},ed={findFiberByHostInstance:bo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},td={bundleType:ed.bundleType,version:ed.version,rendererPackageName:ed.rendererPackageName,rendererConfig:ed.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:y.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=qe(e))?null:e.stateNode},findFiberByHostInstance:ed.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var nd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nd.isDisabled&&nd.supportsFiber)try{ot=nd.inject(td),it=nd}catch(de){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Zc,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Xc(t))throw Error(i(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:S,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!Xc(e))throw Error(i(299));var n=!1,r="",o=$c;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(o=t.onRecoverableError)),t=Fc(e,1,!1,null,0,n,0,r,o),e[mo]=t.current,Ur(8===e.nodeType?e.parentNode:e),new Yc(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(i(188));throw e=Object.keys(e).join(","),Error(i(268,e))}return e=null===(e=qe(t))?null:e.stateNode},t.flushSync=function(e){return cc(e)},t.hydrate=function(e,t,n){if(!Gc(t))throw Error(i(200));return Qc(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!Xc(e))throw Error(i(405));var r=null!=n&&n.hydratedSources||null,o=!1,a="",s=$c;if(null!==n&&void 0!==n&&(!0===n.unstable_strictMode&&(o=!0),void 0!==n.identifierPrefix&&(a=n.identifierPrefix),void 0!==n.onRecoverableError&&(s=n.onRecoverableError)),t=Bc(t,null,e,1,null!=n?n:null,o,0,a,s),e[mo]=t.current,Ur(e),r)for(e=0;e<r.length;e++)o=(o=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Kc(t)},t.render=function(e,t,n){if(!Gc(t))throw Error(i(200));return Qc(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Gc(e))throw Error(i(40));return!!e._reactRootContainer&&(cc(function(){Qc(null,null,e,!1,function(){e._reactRootContainer=null,e[mo]=null})}),!0)},t.unstable_batchedUpdates=lc,t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Gc(n))throw Error(i(200));if(null==e||void 0===e._reactInternals)throw Error(i(38));return Qc(e,t,n,!1,r)},t.version="18.3.1-next-f1338f8080-20240426"},352(e,t,n){"use strict";var r=n(119);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},119(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(345)},901(e){var t="undefined"!==typeof Element,n="function"===typeof Map,r="function"===typeof Set,o="function"===typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(e,a){if(e===a)return!0;if(e&&a&&"object"==typeof e&&"object"==typeof a){if(e.constructor!==a.constructor)return!1;var s,l,c,d;if(Array.isArray(e)){if((s=e.length)!=a.length)return!1;for(l=s;0!==l--;)if(!i(e[l],a[l]))return!1;return!0}if(n&&e instanceof Map&&a instanceof Map){if(e.size!==a.size)return!1;for(d=e.entries();!(l=d.next()).done;)if(!a.has(l.value[0]))return!1;for(d=e.entries();!(l=d.next()).done;)if(!i(l.value[1],a.get(l.value[0])))return!1;return!0}if(r&&e instanceof Set&&a instanceof Set){if(e.size!==a.size)return!1;for(d=e.entries();!(l=d.next()).done;)if(!a.has(l.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(a)){if((s=e.length)!=a.length)return!1;for(l=s;0!==l--;)if(e[l]!==a[l])return!1;return!0}if(e.constructor===RegExp)return e.source===a.source&&e.flags===a.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"===typeof e.valueOf&&"function"===typeof a.valueOf)return e.valueOf()===a.valueOf();if(e.toString!==Object.prototype.toString&&"function"===typeof e.toString&&"function"===typeof a.toString)return e.toString()===a.toString();if((s=(c=Object.keys(e)).length)!==Object.keys(a).length)return!1;for(l=s;0!==l--;)if(!Object.prototype.hasOwnProperty.call(a,c[l]))return!1;if(t&&e instanceof Element)return!1;for(l=s;0!==l--;)if(("_owner"!==c[l]&&"__v"!==c[l]&&"__o"!==c[l]||!e.$$typeof)&&!i(e[c[l]],a[c[l]]))return!1;return!0}return e!==e&&a!==a}e.exports=function(e,t){try{return i(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}},577(e,t){"use strict";var n="function"===typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,d=n?Symbol.for("react.async_mode"):60111,u=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,f=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,x=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,y=n?Symbol.for("react.scope"):60119;function w(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case d:case u:case i:case s:case a:case p:return e;default:switch(e=e&&e.$$typeof){case c:case h:case g:case m:case l:return e;default:return t}}case o:return t}}}function S(e){return w(e)===u}t.AsyncMode=d,t.ConcurrentMode=u,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=h,t.Fragment=i,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=p,t.isAsyncMode=function(e){return S(e)||w(e)===d},t.isConcurrentMode=S,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===h},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===s},t.isStrictMode=function(e){return w(e)===a},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===i||e===u||e===s||e===a||e===p||e===f||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===h||e.$$typeof===x||e.$$typeof===b||e.$$typeof===y||e.$$typeof===v)},t.typeOf=w},429(e,t,n){"use strict";e.exports=n(577)},654(e,t,n){"use strict";var r=n(950),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,d=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(d=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:d,props:i,_owner:s.current}}t.Fragment=i,t.jsx=c,t.jsxs=c},49(e,t){"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||f}function x(){}function b(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||f}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},x.prototype=v.prototype;var y=b.prototype=new x;y.constructor=b,m(y,v.prototype),y.isPureReactComponent=!0;var w=Array.isArray,S=Object.prototype.hasOwnProperty,j={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,r){var o,i={},a=null,s=null;if(null!=t)for(o in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)S.call(t,o)&&!k.hasOwnProperty(o)&&(i[o]=t[o]);var l=arguments.length-2;if(1===l)i.children=r;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];i.children=c}if(e&&e.defaultProps)for(o in l=e.defaultProps)void 0===i[o]&&(i[o]=l[o]);return{$$typeof:n,type:e,key:a,ref:s,props:i,_owner:j.current}}function E(e){return"object"===typeof e&&null!==e&&e.$$typeof===n}var _=/\/+/g;function z(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function R(e,t,o,i,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l=!1;if(null===e)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case r:l=!0}}if(l)return a=a(l=e),e=""===i?"."+z(l,0):i,w(a)?(o="",null!=e&&(o=e.replace(_,"$&/")+"/"),R(a,t,o,"",function(e){return e})):null!=a&&(E(a)&&(a=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,o+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(_,"$&/")+"/")+e)),t.push(a)),1;if(l=0,i=""===i?".":i+":",w(e))for(var c=0;c<e.length;c++){var d=i+z(s=e[c],c);l+=R(s,t,o,d,a)}else if(d=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"===typeof d)for(e=d.call(e),c=0;!(s=e.next()).done;)l+=R(s=s.value,t,o,d=i+z(s,c++),a);else if("object"===s)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function A(e,t,n){if(null==e)return e;var r=[],o=0;return R(e,r,"","",function(e){return t.call(n,e,o++)}),r}function T(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var P={current:null},O={transition:null},L={ReactCurrentDispatcher:P,ReactCurrentBatchConfig:O,ReactCurrentOwner:j};function D(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:A,forEach:function(e,t,n){A(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return A(e,function(){t++}),t},toArray:function(e){return A(e,function(e){return e})||[]},only:function(e){if(!E(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=v,t.Fragment=o,t.Profiler=a,t.PureComponent=b,t.StrictMode=i,t.Suspense=d,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L,t.act=D,t.cloneElement=function(e,t,r){if(null===e||void 0===e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=m({},e.props),i=e.key,a=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,s=j.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)S.call(t,c)&&!k.hasOwnProperty(c)&&(o[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)o.children=r;else if(1<c){l=Array(c);for(var d=0;d<c;d++)l[d]=arguments[d+2];o.children=l}return{$$typeof:n,type:e.type,key:i,ref:a,props:o,_owner:s}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=C,t.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=E,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:T}},t.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=O.transition;O.transition={};try{e()}finally{O.transition=t}},t.unstable_act=D,t.useCallback=function(e,t){return P.current.useCallback(e,t)},t.useContext=function(e){return P.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return P.current.useDeferredValue(e)},t.useEffect=function(e,t){return P.current.useEffect(e,t)},t.useId=function(){return P.current.useId()},t.useImperativeHandle=function(e,t,n){return P.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return P.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return P.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return P.current.useMemo(e,t)},t.useReducer=function(e,t,n){return P.current.useReducer(e,t,n)},t.useRef=function(e){return P.current.useRef(e)},t.useState=function(e){return P.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return P.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return P.current.useTransition()},t.version="18.3.1"},950(e,t,n){"use strict";e.exports=n(49)},414(e,t,n){"use strict";e.exports=n(654)},761(e,t){"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function r(e){return 0===e.length?null:e[0]}function o(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,a=o>>>1;r<a;){var s=2*(r+1)-1,l=e[s],c=s+1,d=e[c];if(0>i(l,n))c<o&&0>i(d,l)?(e[r]=d,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c<o&&0>i(d,n)))break e;e[r]=d,e[c]=n,r=c}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var c=[],d=[],u=1,h=null,p=3,f=!1,m=!1,g=!1,v="function"===typeof setTimeout?setTimeout:null,x="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function y(e){for(var t=r(d);null!==t;){if(null===t.callback)o(d);else{if(!(t.startTime<=e))break;o(d),t.sortIndex=t.expirationTime,n(c,t)}t=r(d)}}function w(e){if(g=!1,y(e),!m)if(null!==r(c))m=!0,O(S);else{var t=r(d);null!==t&&L(w,t.startTime-e)}}function S(e,n){m=!1,g&&(g=!1,x(E),E=-1),f=!0;var i=p;try{for(y(n),h=r(c);null!==h&&(!(h.expirationTime>n)||e&&!R());){var a=h.callback;if("function"===typeof a){h.callback=null,p=h.priorityLevel;var s=a(h.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?h.callback=s:h===r(c)&&o(c),y(n)}else o(c);h=r(c)}if(null!==h)var l=!0;else{var u=r(d);null!==u&&L(w,u.startTime-n),l=!1}return l}finally{h=null,p=i,f=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var j,k=!1,C=null,E=-1,_=5,z=-1;function R(){return!(t.unstable_now()-z<_)}function A(){if(null!==C){var e=t.unstable_now();z=e;var n=!0;try{n=C(!0,e)}finally{n?j():(k=!1,C=null)}}else k=!1}if("function"===typeof b)j=function(){b(A)};else if("undefined"!==typeof MessageChannel){var T=new MessageChannel,P=T.port2;T.port1.onmessage=A,j=function(){P.postMessage(null)}}else j=function(){v(A,0)};function O(e){C=e,k||(k=!0,j())}function L(e,n){E=v(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){m||f||(m=!0,O(S))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,o,i){var a=t.unstable_now();switch("object"===typeof i&&null!==i?i="number"===typeof(i=i.delay)&&0<i?a+i:a:i=a,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:u++,callback:o,priorityLevel:e,startTime:i,expirationTime:s=i+s,sortIndex:-1},i>a?(e.sortIndex=i,n(d,e),null===r(c)&&e===r(d)&&(g?(x(E),E=-1):g=!0,L(w,i-a))):(e.sortIndex=s,n(c,e),m||f||(m=!0,O(S))),e},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},340(e,t,n){"use strict";e.exports=n(761)}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r](i,i.exports,n),i.loaded=!0,i.exports}(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;n.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if("object"===typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&"function"===typeof r.then)return r}var i=Object.create(null);n.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&o&&r;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>a[e]=()=>r[e]);return a.default=()=>r,n.d(i,a),i}})(),n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.nc=void 0,(()=>{"use strict";var e={};n.r(e),n.d(e,{hasBrowserEnv:()=>nN,hasStandardBrowserEnv:()=>oN,hasStandardBrowserWebWorkerEnv:()=>iN,navigator:()=>rN,origin:()=>aN});var t=n(950),r=n.t(t,2),o=n(352),i=n(414);const a=new Set(["dark","light","system"]);function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{initialColorMode:t="light",type:n="localStorage",storageKey:r="chakra-ui-color-mode"}=e,o=function(e){let t=e;return a.has(t)||(t="light"),t}(t),i="cookie"===n,s='(function(){try{var a=function(o){var l="(prefers-color-scheme: dark)",v=window.matchMedia(l).matches?"dark":"light",e=o==="system"?v:o,d=document.documentElement,m=document.body,i="chakra-ui-light",n="chakra-ui-dark",s=e==="dark";return m.classList.add(s?n:i),m.classList.remove(s?i:n),d.style.colorScheme=e,d.dataset.theme=e,e},u=a,h="'.concat(o,'",r="').concat(r,'",t=document.cookie.match(new RegExp("(^| )".concat(r,"=([^;]+)"))),c=t?t[2]:null;c?a(c):document.cookie="".concat(r,"=").concat(a(h),"; max-age=31536000; path=/")}catch(a){}})();\n '),l='(function(){try{var a=function(c){var v="(prefers-color-scheme: dark)",h=window.matchMedia(v).matches?"dark":"light",r=c==="system"?h:c,o=document.documentElement,s=document.body,l="chakra-ui-light",d="chakra-ui-dark",i=r==="dark";return s.classList.add(i?d:l),s.classList.remove(i?l:d),o.style.colorScheme=r,o.dataset.theme=r,r},n=a,m="'.concat(o,'",e="').concat(r,'",t=localStorage.getItem(e);t?a(t):localStorage.setItem(e,a(m))}catch(a){}})();\n ');return"!".concat(i?s:l).trim()}function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{nonce:t}=e;return(0,i.jsx)("script",{id:"chakra-script",nonce:t,dangerouslySetInnerHTML:{__html:s(e)}})}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e){var t=function(e,t){if("object"!=c(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==c(t)?t:t+""}function u(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!1;function r(t){const n=(["container","root"].includes(null!==t&&void 0!==t?t:"")?[e]:[e,t]).filter(Boolean).join("__"),r="chakra-".concat(n);return{className:r,selector:".".concat(r),toString:()=>t}}return{parts:function(){!function(){if(n)throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?");n=!0}();for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];for(const e of i)t[e]=r(e);return f(e,t)},toPart:r,extend:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];for(const e of o)e in t||(t[e]=r(e));return f(e,t)},selectors:function(){const e=Object.fromEntries(Object.entries(t).map(e=>{let[t,n]=e;return[t,n.selector]}));return e},classnames:function(){return Object.fromEntries(Object.entries(t).map(e=>{let[t,n]=e;return[t,n.className]}))},get keys(){return Object.keys(t)},__type:{}}}const m=f("accordion").parts("root","container","button","panel","icon"),g=f("alert").parts("title","description","container","icon","spinner"),v=f("avatar").parts("label","badge","container","excessLabel","group"),x=f("breadcrumb").parts("link","item","container","separator"),b=(f("button").parts(),f("checkbox").parts("control","icon","container","label")),y=(f("progress").parts("track","filledTrack","label"),f("drawer").parts("overlay","dialogContainer","dialog","header","closeButton","body","footer")),w=f("editable").parts("preview","input","textarea"),S=f("form").parts("container","requiredIndicator","helperText"),j=f("formError").parts("text","icon"),k=f("input").parts("addon","field","element","group"),C=f("list").parts("container","item","icon"),E=f("menu").parts("button","list","item","groupTitle","icon","command","divider"),_=f("modal").parts("overlay","dialogContainer","dialog","header","closeButton","body","footer"),z=f("numberinput").parts("root","field","stepperGroup","stepper"),R=(f("pininput").parts("field"),f("popover").parts("content","header","body","footer","popper","arrow","closeButton")),A=f("progress").parts("label","filledTrack","track"),T=f("radio").parts("container","control","label"),P=f("select").parts("field","icon"),O=f("slider").parts("container","track","thumb","filledTrack","mark"),L=f("stat").parts("container","label","helpText","number","icon"),D=f("switch").parts("container","track","thumb","label"),I=f("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),N=f("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),M=f("tag").parts("container","label","closeButton"),F=f("card").parts("container","header","body","footer");f("stepper").parts("stepper","step","title","description","indicator","separator","icon","number");function W(e){return{definePartsStyle:e=>e,defineMultiStyleConfig:t=>p({parts:e},t)}}const{definePartsStyle:B,defineMultiStyleConfig:U}=W(m.keys),V=U({baseStyle:B({container:{borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},button:{transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},panel:{pt:"2",px:"4",pb:"5"},icon:{fontSize:"1.25em"}})});function H(e){const t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return e.replace(/\s+/g,t)}(e.toString());return function(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}(function(e){if(e.includes("\\."))return e;const t=!Number.isInteger(parseFloat(e.toString()));return t?e.replace(".","\\."):e}(t))}function q(e,t){return"var(".concat(e).concat(t?", ".concat(t):"",")")}function $(e){return H("--".concat(function(e){return[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e].filter(Boolean).join("-")}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"")))}function Y(e,t,n){const r=$(e,n);return{variable:r,reference:q(r,t)}}function K(e,t,n){return Math.min(Math.max(e,n),t)}class X extends Error{constructor(e){super('Failed to parse color: "'.concat(e,'"'))}}var G=X;function J(e){if("string"!==typeof e)throw new G(e);if("transparent"===e.trim().toLowerCase())return[0,0,0,0];let t=e.trim();t=ie.test(e)?function(e){const t=e.toLowerCase().trim(),n=Z[function(e){let t=5381,n=e.length;for(;n;)t=33*t^e.charCodeAt(--n);return(t>>>0)%2341}(t)];if(!n)throw new G(e);return"#".concat(n)}(e):e;const n=te.exec(t);if(n){const e=Array.from(n).slice(1);return[...e.slice(0,3).map(e=>parseInt(ee(e,2),16)),parseInt(ee(e[3]||"f",2),16)/255]}const r=ne.exec(t);if(r){const e=Array.from(r).slice(1);return[...e.slice(0,3).map(e=>parseInt(e,16)),parseInt(e[3]||"ff",16)/255]}const o=re.exec(t);if(o){const e=Array.from(o).slice(1);return[...e.slice(0,3).map(e=>parseInt(e,10)),parseFloat(e[3]||"1")]}const i=oe.exec(t);if(i){const[t,n,r,o]=Array.from(i).slice(1).map(parseFloat);if(K(0,100,n)!==n)throw new G(e);if(K(0,100,r)!==r)throw new G(e);return[...se(t,n,r),Number.isNaN(o)?1:o]}throw new G(e)}const Q=e=>parseInt(e.replace(/_/g,""),36),Z="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=Q(t.substring(0,3)),r=Q(t.substring(3)).toString(16);let o="";for(let i=0;i<6-r.length;i++)o+="0";return e[n]="".concat(o).concat(r),e},{});const ee=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),te=new RegExp("^#".concat(ee("([a-f0-9])",3),"([a-f0-9])?$"),"i"),ne=new RegExp("^#".concat(ee("([a-f0-9]{2})",3),"([a-f0-9]{2})?$"),"i"),re=new RegExp("^rgba?\\(\\s*(\\d+)\\s*".concat(ee(",\\s*(\\d+)\\s*",2),"(?:,\\s*([\\d.]+))?\\s*\\)$"),"i"),oe=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,ie=/^[a-z]+$/i,ae=e=>Math.round(255*e),se=(e,t,n)=>{let r=n/100;if(0===t)return[r,r,r].map(ae);const o=(e%360+360)%360/60,i=(1-Math.abs(2*r-1))*(t/100),a=i*(1-Math.abs(o%2-1));let s=0,l=0,c=0;o>=0&&o<1?(s=i,l=a):o>=1&&o<2?(s=a,l=i):o>=2&&o<3?(l=i,c=a):o>=3&&o<4?(l=a,c=i):o>=4&&o<5?(s=a,c=i):o>=5&&o<6&&(s=i,c=a);const d=r-i/2;return[s+d,l+d,c+d].map(ae)};function le(e,t,n,r){return"rgba(".concat(K(0,255,e).toFixed(),", ").concat(K(0,255,t).toFixed(),", ").concat(K(0,255,n).toFixed(),", ").concat(parseFloat(K(0,1,r).toFixed(3)),")")}function ce(e,t){const[n,r,o,i]=J(e);return le(n,r,o,i-t)}const de=(e,t,n)=>{const r=function(e,t,n,r,o){for(t=t.split?t.split("."):t,r=0;r<t.length;r++)e=e?e[t[r]]:o;return e===o?n:e}(e,"colors.".concat(t),t);try{return function(e){const[t,n,r,o]=J(e);let i=e=>{const t=K(0,255,e).toString(16);return 1===t.length?"0".concat(t):t};"#".concat(i(t)).concat(i(n)).concat(i(r)).concat(o<1?i(Math.round(255*o)):"")}(r),r}catch(o){return null!==n&&void 0!==n?n:"#000000"}},ue=e=>t=>{const n=(e=>{const[t,n,r]=J(e);return(299*t+587*n+114*r)/1e3})(de(t,e));return n<128?"dark":"light"},he=(e,t)=>n=>ce(de(n,e),1-t);function pe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"1rem",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgba(255, 255, 255, 0.15)";return{backgroundImage:"linear-gradient(\n 45deg,\n ".concat(t," 25%,\n transparent 25%,\n transparent 50%,\n ").concat(t," 50%,\n ").concat(t," 75%,\n transparent 75%,\n transparent\n )"),backgroundSize:"".concat(e," ").concat(e)}}function fe(e){const t="#".concat(Math.floor(16777215*Math.random()).toString(16).padEnd(6,"0"));return e&&(n=e,0!==Object.keys(n).length)?e.string&&e.colors?function(e,t){let n=0;if(0===e.length)return t[0];for(let r=0;r<e.length;r+=1)n=e.charCodeAt(r)+((n<<5)-n),n&=n;return n=(n%t.length+t.length)%t.length,t[n]}(e.string,e.colors):e.string&&!e.colors?function(e){let t=0;if(0===e.length)return t.toString();for(let r=0;r<e.length;r+=1)t=e.charCodeAt(r)+((t<<5)-t),t&=t;let n="#";for(let r=0;r<3;r+=1){n+="00".concat((t>>8*r&255).toString(16)).substr(-2)}return n}(e.string):e.colors&&!e.string?function(e){return e[Math.floor(Math.random()*e.length)]}(e.colors):t:t;var n}const{definePartsStyle:me,defineMultiStyleConfig:ge}=W(g.keys),ve=Y("alert-fg"),xe=Y("alert-bg");function be(e){const{theme:t,colorScheme:n}=e,r=he("".concat(n,".200"),.16)(t);return{light:"colors.".concat(n,".100"),dark:r}}const ye=ge({baseStyle:me({container:{bg:xe.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:ve.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:ve.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}}),variants:{subtle:me(e=>{const{colorScheme:t}=e,n=be(e);return{container:{[ve.variable]:"colors.".concat(t,".600"),[xe.variable]:n.light,_dark:{[ve.variable]:"colors.".concat(t,".200"),[xe.variable]:n.dark}}}}),"left-accent":me(e=>{const{colorScheme:t}=e,n=be(e);return{container:{[ve.variable]:"colors.".concat(t,".600"),[xe.variable]:n.light,_dark:{[ve.variable]:"colors.".concat(t,".200"),[xe.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:ve.reference}}}),"top-accent":me(e=>{const{colorScheme:t}=e,n=be(e);return{container:{[ve.variable]:"colors.".concat(t,".600"),[xe.variable]:n.light,_dark:{[ve.variable]:"colors.".concat(t,".200"),[xe.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:ve.reference}}}),solid:me(e=>{const{colorScheme:t}=e;return{container:{[ve.variable]:"colors.white",[xe.variable]:"colors.".concat(t,".600"),_dark:{[ve.variable]:"colors.gray.900",[xe.variable]:"colors.".concat(t,".200")},color:ve.reference}}})},defaultProps:{variant:"subtle",colorScheme:"blue"}}),we={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},Se=p(p(p({},we),{max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"}),{},{container:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px"}});function je(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"===typeof e?e(...n):e}const{definePartsStyle:ke,defineMultiStyleConfig:Ce}=W(v.keys),Ee=Y("avatar-border-color"),_e=Y("avatar-bg"),ze=Y("avatar-font-size"),Re=Y("avatar-size"),Ae={borderRadius:"full",border:"0.2em solid",borderColor:Ee.reference,[Ee.variable]:"white",_dark:{[Ee.variable]:"colors.gray.800"}},Te={bg:_e.reference,fontSize:ze.reference,width:Re.reference,height:Re.reference,lineHeight:"1",[_e.variable]:"colors.gray.200",_dark:{[_e.variable]:"colors.whiteAlpha.400"}},Pe=e=>{const{name:t,theme:n}=e,r=t?fe({string:t}):"colors.gray.400",o=(e=>t=>"dark"===ue(e)(t))(r)(n);let i="white";return o||(i="gray.800"),{bg:_e.reference,fontSize:ze.reference,color:i,borderColor:Ee.reference,verticalAlign:"top",width:Re.reference,height:Re.reference,"&:not([data-loaded])":{[_e.variable]:r},[Ee.variable]:"colors.white",_dark:{[Ee.variable]:"colors.gray.800"}}},Oe={fontSize:ze.reference,lineHeight:"1"};function Le(e){const t="100%"!==e?Se[e]:void 0;return ke({container:{[Re.variable]:null!==t&&void 0!==t?t:e,[ze.variable]:"calc(".concat(null!==t&&void 0!==t?t:e," / 2.5)")},excessLabel:{[Re.variable]:null!==t&&void 0!==t?t:e,[ze.variable]:"calc(".concat(null!==t&&void 0!==t?t:e," / 2.5)")}})}const De=Ce({baseStyle:ke(e=>({badge:je(Ae,e),excessLabel:je(Te,e),container:je(Pe,e),label:Oe})),sizes:{"2xs":Le(4),xs:Le(6),sm:Le(8),md:Le(12),lg:Le(16),xl:Le(24),"2xl":Le(32),full:Le("100%")},defaultProps:{size:"md"}}),Ie=function(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[t,o]=r;n[t]=Y("".concat(e,"-").concat(t),o);continue}n[r]=Y("".concat(e,"-").concat(r))}return n}("badge",["bg","color","shadow"]),Ne=e=>{const{colorScheme:t,theme:n}=e,r=he("".concat(t,".500"),.6)(n);return{[Ie.bg.variable]:"colors.".concat(t,".500"),[Ie.color.variable]:"colors.white",_dark:{[Ie.bg.variable]:r,[Ie.color.variable]:"colors.whiteAlpha.800"}}},Me=e=>{const{colorScheme:t,theme:n}=e,r=he("".concat(t,".200"),.16)(n);return{[Ie.bg.variable]:"colors.".concat(t,".100"),[Ie.color.variable]:"colors.".concat(t,".800"),_dark:{[Ie.bg.variable]:r,[Ie.color.variable]:"colors.".concat(t,".200")}}},Fe=e=>{const{colorScheme:t,theme:n}=e,r=he("".concat(t,".200"),.8)(n);return{[Ie.color.variable]:"colors.".concat(t,".500"),_dark:{[Ie.color.variable]:r},[Ie.shadow.variable]:"inset 0 0 0px 1px ".concat(Ie.color.reference)}},We={baseStyle:{px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:Ie.bg.reference,color:Ie.color.reference,boxShadow:Ie.shadow.reference},variants:{solid:Ne,subtle:Me,outline:Fe},defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:Be,definePartsStyle:Ue}=W(x.keys),Ve=Y("breadcrumb-link-decor"),He=Be({baseStyle:Ue({link:{transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:Ve.reference,[Ve.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[Ve.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}}})});function qe(e,t){return n=>"dark"===n.colorMode?t:e}function $e(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?"vertical"===t?n:r:{}}const Ye=e=>{const{colorScheme:t,theme:n}=e;if("gray"===t)return{color:qe("gray.800","whiteAlpha.900")(e),_hover:{bg:qe("gray.100","whiteAlpha.200")(e)},_active:{bg:qe("gray.200","whiteAlpha.300")(e)}};const r=he("".concat(t,".200"),.12)(n),o=he("".concat(t,".200"),.24)(n);return{color:qe("".concat(t,".600"),"".concat(t,".200"))(e),bg:"transparent",_hover:{bg:qe("".concat(t,".50"),r)(e)},_active:{bg:qe("".concat(t,".100"),o)(e)}}},Ke={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},Xe=e=>{var t;const{colorScheme:n}=e;if("gray"===n){const t=qe("gray.100","whiteAlpha.200")(e);return{bg:t,color:qe("gray.800","whiteAlpha.900")(e),_hover:{bg:qe("gray.200","whiteAlpha.300")(e),_disabled:{bg:t}},_active:{bg:qe("gray.300","whiteAlpha.400")(e)}}}const{bg:r="".concat(n,".500"),color:o="white",hoverBg:i="".concat(n,".600"),activeBg:a="".concat(n,".700")}=null!==(t=Ke[n])&&void 0!==t?t:{},s=qe(r,"".concat(n,".200"))(e);return{bg:s,color:qe(o,"gray.800")(e),_hover:{bg:qe(i,"".concat(n,".300"))(e),_disabled:{bg:s}},_active:{bg:qe(a,"".concat(n,".400"))(e)}}},Ge={baseStyle:{lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},variants:{ghost:Ye,outline:e=>{const{colorScheme:t}=e,n=qe("gray.200","whiteAlpha.300")(e);return p({border:"1px solid",borderColor:"gray"===t?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"}},je(Ye,e))},solid:Xe,link:e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:qe("".concat(t,".500"),"".concat(t,".200"))(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:qe("".concat(t,".700"),"".concat(t,".500"))(e)}}},unstyled:{bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"}},sizes:{lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Je,defineMultiStyleConfig:Qe}=W(F.keys),Ze=Y("card-bg"),et=Y("card-padding"),tt=Y("card-shadow"),nt=Y("card-radius"),rt=Y("card-border-width","0"),ot=Y("card-border-color"),it=Je({container:{[Ze.variable]:"colors.chakra-body-bg",backgroundColor:Ze.reference,boxShadow:tt.reference,borderRadius:nt.reference,color:"chakra-body-text",borderWidth:rt.reference,borderColor:ot.reference},body:{padding:et.reference,flex:"1 1 0%"},header:{padding:et.reference},footer:{padding:et.reference}}),at={sm:Je({container:{[nt.variable]:"radii.base",[et.variable]:"space.3"}}),md:Je({container:{[nt.variable]:"radii.md",[et.variable]:"space.5"}}),lg:Je({container:{[nt.variable]:"radii.xl",[et.variable]:"space.7"}})},st=Qe({baseStyle:it,variants:{elevated:Je({container:{[tt.variable]:"shadows.base",_dark:{[Ze.variable]:"colors.gray.700"}}}),outline:Je({container:{[rt.variable]:"1px",[ot.variable]:"colors.chakra-border-color"}}),filled:Je({container:{[Ze.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[et.variable]:0},header:{[et.variable]:0},footer:{[et.variable]:0}}},sizes:at,defaultProps:{variant:"elevated",size:"md"}}),{definePartsStyle:lt,defineMultiStyleConfig:ct}=W(b.keys),dt=Y("checkbox-size"),ut=e=>{const{colorScheme:t}=e;return{w:dt.reference,h:dt.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:qe("".concat(t,".500"),"".concat(t,".200"))(e),borderColor:qe("".concat(t,".500"),"".concat(t,".200"))(e),color:qe("white","gray.900")(e),_hover:{bg:qe("".concat(t,".600"),"".concat(t,".300"))(e),borderColor:qe("".concat(t,".600"),"".concat(t,".300"))(e)},_disabled:{borderColor:qe("gray.200","transparent")(e),bg:qe("gray.200","whiteAlpha.300")(e),color:qe("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:qe("".concat(t,".500"),"".concat(t,".200"))(e),borderColor:qe("".concat(t,".500"),"".concat(t,".200"))(e),color:qe("white","gray.900")(e)},_disabled:{bg:qe("gray.100","whiteAlpha.100")(e),borderColor:qe("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:qe("red.500","red.300")(e)}}},ht={_disabled:{cursor:"not-allowed"}},pt={userSelect:"none",_disabled:{opacity:.4}},ft={transitionProperty:"transform",transitionDuration:"normal"},mt=ct({baseStyle:lt(e=>({icon:ft,container:ht,control:je(ut,e),label:pt})),sizes:{sm:lt({control:{[dt.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:lt({control:{[dt.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:lt({control:{[dt.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},defaultProps:{size:"md",colorScheme:"blue"}});function gt(e){const t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return e.replace(/\s+/g,t)}(e.toString());return t.includes("\\.")?e:function(e){return!Number.isInteger(parseFloat(e.toString()))}(e)?t.replace(".","\\."):e}function vt(e,t){return"var(".concat(gt(e)).concat(t?", ".concat(t):"",")")}function xt(e){return"--".concat(function(e){return[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",gt(e)].filter(Boolean).join("-")}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:""))}function bt(e,t){const n=xt(e,null===t||void 0===t?void 0:t.prefix);return{variable:n,reference:vt(n,yt(null===t||void 0===t?void 0:t.fallback))}}function yt(e){return"string"===typeof e?e:null===e||void 0===e?void 0:e.reference}const wt=bt("close-button-size"),St=bt("close-button-bg"),jt={baseStyle:{w:[wt.reference],h:[wt.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[St.variable]:"colors.blackAlpha.100",_dark:{[St.variable]:"colors.whiteAlpha.100"}},_active:{[St.variable]:"colors.blackAlpha.200",_dark:{[St.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:St.reference},sizes:{lg:{[wt.variable]:"sizes.10",fontSize:"md"},md:{[wt.variable]:"sizes.8",fontSize:"xs"},sm:{[wt.variable]:"sizes.6",fontSize:"2xs"}},defaultProps:{size:"md"}},{variants:kt,defaultProps:Ct}=We,Et={baseStyle:{fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:Ie.bg.reference,color:Ie.color.reference,boxShadow:Ie.shadow.reference},variants:kt,defaultProps:Ct},_t={baseStyle:{w:"100%",mx:"auto",maxW:"prose",px:"4"}},zt={baseStyle:{opacity:.6,borderColor:"inherit"},variants:{solid:{borderStyle:"solid"},dashed:{borderStyle:"dashed"}},defaultProps:{variant:"solid"}},{definePartsStyle:Rt,defineMultiStyleConfig:At}=W(y.keys),Tt=Y("drawer-bg"),Pt=Y("drawer-box-shadow");function Ot(e){return Rt("full"===e?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}const Lt={bg:"blackAlpha.600",zIndex:"modal"},Dt={display:"flex",zIndex:"modal",justifyContent:"center"},It=e=>{const{isFullHeight:t}=e;return p(p({},t&&{height:"100vh"}),{},{zIndex:"modal",maxH:"100vh",color:"inherit",[Tt.variable]:"colors.white",[Pt.variable]:"shadows.lg",_dark:{[Tt.variable]:"colors.gray.700",[Pt.variable]:"shadows.dark-lg"},bg:Tt.reference,boxShadow:Pt.reference})},Nt={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},Mt={position:"absolute",top:"2",insetEnd:"3"},Ft={px:"6",py:"2",flex:"1",overflow:"auto"},Wt={px:"6",py:"4"},Bt=At({baseStyle:Rt(e=>({overlay:Lt,dialogContainer:Dt,dialog:je(It,e),header:Nt,closeButton:Mt,body:Ft,footer:Wt})),sizes:{xs:Ot("xs"),sm:Ot("md"),md:Ot("lg"),lg:Ot("2xl"),xl:Ot("4xl"),full:Ot("full")},defaultProps:{size:"xs"}}),{definePartsStyle:Ut,defineMultiStyleConfig:Vt}=W(w.keys),Ht=Vt({baseStyle:Ut({preview:{borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},input:{borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},textarea:{borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}}})}),{definePartsStyle:qt,defineMultiStyleConfig:$t}=W(S.keys),Yt=Y("form-control-color"),Kt=$t({baseStyle:qt({container:{width:"100%",position:"relative"},requiredIndicator:{marginStart:"1",[Yt.variable]:"colors.red.500",_dark:{[Yt.variable]:"colors.red.300"},color:Yt.reference},helperText:{mt:"2",[Yt.variable]:"colors.gray.600",_dark:{[Yt.variable]:"colors.whiteAlpha.600"},color:Yt.reference,lineHeight:"normal",fontSize:"sm"}})}),{definePartsStyle:Xt,defineMultiStyleConfig:Gt}=W(j.keys),Jt=Y("form-error-color"),Qt=Gt({baseStyle:Xt({text:{[Jt.variable]:"colors.red.500",_dark:{[Jt.variable]:"colors.red.300"},color:Jt.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},icon:{marginEnd:"0.5em",[Jt.variable]:"colors.red.500",_dark:{[Jt.variable]:"colors.red.300"},color:Jt.reference}})}),Zt={baseStyle:{fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}}},en={baseStyle:{fontFamily:"heading",fontWeight:"bold"},sizes:{"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},defaultProps:{size:"xl"}},{definePartsStyle:tn,defineMultiStyleConfig:nn}=W(k.keys),rn=Y("input-height"),on=Y("input-font-size"),an=Y("input-padding"),sn=Y("input-border-radius"),ln=tn({addon:{height:rn.reference,fontSize:on.reference,px:an.reference,borderRadius:sn.reference},field:{width:"100%",height:rn.reference,fontSize:on.reference,px:an.reference,borderRadius:sn.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),cn={lg:{[on.variable]:"fontSizes.lg",[an.variable]:"space.4",[sn.variable]:"radii.md",[rn.variable]:"sizes.12"},md:{[on.variable]:"fontSizes.md",[an.variable]:"space.4",[sn.variable]:"radii.md",[rn.variable]:"sizes.10"},sm:{[on.variable]:"fontSizes.sm",[an.variable]:"space.3",[sn.variable]:"radii.sm",[rn.variable]:"sizes.8"},xs:{[on.variable]:"fontSizes.xs",[an.variable]:"space.2",[sn.variable]:"radii.sm",[rn.variable]:"sizes.6"}},dn={lg:tn({field:cn.lg,group:cn.lg}),md:tn({field:cn.md,group:cn.md}),sm:tn({field:cn.sm,group:cn.sm}),xs:tn({field:cn.xs,group:cn.xs})};function un(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||qe("blue.500","blue.300")(e),errorBorderColor:n||qe("red.500","red.300")(e)}}const hn=tn(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=un(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:qe("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:de(t,r),boxShadow:"0 0 0 1px ".concat(de(t,r))},_focusVisible:{zIndex:1,borderColor:de(t,n),boxShadow:"0 0 0 1px ".concat(de(t,n))}},addon:{border:"1px solid",borderColor:qe("inherit","whiteAlpha.50")(e),bg:qe("gray.100","whiteAlpha.300")(e)}}}),pn=tn(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=un(e);return{field:{border:"2px solid",borderColor:"transparent",bg:qe("gray.100","whiteAlpha.50")(e),_hover:{bg:qe("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:de(t,r)},_focusVisible:{bg:"transparent",borderColor:de(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:qe("gray.100","whiteAlpha.50")(e)}}}),fn=tn(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=un(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:de(t,r),boxShadow:"0px 1px 0px 0px ".concat(de(t,r))},_focusVisible:{borderColor:de(t,n),boxShadow:"0px 1px 0px 0px ".concat(de(t,n))}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),mn=nn({baseStyle:ln,sizes:dn,variants:{outline:hn,filled:pn,flushed:fn,unstyled:tn({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}})},defaultProps:{size:"md",variant:"outline"}}),gn=Y("kbd-bg"),vn={baseStyle:{[gn.variable]:"colors.gray.100",_dark:{[gn.variable]:"colors.whiteAlpha.100"},bg:gn.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"}},xn={baseStyle:{transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}}},{defineMultiStyleConfig:bn,definePartsStyle:yn}=W(C.keys),wn=bn({baseStyle:yn({icon:{marginEnd:"2",display:"inline",verticalAlign:"text-bottom"}})}),{defineMultiStyleConfig:Sn,definePartsStyle:jn}=W(E.keys),kn=Y("menu-bg"),Cn=Y("menu-shadow"),En=Sn({baseStyle:jn({button:{transitionProperty:"common",transitionDuration:"normal"},list:{[kn.variable]:"#fff",[Cn.variable]:"shadows.sm",_dark:{[kn.variable]:"colors.gray.700",[Cn.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:"dropdown",borderRadius:"md",borderWidth:"1px",bg:kn.reference,boxShadow:Cn.reference},item:{py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[kn.variable]:"colors.gray.100",_dark:{[kn.variable]:"colors.whiteAlpha.100"}},_active:{[kn.variable]:"colors.gray.200",_dark:{[kn.variable]:"colors.whiteAlpha.200"}},_expanded:{[kn.variable]:"colors.gray.100",_dark:{[kn.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:kn.reference},groupTitle:{mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},icon:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},command:{opacity:.6},divider:{border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6}})}),{defineMultiStyleConfig:_n,definePartsStyle:zn}=W(_.keys),Rn=Y("modal-bg"),An=Y("modal-shadow"),Tn={bg:"blackAlpha.600",zIndex:"modal"},Pn=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:"inside"===n?"hidden":"auto",overscrollBehaviorY:"none"}},On=e=>{const{isCentered:t,scrollBehavior:n}=e;return{borderRadius:"md",color:"inherit",my:t?"auto":"16",mx:t?"auto":void 0,zIndex:"modal",maxH:"inside"===n?"calc(100% - 7.5rem)":void 0,[Rn.variable]:"colors.white",[An.variable]:"shadows.lg",_dark:{[Rn.variable]:"colors.gray.700",[An.variable]:"shadows.dark-lg"},bg:Rn.reference,boxShadow:An.reference}},Ln={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},Dn={position:"absolute",top:"2",insetEnd:"3"},In=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:"inside"===t?"auto":void 0}},Nn={px:"6",py:"4"};function Mn(e){return zn("full"===e?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}const Fn=_n({baseStyle:zn(e=>({overlay:Tn,dialogContainer:je(Pn,e),dialog:je(On,e),header:Ln,closeButton:Dn,body:je(In,e),footer:Nn})),sizes:{xs:Mn("xs"),sm:Mn("sm"),md:Mn("md"),lg:Mn("lg"),xl:Mn("xl"),"2xl":Mn("2xl"),"3xl":Mn("3xl"),"4xl":Mn("4xl"),"5xl":Mn("5xl"),"6xl":Mn("6xl"),full:Mn("full")},defaultProps:{size:"md"}});function Wn(e){return Array.isArray(e)}function Bn(e){const t=typeof e;return null!=e&&("object"===t||"function"===t)&&!Wn(e)}function Un(e){return Bn(e)&&e.reference?e.reference:String(e)}const Vn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.map(Un).join(" ".concat(e," ")).replace(/calc/g,"")},Hn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"calc(".concat(Vn("+",...t),")")},qn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"calc(".concat(Vn("-",...t),")")},$n=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"calc(".concat(Vn("*",...t),")")},Yn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"calc(".concat(Vn("/",...t),")")},Kn=e=>{const t=Un(e);return null==t||Number.isNaN(parseFloat(t))?$n(t,-1):String(t).startsWith("-")?String(t).slice(1):"-".concat(t)},Xn=Object.assign(e=>({add:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Xn(Hn(e,...n))},subtract:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Xn(qn(e,...n))},multiply:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Xn($n(e,...n))},divide:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Xn(Yn(e,...n))},negate:()=>Xn(Kn(e)),toString:()=>e.toString()}),{add:Hn,subtract:qn,multiply:$n,divide:Yn,negate:Kn}),Gn={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},{defineMultiStyleConfig:Jn,definePartsStyle:Qn}=W(z.keys),Zn=bt("number-input-stepper-width"),er=bt("number-input-input-padding"),tr=Xn(Zn).add("0.5rem").toString(),nr=bt("number-input-bg"),rr=bt("number-input-color"),or=bt("number-input-border-color"),ir={[Zn.variable]:"sizes.6",[er.variable]:tr},ar=e=>{var t,n;return null!==(t=null===(n=je(mn.baseStyle,e))||void 0===n?void 0:n.field)&&void 0!==t?t:{}},sr={width:Zn.reference},lr={borderStart:"1px solid",borderStartColor:or.reference,color:rr.reference,bg:nr.reference,[rr.variable]:"colors.chakra-body-text",[or.variable]:"colors.chakra-border-color",_dark:{[rr.variable]:"colors.whiteAlpha.800",[or.variable]:"colors.whiteAlpha.300"},_active:{[nr.variable]:"colors.gray.200",_dark:{[nr.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}};function cr(e){var t,n,r;const o=null===(t=mn.sizes)||void 0===t?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},a=null!==(n=null===(r=o.field)||void 0===r?void 0:r.fontSize)&&void 0!==n?n:"md",s=Gn.fontSizes[a];return Qn({field:p(p({},o.field),{},{paddingInlineEnd:er.reference,verticalAlign:"top"}),stepper:{fontSize:Xn(s).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}const dr=Jn({baseStyle:Qn(e=>{var t;return{root:ir,field:null!==(t=je(ar,e))&&void 0!==t?t:{},stepperGroup:sr,stepper:lr}}),sizes:{xs:cr("xs"),sm:cr("sm"),md:cr("md"),lg:cr("lg")},variants:mn.variants,defaultProps:mn.defaultProps});var ur,hr,pr;const fr={baseStyle:p(p({},null===(ur=mn.baseStyle)||void 0===ur?void 0:ur.field),{},{textAlign:"center"}),sizes:{lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},variants:{outline:e=>{var t,n,r;return null!==(t=null===(n=je(null===(r=mn.variants)||void 0===r?void 0:r.outline,e))||void 0===n?void 0:n.field)&&void 0!==t?t:{}},flushed:e=>{var t,n,r;return null!==(t=null===(n=je(null===(r=mn.variants)||void 0===r?void 0:r.flushed,e))||void 0===n?void 0:n.field)&&void 0!==t?t:{}},filled:e=>{var t,n,r;return null!==(t=null===(n=je(null===(r=mn.variants)||void 0===r?void 0:r.filled,e))||void 0===n?void 0:n.field)&&void 0!==t?t:{}},unstyled:null!==(hr=null===(pr=mn.variants)||void 0===pr?void 0:pr.unstyled.field)&&void 0!==hr?hr:{}},defaultProps:mn.defaultProps},{defineMultiStyleConfig:mr,definePartsStyle:gr}=W(R.keys),vr=bt("popper-bg"),xr=bt("popper-arrow-bg"),br=bt("popper-arrow-shadow-color"),yr=mr({baseStyle:gr({popper:{zIndex:"popover"},content:{[vr.variable]:"colors.white",bg:vr.reference,[xr.variable]:vr.reference,[br.variable]:"colors.gray.200",_dark:{[vr.variable]:"colors.gray.700",[br.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},header:{px:3,py:2,borderBottomWidth:"1px"},body:{px:3,py:2},footer:{px:3,py:2,borderTopWidth:"1px"},closeButton:{position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2}})}),{defineMultiStyleConfig:wr,definePartsStyle:Sr}=W(A.keys),jr=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:o}=e,i=qe(pe(),pe("1rem","rgba(0,0,0,0.1)"))(e),a=qe("".concat(t,".500"),"".concat(t,".200"))(e),s="linear-gradient(\n to right,\n transparent 0%,\n ".concat(de(n,a)," 50%,\n transparent 100%\n )");return p(p({},!r&&o&&i),r?{bgImage:s}:{bgColor:a})},kr={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},Cr=e=>({bg:qe("gray.100","whiteAlpha.300")(e)}),Er=e=>p({transitionProperty:"common",transitionDuration:"slow"},jr(e)),_r=Sr(e=>({label:kr,filledTrack:Er(e),track:Cr(e)})),zr=wr({sizes:{xs:Sr({track:{h:"1"}}),sm:Sr({track:{h:"2"}}),md:Sr({track:{h:"3"}}),lg:Sr({track:{h:"4"}})},baseStyle:_r,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Rr,definePartsStyle:Ar}=W(T.keys),Tr=e=>{var t;const n=null===(t=je(mt.baseStyle,e))||void 0===t?void 0:t.control;return p(p({},n),{},{borderRadius:"full",_checked:p(p({},null===n||void 0===n?void 0:n._checked),{},{_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}})})},Pr=Rr({baseStyle:Ar(e=>{var t,n;return{label:null===(t=mt.baseStyle)||void 0===t?void 0:t.call(mt,e).label,container:null===(n=mt.baseStyle)||void 0===n?void 0:n.call(mt,e).container,control:Tr(e)}}),sizes:{md:Ar({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:Ar({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:Ar({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},defaultProps:{size:"md",colorScheme:"blue"}});var Or,Lr,Dr,Ir,Nr,Mr,Fr,Wr,Br;const{defineMultiStyleConfig:Ur,definePartsStyle:Vr}=W(P.keys),Hr=Y("select-bg"),qr={paddingInlineEnd:"8"},$r=Ur({baseStyle:Vr({field:p(p({},null===(Or=mn.baseStyle)||void 0===Or?void 0:Or.field),{},{appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:Hr.reference,[Hr.variable]:"colors.white",_dark:{[Hr.variable]:"colors.gray.700"},"> option, > optgroup":{bg:Hr.reference}}),icon:{width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}}}),sizes:{lg:p(p({},null===(Lr=mn.sizes)||void 0===Lr?void 0:Lr.lg),{},{field:p(p({},null===(Dr=mn.sizes)||void 0===Dr?void 0:Dr.lg.field),qr)}),md:p(p({},null===(Ir=mn.sizes)||void 0===Ir?void 0:Ir.md),{},{field:p(p({},null===(Nr=mn.sizes)||void 0===Nr?void 0:Nr.md.field),qr)}),sm:p(p({},null===(Mr=mn.sizes)||void 0===Mr?void 0:Mr.sm),{},{field:p(p({},null===(Fr=mn.sizes)||void 0===Fr?void 0:Fr.sm.field),qr)}),xs:p(p({},null===(Wr=mn.sizes)||void 0===Wr?void 0:Wr.xs),{},{field:p(p({},null===(Br=mn.sizes)||void 0===Br?void 0:Br.xs.field),qr),icon:{insetEnd:"1"}})},variants:mn.variants,defaultProps:mn.defaultProps}),Yr=Y("skeleton-start-color"),Kr=Y("skeleton-end-color"),Xr={baseStyle:{[Yr.variable]:"colors.gray.100",[Kr.variable]:"colors.gray.400",_dark:{[Yr.variable]:"colors.gray.800",[Kr.variable]:"colors.gray.600"},background:Yr.reference,borderColor:Kr.reference,opacity:.7,borderRadius:"sm"}},Gr=Y("skip-link-bg"),Jr={baseStyle:{borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[Gr.variable]:"colors.white",_dark:{[Gr.variable]:"colors.gray.700"},bg:Gr.reference}}};function Qr(e){return Bn(e)&&e.reference?e.reference:String(e)}const Zr=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.map(Qr).join(" ".concat(e," ")).replace(/calc/g,"")},eo=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"calc(".concat(Zr("+",...t),")")},to=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"calc(".concat(Zr("-",...t),")")},no=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"calc(".concat(Zr("*",...t),")")},ro=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"calc(".concat(Zr("/",...t),")")},oo=e=>{const t=Qr(e);return null==t||Number.isNaN(parseFloat(t))?no(t,-1):String(t).startsWith("-")?String(t).slice(1):"-".concat(t)},io=Object.assign(e=>({add:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return io(eo(e,...n))},subtract:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return io(to(e,...n))},multiply:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return io(no(e,...n))},divide:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return io(ro(e,...n))},negate:()=>io(oo(e)),toString:()=>e.toString()}),{add:eo,subtract:to,multiply:no,divide:ro,negate:oo}),{defineMultiStyleConfig:ao,definePartsStyle:so}=W(O.keys),lo=Y("slider-thumb-size"),co=Y("slider-track-size"),uo=Y("slider-bg"),ho=e=>{const{orientation:t}=e;return p({display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"}},$e({orientation:t,vertical:{h:"100%",px:io(lo.reference).divide(2).toString()},horizontal:{w:"100%",py:io(lo.reference).divide(2).toString()}}))},po=e=>p(p({},$e({orientation:e.orientation,horizontal:{h:co.reference},vertical:{w:co.reference}})),{},{overflow:"hidden",borderRadius:"sm",[uo.variable]:"colors.gray.200",_dark:{[uo.variable]:"colors.whiteAlpha.200"},_disabled:{[uo.variable]:"colors.gray.300",_dark:{[uo.variable]:"colors.whiteAlpha.300"}},bg:uo.reference}),fo=e=>{const{orientation:t}=e;return p(p({},$e({orientation:t,vertical:{left:"50%"},horizontal:{top:"50%"}})),{},{w:lo.reference,h:lo.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_active:{"--slider-thumb-scale":"1.15"},_disabled:{bg:"gray.300"}})},mo=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[uo.variable]:"colors.".concat(t,".500"),_dark:{[uo.variable]:"colors.".concat(t,".200")},bg:uo.reference}},go=ao({baseStyle:so(e=>({container:ho(e),track:po(e),thumb:fo(e),filledTrack:mo(e)})),sizes:{lg:so({container:{[lo.variable]:"sizes.4",[co.variable]:"sizes.1"}}),md:so({container:{[lo.variable]:"sizes.3.5",[co.variable]:"sizes.1"}}),sm:so({container:{[lo.variable]:"sizes.2.5",[co.variable]:"sizes.0.5"}})},defaultProps:{size:"md",colorScheme:"blue"}}),vo=bt("spinner-size"),xo={baseStyle:{width:[vo.reference],height:[vo.reference]},sizes:{xs:{[vo.variable]:"sizes.3"},sm:{[vo.variable]:"sizes.4"},md:{[vo.variable]:"sizes.6"},lg:{[vo.variable]:"sizes.8"},xl:{[vo.variable]:"sizes.12"}},defaultProps:{size:"md"}},{defineMultiStyleConfig:bo,definePartsStyle:yo}=W(L.keys),wo=bo({baseStyle:yo({container:{},label:{fontWeight:"medium"},helpText:{opacity:.8,marginBottom:"2"},number:{verticalAlign:"baseline",fontWeight:"semibold"},icon:{marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"}}),sizes:{md:yo({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},defaultProps:{size:"md"}}),{defineMultiStyleConfig:So,definePartsStyle:jo}=W(["stepper","step","title","description","indicator","separator","icon","number"]),ko=Y("stepper-indicator-size"),Co=Y("stepper-icon-size"),Eo=Y("stepper-title-font-size"),_o=Y("stepper-description-font-size"),zo=Y("stepper-accent-color"),Ro=jo(e=>{let{colorScheme:t}=e;return{stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[zo.variable]:"colors.".concat(t,".500"),_dark:{[zo.variable]:"colors.".concat(t,".200")}},title:{fontSize:Eo.reference,fontWeight:"medium"},description:{fontSize:_o.reference,color:"chakra-subtle-text"},number:{fontSize:Eo.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:Co.reference,height:Co.reference},indicator:{flexShrink:0,borderRadius:"full",width:ko.reference,height:ko.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:zo.reference},"&[data-status=complete]":{bg:zo.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:zo.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:"calc(100% - ".concat(ko.reference," - 8px)"),top:"calc(".concat(ko.reference," + 4px)"),insetStart:"calc(".concat(ko.reference," / 2 - 1px)")}}}}),Ao=So({baseStyle:Ro,sizes:{xs:jo({stepper:{[ko.variable]:"sizes.4",[Co.variable]:"sizes.3",[Eo.variable]:"fontSizes.xs",[_o.variable]:"fontSizes.xs"}}),sm:jo({stepper:{[ko.variable]:"sizes.6",[Co.variable]:"sizes.4",[Eo.variable]:"fontSizes.sm",[_o.variable]:"fontSizes.xs"}}),md:jo({stepper:{[ko.variable]:"sizes.8",[Co.variable]:"sizes.5",[Eo.variable]:"fontSizes.md",[_o.variable]:"fontSizes.sm"}}),lg:jo({stepper:{[ko.variable]:"sizes.10",[Co.variable]:"sizes.6",[Eo.variable]:"fontSizes.lg",[_o.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:To,definePartsStyle:Po}=W(D.keys),Oo=bt("switch-track-width"),Lo=bt("switch-track-height"),Do=bt("switch-track-diff"),Io=Xn.subtract(Oo,Lo),No=bt("switch-thumb-x"),Mo=bt("switch-bg"),Fo=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Oo.reference],height:[Lo.reference],transitionProperty:"common",transitionDuration:"fast",[Mo.variable]:"colors.gray.300",_dark:{[Mo.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[Mo.variable]:"colors.".concat(t,".500"),_dark:{[Mo.variable]:"colors.".concat(t,".200")}},bg:Mo.reference}},Wo={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Lo.reference],height:[Lo.reference],_checked:{transform:"translateX(".concat(No.reference,")")}},Bo=To({baseStyle:Po(e=>({container:{[Do.variable]:Io,[No.variable]:Do.reference,_rtl:{[No.variable]:Xn(Do).negate().toString()}},track:Fo(e),thumb:Wo})),sizes:{sm:Po({container:{[Oo.variable]:"1.375rem",[Lo.variable]:"sizes.3"}}),md:Po({container:{[Oo.variable]:"1.875rem",[Lo.variable]:"sizes.4"}}),lg:Po({container:{[Oo.variable]:"2.875rem",[Lo.variable]:"sizes.6"}})},defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Uo,definePartsStyle:Vo}=W(I.keys),Ho=Vo({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),qo={"&[data-is-numeric=true]":{textAlign:"end"}},$o=Uo({baseStyle:Ho,variants:{simple:Vo(e=>{const{colorScheme:t}=e;return{th:p({color:qe("gray.600","gray.400")(e),borderBottom:"1px",borderColor:qe("".concat(t,".100"),"".concat(t,".700"))(e)},qo),td:p({borderBottom:"1px",borderColor:qe("".concat(t,".100"),"".concat(t,".700"))(e)},qo),caption:{color:qe("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),striped:Vo(e=>{const{colorScheme:t}=e;return{th:p({color:qe("gray.600","gray.400")(e),borderBottom:"1px",borderColor:qe("".concat(t,".100"),"".concat(t,".700"))(e)},qo),td:p({borderBottom:"1px",borderColor:qe("".concat(t,".100"),"".concat(t,".700"))(e)},qo),caption:{color:qe("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:qe("".concat(t,".100"),"".concat(t,".700"))(e)},td:{background:qe("".concat(t,".100"),"".concat(t,".700"))(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),unstyled:{}},sizes:{sm:Vo({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:Vo({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:Vo({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Yo=Y("tabs-color"),Ko=Y("tabs-bg"),Xo=Y("tabs-border-color"),{defineMultiStyleConfig:Go,definePartsStyle:Jo}=W(N.keys),Qo=e=>{const{orientation:t}=e;return{display:"vertical"===t?"flex":"block"}},Zo=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},ei=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:"vertical"===n?"column":"row"}},ti={p:4},ni=Jo(e=>({root:Qo(e),tab:Zo(e),tablist:ei(e),tabpanel:ti})),ri={sm:Jo({tab:{py:1,px:4,fontSize:"sm"}}),md:Jo({tab:{fontSize:"md",py:2,px:4}}),lg:Jo({tab:{fontSize:"lg",py:3,px:4}})},oi=Jo(e=>{const{colorScheme:t,orientation:n}=e,r="vertical"===n,o=r?"borderStart":"borderBottom",i=r?"marginStart":"marginBottom";return{tablist:{[o]:"2px solid",borderColor:"inherit"},tab:{[o]:"2px solid",borderColor:"transparent",[i]:"-2px",_selected:{[Yo.variable]:"colors.".concat(t,".600"),_dark:{[Yo.variable]:"colors.".concat(t,".300")},borderColor:"currentColor"},_active:{[Ko.variable]:"colors.gray.200",_dark:{[Ko.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Yo.reference,bg:Ko.reference}}}),ii=Jo(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[Xo.variable]:"transparent",_selected:{[Yo.variable]:"colors.".concat(t,".600"),[Xo.variable]:"colors.white",_dark:{[Yo.variable]:"colors.".concat(t,".300"),[Xo.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:Xo.reference},color:Yo.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),ai=Jo(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Ko.variable]:"colors.gray.50",_dark:{[Ko.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Ko.variable]:"colors.white",[Yo.variable]:"colors.".concat(t,".600"),_dark:{[Ko.variable]:"colors.gray.800",[Yo.variable]:"colors.".concat(t,".300")},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Yo.reference,bg:Ko.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),si=Jo(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:de(n,"".concat(t,".700")),bg:de(n,"".concat(t,".100"))}}}}),li=Go({baseStyle:ni,sizes:ri,variants:{line:oi,enclosed:ii,"enclosed-colored":ai,"soft-rounded":si,"solid-rounded":Jo(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[Yo.variable]:"colors.gray.600",_dark:{[Yo.variable]:"inherit"},_selected:{[Yo.variable]:"colors.white",[Ko.variable]:"colors.".concat(t,".600"),_dark:{[Yo.variable]:"colors.gray.800",[Ko.variable]:"colors.".concat(t,".300")}},color:Yo.reference,bg:Ko.reference}}}),unstyled:Jo({})},defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),{defineMultiStyleConfig:ci,definePartsStyle:di}=W(M.keys),ui=Y("tag-bg"),hi=Y("tag-color"),pi=Y("tag-shadow"),fi=Y("tag-min-height"),mi=Y("tag-min-width"),gi=Y("tag-font-size"),vi=Y("tag-padding-inline"),xi=di({container:{fontWeight:"medium",lineHeight:1.2,outline:0,[hi.variable]:Ie.color.reference,[ui.variable]:Ie.bg.reference,[pi.variable]:Ie.shadow.reference,color:hi.reference,bg:ui.reference,boxShadow:pi.reference,borderRadius:"md",minH:fi.reference,minW:mi.reference,fontSize:gi.reference,px:vi.reference,_focusVisible:{[pi.variable]:"shadows.outline"}},label:{lineHeight:1.2,overflow:"visible"},closeButton:{fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}}}),bi={sm:di({container:{[fi.variable]:"sizes.5",[mi.variable]:"sizes.5",[gi.variable]:"fontSizes.xs",[vi.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:di({container:{[fi.variable]:"sizes.6",[mi.variable]:"sizes.6",[gi.variable]:"fontSizes.sm",[vi.variable]:"space.2"}}),lg:di({container:{[fi.variable]:"sizes.8",[mi.variable]:"sizes.8",[gi.variable]:"fontSizes.md",[vi.variable]:"space.3"}})},yi=ci({variants:{subtle:di(e=>{var t;return{container:null===(t=We.variants)||void 0===t?void 0:t.subtle(e)}}),solid:di(e=>{var t;return{container:null===(t=We.variants)||void 0===t?void 0:t.solid(e)}}),outline:di(e=>{var t;return{container:null===(t=We.variants)||void 0===t?void 0:t.outline(e)}})},baseStyle:xi,sizes:bi,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}});var wi,Si,ji,ki,Ci,Ei,_i,zi,Ri,Ai,Ti;const Pi=p(p({},null===(wi=mn.baseStyle)||void 0===wi?void 0:wi.field),{},{paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"}),Oi={outline:e=>{var t,n;return null!==(t=null===(n=mn.variants)||void 0===n?void 0:n.outline(e).field)&&void 0!==t?t:{}},flushed:e=>{var t,n;return null!==(t=null===(n=mn.variants)||void 0===n?void 0:n.flushed(e).field)&&void 0!==t?t:{}},filled:e=>{var t,n;return null!==(t=null===(n=mn.variants)||void 0===n?void 0:n.filled(e).field)&&void 0!==t?t:{}},unstyled:null!==(Si=null===(ji=mn.variants)||void 0===ji?void 0:ji.unstyled.field)&&void 0!==Si?Si:{}},Li={baseStyle:Pi,sizes:{xs:null!==(ki=null===(Ci=mn.sizes)||void 0===Ci?void 0:Ci.xs.field)&&void 0!==ki?ki:{},sm:null!==(Ei=null===(_i=mn.sizes)||void 0===_i?void 0:_i.sm.field)&&void 0!==Ei?Ei:{},md:null!==(zi=null===(Ri=mn.sizes)||void 0===Ri?void 0:Ri.md.field)&&void 0!==zi?zi:{},lg:null!==(Ai=null===(Ti=mn.sizes)||void 0===Ti?void 0:Ti.lg.field)&&void 0!==Ai?Ai:{}},variants:Oi,defaultProps:{size:"md",variant:"outline"}},Di=bt("tooltip-bg"),Ii=bt("tooltip-fg"),Ni=bt("popper-arrow-bg"),Mi={bg:Di.reference,color:Ii.reference,[Di.variable]:"colors.gray.700",[Ii.variable]:"colors.whiteAlpha.900",_dark:{[Di.variable]:"colors.gray.300",[Ii.variable]:"colors.gray.900"},[Ni.variable]:Di.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},Fi={Accordion:V,Alert:ye,Avatar:De,Badge:We,Breadcrumb:He,Button:Ge,Checkbox:mt,CloseButton:jt,Code:Et,Container:_t,Divider:zt,Drawer:Bt,Editable:Ht,Form:Kt,FormError:Qt,FormLabel:Zt,Heading:en,Input:mn,Kbd:vn,Link:xn,List:wn,Menu:En,Modal:Fn,NumberInput:dr,PinInput:fr,Popover:yr,Progress:zr,Radio:Pr,Select:$r,Skeleton:Xr,SkipLink:Jr,Slider:go,Spinner:xo,Stat:wo,Switch:Bo,Table:$o,Tabs:li,Tag:yi,Textarea:Li,Tooltip:{baseStyle:Mi},Card:st,Stepper:Ao},Wi={property:{common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},easing:{"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},duration:{"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"}},Bi=p(p({breakpoints:{base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},zIndices:{hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},radii:{none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},blur:{none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},colors:{transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"}}},Gn),{},{sizes:Se,shadows:{xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},space:we,borders:{none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},transition:Wi}),Ui={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},Vi={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},Hi={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},qi=p(p({semanticTokens:Ui,direction:"ltr"},Bi),{},{components:Fi,styles:Vi,config:Hi}),$i=p(p({semanticTokens:Ui,direction:"ltr",components:{}},Bi),{},{styles:Vi,config:Hi});function Yi(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}function Ki(e,t){if(null==e)return{};var n,r,o=Yi(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Xi(e){return null!=e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Gi(e){return!(!e.parentElement||!Gi(e.parentElement))||e.hidden}var Ji=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(r){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),Qi=Math.abs,Zi=String.fromCharCode,ea=Object.assign;function ta(e){return e.trim()}function na(e,t,n){return e.replace(t,n)}function ra(e,t){return e.indexOf(t)}function oa(e,t){return 0|e.charCodeAt(t)}function ia(e,t,n){return e.slice(t,n)}function aa(e){return e.length}function sa(e){return e.length}function la(e,t){return t.push(e),e}var ca=1,da=1,ua=0,ha=0,pa=0,fa="";function ma(e,t,n,r,o,i,a){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:ca,column:da,length:a,return:""}}function ga(e,t){return ea(ma("",null,null,"",null,null,0),e,{length:-e.length},t)}function va(){return pa=ha>0?oa(fa,--ha):0,da--,10===pa&&(da=1,ca--),pa}function xa(){return pa=ha<ua?oa(fa,ha++):0,da++,10===pa&&(da=1,ca++),pa}function ba(){return oa(fa,ha)}function ya(){return ha}function wa(e,t){return ia(fa,e,t)}function Sa(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ja(e){return ca=da=1,ua=aa(fa=e),ha=0,[]}function ka(e){return fa="",e}function Ca(e){return ta(wa(ha-1,za(91===e?e+2:40===e?e+1:e)))}function Ea(e){for(;(pa=ba())&&pa<33;)xa();return Sa(e)>2||Sa(pa)>3?"":" "}function _a(e,t){for(;--t&&xa()&&!(pa<48||pa>102||pa>57&&pa<65||pa>70&&pa<97););return wa(e,ya()+(t<6&&32==ba()&&32==xa()))}function za(e){for(;xa();)switch(pa){case e:return ha;case 34:case 39:34!==e&&39!==e&&za(pa);break;case 40:41===e&&za(e);break;case 92:xa()}return ha}function Ra(e,t){for(;xa()&&e+pa!==57&&(e+pa!==84||47!==ba()););return"/*"+wa(t,ha-1)+"*"+Zi(47===e?e:xa())}function Aa(e){for(;!Sa(ba());)xa();return wa(e,ha)}var Ta="-ms-",Pa="-moz-",Oa="-webkit-",La="comm",Da="rule",Ia="decl",Na="@keyframes";function Ma(e,t){for(var n="",r=sa(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function Fa(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Ia:return e.return=e.return||e.value;case La:return"";case Na:return e.return=e.value+"{"+Ma(e.children,r)+"}";case Da:e.value=e.props.join(",")}return aa(n=Ma(e.children,r))?e.return=e.value+"{"+n+"}":""}function Wa(e){return ka(Ba("",null,null,null,[""],e=ja(e),0,[0],e))}function Ba(e,t,n,r,o,i,a,s,l){for(var c=0,d=0,u=a,h=0,p=0,f=0,m=1,g=1,v=1,x=0,b="",y=o,w=i,S=r,j=b;g;)switch(f=x,x=xa()){case 40:if(108!=f&&58==oa(j,u-1)){-1!=ra(j+=na(Ca(x),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:j+=Ca(x);break;case 9:case 10:case 13:case 32:j+=Ea(f);break;case 92:j+=_a(ya()-1,7);continue;case 47:switch(ba()){case 42:case 47:la(Va(Ra(xa(),ya()),t,n),l);break;default:j+="/"}break;case 123*m:s[c++]=aa(j)*v;case 125*m:case 59:case 0:switch(x){case 0:case 125:g=0;case 59+d:-1==v&&(j=na(j,/\f/g,"")),p>0&&aa(j)-u&&la(p>32?Ha(j+";",r,n,u-1):Ha(na(j," ","")+";",r,n,u-2),l);break;case 59:j+=";";default:if(la(S=Ua(j,t,n,c,d,o,s,b,y=[],w=[],u),i),123===x)if(0===d)Ba(j,t,S,S,y,i,u,s,w);else switch(99===h&&110===oa(j,3)?100:h){case 100:case 108:case 109:case 115:Ba(e,S,S,r&&la(Ua(e,S,S,0,0,o,s,b,o,y=[],u),w),o,w,u,s,r?y:w);break;default:Ba(j,S,S,S,[""],w,0,s,w)}}c=d=p=0,m=v=1,b=j="",u=a;break;case 58:u=1+aa(j),p=f;default:if(m<1)if(123==x)--m;else if(125==x&&0==m++&&125==va())continue;switch(j+=Zi(x),x*m){case 38:v=d>0?1:(j+="\f",-1);break;case 44:s[c++]=(aa(j)-1)*v,v=1;break;case 64:45===ba()&&(j+=Ca(xa())),h=ba(),d=u=aa(b=j+=Aa(ya())),x++;break;case 45:45===f&&2==aa(j)&&(m=0)}}return i}function Ua(e,t,n,r,o,i,a,s,l,c,d){for(var u=o-1,h=0===o?i:[""],p=sa(h),f=0,m=0,g=0;f<r;++f)for(var v=0,x=ia(e,u+1,u=Qi(m=a[f])),b=e;v<p;++v)(b=ta(m>0?h[v]+" "+x:na(x,/&\f/g,h[v])))&&(l[g++]=b);return ma(e,t,n,0===o?Da:s,l,c,d)}function Va(e,t,n){return ma(e,t,n,La,Zi(pa),ia(e,2,-2),0)}function Ha(e,t,n,r){return ma(e,t,n,Ia,ia(e,0,r),ia(e,r+1,-1),r)}var qa=function(e,t,n){for(var r=0,o=0;r=o,o=ba(),38===r&&12===o&&(t[n]=1),!Sa(o);)xa();return wa(e,ha)},$a=function(e,t){return ka(function(e,t){var n=-1,r=44;do{switch(Sa(r)){case 0:38===r&&12===ba()&&(t[n]=1),e[n]+=qa(ha-1,t,n);break;case 2:e[n]+=Ca(r);break;case 4:if(44===r){e[++n]=58===ba()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Zi(r)}}while(r=xa());return e}(ja(e),t))},Ya=new WeakMap,Ka=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Ya.get(n))&&!r){Ya.set(e,!0);for(var o=[],i=$a(t,o),a=n.props,s=0,l=0;s<i.length;s++)for(var c=0;c<a.length;c++,l++)e.props[l]=o[s]?i[s].replace(/&\f/g,a[c]):a[c]+" "+i[s]}}},Xa=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Ga(e,t){switch(function(e,t){return 45^oa(e,0)?(((t<<2^oa(e,0))<<2^oa(e,1))<<2^oa(e,2))<<2^oa(e,3):0}(e,t)){case 5103:return Oa+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Oa+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Oa+e+Pa+e+Ta+e+e;case 6828:case 4268:return Oa+e+Ta+e+e;case 6165:return Oa+e+Ta+"flex-"+e+e;case 5187:return Oa+e+na(e,/(\w+).+(:[^]+)/,Oa+"box-$1$2"+Ta+"flex-$1$2")+e;case 5443:return Oa+e+Ta+"flex-item-"+na(e,/flex-|-self/,"")+e;case 4675:return Oa+e+Ta+"flex-line-pack"+na(e,/align-content|flex-|-self/,"")+e;case 5548:return Oa+e+Ta+na(e,"shrink","negative")+e;case 5292:return Oa+e+Ta+na(e,"basis","preferred-size")+e;case 6060:return Oa+"box-"+na(e,"-grow","")+Oa+e+Ta+na(e,"grow","positive")+e;case 4554:return Oa+na(e,/([^-])(transform)/g,"$1"+Oa+"$2")+e;case 6187:return na(na(na(e,/(zoom-|grab)/,Oa+"$1"),/(image-set)/,Oa+"$1"),e,"")+e;case 5495:case 3959:return na(e,/(image-set\([^]*)/,Oa+"$1$`$1");case 4968:return na(na(e,/(.+:)(flex-)?(.*)/,Oa+"box-pack:$3"+Ta+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Oa+e+e;case 4095:case 3583:case 4068:case 2532:return na(e,/(.+)-inline(.+)/,Oa+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(aa(e)-1-t>6)switch(oa(e,t+1)){case 109:if(45!==oa(e,t+4))break;case 102:return na(e,/(.+:)(.+)-([^]+)/,"$1"+Oa+"$2-$3$1"+Pa+(108==oa(e,t+3)?"$3":"$2-$3"))+e;case 115:return~ra(e,"stretch")?Ga(na(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==oa(e,t+1))break;case 6444:switch(oa(e,aa(e)-3-(~ra(e,"!important")&&10))){case 107:return na(e,":",":"+Oa)+e;case 101:return na(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Oa+(45===oa(e,14)?"inline-":"")+"box$3$1"+Oa+"$2$3$1"+Ta+"$2box$3")+e}break;case 5936:switch(oa(e,t+11)){case 114:return Oa+e+Ta+na(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Oa+e+Ta+na(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Oa+e+Ta+na(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Oa+e+Ta+e+e}return e}var Ja=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Ia:e.return=Ga(e.value,e.length);break;case Na:return Ma([ga(e,{value:na(e.value,"@","@"+Oa)})],r);case Da:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ma([ga(e,{props:[na(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Ma([ga(e,{props:[na(t,/:(plac\w+)/,":"+Oa+"input-$1")]}),ga(e,{props:[na(t,/:(plac\w+)/,":-moz-$1")]}),ga(e,{props:[na(t,/:(plac\w+)/,Ta+"input-$1")]})],r)}return""})}}],Qa=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,o,i=e.stylisPlugins||Ja,a={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)a[t[n]]=!0;s.push(e)});var l,c,d=[Fa,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],u=function(e){var t=sa(e);return function(n,r,o,i){for(var a="",s=0;s<t;s++)a+=e[s](n,r,o,i)||"";return a}}([Ka,Xa].concat(i,d));o=function(e,t,n,r){l=n,function(e){Ma(Wa(e),u)}(e?e+"{"+t.styles+"}":t.styles),r&&(h.inserted[t.name]=!0)};var h={key:t,sheet:new Ji({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:o};return h.sheet.hydrate(s),h};function Za(){return Za=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},Za.apply(null,arguments)}var es=function(e){var t=new WeakMap;return function(n){if(t.has(n))return t.get(n);var r=e(n);return t.set(n,r),r}};function ts(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}var ns=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},rs=function(e,t,n){ns(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}};var os={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function is(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var as=/[A-Z]|^ms/g,ss=/_EMO_([^_]+?)_([^]*?)_EMO_/g,ls=function(e){return 45===e.charCodeAt(1)},cs=function(e){return null!=e&&"boolean"!==typeof e},ds=is(function(e){return ls(e)?e:e.replace(as,"-$&").toLowerCase()}),us=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(ss,function(e,t,n){return ps={name:t,styles:n,next:ps},t})}return 1===os[e]||ls(e)||"number"!==typeof t||0===t?t:t+"px"};function hs(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var o=n;if(1===o.anim)return ps={name:o.name,styles:o.styles,next:ps},o.name;var i=n;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)ps={name:a.name,styles:a.styles,next:ps},a=a.next;return i.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=hs(e,t,n[o])+";";else for(var i in n){var a=n[i];if("object"!==typeof a){var s=a;null!=t&&void 0!==t[s]?r+=i+"{"+t[s]+"}":cs(s)&&(r+=ds(i)+":"+us(i,s)+";")}else if(!Array.isArray(a)||"string"!==typeof a[0]||null!=t&&void 0!==t[a[0]]){var l=hs(e,t,a);switch(i){case"animation":case"animationName":r+=ds(i)+":"+l+";";break;default:r+=i+"{"+l+"}"}}else for(var c=0;c<a.length;c++)cs(a[c])&&(r+=ds(i)+":"+us(i,a[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=ps,l=n(e);return ps=s,hs(e,t,l)}}var c=n;if(null==t)return c;var d=t[c];return void 0!==d?d:c}var ps,fs=/label:\s*([^\s;{]+)\s*(;|$)/g;function ms(e,t,n){if(1===e.length&&"object"===typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";ps=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,o+=hs(n,t,i)):o+=i[0];for(var a=1;a<e.length;a++){if(o+=hs(n,t,e[a]),r)o+=i[a]}fs.lastIndex=0;for(var s,l="";null!==(s=fs.exec(o));)l+="-"+s[1];var c=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+l;return{name:c,styles:o,next:ps}}var gs=!!r.useInsertionEffect&&r.useInsertionEffect,vs=gs||function(e){return e()},xs=gs||t.useLayoutEffect,bs=t.createContext("undefined"!==typeof HTMLElement?Qa({key:"css"}):null),ys=(bs.Provider,function(e){return(0,t.forwardRef)(function(n,r){var o=(0,t.useContext)(bs);return e(n,o,r)})}),ws=t.createContext({}),Ss=es(function(e){return es(function(t){return function(e,t){return"function"===typeof t?t(e):Za({},e,t)}(e,t)})}),js=function(e){var n=t.useContext(ws);return e.theme!==n&&(n=Ss(n)(e.theme)),t.createElement(ws.Provider,{value:n},e.children)};var ks={}.hasOwnProperty,Cs="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Es=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return ns(t,n,r),vs(function(){return rs(t,n,r)}),null},_s=ys(function(e,n,r){var o=e.css;"string"===typeof o&&void 0!==n.registered[o]&&(o=n.registered[o]);var i=e[Cs],a=[o],s="";"string"===typeof e.className?s=ts(n.registered,a,e.className):null!=e.className&&(s=e.className+" ");var l=ms(a,void 0,t.useContext(ws));s+=n.key+"-"+l.name;var c={};for(var d in e)ks.call(e,d)&&"css"!==d&&d!==Cs&&(c[d]=e[d]);return c.className=s,r&&(c.ref=r),t.createElement(t.Fragment,null,t.createElement(Es,{cache:n,serialized:l,isStringTag:"string"===typeof i}),t.createElement(i,c))}),zs=_s;const Rs=(0,t.createContext)({});function As(){const e=(0,t.useContext)(Rs);if(void 0===e)throw new Error("useColorMode must be used within a ColorModeProvider");return e}function Ts(e,t){const{colorMode:n}=As();return"dark"===n?t:e}Rs.displayName="ColorModeContext";const Ps="chakra-ui-light",Os="chakra-ui-dark";const Ls="chakra-ui-color-mode";const Ds=(Is=Ls,{ssr:!1,type:"localStorage",get(e){if(null===globalThis||void 0===globalThis||!globalThis.document)return e;let t;try{t=localStorage.getItem(Is)||e}catch(n){}return t||e},set(e){try{localStorage.setItem(Is,e)}catch(t){}}});var Is;function Ns(e,t){const n=e.match(new RegExp("(^| )".concat(t,"=([^;]+)")));return null===n||void 0===n?void 0:n[2]}function Ms(e,t){return{ssr:!!t,type:"cookie",get:n=>t?Ns(t,e):null!==globalThis&&void 0!==globalThis&&globalThis.document&&Ns(document.cookie,e)||n,set(t){document.cookie="".concat(e,"=").concat(t,"; max-age=31536000; path=/")}}}Ms(Ls);const Fs=()=>{},Ws=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?t.useLayoutEffect:t.useEffect;function Bs(e,t){return"cookie"===e.type&&e.ssr?e.get(t):t}const Us=function(e){const{value:n,children:r,options:{useSystemColorMode:o,initialColorMode:a,disableTransitionOnChange:s}={},colorModeManager:l=Ds}=e,c=(0,t.useContext)(bs),d="dark"===a?"dark":"light",[u,h]=(0,t.useState)(()=>Bs(l,d)),[p,f]=(0,t.useState)(()=>Bs(l)),{getSystemTheme:m,setClassName:g,setDataset:v,addListener:x}=(0,t.useMemo)(()=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{preventTransition:t=!0,nonce:n}=e,r={setDataset:e=>{const n=t?r.preventTransition():void 0;document.documentElement.dataset.theme=e,document.documentElement.style.colorScheme=e,null===n||void 0===n||n()},setClassName(e){document.body.classList.add(e?Os:Ps),document.body.classList.remove(e?Ps:Os)},query:()=>window.matchMedia("(prefers-color-scheme: dark)"),getSystemTheme(e){var t;return(null!==(t=r.query().matches)&&void 0!==t?t:"dark"===e)?"dark":"light"},addListener(e){const t=r.query(),n=t=>{e(t.matches?"dark":"light")};return"function"===typeof t.addListener?t.addListener(n):t.addEventListener("change",n),()=>{"function"===typeof t.removeListener?t.removeListener(n):t.removeEventListener("change",n)}},preventTransition(){const e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),void 0!==n&&(e.nonce=n),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(e)})})}}};return r}({preventTransition:s,nonce:null===c||void 0===c?void 0:c.nonce}),[s,null===c||void 0===c?void 0:c.nonce]),b="system"!==a||u?u:p,y=(0,t.useCallback)(e=>{const t="system"===e?m():e;h(t),g("dark"===t),v(t),l.set(t)},[l,m,g,v]);Ws(()=>{"system"===a&&f(m())},[]),(0,t.useEffect)(()=>{const e=l.get();y(e||("system"!==a?d:"system"))},[l,d,a,y]);const w=(0,t.useCallback)(()=>{y("dark"===b?"light":"dark")},[b,y]);(0,t.useEffect)(()=>{if(o)return x(y)},[o,x,y]);const S=(0,t.useMemo)(()=>({colorMode:null!==n&&void 0!==n?n:b,toggleColorMode:n?Fs:w,setColorMode:n?Fs:y,forced:void 0!==n}),[b,w,y,n]);return(0,i.jsx)(Rs.Provider,{value:S,children:r})};function Vs(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Us.displayName="ColorModeProvider";n(876);var Hs=function(e,n){var r=arguments;if(null==n||!ks.call(n,"css"))return t.createElement.apply(void 0,r);var o=r.length,i=new Array(o);i[0]=zs,i[1]=function(e,t){var n={};for(var r in t)ks.call(t,r)&&(n[r]=t[r]);return n[Cs]=e,n}(e,n);for(var a=2;a<o;a++)i[a]=r[a];return t.createElement.apply(null,i)};!function(e){var t;t||(t=e.JSX||(e.JSX={}))}(Hs||(Hs={}));var qs=ys(function(e,n){var r=ms([e.styles],void 0,t.useContext(ws)),o=t.useRef();return xs(function(){var e=n.key+"-global",t=new n.sheet.constructor({key:e,nonce:n.sheet.nonce,container:n.sheet.container,speedy:n.sheet.isSpeedy}),i=!1,a=document.querySelector('style[data-emotion="'+e+" "+r.name+'"]');return n.sheet.tags.length&&(t.before=n.sheet.tags[0]),null!==a&&(i=!0,a.setAttribute("data-emotion",e),t.hydrate([a])),o.current=[t,i],function(){t.flush()}},[n]),xs(function(){var e=o.current,t=e[0];if(e[1])e[1]=!1;else{if(void 0!==r.next&&rs(n,r.next,!0),t.tags.length){var i=t.tags[t.tags.length-1].nextElementSibling;t.before=i,t.flush()}n.insert("",r,t,!1)}},[n,r.name]),null});function $s(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ms(t)}function Ys(){var e=$s.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var Ks,Xs;const Gs=String.raw,Js=Gs(Ks||(Ks=Vs(["\n :root,\n :host {\n --chakra-vh: 100vh;\n }\n\n @supports (height: -webkit-fill-available) {\n :root,\n :host {\n --chakra-vh: -webkit-fill-available;\n }\n }\n\n @supports (height: -moz-fill-available) {\n :root,\n :host {\n --chakra-vh: -moz-fill-available;\n }\n }\n\n @supports (height: 100dvh) {\n :root,\n :host {\n --chakra-vh: 100dvh;\n }\n }\n"]))),Qs=()=>(0,i.jsx)(qs,{styles:Js}),Zs=e=>{let{scope:t=""}=e;return(0,i.jsx)(qs,{styles:Gs(Xs||(Xs=Vs(['\n html {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n font-family: system-ui, sans-serif;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n -moz-osx-font-smoothing: grayscale;\n touch-action: manipulation;\n }\n\n body {\n position: relative;\n min-height: 100%;\n margin: 0;\n font-feature-settings: "kern";\n }\n\n '," :where(*, *::before, *::after) {\n border-width: 0;\n border-style: solid;\n box-sizing: border-box;\n word-wrap: break-word;\n }\n\n main {\n display: block;\n }\n\n "," hr {\n border-top-width: 1px;\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n }\n\n "," :where(pre, code, kbd,samp) {\n font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n font-size: 1em;\n }\n\n "," a {\n background-color: transparent;\n color: inherit;\n text-decoration: inherit;\n }\n\n "," abbr[title] {\n border-bottom: none;\n text-decoration: underline;\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n\n "," :where(b, strong) {\n font-weight: bold;\n }\n\n "," small {\n font-size: 80%;\n }\n\n "," :where(sub,sup) {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n\n "," sub {\n bottom: -0.25em;\n }\n\n "," sup {\n top: -0.5em;\n }\n\n "," img {\n border-style: none;\n }\n\n "," :where(button, input, optgroup, select, textarea) {\n font-family: inherit;\n font-size: 100%;\n line-height: 1.15;\n margin: 0;\n }\n\n "," :where(button, input) {\n overflow: visible;\n }\n\n "," :where(button, select) {\n text-transform: none;\n }\n\n ",' :where(\n button::-moz-focus-inner,\n [type="button"]::-moz-focus-inner,\n [type="reset"]::-moz-focus-inner,\n [type="submit"]::-moz-focus-inner\n ) {\n border-style: none;\n padding: 0;\n }\n\n '," fieldset {\n padding: 0.35em 0.75em 0.625em;\n }\n\n "," legend {\n box-sizing: border-box;\n color: inherit;\n display: table;\n max-width: 100%;\n padding: 0;\n white-space: normal;\n }\n\n "," progress {\n vertical-align: baseline;\n }\n\n "," textarea {\n overflow: auto;\n }\n\n ",' :where([type="checkbox"], [type="radio"]) {\n box-sizing: border-box;\n padding: 0;\n }\n\n ',' input[type="number"]::-webkit-inner-spin-button,\n ',' input[type="number"]::-webkit-outer-spin-button {\n -webkit-appearance: none !important;\n }\n\n ',' input[type="number"] {\n -moz-appearance: textfield;\n }\n\n ',' input[type="search"] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n }\n\n ',' input[type="search"]::-webkit-search-decoration {\n -webkit-appearance: none !important;\n }\n\n '," ::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n }\n\n "," details {\n display: block;\n }\n\n "," summary {\n display: list-item;\n }\n\n template {\n display: none;\n }\n\n [hidden] {\n display: none !important;\n }\n\n "," :where(\n blockquote,\n dl,\n dd,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n hr,\n figure,\n p,\n pre\n ) {\n margin: 0;\n }\n\n "," button {\n background: transparent;\n padding: 0;\n }\n\n "," fieldset {\n margin: 0;\n padding: 0;\n }\n\n "," :where(ol, ul) {\n margin: 0;\n padding: 0;\n }\n\n "," textarea {\n resize: vertical;\n }\n\n ",' :where(button, [role="button"]) {\n cursor: pointer;\n }\n\n '," button::-moz-focus-inner {\n border: 0 !important;\n }\n\n "," table {\n border-collapse: collapse;\n }\n\n "," :where(h1, h2, h3, h4, h5, h6) {\n font-size: inherit;\n font-weight: inherit;\n }\n\n "," :where(button, input, optgroup, select, textarea) {\n padding: 0;\n line-height: inherit;\n color: inherit;\n }\n\n "," :where(img, svg, video, canvas, audio, iframe, embed, object) {\n display: block;\n }\n\n "," :where(img, video) {\n max-width: 100%;\n height: auto;\n }\n\n [data-js-focus-visible]\n :focus:not([data-focus-visible-added]):not(\n [data-focus-visible-disabled]\n ) {\n outline: none;\n box-shadow: none;\n }\n\n "," select::-ms-expand {\n display: none;\n }\n\n ","\n "])),t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,Js)})};function el(e){const t=null==e?0:e.length;return t?e[t-1]:void 0}function tl(e){if(null==e)return e;const{unitless:t}=function(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}(e);return t||"number"===typeof e?"".concat(e,"px"):e}const nl=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,rl=e=>Object.fromEntries(Object.entries(e).sort(nl));function ol(e){const t=rl(e);return Object.assign(Object.values(t),t)}function il(e){var t;if(!e)return e;e=null!==(t=tl(e))&&void 0!==t?t:e;return"number"===typeof e?"".concat(e+-.02):e.replace(/([0-9]+\.?[0-9]*)/,e=>"".concat(parseFloat(e)+-.02))}function al(e,t){const n=["@media screen"];return e&&n.push("and","(min-width: ".concat(tl(e),")")),t&&n.push("and","(max-width: ".concat(tl(t),")")),n.join(" ")}function sl(e){var t;if(!e)return null;e.base=null!==(t=e.base)&&void 0!==t?t:"0px";const n=ol(e),r=Object.entries(e).sort(nl).map((e,t,n)=>{var r;let[o,i]=e,[,a]=null!==(r=n[t+1])&&void 0!==r?r:[];return a=parseFloat(a)>0?il(a):void 0,{_minW:il(i),breakpoint:o,minW:i,maxW:a,maxWQuery:al(null,a),minWQuery:al(i),minMaxQuery:al(i,a)}}),o=function(e){const t=Object.keys(rl(e));return new Set(t)}(e),i=Array.from(o.values());return{keys:o,normalized:n,isResponsive(e){const t=Object.keys(e);return t.length>0&&t.every(e=>o.has(e))},asObject:rl(e),asArray:ol(e),details:r,get:e=>r.find(t=>t.breakpoint===e),media:[null,...n.map(e=>al(e)).slice(1)],toArrayValue(e){if(!Bn(e))throw new Error("toArrayValue: value must be an object");const t=i.map(t=>{var n;return null!==(n=e[t])&&void 0!==n?n:null});for(;null===el(t);)t.pop();return t},toObjectValue(e){if(!Array.isArray(e))throw new Error("toObjectValue: value must be an array");return e.reduce((e,t,n)=>{const r=i[n];return null!=r&&null!=t&&(e[r]=t),e},{})}}}var ll=n(992);function cl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{stop:r,getKey:o}=n;return function e(n){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(Bn(n)||Array.isArray(n)){const s={};for(const[l,c]of Object.entries(n)){var a;const d=null!==(a=null===o||void 0===o?void 0:o(l))&&void 0!==a?a:l,u=[...i,d];if(null!==r&&void 0!==r&&r(n,u))return t(n,i);s[d]=e(c,u)}return s}return t(n,i)}(e)}const dl=(e,t)=>"".concat(e,"[data-closed], ").concat(e,"[data-state=closed] ").concat(t),ul=(e,t)=>"".concat(e,":hover ").concat(t,", ").concat(e,"[data-hover] ").concat(t),hl=(e,t)=>"".concat(e,":focus ").concat(t,", ").concat(e,"[data-focus] ").concat(t),pl=(e,t)=>"".concat(e,":focus-visible ").concat(t),fl=(e,t)=>"".concat(e,":focus-within ").concat(t),ml=(e,t)=>"".concat(e,":active ").concat(t,", ").concat(e,"[data-active] ").concat(t),gl=(e,t)=>"".concat(e,":disabled ").concat(t,", ").concat(e,"[data-disabled] ").concat(t),vl=(e,t)=>"".concat(e,":invalid ").concat(t,", ").concat(e,"[data-invalid] ").concat(t),xl=(e,t)=>"".concat(e,":checked ").concat(t,", ").concat(e,"[data-checked] ").concat(t),bl=(e,t)=>"".concat(e,":placeholder-shown ").concat(t),yl=e=>Sl(t=>e(t,"&"),"[role=group]","[data-group]",".group"),wl=e=>Sl(t=>e(t,"~ &"),"[data-peer]",".peer"),Sl=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.map(e).join(", ")},jl={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within, &[data-focus-within]",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty, &[data-empty]",_expanded:"&[aria-expanded=true], &[data-expanded], &[data-state=expanded]",_checked:"&[aria-checked=true], &[data-checked], &[data-state=checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate], &[data-state=indeterminate]",_groupOpen:yl((e,t)=>"".concat(e,"[data-open], ").concat(e,"[open], ").concat(e,"[data-state=open] ").concat(t)),_groupClosed:yl(dl),_groupHover:yl(ul),_peerHover:wl(ul),_groupFocus:yl(hl),_peerFocus:wl(hl),_groupFocusVisible:yl(pl),_peerFocusVisible:wl(pl),_groupActive:yl(ml),_peerActive:wl(ml),_groupDisabled:yl(gl),_peerDisabled:wl(gl),_groupInvalid:yl(vl),_peerInvalid:wl(vl),_groupChecked:yl(xl),_peerChecked:wl(xl),_groupFocusWithin:yl(fl),_peerFocusWithin:wl(fl),_peerPlaceholderShown:wl(bl),_placeholder:"&::placeholder, &[data-placeholder]",_placeholderShown:"&:placeholder-shown, &[data-placeholder-shown]",_fullScreen:"&:fullscreen, &[data-fullscreen]",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]",_open:"&[data-open], &[open], &[data-state=open]",_closed:"&[data-closed], &[data-state=closed]",_complete:"&[data-complete]",_incomplete:"&[data-incomplete]",_current:"&[data-current]"},kl=Object.keys(jl);function Cl(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}const El=["__cssMap","__cssVars","__breakpoints"],_l=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function zl(e){return Cl(e,_l)}function Rl(e,t){return Y(String(e).replace(/\./g,"-"),void 0,t)}function Al(e){var t;const n=function(e){const t=zl(e),n=function(e){return e.semanticTokens}(e),r=e=>kl.includes(e)||"default"===e,o={};return cl(t,(e,t)=>{null!=e&&(o[t.join(".")]={isSemantic:!1,value:e})}),cl(n,(e,t)=>{null!=e&&(o[t.join(".")]={isSemantic:!0,value:e})},{stop:e=>Object.keys(e).every(r)}),o}(e),r=null===(t=e.config)||void 0===t?void 0:t.cssVarPrefix;let o={};const i={};function a(e,t){const o=[String(e).split(".")[0],t].join(".");if(!n[o])return t;const{reference:i}=Rl(o,r);return i}for(const[s,l]of Object.entries(n)){const{isSemantic:e,value:t}=l,{variable:n,reference:c}=Rl(s,r);if(!e){if(s.startsWith("space")){const e=s.split("."),[r,...o]=e,a="".concat(r,".-").concat(o.join(".")),l=io.negate(t),d=io.negate(c);i[a]={value:l,var:n,varRef:d}}o[n]=t,i[s]={value:t,var:n,varRef:c};continue}const d=Bn(t)?t:{default:t};o=ll(o,Object.entries(d).reduce((e,t)=>{var r;let[o,i]=t;if(!i)return e;const l=a(s,"".concat(i));if("default"===o)return e[n]=l,e;return e[null!==(r=null===jl||void 0===jl?void 0:jl[o])&&void 0!==r?r:o]={[n]:l},e},{})),i[s]={value:c,var:n,varRef:c}}return{cssVars:o,cssMap:i}}function Tl(e){const t=function(e){const{__cssMap:t,__cssVars:n,__breakpoints:r}=e;return Ki(e,El)}(e),{cssMap:n,cssVars:r}=Al(t);return Object.assign(t,{__cssVars:p(p({},{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"}),r),__cssMap:n,__breakpoints:sl(t.breakpoints)}),t}function Pl(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"===typeof e?e(...n):e}const Ol=e=>"string"===typeof e?e.replace(/!(important)?$/,"").trim():e;function Ll(e){const{scale:t,transform:n,compose:r}=e;return(e,o)=>{var i;const a=((e,t)=>n=>{const r=String(t),o=(e=>/!(important)?$/.test(e))(r),i=Ol(r),a=e?"".concat(e,".").concat(i):i;let s=Bn(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=Ol(s),o?"".concat(s," !important"):s})(t,e)(o);let s=null!==(i=null===n||void 0===n?void 0:n(a,o))&&void 0!==i?i:a;return r&&(s=r(s,o)),s}}const Dl=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>t.reduce((e,t)=>t(e),e)};function Il(e,t){return n=>{const r={property:n,scale:e};return r.transform=Ll({scale:e,transform:t}),r}}const Nl=e=>{let{rtl:t,ltr:n}=e;return e=>"rtl"===e.direction?t:n};const Ml=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];const Fl={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},Wl={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};const Bl={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},Ul={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},Vl=new Set(Object.values(Ul)),Hl=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),ql=e=>e.trim();const $l=e=>"string"===typeof e&&e.includes("(")&&e.includes(")");const Yl=e=>t=>"".concat(e,"(").concat(t,")"),Kl={filter:e=>"auto"!==e?e:Fl,backdropFilter:e=>"auto"!==e?e:Wl,ring:e=>function(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}(Kl.px(e)),bgClip:e=>"text"===e?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e},transform:e=>"auto"===e?["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...Ml].join(" "):"auto-gpu"===e?["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...Ml].join(" "):e,vh:e=>"$100vh"===e?"var(--chakra-vh)":e,px(e){if(null==e)return e;const{unitless:t}=(e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}})(e);return t||"number"===typeof e?"".concat(e,"px"):e},fraction:e=>"number"!==typeof e||e>1?e:"".concat(100*e,"%"),float:(e,t)=>"rtl"===t.direction?{left:"right",right:"left"}[e]:e,degree(e){if(function(e){return/^var\(--.+\)$/.test(e)}(e)||null==e)return e;const t="string"===typeof e&&!e.endsWith("deg");return"number"===typeof e||t?"".concat(e,"deg"):e},gradient:(e,t)=>function(e,t){if(null==e||Hl.has(e))return e;if(!$l(e)&&!Hl.has(e))return"url('".concat(e,"')");const n=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),r=null===n||void 0===n?void 0:n[1],o=null===n||void 0===n?void 0:n[2];if(!r||!o)return e;const i=r.includes("-gradient")?r:"".concat(r,"-gradient"),[a,...s]=o.split(",").map(ql).filter(Boolean);if(0===(null===s||void 0===s?void 0:s.length))return e;const l=a in Ul?Ul[a]:a;s.unshift(l);const c=s.map(e=>{if(Vl.has(e))return e;const n=e.indexOf(" "),[r,o]=-1!==n?[e.substr(0,n),e.substr(n+1)]:[e],i=$l(o)?o:o&&o.split(" "),a="colors.".concat(r),s=a in t.__cssMap?t.__cssMap[a].varRef:r;return i?[s,...Array.isArray(i)?i:[i]].join(" "):s});return"".concat(i,"(").concat(c.join(", "),")")}(e,null!==t&&void 0!==t?t:{}),blur:Yl("blur"),opacity:Yl("opacity"),brightness:Yl("brightness"),contrast:Yl("contrast"),dropShadow:Yl("drop-shadow"),grayscale:Yl("grayscale"),hueRotate:e=>Yl("hue-rotate")(Kl.degree(e)),invert:Yl("invert"),saturate:Yl("saturate"),sepia:Yl("sepia"),bgImage(e){if(null==e)return e;return $l(e)||Hl.has(e)?e:"url(".concat(e,")")},outline(e){const t="0"===String(e)||"none"===String(e);return null!==e&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var t;const{space:n,divide:r}=null!==(t=Bl[e])&&void 0!==t?t:{},o={flexDirection:e};return n&&(o[n]=1),r&&(o[r]=1),o}},Xl={borderWidths:Il("borderWidths"),borderStyles:Il("borderStyles"),colors:Il("colors"),borders:Il("borders"),gradients:Il("gradients",Kl.gradient),radii:Il("radii",Kl.px),space:Il("space",Dl(Kl.vh,Kl.px)),spaceT:Il("space",Dl(Kl.vh,Kl.px)),degreeT:e=>({property:e,transform:Kl.degree}),prop:(e,t,n)=>p({property:e,scale:t},t&&{transform:Ll({scale:t,transform:n})}),propT:(e,t)=>({property:e,transform:t}),sizes:Il("sizes",Dl(Kl.vh,Kl.px)),sizesT:Il("sizes",Dl(Kl.vh,Kl.fraction)),shadows:Il("shadows"),logical:function(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:Nl(t),transform:n?Ll({scale:n,compose:r}):r}},blur:Il("blur",Kl.blur)},Gl={background:Xl.colors("background"),backgroundColor:Xl.colors("backgroundColor"),backgroundImage:Xl.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Kl.bgClip},bgSize:Xl.prop("backgroundSize"),bgPosition:Xl.prop("backgroundPosition"),bg:Xl.colors("background"),bgColor:Xl.colors("backgroundColor"),bgPos:Xl.prop("backgroundPosition"),bgRepeat:Xl.prop("backgroundRepeat"),bgAttachment:Xl.prop("backgroundAttachment"),bgGradient:Xl.gradients("backgroundImage"),bgClip:{transform:Kl.bgClip}};Object.assign(Gl,{bgImage:Gl.backgroundImage,bgImg:Gl.backgroundImage});const Jl={border:Xl.borders("border"),borderWidth:Xl.borderWidths("borderWidth"),borderStyle:Xl.borderStyles("borderStyle"),borderColor:Xl.colors("borderColor"),borderRadius:Xl.radii("borderRadius"),borderTop:Xl.borders("borderTop"),borderBlockStart:Xl.borders("borderBlockStart"),borderTopLeftRadius:Xl.radii("borderTopLeftRadius"),borderStartStartRadius:Xl.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:Xl.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:Xl.radii("borderTopRightRadius"),borderStartEndRadius:Xl.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:Xl.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:Xl.borders("borderRight"),borderInlineEnd:Xl.borders("borderInlineEnd"),borderBottom:Xl.borders("borderBottom"),borderBlockEnd:Xl.borders("borderBlockEnd"),borderBottomLeftRadius:Xl.radii("borderBottomLeftRadius"),borderBottomRightRadius:Xl.radii("borderBottomRightRadius"),borderLeft:Xl.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:Xl.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:Xl.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:Xl.borders(["borderLeft","borderRight"]),borderInline:Xl.borders("borderInline"),borderY:Xl.borders(["borderTop","borderBottom"]),borderBlock:Xl.borders("borderBlock"),borderTopWidth:Xl.borderWidths("borderTopWidth"),borderBlockStartWidth:Xl.borderWidths("borderBlockStartWidth"),borderTopColor:Xl.colors("borderTopColor"),borderBlockStartColor:Xl.colors("borderBlockStartColor"),borderTopStyle:Xl.borderStyles("borderTopStyle"),borderBlockStartStyle:Xl.borderStyles("borderBlockStartStyle"),borderBottomWidth:Xl.borderWidths("borderBottomWidth"),borderBlockEndWidth:Xl.borderWidths("borderBlockEndWidth"),borderBottomColor:Xl.colors("borderBottomColor"),borderBlockEndColor:Xl.colors("borderBlockEndColor"),borderBottomStyle:Xl.borderStyles("borderBottomStyle"),borderBlockEndStyle:Xl.borderStyles("borderBlockEndStyle"),borderLeftWidth:Xl.borderWidths("borderLeftWidth"),borderInlineStartWidth:Xl.borderWidths("borderInlineStartWidth"),borderLeftColor:Xl.colors("borderLeftColor"),borderInlineStartColor:Xl.colors("borderInlineStartColor"),borderLeftStyle:Xl.borderStyles("borderLeftStyle"),borderInlineStartStyle:Xl.borderStyles("borderInlineStartStyle"),borderRightWidth:Xl.borderWidths("borderRightWidth"),borderInlineEndWidth:Xl.borderWidths("borderInlineEndWidth"),borderRightColor:Xl.colors("borderRightColor"),borderInlineEndColor:Xl.colors("borderInlineEndColor"),borderRightStyle:Xl.borderStyles("borderRightStyle"),borderInlineEndStyle:Xl.borderStyles("borderInlineEndStyle"),borderTopRadius:Xl.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:Xl.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:Xl.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:Xl.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(Jl,{rounded:Jl.borderRadius,roundedTop:Jl.borderTopRadius,roundedTopLeft:Jl.borderTopLeftRadius,roundedTopRight:Jl.borderTopRightRadius,roundedTopStart:Jl.borderStartStartRadius,roundedTopEnd:Jl.borderStartEndRadius,roundedBottom:Jl.borderBottomRadius,roundedBottomLeft:Jl.borderBottomLeftRadius,roundedBottomRight:Jl.borderBottomRightRadius,roundedBottomStart:Jl.borderEndStartRadius,roundedBottomEnd:Jl.borderEndEndRadius,roundedLeft:Jl.borderLeftRadius,roundedRight:Jl.borderRightRadius,roundedStart:Jl.borderInlineStartRadius,roundedEnd:Jl.borderInlineEndRadius,borderStart:Jl.borderInlineStart,borderEnd:Jl.borderInlineEnd,borderTopStartRadius:Jl.borderStartStartRadius,borderTopEndRadius:Jl.borderStartEndRadius,borderBottomStartRadius:Jl.borderEndStartRadius,borderBottomEndRadius:Jl.borderEndEndRadius,borderStartRadius:Jl.borderInlineStartRadius,borderEndRadius:Jl.borderInlineEndRadius,borderStartWidth:Jl.borderInlineStartWidth,borderEndWidth:Jl.borderInlineEndWidth,borderStartColor:Jl.borderInlineStartColor,borderEndColor:Jl.borderInlineEndColor,borderStartStyle:Jl.borderInlineStartStyle,borderEndStyle:Jl.borderInlineEndStyle});const Ql={color:Xl.colors("color"),textColor:Xl.colors("color"),fill:Xl.colors("fill"),stroke:Xl.colors("stroke"),accentColor:Xl.colors("accentColor"),textFillColor:Xl.colors("textFillColor")},Zl={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Kl.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:Xl.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:Xl.space("gap"),rowGap:Xl.space("rowGap"),columnGap:Xl.space("columnGap")};Object.assign(Zl,{flexDir:Zl.flexDirection});const ec={width:Xl.sizesT("width"),inlineSize:Xl.sizesT("inlineSize"),height:Xl.sizes("height"),blockSize:Xl.sizes("blockSize"),boxSize:Xl.sizes(["width","height"]),minWidth:Xl.sizes("minWidth"),minInlineSize:Xl.sizes("minInlineSize"),minHeight:Xl.sizes("minHeight"),minBlockSize:Xl.sizes("minBlockSize"),maxWidth:Xl.sizes("maxWidth"),maxInlineSize:Xl.sizes("maxInlineSize"),maxHeight:Xl.sizes("maxHeight"),maxBlockSize:Xl.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var n,r;const o=null!==(n=null===(r=t.__breakpoints)||void 0===r||null===(r=r.get(e))||void 0===r?void 0:r.minW)&&void 0!==n?n:e,i="@media screen and (min-width: ".concat(o,")");return{[i]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var n,r;const o=null!==(n=null===(r=t.__breakpoints)||void 0===r||null===(r=r.get(e))||void 0===r?void 0:r._minW)&&void 0!==n?n:e,i="@media screen and (max-width: ".concat(o,")");return{[i]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:Xl.propT("float",Kl.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(ec,{w:ec.width,h:ec.height,minW:ec.minWidth,maxW:ec.maxWidth,minH:ec.minHeight,maxH:ec.maxHeight,overscroll:ec.overscrollBehavior,overscrollX:ec.overscrollBehaviorX,overscrollY:ec.overscrollBehaviorY});const tc={filter:{transform:Kl.filter},blur:Xl.blur("--chakra-blur"),brightness:Xl.propT("--chakra-brightness",Kl.brightness),contrast:Xl.propT("--chakra-contrast",Kl.contrast),hueRotate:Xl.propT("--chakra-hue-rotate",Kl.hueRotate),invert:Xl.propT("--chakra-invert",Kl.invert),saturate:Xl.propT("--chakra-saturate",Kl.saturate),dropShadow:Xl.propT("--chakra-drop-shadow",Kl.dropShadow),backdropFilter:{transform:Kl.backdropFilter},backdropBlur:Xl.blur("--chakra-backdrop-blur"),backdropBrightness:Xl.propT("--chakra-backdrop-brightness",Kl.brightness),backdropContrast:Xl.propT("--chakra-backdrop-contrast",Kl.contrast),backdropHueRotate:Xl.propT("--chakra-backdrop-hue-rotate",Kl.hueRotate),backdropInvert:Xl.propT("--chakra-backdrop-invert",Kl.invert),backdropSaturate:Xl.propT("--chakra-backdrop-saturate",Kl.saturate)},nc={ring:{transform:Kl.ring},ringColor:Xl.colors("--chakra-ring-color"),ringOffset:Xl.prop("--chakra-ring-offset-width"),ringOffsetColor:Xl.colors("--chakra-ring-offset-color"),ringInset:Xl.prop("--chakra-ring-inset")},rc={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Kl.outline},outlineOffset:!0,outlineColor:Xl.colors("outlineColor")},oc={gridGap:Xl.space("gridGap"),gridColumnGap:Xl.space("gridColumnGap"),gridRowGap:Xl.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0};const ic=(e=>{const t=new WeakMap;return(n,r,o,i)=>{if("undefined"===typeof n)return e(n,r,o);t.has(n)||t.set(n,new Map);const a=t.get(n);if(a.has(r))return a.get(r);const s=e(n,r,o,i);return a.set(r,s),s}})(function(e,t,n,r){const o="string"===typeof t?t.split("."):[t];for(r=0;r<o.length&&e;r+=1)e=e[o[r]];return void 0===e?n:e}),ac={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},sc={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},lc=(e,t,n)=>{const r={},o=ic(e,t,{});for(const i in o){i in n&&null!=n[i]||(r[i]=o[i])}return r},cc={srOnly:{transform:e=>!0===e?ac:"focusable"===e?sc:{}},layerStyle:{processResult:!0,transform:(e,t,n)=>lc(t,"layerStyles.".concat(e),n)},textStyle:{processResult:!0,transform:(e,t,n)=>lc(t,"textStyles.".concat(e),n)},apply:{processResult:!0,transform:(e,t,n)=>lc(t,e,n)}},dc={position:!0,pos:Xl.prop("position"),zIndex:Xl.prop("zIndex","zIndices"),inset:Xl.spaceT("inset"),insetX:Xl.spaceT(["left","right"]),insetInline:Xl.spaceT("insetInline"),insetY:Xl.spaceT(["top","bottom"]),insetBlock:Xl.spaceT("insetBlock"),top:Xl.spaceT("top"),insetBlockStart:Xl.spaceT("insetBlockStart"),bottom:Xl.spaceT("bottom"),insetBlockEnd:Xl.spaceT("insetBlockEnd"),left:Xl.spaceT("left"),insetInlineStart:Xl.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:Xl.spaceT("right"),insetInlineEnd:Xl.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(dc,{insetStart:dc.insetInlineStart,insetEnd:dc.insetInlineEnd});const uc={boxShadow:Xl.shadows("boxShadow"),mixBlendMode:!0,blendMode:Xl.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:Xl.prop("backgroundBlendMode"),opacity:!0};Object.assign(uc,{shadow:uc.boxShadow});const hc={margin:Xl.spaceT("margin"),marginTop:Xl.spaceT("marginTop"),marginBlockStart:Xl.spaceT("marginBlockStart"),marginRight:Xl.spaceT("marginRight"),marginInlineEnd:Xl.spaceT("marginInlineEnd"),marginBottom:Xl.spaceT("marginBottom"),marginBlockEnd:Xl.spaceT("marginBlockEnd"),marginLeft:Xl.spaceT("marginLeft"),marginInlineStart:Xl.spaceT("marginInlineStart"),marginX:Xl.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:Xl.spaceT("marginInline"),marginY:Xl.spaceT(["marginTop","marginBottom"]),marginBlock:Xl.spaceT("marginBlock"),padding:Xl.space("padding"),paddingTop:Xl.space("paddingTop"),paddingBlockStart:Xl.space("paddingBlockStart"),paddingRight:Xl.space("paddingRight"),paddingBottom:Xl.space("paddingBottom"),paddingBlockEnd:Xl.space("paddingBlockEnd"),paddingLeft:Xl.space("paddingLeft"),paddingInlineStart:Xl.space("paddingInlineStart"),paddingInlineEnd:Xl.space("paddingInlineEnd"),paddingX:Xl.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:Xl.space("paddingInline"),paddingY:Xl.space(["paddingTop","paddingBottom"]),paddingBlock:Xl.space("paddingBlock")};Object.assign(hc,{m:hc.margin,mt:hc.marginTop,mr:hc.marginRight,me:hc.marginInlineEnd,marginEnd:hc.marginInlineEnd,mb:hc.marginBottom,ml:hc.marginLeft,ms:hc.marginInlineStart,marginStart:hc.marginInlineStart,mx:hc.marginX,my:hc.marginY,p:hc.padding,pt:hc.paddingTop,py:hc.paddingY,px:hc.paddingX,pb:hc.paddingBottom,pl:hc.paddingLeft,ps:hc.paddingInlineStart,paddingStart:hc.paddingInlineStart,pr:hc.paddingRight,pe:hc.paddingInlineEnd,paddingEnd:hc.paddingInlineEnd});const pc={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:Xl.spaceT("scrollMargin"),scrollMarginTop:Xl.spaceT("scrollMarginTop"),scrollMarginBottom:Xl.spaceT("scrollMarginBottom"),scrollMarginLeft:Xl.spaceT("scrollMarginLeft"),scrollMarginRight:Xl.spaceT("scrollMarginRight"),scrollMarginX:Xl.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:Xl.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:Xl.spaceT("scrollPadding"),scrollPaddingTop:Xl.spaceT("scrollPaddingTop"),scrollPaddingBottom:Xl.spaceT("scrollPaddingBottom"),scrollPaddingLeft:Xl.spaceT("scrollPaddingLeft"),scrollPaddingRight:Xl.spaceT("scrollPaddingRight"),scrollPaddingX:Xl.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:Xl.spaceT(["scrollPaddingTop","scrollPaddingBottom"])},fc={fontFamily:Xl.prop("fontFamily","fonts"),fontSize:Xl.prop("fontSize","fontSizes",Kl.px),fontWeight:Xl.prop("fontWeight","fontWeights"),lineHeight:Xl.prop("lineHeight","lineHeights"),letterSpacing:Xl.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(!0===e)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},mc={textDecorationColor:Xl.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:Xl.shadows("textShadow")},gc={clipPath:!0,transform:Xl.propT("transform",Kl.transform),transformOrigin:!0,translateX:Xl.spaceT("--chakra-translate-x"),translateY:Xl.spaceT("--chakra-translate-y"),skewX:Xl.degreeT("--chakra-skew-x"),skewY:Xl.degreeT("--chakra-skew-y"),scaleX:Xl.prop("--chakra-scale-x"),scaleY:Xl.prop("--chakra-scale-y"),scale:Xl.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:Xl.degreeT("--chakra-rotate")},vc={listStyleType:!0,listStylePosition:!0,listStylePos:Xl.prop("listStylePosition"),listStyleImage:!0,listStyleImg:Xl.prop("listStyleImage")},xc={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:Xl.prop("transitionDuration","transition.duration"),transitionProperty:Xl.prop("transitionProperty","transition.property"),transitionTimingFunction:Xl.prop("transitionTimingFunction","transition.easing")},bc=ll({},Gl,Jl,Ql,Zl,ec,tc,nc,rc,oc,cc,dc,uc,hc,pc,fc,mc,gc,vc,xc),yc=Object.assign({},hc,ec,Zl,oc,dc),wc=Object.keys(yc),Sc=[...Object.keys(bc),...kl],jc=p(p({},bc),jl),kc=e=>e in jc;const Cc=(e,t)=>e.startsWith("--")&&"string"===typeof t&&!function(e){return/^var\(--.+\)$/.test(e)}(t),Ec=(e,t)=>{var n,r;if(null==t)return t;const o=t=>{var n;return null===(n=e.__cssMap)||void 0===n||null===(n=n[t])||void 0===n?void 0:n.varRef},i=e=>{var t;return null!==(t=o(e))&&void 0!==t?t:e},[a,s]=function(e){const t=[];let n="",r=!1;for(let o=0;o<e.length;o++){const i=e[o];"("===i?(r=!0,n+=i):")"===i?(r=!1,n+=i):","!==i||r?n+=i:(t.push(n),n="")}return n=n.trim(),n&&t.push(n),t}(t);return t=null!==(n=null!==(r=o(a))&&void 0!==r?r:i(s))&&void 0!==n?n:i(t)};function _c(e){const{configs:t={},pseudos:n={},theme:r}=e,o=function(e){let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const a=Pl(e,r),s=(e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:o}=t.__breakpoints,i={};for(const a in e){let s=Pl(e[a],t);if(null==s)continue;if(s=Bn(s)&&n(s)?r(s):s,!Array.isArray(s)){i[a]=s;continue}const l=s.slice(0,o.length).length;for(let e=0;e<l;e+=1){const t=null===o||void 0===o?void 0:o[e];t?(i[t]=i[t]||{},null!=s[e]&&(i[t][a]=s[e])):i[a]=s[e]}}return i})(a)(r);let l={};for(let g in s){var c,d,u,h,p,f;let e=Pl(s[g],r);g in n&&(g=n[g]),Cc(g,e)&&(e=Ec(r,e));let v=t[g];if(!0===v&&(v={property:g}),Bn(e)){var m;l[g]=null!==(m=l[g])&&void 0!==m?m:{},l[g]=ll({},l[g],o(e,!0));continue}let x=null!==(c=null===(d=v)||void 0===d||null===(u=d.transform)||void 0===u?void 0:u.call(d,e,r,a))&&void 0!==c?c:e;x=null!==(h=v)&&void 0!==h&&h.processResult?o(x,!0):x;const b=Pl(null===(p=v)||void 0===p?void 0:p.property,r);if(!i&&null!==(f=v)&&void 0!==f&&f.static){const e=Pl(v.static,r);l=ll({},l,e)}if(b&&Array.isArray(b))for(const t of b)l[t]=x;else b?"&"===b&&Bn(x)?l=ll({},l,x):l[b]=x:Bn(x)?l=ll({},l,x):l[g]=x}return l};return o}const zc=e=>t=>_c({theme:t,pseudos:jl,configs:bc})(e);function Rc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{name:n,strict:r=!0,hookName:o="useContext",providerName:i="Provider",errorMessage:a,defaultValue:s}=e,l=(0,t.createContext)(s);return l.displayName=n,[l.Provider,function e(){const n=(0,t.useContext)(l);if(!n&&r){var s;const t=new Error(null!==a&&void 0!==a?a:(c=i,"".concat(o," returned `undefined`. Seems you forgot to wrap component within ").concat(c)));throw t.name="ContextError",null===(s=Error.captureStackTrace)||void 0===s||s.call(Error,t,e),t}var c;return n},l]}const Ac=(e=>{const t=new WeakMap;return(n,r,o,i)=>{if("undefined"===typeof n)return e(n,r,o);t.has(n)||t.set(n,new Map);const a=t.get(n);if(a.has(r))return a.get(r);const s=e(n,r,o,i);return a.set(r,s),s}})(function(e,t,n,r){const o="string"===typeof t?t.split("."):[t];for(r=0;r<o.length&&e;r+=1)e=e[o[r]];return void 0===e?n:e});function Tc(e){const{cssVarsRoot:n,theme:r,children:o}=e,a=(0,t.useMemo)(()=>Tl(r),[r]);return(0,i.jsxs)(js,{theme:a,children:[(0,i.jsx)(Pc,{root:n}),o]})}function Pc(e){let{root:t=":host, :root"}=e;const n=[t,"[data-theme]"].join(",");return(0,i.jsx)(qs,{styles:e=>({[n]:e.__cssVars})})}const[Oc,Lc]=Rc({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `<StylesProvider />` "});function Dc(){const{colorMode:e}=As();return(0,i.jsx)(qs,{styles:t=>{const n=Pl(Ac(t,"styles.global"),{theme:t,colorMode:e});if(!n)return;return zc(n)(t)}})}const[Ic,Nc]=Rc({strict:!1,name:"PortalManagerContext"});function Mc(e){const{children:t,zIndex:n}=e;return(0,i.jsx)(Ic,{value:{zIndex:n},children:t})}Mc.displayName="PortalManager";const Fc=(0,t.createContext)({getDocument:()=>document,getWindow:()=>window});function Wc(e){const{children:n,environment:r,disabled:o}=e,a=(0,t.useRef)(null),s=(0,t.useMemo)(()=>r||{getDocument:()=>{var e,t;return null!==(e=null===(t=a.current)||void 0===t?void 0:t.ownerDocument)&&void 0!==e?e:document},getWindow:()=>{var e,t;return null!==(e=null===(t=a.current)||void 0===t?void 0:t.ownerDocument.defaultView)&&void 0!==e?e:window}},[r]),l=!o||!r;return(0,i.jsxs)(Fc.Provider,{value:s,children:[n,l&&(0,i.jsx)("span",{id:"__chakra_env",hidden:!0,ref:a})]})}Fc.displayName="EnvironmentContext",Wc.displayName="EnvironmentProvider";const Bc=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetScope:o,resetCSS:a=!0,theme:s={},environment:l,cssVarsRoot:c,disableEnvironment:d,disableGlobalStyle:u}=e,h=(0,i.jsx)(Wc,{environment:l,disabled:d,children:t});return(0,i.jsx)(Tc,{theme:s,cssVarsRoot:c,children:(0,i.jsxs)(Us,{colorModeManager:n,options:s.config,children:[a?(0,i.jsx)(Zs,{scope:o}):(0,i.jsx)(Qs,{}),!u&&(0,i.jsx)(Dc,{}),r?(0,i.jsx)(Mc,{zIndex:r,children:h}):h]})})},Uc="undefined"!==typeof document,Vc=Uc?t.useLayoutEffect:t.useEffect;function Hc(){const e=(0,t.useRef)(!1);return Vc(()=>(e.current=!0,()=>{e.current=!1}),[]),e}const qc=e=>e;class $c{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const t=this.order.indexOf(e);-1!==t&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}const Yc=["prepare","read","update","preRender","render","postRender"];const{schedule:Kc,cancel:Xc,state:Gc,steps:Jc}=function(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=Yc.reduce((e,t)=>(e[t]=function(e){let t=new $c,n=new $c,r=0,o=!1,i=!1;const a=new WeakSet,s={schedule:function(e){const i=arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&o,s=i?t:n;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&a.add(e),s.add(e)&&i&&o&&(r=t.order.length),e},cancel:e=>{n.remove(e),a.delete(e)},process:l=>{if(o)i=!0;else{if(o=!0,[t,n]=[n,t],n.clear(),r=t.order.length,r)for(let n=0;n<r;n++){const r=t.order[n];r(l),a.has(r)&&(s.schedule(r),e())}o=!1,i&&(i=!1,s.process(l))}}};return s}(()=>n=!0),e),{}),a=e=>i[e].process(o),s=()=>{const i=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,Yc.forEach(a),o.isProcessing=!1,n&&t&&(r=!1,e(s))},l=Yc.reduce((t,a)=>{const l=i[a];return t[a]=function(t){let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return n||(n=!0,r=!0,o.isProcessing||e(s)),l.schedule(t,i,a)},t},{});return{schedule:l,cancel:e=>Yc.forEach(t=>i[t].cancel(e)),state:o,steps:i}}("undefined"!==typeof requestAnimationFrame?requestAnimationFrame:qc,!0);const Qc=(0,t.createContext)(null);function Zc(e){const n=(0,t.useRef)(null);return null===n.current&&(n.current=e()),n.current}class ed extends t.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function td(e){let{children:n,isPresent:r}=e;const o=(0,t.useId)(),i=(0,t.useRef)(null),a=(0,t.useRef)({width:0,height:0,top:0,left:0});return(0,t.useInsertionEffect)(()=>{const{width:e,height:t,top:n,left:s}=a.current;if(r||!i.current||!e||!t)return;i.current.dataset.motionPopId=o;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule('\n [data-motion-pop-id="'.concat(o,'"] {\n position: absolute !important;\n width: ').concat(e,"px !important;\n height: ").concat(t,"px !important;\n top: ").concat(n,"px !important;\n left: ").concat(s,"px !important;\n }\n ")),()=>{document.head.removeChild(l)}},[r]),t.createElement(ed,{isPresent:r,childRef:i,sizeRef:a},t.cloneElement(n,{ref:i}))}const nd=e=>{let{children:n,initial:r,isPresent:o,onExitComplete:i,custom:a,presenceAffectsLayout:s,mode:l}=e;const c=Zc(rd),d=(0,t.useId)(),u=(0,t.useMemo)(()=>({id:d,initial:r,isPresent:o,custom:a,onExitComplete:e=>{c.set(e,!0);for(const t of c.values())if(!t)return;i&&i()},register:e=>(c.set(e,!1),()=>c.delete(e))}),s?void 0:[o]);return(0,t.useMemo)(()=>{c.forEach((e,t)=>c.set(t,!1))},[o]),t.useEffect(()=>{!o&&!c.size&&i&&i()},[o]),"popLayout"===l&&(n=t.createElement(td,{isPresent:o},n)),t.createElement(Qc.Provider,{value:u},n)};function rd(){return new Map}const od=(0,t.createContext)({});let id=qc,ad=qc;const sd=e=>e.key||"";const ld=e=>{let{children:n,custom:r,initial:o=!0,onExitComplete:i,exitBeforeEnter:a,presenceAffectsLayout:s=!0,mode:l="sync"}=e;ad(!a,"Replace exitBeforeEnter with mode='wait'");const c=(0,t.useContext)(od).forceRender||function(){const e=Hc(),[n,r]=(0,t.useState)(0),o=(0,t.useCallback)(()=>{e.current&&r(n+1)},[n]);return[(0,t.useCallback)(()=>Kc.postRender(o),[o]),n]}()[0],d=Hc(),u=function(e){const n=[];return t.Children.forEach(e,e=>{(0,t.isValidElement)(e)&&n.push(e)}),n}(n);let h=u;const p=(0,t.useRef)(new Map).current,f=(0,t.useRef)(h),m=(0,t.useRef)(new Map).current,g=(0,t.useRef)(!0);var v;if(Vc(()=>{g.current=!1,function(e,t){e.forEach(e=>{const n=sd(e);t.set(n,e)})}(u,m),f.current=h}),v=()=>{g.current=!0,m.clear(),p.clear()},(0,t.useEffect)(()=>()=>v(),[]),g.current)return t.createElement(t.Fragment,null,h.map(e=>t.createElement(nd,{key:sd(e),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:s,mode:l},e)));h=[...h];const x=f.current.map(sd),b=u.map(sd),y=x.length;for(let t=0;t<y;t++){const e=x[t];-1!==b.indexOf(e)||p.has(e)||p.set(e,void 0)}return"wait"===l&&p.size&&(h=[]),p.forEach((e,n)=>{if(-1!==b.indexOf(n))return;const o=m.get(n);if(!o)return;const a=x.indexOf(n);let g=e;if(!g){const e=()=>{p.delete(n);const e=Array.from(m.keys()).filter(e=>!b.includes(e));if(e.forEach(e=>m.delete(e)),f.current=u.filter(t=>{const r=sd(t);return r===n||e.includes(r)}),!p.size){if(!1===d.current)return;c(),i&&i()}};g=t.createElement(nd,{key:sd(o),isPresent:!1,onExitComplete:e,custom:r,presenceAffectsLayout:s,mode:l},o),p.set(n,g)}h.splice(a,0,g)}),h=h.map(e=>{const n=e.key;return p.has(n)?e:t.createElement(nd,{key:sd(e),isPresent:!0,presenceAffectsLayout:s,mode:l},e)}),t.createElement(t.Fragment,null,p.size?h:h.map(e=>(0,t.cloneElement)(e)))},cd=(e,n)=>{const r=(0,t.useRef)(!1),o=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(r.current&&o.current)return e();o.current=!0},n),(0,t.useEffect)(()=>(r.current=!0,()=>{r.current=!1}),[])};function dd(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,t.useRef)(e);return(0,t.useEffect)(()=>{r.current=e}),(0,t.useCallback)(function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return null===(e=r.current)||void 0===e?void 0:e.call(r,...n)},n)}function ud(){const e=(0,t.useContext)(Qc);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=e,i=(0,t.useId)();(0,t.useEffect)(()=>o(i),[]);return!n&&r?[!1,()=>r&&r(i)]:[!0]}function hd(){return null===(e=(0,t.useContext)(Qc))||e.isPresent;var e}const pd=(0,t.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),fd=(0,t.createContext)({}),md=(0,t.createContext)({strict:!1}),gd=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),vd="data-"+gd("framerAppearId");function xd(e){return e&&"object"===typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function bd(e){return"string"===typeof e||Array.isArray(e)}function yd(e){return null!==e&&"object"===typeof e&&"function"===typeof e.start}const wd=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Sd=["initial",...wd];function jd(e){return yd(e.animate)||Sd.some(t=>bd(e[t]))}function kd(e){return Boolean(jd(e)||e.variants)}function Cd(e){const{initial:n,animate:r}=function(e,t){if(jd(e)){const{initial:t,animate:n}=e;return{initial:!1===t||bd(t)?t:void 0,animate:bd(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,t.useContext)(fd));return(0,t.useMemo)(()=>({initial:n,animate:r}),[Ed(n),Ed(r)])}function Ed(e){return Array.isArray(e)?e.join(" "):e}const _d={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},zd={};for(const n in _d)zd[n]={isEnabled:e=>_d[n].some(t=>!!e[t])};const Rd=(0,t.createContext)({}),Ad=Symbol.for("motionComponentSymbol");function Td(e){let{preloadedFeatures:n,createVisualElement:r,useRender:o,useVisualState:i,Component:a}=e;n&&function(e){for(const t in e)zd[t]=p(p({},zd[t]),e[t])}(n);const s=(0,t.forwardRef)(function(e,s){let l;const c=p(p(p({},(0,t.useContext)(pd)),e),{},{layoutId:Pd(e)}),{isStatic:d}=c,u=Cd(e),h=i(e,d);if(!d&&Uc){u.visualElement=function(e,n,r,o){const{visualElement:i}=(0,t.useContext)(fd),a=(0,t.useContext)(md),s=(0,t.useContext)(Qc),l=(0,t.useContext)(pd).reducedMotion,c=(0,t.useRef)();o=o||a.renderer,!c.current&&o&&(c.current=o(e,{visualState:n,parent:i,props:r,presenceContext:s,blockInitialAnimation:!!s&&!1===s.initial,reducedMotionConfig:l}));const d=c.current;(0,t.useInsertionEffect)(()=>{d&&d.update(r,s)});const u=(0,t.useRef)(Boolean(r[vd]&&!window.HandoffComplete));return Vc(()=>{d&&(d.render(),u.current&&d.animationState&&d.animationState.animateChanges())}),(0,t.useEffect)(()=>{d&&(d.updateFeatures(),!u.current&&d.animationState&&d.animationState.animateChanges(),u.current&&(u.current=!1,window.HandoffComplete=!0))}),d}(a,h,c,r);const e=(0,t.useContext)(Rd),o=(0,t.useContext)(md).strict;u.visualElement&&(l=u.visualElement.loadFeatures(c,o,n,e))}return t.createElement(fd.Provider,{value:u},l&&u.visualElement?t.createElement(l,p({visualElement:u.visualElement},c)):null,o(a,e,function(e,n,r){return(0,t.useCallback)(t=>{t&&e.mount&&e.mount(t),n&&(t?n.mount(t):n.unmount()),r&&("function"===typeof r?r(t):xd(r)&&(r.current=t))},[n])}(h,u.visualElement,s),h,d,u.visualElement))});return s[Ad]=a,s}function Pd(e){let{layoutId:n}=e;const r=(0,t.useContext)(od).id;return r&&void 0!==n?r+"-"+n:n}function Od(e){function t(t){return Td(e(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))}if("undefined"===typeof Proxy)return t;const n=new Map;return new Proxy(t,{get:(e,r)=>(n.has(r)||n.set(r,t(r)),n.get(r))})}const Ld=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Dd(e){return"string"===typeof e&&!e.includes("-")&&!!(Ld.indexOf(e)>-1||/[A-Z]/.test(e))}const Id={};const Nd=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Md=new Set(Nd);function Fd(e,t){let{layout:n,layoutId:r}=t;return Md.has(e)||e.startsWith("origin")||(n||void 0!==r)&&(!!Id[e]||"opacity"===e)}const Wd=e=>Boolean(e&&e.getVelocity),Bd={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ud=Nd.length;const Vd=e=>t=>"string"===typeof t&&t.startsWith(e),Hd=Vd("--"),qd=Vd("var(--"),$d=(e,t)=>t&&"number"===typeof e?t.transform(e):e,Yd=(e,t,n)=>Math.min(Math.max(n,e),t),Kd={test:e=>"number"===typeof e,parse:parseFloat,transform:e=>e},Xd=p(p({},Kd),{},{transform:e=>Yd(0,1,e)}),Gd=p(p({},Kd),{},{default:1}),Jd=e=>Math.round(1e5*e)/1e5,Qd=/(-)?([\d]*\.?[\d])+/g,Zd=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,eu=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function tu(e){return"string"===typeof e}const nu=e=>({test:t=>tu(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>"".concat(t).concat(e)}),ru=nu("deg"),ou=nu("%"),iu=nu("px"),au=nu("vh"),su=nu("vw"),lu=p(p({},ou),{},{parse:e=>ou.parse(e)/100,transform:e=>ou.transform(100*e)}),cu=p(p({},Kd),{},{transform:Math.round}),du={borderWidth:iu,borderTopWidth:iu,borderRightWidth:iu,borderBottomWidth:iu,borderLeftWidth:iu,borderRadius:iu,radius:iu,borderTopLeftRadius:iu,borderTopRightRadius:iu,borderBottomRightRadius:iu,borderBottomLeftRadius:iu,width:iu,maxWidth:iu,height:iu,maxHeight:iu,size:iu,top:iu,right:iu,bottom:iu,left:iu,padding:iu,paddingTop:iu,paddingRight:iu,paddingBottom:iu,paddingLeft:iu,margin:iu,marginTop:iu,marginRight:iu,marginBottom:iu,marginLeft:iu,rotate:ru,rotateX:ru,rotateY:ru,rotateZ:ru,scale:Gd,scaleX:Gd,scaleY:Gd,scaleZ:Gd,skew:ru,skewX:ru,skewY:ru,distance:iu,translateX:iu,translateY:iu,translateZ:iu,x:iu,y:iu,z:iu,perspective:iu,transformPerspective:iu,opacity:Xd,originX:lu,originY:lu,originZ:iu,zIndex:cu,fillOpacity:Xd,strokeOpacity:Xd,numOctaves:cu};function uu(e,t,n,r){const{style:o,vars:i,transform:a,transformOrigin:s}=e;let l=!1,c=!1,d=!0;for(const u in t){const e=t[u];if(Hd(u)){i[u]=e;continue}const n=du[u],r=$d(e,n);if(Md.has(u)){if(l=!0,a[u]=r,!d)continue;e!==(n.default||0)&&(d=!1)}else u.startsWith("origin")?(c=!0,s[u]=r):o[u]=r}if(t.transform||(l||r?o.transform=function(e,t,n,r){let{enableHardwareAcceleration:o=!0,allowTransformNone:i=!0}=t,a="";for(let s=0;s<Ud;s++){const t=Nd[s];void 0!==e[t]&&(a+="".concat(Bd[t]||t,"(").concat(e[t],") "))}return o&&!e.z&&(a+="translateZ(0)"),a=a.trim(),r?a=r(e,n?"":a):i&&n&&(a="none"),a}(e.transform,n,d,r):o.transform&&(o.transform="none")),c){const{originX:e="50%",originY:t="50%",originZ:n=0}=s;o.transformOrigin="".concat(e," ").concat(t," ").concat(n)}}const hu=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function pu(e,t,n){for(const r in t)Wd(t[r])||Fd(r,n)||(e[r]=t[r])}function fu(e,n,r){const o={};return pu(o,e.style||{},e),Object.assign(o,function(e,n,r){let{transformTemplate:o}=e;return(0,t.useMemo)(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return uu(e,n,{enableHardwareAcceleration:!r},o),Object.assign({},e.vars,e.style)},[n])}(e,n,r)),e.transformValues?e.transformValues(o):o}function mu(e,t,n){const r={},o=fu(e,t,n);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===e.drag?"none":"pan-".concat("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=o,r}const gu=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function vu(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||gu.has(e)}let xu=e=>!vu(e);try{(bu=require("@emotion/is-prop-valid").default)&&(xu=e=>e.startsWith("on")?!vu(e):bu(e))}catch(jF){}var bu;function yu(e,t,n){return"string"===typeof e?e:iu.transform(t+n*e)}const wu={offset:"stroke-dashoffset",array:"stroke-dasharray"},Su={offset:"strokeDashoffset",array:"strokeDasharray"};const ju=["attrX","attrY","attrScale","originX","originY","pathLength","pathSpacing","pathOffset"];function ku(e,t,n,r,o){let{attrX:i,attrY:a,attrScale:s,originX:l,originY:c,pathLength:d,pathSpacing:u=1,pathOffset:h=0}=t;if(uu(e,Ki(t,ju),n,o),r)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:p,style:f,dimensions:m}=e;p.transform&&(m&&(f.transform=p.transform),delete p.transform),m&&(void 0!==l||void 0!==c||f.transform)&&(f.transformOrigin=function(e,t,n){const r=yu(t,e.x,e.width),o=yu(n,e.y,e.height);return"".concat(r," ").concat(o)}(m,void 0!==l?l:.5,void 0!==c?c:.5)),void 0!==i&&(p.x=i),void 0!==a&&(p.y=a),void 0!==s&&(p.scale=s),void 0!==d&&function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];e.pathLength=1;const i=o?wu:Su;e[i.offset]=iu.transform(-r);const a=iu.transform(t),s=iu.transform(n);e[i.array]="".concat(a," ").concat(s)}(p,d,u,h,!1)}const Cu=()=>p(p({},{style:{},transform:{},transformOrigin:{},vars:{}}),{},{attrs:{}}),Eu=e=>"string"===typeof e&&"svg"===e.toLowerCase();function _u(e,n,r,o){const i=(0,t.useMemo)(()=>{const t=Cu();return ku(t,n,{enableHardwareAcceleration:!1},Eu(o),e.transformTemplate),p(p({},t.attrs),{},{style:p({},t.style)})},[n]);if(e.style){const t={};pu(t,e.style,e),i.style=p(p({},t),i.style)}return i}function zu(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(n,r,o,i,a)=>{let{latestValues:s}=i;const l=(Dd(n)?_u:mu)(r,s,a,n),c=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"===typeof e.values||(xu(o)||!0===n&&vu(o)||!t&&!vu(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(r,"string"===typeof n,e),d=p(p(p({},c),l),{},{ref:o}),{children:u}=r,h=(0,t.useMemo)(()=>Wd(u)?u.get():u,[u]);return(0,t.createElement)(n,p(p({},d),{},{children:h}))}}function Ru(e,t,n,r){let{style:o,vars:i}=t;Object.assign(e.style,o,r&&r.getProjectionStyles(n));for(const a in i)e.style.setProperty(a,i[a])}const Au=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Tu(e,t,n,r){Ru(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Au.has(o)?o:gd(o),t.attrs[o])}function Pu(e,t){const{style:n}=e,r={};for(const o in n)(Wd(n[o])||t.style&&Wd(t.style[o])||Fd(o,e))&&(r[o]=n[o]);return r}function Ou(e,t){const n=Pu(e,t);for(const r in e)if(Wd(e[r])||Wd(t[r])){n[-1!==Nd.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=e[r]}return n}function Lu(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return"function"===typeof t&&(t=t(void 0!==n?n:e.custom,r,o)),"string"===typeof t&&(t=e.variants&&e.variants[t]),"function"===typeof t&&(t=t(void 0!==n?n:e.custom,r,o)),t}const Du=e=>Array.isArray(e),Iu=e=>Du(e)?e[e.length-1]||0:e;function Nu(e){const t=Wd(e)?e.get():e;return n=t,Boolean(n&&"object"===typeof n&&n.mix&&n.toValue)?t.toValue():t;var n}const Mu=["transitionEnd","transition"];const Fu=e=>(n,r)=>{const o=(0,t.useContext)(fd),i=(0,t.useContext)(Qc),a=()=>function(e,t,n,r){let{scrapeMotionValuesFromProps:o,createRenderState:i,onMount:a}=e;const s={latestValues:Wu(t,n,r,o),renderState:i()};return a&&(s.mount=e=>a(t,e,s)),s}(e,n,o,i);return r?a():Zc(a)};function Wu(e,t,n,r){const o={},i=r(e,{});for(const h in i)o[h]=Nu(i[h]);let{initial:a,animate:s}=e;const l=jd(e),c=kd(e);t&&c&&!l&&!1!==e.inherit&&(void 0===a&&(a=t.initial),void 0===s&&(s=t.animate));let d=!!n&&!1===n.initial;d=d||!1===a;const u=d?s:a;if(u&&"boolean"!==typeof u&&!yd(u)){(Array.isArray(u)?u:[u]).forEach(t=>{const n=Lu(e,t);if(!n)return;const{transitionEnd:r,transition:i}=n,a=Ki(n,Mu);for(const e in a){let t=a[e];if(Array.isArray(t)){t=t[d?t.length-1:0]}null!==t&&(o[e]=t)}for(const e in r)o[e]=r[e]})}return o}const Bu={useVisualState:Fu({scrapeMotionValuesFromProps:Ou,createRenderState:Cu,onMount:(e,t,n)=>{let{renderState:r,latestValues:o}=n;Kc.read(()=>{try{r.dimensions="function"===typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){r.dimensions={x:0,y:0,width:0,height:0}}}),Kc.render(()=>{ku(r,o,{enableHardwareAcceleration:!1},Eu(t.tagName),e.transformTemplate),Tu(t,r)})}})},Uu={useVisualState:Fu({scrapeMotionValuesFromProps:Pu,createRenderState:hu})};function Vu(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{passive:!0};return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const Hu=e=>"mouse"===e.pointerType?"number"!==typeof e.button||e.button<=0:!1!==e.isPrimary;function qu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"page";return{point:{x:e[t+"X"],y:e[t+"Y"]}}}function $u(e,t,n,r){return Vu(e,t,(e=>t=>Hu(t)&&e(t,qu(t)))(n),r)}const Yu=(e,t)=>n=>t(e(n)),Ku=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(Yu)};function Xu(e){let t=null;return()=>{const n=()=>{t=null};return null===t&&(t=e,n)}}const Gu=Xu("dragHorizontal"),Ju=Xu("dragVertical");function Qu(e){let t=!1;if("y"===e)t=Ju();else if("x"===e)t=Gu();else{const e=Gu(),n=Ju();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function Zu(){const e=Qu(!0);return!e||(e(),!1)}class eh{constructor(e){this.isMounted=!1,this.node=e}update(){}}function th(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End");return $u(e.current,n,(n,o)=>{if("touch"===n.pointerType||Zu())return;const i=e.getProps();e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",t),i[r]&&Kc.update(()=>i[r](n,o))},{passive:!e.getProps()[r]})}const nh=(e,t)=>!!t&&(e===t||nh(e,t.parentElement));function rh(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,qu(n))}const oh=["root"],ih=new WeakMap,ah=new WeakMap,sh=e=>{const t=ih.get(e.target);t&&t(e)},lh=e=>{e.forEach(sh)};function ch(e,t,n){const r=function(e){let{root:t}=e,n=Ki(e,oh);const r=t||document;ah.has(r)||ah.set(r,{});const o=ah.get(r),i=JSON.stringify(n);return o[i]||(o[i]=new IntersectionObserver(lh,p({root:t},n))),o[i]}(t);return ih.set(e,n),r.observe(e),()=>{ih.delete(e),r.unobserve(e)}}const dh={some:0,all:1};const uh={inView:{Feature:class extends eh{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e,i={root:t?t.current:void 0,rootMargin:n,threshold:"number"===typeof r?r:dh[r]};return ch(this.node.current,i,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)})}mount(){this.startObserver()}update(){if("undefined"===typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node,n=["amount","margin","root"].some(function(e){let{viewport:t={}}=e,{viewport:n={}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e=>t[e]!==n[e]}(e,t));n&&this.startObserver()}unmount(){}}},tap:{Feature:class extends eh{constructor(){super(...arguments),this.removeStartListeners=qc,this.removeEndListeners=qc,this.removeAccessibleListeners=qc,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=$u(window,"pointerup",(e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:o}=this.node.getProps();Kc.update(()=>{o||nh(this.node.current,e.target)?n&&n(e,t):r&&r(e,t)})},{passive:!(n.onTap||n.onPointerUp)}),o=$u(window,"pointercancel",(e,t)=>this.cancelPress(e,t),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Ku(r,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=Vu(this.node.current,"keydown",e=>{if("Enter"!==e.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=Vu(this.node.current,"keyup",e=>{"Enter"===e.key&&this.checkPressEnd()&&rh("up",(e,t)=>{const{onTap:n}=this.node.getProps();n&&Kc.update(()=>n(e,t))})}),rh("down",(e,t)=>{this.startPress(e,t)})}),t=Vu(this.node.current,"blur",()=>{this.isPressing&&rh("cancel",(e,t)=>this.cancelPress(e,t))});this.removeAccessibleListeners=Ku(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&Kc.update(()=>n(e,t))}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Zu()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&Kc.update(()=>n(e,t))}mount(){const e=this.node.getProps(),t=$u(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=Vu(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Ku(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends eh{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ku(Vu(this.node.current,"focus",()=>this.onFocus()),Vu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends eh{mount(){this.unmount=Ku(th(this.node,!0),th(this.node,!1))}unmount(){}}}};function hh(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function ph(e,t,n){const r=e.getProps();return Lu(r,t,void 0!==n?n:r.custom,function(e){const t={};return e.values.forEach((e,n)=>t[n]=e.get()),t}(e),function(e){const t={};return e.values.forEach((e,n)=>t[n]=e.getVelocity()),t}(e))}const fh=e=>1e3*e,mh=e=>e/1e3,gh=!1,vh=e=>Array.isArray(e)&&"number"===typeof e[0];function xh(e){return Boolean(!e||"string"===typeof e&&yh[e]||vh(e)||Array.isArray(e)&&e.every(xh))}const bh=e=>{let[t,n,r,o]=e;return"cubic-bezier(".concat(t,", ").concat(n,", ").concat(r,", ").concat(o,")")},yh={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:bh([0,.65,.55,1]),circOut:bh([.55,0,1,.45]),backIn:bh([.31,.01,.66,-.59]),backOut:bh([.33,1.53,.69,.99])};function wh(e){if(e)return vh(e)?bh(e):Array.isArray(e)?e.map(wh):yh[e]}const Sh=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function jh(e,t,n,r){if(e===t&&n===r)return qc;const o=t=>function(e,t,n,r,o){let i,a,s=0;do{a=t+(n-t)/2,i=Sh(a,r,o)-e,i>0?n=a:t=a}while(Math.abs(i)>1e-7&&++s<12);return a}(t,0,1,e,n);return e=>0===e||1===e?e:Sh(o(e),t,r)}const kh=jh(.42,0,1,1),Ch=jh(0,0,.58,1),Eh=jh(.42,0,.58,1),_h=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,zh=e=>t=>1-e(1-t),Rh=e=>1-Math.sin(Math.acos(e)),Ah=zh(Rh),Th=_h(Rh),Ph=jh(.33,1.53,.69,.99),Oh=zh(Ph),Lh=_h(Oh),Dh={linear:qc,easeIn:kh,easeInOut:Eh,easeOut:Ch,circIn:Rh,circInOut:Th,circOut:Ah,backIn:Oh,backInOut:Lh,backOut:Ph,anticipate:e=>(e*=2)<1?.5*Oh(e):.5*(2-Math.pow(2,-10*(e-1)))},Ih=e=>{if(Array.isArray(e)){ad(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return jh(t,n,r,o)}return"string"===typeof e?(ad(void 0!==Dh[e],"Invalid easing type '".concat(e,"'")),Dh[e]):e},Nh=(e,t)=>n=>Boolean(tu(n)&&eu.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),Mh=(e,t,n)=>r=>{if(!tu(r))return r;const[o,i,a,s]=r.match(Qd);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(a),alpha:void 0!==s?parseFloat(s):1}},Fh=p(p({},Kd),{},{transform:e=>Math.round((e=>Yd(0,255,e))(e))}),Wh={test:Nh("rgb","red"),parse:Mh("red","green","blue"),transform:e=>{let{red:t,green:n,blue:r,alpha:o=1}=e;return"rgba("+Fh.transform(t)+", "+Fh.transform(n)+", "+Fh.transform(r)+", "+Jd(Xd.transform(o))+")"}};const Bh={test:Nh("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:Wh.transform},Uh={test:Nh("hsl","hue"),parse:Mh("hue","saturation","lightness"),transform:e=>{let{hue:t,saturation:n,lightness:r,alpha:o=1}=e;return"hsla("+Math.round(t)+", "+ou.transform(Jd(n))+", "+ou.transform(Jd(r))+", "+Jd(Xd.transform(o))+")"}},Vh={test:e=>Wh.test(e)||Bh.test(e)||Uh.test(e),parse:e=>Wh.test(e)?Wh.parse(e):Uh.test(e)?Uh.parse(e):Bh.parse(e),transform:e=>tu(e)?e:e.hasOwnProperty("red")?Wh.transform(e):Uh.transform(e)},Hh=(e,t,n)=>-n*e+n*t+e;function qh(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}const $h=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},Yh=[Bh,Wh,Uh];function Kh(e){const t=(n=e,Yh.find(e=>e.test(n)));var n;ad(Boolean(t),"'".concat(e,"' is not an animatable color. Use the equivalent color code instead."));let r=t.parse(e);return t===Uh&&(r=function(e){let{hue:t,saturation:n,lightness:r,alpha:o}=e;t/=360,n/=100,r/=100;let i=0,a=0,s=0;if(n){const e=r<.5?r*(1+n):r+n-r*n,o=2*r-e;i=qh(o,e,t+1/3),a=qh(o,e,t),s=qh(o,e,t-1/3)}else i=a=s=r;return{red:Math.round(255*i),green:Math.round(255*a),blue:Math.round(255*s),alpha:o}}(r)),r}const Xh=(e,t)=>{const n=Kh(e),r=Kh(t),o=p({},n);return e=>(o.red=$h(n.red,r.red,e),o.green=$h(n.green,r.green,e),o.blue=$h(n.blue,r.blue,e),o.alpha=Hh(n.alpha,r.alpha,e),Wh.transform(o))};const Gh={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:"Vars",token:"${v}",parse:qc},Jh={regex:Zd,countKey:"Colors",token:"${c}",parse:Vh.parse},Qh={regex:Qd,countKey:"Numbers",token:"${n}",parse:Kd.parse};function Zh(e,t){let{regex:n,countKey:r,token:o,parse:i}=t;const a=e.tokenised.match(n);a&&(e["num"+r]=a.length,e.tokenised=e.tokenised.replace(n,o),e.values.push(...a.map(i)))}function ep(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Zh(n,Gh),Zh(n,Jh),Zh(n,Qh),n}function tp(e){return ep(e).values}function np(e){const{values:t,numColors:n,numVars:r,tokenised:o}=ep(e),i=t.length;return e=>{let t=o;for(let o=0;o<i;o++)t=o<r?t.replace(Gh.token,e[o]):o<r+n?t.replace(Jh.token,Vh.transform(e[o])):t.replace(Qh.token,Jd(e[o]));return t}}const rp=e=>"number"===typeof e?0:e;const op={test:function(e){var t,n;return isNaN(e)&&tu(e)&&((null===(t=e.match(Qd))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(Zd))||void 0===n?void 0:n.length)||0)>0},parse:tp,createTransformer:np,getAnimatableNone:function(e){const t=tp(e);return np(e)(t.map(rp))}},ip=(e,t)=>n=>"".concat(n>0?t:e);function ap(e,t){return"number"===typeof e?n=>Hh(e,t,n):Vh.test(e)?Xh(e,t):e.startsWith("var(")?ip(e,t):cp(e,t)}const sp=(e,t)=>{const n=[...e],r=n.length,o=e.map((e,n)=>ap(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=o[t](e);return n}},lp=(e,t)=>{const n=p(p({},e),t),r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=ap(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}},cp=(e,t)=>{const n=op.createTransformer(t),r=ep(e),o=ep(t);return r.numVars===o.numVars&&r.numColors===o.numColors&&r.numNumbers>=o.numNumbers?Ku(sp(r.values,o.values),n):(id(!0,"Complex values '".concat(e,"' and '").concat(t,"' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.")),ip(e,t))},dp=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},up=(e,t)=>n=>Hh(e,t,n);function hp(e,t,n){const r=[],o=n||("number"===typeof(i=e[0])?up:"string"===typeof i?Vh.test(i)?Xh:cp:Array.isArray(i)?sp:"object"===typeof i?lp:up);var i;const a=e.length-1;for(let s=0;s<a;s++){let n=o(e[s],e[s+1]);if(t){const e=Array.isArray(t)?t[s]||qc:t;n=Ku(e,n)}r.push(n)}return r}function pp(e,t){let{clamp:n=!0,ease:r,mixer:o}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=e.length;if(ad(i===t.length,"Both input and output ranges must be the same length"),1===i)return()=>t[0];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=hp(t,r,o),s=a.length,l=t=>{let n=0;if(s>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const r=dp(e[n],e[n+1],t);return a[n](r)};return n?t=>l(Yd(e[0],e[i-1],t)):l}function fp(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=dp(0,t,r);e.push(Hh(n,1,o))}}(t,e.length-1),t}function mp(e){let{duration:t=300,keyframes:n,times:r,ease:o="easeInOut"}=e;const i=(e=>Array.isArray(e)&&"number"!==typeof e[0])(o)?o.map(Ih):Ih(o),a={done:!1,value:n[0]},s=function(e,t){return e.map(e=>e*t)}(r&&r.length===n.length?r:fp(n),t),l=pp(s,n,{ease:Array.isArray(i)?i:(c=n,d=i,c.map(()=>d||Eh).splice(0,c.length-1))});var c,d;return{calculatedDuration:t,next:e=>(a.value=l(e),a.done=e>=t,a)}}function gp(e,t){return t?e*(1e3/t):0}function vp(e,t,n){const r=Math.max(t-5,0);return gp(n-e(r),t-r)}const xp=.001;function bp(e){let t,n,{duration:r=800,bounce:o=.25,velocity:i=0,mass:a=1}=e;id(r<=fh(10),"Spring duration must be 10 seconds or less");let s=1-o;s=Yd(.05,1,s),r=Yd(.01,10,mh(r)),s<1?(t=e=>{const t=e*s,n=t*r,o=t-i,a=wp(e,s),l=Math.exp(-n);return xp-o/a*l},n=e=>{const n=e*s*r,o=n*i+i,a=Math.pow(s,2)*Math.pow(e,2)*r,l=Math.exp(-n),c=wp(Math.pow(e,2),s);return(-t(e)+xp>0?-1:1)*((o-a)*l)/c}):(t=e=>Math.exp(-e*r)*((e-i)*r+1)-.001,n=e=>Math.exp(-e*r)*(r*r*(i-e)));const l=function(e,t,n){let r=n;for(let o=1;o<yp;o++)r-=e(r)/t(r);return r}(t,n,5/r);if(r=fh(r),isNaN(l))return{stiffness:100,damping:10,duration:r};{const e=Math.pow(l,2)*a;return{stiffness:e,damping:2*s*Math.sqrt(a*e),duration:r}}}const yp=12;function wp(e,t){return e*Math.sqrt(1-t*t)}const Sp=["keyframes","restDelta","restSpeed"],jp=["duration","bounce"],kp=["stiffness","damping","mass"];function Cp(e,t){return t.some(t=>void 0!==e[t])}function Ep(e){let{keyframes:t,restDelta:n,restSpeed:r}=e,o=Ki(e,Sp);const i=t[0],a=t[t.length-1],s={done:!1,value:i},{stiffness:l,damping:c,mass:d,duration:u,velocity:h,isResolvedFromDuration:f}=function(e){let t=p({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!Cp(e,kp)&&Cp(e,jp)){const n=bp(e);t=p(p(p({},t),n),{},{mass:1}),t.isResolvedFromDuration=!0}return t}(p(p({},o),{},{velocity:-mh(o.velocity||0)})),m=h||0,g=c/(2*Math.sqrt(l*d)),v=a-i,x=mh(Math.sqrt(l/d)),b=Math.abs(v)<5;let y;if(r||(r=b?.01:2),n||(n=b?.005:.5),g<1){const e=wp(x,g);y=t=>{const n=Math.exp(-g*x*t);return a-n*((m+g*x*v)/e*Math.sin(e*t)+v*Math.cos(e*t))}}else if(1===g)y=e=>a-Math.exp(-x*e)*(v+(m+x*v)*e);else{const e=x*Math.sqrt(g*g-1);y=t=>{const n=Math.exp(-g*x*t),r=Math.min(e*t,300);return a-n*((m+g*x*v)*Math.sinh(r)+e*v*Math.cosh(r))/e}}return{calculatedDuration:f&&u||null,next:e=>{const t=y(e);if(f)s.done=e>=u;else{let o=m;0!==e&&(o=g<1?vp(y,e,t):0);const i=Math.abs(o)<=r,l=Math.abs(a-t)<=n;s.done=i&&l}return s.value=s.done?a:t,s}}}function _p(e){let{keyframes:t,velocity:n=0,power:r=.8,timeConstant:o=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:s,min:l,max:c,restDelta:d=.5,restSpeed:u}=e;const h=t[0],p={done:!1,value:h},f=e=>void 0===l?c:void 0===c||Math.abs(l-e)<Math.abs(c-e)?l:c;let m=r*n;const g=h+m,v=void 0===s?g:s(g);v!==g&&(m=v-h);const x=e=>-m*Math.exp(-e/o),b=e=>v+x(e),y=e=>{const t=x(e),n=b(e);p.done=Math.abs(t)<=d,p.value=p.done?v:n};let w,S;const j=e=>{var t;(t=p.value,void 0!==l&&t<l||void 0!==c&&t>c)&&(w=e,S=Ep({keyframes:[p.value,f(p.value)],velocity:vp(b,e,p.value),damping:i,stiffness:a,restDelta:d,restSpeed:u}))};return j(0),{calculatedDuration:null,next:e=>{let t=!1;return S||void 0!==w||(t=!0,y(e),j(e)),void 0!==w&&e>w?S.next(e-w):(!t&&y(e),p)}}}const zp=e=>{const t=t=>{let{timestamp:n}=t;return e(n)};return{start:()=>Kc.update(t,!0),stop:()=>Xc(t),now:()=>Gc.isProcessing?Gc.timestamp:performance.now()}};function Rp(e){let t=0;let n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}const Ap=["autoplay","delay","driver","keyframes","type","repeat","repeatDelay","repeatType","onPlay","onStop","onComplete","onUpdate"],Tp={decay:_p,inertia:_p,tween:mp,keyframes:mp,spring:Ep};function Pp(e){let t,n,{autoplay:r=!0,delay:o=0,driver:i=zp,keyframes:a,type:s="keyframes",repeat:l=0,repeatDelay:c=0,repeatType:d="loop",onPlay:u,onStop:h,onComplete:f,onUpdate:m}=e,g=Ki(e,Ap),v=1,x=!1;const b=()=>{n=new Promise(e=>{t=e})};let y;b();const w=Tp[s]||mp;let S;w!==mp&&"number"!==typeof a[0]&&(S=pp([0,100],a,{clamp:!1}),a=[0,100]);const j=w(p(p({},g),{},{keyframes:a}));let k;"mirror"===d&&(k=w(p(p({},g),{},{keyframes:[...a].reverse(),velocity:-(g.velocity||0)})));let C="idle",E=null,_=null,z=null;null===j.calculatedDuration&&l&&(j.calculatedDuration=Rp(j));const{calculatedDuration:R}=j;let A=1/0,T=1/0;null!==R&&(A=R+c,T=A*(l+1)-c);let P=0;const O=e=>{if(null===_)return;v>0&&(_=Math.min(_,e)),v<0&&(_=Math.min(e-T/v,_)),P=null!==E?E:Math.round(e-_)*v;const t=P-o*(v>=0?1:-1),n=v>=0?t<0:t>T;P=Math.max(t,0),"finished"===C&&null===E&&(P=T);let r=P,i=j;if(l){const e=Math.min(P,T)/A;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,l+1);Boolean(t%2)&&("reverse"===d?(n=1-n,c&&(n-=c/A)):"mirror"===d&&(i=k)),r=Yd(0,1,n)*A}const s=n?{done:!1,value:a[0]}:i.next(r);S&&(s.value=S(s.value));let{done:u}=s;n||null===R||(u=v>=0?P>=T:P<=0);const h=null===E&&("finished"===C||"running"===C&&u);return m&&m(s.value),h&&I(),s},L=()=>{y&&y.stop(),y=void 0},D=()=>{C="idle",L(),t(),b(),_=z=null},I=()=>{C="finished",f&&f(),L(),t()},N=()=>{if(x)return;y||(y=i(O));const e=y.now();u&&u(),null!==E?_=e-E:_&&"finished"!==C||(_=e),"finished"===C&&b(),z=_,E=null,C="running",y.start()};r&&N();const M={then:(e,t)=>n.then(e,t),get time(){return mh(P)},set time(e){e=fh(e),P=e,null===E&&y&&0!==v?_=y.now()-e/v:E=e},get duration(){const e=null===j.calculatedDuration?Rp(j):j.calculatedDuration;return mh(e)},get speed(){return v},set speed(e){e!==v&&y&&(v=e,M.time=mh(P))},get state(){return C},play:N,pause:()=>{C="paused",E=P},stop:()=>{x=!0,"idle"!==C&&(C="idle",h&&h(),D())},cancel:()=>{null!==z&&O(z),D()},complete:()=>{C="finished"},sample:e=>(_=0,O(e))};return M}const Op=["onUpdate","onComplete"],Lp=function(e){let t;return()=>(void 0===t&&(t=e()),t)}(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Dp=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);function Ip(e,t,n){let{onUpdate:r,onComplete:o}=n,i=Ki(n,Op);if(!(Lp()&&Dp.has(t)&&!i.repeatDelay&&"mirror"!==i.repeatType&&0!==i.damping&&"inertia"!==i.type))return!1;let a,s,l=!1,c=!1;const d=()=>{s=new Promise(e=>{a=e})};d();let{keyframes:u,duration:h=300,ease:f,times:m}=i;if(((e,t)=>"spring"===t.type||"backgroundColor"===e||!xh(t.ease))(t,i)){const e=Pp(p(p({},i),{},{repeat:0,delay:0}));let t={done:!1,value:u[0]};const n=[];let r=0;for(;!t.done&&r<2e4;)t=e.sample(r),n.push(t.value),r+=10;m=void 0,u=n,h=r-10,f="linear"}const g=function(e,t,n){let{delay:r=0,duration:o,repeat:i=0,repeatType:a="loop",ease:s,times:l}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const c={[t]:n};l&&(c.offset=l);const d=wh(s);return Array.isArray(d)&&(c.easing=d),e.animate(c,{delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:"reverse"===a?"alternate":"normal"})}(e.owner.current,t,u,p(p({},i),{},{duration:h,ease:f,times:m})),v=()=>{c=!1,g.cancel()},x=()=>{c=!0,Kc.update(v),a(),d()};g.onfinish=()=>{c||(e.set(function(e,t){let{repeat:n,repeatType:r="loop"}=t;return e[n&&"loop"!==r&&n%2===1?0:e.length-1]}(u,i)),o&&o(),x())};return{then:(e,t)=>s.then(e,t),attachTimeline:e=>(g.timeline=e,g.onfinish=null,qc),get time(){return mh(g.currentTime||0)},set time(e){g.currentTime=fh(e)},get speed(){return g.playbackRate},set speed(e){g.playbackRate=e},get duration(){return mh(h)},play:()=>{l||(g.play(),Xc(v))},pause:()=>g.pause(),stop:()=>{if(l=!0,"idle"===g.playState)return;const{currentTime:t}=g;if(t){const n=Pp(p(p({},i),{},{autoplay:!1}));e.setWithVelocity(n.sample(t-10).value,n.sample(t).value,10)}x()},complete:()=>{c||g.finish()},cancel:x}}const Np={type:"spring",stiffness:500,damping:25,restSpeed:10},Mp={type:"keyframes",duration:.8},Fp={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Wp=(e,t)=>{let{keyframes:n}=t;return n.length>2?Mp:Md.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===n[1]?2*Math.sqrt(550):30,restSpeed:10}:Np:Fp},Bp=(e,t)=>"zIndex"!==e&&(!("number"!==typeof t&&!Array.isArray(t))||!("string"!==typeof t||!op.test(t)&&"0"!==t||t.startsWith("url("))),Up=new Set(["brightness","contrast","saturate","opacity"]);function Vp(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Qd)||[];if(!r)return e;const o=n.replace(r,"");let i=Up.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const Hp=/([a-z-]*)\(.*?\)/g,qp=p(p({},op),{},{getAnimatableNone:e=>{const t=e.match(Hp);return t?t.map(Vp).join(" "):e}}),$p=p(p({},du),{},{color:Vh,backgroundColor:Vh,outlineColor:Vh,fill:Vh,stroke:Vh,borderColor:Vh,borderTopColor:Vh,borderRightColor:Vh,borderBottomColor:Vh,borderLeftColor:Vh,filter:qp,WebkitFilter:qp}),Yp=e=>$p[e];function Kp(e,t){let n=Yp(e);return n!==qp&&(n=op),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Xp=e=>/^0[^.\s]+$/.test(e);function Gp(e){return"number"===typeof e?0===e:null!==e?"none"===e||"0"===e||Xp(e):void 0}const Jp=["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"];function Qp(e,t){return e[t]||e.default||e}const Zp=!1,ef=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return o=>{const i=Qp(r,e)||{},a=i.delay||r.delay||0;let{elapsed:s=0}=r;s-=fh(a);const l=function(e,t,n,r){const o=Bp(t,n);let i;i=Array.isArray(n)?[...n]:[null,n];const a=void 0!==r.from?r.from:e.get();let s;const l=[];for(let c=0;c<i.length;c++)null===i[c]&&(i[c]=0===c?a:i[c-1]),Gp(i[c])&&l.push(c),"string"===typeof i[c]&&"none"!==i[c]&&"0"!==i[c]&&(s=i[c]);if(o&&l.length&&s)for(let c=0;c<l.length;c++)i[l[c]]=Kp(t,s);return i}(t,e,n,i),c=l[0],d=l[l.length-1],u=Bp(e,c),h=Bp(e,d);id(u===h,"You are trying to animate ".concat(e,' from "').concat(c,'" to "').concat(d,'". ').concat(c," is not an animatable value - to enable this animation set ").concat(c," to a value animatable to ").concat(d," via the `style` property."));let f=p(p({keyframes:l,velocity:t.getVelocity(),ease:"easeOut"},i),{},{delay:-s,onUpdate:e=>{t.set(e),i.onUpdate&&i.onUpdate(e)},onComplete:()=>{o(),i.onComplete&&i.onComplete()}});if(function(e){let{when:t,delay:n,delayChildren:r,staggerChildren:o,staggerDirection:i,repeat:a,repeatType:s,repeatDelay:l,from:c,elapsed:d}=e,u=Ki(e,Jp);return!!Object.keys(u).length}(i)||(f=p(p({},f),Wp(e,f))),f.duration&&(f.duration=fh(f.duration)),f.repeatDelay&&(f.repeatDelay=fh(f.repeatDelay)),!u||!h||gh||!1===i.type||Zp)return function(e){let{keyframes:t,delay:n,onUpdate:r,onComplete:o}=e;const i=()=>(r&&r(t[t.length-1]),o&&o(),{time:0,speed:1,duration:0,play:qc,pause:qc,stop:qc,then:e=>(e(),Promise.resolve()),cancel:qc,complete:qc});return n?Pp({keyframes:[0,1],duration:0,delay:n,onComplete:i}):i()}(gh?p(p({},f),{},{delay:0}):f);if(!r.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const n=Ip(t,e,f);if(n)return n}return Pp(f)}};function tf(e){return Boolean(Wd(e)&&e.add)}const nf=e=>/^\-?\d*\.?\d+$/.test(e);function rf(e,t){-1===e.indexOf(t)&&e.push(t)}function of(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class af{constructor(){this.subscriptions=[]}add(e){return rf(this.subscriptions,e),()=>of(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const sf={current:void 0};class lf{constructor(e){var t=this;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var r;this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=function(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t.prev=t.current,t.current=e;const{delta:r,timestamp:o}=Gc;t.lastUpdated!==o&&(t.timeDelta=r,t.lastUpdated=o,Kc.postRender(t.scheduleVelocityCheck)),t.prev!==t.current&&t.events.change&&t.events.change.notify(t.current),t.events.velocityChange&&t.events.velocityChange.notify(t.getVelocity()),n&&t.events.renderRequest&&t.events.renderRequest.notify(t.current)},this.scheduleVelocityCheck=()=>Kc.postRender(this.velocityCheck),this.velocityCheck=e=>{let{timestamp:t}=e;t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=(r=this.current,!isNaN(parseFloat(r))),this.owner=n.owner}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new af);const n=this.events[e].add(t);return"change"===e?()=>{n(),Kc.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=e,this.timeDelta=n}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return sf.current&&sf.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?gp(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function cf(e,t){return new lf(e,t)}const df=e=>t=>t.test(e),uf=[Kd,iu,ou,ru,su,au,{test:e=>"auto"===e,parse:e=>e}],hf=e=>uf.find(df(e)),pf=[...uf,Vh,op],ff=e=>pf.find(df(e)),mf=["transitionEnd","transition"];function gf(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,cf(n))}function vf(e,t){const n=ph(e,t);let r=n?e.makeTargetAnimatable(n,!1):{},{transitionEnd:o={},transition:i={}}=r,a=Ki(r,mf);a=p(p({},a),o);for(const s in a){gf(e,s,Iu(a[s]))}}function xf(e,t){if(!t)return;return(t[e]||t.default||t).from}const bf=["transition","transitionEnd"];function yf(e,t){let{protectedKeys:n,needsAnimating:r}=e;const o=n.hasOwnProperty(t)&&!0!==r[t];return r[t]=!1,o}function wf(e,t){const n=e.get();if(!Array.isArray(t))return n!==t;for(let r=0;r<t.length;r++)if(t[r]!==n)return!0}function Sf(e,t){let{delay:n=0,transitionOverride:r,type:o}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=e.makeTargetAnimatable(t),{transition:a=e.getDefaultTransition(),transitionEnd:s}=i,l=Ki(i,bf);const c=e.getValue("willChange");r&&(a=r);const d=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const h in l){const t=e.getValue(h),r=l[h];if(!t||void 0===r||u&&yf(u,h))continue;const o=p({delay:n,elapsed:0},Qp(a||{},h));if(window.HandoffAppearAnimations){const n=e.getProps()[vd];if(n){const e=window.HandoffAppearAnimations(n,h,t,Kc);null!==e&&(o.elapsed=e,o.isHandoff=!0)}}let i=!o.isHandoff&&!wf(t,r);if("spring"===o.type&&(t.getVelocity()||o.velocity)&&(i=!1),t.animation&&(i=!1),i)continue;t.start(ef(h,t,r,e.shouldReduceMotion&&Md.has(h)?{type:!1}:o));const s=t.animation;tf(c)&&(c.add(h),s.then(()=>c.remove(h))),d.push(s)}return s&&Promise.all(d).then(()=>{s&&vf(e,s)}),d}function jf(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=ph(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(Sf(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{delayChildren:i=0,staggerChildren:a,staggerDirection:s}=o;return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,i=arguments.length>5?arguments[5]:void 0;const a=[],s=(e.variantChildren.size-1)*r,l=1===o?function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)*r}:function(){return s-(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)*r};return Array.from(e.variantChildren).sort(kf).forEach((e,r)=>{e.notify("AnimationStart",t),a.push(jf(e,t,p(p({},i),{},{delay:n+l(r)})).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(a)}(e,t,i+r,a,s,n)}:()=>Promise.resolve(),{when:s}=o;if(s){const[e,t]="beforeChildren"===s?[i,a]:[a,i];return e().then(()=>t())}return Promise.all([i(),a(n.delay)])}function kf(e,t){return e.sortNodePosition(t)}const Cf=["transition","transitionEnd"],Ef=[...wd].reverse(),_f=wd.length;function zf(e){return t=>Promise.all(t.map(t=>{let{animation:n,options:r}=t;return function(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map(t=>jf(e,t,r));n=Promise.all(o)}else if("string"===typeof t)n=jf(e,t,r);else{const o="function"===typeof t?ph(e,t,r.custom):t;n=Promise.all(Sf(e,o,r))}return n.then(()=>e.notify("AnimationComplete",t))}(e,n,r)}))}function Rf(e){let t=zf(e);const n={animate:Tf(!0),whileInView:Tf(),whileHover:Tf(),whileTap:Tf(),whileDrag:Tf(),whileFocus:Tf(),exit:Tf()};let r=!0;const o=(t,n)=>{const r=ph(e,n);if(r){const{transition:e,transitionEnd:n}=r,o=Ki(r,Cf);t=p(p(p({},t),o),n)}return t};function i(i,a){const s=e.getProps(),l=e.getVariantContext(!0)||{},c=[],d=new Set;let u={},h=1/0;for(let t=0;t<_f;t++){const f=Ef[t],m=n[f],g=void 0!==s[f]?s[f]:l[f],v=bd(g),x=f===a?m.isActive:null;!1===x&&(h=t);let b=g===l[f]&&g!==s[f]&&v;if(b&&r&&e.manuallyAnimateOnMount&&(b=!1),m.protectedKeys=p({},u),!m.isActive&&null===x||!g&&!m.prevProp||yd(g)||"boolean"===typeof g)continue;let y=Af(m.prevProp,g)||f===a&&m.isActive&&!b&&v||t>h&&v,w=!1;const S=Array.isArray(g)?g:[g];let j=S.reduce(o,{});!1===x&&(j={});const{prevResolvedValues:k={}}=m,C=p(p({},k),j),E=e=>{y=!0,d.has(e)&&(w=!0,d.delete(e)),m.needsAnimating[e]=!0};for(const e in C){const t=j[e],n=k[e];if(u.hasOwnProperty(e))continue;let r=!1;r=Du(t)&&Du(n)?!hh(t,n):t!==n,r?void 0!==t?E(e):d.add(e):void 0!==t&&d.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=g,m.prevResolvedValues=j,m.isActive&&(u=p(p({},u),j)),r&&e.blockInitialAnimation&&(y=!1),!y||b&&!w||c.push(...S.map(e=>({animation:e,options:p({type:f},i)})))}if(d.size){const t={};d.forEach(n=>{const r=e.getBaseTarget(n);void 0!==r&&(t[n]=r)}),c.push({animation:t})}let f=Boolean(c.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(f=!1),r=!1,f?t(c):Promise.resolve()}return{animateChanges:i,setActive:function(t,r,o){var a;if(n[t].isActive===r)return Promise.resolve();null===(a=e.variantChildren)||void 0===a||a.forEach(e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)}),n[t].isActive=r;const s=i(o,t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n}}function Af(e,t){return"string"===typeof t?t!==e:!!Array.isArray(t)&&!hh(t,e)}function Tf(){return{isActive:arguments.length>0&&void 0!==arguments[0]&&arguments[0],protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let Pf=0;const Of={animation:{Feature:class extends eh{constructor(e){super(e),e.animationState||(e.animationState=Rf(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),yd(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends eh{constructor(){super(...arguments),this.id=Pf++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t,custom:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const o=this.node.animationState.setActive("exit",!e,{custom:null!==n&&void 0!==n?n:this.node.getProps().custom});t&&!e&&o.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},Lf=(e,t)=>Math.abs(e-t);class Df{constructor(e,t){let{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:o=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=Mf(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Lf(e.x,t.x),r=Lf(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=Gc;this.history.push(p(p({},r),{},{timestamp:o}));const{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=If(t,this.transformPagePoint),Kc.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=Mf("pointercancel"===e.type?this.lastMoveEventInfo:If(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!Hu(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=If(qu(e),this.transformPagePoint),{point:a}=i,{timestamp:s}=Gc;this.history=[p(p({},a),{},{timestamp:s})];const{onSessionStart:l}=t;l&&l(e,Mf(i,this.history)),this.removeListeners=Ku($u(this.contextWindow,"pointermove",this.handlePointerMove),$u(this.contextWindow,"pointerup",this.handlePointerUp),$u(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Xc(this.updatePoint)}}function If(e,t){return t?{point:t(e.point)}:e}function Nf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Mf(e,t){let{point:n}=e;return{point:n,delta:Nf(n,Wf(t)),offset:Nf(n,Ff(t)),velocity:Bf(t,.1)}}function Ff(e){return e[0]}function Wf(e){return e[e.length-1]}function Bf(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Wf(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>fh(t)));)n--;if(!r)return{x:0,y:0};const i=mh(o.timestamp-r.timestamp);if(0===i)return{x:0,y:0};const a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Uf(e){return e.max-e.min}function Vf(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return Math.abs(e-t)<=n}function Hf(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;e.origin=r,e.originPoint=Hh(t.min,t.max,e.origin),e.scale=Uf(n)/Uf(t),(Vf(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=Hh(n.min,n.max,e.origin)-e.originPoint,(Vf(e.translate)||isNaN(e.translate))&&(e.translate=0)}function qf(e,t,n,r){Hf(e.x,t.x,n.x,r?r.originX:void 0),Hf(e.y,t.y,n.y,r?r.originY:void 0)}function $f(e,t,n){e.min=n.min+t.min,e.max=e.min+Uf(t)}function Yf(e,t,n){e.min=t.min-n.min,e.max=e.min+Uf(t)}function Kf(e,t,n){Yf(e.x,t.x,n.x),Yf(e.y,t.y,n.y)}function Xf(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Gf(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}const Jf=.35;function Qf(e,t,n){return{min:Zf(e,t),max:Zf(e,n)}}function Zf(e,t){return"number"===typeof e?e:e[t]||0}const em=()=>({x:{min:0,max:0},y:{min:0,max:0}});function tm(e){return[e("x"),e("y")]}function nm(e){let{top:t,left:n,right:r,bottom:o}=e;return{x:{min:n,max:r},y:{min:t,max:o}}}function rm(e){return void 0===e||1===e}function om(e){let{scale:t,scaleX:n,scaleY:r}=e;return!rm(t)||!rm(n)||!rm(r)}function im(e){return om(e)||am(e)||e.z||e.rotate||e.rotateX||e.rotateY}function am(e){return sm(e.x)||sm(e.y)}function sm(e){return e&&"0%"!==e}function lm(e,t,n){return n+t*(e-n)}function cm(e,t,n,r,o){return void 0!==o&&(e=lm(e,o,r)),lm(e,n,r)+t}function dm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;e.min=cm(e.min,t,n,r,o),e.max=cm(e.max,t,n,r,o)}function um(e,t){let{x:n,y:r}=t;dm(e.x,n.translate,n.scale,n.originPoint),dm(e.y,r.translate,r.scale,r.originPoint)}function hm(e){return Number.isInteger(e)||e>1.0000000000001||e<.999999999999?e:1}function pm(e,t){e.min=e.min+t,e.max=e.max+t}function fm(e,t,n){let[r,o,i]=n;const a=void 0!==t[i]?t[i]:.5,s=Hh(e.min,e.max,a);dm(e,t[r],t[o],s,t.scale)}const mm=["x","scaleX","originX"],gm=["y","scaleY","originY"];function vm(e,t){fm(e.x,t,mm),fm(e.y,t,gm)}function xm(e,t){return nm(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const bm=e=>{let{current:t}=e;return t?t.ownerDocument.defaultView:null},ym=new WeakMap;class wm{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e){let{snapToCursor:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new Df(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(qu(e,"page").point)},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:o}=this.getProps();if(n&&!r&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Qu(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),tm(e=>{let t=this.getAxisMotionValue(e).get()||0;if(ou.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];if(r){t=Uf(r)*(parseFloat(t)/100)}}}this.originPoint[e]=t}),o&&Kc.update(()=>o(e,t),!1,!0);const{animationState:i}=this.visualElement;i&&i.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:a}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(a),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,a),this.updateAxis("y",t.point,a),this.visualElement.render(),i&&i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>tm(e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:bm(this.visualElement)})}stop(e,t){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:o}=this.getProps();o&&Kc.update(()=>o(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!Sm(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,t,n){let{min:r,max:o}=t;return void 0!==r&&e<r?e=n?Hh(r,e,n.min):Math.max(e,r):void 0!==o&&e>o&&(e=n?Hh(o,e,n.max):Math.min(e,o)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&xd(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,t){let{top:n,left:r,bottom:o,right:i}=t;return{x:Xf(e.x,r,i),y:Xf(e.y,n,o)}}(r.layoutBox,t),this.elastic=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jf;return!1===e?e=0:!0===e&&(e=Jf),{x:Qf(e,"left","right"),y:Qf(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&tm(e=>{this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!xd(e))return!1;const n=e.current;ad(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=xm(e,n),{scroll:o}=t;return o&&(pm(r.x,o.offset.x),pm(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:Gf(e.x,t.x),y:Gf(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function(e){let{x:t,y:n}=e;return{top:n.min,right:t.max,bottom:n.max,left:t.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=nm(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),s=this.constraints||{},l=tm(a=>{if(!Sm(a,t,this.currentDirection))return;let l=s&&s[a]||{};i&&(l={min:0,max:0});const c=r?200:1e6,d=r?40:1e7,u=p(p({type:"inertia",velocity:n?e[a]:0,bounceStiffness:c,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10},o),l);return this.startAxisValueAnimation(a,u)});return Promise.all(l).then(a)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return n.start(ef(e,n,0,t))}stopAnimation(){tm(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){tm(e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()})}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t="_drag"+e.toUpperCase(),n=this.visualElement.getProps(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){tm(t=>{const{drag:n}=this.getProps();if(!Sm(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-Hh(n,i,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!xd(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};tm(e=>{const t=this.getAxisMotionValue(e);if(t){const n=t.get();r[e]=function(e,t){let n=.5;const r=Uf(e),o=Uf(t);return o>r?n=dp(t.min,t.max-r,e.min):r>o&&(n=dp(e.min,e.max-o,t.min)),Yd(0,1,n)}({min:n,max:n},this.constraints[e])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),tm(t=>{if(!Sm(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Hh(o,i,r[t]))})}addListeners(){if(!this.visualElement.current)return;ym.set(this.visualElement,this);const e=$u(this.visualElement.current,"pointerdown",e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),t=()=>{const{dragConstraints:e}=this.getProps();xd(e)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),t();const o=Vu(window,"resize",()=>this.scalePositionWithinConstraints()),i=n.addEventListener("didUpdate",e=>{let{delta:t,hasLayoutChanged:n}=e;this.isDragging&&n&&(tm(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{o(),e(),r(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=Jf,dragMomentum:a=!0}=e;return p(p({},e),{},{drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:a})}}function Sm(e,t,n){return(!0===t||t===e)&&(null===n||n===e)}const jm=e=>(t,n)=>{e&&Kc.update(()=>e(t,n))};const km={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Cm(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Em={correct:(e,t)=>{if(!t.target)return e;if("string"===typeof e){if(!iu.test(e))return e;e=parseFloat(e)}const n=Cm(e,t.target.x),r=Cm(e,t.target.y);return"".concat(n,"% ").concat(r,"%")}},_m={correct:(e,t)=>{let{treeScale:n,projectionDelta:r}=t;const o=e,i=op.parse(e);if(i.length>5)return o;const a=op.createTransformer(e),s="number"!==typeof i[0]?1:0,l=r.x.scale*n.x,c=r.y.scale*n.y;i[0+s]/=l,i[1+s]/=c;const d=Hh(l,c,.5);return"number"===typeof i[2+s]&&(i[2+s]/=d),"number"===typeof i[3+s]&&(i[3+s]/=d),a(i)}};class zm extends t.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var i;i=Am,Object.assign(Id,i),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions(p(p({},o.options),{},{onExitComplete:()=>this.safeToRemove()}))),km.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||Kc.postRender(()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),queueMicrotask(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Rm(e){const[n,r]=ud(),o=(0,t.useContext)(od);return t.createElement(zm,p(p({},e),{},{layoutGroup:o,switchLayoutGroup:(0,t.useContext)(Rd),isPresent:n,safeToRemove:r}))}const Am={borderRadius:p(p({},Em),{},{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Em,borderTopRightRadius:Em,borderBottomLeftRadius:Em,borderBottomRightRadius:Em,boxShadow:_m},Tm=["TopLeft","TopRight","BottomLeft","BottomRight"],Pm=Tm.length,Om=e=>"string"===typeof e?parseFloat(e):e,Lm=e=>"number"===typeof e||iu.test(e);function Dm(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Im=Mm(0,.5,Ah),Nm=Mm(.5,.95,qc);function Mm(e,t,n){return r=>r<e?0:r>t?1:n(dp(e,t,r))}function Fm(e,t){e.min=t.min,e.max=t.max}function Wm(e,t){Fm(e.x,t.x),Fm(e.y,t.y)}function Bm(e,t,n,r,o){return e=lm(e-=t,1/n,r),void 0!==o&&(e=lm(e,1/o,r)),e}function Um(e,t,n,r,o){let[i,a,s]=n;!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:e;ou.test(t)&&(t=parseFloat(t),t=Hh(a.min,a.max,t/100)-a.min);if("number"!==typeof t)return;let s=Hh(i.min,i.max,r);e===i&&(s-=t),e.min=Bm(e.min,t,n,s,o),e.max=Bm(e.max,t,n,s,o)}(e,t[i],t[a],t[s],t.scale,r,o)}const Vm=["x","scaleX","originX"],Hm=["y","scaleY","originY"];function qm(e,t,n,r){Um(e.x,t,Vm,n?n.x:void 0,r?r.x:void 0),Um(e.y,t,Hm,n?n.y:void 0,r?r.y:void 0)}function $m(e){return 0===e.translate&&1===e.scale}function Ym(e){return $m(e.x)&&$m(e.y)}function Km(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function Xm(e){return Uf(e.x)/Uf(e.y)}class Gm{constructor(){this.members=[]}add(e){rf(this.members,e),e.scheduleRender()}remove(e){if(of(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex(t=>e===t);if(0===t)return!1;let n;for(let r=t;r>=0;r--){const e=this.members[r];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Jm(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y;if((o||i)&&(r="translate3d(".concat(o,"px, ").concat(i,"px, 0) ")),1===t.x&&1===t.y||(r+="scale(".concat(1/t.x,", ").concat(1/t.y,") ")),n){const{rotate:e,rotateX:t,rotateY:o}=n;e&&(r+="rotate(".concat(e,"deg) ")),t&&(r+="rotateX(".concat(t,"deg) ")),o&&(r+="rotateY(".concat(o,"deg) "))}const a=e.x.scale*t.x,s=e.y.scale*t.y;return 1===a&&1===s||(r+="scale(".concat(a,", ").concat(s,")")),r||"none"}const Qm=(e,t)=>e.depth-t.depth;class Zm{constructor(){this.children=[],this.isDirty=!1}add(e){rf(this.children,e),this.isDirty=!0}remove(e){of(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Qm),this.isDirty=!1,this.children.forEach(e)}}const eg=["","X","Y","Z"],tg={visibility:"hidden"};let ng=0;const rg={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function og(e){let{attachResizeListener:t,defaultParent:n,measureScroll:r,checkIsScrollRoot:o,resetTransform:i}=e;return class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===n||void 0===n?void 0:n();this.id=ng++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,rg.totalNodes=rg.resolvedTargetDeltas=rg.recalculatedProjection=0,this.nodes.forEach(sg),this.nodes.forEach(fg),this.nodes.forEach(mg),this.nodes.forEach(lg),function(e){window.MotionDebug&&window.MotionDebug.record(e)}(rg)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=t?t.root||t:this,this.path=t?[...t.path,t]:[],this.parent=t,this.depth=t?t.depth+1:0;for(let n=0;n<this.path.length;n++)this.path[n].shouldResetTransform=!0;this.root===this&&(this.nodes=new Zm)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new af),this.eventHandlers.get(e).add(t)}notifyListeners(e){const t=this.eventHandlers.get(e);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t&&t.notify(...r)}hasListeners(e){return this.eventHandlers.has(e)}mount(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.root.hasTreeAnimated;if(this.instance)return;var r;this.isSVG=(r=e)instanceof SVGElement&&"svg"!==r.tagName,this.instance=e;const{layoutId:o,layout:i,visualElement:a}=this.options;if(a&&!a.current&&a.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(i||o)&&(this.isLayoutDirty=!0),t){let n;const r=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=performance.now(),r=o=>{let{timestamp:i}=o;const a=i-n;a>=t&&(Xc(r),e(a-t))};return Kc.read(r,!0),()=>Xc(r)}(r,250),km.hasAnimatedSinceResize&&(km.hasAnimatedSinceResize=!1,this.nodes.forEach(pg))})}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&a&&(o||i)&&this.addEventListener("didUpdate",e=>{let{delta:t,hasLayoutChanged:n,hasRelativeTargetChanged:r,layout:o}=e;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const i=this.options.transition||a.getDefaultTransition()||wg,{onLayoutAnimationStart:s,onLayoutAnimationComplete:l}=a.getProps(),c=!this.targetLayout||!Km(this.targetLayout,o)||r,d=!n&&r;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||d||n&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,d);const e=p(p({},Qp(i,"layout")),{},{onPlay:s,onComplete:l});(a.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else n||pg(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=o})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Xc(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(gg),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let o=0;o<this.path.length;o++){const e=this.path[o];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(dg);this.isUpdating||this.nodes.forEach(ug),this.isUpdating=!1,this.nodes.forEach(hg),this.nodes.forEach(ig),this.nodes.forEach(ag),this.clearAllSnapshots();const e=performance.now();Gc.delta=Yd(0,1e3/60,e-Gc.timestamp),Gc.timestamp=e,Gc.isProcessing=!0,Jc.update.process(Gc),Jc.preRender.process(Gc),Jc.render.process(Gc),Gc.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(cg),this.sharedNodes.forEach(vg)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Kc.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Kc.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),(!this.options.alwaysMeasureLayout||!this.isLead())&&!this.isLayoutDirty)return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let n=0;n<this.path.length;n++){this.path[n].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"measure",t=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&(this.scroll={animationId:this.root.animationId,phase:e,isRoot:o(this.instance),offset:r(this.instance)})}resetTransform(){if(!i)return;const e=this.isLayoutDirty||this.shouldResetTransform,t=this.projectionDelta&&!Ym(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,o=r!==this.prevTransformTemplateValue;e&&(t||im(this.latestValues)||o)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=this.measurePageBox();let n=this.removeElementScroll(t);var r;return e&&(n=this.removeTransform(n)),kg((r=n).x),kg(r.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const t=e.measureViewportBox(),{scroll:n}=this.root;return n&&(pm(t.x,n.offset.x),pm(t.y,n.offset.y)),t}removeElementScroll(e){const t={x:{min:0,max:0},y:{min:0,max:0}};Wm(t,e);for(let n=0;n<this.path.length;n++){const r=this.path[n],{scroll:o,options:i}=r;if(r!==this.root&&o&&i.layoutScroll){if(o.isRoot){Wm(t,e);const{scroll:n}=this.root;n&&(pm(t.x,-n.offset.x),pm(t.y,-n.offset.y))}pm(t.x,o.offset.x),pm(t.y,o.offset.y)}}return t}applyTransform(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={x:{min:0,max:0},y:{min:0,max:0}};Wm(n,e);for(let r=0;r<this.path.length;r++){const e=this.path[r];!t&&e.options.layoutScroll&&e.scroll&&e!==e.root&&vm(n,{x:-e.scroll.offset.x,y:-e.scroll.offset.y}),im(e.latestValues)&&vm(n,e.latestValues)}return im(this.latestValues)&&vm(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};Wm(t,e);for(let n=0;n<this.path.length;n++){const e=this.path[n];if(!e.instance)continue;if(!im(e.latestValues))continue;om(e.latestValues)&&e.updateSnapshot();const r=em();Wm(r,e.measurePageBox()),qm(t,e.latestValues,e.snapshot?e.snapshot.layoutBox:void 0,r)}return im(this.latestValues)&&qm(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options=p(p(p({},this.options),e),{},{crossfade:void 0===e.crossfade||e.crossfade})}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Gc.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var t;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(e||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget))return;const{layout:o,layoutId:i}=this.options;if(this.layout&&(o||i)){if(this.resolvedRelativeTargetAt=Gc.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Kf(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),Wm(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var a,s,l;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),a=this.target,s=this.relativeTarget,l=this.relativeParent.target,$f(a.x,s.x,l.x),$f(a.y,s.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Wm(this.target,this.layout.layoutBox),um(this.target,this.targetDelta)):Wm(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&Boolean(e.resumingFrom)===Boolean(this.resumingFrom)&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Kf(this.relativeTargetOrigin,this.target,e.target),Wm(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}rg.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!om(this.parent.latestValues)&&!am(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var e;const t=this.getLead(),n=Boolean(this.resumingFrom)||this!==t;let r=!0;if((this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===Gc.timestamp&&(r=!1),r)return;const{layout:o,layoutId:i}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!i)return;Wm(this.layoutCorrected,this.layout.layoutBox);const a=this.treeScale.x,s=this.treeScale.y;!function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=n.length;if(!o)return;let i,a;t.x=t.y=1;for(let s=0;s<o;s++){i=n[s],a=i.projectionDelta;const o=i.instance;o&&o.style&&"contents"===o.style.display||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&vm(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,um(e,a)),r&&im(i.latestValues)&&vm(e,i.latestValues))}t.x=hm(t.x),t.y=hm(t.y)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox);const{target:l}=t;if(!l)return void(this.projectionTransform&&(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionTransform="none",this.scheduleRender()));this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const c=this.projectionTransform;qf(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=Jm(this.projectionDelta,this.treeScale),this.projectionTransform===c&&this.treeScale.x===a&&this.treeScale.y===s||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),rg.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.options.scheduleRender&&this.options.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.snapshot,r=n?n.latestValues:{},o=p({},this.latestValues),i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const a={x:{min:0,max:0},y:{min:0,max:0}},s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,d=Boolean(s&&!c&&!0===this.options.crossfade&&!this.path.some(yg));let u;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,h;xg(i.x,e.x,n),xg(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Kf(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,n,r){bg(e.x,t.x,n.x,r),bg(e.y,t.y,n.y,r)}(this.relativeTarget,this.relativeTargetOrigin,a,n),u&&(l=this.relativeTarget,h=u,l.x.min===h.x.min&&l.x.max===h.x.max&&l.y.min===h.y.min&&l.y.max===h.y.max)&&(this.isProjectionDirty=!1),u||(u={x:{min:0,max:0},y:{min:0,max:0}}),Wm(u,this.relativeTarget)),s&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=Hh(0,void 0!==n.opacity?n.opacity:1,Im(r)),e.opacityExit=Hh(void 0!==t.opacity?t.opacity:1,0,Nm(r))):i&&(e.opacity=Hh(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let a=0;a<Pm;a++){const o="border".concat(Tm[a],"Radius");let i=Dm(t,o),s=Dm(n,o);void 0===i&&void 0===s||(i||(i=0),s||(s=0),0===i||0===s||Lm(i)===Lm(s)?(e[o]=Math.max(Hh(Om(i),Om(s),r),0),(ou.test(s)||ou.test(i))&&(e[o]+="%")):e[o]=s)}(t.rotate||n.rotate)&&(e.rotate=Hh(t.rotate||0,n.rotate||0,r))}(o,r,this.latestValues,n,d,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Xc(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Kc.update(()=>{km.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=Wd(e)?e:cf(e);return r.start(ef("",r,t,n)),r.animation}(0,1e3,p(p({},e),{},{onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}})),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&Cg(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Uf(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Uf(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Wm(t,n),vm(t,o),qf(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Gm);this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote(){let{needsReset:e,transition:t,preserveFollowOpacity:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(t=!0),!t)return;const r={};for(let o=0;o<eg.length;o++){const t="rotate"+eg[o];n[t]&&(r[t]=n[t],e.setStaticValue(t,0))}e.render();for(const o in r)e.setStaticValue(o,r[o]);e.scheduleRender()}getProjectionStyles(e){var t,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return tg;const r={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=Nu(null===e||void 0===e?void 0:e.pointerEvents)||"",r.transform=o?o(this.latestValues,""):"none",r;const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Nu(null===e||void 0===e?void 0:e.pointerEvents)||""),this.hasProjected&&!im(this.latestValues)&&(t.transform=o?o({},""):"none",this.hasProjected=!1),t}const a=i.animationValues||i.latestValues;this.applyTransformsToTarget(),r.transform=Jm(this.projectionDeltaWithTransform,this.treeScale,a),o&&(r.transform=o(a,r.transform));const{x:s,y:l}=this.projectionDelta;r.transformOrigin="".concat(100*s.origin,"% ").concat(100*l.origin,"% 0"),i.animationValues?r.opacity=i===this?null!==(n=null!==(t=a.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:r.opacity=i===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const c in Id){if(void 0===a[c])continue;const{correct:e,applyTo:t}=Id[c],n="none"===r.transform?a[c]:e(a[c],i);if(t){const e=t.length;for(let o=0;o<e;o++)r[t[o]]=n}else r[c]=n}return this.options.layoutId&&(r.pointerEvents=i===this?Nu(null===e||void 0===e?void 0:e.pointerEvents)||"":"none"),r}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(dg),this.root.sharedNodes.clear()}}}function ig(e){e.updateLayout()}function ag(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,i=n.source!==e.layout.source;"size"===o?tm(e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=Uf(r);r.min=t[e].min,r.max=r.min+o}):Cg(o,n.layoutBox,t)&&tm(r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],a=Uf(t[r]);o.max=o.min+a,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+a)});const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};qf(a,t,n.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};i?qf(s,e.applyTransform(r,!0),n.measuredBox):qf(s,t,n.layoutBox);const l=!Ym(a);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const a={x:{min:0,max:0},y:{min:0,max:0}};Kf(a,n.layoutBox,o.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};Kf(s,t,i.layoutBox),Km(a,s)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=a,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:s,layoutDelta:a,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function sg(e){rg.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function lg(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function cg(e){e.clearSnapshot()}function dg(e){e.clearMeasurements()}function ug(e){e.isLayoutDirty=!1}function hg(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function pg(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function fg(e){e.resolveTargetDelta()}function mg(e){e.calcProjection()}function gg(e){e.resetRotation()}function vg(e){e.removeLeadSnapshot()}function xg(e,t,n){e.translate=Hh(t.translate,0,n),e.scale=Hh(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function bg(e,t,n,r){e.min=Hh(t.min,n.min,r),e.max=Hh(t.max,n.max,r)}function yg(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const wg={duration:.45,ease:[.4,0,.1,1]},Sg=e=>"undefined"!==typeof navigator&&navigator.userAgent.toLowerCase().includes(e),jg=Sg("applewebkit/")&&!Sg("chrome/")?Math.round:qc;function kg(e){e.min=jg(e.min),e.max=jg(e.max)}function Cg(e,t,n){return"position"===e||"preserve-aspect"===e&&!Vf(Xm(t),Xm(n),.2)}const Eg=og({attachResizeListener:(e,t)=>Vu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),_g={current:void 0},zg=og({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_g.current){const e=new Eg({});e.mount(window),e.setOptions({layoutScroll:!0}),_g.current=e}return _g.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),Rg={pan:{Feature:class extends eh{constructor(){super(...arguments),this.removePointerDownListener=qc}onPointerDown(e){this.session=new Df(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:bm(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:jm(e),onStart:jm(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&Kc.update(()=>r(e,t))}}}mount(){this.removePointerDownListener=$u(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends eh{constructor(e){super(e),this.removeGroupControls=qc,this.removeListeners=qc,this.controls=new wm(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||qc}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:zg,MeasureLayout:Rm}};const Ag=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Tg(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;ad(n<=4,'Max CSS variable fallback depth detected in property "'.concat(e,'". This may indicate a circular fallback dependency.'));const[r,o]=function(e){const t=Ag.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const e=i.trim();return nf(e)?parseFloat(e):e}return qd(o)?Tg(o,t,n+1):o}function Pg(e,t,n){let r=Object.assign({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(t),t));const o=e.current;if(!(o instanceof Element))return{target:r,transitionEnd:n};n&&(n=p({},n)),e.values.forEach(e=>{const t=e.get();if(!qd(t))return;const n=Tg(t,o);n&&e.set(n)});for(const i in r){const e=r[i];if(!qd(e))continue;const t=Tg(e,o);t&&(r[i]=t,n||(n={}),void 0===n[i]&&(n[i]=e))}return{target:r,transitionEnd:n}}const Og=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Lg=e=>Og.has(e),Dg=e=>e===Kd||e===iu,Ig=(e,t)=>parseFloat(e.split(", ")[t]),Ng=(e,t)=>(n,r)=>{let{transform:o}=r;if("none"===o||!o)return 0;const i=o.match(/^matrix3d\((.+)\)$/);if(i)return Ig(i[1],t);{const t=o.match(/^matrix\((.+)\)$/);return t?Ig(t[1],e):0}},Mg=new Set(["x","y","z"]),Fg=Nd.filter(e=>!Mg.has(e));const Wg={width:(e,t)=>{let{x:n}=e,{paddingLeft:r="0",paddingRight:o="0"}=t;return n.max-n.min-parseFloat(r)-parseFloat(o)},height:(e,t)=>{let{y:n}=e,{paddingTop:r="0",paddingBottom:o="0"}=t;return n.max-n.min-parseFloat(r)-parseFloat(o)},top:(e,t)=>{let{top:n}=t;return parseFloat(n)},left:(e,t)=>{let{left:n}=t;return parseFloat(n)},bottom:(e,t)=>{let{y:n}=e,{top:r}=t;return parseFloat(r)+(n.max-n.min)},right:(e,t)=>{let{x:n}=e,{left:r}=t;return parseFloat(r)+(n.max-n.min)},x:Ng(4,13),y:Ng(5,14)};Wg.translateX=Wg.x,Wg.translateY=Wg.y;const Bg=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=p({},t),r=p({},r);const o=Object.keys(t).filter(Lg);let i=[],a=!1;const s=[];if(o.forEach(o=>{const l=e.getValue(o);if(!e.hasValue(o))return;let c=n[o],d=hf(c);const u=t[o];let h;if(Du(u)){const e=u.length,t=null===u[0]?1:0;c=u[t],d=hf(c);for(let n=t;n<e&&null!==u[n];n++)h?ad(hf(u[n])===h,"All keyframes must be of the same type"):(h=hf(u[n]),ad(h===d||Dg(d)&&Dg(h),"Keyframes must be of the same dimension as the current value"))}else h=hf(u);if(d!==h)if(Dg(d)&&Dg(h)){const e=l.get();"string"===typeof e&&l.set(parseFloat(e)),"string"===typeof u?t[o]=parseFloat(u):Array.isArray(u)&&h===iu&&(t[o]=u.map(parseFloat))}else(null===d||void 0===d?void 0:d.transform)&&(null===h||void 0===h?void 0:h.transform)&&(0===c||0===u)?0===c?l.set(h.transform(c)):t[o]=d.transform(u):(a||(i=function(e){const t=[];return Fg.forEach(n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}(e),a=!0),s.push(o),r[o]=void 0!==r[o]?r[o]:t[o],l.jump(u))}),s.length){const n=s.indexOf("height")>=0?window.pageYOffset:null,o=((e,t,n)=>{const r=t.measureViewportBox(),o=t.current,i=getComputedStyle(o),{display:a}=i,s={};"none"===a&&t.setStaticValue("display",e.display||"block"),n.forEach(e=>{s[e]=Wg[e](r,i)}),t.render();const l=t.measureViewportBox();return n.forEach(n=>{const r=t.getValue(n);r&&r.jump(s[n]),e[n]=Wg[n](l,i)}),e})(t,e,s);return i.length&&i.forEach(t=>{let[n,r]=t;e.getValue(n).set(r)}),e.render(),Uc&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:r}}return{target:t,transitionEnd:r}};function Ug(e,t,n,r){return(e=>Object.keys(e).some(Lg))(t)?Bg(e,t,n,r):{target:t,transitionEnd:r}}const Vg={current:null},Hg={current:!1};const qg=new WeakMap,$g=["willChange"],Yg=["children"],Kg=Object.keys(zd),Xg=Kg.length,Gg=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Jg=Sd.length;class Qg{constructor(e){let{parent:t,props:n,presenceContext:r,reducedMotionConfig:o,visualState:i}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Kc.render(this.render,!1,!0);const{latestValues:s,renderState:l}=i;this.latestValues=s,this.baseTarget=p({},s),this.initialValues=n.initial?p({},s):{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.isControllingVariants=jd(n),this.isVariantNode=kd(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const c=this.scrapeMotionValuesFromProps(n,{}),{willChange:d}=c,u=Ki(c,$g);for(const h in u){const e=u[h];void 0!==s[h]&&Wd(e)&&(e.set(s[h],!1),tf(d)&&d.add(h))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,qg.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),Hg.current||function(){if(Hg.current=!0,Uc)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Vg.current=e.matches;e.addListener(t),t()}else Vg.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Vg.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){qg.delete(this.current),this.projection&&this.projection.unmount(),Xc(this.notifyUpdate),Xc(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){const n=Md.has(e),r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&Kc.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),o=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{r(),o()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}loadFeatures(e,t,n,r){let o,i,{children:a}=e,s=Ki(e,Yg);for(let l=0;l<Xg;l++){const e=Kg[l],{isEnabled:t,Feature:n,ProjectionNode:r,MeasureLayout:a}=zd[e];r&&(o=r),t(s)&&(!this.features[e]&&n&&(this.features[e]=new n(this)),a&&(i=a))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&o){this.projection=new o(this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:t,drag:n,dragConstraints:i,layoutScroll:a,layoutRoot:l}=s;this.projection.setOptions({layoutId:e,layout:t,alwaysMeasureLayout:Boolean(n)||i&&xd(i),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"===typeof t?t:"both",initialPromotionConfig:r,layoutScroll:a,layoutRoot:l})}return i}updateFeatures(){for(const e in this.features){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.makeTargetAnimatableFromInstance(e,this.props,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let n=0;n<Gg.length;n++){const t=Gg[n];this.propEventSubscriptions[t]&&(this.propEventSubscriptions[t](),delete this.propEventSubscriptions[t]);const r=e["on"+t];r&&(this.propEventSubscriptions[t]=this.on(t,r))}this.prevMotionValues=function(e,t,n){const{willChange:r}=t;for(const o in t){const i=t[o],a=n[o];if(Wd(i))e.addValue(o,i),tf(r)&&r.add(o);else if(Wd(a))e.addValue(o,cf(i,{owner:e})),tf(r)&&r.remove(o);else if(a!==i)if(e.hasValue(o)){const t=e.getValue(o);!t.hasAnimated&&t.set(i)}else{const t=e.getStaticValue(o);e.addValue(o,cf(void 0!==t?t:i,{owner:e}))}}for(const o in n)void 0===t[o]&&e.removeValue(o);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0])return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const e=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(e.initial=this.props.initial),e}const e={};for(let t=0;t<Jg;t++){const n=Sd[t],r=this.props[n];(bd(r)||!1===r)&&(e[n]=r)}return e}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=cf(t,{owner:this}),this.addValue(e,n)),n}readValue(e){var t;return void 0===this.latestValues[e]&&this.current?null!==(t=this.getBaseTargetFromProps(this.props,e))&&void 0!==t?t:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e]}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props,r="string"===typeof n||"object"===typeof n?null===(t=Lu(this.props,n))||void 0===t?void 0:t[e]:void 0;if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||Wd(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new af),this.events[e].add(t)}notify(e){if(this.events[e]){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.events[e].notify(...n)}}}const Zg=["transition","transitionEnd"];class ev extends Qg{sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,t){let{vars:n,style:r}=t;delete n[e],delete r[e]}makeTargetAnimatableFromInstance(e,t,n){let{transition:r,transitionEnd:o}=e,i=Ki(e,Zg),{transformValues:a}=t,s=function(e,t,n){const r={};for(const o in e){const e=xf(o,t);if(void 0!==e)r[o]=e;else{const e=n.getValue(o);e&&(r[o]=e.get())}}return r}(i,r||{},this);if(a&&(o&&(o=a(o)),i&&(i=a(i)),s&&(s=a(s))),n){!function(e,t,n){var r,o;const i=Object.keys(t).filter(t=>!e.hasValue(t)),a=i.length;if(a)for(let s=0;s<a;s++){const a=i[s],l=t[a];let c=null;Array.isArray(l)&&(c=l[0]),null===c&&(c=null!==(o=null!==(r=n[a])&&void 0!==r?r:e.readValue(a))&&void 0!==o?o:t[a]),void 0!==c&&null!==c&&("string"===typeof c&&(nf(c)||Xp(c))?c=parseFloat(c):!ff(c)&&op.test(l)&&(c=Kp(a,l)),e.addValue(a,cf(c,{owner:e})),void 0===n[a]&&(n[a]=c),null!==c&&e.setBaseTarget(a,c))}}(this,i,s);const e=((e,t,n,r)=>{const o=Pg(e,t,r);return Ug(e,t=o.target,n,r=o.transitionEnd)})(this,i,s,o);o=e.transitionEnd,i=e.target}return p({transition:r,transitionEnd:o},i)}}class tv extends ev{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,t){if(Md.has(t)){const e=Yp(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=(Hd(t)?r.getPropertyValue(t):r[t])||0;return"string"===typeof o?o.trim():o}var n}measureInstanceViewportBox(e,t){let{transformPagePoint:n}=t;return xm(e,n)}build(e,t,n,r){uu(e,t,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,t){return Pu(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Wd(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent="".concat(e))}))}renderInstance(e,t,n,r){Ru(e,t,n,r)}}class nv extends ev{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Md.has(t)){const e=Yp(t);return e&&e.default||0}return t=Au.has(t)?t:gd(t),e.getAttribute(t)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(e,t){return Ou(e,t)}build(e,t,n,r){ku(e,t,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,n,r){Tu(e,t,0,r)}mount(e){this.isSVGTag=Eu(e.tagName),super.mount(e)}}const rv=(e,t)=>Dd(e)?new nv(t,{enableHardwareAcceleration:!1}):new tv(t,{enableHardwareAcceleration:!0}),ov={layout:{ProjectionNode:zg,MeasureLayout:Rm}};const iv=p(p(p(p({},Of),uh),Rg),ov),av=Od((e,t)=>function(e,t,n,r){let{forwardMotionProps:o=!1}=t;return p(p({},Dd(e)?Bu:Uu),{},{preloadedFeatures:n,useRender:zu(o),createVisualElement:r,Component:e})}(e,t,iv,rv));const sv=(e,t)=>e.find(e=>e.id===t);function lv(e,t){const n=cv(e,t);return{position:n,index:n?e[n].findIndex(e=>e.id===t):-1}}function cv(e,t){for(const[n,r]of Object.entries(e))if(sv(r,t))return n}function dv(e){return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:"top"===e||"bottom"===e?"0 auto":void 0,top:e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,bottom:e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,right:e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",left:e.includes("right")?void 0:"env(safe-area-inset-left, 0px)"}}function uv(e){const t=Object.assign({},e);for(let n in t)void 0===t[n]&&delete t[n];return t}var hv=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,pv=is(function(e){return hv.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),fv=function(e){return"theme"!==e},mv=function(e){return"string"===typeof e&&e.charCodeAt(0)>96?pv:fv},gv=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!==typeof r&&n&&(r=e.__emotion_forwardProp),r},vv=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return ns(t,n,r),vs(function(){return rs(t,n,r)}),null},xv=function e(n,r){var o,i,a=n.__emotion_real===n,s=a&&n.__emotion_base||n;void 0!==r&&(o=r.label,i=r.target);var l=gv(n,r,a),c=l||mv(s),d=!c("as");return function(){var u=arguments,h=a&&void 0!==n.__emotion_styles?n.__emotion_styles.slice(0):[];if(void 0!==o&&h.push("label:"+o+";"),null==u[0]||void 0===u[0].raw)h.push.apply(h,u);else{var p=u[0];h.push(p[0]);for(var f=u.length,m=1;m<f;m++)h.push(u[m],p[m])}var g=ys(function(e,n,r){var o=d&&e.as||s,a="",u=[],p=e;if(null==e.theme){for(var f in p={},e)p[f]=e[f];p.theme=t.useContext(ws)}"string"===typeof e.className?a=ts(n.registered,u,e.className):null!=e.className&&(a=e.className+" ");var m=ms(h.concat(u),n.registered,p);a+=n.key+"-"+m.name,void 0!==i&&(a+=" "+i);var g=d&&void 0===l?mv(o):c,v={};for(var x in e)d&&"as"===x||g(x)&&(v[x]=e[x]);return v.className=a,r&&(v.ref=r),t.createElement(t.Fragment,null,t.createElement(vv,{cache:n,serialized:m,isStringTag:"string"===typeof o}),t.createElement(o,v))});return g.displayName=void 0!==o?o:"Styled("+("string"===typeof s?s:s.displayName||s.name||"Component")+")",g.defaultProps=n.defaultProps,g.__emotion_real=g,g.__emotion_base=s,g.__emotion_styles=h,g.__emotion_forwardProp=l,Object.defineProperty(g,"toString",{value:function(){return"."+i}}),g.withComponent=function(t,n){return e(t,Za({},r,n,{shouldForwardProp:gv(g,n,!0)})).apply(void 0,h)},g}}.bind(null);["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){xv[e]=xv(e)});const bv=new Set([...Sc,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),yv=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function wv(e){return(yv.has(e)||!bv.has(e))&&"_"!==e[0]}const Sv=["theme","css","__css","sx"],jv=["baseStyle"],kv=["children"],Cv=(Ev=xv).default||Ev;var Ev;const _v=e=>{let{baseStyle:t}=e;return e=>{const{theme:n,css:r,__css:o,sx:i}=e,a=Ki(e,Sv),[s]=function(e){const t=Object.getOwnPropertyDescriptors(e),n=Object.keys(t),r=e=>{const n={};for(let r=0;r<e.length;r++){const o=e[r];t[o]&&(Object.defineProperty(n,o,t[o]),delete t[o])}return n};for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return i.map(e=>r(Array.isArray(e)?e:n.filter(e))).concat(r(n))}(a,kc),l=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");const t=p({},e);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(const i of r)if(null!=i)for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in t&&delete t[e],t[e]=i[e]);return t}({},o,Pl(t,e),uv(s),i),c=zc(l)(e.theme);return r?[c,r]:c}};function zv(e,n){const r=null!==n&&void 0!==n?n:{},{baseStyle:o}=r,i=Ki(r,jv);i.shouldForwardProp||(i.shouldForwardProp=wv);const a=_v({baseStyle:o}),s=Cv(e,i)(a);return(0,t.forwardRef)(function(e,n){const{children:r}=e,o=Ki(e,kv),{colorMode:i,forced:a}=As(),l=a?i:void 0;return(0,t.createElement)(s,p({ref:n,"data-theme":l},o),r)})}const Rv=function(){const e=new Map;return new Proxy(zv,{apply:(e,t,n)=>zv(...n),get:(t,n)=>(e.has(n)||e.set(n,zv(n)),e.get(n))})}(),Av={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return"bottom"===t&&(r=1),{opacity:0,[n]:24*r}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},Tv=(0,t.memo)(e=>{const{id:n,message:r,onCloseComplete:o,onRequestRemove:a,requestClose:s=!1,position:l="bottom",duration:c=5e3,containerStyle:d,motionVariants:u=Av,toastSpacing:h="0.5rem"}=e,[f,m]=(0,t.useState)(c),g=hd();cd(()=>{g||null===o||void 0===o||o()},[g]),cd(()=>{m(c)},[c]);const v=()=>{g&&a()};(0,t.useEffect)(()=>{g&&s&&a()},[g,s,a]),function(e,n){const r=dd(e);(0,t.useEffect)(()=>{if(null==n)return;let e=null;return e=window.setTimeout(()=>{r()},n),()=>{e&&window.clearTimeout(e)}},[n,r])}(v,f);const x=(0,t.useMemo)(()=>p({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:h},d),[d,h]),b=(0,t.useMemo)(()=>function(e){let t="center";return e.includes("right")&&(t="flex-end"),e.includes("left")&&(t="flex-start"),{display:"flex",flexDirection:"column",alignItems:t}}(l),[l]);return(0,i.jsx)(av.div,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:()=>m(null),onHoverEnd:()=>m(c),custom:{position:l},style:b,children:(0,i.jsx)(Rv.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:x,children:Pl(r,{id:n,onClose:v})})})});function Pv(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Ov(e){return Pv(e,["styleConfig","size","variant","colorScheme"])}Tv.displayName="ToastComponent";const Lv=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")};function Dv(e){return(0,t.forwardRef)(e)}function Iv(e,t){for(let n=t+1;n<e.length;n++)if(null!=e[n])return n;return-1}function Nv(e){const t=e.__breakpoints;return function(e,n,r,o){if(!t)return;const i={},a=function(e,t){return Array.isArray(e)?e:Bn(e)?t(e):null!=e?[e]:void 0}(r,t.toArrayValue);if(!a)return i;const s=a.length,l=1===s,c=!!e.parts;for(let h=0;h<s;h++){var d;const r=t.details[h],s=t.details[Iv(a,h)],p=al(r.minW,null===s||void 0===s?void 0:s._minW),f=Pl(null===(d=e[n])||void 0===d?void 0:d[a[h]],o);var u;if(f)if(c)null===(u=e.parts)||void 0===u||u.forEach(e=>{ll(i,{[e]:l?f[e]:{[p]:f[e]}})});else c?i[p]=f:l?ll(i,f):i[p]=f}return i}}var Mv=n(901);function Fv(){const e=(0,t.useContext)(ws);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `<ChakraProvider />` or `<ThemeProvider />`");return e}function Wv(){const e=As(),t=Fv();return p(p({},e),{},{theme:t})}function Bv(e,t,n){const r=Array.isArray(t)?t:[t],o=Array.isArray(n)?n:[n];return n=>{const i=o.filter(Boolean),a=r.map((t,r)=>{var o,a;if("breakpoints"===e)return function(e,t,n){var r,o;if(null==t)return t;const i=t=>{var n;return null===(n=e.__breakpoints)||void 0===n||null===(n=n.asArray)||void 0===n?void 0:n[t]};return null!==(r=null!==(o=i(t))&&void 0!==o?o:i(n))&&void 0!==r?r:n}(n,t,null!==(a=i[r])&&void 0!==a?a:t);const s="".concat(e,".").concat(t);return function(e,t,n){var r,o;if(null==t)return t;const i=t=>{var n;return null===(n=e.__cssMap)||void 0===n||null===(n=n[t])||void 0===n?void 0:n.value};return null!==(r=null!==(o=i(t))&&void 0!==o?o:i(n))&&void 0!==r?r:n}(n,s,null!==(o=i[r])&&void 0!==o?o:t)});return Array.isArray(t)?a:a[0]}}const Uv=["styleConfig"];function Vv(e){var n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{styleConfig:o}=r,i=Ki(r,Uv),{theme:a,colorMode:s}=Wv(),l=e?Ac(a,"components.".concat(e)):void 0,c=o||l,d=ll({theme:a,colorMode:s},null!==(n=null===c||void 0===c?void 0:c.defaultProps)&&void 0!==n?n:{},function(e){return Object.fromEntries(Object.entries(e).filter(e=>{let[n,r]=e;return void 0!==r&&"children"!==n&&!(0,t.isValidElement)(r)}))}(i),(e,t)=>e?void 0:t),u=(0,t.useRef)({});if(c){const e=function(e){return t=>{var n;const{variant:r,size:o,theme:i}=t,a=Nv(i);return ll({},Pl(null!==(n=e.baseStyle)&&void 0!==n?n:{},t),a(e,"sizes",o,t),a(e,"variants",r,t))}}(c),t=e(d);Mv(u.current,t)||(u.current=t)}return u.current}function Hv(e){return Vv(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}function qv(e){return Vv(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}const $v=["as","viewBox","color","focusable","children","className","__css"],Yv={path:(0,i.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",children:[(0,i.jsx)("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),(0,i.jsx)("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),(0,i.jsx)("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Kv=Dv((e,t)=>{const{as:n,viewBox:r,color:o="currentColor",focusable:a=!1,children:s,className:l,__css:c}=e,d=Ki(e,$v),u=Lv("chakra-icon",l),h=Hv("Icon",e),f={ref:t,focusable:a,className:u,__css:p(p({w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:o},c),h)},m=null!==r&&void 0!==r?r:Yv.viewBox;if(n&&"string"!==typeof n)return(0,i.jsx)(Rv.svg,p(p({as:n},f),d));const g=null!==s&&void 0!==s?s:Yv.path;return(0,i.jsx)(Rv.svg,p(p(p({verticalAlign:"middle",viewBox:m},f),d),{},{children:g}))});function Xv(e){return(0,i.jsx)(Kv,p(p({viewBox:"0 0 24 24"},e),{},{children:(0,i.jsx)("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})}))}Kv.displayName="Icon";const Gv=["label","thickness","speed","emptyColor","className"],Jv=Ys({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),Qv=Dv((e,t)=>{const n=Hv("Spinner",e),r=Ov(e),{label:o="Loading...",thickness:a="2px",speed:s="0.45s",emptyColor:l="transparent",className:c}=r,d=Ki(r,Gv),u=Lv("chakra-spinner",c),h=p({display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:a,borderBottomColor:l,borderLeftColor:l,animation:"".concat(Jv," ").concat(s," linear infinite")},n);return(0,i.jsx)(Rv.div,p(p({ref:t,__css:h,className:u},d),{},{children:o&&(0,i.jsx)(Rv.span,{srOnly:!0,children:o})}))});Qv.displayName="Spinner";const[Zv,ex]=Rc({name:"AlertContext",hookName:"useAlertContext",providerName:"<Alert />"}),[tx,nx]=Rc({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:"<Alert />"}),rx={info:{icon:function(e){return(0,i.jsx)(Kv,p(p({viewBox:"0 0 24 24"},e),{},{children:(0,i.jsx)("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})}))},colorScheme:"blue"},warning:{icon:Xv,colorScheme:"orange"},success:{icon:function(e){return(0,i.jsx)(Kv,p(p({viewBox:"0 0 24 24"},e),{},{children:(0,i.jsx)("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})}))},colorScheme:"green"},error:{icon:Xv,colorScheme:"red"},loading:{icon:Qv,colorScheme:"blue"}};const ox=["status","addRole"],ix=Dv(function(e,t){var n;const r=Ov(e),{status:o="info",addRole:a=!0}=r,s=Ki(r,ox),l=null!==(n=e.colorScheme)&&void 0!==n?n:function(e){return rx[e].colorScheme}(o),c=qv("Alert",p(p({},e),{},{colorScheme:l})),d=p({width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden"},c.container);return(0,i.jsx)(Zv,{value:{status:o},children:(0,i.jsx)(tx,{value:c,children:(0,i.jsx)(Rv.div,p(p({"data-status":o,role:a?"alert":void 0,ref:t},s),{},{className:Lv("chakra-alert",e.className),__css:d}))})})});function ax(e){const{status:t}=ex(),n=function(e){return rx[e].icon}(t),r=nx(),o="loading"===t?r.spinner:r.icon;return(0,i.jsx)(Rv.span,p(p({display:"inherit","data-status":t},e),{},{className:Lv("chakra-alert__icon",e.className),__css:o,children:e.children||(0,i.jsx)(n,{h:"100%",w:"100%"})}))}ix.displayName="Alert",ax.displayName="AlertIcon";const sx=Dv(function(e,t){const n=nx(),{status:r}=ex();return(0,i.jsx)(Rv.div,p(p({ref:t,"data-status":r},e),{},{className:Lv("chakra-alert__title",e.className),__css:n.title}))});sx.displayName="AlertTitle";const lx=Dv(function(e,t){const{status:n}=ex(),r=p({display:"inline"},nx().description);return(0,i.jsx)(Rv.div,p(p({ref:t,"data-status":n},e),{},{className:Lv("chakra-alert__desc",e.className),__css:r}))});lx.displayName="AlertDescription";const cx=["children","isDisabled","__css"];function dx(e){return(0,i.jsx)(Kv,p(p({focusable:"false","aria-hidden":!0},e),{},{children:(0,i.jsx)("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})}))}const ux=Dv(function(e,t){const n=Hv("CloseButton",e),r=Ov(e),{children:o,isDisabled:a,__css:s}=r,l=Ki(r,cx);return(0,i.jsx)(Rv.button,p(p({type:"button","aria-label":"Close",ref:t,disabled:a,__css:p(p(p({},{outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}),n),s)},l),{},{children:o||(0,i.jsx)(dx,{width:"1em",height:"1em"})}))});ux.displayName="CloseButton";const hx=e=>{const{status:t,variant:n="solid",id:r,title:o,isClosable:a,onClose:s,description:l,colorScheme:c,icon:d}=e,u=r?{root:"toast-".concat(r),title:"toast-".concat(r,"-title"),description:"toast-".concat(r,"-description")}:void 0;return(0,i.jsxs)(ix,{addRole:!1,status:t,variant:n,id:null===u||void 0===u?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:c,children:[(0,i.jsx)(ax,{children:d}),(0,i.jsxs)(Rv.div,{flex:"1",maxWidth:"100%",children:[o&&(0,i.jsx)(sx,{id:null===u||void 0===u?void 0:u.title,children:o}),l&&(0,i.jsx)(lx,{id:null===u||void 0===u?void 0:u.description,display:"block",children:l})]}),a&&(0,i.jsx)(ux,{size:"sm",onClick:s,position:"absolute",insetEnd:1,top:1})]})};function px(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{render:t,toastComponent:n=hx}=e;return r=>"function"===typeof t?t(p(p({},r),e)):(0,i.jsx)(n,p(p({},r),e))}const fx=function(e){let t=e;const n=new Set,r=e=>{t=e(t),n.forEach(e=>e())};return{getState:()=>t,subscribe:t=>(n.add(t),()=>{r(()=>e),n.delete(t)}),removeToast:(e,t)=>{r(n=>p(p({},n),{},{[t]:n[t].filter(t=>t.id!=e)}))},notify:(e,t)=>{const n=function(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};mx+=1;const o=null!==(t=r.id)&&void 0!==t?t:mx,i=null!==(n=r.position)&&void 0!==n?n:"bottom";return{id:o,message:e,position:i,duration:r.duration,onCloseComplete:r.onCloseComplete,onRequestRemove:()=>fx.removeToast(String(o),i),status:r.status,requestClose:!1,containerStyle:r.containerStyle}}(e,t),{position:o,id:i}=n;return r(e=>{var t,r;const i=o.includes("top")?[n,...null!==(t=e[o])&&void 0!==t?t:[]]:[...null!==(r=e[o])&&void 0!==r?r:[],n];return p(p({},e),{},{[o]:i})}),i},update:(e,t)=>{e&&r(n=>{const r=p({},n),{position:o,index:i}=lv(r,e);return o&&-1!==i&&(r[o][i]=p(p(p({},r[o][i]),t),{},{message:px(t)})),r})},closeAll:function(){let{positions:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(t=>(null!==e&&void 0!==e?e:["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((e,n)=>(e[n]=t[n].map(e=>p(p({},e),{},{requestClose:!0})),e),p({},t)))},close:e=>{r(t=>{const n=cv(t,e);return n?p(p({},t),{},{[n]:t[n].map(t=>t.id==e?p(p({},t),{},{requestClose:!0}):t)}):t})},isActive:e=>Boolean(lv(fx.getState(),e).position)}}({top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]});let mx=0;const gx=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?t.useLayoutEffect:t.useEffect;var vx=n(119);const xx=["containerRef"],[bx,yx]=Rc({strict:!1,name:"PortalContext"}),wx="chakra-portal",Sx=e=>(0,i.jsx)("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),jx=e=>{const{appendToParentPortal:n,children:r}=e,[o,a]=(0,t.useState)(null),s=(0,t.useRef)(null),[,l]=(0,t.useState)({});(0,t.useEffect)(()=>l({}),[]);const c=yx(),d=Nc();gx(()=>{if(!o)return;const e=o.ownerDocument,t=n&&null!==c&&void 0!==c?c:e.body;if(!t)return;s.current=e.createElement("div"),s.current.className=wx,t.appendChild(s.current),l({});const r=s.current;return()=>{t.contains(r)&&t.removeChild(r)}},[o]);const u=null!==d&&void 0!==d&&d.zIndex?(0,i.jsx)(Sx,{zIndex:null===d||void 0===d?void 0:d.zIndex,children:r}):r;return s.current?(0,vx.createPortal)((0,i.jsx)(bx,{value:s.current,children:u}),s.current):(0,i.jsx)("span",{ref:e=>{e&&a(e)}})},kx=e=>{const{children:n,containerRef:r,appendToParentPortal:o}=e,a=r.current,s=null!==a&&void 0!==a?a:"undefined"!==typeof window?document.body:void 0,l=(0,t.useMemo)(()=>{const e=null===a||void 0===a?void 0:a.ownerDocument.createElement("div");return e&&(e.className=wx),e},[a]),[,c]=(0,t.useState)({});return gx(()=>c({}),[]),gx(()=>{if(l&&s)return s.appendChild(l),()=>{s.removeChild(l)}},[l,s]),s&&l?(0,vx.createPortal)((0,i.jsx)(bx,{value:o?l:null,children:n}),l):null};function Cx(e){const t=p({appendToParentPortal:!0},e),{containerRef:n}=t,r=Ki(t,xx);return n?(0,i.jsx)(kx,p({containerRef:n},r)):(0,i.jsx)(jx,p({},r))}Cx.className=wx,Cx.selector=".chakra-portal",Cx.displayName="Portal";const[Ex,_x]=Rc({name:"ToastOptionsContext",strict:!1}),zx=e=>{const n=(0,t.useSyncExternalStore)(fx.subscribe,fx.getState,fx.getState),{motionVariants:r,component:o=Tv,portalProps:a,animatePresenceProps:s}=e,l=Object.keys(n).map(e=>{const t=n[e];return(0,i.jsx)("div",{role:"region","aria-live":"polite","aria-label":"Notifications-".concat(e),id:"chakra-toast-manager-".concat(e),style:dv(e),children:(0,i.jsx)(ld,p(p({},s),{},{initial:!1,children:t.map(e=>(0,i.jsx)(o,p({motionVariants:r},e),e.id))}))},e)});return(0,i.jsx)(Cx,p(p({},a),{},{children:l}))},Rx=["children","theme","toastOptions"],Ax=(Tx=qi,function(e){let{children:t,theme:n=Tx,toastOptions:r}=e,o=Ki(e,Rx);return(0,i.jsxs)(Bc,p(p({theme:n},o),{},{children:[(0,i.jsx)(Ex,{value:null===r||void 0===r?void 0:r.defaultOptions,children:t}),(0,i.jsx)(zx,p({},r))]}))});var Tx;const Px=["sri"],Ox=["page"],Lx=["page","matches"],Dx=["page","matches"],Ix=["onClick","discover","prefetch","relative","reloadDocument","replace","mask","state","target","to","preventScrollReset","viewTransition","defaultShouldRevalidate"],Nx=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Mx=["discover","fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition","defaultShouldRevalidate"];var Fx=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Wx=/^[\\/]{2}/;function Bx(e,t){return t+e.replace(/\\/g,"/")}var Ux="popstate";function Vx(e){return"object"===typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Hx(){return Jx(function(e,t){var n;let r=null===(n=t.state)||void 0===n?void 0:n.masked,{pathname:o,search:i,hash:a}=r||e.location;return Kx("",{pathname:o,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default",r?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)},function(e,t){return"string"===typeof t?t:Xx(t)},null,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}function qx(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function $x(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function Yx(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Kx(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return p(p({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?Gx(t):t),{},{state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10),mask:o})}function Xx(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function Gx(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Jx(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,s="POP",l=null,c=d();function d(){return(a.state||{idx:null}).idx}function u(){s="POP";let e=d(),t=null==e?null:e-c;c=e,l&&l({action:s,location:f.location,delta:t})}function h(e){return Qx(o,e)}null==c&&(c=0,a.replaceState(p(p({},a.state),{},{idx:c}),""));let f={get action(){return s},get location(){return e(o,a)},listen(e){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(Ux,u),l=e,()=>{o.removeEventListener(Ux,u),l=null}},createHref:e=>t(o,e),createURL:h,encodeLocation(e){let t=h(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s="PUSH";let r=Vx(e)?e:Kx(f.location,e,t);n&&n(r,e),c=d()+1;let u=Yx(r,c),h=f.createHref(r.mask||r);try{a.pushState(u,"",h)}catch(p){if(p instanceof DOMException&&"DataCloneError"===p.name)throw p;o.location.assign(h)}i&&l&&l({action:s,location:f.location,delta:1})},replace:function(e,t){s="REPLACE";let r=Vx(e)?e:Kx(f.location,e,t);n&&n(r,e),c=d();let o=Yx(r,c),u=f.createHref(r.mask||r);a.replaceState(o,"",u),i&&l&&l({action:s,location:f.location,delta:0})},go:e=>a.go(e)};return f}function Qx(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r="http://localhost";e&&(r="null"!==e.location.origin?e.location.origin:e.location.href),qx(r,"No window.location.(origin|href) available to create URL");let o="string"===typeof t?t:Xx(t);return o=o.replace(/ $/,"%20"),!n&&Wx.test(o)&&(o=r+o),new URL(o,r)}new WeakMap;function Zx(e,t){return eb(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/",!1)}function eb(e,t,n,r,o){let i=vb(("string"===typeof t?Gx(t):t).pathname||"/",n);if(null==i)return null;let a=null!==o&&void 0!==o?o:tb(e),s=null,l=gb(i);for(let c=0;null==s&&c<a.length;++c)s=hb(a[c],l,r);return s}function tb(e){let t=nb(e);return function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n]);return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(t),t}function nb(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=function(e,i){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,s=arguments.length>3?arguments[3]:void 0,l={relativePath:void 0===s?e.path||"":s,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};if(l.relativePath.startsWith("/")){if(!l.relativePath.startsWith(r)&&a)return;qx(l.relativePath.startsWith(r),'Absolute route path "'.concat(l.relativePath,'" nested under path "').concat(r,'" is not valid. An absolute child route path must start with the combined path of all its parent routes.')),l.relativePath=l.relativePath.slice(r.length)}let c=kb([r,l.relativePath]),d=n.concat(l);e.children&&e.children.length>0&&(qx(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'.concat(c,'".')),nb(e.children,t,d,c,a)),(null!=e.path||e.index)&&t.push({path:c,score:ub(c,e.index),routesMeta:d.map((e,t)=>{let[n,r]=mb(e.relativePath,e.caseSensitive,t===d.length-1);return p(p({},e),{},{matcher:n,compiledParams:r})})})};return e.forEach((e,t)=>{var n;if(""!==e.path&&null!==(n=e.path)&&void 0!==n&&n.includes("?"))for(let r of rb(e.path))i(e,t,!0,r);else i(e,t)}),t}function rb(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===r.length)return o?[i,""]:[i];let a=rb(r.join("/")),s=[];return s.push(...a.map(e=>""===e?i:[i,e].join("/"))),o&&s.push(...a),s.map(t=>e.startsWith("/")&&""===t?"/":t)}var ob=/^:[\w-]+$/,ib=3,ab=2,sb=1,lb=10,cb=-2,db=e=>"*"===e;function ub(e,t){let n=e.split("/"),r=n.length;return n.some(db)&&(r+=cb),t&&(r+=ab),n.filter(e=>!db(e)).reduce((e,t)=>e+(ob.test(t)?ib:""===t?sb:lb),r)}function hb(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],{routesMeta:r}=e,o={},i="/",a=[];for(let s=0;s<r.length;++s){let e=r[s],l=s===r.length-1,c="/"===i?t:t.slice(i.length)||"/",d={path:e.relativePath,caseSensitive:e.caseSensitive,end:l},u=e.matcher&&e.compiledParams?fb(d,c,e.matcher,e.compiledParams):pb(d,c),h=e.route;if(!u&&l&&n&&!r[r.length-1].route.index&&(u=pb({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;Object.assign(o,u.params),a.push({params:o,pathname:kb([i,u.pathname]),pathnameBase:Eb(kb([i,u.pathnameBase])),route:h}),"/"!==u.pathnameBase&&(i=kb([i,u.pathnameBase]))}return a}function pb(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=mb(e.path,e.caseSensitive,e.end);return fb(e,t,n,r)}function fb(e,t,n,r){let o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:o}=t;if("*"===r){let e=s[n]||"";a=i.slice(0,i.length-e.length).replace(/(.)\/+$/,"$1")}const l=s[n];return e[r]=o&&!l?void 0:(l||"").replace(/%2F/g,"/"),e},{}),pathname:i,pathnameBase:a,pattern:e}}function mb(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];$x("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'.concat(e,'" will be treated as if it were "').concat(e.replace(/\*$/,"/*"),'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "').concat(e.replace(/\*$/,"/*"),'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n,o,i)=>{if(r.push({paramName:t,isOptional:null!=n}),n){let t=i.charAt(o+e.length);return t&&"/"!==t?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function gb(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return $x(!1,'The URL path "'.concat(e,'" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (').concat(t,").")),e}}function vb(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function xb(e,t){let n=Cb(t).split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function bb(e,t,n,r){return"Cannot include a '".concat(e,"' character in a manually specified `to.").concat(t,"` field [").concat(JSON.stringify(r),"]. Please separate it out to the `to.").concat(n,'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.')}function yb(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function wb(e){let t=yb(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Sb(e,t,n){let r,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];"string"===typeof e?r=Gx(e):(r=p({},e),qx(!r.pathname||!r.pathname.includes("?"),bb("?","pathname","search",r)),qx(!r.pathname||!r.pathname.includes("#"),bb("#","pathname","hash",r)),qx(!r.search||!r.search.includes("#"),bb("#","search","hash",r)));let i,a=""===e||""===r.pathname,s=a?"/":r.pathname;if(null==s)i=n;else{let e=t.length-1;if(!o&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}i=e>=0?t[e]:"/"}let l=function(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",{pathname:r,search:o="",hash:i=""}="string"===typeof e?Gx(e):e;return r?(r=jb(r),t=r.startsWith("/")?xb(r.substring(1),"/"):xb(r,n)):t=n,{pathname:t,search:_b(o),hash:zb(i)}}(r,i),c=s&&"/"!==s&&s.endsWith("/"),d=(a||"."===s)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!d||(l.pathname+="/"),l}var jb=e=>e.replace(/[\\/]{2,}/g,"/"),kb=e=>jb(e.join("/")),Cb=e=>e.replace(/\/+$/,""),Eb=e=>Cb(e).replace(/^\/*/,"/"),_b=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",zb=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var Rb=class{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ab(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}function Tb(e){let t=e.map(e=>e.route.path).filter(Boolean);return kb(t)||"/"}var Pb="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement;function Ob(e,t){let n=e;if("string"!==typeof n||!Fx.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,o=!1;if(Pb)try{let e=new URL(window.location.href),r=Wx.test(n)?new URL(Bx(n,e.protocol)):new URL(n),i=vb(r.pathname,t);r.origin===e.origin&&null!=i?n=i+r.search+r.hash:o=!0}catch(i){$x(!1,'<Link to="'.concat(n,'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.'))}return{absoluteURL:r,isExternal:o,to:n}}Symbol("Uninstrumented");Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Lb=["POST","PUT","PATCH","DELETE"],Db=(new Set(Lb),["GET",...Lb]);new Set(Db),Symbol("ResetLoaderData");new WeakMap,new WeakMap,new WeakMap,new WeakMap;var Ib=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Nb(e){try{return Ib.includes(new URL(e).protocol)}catch(t){return!1}}var Mb=t.createContext(null);Mb.displayName="DataRouter";var Fb=t.createContext(null);Fb.displayName="DataRouterState";var Wb=t.createContext(!1);function Bb(){return t.useContext(Wb)}var Ub=t.createContext({isTransitioning:!1});Ub.displayName="ViewTransition";var Vb=t.createContext(new Map);Vb.displayName="Fetchers";var Hb=t.createContext(null);Hb.displayName="Await";var qb=t.createContext(null);qb.displayName="Navigation";var $b=t.createContext(null);$b.displayName="Location";var Yb=t.createContext({outlet:null,matches:[],isDataRoute:!1});Yb.displayName="Route";var Kb=t.createContext(null);Kb.displayName="RouteError";var Xb="REACT_ROUTER_ERROR";function Gb(){return null!=t.useContext($b)}function Jb(){return qx(Gb(),"useLocation() may be used only in the context of a <Router> component."),t.useContext($b).location}var Qb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Zb(e){t.useContext(qb).static||t.useLayoutEffect(e)}function ey(){let{isDataRoute:e}=t.useContext(Yb);return e?function(){let{router:e}=uy("useNavigate"),n=py("useNavigate"),r=t.useRef(!1);Zb(()=>{r.current=!0});let o=t.useCallback(async function(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};$x(r.current,Qb),r.current&&("number"===typeof t?await e.navigate(t):await e.navigate(t,p({fromRouteId:n},o)))},[e,n]);return o}():function(){qx(Gb(),"useNavigate() may be used only in the context of a <Router> component.");let e=t.useContext(Mb),{basename:n,navigator:r}=t.useContext(qb),{matches:o}=t.useContext(Yb),{pathname:i}=Jb(),a=JSON.stringify(wb(o)),s=t.useRef(!1);Zb(()=>{s.current=!0});let l=t.useCallback(function(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if($x(s.current,Qb),!s.current)return;if("number"===typeof t)return void r.go(t);let l=Sb(t,JSON.parse(a),i,"path"===o.relative);null==e&&"/"!==n&&(l.pathname="/"===l.pathname?n:kb([n,l.pathname])),(o.replace?r.replace:r.push)(l,o.state,o)},[n,r,a,i,e]);return l}()}t.createContext(null);function ty(e){let{relative:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{matches:r}=t.useContext(Yb),{pathname:o}=Jb(),i=JSON.stringify(wb(r));return t.useMemo(()=>Sb(e,JSON.parse(i),o,"path"===n),[e,i,o,n])}function ny(e,n,r){qx(Gb(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=t.useContext(qb),{matches:i}=t.useContext(Yb),a=i[i.length-1],s=a?a.params:{},l=a?a.pathname:"/",c=a?a.pathnameBase:"/",d=a&&a.route;{let e=d&&d.path||"";gy(l,!d||e.endsWith("*")||e.endsWith("*?"),'You rendered descendant <Routes> (or called `useRoutes()`) at "'.concat(l,'" (under <Route path="').concat(e,'">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won\'t match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="').concat(e,'"> to <Route path="').concat("/"===e?"*":"".concat(e,"/*"),'">.'))}let u,h=Jb();if(n){var f;let e="string"===typeof n?Gx(n):n;qx("/"===c||(null===(f=e.pathname)||void 0===f?void 0:f.startsWith(c)),'When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "'.concat(c,'" but pathname "').concat(e.pathname,'" was given in the `location` prop.')),u=e}else u=h;let m=u.pathname||"/",g=m;if("/"!==c){let e=c.replace(/^\//,"").split("/");g="/"+m.replace(/^\//,"").split("/").slice(e.length).join("/")}let v=r&&r.state.matches.length?r.state.matches.map(e=>Object.assign(e,{route:r.manifest[e.route.id]||e.route})):Zx(e,{pathname:g});$x(d||null!=v,'No routes matched location "'.concat(u.pathname).concat(u.search).concat(u.hash,'" ')),$x(null==v||void 0!==v[v.length-1].route.element||void 0!==v[v.length-1].route.Component||void 0!==v[v.length-1].route.lazy,'Matched leaf route at location "'.concat(u.pathname).concat(u.search).concat(u.hash,'" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.'));let x=cy(v&&v.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:kb([c,o.encodeLocation?o.encodeLocation(e.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:kb([c,o.encodeLocation?o.encodeLocation(e.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),i,r);return n&&x?t.createElement($b.Provider,{value:{location:p({pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0},u),navigationType:"POP"}},x):x}function ry(){let e=fy(),n=Ab(e)?"".concat(e.status," ").concat(e.statusText):e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:o},a={padding:"2px 4px",backgroundColor:o},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=t.createElement(t.Fragment,null,t.createElement("p",null,"\ud83d\udcbf Hey developer \ud83d\udc4b"),t.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",t.createElement("code",{style:a},"ErrorBoundary")," or"," ",t.createElement("code",{style:a},"errorElement")," prop on your route.")),t.createElement(t.Fragment,null,t.createElement("h2",null,"Unexpected Application Error!"),t.createElement("h3",{style:{fontStyle:"italic"}},n),r?t.createElement("pre",{style:i},r):null,s)}var oy=t.createElement(ry,null),iy=class extends t.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&"object"===typeof e&&e&&"digest"in e&&"string"===typeof e.digest){const t=function(e){if(e.startsWith("".concat(Xb,":").concat("ROUTE_ERROR_RESPONSE",":{")))try{let t=JSON.parse(e.slice(40));if("object"===typeof t&&t&&"number"===typeof t.status&&"string"===typeof t.statusText)return new Rb(t.status,t.statusText,t.data)}catch(t){}}(e.digest);t&&(e=t)}let n=void 0!==e?t.createElement(Yb.Provider,{value:this.props.routeContext},t.createElement(Kb.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?t.createElement(sy,{error:e},n):n}};iy.contextType=Wb;var ay=new WeakMap;function sy(e){let{children:n,error:r}=e,{basename:o}=t.useContext(qb);if("object"===typeof r&&r&&"digest"in r&&"string"===typeof r.digest){let e=function(e){if(e.startsWith("".concat(Xb,":").concat("REDIRECT",":{")))try{let t=JSON.parse(e.slice(28));if("object"===typeof t&&t&&"number"===typeof t.status&&"string"===typeof t.statusText&&"string"===typeof t.location&&"boolean"===typeof t.reloadDocument&&"boolean"===typeof t.replace)return t}catch(t){}}(r.digest);if(e){let n=ay.get(r);if(n)throw n;let i=Ob(e.location,o),a=i.absoluteURL||i.to;if(Nb(a))throw new Error("Invalid redirect location");if(Pb&&!ay.get(r)){if(!i.isExternal&&!e.reloadDocument){const t=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw ay.set(r,t),t}window.location.href=a}return t.createElement("meta",{httpEquiv:"refresh",content:"0;url=".concat(a)})}}return n}function ly(e){let{routeContext:n,match:r,children:o}=e,i=t.useContext(Mb);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),t.createElement(Yb.Provider,{value:n},o)}function cy(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,o=null===r||void 0===r?void 0:r.state;if(null==e){if(!o)return null;if(o.errors)e=o.matches;else{if(0!==n.length||o.initialized||!(o.matches.length>0))return null;e=o.matches}}let i=e,a=null===o||void 0===o?void 0:o.errors;if(null!=a){let e=i.findIndex(e=>e.route.id&&void 0!==(null===a||void 0===a?void 0:a[e.route.id]));qx(e>=0,"Could not find a matching route for errors on route IDs: ".concat(Object.keys(a).join(","))),i=i.slice(0,Math.min(i.length,e+1))}let s=!1,l=-1;if(r&&o){s=o.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(l=e),t.route.id){let{loaderData:e,errors:n}=o,a=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||void 0===n[t.route.id]);if(t.route.lazy||a){r.isStatic&&(s=!0),i=l>=0?i.slice(0,l+1):[i[0]];break}}}}let c=null===r||void 0===r?void 0:r.onError,d=o&&c?(e,t)=>{var n,r;c(e,{location:o.location,params:null!==(n=null===(r=o.matches)||void 0===r||null===(r=r[0])||void 0===r?void 0:r.params)&&void 0!==n?n:{},pattern:Tb(o.matches),errorInfo:t})}:void 0;return i.reduceRight((e,r,c)=>{let u,h=!1,p=null,f=null;o&&(u=a&&r.route.id?a[r.route.id]:void 0,p=r.route.errorElement||oy,s&&(l<0&&0===c?(gy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),h=!0,f=null):l===c&&(h=!0,f=r.route.hydrateFallbackElement||null)));let m=n.concat(i.slice(0,c+1)),g=()=>{let n;return n=u?p:h?f:r.route.Component?t.createElement(r.route.Component,null):r.route.element?r.route.element:e,t.createElement(ly,{match:r,routeContext:{outlet:e,matches:m,isDataRoute:null!=o},children:n})};return o&&(r.route.ErrorBoundary||r.route.errorElement||0===c)?t.createElement(iy,{location:o.location,revalidation:o.revalidation,component:p,error:u,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:d}):g()},null)}function dy(e){return"".concat(e," must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.")}function uy(e){let n=t.useContext(Mb);return qx(n,dy(e)),n}function hy(e){let n=t.useContext(Fb);return qx(n,dy(e)),n}function py(e){let n=function(e){let n=t.useContext(Yb);return qx(n,dy(e)),n}(e),r=n.matches[n.matches.length-1];return qx(r.route.id,"".concat(e,' can only be used on routes that contain a unique "id"')),r.route.id}function fy(){var e;let n=t.useContext(Kb),r=hy("useRouteError"),o=py("useRouteError");return void 0!==n?n:null===(e=r.errors)||void 0===e?void 0:e[o]}var my={};function gy(e,t,n){t||my[e]||(my[e]=!0,$x(!1,n))}var vy={};function xy(e,t){e||vy[t]||(vy[t]=!0,console.warn(t))}r.useOptimistic;t.memo(by);function by(e){let{routes:t,manifest:n,future:r,state:o,isStatic:i,onError:a}=e;return ny(t,void 0,{manifest:n,state:o,isStatic:i,onError:a,future:r})}function yy(e){qx(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function wy(e){let{basename:n="/",children:r=null,location:o,navigationType:i="POP",navigator:a,static:s=!1,useTransitions:l}=e;qx(!Gb(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=n.replace(/^\/*/,"/"),d=t.useMemo(()=>({basename:c,navigator:a,static:s,useTransitions:l,future:{}}),[c,a,s,l]);"string"===typeof o&&(o=Gx(o));let{pathname:u="/",search:h="",hash:p="",state:f=null,key:m="default",mask:g}=o,v=t.useMemo(()=>{let e=vb(u,c);return null==e?null:{location:{pathname:e,search:h,hash:p,state:f,key:m,mask:g},navigationType:i}},[c,u,h,p,f,m,i,g]);return $x(null!=v,'<Router basename="'.concat(c,'"> is not able to match the URL "').concat(u).concat(h).concat(p,"\" because it does not start with the basename, so the <Router> won't render anything.")),null==v?null:t.createElement(qb.Provider,{value:d},t.createElement($b.Provider,{children:r,value:v}))}function Sy(e){let{children:t,location:n}=e;return ny(jy(t),n)}t.Component;function jy(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[];return t.Children.forEach(e,(e,o)=>{if(!t.isValidElement(e))return;let i=[...n,o];if(e.type===t.Fragment)return void r.push.apply(r,jy(e.props.children,i));qx(e.type===yy,"[".concat("string"===typeof e.type?e.type:e.type.name,"] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>")),qx(!e.props.index||!e.props.children,"An index route cannot have child routes.");let a={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:!0===e.props.hasErrorBoundary||null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=jy(e.props.children,i)),r.push(a)}),r}var ky="get",Cy="application/x-www-form-urlencoded";function Ey(e){return"undefined"!==typeof HTMLElement&&e instanceof HTMLElement}var _y=null;var zy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ry(e){return null==e||zy.has(e)?e:($x(!1,'"'.concat(e,'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` and will default to "').concat(Cy,'"')),null)}function Ay(e,t){let n,r,o,i,a;if(Ey(s=e)&&"form"===s.tagName.toLowerCase()){let a=e.getAttribute("action");r=a?vb(a,t):null,n=e.getAttribute("method")||ky,o=Ry(e.getAttribute("enctype"))||Cy,i=new FormData(e)}else if(function(e){return Ey(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Ey(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let a=e.form;if(null==a)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||a.getAttribute("action");if(r=s?vb(s,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||ky,o=Ry(e.getAttribute("formenctype"))||Ry(a.getAttribute("enctype"))||Cy,i=new FormData(a,e),!function(){if(null===_y)try{new FormData(document.createElement("form"),0),_y=!1}catch(e){_y=!0}return _y}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?"".concat(t,"."):"";i.append("".concat(e,"x"),"0"),i.append("".concat(e,"y"),"0")}else t&&i.append(t,r)}}else{if(Ey(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ky,r=null,o=Cy,a=e}var s;return i&&"text/plain"===o&&(a=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");"undefined"!==typeof window?window:"undefined"!==typeof globalThis&&globalThis;function Ty(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}Symbol("SingleFetchRedirect");function Py(e,t,n,r){let o="string"===typeof e?new URL(e,"undefined"===typeof window?"server://singlefetch/":window.location.origin):e;return n?o.pathname.endsWith("/")?o.pathname="".concat(o.pathname,"_.").concat(r):o.pathname="".concat(o.pathname,".").concat(r):"/"===o.pathname?o.pathname="_root.".concat(r):t&&"/"===vb(o.pathname,t)?o.pathname="".concat(Cb(t),"/_root.").concat(r):o.pathname="".concat(Cb(o.pathname),".").concat(r),o}async function Oy(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error("Error loading route module `".concat(e.module,"`, reloading page...")),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ly(e){return null!=e&&"string"===typeof e.page}function Dy(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"===typeof e.imageSrcSet&&"string"===typeof e.imageSizes:"string"===typeof e.rel&&"string"===typeof e.href)}function Iy(e,t,n,r,o,i){let a=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>{var r;return n[t].pathname!==e.pathname||(null===(r=n[t].route.path)||void 0===r?void 0:r.endsWith("*"))&&n[t].params["*"]!==e.params["*"]};return"assets"===i?t.filter((e,t)=>a(e,t)||s(e,t)):"data"===i?t.filter((t,i)=>{let l=r.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(a(t,i)||s(t,i))return!0;if(t.route.shouldRevalidate){var c;let r=t.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:(null===(c=n[0])||void 0===c?void 0:c.params)||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"===typeof r)return r}return!0}):[]}function Ny(e,t){let{includeHydrateFallback:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r=e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let o=[r.module];return r.clientActionModule&&(o=o.concat(r.clientActionModule)),r.clientLoaderModule&&(o=o.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(o=o.concat(r.hydrateFallbackModule)),r.imports&&(o=o.concat(r.imports)),o}).flat(1),[...new Set(r)];var r}function My(e,t){let n=new Set,r=new Set(t);return e.reduce((e,o)=>{if(t&&!Ly(o)&&"script"===o.as&&o.href&&r.has(o.href))return e;let i=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(o));return n.has(i)||(n.add(i),e.push({key:i,link:o})),e},[])}function Fy(e,t){return"lazy"===e.mode&&!0===t}function Wy(){let e=t.useContext(Mb);return Ty(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function By(){let e=t.useContext(Fb);return Ty(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Uy=t.createContext(void 0);function Vy(){let e=t.useContext(Uy);return Ty(e,"You must render this element inside a <HydratedRouter> element"),e}function Hy(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function qy(e,t,n){if(n&&!Gy)return[e[0]];if(t){let n=e.findIndex(e=>void 0!==t[e.route.id]);return e.slice(0,n+1)}return e}Uy.displayName="FrameworkContext";function $y(e){let{page:n}=e,r=Ki(e,Ox),o=Bb(),{nonce:i}=Vy(),{router:a}=Wy(),s=t.useMemo(()=>Zx(a.routes,n,a.basename),[a.routes,n,a.basename]);return s?(null==r.nonce&&i&&(r=p(p({},r),{},{nonce:i})),o?t.createElement(Ky,p({page:n,matches:s},r)):t.createElement(Xy,p({page:n,matches:s},r))):null}function Yy(e){let{manifest:n,routeModules:r}=Vy(),[o,i]=t.useState([]);return t.useEffect(()=>{let t=!1;return async function(e,t,n){let r=await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Oy(r,n);return e.links?e.links():[]}return[]}));return My(r.flat(1).filter(Dy).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?p(p({},e),{},{rel:"prefetch",as:"style"}):p(p({},e),{},{rel:"prefetch"})))}(e,n,r).then(e=>{t||i(e)}),()=>{t=!0}},[e,n,r]),o}function Ky(e){let{page:n,matches:r}=e,o=Ki(e,Lx),i=Jb(),{future:a}=Vy(),{basename:s}=Wy(),l=t.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let e=Py(n,s,a.v8_trailingSlashAwareDataRequests,"rsc"),t=!1,o=[];for(let n of r)"function"===typeof n.route.shouldRevalidate?t=!0:o.push(n.route.id);return t&&o.length>0&&e.searchParams.set("_routes",o.join(",")),[e.pathname+e.search]},[s,a.v8_trailingSlashAwareDataRequests,n,i,r]);return t.createElement(t.Fragment,null,l.map(e=>t.createElement("link",p({key:e,rel:"prefetch",as:"fetch",href:e},o))))}function Xy(e){let{page:n,matches:r}=e,o=Ki(e,Dx),i=Jb(),{future:a,manifest:s,routeModules:l}=Vy(),{basename:c}=Wy(),{loaderData:d,matches:u}=By(),h=t.useMemo(()=>Iy(n,r,u,s,i,"data"),[n,r,u,s,i]),f=t.useMemo(()=>Iy(n,r,u,s,i,"assets"),[n,r,u,s,i]),m=t.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let e=new Set,t=!1;if(r.forEach(n=>{var r;let o=s.routes[n.route.id];o&&o.hasLoader&&(!h.some(e=>e.route.id===n.route.id)&&n.route.id in d&&null!==(r=l[n.route.id])&&void 0!==r&&r.shouldRevalidate||o.hasClientLoader?t=!0:e.add(n.route.id))}),0===e.size)return[];let o=Py(n,c,a.v8_trailingSlashAwareDataRequests,"data");return t&&e.size>0&&o.searchParams.set("_routes",r.filter(t=>e.has(t.route.id)).map(e=>e.route.id).join(",")),[o.pathname+o.search]},[c,a.v8_trailingSlashAwareDataRequests,d,i,s,h,r,n,l]),g=t.useMemo(()=>Ny(f,s),[f,s]),v=Yy(f);return t.createElement(t.Fragment,null,m.map(e=>t.createElement("link",p({key:e,rel:"prefetch",as:"fetch",href:e},o))),g.map(e=>t.createElement("link",p({key:e,rel:"modulepreload",href:e},o))),v.map(e=>{var n;let{key:r,link:i}=e;return t.createElement("link",p(p({key:r,nonce:o.nonce},i),{},{crossOrigin:null!==(n=i.crossOrigin)&&void 0!==n?n:o.crossOrigin}))}))}var Gy=!1;function Jy(e){let{manifest:n,serverHandoffString:r,isSpaMode:o,renderMeta:i,routeDiscovery:a,ssr:s,nonce:l}=Vy(),{router:c,static:d,staticContext:u}=Wy(),{matches:h}=By(),f=Bb(),m=Fy(a,s);null==e.nonce&&l&&p(p({},e),{},{nonce:l}),i&&(i.didRenderScripts=!0);let g=qy(h,null,o);t.useEffect(()=>{0},[]);let v=t.useMemo(()=>{var o;if(f)return null;let i=u?"window.__reactRouterContext = ".concat(r,";").concat("window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());"):" ",a=d?"".concat(null!==n.hmr&&void 0!==o&&o.runtime?"import ".concat(JSON.stringify(n.hmr.runtime),";"):"").concat(m?"":"import ".concat(JSON.stringify(n.url)),";\n").concat(g.map((e,t)=>{let r="route".concat(t),o=n.routes[e.route.id];Ty(o,"Route ".concat(e.route.id," not found in manifest"));let{clientActionModule:i,clientLoaderModule:a,clientMiddlewareModule:s,hydrateFallbackModule:l,module:c}=o,d=[...i?[{module:i,varName:"".concat(r,"_clientAction")}]:[],...a?[{module:a,varName:"".concat(r,"_clientLoader")}]:[],...s?[{module:s,varName:"".concat(r,"_clientMiddleware")}]:[],...l?[{module:l,varName:"".concat(r,"_HydrateFallback")}]:[],{module:c,varName:"".concat(r,"_main")}];return 1===d.length?"import * as ".concat(r," from ").concat(JSON.stringify(c),";"):[d.map(e=>"import * as ".concat(e.varName,' from "').concat(e.module,'";')).join("\n"),"const ".concat(r," = {").concat(d.map(e=>"...".concat(e.varName)).join(","),"};")].join("\n")}).join("\n"),"\n ").concat(m?"window.__reactRouterManifest = ".concat(JSON.stringify(function(e,t){let{sri:n}=e,r=Ki(e,Px),o=new Set(t.state.matches.map(e=>e.route.id)),i=t.state.location.pathname.split("/").filter(Boolean),a=["/"];for(i.pop();i.length>0;)a.push("/".concat(i.join("/"))),i.pop();a.forEach(e=>{let n=eb(t.routes,e,t.basename||"/",!1,t.branches);n&&n.forEach(e=>o.add(e.route.id))});let s=[...o].reduce((e,t)=>Object.assign(e,{[t]:r.routes[t]}),{});return p(p({},r),{},{routes:s,sri:!!n||void 0})}(n,c),null,2),";"):"","\n window.__reactRouterRouteModules = {").concat(g.map((e,t)=>"".concat(JSON.stringify(e.route.id),":route").concat(t)).join(","),"};\n\nimport(").concat(JSON.stringify(n.entry.module),");"):" ";return t.createElement(t.Fragment,null,t.createElement("script",p(p({},e),{},{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:i},type:void 0})),t.createElement("script",p(p({},e),{},{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:a},type:"module",async:!0})))},[]),x=Gy||f?[]:[...new Set(n.entry.imports.concat(Ny(g,n,{includeHydrateFallback:!0})))],b="object"===typeof n.sri?n.sri:{};return xy(!f,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),Gy||f?null:t.createElement(t.Fragment,null,"object"===typeof n.sri?t.createElement("script",p(p({},e),{},{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:b})}})):null,m?null:t.createElement("link",{rel:"modulepreload",href:n.url,crossOrigin:e.crossOrigin,integrity:b[n.url],nonce:e.nonce,suppressHydrationWarning:!0}),t.createElement("link",{rel:"modulepreload",href:n.entry.module,crossOrigin:e.crossOrigin,integrity:b[n.entry.module],nonce:e.nonce,suppressHydrationWarning:!0}),x.map(n=>t.createElement("link",{key:n,rel:"modulepreload",href:n,crossOrigin:e.crossOrigin,integrity:b[n],nonce:e.nonce,suppressHydrationWarning:!0})),v)}function Qy(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{t.forEach(t=>{"function"===typeof t?t(e):null!=t&&(t.current=e)})}}t.Component;function Zy(e){let{error:n,isOutsideRemixApp:r}=e,{nonce:o}=Vy();console.error(n);let i,a=t.createElement("script",{nonce:o,dangerouslySetInnerHTML:{__html:'\n console.log(\n "\ud83d\udcbf Hey developer \ud83d\udc4b. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."\n );\n '}});if(Ab(n))return t.createElement(ew,{title:"Unhandled Thrown Response!"},t.createElement("h1",{style:{fontSize:"24px"}},n.status," ",n.statusText),a);if(n instanceof Error)0;else{let e=null==n?"Unknown Error":"object"===typeof n&&"toString"in n?n.toString():JSON.stringify(n);new Error(e)}return t.createElement(ew,{title:"Application Error!",isOutsideRemixApp:r},t.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),t.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},i.stack),a)}function ew(e){var n;let{title:r,renderScripts:o,isOutsideRemixApp:i,children:a}=e,{routeModules:s}=Vy();return null!==s.root&&void 0!==n&&n.Layout&&!i?a:t.createElement("html",{lang:"en"},t.createElement("head",null,t.createElement("meta",{charSet:"utf-8"}),t.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),t.createElement("title",null,r)),t.createElement("body",null,t.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},a,o?t.createElement(Jy,null):null)))}var tw="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement;try{tw&&(window.__reactRouterVersion="7.18.1")}catch(kF){}function nw(e){let{basename:n,children:r,useTransitions:o,window:i}=e,a=t.useRef();null==a.current&&(a.current=Hx({window:i,v5Compat:!0}));let s=a.current,[l,c]=t.useState({action:s.action,location:s.location}),d=t.useCallback(e=>{!1===o?c(e):t.startTransition(()=>c(e))},[o]);return t.useLayoutEffect(()=>s.listen(d),[s,d]),t.createElement(wy,{basename:n,children:r,location:l.location,navigationType:l.action,navigator:s,useTransitions:o})}var rw=t.forwardRef(function(e,n){let{onClick:r,discover:o="render",prefetch:i="none",relative:a,reloadDocument:s,replace:l,mask:c,state:d,target:u,to:h,preventScrollReset:f,viewTransition:m,defaultShouldRevalidate:g}=e,v=Ki(e,Ix),{basename:x,navigator:b,useTransitions:y}=t.useContext(qb),w="string"===typeof h&&Fx.test(h),S=Ob(h,x);h=S.to;let j=function(e){let{relative:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};qx(Gb(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:o}=t.useContext(qb),{hash:i,pathname:a,search:s}=ty(e,{relative:n}),l=a;return"/"!==r&&(l="/"===a?r:kb([r,a])),o.createHref({pathname:l,search:s,hash:i})}(h,{relative:a}),k=Jb(),C=null;if(c){let e=Sb(c,[],k.mask?k.mask.pathname:"/",!0);"/"!==x&&(e.pathname="/"===e.pathname?x:kb([x,e.pathname])),C=b.createHref(e)}let[E,_,z]=function(e,n){let r=t.useContext(Uy),[o,i]=t.useState(!1),[a,s]=t.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:d,onMouseLeave:u,onTouchStart:h}=n,p=t.useRef(null);t.useEffect(()=>{if("render"===e&&s(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),t.useEffect(()=>{if(o){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[o]);let f=()=>{i(!0)},m=()=>{i(!1),s(!1)};return r?"intent"!==e?[a,p,{}]:[a,p,{onFocus:Hy(l,f),onBlur:Hy(c,m),onMouseEnter:Hy(d,f),onMouseLeave:Hy(u,m),onTouchStart:Hy(h,f)}]:[!1,p,{}]}(i,v),R=function(e){let{target:n,replace:r,mask:o,state:i,preventScrollReset:a,relative:s,viewTransition:l,defaultShouldRevalidate:c,useTransitions:d}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=ey(),h=Jb(),p=ty(e,{relative:s});return t.useCallback(f=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(f,n)){f.preventDefault();let n=void 0!==r?r:Xx(h)===Xx(p),m=()=>u(e,{replace:n,mask:o,state:i,preventScrollReset:a,relative:s,viewTransition:l,defaultShouldRevalidate:c});d?t.startTransition(()=>m()):m()}},[h,u,p,r,o,i,n,e,a,s,l,c,d])}(h,{replace:l,mask:c,state:d,target:u,preventScrollReset:f,relative:a,viewTransition:m,defaultShouldRevalidate:g,useTransitions:y});let A=!(S.isExternal||s),T=t.createElement("a",p(p(p({},v),z),{},{href:(A?C:void 0)||S.absoluteURL||j,onClick:A?function(e){r&&r(e),e.defaultPrevented||R(e)}:r,ref:Qy(n,_),target:u,"data-discover":w||"render"!==o?void 0:"true"}));return E&&!w?t.createElement(t.Fragment,null,T,t.createElement($y,{page:j})):T});rw.displayName="Link";var ow=t.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:a=!1,style:s,to:l,viewTransition:c,children:d}=e,u=Ki(e,Nx),h=ty(l,{relative:u.relative}),f=Jb(),m=t.useContext(Fb),{navigator:g,basename:v}=t.useContext(qb),x=null!=m&&function(e){let{relative:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.useContext(Ub);qx(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=sw("useViewTransitionState"),i=ty(e,{relative:n});if(!r.isTransitioning)return!1;let a=vb(r.currentLocation.pathname,o)||r.currentLocation.pathname,s=vb(r.nextLocation.pathname,o)||r.nextLocation.pathname;return null!=pb(i.pathname,s)||null!=pb(i.pathname,a)}(h)&&!0===c,b=g.encodeLocation?g.encodeLocation(h).pathname:h.pathname,y=f.pathname,w=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;o||(y=y.toLowerCase(),w=w?w.toLowerCase():null,b=b.toLowerCase()),w&&v&&(w=vb(w,v)||w);const S="/"!==b&&b.endsWith("/")?b.length-1:b.length;let j,k=y===b||!a&&y.startsWith(b)&&"/"===y.charAt(S),C=null!=w&&(w===b||!a&&w.startsWith(b)&&"/"===w.charAt(b.length)),E={isActive:k,isPending:C,isTransitioning:x},_=k?r:void 0;j="function"===typeof i?i(E):[i,k?"active":null,C?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let z="function"===typeof s?s(E):s;return t.createElement(rw,p(p({},u),{},{"aria-current":_,className:j,ref:n,style:z,to:l,viewTransition:c}),"function"===typeof d?d(E):d)});ow.displayName="NavLink";var iw=t.forwardRef((e,n)=>{let{discover:r="render",fetcherKey:o,navigate:i,reloadDocument:a,replace:s,state:l,method:c=ky,action:d,onSubmit:u,relative:h,preventScrollReset:f,viewTransition:m,defaultShouldRevalidate:g}=e,v=Ki(e,Mx),{useTransitions:x}=t.useContext(qb),b=dw(),y=function(e){let{relative:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{basename:r}=t.useContext(qb),o=t.useContext(Yb);qx(o,"useFormAction must be used inside a RouteContext");let[i]=o.matches.slice(-1),a=p({},ty(e||".",{relative:n})),s=Jb();if(null==e){a.search=s.search;let e=new URLSearchParams(a.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let n=e.toString();a.search=n?"?".concat(n):""}}e&&"."!==e||!i.route.index||(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index");"/"!==r&&(a.pathname="/"===a.pathname?r:kb([r,a.pathname]));return Xx(a)}(d,{relative:h}),w="get"===c.toLowerCase()?"get":"post",S="string"===typeof d&&Fx.test(d);return t.createElement("form",p(p({ref:n,method:w,action:y,onSubmit:a?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,r=(null===n||void 0===n?void 0:n.getAttribute("formmethod"))||c,a=()=>b(n||e.currentTarget,{fetcherKey:o,method:r,navigate:i,replace:s,state:l,relative:h,preventScrollReset:f,viewTransition:m,defaultShouldRevalidate:g});x&&!1!==i?t.startTransition(()=>a()):a()}},v),{},{"data-discover":S||"render"!==r?void 0:"true"}))});function aw(e){return"".concat(e," must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.")}function sw(e){let n=t.useContext(Mb);return qx(n,aw(e)),n}iw.displayName="Form";var lw=0,cw=()=>"__".concat(String(++lw),"__");function dw(){let{router:e}=sw("useSubmit"),{basename:n}=t.useContext(qb),r=py("useRouteId"),o=e.fetch,i=e.navigate;return t.useCallback(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{action:a,method:s,encType:l,formData:c,body:d}=Ay(e,n);if(!1===t.navigate){let e=t.fetcherKey||cw();await o(e,r,t.action||a,{defaultShouldRevalidate:t.defaultShouldRevalidate,preventScrollReset:t.preventScrollReset,formData:c,body:d,formMethod:t.method||s,formEncType:t.encType||l,flushSync:t.flushSync})}else await i(t.action||a,{defaultShouldRevalidate:t.defaultShouldRevalidate,preventScrollReset:t.preventScrollReset,formData:c,body:d,formMethod:t.method||s,formEncType:t.encType||l,replace:t.replace,state:t.state,fromRouteId:r,flushSync:t.flushSync,viewTransition:t.viewTransition})},[o,i,n,r])}function uw(e,t){var n;const r=null!==e&&void 0!==e?e:"bottom",o={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[r];return null!==(n=null===o||void 0===o?void 0:o[t])&&void 0!==n?n:r}function hw(e){const{theme:n}=Wv(),r=_x();return(0,t.useMemo)(()=>function(e,t){const n=n=>{var r;return p(p(p({},t),n),{},{position:uw(null!==(r=null===n||void 0===n?void 0:n.position)&&void 0!==r?r:null===t||void 0===t?void 0:t.position,e)})},r=e=>{const t=n(e),r=px(t);return fx.notify(r,t)};return r.update=(e,t)=>{fx.update(e,n(t))},r.promise=(e,t)=>{const n=r(p(p({},t.loading),{},{status:"loading",duration:null}));e.then(e=>r.update(n,p({status:"success",duration:5e3},Pl(t.success,e)))).catch(e=>r.update(n,p({status:"error",duration:5e3},Pl(t.error,e))))},r.closeAll=fx.closeAll,r.close=fx.close,r.isActive=fx.isActive,r}(n.direction,p(p({},r),e)),[e,n.direction,r])}const pw=["direction","align","justify","wrap","basis","grow","shrink"],fw=Dv(function(e,t){const{direction:n,align:r,justify:o,wrap:a,basis:s,grow:l,shrink:c}=e,d=Ki(e,pw),u={display:"flex",flexDirection:n,alignItems:r,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:c};return(0,i.jsx)(Rv.div,p({ref:t,__css:u},d))});fw.displayName="Flex";const mw=Rv("div");function gw(e){return t.Children.toArray(e).filter(e=>(0,t.isValidElement)(e))}mw.displayName="Box";const vw=e=>(0,i.jsx)(Rv.div,p(p({className:"chakra-stack__item"},e),{},{__css:p({display:"inline-block",flex:"0 0 auto",minWidth:0},e.__css)}));vw.displayName="StackItem";Object.freeze(["base","sm","md","lg","xl","2xl"]);function xw(e,t){return Array.isArray(e)?e.map(e=>null===e?null:t(e)):Bn(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):null!=e?t(e):null}const bw=["isInline","direction","align","justify","spacing","wrap","children","divider","className","shouldWrapChildren"],yw=Dv((e,n)=>{const{isInline:r,direction:o,align:a,justify:s,spacing:l="0.5rem",wrap:c,children:d,divider:u,className:h,shouldWrapChildren:f}=e,m=Ki(e,bw),g=r?"row":null!==o&&void 0!==o?o:"column",v=(0,t.useMemo)(()=>function(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":xw(n,e=>r[e])}}({spacing:l,direction:g}),[l,g]),x=!!u,b=!f&&!x,y=(0,t.useMemo)(()=>{const e=gw(d);return b?e:e.map((n,r)=>{const o="undefined"!==typeof n.key?n.key:r,a=r+1===e.length,s=f?(0,i.jsx)(vw,{children:n},o):n;if(!x)return s;const l=(0,t.cloneElement)(u,{__css:v}),c=a?null:l;return(0,i.jsxs)(t.Fragment,{children:[s,c]},o)})},[u,v,x,b,f,d]),w=Lv("chakra-stack",h);return(0,i.jsx)(Rv.div,p(p({ref:n,display:"flex",alignItems:a,justifyContent:s,flexDirection:g,flexWrap:c,gap:x?void 0:l,className:w},m),{},{children:y}))});yw.displayName="Stack";const ww=Dv((e,t)=>(0,i.jsx)(yw,p(p({align:"center"},e),{},{direction:"column",ref:t})));ww.displayName="VStack";const Sw=["className"],jw=Dv(function(e,t){const n=Hv("Heading",e),r=Ov(e),{className:o}=r,a=Ki(r,Sw);return(0,i.jsx)(Rv.h2,p(p({ref:t,className:Lv("chakra-heading",e.className)},a),{},{__css:n}))});jw.displayName="Heading";const kw=["className","align","decoration","casing"],Cw=Dv(function(e,t){const n=Hv("Text",e),r=Ov(e),{className:o,align:a,decoration:s,casing:l}=r,c=Ki(r,kw),d=uv({textAlign:e.align,textDecoration:e.decoration,textTransform:e.casing});return(0,i.jsx)(Rv.p,p(p(p({ref:t,className:Lv("chakra-text",e.className)},d),c),{},{__css:n}))});Cw.displayName="Text";const Ew=Dv((e,t)=>(0,i.jsx)(yw,p(p({align:"center"},e),{},{direction:"row",ref:t})));Ew.displayName="HStack";const _w=["className"],zw=Dv(function(e,t){const n=Hv("Badge",e),r=Ov(e),{className:o}=r,a=Ki(r,_w);return(0,i.jsx)(Rv.span,p(p({ref:t,className:Lv("chakra-badge",e.className)},a),{},{__css:p({display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle"},n)}))});function Rw(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{t.forEach(t=>{!function(e,t){if(null!=e)if("function"!==typeof e)try{e.current=t}catch(n){throw new Error("Cannot assign value '".concat(t,"' to ref '").concat(e,"'"))}else e(t)}(t,e)})}}function Aw(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(0,t.useMemo)(()=>Rw(...n),n)}zw.displayName="Badge";const Tw=e=>e?"":void 0,Pw=e=>!!e||void 0,[Ow,Lw]=Rc({strict:!1,name:"ButtonGroupContext"}),Dw=["children","className"];function Iw(e){const{children:n,className:r}=e,o=Ki(e,Dw),a=(0,t.isValidElement)(n)?(0,t.cloneElement)(n,{"aria-hidden":!0,focusable:!1}):n,s=Lv("chakra-button__icon",r);return(0,i.jsx)(Rv.span,p(p({display:"inline-flex",alignSelf:"center",flexShrink:0},o),{},{className:s,children:a}))}Iw.displayName="ButtonIcon";const Nw=["label","placement","spacing","children","className","__css"];function Mw(e){const{label:n,placement:r,spacing:o="0.5rem",children:a=(0,i.jsx)(Qv,{color:"currentColor",width:"1em",height:"1em"}),className:s,__css:l}=e,c=Ki(e,Nw),d=Lv("chakra-button__spinner",s),u="start"===r?"marginEnd":"marginStart",h=(0,t.useMemo)(()=>p({display:"flex",alignItems:"center",position:n?"relative":"absolute",[u]:n?o:0,fontSize:"1em",lineHeight:"normal"},l),[l,n,u,o]);return(0,i.jsx)(Rv.div,p(p({className:d},c),{},{__css:h,children:a}))}Mw.displayName="ButtonSpinner";const Fw=["isDisabled","isLoading","isActive","children","leftIcon","rightIcon","loadingText","iconSpacing","type","spinner","spinnerPlacement","className","as","shouldWrapChildren"],Ww=Dv((e,n)=>{const r=Lw(),o=Hv("Button",p(p({},r),e)),a=Ov(e),{isDisabled:s=(null===r||void 0===r?void 0:r.isDisabled),isLoading:l,isActive:c,children:d,leftIcon:u,rightIcon:h,loadingText:f,iconSpacing:m="0.5rem",type:g,spinner:v,spinnerPlacement:x="start",className:b,as:y,shouldWrapChildren:w}=a,S=Ki(a,Fw),j=(0,t.useMemo)(()=>{const e=p(p({},null===o||void 0===o?void 0:o._focus),{},{zIndex:1});return p(p({display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none"},o),!!r&&{_focus:e})},[o,r]),{ref:k,type:C}=function(e){const[n,r]=(0,t.useState)(!e),o=(0,t.useCallback)(e=>{e&&r("BUTTON"===e.tagName)},[]);return{ref:o,type:n?"button":void 0}}(y),E={rightIcon:h,leftIcon:u,iconSpacing:m,children:d,shouldWrapChildren:w};return(0,i.jsxs)(Rv.button,p(p({disabled:s||l,ref:Aw(n,k),as:y,type:null!==g&&void 0!==g?g:C,"data-active":Tw(c),"data-loading":Tw(l),__css:j,className:Lv("chakra-button",b)},S),{},{children:[l&&"start"===x&&(0,i.jsx)(Mw,{className:"chakra-button__spinner--start",label:f,placement:"start",spacing:m,children:v}),l?f||(0,i.jsx)(Rv.span,{opacity:0,children:(0,i.jsx)(Bw,p({},E))}):(0,i.jsx)(Bw,p({},E)),l&&"end"===x&&(0,i.jsx)(Mw,{className:"chakra-button__spinner--end",label:f,placement:"end",spacing:m,children:v})]}))});function Bw(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o,shouldWrapChildren:a}=e;return a?(0,i.jsxs)("span",{style:{display:"contents"},children:[t&&(0,i.jsx)(Iw,{marginEnd:o,children:t}),r,n&&(0,i.jsx)(Iw,{marginStart:o,children:n})]}):(0,i.jsxs)(i.Fragment,{children:[t&&(0,i.jsx)(Iw,{marginEnd:o,children:t}),r,n&&(0,i.jsx)(Iw,{marginStart:o,children:n})]})}Ww.displayName="Button";const Uw=["className","centerContent"],Vw=Dv(function(e,t){const n=Ov(e),{className:r,centerContent:o}=n,a=Ki(n,Uw),s=Hv("Container",e);return(0,i.jsx)(Rv.div,p(p({ref:t,className:Lv("chakra-container",r)},a),{},{__css:p(p({},s),o&&{display:"flex",flexDirection:"column",alignItems:"center"})}))});Vw.displayName="Container";const Hw=["icon","children","isRound","aria-label"],qw=Dv((e,n)=>{const{icon:r,children:o,isRound:a,"aria-label":s}=e,l=Ki(e,Hw),c=r||o,d=(0,t.isValidElement)(c)?(0,t.cloneElement)(c,{"aria-hidden":!0,focusable:!1}):null;return(0,i.jsx)(Ww,p(p({px:"0",py:"0",borderRadius:a?"full":void 0,ref:n,"aria-label":s},l),{},{children:d}))});qw.displayName="IconButton";const $w={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}};function Yw(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{onClose:n,onOpen:r,isOpen:o,id:i}=e,a=dd(r),s=dd(n),[l,c]=(0,t.useState)(e.defaultIsOpen||!1),d=void 0!==o?o:l,u=void 0!==o,h=(0,t.useId)(),f=null!==i&&void 0!==i?i:"disclosure-".concat(h),m=(0,t.useCallback)(()=>{u||c(!1),null===s||void 0===s||s()},[u,s]),g=(0,t.useCallback)(()=>{u||c(!0),null===a||void 0===a||a()},[u,a]),v=(0,t.useCallback)(()=>{d?m():g()},[d,g,m]);return{isOpen:d,onOpen:g,onClose:m,onToggle:v,isControlled:u,getButtonProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return p(p({},e),{},{"aria-expanded":d,"aria-controls":f,onClick(t){var n;null===(n=e.onClick)||void 0===n||n.call(e,t),v()}})},getDisclosureProps:function(){return p(p({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{hidden:!d,id:f})}}}function Kw(e,n,r,o){const i=dd(r);return(0,t.useEffect)(()=>{const t="function"===typeof e?e():null!==e&&void 0!==e?e:document;if(r&&t)return t.addEventListener(n,i,o),()=>{t.removeEventListener(n,i,o)}},[n,e,o,i,r]),()=>{const t="function"===typeof e?e():null!==e&&void 0!==e?e:document;null===t||void 0===t||t.removeEventListener(n,i,o)}}function Xw(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:Xi(e)&&function(e){const t=e.ownerDocument.defaultView||window,{overflow:n,overflowX:r,overflowY:o}=t.getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(n+o+r)}(e)?e:Xw(function(e){return"html"===e.localName?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}(e))}function Gw(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach(e=>null===e||void 0===e?void 0:e(...n))}}function Jw(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.some(t=>(null===t||void 0===t||t(e),null===e||void 0===e?void 0:e.defaultPrevented))}}function Qw(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Zw(e){return e instanceof Qw(e).Element||e instanceof Element}function eS(e){return e instanceof Qw(e).HTMLElement||e instanceof HTMLElement}function tS(e){return"undefined"!==typeof ShadowRoot&&(e instanceof Qw(e).ShadowRoot||e instanceof ShadowRoot)}var nS=Math.max,rS=Math.min,oS=Math.round;function iS(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function aS(){return!/^((?!chrome|android).)*safari/i.test(iS())}function sS(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&eS(e)&&(o=e.offsetWidth>0&&oS(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&oS(r.height)/e.offsetHeight||1);var a=(Zw(e)?Qw(e):window).visualViewport,s=!aS()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/o,c=(r.top+(s&&a?a.offsetTop:0))/i,d=r.width/o,u=r.height/i;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l,x:l,y:c}}function lS(e){var t=Qw(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function cS(e){return e?(e.nodeName||"").toLowerCase():null}function dS(e){return((Zw(e)?e.ownerDocument:e.document)||window.document).documentElement}function uS(e){return sS(dS(e)).left+lS(e).scrollLeft}function hS(e){return Qw(e).getComputedStyle(e)}function pS(e){var t=hS(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function fS(e,t,n){void 0===n&&(n=!1);var r=eS(t),o=eS(t)&&function(e){var t=e.getBoundingClientRect(),n=oS(t.width)/e.offsetWidth||1,r=oS(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),i=dS(t),a=sS(e,o,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&(("body"!==cS(t)||pS(i))&&(s=function(e){return e!==Qw(e)&&eS(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:lS(e);var t}(t)),eS(t)?((l=sS(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=uS(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function mS(e){var t=sS(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function gS(e){return"html"===cS(e)?e:e.assignedSlot||e.parentNode||(tS(e)?e.host:null)||dS(e)}function vS(e){return["html","body","#document"].indexOf(cS(e))>=0?e.ownerDocument.body:eS(e)&&pS(e)?e:vS(gS(e))}function xS(e,t){var n;void 0===t&&(t=[]);var r=vS(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=Qw(r),a=o?[i].concat(i.visualViewport||[],pS(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(xS(gS(a)))}function bS(e){return["table","td","th"].indexOf(cS(e))>=0}function yS(e){return eS(e)&&"fixed"!==hS(e).position?e.offsetParent:null}function wS(e){for(var t=Qw(e),n=yS(e);n&&bS(n)&&"static"===hS(n).position;)n=yS(n);return n&&("html"===cS(n)||"body"===cS(n)&&"static"===hS(n).position)?t:n||function(e){var t=/firefox/i.test(iS());if(/Trident/i.test(iS())&&eS(e)&&"fixed"===hS(e).position)return null;var n=gS(e);for(tS(n)&&(n=n.host);eS(n)&&["html","body"].indexOf(cS(n))<0;){var r=hS(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var SS="top",jS="bottom",kS="right",CS="left",ES="auto",_S=[SS,jS,kS,CS],zS="start",RS="end",AS="viewport",TS="popper",PS=_S.reduce(function(e,t){return e.concat([t+"-"+zS,t+"-"+RS])},[]),OS=[].concat(_S,[ES]).reduce(function(e,t){return e.concat([t,t+"-"+zS,t+"-"+RS])},[]),LS=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function DS(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}}),r.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){n.has(e.name)||o(e)}),r}function IS(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}var NS={placement:"bottom",modifiers:[],strategy:"absolute"};function MS(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"===typeof e.getBoundingClientRect)})}function FS(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?NS:o;return function(e,t,n){void 0===n&&(n=i);var o={placement:"bottom",orderedModifiers:[],options:Object.assign({},NS,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],s=!1,l={state:o,setOptions:function(n){var s="function"===typeof n?n(o.options):n;c(),o.options=Object.assign({},i,o.options,s),o.scrollParents={reference:Zw(e)?xS(e):e.contextElement?xS(e.contextElement):[],popper:xS(t)};var d=function(e){var t=DS(e);return LS.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}(function(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}([].concat(r,o.options.modifiers)));return o.orderedModifiers=d.filter(function(e){return e.enabled}),o.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"===typeof i){var s=i({state:o,name:t,instance:l,options:r}),c=function(){};a.push(s||c)}}),l.update()},forceUpdate:function(){if(!s){var e=o.elements,t=e.reference,n=e.popper;if(MS(t,n)){o.rects={reference:fS(t,wS(n),"fixed"===o.options.strategy),popper:mS(n)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach(function(e){return o.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<o.orderedModifiers.length;r++)if(!0!==o.reset){var i=o.orderedModifiers[r],a=i.fn,c=i.options,d=void 0===c?{}:c,u=i.name;"function"===typeof a&&(o=a({state:o,options:d,name:u,instance:l})||o)}else o.reset=!1,r=-1}}},update:IS(function(){return new Promise(function(e){l.forceUpdate(),e(o)})}),destroy:function(){c(),s=!0}};if(!MS(e,t))return l;function c(){a.forEach(function(e){return e()}),a=[]}return l.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)}),l}}var WS={passive:!0};const BS={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,s=void 0===a||a,l=Qw(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(e){e.addEventListener("scroll",n.update,WS)}),s&&l.addEventListener("resize",n.update,WS),function(){i&&c.forEach(function(e){e.removeEventListener("scroll",n.update,WS)}),s&&l.removeEventListener("resize",n.update,WS)}},data:{}};function US(e){return e.split("-")[0]}function VS(e){return e.split("-")[1]}function HS(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function qS(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?US(o):null,a=o?VS(o):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case SS:t={x:s,y:n.y-r.height};break;case jS:t={x:s,y:n.y+n.height};break;case kS:t={x:n.x+n.width,y:l};break;case CS:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?HS(i):null;if(null!=c){var d="y"===c?"height":"width";switch(a){case zS:t[c]=t[c]-(n[d]/2-r[d]/2);break;case RS:t[c]=t[c]+(n[d]/2-r[d]/2)}}return t}const $S={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=qS({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var YS={top:"auto",right:"auto",bottom:"auto",left:"auto"};function KS(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,u=e.isFixed,h=a.x,p=void 0===h?0:h,f=a.y,m=void 0===f?0:f,g="function"===typeof d?d({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var v=a.hasOwnProperty("x"),x=a.hasOwnProperty("y"),b=CS,y=SS,w=window;if(c){var S=wS(n),j="clientHeight",k="clientWidth";if(S===Qw(n)&&"static"!==hS(S=dS(n)).position&&"absolute"===s&&(j="scrollHeight",k="scrollWidth"),o===SS||(o===CS||o===kS)&&i===RS)y=jS,m-=(u&&S===w&&w.visualViewport?w.visualViewport.height:S[j])-r.height,m*=l?1:-1;if(o===CS||(o===SS||o===jS)&&i===RS)b=kS,p-=(u&&S===w&&w.visualViewport?w.visualViewport.width:S[k])-r.width,p*=l?1:-1}var C,E=Object.assign({position:s},c&&YS),_=!0===d?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:oS(n*o)/o||0,y:oS(r*o)/o||0}}({x:p,y:m},Qw(n)):{x:p,y:m};return p=_.x,m=_.y,l?Object.assign({},E,((C={})[y]=x?"0":"",C[b]=v?"0":"",C.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",C)):Object.assign({},E,((t={})[y]=x?m+"px":"",t[b]=v?p+"px":"",t.transform="",t))}const XS={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,l=void 0===s||s,c={placement:US(t.placement),variation:VS(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,KS(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,KS(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};const GS={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];eS(o)&&cS(o)&&(Object.assign(o.style,n),Object.keys(r).forEach(function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});eS(r)&&cS(r)&&(Object.assign(r.style,i),Object.keys(o).forEach(function(e){r.removeAttribute(e)}))})}},requires:["computeStyles"]};const JS={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=OS.reduce(function(e,n){return e[n]=function(e,t,n){var r=US(e),o=[CS,SS].indexOf(r)>=0?-1:1,i="function"===typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[CS,kS].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e},{}),s=a[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}};var QS={left:"right",right:"left",bottom:"top",top:"bottom"};function ZS(e){return e.replace(/left|right|bottom|top/g,function(e){return QS[e]})}var ej={start:"end",end:"start"};function tj(e){return e.replace(/start|end/g,function(e){return ej[e]})}function nj(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&tS(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function rj(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function oj(e,t,n){return t===AS?rj(function(e,t){var n=Qw(e),r=dS(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var c=aS();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+uS(e),y:l}}(e,n)):Zw(t)?function(e,t){var n=sS(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):rj(function(e){var t,n=dS(e),r=lS(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=nS(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=nS(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+uS(e),l=-r.scrollTop;return"rtl"===hS(o||n).direction&&(s+=nS(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(dS(e)))}function ij(e,t,n,r){var o="clippingParents"===t?function(e){var t=xS(gS(e)),n=["absolute","fixed"].indexOf(hS(e).position)>=0&&eS(e)?wS(e):e;return Zw(n)?t.filter(function(e){return Zw(e)&&nj(e,n)&&"body"!==cS(e)}):[]}(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce(function(t,n){var o=oj(e,n,r);return t.top=nS(o.top,t.top),t.right=rS(o.right,t.right),t.bottom=rS(o.bottom,t.bottom),t.left=nS(o.left,t.left),t},oj(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function aj(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function sj(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}function lj(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.strategy,a=void 0===i?e.strategy:i,s=n.boundary,l=void 0===s?"clippingParents":s,c=n.rootBoundary,d=void 0===c?AS:c,u=n.elementContext,h=void 0===u?TS:u,p=n.altBoundary,f=void 0!==p&&p,m=n.padding,g=void 0===m?0:m,v=aj("number"!==typeof g?g:sj(g,_S)),x=h===TS?"reference":TS,b=e.rects.popper,y=e.elements[f?x:h],w=ij(Zw(y)?y:y.contextElement||dS(e.elements.popper),l,d,a),S=sS(e.elements.reference),j=qS({reference:S,element:b,strategy:"absolute",placement:o}),k=rj(Object.assign({},b,j)),C=h===TS?k:S,E={top:w.top-C.top+v.top,bottom:C.bottom-w.bottom+v.bottom,left:w.left-C.left+v.left,right:C.right-w.right+v.right},_=e.modifiersData.offset;if(h===TS&&_){var z=_[o];Object.keys(E).forEach(function(e){var t=[kS,jS].indexOf(e)>=0?1:-1,n=[SS,jS].indexOf(e)>=0?"y":"x";E[e]+=z[n]*t})}return E}const cj={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,d=n.boundary,u=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,f=void 0===p||p,m=n.allowedAutoPlacements,g=t.options.placement,v=US(g),x=l||(v===g||!f?[ZS(g)]:function(e){if(US(e)===ES)return[];var t=ZS(e);return[tj(e),t,tj(t)]}(g)),b=[g].concat(x).reduce(function(e,n){return e.concat(US(n)===ES?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?OS:l,d=VS(r),u=d?s?PS:PS.filter(function(e){return VS(e)===d}):_S,h=u.filter(function(e){return c.indexOf(e)>=0});0===h.length&&(h=u);var p=h.reduce(function(t,n){return t[n]=lj(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[US(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}(t,{placement:n,boundary:d,rootBoundary:u,padding:c,flipVariations:f,allowedAutoPlacements:m}):n)},[]),y=t.rects.reference,w=t.rects.popper,S=new Map,j=!0,k=b[0],C=0;C<b.length;C++){var E=b[C],_=US(E),z=VS(E)===zS,R=[SS,jS].indexOf(_)>=0,A=R?"width":"height",T=lj(t,{placement:E,boundary:d,rootBoundary:u,altBoundary:h,padding:c}),P=R?z?kS:CS:z?jS:SS;y[A]>w[A]&&(P=ZS(P));var O=ZS(P),L=[];if(i&&L.push(T[_]<=0),s&&L.push(T[P]<=0,T[O]<=0),L.every(function(e){return e})){k=E,j=!1;break}S.set(E,L)}if(j)for(var D=function(e){var t=b.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return k=t,"break"},I=f?3:1;I>0;I--){if("break"===D(I))break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function dj(e,t,n){return nS(e,rS(t,n))}const uj={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,d=n.altBoundary,u=n.padding,h=n.tether,p=void 0===h||h,f=n.tetherOffset,m=void 0===f?0:f,g=lj(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),v=US(t.placement),x=VS(t.placement),b=!x,y=HS(v),w="x"===y?"y":"x",S=t.modifiersData.popperOffsets,j=t.rects.reference,k=t.rects.popper,C="function"===typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,E="number"===typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),_=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,z={x:0,y:0};if(S){if(i){var R,A="y"===y?SS:CS,T="y"===y?jS:kS,P="y"===y?"height":"width",O=S[y],L=O+g[A],D=O-g[T],I=p?-k[P]/2:0,N=x===zS?j[P]:k[P],M=x===zS?-k[P]:-j[P],F=t.elements.arrow,W=p&&F?mS(F):{width:0,height:0},B=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},U=B[A],V=B[T],H=dj(0,j[P],W[P]),q=b?j[P]/2-I-H-U-E.mainAxis:N-H-U-E.mainAxis,$=b?-j[P]/2+I+H+V+E.mainAxis:M+H+V+E.mainAxis,Y=t.elements.arrow&&wS(t.elements.arrow),K=Y?"y"===y?Y.clientTop||0:Y.clientLeft||0:0,X=null!=(R=null==_?void 0:_[y])?R:0,G=O+$-X,J=dj(p?rS(L,O+q-X-K):L,O,p?nS(D,G):D);S[y]=J,z[y]=J-O}if(s){var Q,Z="x"===y?SS:CS,ee="x"===y?jS:kS,te=S[w],ne="y"===w?"height":"width",re=te+g[Z],oe=te-g[ee],ie=-1!==[SS,CS].indexOf(v),ae=null!=(Q=null==_?void 0:_[w])?Q:0,se=ie?re:te-j[ne]-k[ne]-ae+E.altAxis,le=ie?te+j[ne]+k[ne]-ae-E.altAxis:oe,ce=p&&ie?function(e,t,n){var r=dj(e,t,n);return r>n?n:r}(se,te,le):dj(p?se:re,te,p?le:oe);S[w]=ce,z[w]=ce-te}t.modifiersData[r]=z}},requiresIfExists:["offset"]};const hj={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=US(n.placement),l=HS(s),c=[CS,kS].indexOf(s)>=0?"height":"width";if(i&&a){var d=function(e,t){return aj("number"!==typeof(e="function"===typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:sj(e,_S))}(o.padding,n),u=mS(i),h="y"===l?SS:CS,p="y"===l?jS:kS,f=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],m=a[l]-n.rects.reference[l],g=wS(i),v=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,x=f/2-m/2,b=d[h],y=v-u[c]-d[p],w=v/2-u[c]/2+x,S=dj(b,w,y),j=l;n.modifiersData[r]=((t={})[j]=S,t.centerOffset=S-w,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!==typeof r||(r=t.elements.popper.querySelector(r)))&&nj(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function pj(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function fj(e){return[SS,kS,jS,CS].some(function(t){return e[t]>=0})}const mj={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=lj(t,{elementContext:"reference"}),s=lj(t,{altBoundary:!0}),l=pj(a,r),c=pj(s,o,i),d=fj(l),u=fj(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}};var gj=FS({defaultModifiers:[BS,$S,XS,GS,JS,cj,uj,hj,mj]});const vj=(e,t)=>({var:e,varRef:t?"var(".concat(e,", ").concat(t,")"):"var(".concat(e,")")}),xj={arrowShadowColor:vj("--popper-arrow-shadow-color"),arrowSize:vj("--popper-arrow-size","8px"),arrowSizeHalf:vj("--popper-arrow-size-half"),arrowBg:vj("--popper-arrow-bg"),transformOrigin:vj("--popper-transform-origin"),arrowOffset:vj("--popper-arrow-offset")};const bj={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},yj={scroll:!0,resize:!0};function wj(e){let t;return t="object"===typeof e?{enabled:!0,options:p(p({},yj),e)}:{enabled:e,options:yj},t}const Sj={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:e=>{let{state:t}=e;t.styles.popper.width="".concat(t.rects.reference.width,"px")},effect:e=>{let{state:t}=e;return()=>{const e=t.elements.reference;t.elements.popper.style.width="".concat(e.offsetWidth,"px")}}},jj={name:"transformOrigin",enabled:!0,phase:"write",fn:e=>{let{state:t}=e;kj(t)},effect:e=>{let{state:t}=e;return()=>{kj(t)}}},kj=e=>{var t;e.elements.popper.style.setProperty(xj.transformOrigin.var,(t=e.placement,bj[t]))},Cj={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:e=>{let{state:t}=e;Ej(t)}},Ej=e=>{var t;if(!e.placement)return;const n=_j(e.placement);if(null!==(t=e.elements)&&void 0!==t&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:xj.arrowSize.varRef,height:xj.arrowSize.varRef,zIndex:-1});const t={[xj.arrowSizeHalf.var]:"calc(".concat(xj.arrowSize.varRef," / 2 - 1px)"),[xj.arrowOffset.var]:"calc(".concat(xj.arrowSizeHalf.varRef," * -1)")};for(const n in t)e.elements.arrow.style.setProperty(n,t[n])}},_j=e=>e.startsWith("top")?{property:"bottom",value:xj.arrowOffset.varRef}:e.startsWith("bottom")?{property:"top",value:xj.arrowOffset.varRef}:e.startsWith("left")?{property:"right",value:xj.arrowOffset.varRef}:e.startsWith("right")?{property:"left",value:xj.arrowOffset.varRef}:void 0,zj={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:e=>{let{state:t}=e;Rj(t)},effect:e=>{let{state:t}=e;return()=>{Rj(t)}}},Rj=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=(r=e.placement).includes("top")?"1px 1px 0px 0 var(--popper-arrow-shadow-color)":r.includes("bottom")?"-1px -1px 0px 0 var(--popper-arrow-shadow-color)":r.includes("right")?"-1px 1px 0px 0 var(--popper-arrow-shadow-color)":r.includes("left")?"1px -1px 0px 0 var(--popper-arrow-shadow-color)":void 0;var r;n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:xj.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},Aj={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},Tj={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};const Pj=["size","shadowColor","bg","style"];function Oj(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{enabled:n=!0,modifiers:r,placement:o="bottom",strategy:i="absolute",arrowPadding:a=8,eventListeners:s=!0,offset:l,gutter:c=8,flip:d=!0,boundary:u="clippingParents",preventOverflow:h=!0,matchWidth:f,direction:m="ltr"}=e,g=(0,t.useRef)(null),v=(0,t.useRef)(null),x=(0,t.useRef)(null),b=function(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ltr";const o=(null===(t=Aj[e])||void 0===t?void 0:t[r])||e;return"ltr"===r?o:null!==(n=Tj[e])&&void 0!==n?n:o}(o,m),y=(0,t.useRef)(()=>{}),w=(0,t.useCallback)(()=>{var e;n&&g.current&&v.current&&(null===(e=y.current)||void 0===e||e.call(y),x.current=gj(g.current,v.current,{placement:b,modifiers:[zj,Cj,jj,p(p({},Sj),{},{enabled:!!f}),p({name:"eventListeners"},wj(s)),{name:"arrow",options:{padding:a}},{name:"offset",options:{offset:null!==l&&void 0!==l?l:[0,c]}},{name:"flip",enabled:!!d,options:{padding:8}},{name:"preventOverflow",enabled:!!h,options:{boundary:u}},...null!==r&&void 0!==r?r:[]],strategy:i}),x.current.forceUpdate(),y.current=x.current.destroy)},[b,n,r,f,s,a,l,c,d,h,u,i]);(0,t.useEffect)(()=>()=>{var e;g.current||v.current||(null===(e=x.current)||void 0===e||e.destroy(),x.current=null)},[]);const S=(0,t.useCallback)(e=>{g.current=e,w()},[w]),j=(0,t.useCallback)(function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{ref:Rw(S,e)})},[S]),k=(0,t.useCallback)(e=>{v.current=e,w()},[w]),C=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},e),{},{ref:Rw(k,t),style:p(p({},e.style),{},{position:i,minWidth:f?void 0:"max-content",inset:"0 auto auto 0"})})},[i,k,f]),E=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{size:n,shadowColor:r,bg:o,style:i}=e;return p(p({},Ki(e,Pj)),{},{ref:t,"data-popper-arrow":"",style:Lj(e)})},[]),_=(0,t.useCallback)(function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{ref:e,"data-popper-arrow-inner":""})},[]);return{update(){var e;null===(e=x.current)||void 0===e||e.update()},forceUpdate(){var e;null===(e=x.current)||void 0===e||e.forceUpdate()},transformOrigin:xj.transformOrigin.varRef,referenceRef:S,popperRef:k,getPopperProps:C,getArrowProps:E,getArrowInnerProps:_,getReferenceProps:j}}function Lj(e){const{size:t,shadowColor:n,bg:r,style:o}=e,i=p(p({},o),{},{position:"absolute"});return t&&(i["--popper-arrow-size"]=t),n&&(i["--popper-arrow-shadow-color"]=n),r&&(i["--popper-arrow-bg"]=r),i}const Dj=["openDelay","closeDelay","closeOnClick","closeOnMouseDown","closeOnScroll","closeOnPointerDown","closeOnEsc","onOpen","onClose","placement","id","isOpen","defaultIsOpen","arrowSize","arrowShadowColor","arrowPadding","modifiers","isDisabled","gutter","offset","direction"],Ij=e=>{var t;return(null===(t=e.current)||void 0===t?void 0:t.ownerDocument)||document},Nj=e=>{var t;return(null===(t=e.current)||void 0===t||null===(t=t.ownerDocument)||void 0===t?void 0:t.defaultView)||window};function Mj(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{openDelay:n=0,closeDelay:r=0,closeOnClick:o=!0,closeOnMouseDown:i,closeOnScroll:a,closeOnPointerDown:s=i,closeOnEsc:l=!0,onOpen:c,onClose:d,placement:u,id:h,isOpen:f,defaultIsOpen:m,arrowSize:g=10,arrowShadowColor:v,arrowPadding:x,modifiers:b,isDisabled:y,gutter:w,offset:S,direction:j}=e,k=Ki(e,Dj),{isOpen:C,onOpen:E,onClose:_}=Yw({isOpen:f,defaultIsOpen:m,onOpen:c,onClose:d}),{referenceRef:z,getPopperProps:R,getArrowInnerProps:A,getArrowProps:T}=Oj({enabled:C,placement:u,arrowPadding:x,modifiers:b,gutter:w,offset:S,direction:j}),P=(0,t.useId)(),O="tooltip-".concat(null!==h&&void 0!==h?h:P),L=(0,t.useRef)(null),D=(0,t.useRef)(void 0),I=(0,t.useCallback)(()=>{D.current&&(clearTimeout(D.current),D.current=void 0)},[]),N=(0,t.useRef)(void 0),M=(0,t.useCallback)(()=>{N.current&&(clearTimeout(N.current),N.current=void 0)},[]),F=(0,t.useCallback)(()=>{M(),_()},[_,M]),W=function(e,n){return(0,t.useEffect)(()=>{const t=Ij(e);return t.addEventListener(Fj,n),()=>t.removeEventListener(Fj,n)},[n,e]),()=>{const t=Ij(e),n=Nj(e);t.dispatchEvent(new n.CustomEvent(Fj))}}(L,F),B=(0,t.useCallback)(()=>{if(!y&&!D.current){C&&W();const e=Nj(L);D.current=e.setTimeout(E,n)}},[W,y,C,E,n]),U=(0,t.useCallback)(()=>{I();const e=Nj(L);N.current=e.setTimeout(F,r)},[r,F,I]),V=(0,t.useCallback)(()=>{C&&o&&U()},[o,U,C]),H=(0,t.useCallback)(()=>{C&&s&&U()},[s,U,C]),q=(0,t.useCallback)(e=>{C&&"Escape"===e.key&&U()},[C,U]);Kw(()=>Ij(L),"keydown",l?q:void 0),Kw(()=>{if(!a)return null;const e=L.current;if(!e)return null;const t=Xw(e);return"body"===t.localName?Nj(L):t},"scroll",()=>{C&&a&&F()},{passive:!0,capture:!0}),(0,t.useEffect)(()=>{y&&(I(),C&&_())},[y,C,_,I]),(0,t.useEffect)(()=>()=>{I(),M()},[I,M]),Kw(()=>L.current,"pointerleave",U);const $=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},e),{},{ref:Rw(L,t,z),onPointerEnter:Jw(e.onPointerEnter,e=>{"touch"!==e.pointerType&&B()}),onClick:Jw(e.onClick,V),onPointerDown:Jw(e.onPointerDown,H),onFocus:Jw(e.onFocus,B),onBlur:Jw(e.onBlur,U),"aria-describedby":C?O:void 0})},[B,U,H,C,O,V,z]),Y=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return R(p(p({},e),{},{style:p(p({},e.style),{},{[xj.arrowSize.var]:g?"".concat(g,"px"):void 0,[xj.arrowShadowColor.var]:v})}),t)},[R,g,v]),K=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=p(p({},e.style),{},{position:"relative",transformOrigin:xj.transformOrigin.varRef});return p(p(p({ref:t},k),e),{},{id:O,role:"tooltip",style:n})},[k,O]);return{isOpen:C,show:B,hide:U,getTriggerProps:$,getTooltipProps:K,getTooltipPositionerProps:Y,getArrowProps:T,getArrowInnerProps:A}}const Fj="chakra-ui:close-tooltip";const Wj=["children","label","shouldWrapChildren","aria-label","hasArrow","bg","portalProps","background","backgroundColor","bgColor","motionProps","animatePresenceProps"],Bj=Rv(av.div),Uj=Dv((e,n)=>{var r,o;const a=Hv("Tooltip",e),s=Ov(e),l=Fv(),{children:c,label:d,shouldWrapChildren:u,"aria-label":h,hasArrow:f,bg:m,portalProps:g,background:v,backgroundColor:x,bgColor:b,motionProps:y,animatePresenceProps:w}=s,S=Ki(s,Wj),j=null!==(r=null!==(o=null!==v&&void 0!==v?v:x)&&void 0!==o?o:m)&&void 0!==r?r:b;if(j){a.bg=j;const e=function(e,t,n){var r,o;return null!==(r=null===(o=e.__cssMap)||void 0===o||null===(o=o["".concat(t,".").concat(n)])||void 0===o?void 0:o.varRef)&&void 0!==r?r:n}(l,"colors",j);a[xj.arrowBg.var]=e}const k=Mj(p(p({},S),{},{direction:l.direction}));let C;if(!(0,t.isValidElement)(c)||u)C=(0,i.jsx)(Rv.span,p(p({display:"inline-block",tabIndex:0},k.getTriggerProps()),{},{children:c}));else{const e=t.Children.only(c);C=(0,t.cloneElement)(e,k.getTriggerProps(e.props,function(e){var n;const r=t.version;return"string"!==typeof r||r.startsWith("18.")?null===e||void 0===e?void 0:e.ref:null===e||void 0===e||null===(n=e.props)||void 0===n?void 0:n.ref}(e)))}const E=!!h,_=k.getTooltipProps({},n),z=E?Pv(_,["role","id"]):_,R=Cl(_,["role","id"]);return d?(0,i.jsxs)(i.Fragment,{children:[C,(0,i.jsx)(ld,p(p({},w),{},{children:k.isOpen&&(0,i.jsx)(Cx,p(p({},g),{},{children:(0,i.jsx)(Rv.div,p(p({},k.getTooltipPositionerProps()),{},{__css:{zIndex:a.zIndex,pointerEvents:"none"},children:(0,i.jsxs)(Bj,p(p(p({variants:$w,initial:"exit",animate:"enter",exit:"exit"},y),z),{},{__css:a,children:[d,E&&(0,i.jsx)(Rv.span,p(p({srOnly:!0},R),{},{children:h})),f&&(0,i.jsx)(Rv.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:(0,i.jsx)(Rv.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:a.bg}})})]}))}))}))}))]}):(0,i.jsx)(i.Fragment,{children:c})});Uj.displayName="Tooltip";var Vj={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Hj=t.createContext&&t.createContext(Vj),qj=["attr","size","title"];function $j(){return $j=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},$j.apply(null,arguments)}function Yj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Kj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yj(Object(n),!0).forEach(function(t){Xj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Xj(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gj(e){return e&&e.map((e,n)=>t.createElement(e.tag,Kj({key:n},e.attr),Gj(e.child)))}function Jj(e){return n=>t.createElement(Qj,$j({attr:Kj({},e.attr)},n),Gj(e.child))}function Qj(e){var n=n=>{var r,o=e.attr,i=e.size,a=e.title,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,qj),l=i||n.size||"1em";return n.className&&(r=n.className),e.className&&(r=(r?r+" ":"")+e.className),t.createElement("svg",$j({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,o,s,{className:r,style:Kj(Kj({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&t.createElement("title",null,a),e.children)};return void 0!==Hj?t.createElement(Hj.Consumer,null,e=>n(e)):n(Vj)}function Zj(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"},child:[]}]})(e)}function ek(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}function tk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"15",y1:"9",x2:"9",y2:"15"},child:[]},{tag:"line",attr:{x1:"9",y1:"9",x2:"15",y2:"15"},child:[]}]})(e)}function nk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M5 12.55a11 11 0 0 1 14.08 0"},child:[]},{tag:"path",attr:{d:"M1.42 9a16 16 0 0 1 21.16 0"},child:[]},{tag:"path",attr:{d:"M8.53 16.11a6 6 0 0 1 6.95 0"},child:[]},{tag:"line",attr:{x1:"12",y1:"20",x2:"12.01",y2:"20"},child:[]}]})(e)}function rk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"17 8 12 3 7 8"},child:[]},{tag:"line",attr:{x1:"12",y1:"3",x2:"12",y2:"15"},child:[]}]})(e)}function ok(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"16 16 12 12 8 16"},child:[]},{tag:"line",attr:{x1:"12",y1:"12",x2:"12",y2:"21"},child:[]},{tag:"path",attr:{d:"M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"},child:[]},{tag:"polyline",attr:{points:"16 16 12 12 8 16"},child:[]}]})(e)}function ik(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M7 11V7a5 5 0 0 1 9.9-1"},child:[]}]})(e)}function ak(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"4 7 4 4 20 4 20 7"},child:[]},{tag:"line",attr:{x1:"9",y1:"20",x2:"15",y2:"20"},child:[]},{tag:"line",attr:{x1:"12",y1:"4",x2:"12",y2:"20"},child:[]}]})(e)}function sk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"},child:[]},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},child:[]},{tag:"line",attr:{x1:"10",y1:"11",x2:"10",y2:"17"},child:[]},{tag:"line",attr:{x1:"14",y1:"11",x2:"14",y2:"17"},child:[]}]})(e)}function lk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"4 17 10 11 4 5"},child:[]},{tag:"line",attr:{x1:"12",y1:"19",x2:"20",y2:"19"},child:[]}]})(e)}function ck(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"6"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"2"},child:[]}]})(e)}function dk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"4",y:"2",width:"16",height:"20",rx:"2",ry:"2"},child:[]},{tag:"line",attr:{x1:"12",y1:"18",x2:"12.01",y2:"18"},child:[]}]})(e)}function uk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"5"},child:[]},{tag:"line",attr:{x1:"12",y1:"1",x2:"12",y2:"3"},child:[]},{tag:"line",attr:{x1:"12",y1:"21",x2:"12",y2:"23"},child:[]},{tag:"line",attr:{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"},child:[]},{tag:"line",attr:{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"},child:[]},{tag:"line",attr:{x1:"1",y1:"12",x2:"3",y2:"12"},child:[]},{tag:"line",attr:{x1:"21",y1:"12",x2:"23",y2:"12"},child:[]},{tag:"line",attr:{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"},child:[]},{tag:"line",attr:{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"},child:[]}]})(e)}function hk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"rect",attr:{x:"9",y:"9",width:"6",height:"6"},child:[]}]})(e)}function pk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"},child:[]}]})(e)}function fk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"},child:[]},{tag:"line",attr:{x1:"12",y1:"18",x2:"12.01",y2:"18"},child:[]}]})(e)}function mk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"4.93",y1:"4.93",x2:"19.07",y2:"19.07"},child:[]}]})(e)}function gk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"},child:[]}]})(e)}function vk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"22",y1:"2",x2:"11",y2:"13"},child:[]},{tag:"polygon",attr:{points:"22 2 15 22 11 13 2 9 22 2"},child:[]}]})(e)}function xk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"line",attr:{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},child:[]}]})(e)}function bk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"},child:[]},{tag:"polyline",attr:{points:"17 21 17 13 7 13 7 21"},child:[]},{tag:"polyline",attr:{points:"7 3 7 8 15 8"},child:[]}]})(e)}function yk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"23 4 23 10 17 10"},child:[]},{tag:"path",attr:{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"},child:[]}]})(e)}function wk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"1 4 1 10 7 10"},child:[]},{tag:"path",attr:{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"},child:[]}]})(e)}function Sk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"23 4 23 10 17 10"},child:[]},{tag:"polyline",attr:{points:"1 20 1 14 7 14"},child:[]},{tag:"path",attr:{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"},child:[]}]})(e)}function jk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18.36 6.64a9 9 0 1 1-12.73 0"},child:[]},{tag:"line",attr:{x1:"12",y1:"2",x2:"12",y2:"12"},child:[]}]})(e)}function kk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"5",x2:"12",y2:"19"},child:[]},{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"},child:[]}]})(e)}function Ck(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"5 3 19 12 5 21 5 3"},child:[]}]})(e)}function Ek(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"6",y:"4",width:"4",height:"16"},child:[]},{tag:"rect",attr:{x:"14",y:"4",width:"4",height:"16"},child:[]}]})(e)}function _k(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.21"},child:[]},{tag:"path",attr:{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"},child:[]},{tag:"polyline",attr:{points:"3.27 6.96 12 12.01 20.73 6.96"},child:[]},{tag:"line",attr:{x1:"12",y1:"22.08",x2:"12",y2:"12"},child:[]}]})(e)}function zk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"5 9 2 12 5 15"},child:[]},{tag:"polyline",attr:{points:"9 5 12 2 15 5"},child:[]},{tag:"polyline",attr:{points:"15 19 12 22 9 19"},child:[]},{tag:"polyline",attr:{points:"19 9 22 12 19 15"},child:[]},{tag:"line",attr:{x1:"2",y1:"12",x2:"22",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"2",x2:"12",y2:"22"},child:[]}]})(e)}function Rk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"},child:[]},{tag:"path",attr:{d:"M13 13l6 6"},child:[]}]})(e)}function Ak(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"1"},child:[]},{tag:"circle",attr:{cx:"12",cy:"5",r:"1"},child:[]},{tag:"circle",attr:{cx:"12",cy:"19",r:"1"},child:[]}]})(e)}function Tk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"},child:[]}]})(e)}function Pk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"},child:[]},{tag:"line",attr:{x1:"8",y1:"21",x2:"16",y2:"21"},child:[]},{tag:"line",attr:{x1:"12",y1:"17",x2:"12",y2:"21"},child:[]}]})(e)}function Ok(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"},child:[]}]})(e)}function Lk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"},child:[]},{tag:"path",attr:{d:"M19 10v2a7 7 0 0 1-14 0v-2"},child:[]},{tag:"line",attr:{x1:"12",y1:"19",x2:"12",y2:"23"},child:[]},{tag:"line",attr:{x1:"8",y1:"23",x2:"16",y2:"23"},child:[]}]})(e)}function Dk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"15 3 21 3 21 9"},child:[]},{tag:"polyline",attr:{points:"9 21 3 21 3 15"},child:[]},{tag:"line",attr:{x1:"21",y1:"3",x2:"14",y2:"10"},child:[]},{tag:"line",attr:{x1:"3",y1:"21",x2:"10",y2:"14"},child:[]}]})(e)}function Ik(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"},child:[]},{tag:"circle",attr:{cx:"12",cy:"10",r:"3"},child:[]}]})(e)}function Nk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M7 11V7a5 5 0 0 1 10 0v4"},child:[]}]})(e)}function Mk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"8",y1:"6",x2:"21",y2:"6"},child:[]},{tag:"line",attr:{x1:"8",y1:"12",x2:"21",y2:"12"},child:[]},{tag:"line",attr:{x1:"8",y1:"18",x2:"21",y2:"18"},child:[]},{tag:"line",attr:{x1:"3",y1:"6",x2:"3.01",y2:"6"},child:[]},{tag:"line",attr:{x1:"3",y1:"12",x2:"3.01",y2:"12"},child:[]},{tag:"line",attr:{x1:"3",y1:"18",x2:"3.01",y2:"18"},child:[]}]})(e)}function Fk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"12 2 2 7 12 12 22 7 12 2"},child:[]},{tag:"polyline",attr:{points:"2 17 12 22 22 17"},child:[]},{tag:"polyline",attr:{points:"2 12 12 17 22 12"},child:[]}]})(e)}function Wk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"},child:[]}]})(e)}function Bk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"12",y1:"16",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12.01",y2:"8"},child:[]}]})(e)}function Uk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"},child:[]},{tag:"polyline",attr:{points:"9 22 9 12 15 12 15 22"},child:[]}]})(e)}function Vk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"22",y1:"12",x2:"2",y2:"12"},child:[]},{tag:"path",attr:{d:"M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"},child:[]},{tag:"line",attr:{x1:"6",y1:"16",x2:"6.01",y2:"16"},child:[]},{tag:"line",attr:{x1:"10",y1:"16",x2:"10.01",y2:"16"},child:[]}]})(e)}function Hk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"3",width:"7",height:"7"},child:[]},{tag:"rect",attr:{x:"14",y:"3",width:"7",height:"7"},child:[]},{tag:"rect",attr:{x:"14",y:"14",width:"7",height:"7"},child:[]},{tag:"rect",attr:{x:"3",y:"14",width:"7",height:"7"},child:[]}]})(e)}function qk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"},child:[]}]})(e)}function $k(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"},child:[]},{tag:"polyline",attr:{points:"14 2 14 8 20 8"},child:[]},{tag:"line",attr:{x1:"16",y1:"13",x2:"8",y2:"13"},child:[]},{tag:"line",attr:{x1:"16",y1:"17",x2:"8",y2:"17"},child:[]},{tag:"polyline",attr:{points:"10 9 9 9 8 9"},child:[]}]})(e)}function Yk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function Kk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},child:[]},{tag:"line",attr:{x1:"1",y1:"1",x2:"23",y2:"23"},child:[]}]})(e)}function Xk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"},child:[]},{tag:"polyline",attr:{points:"15 3 21 3 21 9"},child:[]},{tag:"line",attr:{x1:"10",y1:"14",x2:"21",y2:"3"},child:[]}]})(e)}function Gk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"},child:[]}]})(e)}function Jk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"7 10 12 15 17 10"},child:[]},{tag:"line",attr:{x1:"12",y1:"15",x2:"12",y2:"3"},child:[]}]})(e)}function Qk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"4",y:"4",width:"16",height:"16",rx:"2",ry:"2"},child:[]},{tag:"rect",attr:{x:"9",y:"9",width:"6",height:"6"},child:[]},{tag:"line",attr:{x1:"9",y1:"1",x2:"9",y2:"4"},child:[]},{tag:"line",attr:{x1:"15",y1:"1",x2:"15",y2:"4"},child:[]},{tag:"line",attr:{x1:"9",y1:"20",x2:"9",y2:"23"},child:[]},{tag:"line",attr:{x1:"15",y1:"20",x2:"15",y2:"23"},child:[]},{tag:"line",attr:{x1:"20",y1:"9",x2:"23",y2:"9"},child:[]},{tag:"line",attr:{x1:"20",y1:"14",x2:"23",y2:"14"},child:[]},{tag:"line",attr:{x1:"1",y1:"9",x2:"4",y2:"9"},child:[]},{tag:"line",attr:{x1:"1",y1:"14",x2:"4",y2:"14"},child:[]}]})(e)}function Zk(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 10 4 15 9 20"},child:[]},{tag:"path",attr:{d:"M20 4v7a4 4 0 0 1-4 4H4"},child:[]}]})(e)}function eC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"},child:[]}]})(e)}function tC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"polygon",attr:{points:"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"},child:[]}]})(e)}function nC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"16 18 22 12 16 6"},child:[]},{tag:"polyline",attr:{points:"8 6 2 12 8 18"},child:[]}]})(e)}function rC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"polyline",attr:{points:"12 6 12 12 16 14"},child:[]}]})(e)}function oC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]}]})(e)}function iC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"18 15 12 9 6 15"},child:[]}]})(e)}function aC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 18 15 12 9 6"},child:[]}]})(e)}function sC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"15 18 9 12 15 6"},child:[]}]})(e)}function lC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"6 9 12 15 18 9"},child:[]}]})(e)}function cC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"20 6 9 17 4 12"},child:[]}]})(e)}function dC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"},child:[]},{tag:"polyline",attr:{points:"22 4 12 14.01 9 11.01"},child:[]}]})(e)}function uC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"},child:[]},{tag:"circle",attr:{cx:"12",cy:"13",r:"4"},child:[]}]})(e)}function hC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"},child:[]},{tag:"path",attr:{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"},child:[]}]})(e)}function pC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"19",x2:"12",y2:"5"},child:[]},{tag:"polyline",attr:{points:"5 12 12 5 19 12"},child:[]}]})(e)}function fC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"},child:[]},{tag:"polyline",attr:{points:"12 5 19 12 12 19"},child:[]}]})(e)}function mC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"19",y1:"12",x2:"5",y2:"12"},child:[]},{tag:"polyline",attr:{points:"12 19 5 12 12 5"},child:[]}]})(e)}function gC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"},child:[]},{tag:"line",attr:{x1:"12",y1:"9",x2:"12",y2:"13"},child:[]},{tag:"line",attr:{x1:"12",y1:"17",x2:"12.01",y2:"17"},child:[]}]})(e)}function vC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"16",x2:"12.01",y2:"16"},child:[]}]})(e)}function xC(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"22 12 18 12 15 21 9 3 6 12 2 12"},child:[]}]})(e)}function bC(){return"undefined"!==typeof window}function yC(){try{const e="production";if("development"===e||"test"===e)return"development"}catch(kF){}return"production"}function wC(){return(bC()?window.vam:yC())||"production"}function SC(){return"development"===wC()}function jC(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{debug:!0};var t;if(!bC())return;!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto";window.vam="auto"!==e?e:yC()}(e.mode),window.va||(window.va=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(window.vaq=window.vaq||[]).push(t)}),e.beforeSend&&(null==(t=window.va)||t.call(window,"beforeSend",e.beforeSend));const n=function(e){return e.scriptSrc?e.scriptSrc:SC()?"https://va.vercel-scripts.com/v1/script.debug.js":e.basePath?"".concat(e.basePath,"/insights/script.js"):"/_vercel/insights/script.js"}(e);if(document.head.querySelector('script[src*="'.concat(n,'"]')))return;const r=document.createElement("script");r.src=n,r.defer=!0,r.dataset.sdkn="@vercel/analytics"+(e.framework?"/".concat(e.framework):""),r.dataset.sdkv="1.6.1",e.disableAutoTrack&&(r.dataset.disableAutoTrack="1"),e.endpoint?r.dataset.endpoint=e.endpoint:e.basePath&&(r.dataset.endpoint="".concat(e.basePath,"/insights")),e.dsn&&(r.dataset.dsn=e.dsn),r.onerror=()=>{const e=SC()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log("[Vercel Web Analytics] Failed to load script from ".concat(n,". ").concat(e))},SC()&&!1===e.debug&&(r.dataset.debug="false"),document.head.appendChild(r)}function kC(){if("undefined"!==typeof process)return{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function CC(e){return(0,t.useEffect)(()=>{var t;e.beforeSend&&(null==(t=window.va)||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),(0,t.useEffect)(()=>{var t;jC(p(p({framework:e.framework||"react",basePath:null!==(t=e.basePath)&&void 0!==t?t:kC()},void 0!==e.route&&{disableAutoTrack:!0}),e))},[]),(0,t.useEffect)(()=>{e.route&&e.path&&function(e){let{route:t,path:n}=e;var r;null==(r=window.va)||r.call(window,"pageview",{route:t,path:n})}({route:e.route,path:e.path})},[e.route,e.path]),null}const EC=[{view:"control",label:"Control",icon:fk},{view:"recordings",label:"Recordings",icon:function(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"2",y:"2",width:"20",height:"20",rx:"2.18",ry:"2.18"},child:[]},{tag:"line",attr:{x1:"7",y1:"2",x2:"7",y2:"22"},child:[]},{tag:"line",attr:{x1:"17",y1:"2",x2:"17",y2:"22"},child:[]},{tag:"line",attr:{x1:"2",y1:"12",x2:"22",y2:"12"},child:[]},{tag:"line",attr:{x1:"2",y1:"7",x2:"7",y2:"7"},child:[]},{tag:"line",attr:{x1:"2",y1:"17",x2:"7",y2:"17"},child:[]},{tag:"line",attr:{x1:"17",y1:"17",x2:"22",y2:"17"},child:[]},{tag:"line",attr:{x1:"17",y1:"7",x2:"22",y2:"7"},child:[]}]})(e)}},{view:"settings",label:"Settings",icon:function(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},child:[]}]})(e)}}],_C=e=>{e.preventDefault();const t=document.getElementById("main-content");t&&t.focus()},zC=e=>{let{isBackendAvailable:t,isConnected:n,onlineCount:r,totalCount:o,agentCount:a=0}=e,s="green",l="Server \xb7 ".concat(r,"/").concat(o," device").concat(1===o?"":"s"," online").concat(a>0?" \xb7 \ud83e\udd16 ".concat(a," agent").concat(1===a?"":"s"):""),c="Backend reachable and live updates connected.";return t?n||(s="orange",l="Reconnecting\u2026",c="Backend reachable, live connection is being restored."):(s="red",l="Server offline",c="The Devicely backend is not reachable. Run `devicely start`."),(0,i.jsx)(Uj,{label:c,children:(0,i.jsxs)(Ew,{role:"status","aria-live":"polite",spacing:2,px:3,py:1,borderRadius:"full",borderWidth:"1px",borderColor:"".concat(s,".300"),bg:"".concat(s,".50"),_dark:{bg:"".concat(s,".900"),borderColor:"".concat(s,".600")},"data-testid":"connection-pill",children:[(0,i.jsx)(mw,{w:2,h:2,borderRadius:"full",bg:"".concat(s,".500"),flexShrink:0}),(0,i.jsx)(Cw,{fontSize:"xs",fontWeight:"600",color:"".concat(s,".800"),_dark:{color:"".concat(s,".100")},whiteSpace:"nowrap",children:l})]})})},RC=e=>{let{view:t="control",onNavigate:n,isBackendAvailable:r=!0,isConnected:o=!0,onlineCount:a=0,totalCount:s=0,isRecording:l=!1,recordingCommandCount:c=0,agentCount:d=0}=e;const{colorMode:u,toggleColorMode:h}=As(),f=Ts("gray.200","gray.700"),m=Ts("white","gray.900"),g="linear(to-r, brand.500, brand.600)";return(0,i.jsxs)(mw,{as:"header",position:"relative",flexShrink:0,borderBottom:"1px",borderColor:f,bg:m,children:[(0,i.jsx)(mw,{as:"a",href:"#main-content",onClick:_C,position:"absolute",left:2,top:2,zIndex:2e3,px:3,py:2,bg:"brand.600",color:"white",borderRadius:"md",fontSize:"sm",fontWeight:"600",transform:"translateY(-200%)",_focus:{transform:"translateY(0)"},"data-testid":"skip-link",children:"Skip to main content"}),(0,i.jsxs)(fw,{px:4,h:"56px",align:"center",gap:6,children:[(0,i.jsxs)(Ew,{as:"a",href:"#/control",onClick:e=>{e.preventDefault(),null===n||void 0===n||n("control")},spacing:2,flexShrink:0,cursor:"pointer",textDecoration:"none",role:"link","aria-label":"Devicely - Return to Home screen",title:"Return to Home screen",transition:"all 0.15s ease-in-out",_hover:{textDecoration:"none",transform:"translateY(-1px)",opacity:.9},_active:{transform:"translateY(0)"},_focusVisible:{outline:"2px solid",outlineColor:"brand.500",borderRadius:"md"},"data-testid":"header-brand-home",children:[(0,i.jsx)(mw,{bgGradient:g,p:1.5,borderRadius:"md",display:"flex",boxShadow:"sm",children:(0,i.jsx)(Zj,{color:"white",size:16,"aria-hidden":"true"})}),(0,i.jsx)(Cw,{fontSize:"lg",fontWeight:"800",letterSpacing:"tight",bgGradient:g,bgClip:"text",userSelect:"none",children:"Devicely"})]}),(0,i.jsx)(Ew,{as:"nav","aria-label":"Primary",spacing:1,children:EC.map(e=>{let{view:r,label:o,icon:a}=e;const s=t===r;return(0,i.jsxs)(Ww,p(p({as:"a",href:"#/".concat(r),onClick:e=>{e.preventDefault(),null===n||void 0===n||n(r)},"aria-current":s?"page":void 0,size:"sm",variant:"ghost",colorScheme:"gray",leftIcon:(0,i.jsx)(a,{"aria-hidden":"true"}),fontWeight:s?"700":"500"},s&&{bg:"brand.50",color:"brand.700",_hover:{bg:"brand.100"},_dark:{bg:"whiteAlpha.200",color:"brand.200"}}),{},{children:[o,"control"===r&&l&&(0,i.jsxs)(mw,{as:"span",ml:2,px:1.5,borderRadius:"sm",bg:"red.500",color:"white",fontSize:"2xs",fontWeight:"700","aria-label":"Recording, ".concat(c," steps"),children:["REC ",c]})]}),r)})}),(0,i.jsx)(mw,{flex:"1"}),(0,i.jsx)(zC,{isBackendAvailable:r,isConnected:o,onlineCount:a,totalCount:s,agentCount:d}),(0,i.jsx)(Uj,{label:"Switch to ".concat("light"===u?"dark":"light"," mode"),children:(0,i.jsx)(qw,{"aria-label":"Switch to ".concat("light"===u?"dark":"light"," mode"),icon:"light"===u?(0,i.jsx)(Tk,{}):(0,i.jsx)(uk,{}),variant:"ghost",size:"sm",onClick:h})})]})]})},AC=e=>{const{condition:t,message:n}=e},TC={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},PC={position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},OC={position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},LC={position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},DC={position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}};function IC(e){var t;switch(null!==(t=null===e||void 0===e?void 0:e.direction)&&void 0!==t?t:"right"){case"right":default:return OC;case"left":return PC;case"bottom":return DC;case"top":return LC}}const NC={enter:{duration:.2,ease:TC.easeOut},exit:{duration:.1,ease:TC.easeIn}},MC=(e,t)=>p(p({},e),{},{delay:"number"===typeof t?t:null===t||void 0===t?void 0:t.enter}),FC=(e,t)=>p(p({},e),{},{delay:"number"===typeof t?t:null===t||void 0===t?void 0:t.exit}),WC=["in","unmountOnExit","animateOpacity","startingHeight","endingHeight","style","className","transition","transitionEnd","animatePresenceProps"],BC={exit:{height:{duration:.2,ease:TC.ease},opacity:{duration:.3,ease:TC.ease}},enter:{height:{duration:.3,ease:TC.ease},opacity:{duration:.4,ease:TC.ease}}},UC={exit:e=>{var t;let{animateOpacity:n,startingHeight:r,transition:o,transitionEnd:i,delay:a}=e;return p(p({},n&&{opacity:(s=r,null!=s&&parseInt(s.toString(),10)>0?1:0)}),{},{height:r,transitionEnd:null===i||void 0===i?void 0:i.exit,transition:null!==(t=null===o||void 0===o?void 0:o.exit)&&void 0!==t?t:FC(BC.exit,a)});var s},enter:e=>{var t;let{animateOpacity:n,endingHeight:r,transition:o,transitionEnd:i,delay:a}=e;return p(p({},n&&{opacity:1}),{},{height:r,transitionEnd:null===i||void 0===i?void 0:i.enter,transition:null!==(t=null===o||void 0===o?void 0:o.enter)&&void 0!==t?t:MC(BC.enter,a)})}},VC=(0,t.forwardRef)((e,n)=>{const{in:r,unmountOnExit:o,animateOpacity:a=!0,startingHeight:s=0,endingHeight:l="auto",style:c,className:d,transition:u,transitionEnd:h,animatePresenceProps:f}=e,m=Ki(e,WC),[g,v]=(0,t.useState)(!1);(0,t.useEffect)(()=>{const e=setTimeout(()=>{v(!0)});return()=>clearTimeout(e)},[]),AC({condition:Number(s)>0&&!!o,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const x=parseFloat(s.toString())>0,b={startingHeight:s,endingHeight:l,animateOpacity:a,transition:g?u:{enter:{duration:0}},transitionEnd:{enter:null===h||void 0===h?void 0:h.enter,exit:o?null===h||void 0===h?void 0:h.exit:p(p({},null===h||void 0===h?void 0:h.exit),{},{display:x?"block":"none"})}},y=!o||r,w=r||o?"enter":"exit";return(0,i.jsx)(ld,p(p({},f),{},{initial:!1,custom:b,children:y&&(0,i.jsx)(av.div,p(p({ref:n},m),{},{className:Lv("chakra-collapse",d),style:p({overflow:"hidden",display:"block"},c),custom:b,variants:UC,initial:!!o&&"exit",animate:w,exit:"exit"}))}))});VC.displayName="Collapse";const HC=["children","className"],[qC,$C]=Rc({name:"InputGroupStylesContext",errorMessage:"useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<InputGroup />\" "}),YC=Dv(function(e,n){const r=qv("Input",e),o=Ov(e),{children:a,className:s}=o,l=Ki(o,HC),c=Lv("chakra-input__group",s),d={},u=gw(a),h=r.field;u.forEach(e=>{if(r){var t,n;if(h&&"InputLeftElement"===e.type.id)d.paddingStart=null!==(t=h.height)&&void 0!==t?t:h.h;if(h&&"InputRightElement"===e.type.id)d.paddingEnd=null!==(n=h.height)&&void 0!==n?n:h.h;"InputRightAddon"===e.type.id&&(d.borderEndRadius=0),"InputLeftAddon"===e.type.id&&(d.borderStartRadius=0)}});const f=u.map(n=>{var r,o;const i=uv({size:(null===(r=n.props)||void 0===r?void 0:r.size)||e.size,variant:(null===(o=n.props)||void 0===o?void 0:o.variant)||e.variant});return"Input"!==n.type.id?(0,t.cloneElement)(n,i):(0,t.cloneElement)(n,Object.assign(i,d,n.props))});return(0,i.jsx)(Rv.div,p(p({className:c,ref:n,__css:p({width:"100%",display:"flex",position:"relative",isolation:"isolate"},r.group),"data-group":!0},l),{},{children:(0,i.jsx)(qC,{value:r,children:f})}))});YC.displayName="InputGroup";const KC=["placement"],XC=["className"],GC=["className"],JC=Rv("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),QC=Dv(function(e,t){var n,r;const{placement:o="left"}=e,a=Ki(e,KC),s=$C(),l=s.field,c="left"===o?"insetStart":"insetEnd",d=p({[c]:"0",width:null!==(n=null===l||void 0===l?void 0:l.height)&&void 0!==n?n:null===l||void 0===l?void 0:l.h,height:null!==(r=null===l||void 0===l?void 0:l.height)&&void 0!==r?r:null===l||void 0===l?void 0:l.h,fontSize:null===l||void 0===l?void 0:l.fontSize},s.element);return(0,i.jsx)(JC,p({ref:t,__css:d},a))});QC.id="InputElement",QC.displayName="InputElement";const ZC=Dv(function(e,t){const{className:n}=e,r=Ki(e,XC),o=Lv("chakra-input__left-element",n);return(0,i.jsx)(QC,p({ref:t,placement:"left",className:o},r))});ZC.id="InputLeftElement",ZC.displayName="InputLeftElement";const eE=Dv(function(e,t){const{className:n}=e,r=Ki(e,GC),o=Lv("chakra-input__right-element",n);return(0,i.jsx)(QC,p({ref:t,placement:"right",className:o},r))});eE.id="InputRightElement",eE.displayName="InputRightElement";const tE=["id","isRequired","isInvalid","isDisabled","isReadOnly"],nE=["getRootProps","htmlProps"],[rE,oE]=Rc({name:"FormControlStylesContext",errorMessage:"useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<FormControl />\" "}),[iE,aE]=Rc({strict:!1,name:"FormControlContext"});const sE=Dv(function(e,n){const r=qv("Form",e),o=function(e){const{id:n,isRequired:r,isInvalid:o,isDisabled:i,isReadOnly:a}=e,s=Ki(e,tE),l=(0,t.useId)(),c=n||"field-".concat(l),d="".concat(c,"-label"),u="".concat(c,"-feedback"),h="".concat(c,"-helptext"),[f,m]=(0,t.useState)(!1),[g,v]=(0,t.useState)(!1),[x,b]=(0,t.useState)(!1),y=(0,t.useCallback)(function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({id:h},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{ref:Rw(e,e=>{e&&v(!0)})})},[h]),w=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},e),{},{ref:t,"data-focus":Tw(x),"data-disabled":Tw(i),"data-invalid":Tw(o),"data-readonly":Tw(a),id:void 0!==e.id?e.id:d,htmlFor:void 0!==e.htmlFor?e.htmlFor:c})},[c,i,x,o,a,d]),S=(0,t.useCallback)(function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({id:u},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{ref:Rw(e,e=>{e&&m(!0)}),"aria-live":"polite"})},[u]),j=(0,t.useCallback)(function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p(p({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),s),{},{ref:e,role:"group","data-focus":Tw(x),"data-disabled":Tw(i),"data-invalid":Tw(o),"data-readonly":Tw(a)})},[s,i,x,o,a]),k=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},e),{},{ref:t,role:"presentation","aria-hidden":!0,children:e.children||"*"})},[]);return{isRequired:!!r,isInvalid:!!o,isReadOnly:!!a,isDisabled:!!i,isFocused:!!x,onFocus:()=>b(!0),onBlur:()=>b(!1),hasFeedbackText:f,setHasFeedbackText:m,hasHelpText:g,setHasHelpText:v,id:c,labelId:d,feedbackId:u,helpTextId:h,htmlProps:s,getHelpTextProps:y,getErrorMessageProps:S,getRootProps:j,getLabelProps:w,getRequiredIndicatorProps:k}}(Ov(e)),{getRootProps:a,htmlProps:s}=o,l=Ki(o,nE),c=Lv("chakra-form-control",e.className);return(0,i.jsx)(iE,{value:l,children:(0,i.jsx)(rE,{value:r,children:(0,i.jsx)(Rv.div,p(p({},a({},n)),{},{className:c,__css:r.container}))})})});sE.displayName="FormControl";const lE=Dv(function(e,t){const n=aE(),r=oE(),o=Lv("chakra-form__helper-text",e.className);return(0,i.jsx)(Rv.div,p(p({},null===n||void 0===n?void 0:n.getHelpTextProps(e,t)),{},{__css:r.helperText,className:o}))});lE.displayName="FormHelperText";const cE=["isDisabled","isInvalid","isReadOnly","isRequired"],dE=["id","disabled","readOnly","required","isRequired","isInvalid","isReadOnly","isDisabled","onFocus","onBlur"];function uE(e){const t=hE(e),{isDisabled:n,isInvalid:r,isReadOnly:o,isRequired:i}=t;return p(p({},Ki(t,cE)),{},{disabled:n,readOnly:o,required:i,"aria-invalid":Pw(r),"aria-required":Pw(i),"aria-readonly":Pw(o)})}function hE(e){var t,n,r;const o=aE(),{id:i,disabled:a,readOnly:s,required:l,isRequired:c,isInvalid:d,isReadOnly:u,isDisabled:h,onFocus:f,onBlur:m}=e,g=Ki(e,dE),v=e["aria-describedby"]?[e["aria-describedby"]]:[];return null!==o&&void 0!==o&&o.hasFeedbackText&&null!==o&&void 0!==o&&o.isInvalid&&v.push(o.feedbackId),null!==o&&void 0!==o&&o.hasHelpText&&v.push(o.helpTextId),p(p({},g),{},{"aria-describedby":v.join(" ")||void 0,id:null!==i&&void 0!==i?i:null===o||void 0===o?void 0:o.id,isDisabled:null!==(t=null!==a&&void 0!==a?a:h)&&void 0!==t?t:null===o||void 0===o?void 0:o.isDisabled,isReadOnly:null!==(n=null!==s&&void 0!==s?s:u)&&void 0!==n?n:null===o||void 0===o?void 0:o.isReadOnly,isRequired:null!==(r=null!==l&&void 0!==l?l:c)&&void 0!==r?r:null===o||void 0===o?void 0:o.isRequired,isInvalid:null!==d&&void 0!==d?d:null===o||void 0===o?void 0:o.isInvalid,onFocus:Jw(null===o||void 0===o?void 0:o.onFocus,f),onBlur:Jw(null===o||void 0===o?void 0:o.onBlur,m)})}const pE=["htmlSize"],fE=Dv(function(e,t){const{htmlSize:n}=e,r=Ki(e,pE),o=qv("Input",r),a=uE(Ov(r)),s=Lv("chakra-input",e.className);return(0,i.jsx)(Rv.input,p(p({size:n},a),{},{__css:o.field,ref:t,className:s}))});function mE(e){return Jj({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 93.7l183.6-25.3v177.4H0V93.7zm0 324.6l183.6 25.3V268.4H0v149.9zm203.8 28L448 480V268.4H203.8v177.9zm0-380.6v180.1H448V32L203.8 65.7z"},child:[]}]})(e)}function gE(e){return Jj({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M220.8 123.3c1 .5 1.8 1.7 3 1.7 1.1 0 2.8-.4 2.9-1.5.2-1.4-1.9-2.3-3.2-2.9-1.7-.7-3.9-1-5.5-.1-.4.2-.8.7-.6 1.1.3 1.3 2.3 1.1 3.4 1.7zm-21.9 1.7c1.2 0 2-1.2 3-1.7 1.1-.6 3.1-.4 3.5-1.6.2-.4-.2-.9-.6-1.1-1.6-.9-3.8-.6-5.5.1-1.3.6-3.4 1.5-3.2 2.9.1 1 1.8 1.5 2.8 1.4zM420 403.8c-3.6-4-5.3-11.6-7.2-19.7-1.8-8.1-3.9-16.8-10.5-22.4-1.3-1.1-2.6-2.1-4-2.9-1.3-.8-2.7-1.5-4.1-2 9.2-27.3 5.6-54.5-3.7-79.1-11.4-30.1-31.3-56.4-46.5-74.4-17.1-21.5-33.7-41.9-33.4-72C311.1 85.4 315.7.1 234.8 0 132.4-.2 158 103.4 156.9 135.2c-1.7 23.4-6.4 41.8-22.5 64.7-18.9 22.5-45.5 58.8-58.1 96.7-6 17.9-8.8 36.1-6.2 53.3-6.5 5.8-11.4 14.7-16.6 20.2-4.2 4.3-10.3 5.9-17 8.3s-14 6-18.5 14.5c-2.1 3.9-2.8 8.1-2.8 12.4 0 3.9.6 7.9 1.2 11.8 1.2 8.1 2.5 15.7.8 20.8-5.2 14.4-5.9 24.4-2.2 31.7 3.8 7.3 11.4 10.5 20.1 12.3 17.3 3.6 40.8 2.7 59.3 12.5 19.8 10.4 39.9 14.1 55.9 10.4 11.6-2.6 21.1-9.6 25.9-20.2 12.5-.1 26.3-5.4 48.3-6.6 14.9-1.2 33.6 5.3 55.1 4.1.6 2.3 1.4 4.6 2.5 6.7v.1c8.3 16.7 23.8 24.3 40.3 23 16.6-1.3 34.1-11 48.3-27.9 13.6-16.4 36-23.2 50.9-32.2 7.4-4.5 13.4-10.1 13.9-18.3.4-8.2-4.4-17.3-15.5-29.7zM223.7 87.3c9.8-22.2 34.2-21.8 44-.4 6.5 14.2 3.6 30.9-4.3 40.4-1.6-.8-5.9-2.6-12.6-4.9 1.1-1.2 3.1-2.7 3.9-4.6 4.8-11.8-.2-27-9.1-27.3-7.3-.5-13.9 10.8-11.8 23-4.1-2-9.4-3.5-13-4.4-1-6.9-.3-14.6 2.9-21.8zM183 75.8c10.1 0 20.8 14.2 19.1 33.5-3.5 1-7.1 2.5-10.2 4.6 1.2-8.9-3.3-20.1-9.6-19.6-8.4.7-9.8 21.2-1.8 28.1 1 .8 1.9-.2-5.9 5.5-15.6-14.6-10.5-52.1 8.4-52.1zm-13.6 60.7c6.2-4.6 13.6-10 14.1-10.5 4.7-4.4 13.5-14.2 27.9-14.2 7.1 0 15.6 2.3 25.9 8.9 6.3 4.1 11.3 4.4 22.6 9.3 8.4 3.5 13.7 9.7 10.5 18.2-2.6 7.1-11 14.4-22.7 18.1-11.1 3.6-19.8 16-38.2 14.9-3.9-.2-7-1-9.6-2.1-8-3.5-12.2-10.4-20-15-8.6-4.8-13.2-10.4-14.7-15.3-1.4-4.9 0-9 4.2-12.3zm3.3 334c-2.7 35.1-43.9 34.4-75.3 18-29.9-15.8-68.6-6.5-76.5-21.9-2.4-4.7-2.4-12.7 2.6-26.4v-.2c2.4-7.6.6-16-.6-23.9-1.2-7.8-1.8-15 .9-20 3.5-6.7 8.5-9.1 14.8-11.3 10.3-3.7 11.8-3.4 19.6-9.9 5.5-5.7 9.5-12.9 14.3-18 5.1-5.5 10-8.1 17.7-6.9 8.1 1.2 15.1 6.8 21.9 16l19.6 35.6c9.5 19.9 43.1 48.4 41 68.9zm-1.4-25.9c-4.1-6.6-9.6-13.6-14.4-19.6 7.1 0 14.2-2.2 16.7-8.9 2.3-6.2 0-14.9-7.4-24.9-13.5-18.2-38.3-32.5-38.3-32.5-13.5-8.4-21.1-18.7-24.6-29.9s-3-23.3-.3-35.2c5.2-22.9 18.6-45.2 27.2-59.2 2.3-1.7.8 3.2-8.7 20.8-8.5 16.1-24.4 53.3-2.6 82.4.6-20.7 5.5-41.8 13.8-61.5 12-27.4 37.3-74.9 39.3-112.7 1.1.8 4.6 3.2 6.2 4.1 4.6 2.7 8.1 6.7 12.6 10.3 12.4 10 28.5 9.2 42.4 1.2 6.2-3.5 11.2-7.5 15.9-9 9.9-3.1 17.8-8.6 22.3-15 7.7 30.4 25.7 74.3 37.2 95.7 6.1 11.4 18.3 35.5 23.6 64.6 3.3-.1 7 .4 10.9 1.4 13.8-35.7-11.7-74.2-23.3-84.9-4.7-4.6-4.9-6.6-2.6-6.5 12.6 11.2 29.2 33.7 35.2 59 2.8 11.6 3.3 23.7.4 35.7 16.4 6.8 35.9 17.9 30.7 34.8-2.2-.1-3.2 0-4.2 0 3.2-10.1-3.9-17.6-22.8-26.1-19.6-8.6-36-8.6-38.3 12.5-12.1 4.2-18.3 14.7-21.4 27.3-2.8 11.2-3.6 24.7-4.4 39.9-.5 7.7-3.6 18-6.8 29-32.1 22.9-76.7 32.9-114.3 7.2zm257.4-11.5c-.9 16.8-41.2 19.9-63.2 46.5-13.2 15.7-29.4 24.4-43.6 25.5s-26.5-4.8-33.7-19.3c-4.7-11.1-2.4-23.1 1.1-36.3 3.7-14.2 9.2-28.8 9.9-40.6.8-15.2 1.7-28.5 4.2-38.7 2.6-10.3 6.6-17.2 13.7-21.1.3-.2.7-.3 1-.5.8 13.2 7.3 26.6 18.8 29.5 12.6 3.3 30.7-7.5 38.4-16.3 9-.3 15.7-.9 22.6 5.1 9.9 8.5 7.1 30.3 17.1 41.6 10.6 11.6 14 19.5 13.7 24.6zM173.3 148.7c2 1.9 4.7 4.5 8 7.1 6.6 5.2 15.8 10.6 27.3 10.6 11.6 0 22.5-5.9 31.8-10.8 4.9-2.6 10.9-7 14.8-10.4s5.9-6.3 3.1-6.6-2.6 2.6-6 5.1c-4.4 3.2-9.7 7.4-13.9 9.8-7.4 4.2-19.5 10.2-29.9 10.2s-18.7-4.8-24.9-9.7c-3.1-2.5-5.7-5-7.7-6.9-1.5-1.4-1.9-4.6-4.3-4.9-1.4-.1-1.8 3.7 1.7 6.5z"},child:[]}]})(e)}function vE(e){return Jj({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"},child:[]}]})(e)}function xE(e){return Jj({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M420.55,301.93a24,24,0,1,1,24-24,24,24,0,0,1-24,24m-265.1,0a24,24,0,1,1,24-24,24,24,0,0,1-24,24m273.7-144.48,47.94-83a10,10,0,1,0-17.27-10h0l-48.54,84.07a301.25,301.25,0,0,0-246.56,0L116.18,64.45a10,10,0,1,0-17.27,10h0l47.94,83C64.53,202.22,8.24,285.55,0,384H576c-8.24-98.45-64.54-181.78-146.85-226.55"},child:[]}]})(e)}function bE(e){return Jj({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M32,224H64V416H32A31.96166,31.96166,0,0,1,0,384V256A31.96166,31.96166,0,0,1,32,224Zm512-48V448a64.06328,64.06328,0,0,1-64,64H160a64.06328,64.06328,0,0,1-64-64V176a79.974,79.974,0,0,1,80-80H288V32a32,32,0,0,1,64,0V96H464A79.974,79.974,0,0,1,544,176ZM264,256a40,40,0,1,0-40,40A39.997,39.997,0,0,0,264,256Zm-8,128H192v32h64Zm96,0H288v32h64ZM456,256a40,40,0,1,0-40,40A39.997,39.997,0,0,0,456,256Zm-8,128H384v32h64ZM640,256V384a31.96166,31.96166,0,0,1-32,32H576V224h32A31.96166,31.96166,0,0,1,640,256Z"},child:[]}]})(e)}fE.displayName="Input",fE.id="Input";const yE={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_API_URL||"http://localhost:3001",wE=e=>{const t=e.startsWith("/")?e:"/".concat(e);return"".concat(yE).concat(t)},SE={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_WS_URL||yE.replace(/^http/,"ws"),jE=[{id:"raw",label:"Raw",prefix:""},{id:"type",label:"Type",prefix:"type "},{id:"click",label:"Tap",prefix:"click "},{id:"longpress",label:"Hold",prefix:"longpress "},{id:"launch",label:"Launch",prefix:"launch "},{id:"kill",label:"Kill",prefix:"kill "},{id:"url",label:"URL",prefix:"url "}],kE=["Open Settings and scroll down","Launch Chrome and search for devicely","Go home, then open the camera"],CE=e=>{var n,r,o;let{commandInput:a,setCommandInput:s,commandInputRef:l,onExecute:c,useAI:d,setUseAI:u,hasApiKey:h,onConfigureAI:f,isExecuting:m,selectedDevices:g,connectedDevices:v,onVoiceInput:x,onVoiceStatusChange:b,isListening:y,setIsListening:w,voiceStatus:S,voiceTranscript:j,aiProcessingStatus:k,aiDeviceResults:C=[],aiProcessingText:E,aiCommandQueue:_=[],currentCommandIndex:z=-1,completedCommands:R=[],currentActualCommandNumber:A=0,totalActualCommands:T=0,onStopAI:P,onCloseAI:O,onSaveAI:L,commandHistory:D=[],sendTextHistory:I=[],clickOnHistory:N=[],launchAppHistory:M=[],sendTextHistoryIndex:F,setSendTextHistoryIndex:W,clickOnHistoryIndex:B,setClickOnHistoryIndex:U,launchAppHistoryIndex:V,setLaunchAppHistoryIndex:H,isRecording:q,onStartRecording:$,onStopRecording:Y,recordingCommandCount:K,recordingName:X,setRecordingName:G}=e;const[,J]=(0,t.useState)([]),[,Q]=(0,t.useState)(!1),[Z,ee]=(0,t.useState)(-1),[te,ne]=(0,t.useState)("raw"),[re,oe]=(0,t.useState)(""),ie=Ts("white","gray.800"),ae=Ts("gray.200","gray.700"),se=Ts("gray.50","gray.900"),le=Ts("brand.500","brand.400"),ce=Ts("orange.50","orange.900"),de=Ts("orange.200","orange.700"),ue=Ts("orange.700","orange.200"),he=Ts("gray.100","gray.600"),pe=Ts("purple.50","purple.900"),fe=Ts("purple.200","purple.700"),me=Ts("purple.700","purple.200"),ge=Ts("purple.600","purple.300"),{isOpen:ve,onToggle:xe}=Yw({defaultIsOpen:!1}),be=0===g.length||m,ye=0===v.length,we=()=>{var e;if(be||!a||"string"===typeof a&&!a.trim())return;y&&w&&w(!1);const t=d||"raw"===te?"":null===(e=jE.find(e=>e.id===te))||void 0===e?void 0:e.prefix;c(t+a,te,a,!1,{isFromCommandPanel:!0,useAI:d}),ee(-1),oe(""),s("")};return t.useEffect(()=>{k&&console.debug("\ud83c\udfa8 CommandPanel - AI Status Display:",{status:k,text:E,queue:_,currentIndex:z,queueLength:_.length})},[k,E,_,z]),(0,t.useEffect)(()=>{(async()=>{Q(!0);try{const e=await fetch("".concat(yE,"/api/apps/presets")),t=await e.json();t.success&&J(t.apps)}catch(e){console.error("Failed to load app presets:",e)}finally{Q(!1)}})()},[]),(0,i.jsx)(mw,{bg:ie,borderRadius:"2xl",borderWidth:"1px",borderColor:ae,overflow:"hidden",boxShadow:"lg",children:(0,i.jsx)(mw,{p:{base:3,md:4},children:(0,i.jsxs)(ww,{spacing:3,align:"stretch",children:[(ye||g.length>0)&&(0,i.jsxs)(fw,{align:"center",gap:2,rowGap:1.5,flexWrap:"wrap",children:[ye&&(0,i.jsxs)(Ew,{px:2,py:.5,spacing:1.5,bg:ce,borderRadius:"full",borderWidth:"1px",borderColor:de,flexShrink:0,children:[(0,i.jsx)(gC,{size:11}),(0,i.jsx)(Cw,{fontSize:"xs",color:ue,fontWeight:"600",children:"No devices connected"})]}),g.length>0&&(0,i.jsxs)(Ew,{spacing:1,flexWrap:"wrap",minW:0,children:[(0,i.jsx)(Cw,{fontSize:"xs",fontWeight:"600",color:le,flexShrink:0,children:"\ud83c\udfaf"}),g.slice(0,3).map(e=>(0,i.jsx)(zw,{colorScheme:"brand",fontSize:"2xs",px:2,borderRadius:"full",fontWeight:"600",children:e},e)),g.length>3&&(0,i.jsxs)(zw,{colorScheme:"brand",fontSize:"2xs",px:1.5,borderRadius:"full",children:["+",g.length-3]})]})]}),(0,i.jsxs)(ww,{spacing:3,children:[k&&(0,i.jsxs)(ww,{w:"full",p:3,bg:pe,borderRadius:"lg",borderWidth:"1px",borderColor:fe,spacing:2,animation:"fadeIn 0.3s ease",align:"stretch",children:[(0,i.jsxs)(Ew,{spacing:2,justify:"space-between",children:[(0,i.jsxs)(Ew,{spacing:2,flex:"1",children:[("executing"===k||"stopping"===k)&&(0,i.jsx)(Qv,{size:"sm",color:"purple.500",thickness:"2px"}),"completed"===k&&(0,i.jsx)(dC,{color:"green",size:16}),"error"===k&&(0,i.jsx)(mw,{color:"red.500",fontSize:"16px",children:"\u274c"}),(0,i.jsxs)(ww,{align:"start",spacing:0,flex:"1",children:[(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsxs)(Cw,{fontSize:"xs",fontWeight:"700",color:me,textTransform:"uppercase",letterSpacing:"wide",children:["thinking"===k&&"\ud83e\udde0 Analyzing","executing"===k&&"\u26a1 Executing","completed"===k&&(C.length>1?"\u2705 Done on all ".concat(C.length," devices"):"\u2705 Completed"),"partial"===k&&"\u26a0\ufe0f Done on ".concat(C.filter(e=>e.success).length,"/").concat(C.length," devices"),"stopping"===k&&"\u23f3 Stopping after current step","stopped"===k&&"\u23f9 Stopped","error"===k&&"\u274c Error"]}),(0,i.jsx)(zw,{colorScheme:"error"===k?"red":"partial"===k?"orange":"purple",fontSize:"2xs",px:2,py:.5,children:"AI"}),_.length>1&&["thinking","executing","stopping"].includes(k)&&(0,i.jsxs)(zw,{colorScheme:"blue",fontSize:"2xs",px:2,py:.5,children:[A,"/",T]}),"completed"===k&&(0,i.jsx)(zw,{colorScheme:"green",fontSize:"2xs",px:2,py:.5,children:T>0?"".concat(T," command").concat(T>1?"s":""):"Complete"})]}),["thinking","executing"].includes(k)&&(0,i.jsxs)(Cw,{fontSize:"xs",color:ge,fontFamily:"mono",fontWeight:"600",children:["thinking"===k&&'"'.concat(E,'"'),"executing"===k&&E]}),"error"===k&&(0,i.jsx)(Cw,{fontSize:"xs",color:"red.500",fontFamily:"mono",fontWeight:"600",whiteSpace:"pre-wrap",children:E}),C.some(e=>!e.success)&&(0,i.jsx)(ww,{align:"start",spacing:.5,pt:1,children:C.filter(e=>!e.success).map(e=>(0,i.jsxs)(Cw,{fontSize:"xs",color:"red.500",_dark:{color:"red.300"},fontFamily:"mono",wordBreak:"break-word",children:["\u2717 ",e.device,e.step?" \xb7 ".concat(e.step):"",e.error?" \u2014 ".concat(e.error):""]},e.device))})]})]}),(0,i.jsxs)(Ew,{spacing:1,children:["executing"===k&&(0,i.jsx)(Uj,{label:"Stop Execution",children:(0,i.jsx)(qw,{icon:(0,i.jsx)(pk,{}),size:"xs",colorScheme:"red",variant:"ghost",onClick:P,"aria-label":"Stop execution"})}),["completed","partial","stopped","error"].includes(k)&&(0,i.jsx)(Uj,{label:"Save as Recording",children:(0,i.jsx)(qw,{icon:(0,i.jsx)(bk,{}),size:"xs",colorScheme:"green",variant:"ghost",onClick:L,isDisabled:"error"===k,"aria-label":"Save recording"})}),(0,i.jsx)(Uj,{label:"Close",children:(0,i.jsx)(qw,{icon:(0,i.jsx)(ek,{}),size:"xs",colorScheme:"gray",variant:"ghost",onClick:O,"aria-label":"Close"})})]})]}),"executing"===k&&_.length>1&&z<_.length-1&&(0,i.jsxs)(ww,{align:"stretch",spacing:1,pt:1,borderTopWidth:"1px",borderColor:fe,children:[(0,i.jsx)(Cw,{fontSize:"2xs",color:ge,textTransform:"uppercase",fontWeight:"600",letterSpacing:"wide",children:"Next"}),_.slice(z+1,z+3).map((e,t)=>(0,i.jsxs)(Ew,{spacing:2,pl:2,children:[(0,i.jsx)(mw,{w:"4px",h:"4px",bg:ge,borderRadius:"full",opacity:.5}),(0,i.jsx)(Cw,{fontSize:"2xs",color:ge,fontFamily:"mono",opacity:.7,noOfLines:1,children:e})]},t)),_.length-z>3&&(0,i.jsxs)(Cw,{fontSize:"2xs",color:ge,pl:4,opacity:.5,children:["+",_.length-z-3," more"]})]}),("completed"===k||"partial"===k)&&(0,i.jsxs)(ww,{align:"stretch",spacing:1,pt:2,borderTopWidth:"1px",borderColor:fe,children:[(0,i.jsxs)(Ew,{spacing:2,cursor:"pointer",onClick:xe,_hover:{bg:he},px:2,py:1,borderRadius:"md",children:[(0,i.jsx)(Cw,{fontSize:"2xs",color:ge,textTransform:"uppercase",fontWeight:"600",letterSpacing:"wide",children:"Executed Commands"}),(0,i.jsx)(mw,{ml:"auto",children:ve?(0,i.jsx)(iC,{size:14}):(0,i.jsx)(lC,{size:14})})]}),(0,i.jsx)(VC,{in:ve,animateOpacity:!0,children:(0,i.jsx)(ww,{align:"stretch",spacing:1,maxH:"200px",overflowY:"auto",pt:1,children:_.filter(e=>!e.startsWith("WAIT ")).map((e,t)=>(0,i.jsxs)(Ew,{spacing:2,pl:2,py:1,children:["completed"===k?(0,i.jsx)(dC,{color:"green",size:12}):(0,i.jsx)(mw,{w:"6px",h:"6px",mx:"3px",bg:ge,borderRadius:"full",flexShrink:0}),(0,i.jsx)(Cw,{fontSize:"2xs",color:me,fontFamily:"mono",fontWeight:"500",children:e})]},t))})})]})]}),S&&(0,i.jsx)(Ew,{w:"full",p:3,bg:"listening"===S?"red.50":"blue.50",borderRadius:"lg",borderWidth:"1px",borderColor:"listening"===S?"red.200":"blue.200",spacing:3,animation:"fadeIn 0.3s ease",children:"listening"===S?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(mw,{w:"8px",h:"8px",bg:"red.500",borderRadius:"full",animation:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite"}),(0,i.jsxs)(Cw,{fontSize:"sm",fontWeight:"600",color:"red.700",children:["\ud83c\udfa4 Listening... ",j&&'"'.concat(j,'"')]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qv,{size:"sm",color:"blue.500"}),(0,i.jsxs)(Cw,{fontSize:"sm",fontWeight:"600",color:"blue.700",children:['\u26a1 Processing: "',j,'"']})]})}),(0,i.jsx)(mw,{w:"full",overflowX:"auto",pb:2,css:{"&::-webkit-scrollbar":{height:"4px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"rgba(0,0,0,0.1)",borderRadius:"4px"}},children:(0,i.jsxs)(Ew,{spacing:2,minW:"max-content",role:"group","aria-label":"Command mode","data-testid":"command-modes",children:[jE.map(e=>{const t=!d&&te===e.id;return(0,i.jsx)(Ww,p(p({size:"xs",variant:t?"solid":"ghost",colorScheme:t?"brand":"gray"},t&&{bg:"brand.600",_hover:{bg:"brand.700"},_dark:{bg:"brand.200",_hover:{bg:"brand.300"}}}),{},{"aria-pressed":t,onClick:()=>{var t;ne(e.id),d&&u(!1),null===l||void 0===l||null===(t=l.current)||void 0===t||t.focus()},borderRadius:"full",px:3,children:e.label}),e.id)}),(0,i.jsx)(mw,{w:"1px",h:"16px",bg:ae,mx:1,"aria-hidden":"true"}),(0,i.jsx)(Uj,{label:h?"Describe what to do in plain English; AI turns it into commands":"Add an AI provider key in Settings to use plain English",children:(0,i.jsxs)(Ww,{size:"xs",variant:d?"solid":"ghost",colorScheme:"purple","aria-pressed":!!d,leftIcon:(0,i.jsx)(bE,{size:11}),onClick:()=>{var e;h?(u(!0),null===l||void 0===l||null===(e=l.current)||void 0===e||e.focus()):null===f||void 0===f||f()},borderRadius:"full",px:3,"data-testid":"ai-mode-chip",children:["AI",h?"":" \xb7 set up"]})})]})}),(0,i.jsxs)(Ew,{spacing:2,w:"full",children:[(0,i.jsxs)(YC,{size:{base:"md",md:"lg"},flex:"1",children:["raw"!==te&&!d&&(0,i.jsx)(ZC,{width:"auto",pl:4,pr:2,zIndex:2,h:"100%",children:(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"600",color:"gray.500",fontFamily:"mono",children:null===(n=jE.find(e=>e.id===te))||void 0===n?void 0:n.prefix})}),(0,i.jsx)(fE,{ref:l,placeholder:d?"Describe what to do, e.g. open Settings and scroll down":"raw"===te?"Enter command (e.g., launch settings)...":"Enter argument for ".concat(null===(r=jE.find(e=>e.id===te))||void 0===r?void 0:r.label.toLowerCase(),"..."),pl:d||"raw"===te?"16px":"calc(40px + ".concat(8*((null===(o=jE.find(e=>e.id===te))||void 0===o?void 0:o.prefix.length)||0),"px)"),value:a,onChange:e=>{s(e.target.value),oe(e.target.value),ee(-1)},onKeyDown:e=>{if("ArrowUp"===e.key&&D.length>0){e.preventDefault();const t=Math.min(Z+1,D.length-1);ee(t);const n=D[t];if("object"===typeof n)s(n.argument||""),n.commandType&&ne(n.commandType);else if("string"===typeof n){const e=jE.find(e=>"raw"!==e.id&&n.startsWith(e.prefix));e?(ne(e.id),s(n.substring(e.prefix.length))):(ne("raw"),s(n))}}else if("ArrowDown"===e.key)if(e.preventDefault(),Z>0){const e=Z-1;ee(e);const t=D[e];if("object"===typeof t)s(t.argument||""),t.commandType&&ne(t.commandType);else if("string"===typeof t){const e=jE.find(e=>"raw"!==e.id&&t.startsWith(e.prefix));e?(ne(e.id),s(t.substring(e.prefix.length))):(ne("raw"),s(t))}}else ee(-1),s(re)},onKeyPress:e=>{"Enter"!==e.key||be||we()},disabled:ye||m,bg:se,borderRadius:"xl",borderWidth:"2px",borderColor:d?"purple.300":"transparent",_focus:{borderColor:d?"purple.500":"brand.500",boxShadow:d?"0 0 0 1px rgba(147, 51, 234, 0.1)":"0 0 0 1px rgba(24, 144, 255, 0.1)",bg:ie},_disabled:{opacity:.6,cursor:"not-allowed"},fontSize:{base:"sm",md:"md"},fontWeight:"500"})]}),(0,i.jsxs)(Ew,{spacing:2,display:{base:"none",md:"flex"},children:[(0,i.jsx)(Uj,{label:y?"Stop Listening":"Voice Input",children:(0,i.jsx)(qw,{"aria-label":"Voice input",icon:y?(0,i.jsx)(Ek,{}):(0,i.jsx)(Lk,{}),size:"lg",colorScheme:y?"red":"purple",onClick:()=>w(!y),isDisabled:ye,borderRadius:"xl"})}),(0,i.jsx)(Uj,{label:ye?"Connect a device first":0===g.length?"Select a device":"Execute command",children:(0,i.jsx)(Ww,{leftIcon:(0,i.jsx)(vk,{}),size:"lg",colorScheme:"brand",onClick:we,isLoading:m,isDisabled:be||!a||"string"===typeof a&&!a.trim(),borderRadius:"xl",px:8,fontWeight:"600",children:"Execute"})})]})]}),d&&!a&&(0,i.jsxs)(Ew,{spacing:2,flexWrap:"wrap",rowGap:1,"data-testid":"ai-examples",children:[(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.500",_dark:{color:"gray.400"},children:"Try:"}),kE.map(e=>(0,i.jsx)(Ww,{size:"xs",variant:"outline",colorScheme:"purple",fontWeight:"500",borderRadius:"full",onClick:()=>{var t;s(e),null===l||void 0===l||null===(t=l.current)||void 0===t||t.focus()},children:e},e))]}),(0,i.jsxs)(Ew,{spacing:2,w:"full",display:{base:"flex",md:"none"},children:[(0,i.jsx)(qw,{"aria-label":"Voice input",icon:y?(0,i.jsx)(Ek,{}):(0,i.jsx)(Lk,{}),size:"md",colorScheme:y?"red":"purple",onClick:()=>w(!y),isDisabled:ye,borderRadius:"lg",flex:"1"}),(0,i.jsx)(Ww,{leftIcon:(0,i.jsx)(vk,{}),size:"md",colorScheme:"brand",onClick:we,isLoading:m,isDisabled:be||!a||"string"===typeof a&&!a.trim(),borderRadius:"lg",fontWeight:"600",flex:"2",children:"Execute"})]})]}),ye?null:g.length>0&&0===v.filter(e=>g.includes(e)).length?(0,i.jsx)(mw,{p:3,bg:ce,borderRadius:"lg",borderWidth:"1px",borderColor:de,children:(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"600",color:ue,textAlign:"center",children:'\u26a0\ufe0f Selected devices are not connected. Click "Connect" button on each device.'})}):null]})})})};function EE(e){const{value:n,defaultValue:r,onChange:o,shouldUpdate:i=(e,t)=>e!==t}=e,a=dd(o),s=dd(i),[l,c]=(0,t.useState)(r),d=void 0!==n,u=d?n:l,h=dd(e=>{const t="function"===typeof e?e(u):e;s(u,t)&&(d||c(t),a(t))},[d,a,u,s]);return[u,h]}function _E(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!n||(!!r||!("keepMounted"!==o||!t))}function zE(e){return e.sort((e,t)=>{const n=e.compareDocumentPosition(t);if(n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(n&Node.DOCUMENT_POSITION_DISCONNECTED||n&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}function RE(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function AE(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}const TE="undefined"!==typeof window?t.useLayoutEffect:t.useEffect;var PE=Object.defineProperty,OE=(e,t,n)=>(((e,t,n)=>{t in e?PE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!==typeof t?t+"":t,n),n);class LE{constructor(){var e=this;OE(this,"descendants",new Map),OE(this,"register",e=>{var t;if(null!=e)return"object"==typeof(t=e)&&"nodeType"in t&&t.nodeType===Node.ELEMENT_NODE?this.registerNode(e):t=>{this.registerNode(t,e)}}),OE(this,"unregister",e=>{this.descendants.delete(e);const t=zE(Array.from(this.descendants.keys()));this.assignIndex(t)}),OE(this,"destroy",()=>{this.descendants.clear()}),OE(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),OE(this,"count",()=>this.descendants.size),OE(this,"enabledCount",()=>this.enabledValues().length),OE(this,"values",()=>Array.from(this.descendants.values()).sort((e,t)=>e.index-t.index)),OE(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),OE(this,"item",e=>{if(0!==this.count())return this.values()[e]}),OE(this,"enabledItem",e=>{if(0!==this.enabledCount())return this.enabledValues()[e]}),OE(this,"first",()=>this.item(0)),OE(this,"firstEnabled",()=>this.enabledItem(0)),OE(this,"last",()=>this.item(this.descendants.size-1)),OE(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),OE(this,"indexOf",e=>{var t,n;return e&&null!==(t=null===(n=this.descendants.get(e))||void 0===n?void 0:n.index)&&void 0!==t?t:-1}),OE(this,"enabledIndexOf",e=>null==e?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),OE(this,"next",function(t){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=RE(t,e.count(),n);return e.item(r)}),OE(this,"nextEnabled",function(t){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=e.item(t);if(!r)return;const o=RE(e.enabledIndexOf(r.node),e.enabledCount(),n);return e.enabledItem(o)}),OE(this,"prev",function(t){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=AE(t,e.count()-1,n);return e.item(r)}),OE(this,"prevEnabled",function(t){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=e.item(t);if(!r)return;const o=AE(e.enabledIndexOf(r.node),e.enabledCount()-1,n);return e.enabledItem(o)}),OE(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=zE(Array.from(this.descendants.keys()).concat(e));null!==t&&void 0!==t&&t.disabled&&(t.disabled=!!t.disabled);const r=p({node:e,index:-1},t);this.descendants.set(e,r),this.assignIndex(n)})}}function DE(){const[e,n]=Rc({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});return[e,n,()=>{const e=(0,t.useRef)(new LE);return TE(()=>()=>e.current.destroy()),e.current},e=>{const r=n(),[o,i]=(0,t.useState)(-1),a=(0,t.useRef)(null);TE(()=>()=>{a.current&&r.unregister(a.current)},[]),TE(()=>{if(!a.current)return;const e=Number(a.current.dataset.index);o==e||Number.isNaN(e)||i(e)});const s=e?r.register(e):r.register;return{descendants:r,index:o,enabledIndex:r.enabledIndexOf(a.current),register:Rw(s,a)}}]}const IE=["ref","isDisabled","isFocusable","clickOnEnter","clickOnSpace","onMouseDown","onMouseUp","onClick","onKeyDown","onKeyUp","tabIndex","onMouseOver","onMouseLeave"];function NE(e){var t,n;const r=null!==(t=null===(n=e.composedPath)||void 0===n||null===(n=n.call(e))||void 0===n?void 0:n[0])&&void 0!==t?t:e.target,{tagName:o,isContentEditable:i}=r;return"INPUT"!==o&&"TEXTAREA"!==o&&!0!==i}function ME(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{ref:n,isDisabled:r,isFocusable:o,clickOnEnter:i=!0,clickOnSpace:a=!0,onMouseDown:s,onMouseUp:l,onClick:c,onKeyDown:d,onKeyUp:u,tabIndex:h,onMouseOver:f,onMouseLeave:m}=e,g=Ki(e,IE),[v,x]=(0,t.useState)(!0),[b,y]=(0,t.useState)(!1),w=function(){const e=(0,t.useRef)(new Map),n=e.current,r=(0,t.useCallback)((t,n,r,o)=>{e.current.set(r,{type:n,el:t,options:o}),t.addEventListener(n,r,o)},[]),o=(0,t.useCallback)((t,n,r,o)=>{t.removeEventListener(n,r,o),e.current.delete(r)},[]);return(0,t.useEffect)(()=>()=>{n.forEach((e,t)=>{o(e.el,e.type,t,e.options)})},[o,n]),{add:r,remove:o}}(),S=v?h:h||0,j=r&&!o,k=(0,t.useCallback)(e=>{if(r)return e.stopPropagation(),void e.preventDefault();e.currentTarget.focus(),null===c||void 0===c||c(e)},[r,c]),C=(0,t.useCallback)(e=>{b&&NE(e)&&(e.preventDefault(),e.stopPropagation(),y(!1),w.remove(document,"keyup",C,!1))},[b,w]),E=(0,t.useCallback)(e=>{if(null===d||void 0===d||d(e),r||e.defaultPrevented||e.metaKey)return;if(!NE(e.nativeEvent)||v)return;const t=i&&"Enter"===e.key;if(a&&" "===e.key&&(e.preventDefault(),y(!0)),t){e.preventDefault();e.currentTarget.click()}w.add(document,"keyup",C,!1)},[r,v,d,i,a,w,C]),_=(0,t.useCallback)(e=>{if(null===u||void 0===u||u(e),r||e.defaultPrevented||e.metaKey)return;if(!NE(e.nativeEvent)||v)return;if(a&&" "===e.key){e.preventDefault(),y(!1);e.currentTarget.click()}},[a,v,r,u]),z=(0,t.useCallback)(e=>{0===e.button&&(y(!1),w.remove(document,"mouseup",z,!1))},[w]),R=(0,t.useCallback)(e=>{if(0!==e.button)return;if(r)return e.stopPropagation(),void e.preventDefault();v||y(!0);e.currentTarget.focus({preventScroll:!0}),w.add(document,"mouseup",z,!1),null===s||void 0===s||s(e)},[r,v,s,w,z]),A=(0,t.useCallback)(e=>{0===e.button&&(v||y(!1),null===l||void 0===l||l(e))},[l,v]),T=(0,t.useCallback)(e=>{r?e.preventDefault():null===f||void 0===f||f(e)},[r,f]),P=(0,t.useCallback)(e=>{b&&(e.preventDefault(),y(!1)),null===m||void 0===m||m(e)},[b,m]),O=Rw(n,e=>{e&&"BUTTON"!==e.tagName&&x(!1)});return p(p({},g),{},v?{ref:O,type:"button","aria-disabled":j?void 0:r,disabled:j,onClick:k,onMouseDown:s,onMouseUp:l,onKeyUp:u,onKeyDown:d,onMouseOver:f,onMouseLeave:m}:{ref:O,role:"button","data-active":Tw(b),"aria-disabled":r?"true":void 0,tabIndex:j?void 0:S,onClick:k,onMouseDown:R,onMouseUp:A,onKeyUp:_,onKeyDown:E,onMouseOver:T,onMouseLeave:P})}const FE=["defaultIndex","onChange","index","isManual","isLazy","lazyBehavior","orientation","direction"],WE=["isDisabled","isFocusable"],BE=["children"],[UE,VE,HE,qE]=DE();const[$E,YE]=Rc({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});const[KE,XE]=Rc({});function GE(e,t){return"".concat(e,"--tab-").concat(t)}function JE(e,t){return"".concat(e,"--tabpanel-").concat(t)}const QE=["children","className"],ZE=["htmlProps","descendants"],e_=["isFitted"],[t_,n_]=Rc({name:"TabsStylesContext",errorMessage:"useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<Tabs />\" "}),r_=Dv(function(e,n){const r=qv("Tabs",e),o=Ov(e),{children:a,className:s}=o,l=function(e){var n;const{defaultIndex:r,onChange:o,index:i,isManual:a,isLazy:s,lazyBehavior:l="unmount",orientation:c="horizontal",direction:d="ltr"}=e,u=Ki(e,FE),[h,p]=(0,t.useState)(null!==r&&void 0!==r?r:0),[f,m]=EE({defaultValue:null!==r&&void 0!==r?r:0,value:i,onChange:o});(0,t.useEffect)(()=>{null!=i&&p(i)},[i]);const g=HE(),v=(0,t.useId)(),x=null!==(n=e.id)&&void 0!==n?n:v;return{id:"tabs-".concat(x),selectedIndex:f,focusedIndex:h,setSelectedIndex:m,setFocusedIndex:p,isManual:a,isLazy:s,lazyBehavior:l,orientation:c,descendants:g,direction:d,htmlProps:u}}(Ki(o,QE)),{htmlProps:c,descendants:d}=l,u=Ki(l,ZE),h=(0,t.useMemo)(()=>u,[u]),{isFitted:f}=c,m=Ki(c,e_),g=p({position:"relative"},r.root);return(0,i.jsx)(UE,{value:d,children:(0,i.jsx)($E,{value:h,children:(0,i.jsx)(t_,{value:r,children:(0,i.jsx)(Rv.div,p(p({className:Lv("chakra-tabs",s),ref:n},m),{},{__css:g,children:a}))})})})});r_.displayName="Tabs";const o_=Dv(function(e,n){const r=function(e){const{focusedIndex:n,orientation:r,direction:o}=YE(),i=VE(),a=(0,t.useCallback)(e=>{const t=()=>{var e;const t=i.nextEnabled(n);t&&(null===(e=t.node)||void 0===e||e.focus())},a=()=>{var e;const t=i.prevEnabled(n);t&&(null===(e=t.node)||void 0===e||e.focus())},s="horizontal"===r,l="vertical"===r,c=e.key,d="ltr"===o?"ArrowLeft":"ArrowRight",u="ltr"===o?"ArrowRight":"ArrowLeft",h={[d]:()=>s&&a(),[u]:()=>s&&t(),ArrowDown:()=>l&&t(),ArrowUp:()=>l&&a(),Home:()=>{var e;const t=i.firstEnabled();t&&(null===(e=t.node)||void 0===e||e.focus())},End:()=>{var e;const t=i.lastEnabled();t&&(null===(e=t.node)||void 0===e||e.focus())}}[c];h&&(e.preventDefault(),h(e))},[i,n,r,o]);return p(p({},e),{},{role:"tablist","aria-orientation":r,onKeyDown:Jw(e.onKeyDown,a)})}(p(p({},e),{},{ref:n})),o=p({display:"flex"},n_().tablist);return(0,i.jsx)(Rv.div,p(p({},r),{},{className:Lv("chakra-tabs__tablist",e.className),__css:o}))});o_.displayName="TabList";const i_=Dv(function(e,t){const n=n_(),r=function(e){const{isDisabled:t=!1,isFocusable:n=!1}=e,r=Ki(e,WE),{setSelectedIndex:o,isManual:i,id:a,setFocusedIndex:s,selectedIndex:l}=YE(),{index:c,register:d}=qE({disabled:t&&!n}),u=c===l,h=ME(p(p({},r),{},{ref:Rw(d,e.ref),isDisabled:t,isFocusable:n,onClick:Jw(e.onClick,()=>{o(c)})}));return p(p({},h),{},{id:GE(a,c),role:"tab",tabIndex:u?0:-1,type:"button","aria-selected":u,"aria-controls":JE(a,c),onFocus:t?void 0:Jw(e.onFocus,()=>{s(c),!i&&(!t||!n)&&o(c)})})}(p(p({},e),{},{ref:t})),o=p({outline:"0",display:"flex",alignItems:"center",justifyContent:"center"},n.tab);return(0,i.jsx)(Rv.button,p(p({},r),{},{className:Lv("chakra-tabs__tab",e.className),__css:o}))});i_.displayName="Tab";const a_=Dv(function(e,n){const r=function(e){const n=YE(),{id:r,selectedIndex:o}=n,i=gw(e.children).map((e,n)=>{var i;return(0,t.createElement)(KE,{key:null!==(i=e.key)&&void 0!==i?i:n,value:{isSelected:n===o,id:JE(r,n),tabId:GE(r,n),selectedIndex:o}},e)});return p(p({},e),{},{children:i})}(e),o=n_();return(0,i.jsx)(Rv.div,p(p({},r),{},{width:"100%",ref:n,className:Lv("chakra-tabs__tab-panels",e.className),__css:o.tabpanels}))});a_.displayName="TabPanels";const s_=Dv(function(e,n){const r=function(e){const{children:n}=e,r=Ki(e,BE),{isLazy:o,lazyBehavior:i}=YE(),{isSelected:a,id:s,tabId:l}=XE(),c=(0,t.useRef)(!1);a&&(c.current=!0);const d=_E({wasSelected:c.current,isSelected:a,enabled:o,mode:i});return p(p({tabIndex:0},r),{},{children:d?n:null,role:"tabpanel","aria-labelledby":l,hidden:!a,id:s})}(p(p({},e),{},{ref:n})),o=n_();return(0,i.jsx)(Rv.div,p(p({outline:"0"},r),{},{className:Lv("chakra-tabs__tab-panel",e.className),__css:o.tabpanel}))});s_.displayName="TabPanel";const l_=["templateAreas","gap","rowGap","columnGap","column","row","autoFlow","autoRows","templateRows","autoColumns","templateColumns"],c_=Dv(function(e,t){const{templateAreas:n,gap:r,rowGap:o,columnGap:a,column:s,row:l,autoFlow:c,autoRows:d,templateRows:u,autoColumns:h,templateColumns:f}=e,m=Ki(e,l_),g={display:"grid",gridTemplateAreas:n,gridGap:r,gridRowGap:o,gridColumnGap:a,gridAutoColumns:h,gridColumn:s,gridRow:l,gridAutoFlow:c,gridAutoRows:d,gridTemplateRows:u,gridTemplateColumns:f};return(0,i.jsx)(Rv.div,p({ref:t,__css:g},m))});c_.displayName="Grid";const d_=["columns","spacingX","spacingY","spacing","minChildWidth"],u_=Dv(function(e,t){const{columns:n,spacingX:r,spacingY:o,spacing:a,minChildWidth:s}=e,l=Ki(e,d_),c=Fv(),d=s?function(e,t){return xw(e,e=>{const n=Bv("sizes",e,"number"===typeof(r=e)?"".concat(r,"px"):r)(t);var r;return null===e?null:"repeat(auto-fit, minmax(".concat(n,", 1fr))")})}(s,c):xw(n,e=>null===e?null:"repeat(".concat(e,", minmax(0, 1fr))"));return(0,i.jsx)(c_,p({ref:t,gap:a,columnGap:r,rowGap:o,templateColumns:d},l))});u_.displayName="SimpleGrid";const h_=["htmlWidth","htmlHeight","alt"],p_=Dv(function(e,t){const{htmlWidth:n,htmlHeight:r,alt:o}=e,a=Ki(e,h_);return(0,i.jsx)("img",p({width:n,height:r,ref:t,alt:o},a))});p_.displayName="NativeImage";const f_=["fallbackSrc","fallback","src","srcSet","align","fit","loading","ignoreFallback","crossOrigin","fallbackStrategy","referrerPolicy"],m_=Dv(function(e,n){const{fallbackSrc:r,fallback:o,src:a,srcSet:s,align:l,fit:c,loading:d,ignoreFallback:u,crossOrigin:h,fallbackStrategy:f="beforeLoadOrError",referrerPolicy:m}=e,g=Ki(e,f_),v=null!=d||u||!(void 0!==r||void 0!==o),x=function(e){const{loading:n,src:r,srcSet:o,onLoad:i,onError:a,crossOrigin:s,sizes:l,ignoreFallback:c}=e,[d,u]=(0,t.useState)("pending");(0,t.useEffect)(()=>{u(r?"loading":"pending")},[r]);const h=(0,t.useRef)(null),p=(0,t.useCallback)(()=>{if(!r)return;f();const e=new Image;e.src=r,s&&(e.crossOrigin=s),o&&(e.srcset=o),l&&(e.sizes=l),n&&(e.loading=n),e.onload=e=>{f(),u("loaded"),null===i||void 0===i||i(e)},e.onerror=e=>{f(),u("failed"),null===a||void 0===a||a(e)},h.current=e},[r,s,o,l,i,a,n]),f=()=>{h.current&&(h.current.onload=null,h.current.onerror=null,h.current=null)};return gx(()=>{if(!c)return"loading"===d&&p(),()=>{f()}},[d,p,c]),c?"loaded":d}(p(p({},e),{},{crossOrigin:h,ignoreFallback:v})),b=((e,t)=>"loaded"!==e&&"beforeLoadOrError"===t||"failed"===e&&"onError"===t)(x,f),y=p({ref:n,objectFit:c,objectPosition:l},v?g:Pv(g,["onError","onLoad"]));return b?o||(0,i.jsx)(Rv.img,p({as:p_,className:"chakra-image__placeholder",src:r},y)):(0,i.jsx)(Rv.img,p({as:p_,src:a,srcSet:s,crossOrigin:h,loading:d,referrerPolicy:m,className:"chakra-image"},y))});m_.displayName="Image";var g_=function(e){return"undefined"===typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},v_=new WeakMap,x_=new WeakMap,b_={},y_=0,w_=function(e){return e&&(e.host||w_(e.parentNode))},S_=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=w_(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);b_[n]||(b_[n]=new WeakMap);var i=b_[n],a=[],s=new Set,l=new Set(o),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};o.forEach(c);var d=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))d(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(v_.get(e)||0)+1,c=(i.get(e)||0)+1;v_.set(e,l),i.set(e,c),a.push(e),1===l&&o&&x_.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(kF){console.error("aria-hidden: cannot operate on ",e,kF)}})};return d(t),s.clear(),y_++,function(){a.forEach(function(e){var t=v_.get(e)-1,o=i.get(e)-1;v_.set(e,t),i.set(e,o),t||(x_.has(e)||e.removeAttribute(r),x_.delete(e)),o||e.removeAttribute(n)}),--y_||(v_=new WeakMap,v_=new WeakMap,x_=new WeakMap,b_={})}},j_=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||g_(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),S_(r,o,n,"aria-hidden")):function(){return null}},k_=Object.defineProperty,C_=(e,t,n)=>(((e,t,n)=>{t in e?k_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!==typeof t?t+"":t,n),n);const E_=new class{constructor(){C_(this,"modals"),this.modals=new Set}add(e){return this.modals.add(e),this.modals.size}remove(e){this.modals.delete(e)}isTopModal(e){if(!e)return!1;return e===Array.from(this.modals)[this.modals.size-1]}};function __(e,n){const[r,o]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=e.current;if(t){if(n){const e=E_.add(t);o(e)}return()=>{E_.remove(t),o(0)}}},[n,e]),r}function z_(e){const{isOpen:n,onClose:r,id:o,closeOnOverlayClick:i=!0,closeOnEsc:a=!0,useInert:s=!0,onOverlayClick:l,onEsc:c}=e,d=(0,t.useRef)(null),u=(0,t.useRef)(null),[h,f,m]=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];const i=(0,t.useId)(),a=e||i;return(0,t.useMemo)(()=>r.map(e=>"".concat(e,"-").concat(a)),[a,r])}(o,"chakra-modal","chakra-modal--header","chakra-modal--body");!function(e,n){const r=e.current;(0,t.useEffect)(()=>{if(e.current&&n)return j_(e.current)},[n,e,r])}(d,n&&s);const g=__(d,n),v=(0,t.useRef)(null),x=(0,t.useCallback)(e=>{v.current=e.target},[]),b=(0,t.useCallback)(e=>{"Escape"===e.key&&(e.stopPropagation(),a&&(null===r||void 0===r||r()),null===c||void 0===c||c())},[a,r,c]),[y,w]=(0,t.useState)(!1),[S,j]=(0,t.useState)(!1),k=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({role:"dialog"},e),{},{ref:Rw(t,d),id:h,tabIndex:-1,"aria-modal":!0,"aria-labelledby":y?f:void 0,"aria-describedby":S?m:void 0,onClick:Jw(e.onClick,e=>e.stopPropagation())})},[m,S,h,f,y]),C=(0,t.useCallback)(e=>{e.stopPropagation(),v.current===e.target&&E_.isTopModal(d.current)&&(i&&(null===r||void 0===r||r()),null===l||void 0===l||l())},[r,i,l]),E=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},e),{},{ref:Rw(t,u),onClick:Jw(e.onClick,C),onKeyDown:Jw(e.onKeyDown,b),onMouseDown:Jw(e.onMouseDown,x)})},[b,x,C]);return{isOpen:n,onClose:r,headerId:f,bodyId:m,setBodyMounted:j,setHeaderMounted:w,dialogRef:d,overlayRef:u,getDialogProps:k,getDialogContainerProps:E,index:g}}const[R_,A_]=Rc({name:"ModalStylesContext",errorMessage:"useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<Modal />\" "}),[T_,P_]=Rc({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),O_=e=>{var t;const n=p(p({scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,preserveScrollBarGap:!0,motionPreset:"scale"},e),{},{lockFocusAcrossFrames:null===(t=e.lockFocusAcrossFrames)||void 0===t||t}),{portalProps:r,children:o,autoFocus:a,trapFocus:s,initialFocusRef:l,finalFocusRef:c,returnFocusOnClose:d,blockScrollOnMount:u,allowPinchZoom:h,preserveScrollBarGap:f,motionPreset:m,lockFocusAcrossFrames:g,animatePresenceProps:v,onCloseComplete:x}=n,b=qv("Modal",n),y=p(p({},z_(n)),{},{autoFocus:a,trapFocus:s,initialFocusRef:l,finalFocusRef:c,returnFocusOnClose:d,blockScrollOnMount:u,allowPinchZoom:h,preserveScrollBarGap:f,motionPreset:m,lockFocusAcrossFrames:g});return(0,i.jsx)(T_,{value:y,children:(0,i.jsx)(R_,{value:b,children:(0,i.jsx)(ld,p(p({},v),{},{onExitComplete:x,children:y.isOpen&&(0,i.jsx)(Cx,p(p({},r),{},{children:o}))}))})})};O_.displayName="Modal";const L_=["unmountOnExit","in","className","transition","transitionEnd","delay","animatePresenceProps"],D_={enter:function(){var e;let{transition:t,transitionEnd:n,delay:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{opacity:1,transition:null!==(e=null===t||void 0===t?void 0:t.enter)&&void 0!==e?e:MC(NC.enter,r),transitionEnd:null===n||void 0===n?void 0:n.enter}},exit:function(){var e;let{transition:t,transitionEnd:n,delay:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{opacity:0,transition:null!==(e=null===t||void 0===t?void 0:t.exit)&&void 0!==e?e:FC(NC.exit,r),transitionEnd:null===n||void 0===n?void 0:n.exit}}},I_={initial:"exit",animate:"enter",exit:"exit",variants:D_},N_=(0,t.forwardRef)(function(e,t){const{unmountOnExit:n,in:r,className:o,transition:a,transitionEnd:s,delay:l,animatePresenceProps:c}=e,d=Ki(e,L_),u=r||n?"enter":"exit",h=!n||r&&n,f={transition:a,transitionEnd:s,delay:l};return(0,i.jsx)(ld,p(p({},c),{},{custom:f,children:h&&(0,i.jsx)(av.div,p(p({ref:t,className:Lv("chakra-fade",o),custom:f},I_),{},{animate:u},d))}))});N_.displayName="Fade";const M_=["className","transition","motionProps"],F_=Rv(av.div),W_=Dv((e,t)=>{const{className:n,transition:r,motionProps:o}=e,a=Ki(e,M_),s=Lv("chakra-modal__overlay",n),l=p({pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh"},A_().overlay),{motionPreset:c}=P_(),d=o||("none"===c?{}:I_);return(0,i.jsx)(F_,p(p({},d),{},{__css:l,ref:t,className:s},a))});W_.displayName="ModalOverlay";var B_=function(){return B_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},B_.apply(this,arguments)};function U_(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}Object.create;function V_(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}Object.create;"function"===typeof SuppressedError&&SuppressedError;var H_="right-scroll-bar-position",q_="width-before-scroll-bar";function $_(e,t){return"function"===typeof e?e(t):e&&(e.current=t),e}var Y_="undefined"!==typeof window?t.useLayoutEffect:t.useEffect,K_=new WeakMap;function X_(e,n){var r=function(e,n){var r=(0,t.useState)(function(){return{value:e,callback:n,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}})[0];return r.callback=n,r.facade}(n||null,function(t){return e.forEach(function(e){return $_(e,t)})});return Y_(function(){var t=K_.get(r);if(t){var n=new Set(t),o=new Set(e),i=r.current;n.forEach(function(e){o.has(e)||$_(e,null)}),o.forEach(function(e){n.has(e)||$_(e,i)})}K_.set(r,e)},[e]),r}function G_(e){return e}function J_(e,t){void 0===t&&(t=G_);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}};return o}function Q_(e,t){return void 0===t&&(t=G_),J_(e,t)}function Z_(e){void 0===e&&(e={});var t=J_(null);return t.options=B_({async:!0,ssr:!1},e),t}var ez=Z_(),tz=function(){},nz=t.forwardRef(function(e,n){var r=t.useRef(null),o=t.useState({onScrollCapture:tz,onWheelCapture:tz,onTouchMoveCapture:tz}),i=o[0],a=o[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,h=e.shards,p=e.sideCar,f=e.noRelative,m=e.noIsolation,g=e.inert,v=e.allowPinchZoom,x=e.as,b=void 0===x?"div":x,y=e.gapMode,w=U_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,j=X_([r,n]),k=B_(B_({},w),i);return t.createElement(t.Fragment,null,u&&t.createElement(S,{sideCar:ez,removeScrollBar:d,shards:h,noRelative:f,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!v,lockRef:r,gapMode:y}),s?t.cloneElement(t.Children.only(l),B_(B_({},k),{ref:j})):t.createElement(b,B_({},k,{className:c,ref:j}),l))});nz.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},nz.classNames={fullWidth:q_,zeroRight:H_};var rz,oz=function(e){var n=e.sideCar,r=U_(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return t.createElement(o,B_({},r))};oz.isSideCarExport=!0;function iz(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=rz||n.nc;return t&&e.setAttribute("nonce",t),e}var az=function(){var e=0,t=null;return{add:function(n){var r;0==e&&(t=iz())&&(!function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),r=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(r)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},sz=function(){var e=function(){var e=az();return function(n,r){t.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&r])}}();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},lz={left:0,top:0,right:0,gap:0},cz=function(e){return parseInt(e||"",10)||0},dz=function(e){if(void 0===e&&(e="margin"),"undefined"===typeof window)return lz;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[cz(n),cz(r),cz(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},uz=sz(),hz="data-scroll-locked",pz=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(hz,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(H_," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(q_," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(H_," .").concat(H_," {\n right: 0 ").concat(r,";\n }\n \n .").concat(q_," .").concat(q_," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(hz,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},fz=function(){var e=parseInt(document.body.getAttribute(hz)||"0",10);return isFinite(e)?e:0},mz=function(e){var n=e.noRelative,r=e.noImportant,o=e.gapMode,i=void 0===o?"margin":o;t.useEffect(function(){return document.body.setAttribute(hz,(fz()+1).toString()),function(){var e=fz()-1;e<=0?document.body.removeAttribute(hz):document.body.setAttribute(hz,e.toString())}},[]);var a=t.useMemo(function(){return dz(i)},[i]);return t.createElement(uz,{styles:pz(a,!n,i,r?"":"!important")})},gz=!1;if("undefined"!==typeof window)try{var vz=Object.defineProperty({},"passive",{get:function(){return gz=!0,!0}});window.addEventListener("test",vz,vz),window.removeEventListener("test",vz,vz)}catch(CF){gz=!1}var xz=!!gz&&{passive:!1},bz=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},yz=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!==typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),wz(e,r)){var o=Sz(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wz=function(e,t){return"v"===e?function(e){return bz(e,"overflowY")}(t):function(e){return bz(e,"overflowX")}(t)},Sz=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},jz=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kz=function(e){return[e.deltaX,e.deltaY]},Cz=function(e){return e&&"current"in e?e.current:e},Ez=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},_z=0,zz=[];function Rz(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Az=(Tz=function(e){var n=t.useRef([]),r=t.useRef([0,0]),o=t.useRef(),i=t.useState(_z++)[0],a=t.useState(sz)[0],s=t.useRef(e);t.useEffect(function(){s.current=e},[e]),t.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=V_([e.lockRef.current],(e.shards||[]).map(Cz),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=t.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var n,i=jz(e),a=r.current,l="deltaX"in e?e.deltaX:a[0]-i[0],c="deltaY"in e?e.deltaY:a[1]-i[1],d=e.target,u=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var h=window.getSelection(),p=h&&h.anchorNode;if(p&&(p===d||p.contains(d)))return!1;var f=yz(u,d);if(!f)return!0;if(f?n=u:(n="v"===u?"h":"v",f=yz(u,d)),!f)return!1;if(!o.current&&"changedTouches"in e&&(l||c)&&(o.current=n),!n)return!0;var m=o.current||n;return function(e,t,n,r,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),c=!1,d=a>0,u=0,h=0;do{if(!s)break;var p=Sz(e,s),f=p[0],m=p[1]-p[2]-i*f;(f||m)&&wz(e,s)&&(u+=m,h+=f);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&(o&&Math.abs(u)<1||!o&&a>u)||!d&&(o&&Math.abs(h)<1||!o&&-a>h))&&(c=!0),c}(m,t,e,"h"===m?l:c,!0)},[]),c=t.useCallback(function(e){var t=e;if(zz.length&&zz[zz.length-1]===a){var r="deltaY"in t?kz(t):jz(t),o=n.current.filter(function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(n=e.delta,o=r,n[0]===o[0]&&n[1]===o[1]);var n,o})[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var i=(s.current.shards||[]).map(Cz).filter(Boolean).filter(function(e){return e.contains(t.target)});(i.length>0?l(t,i[0]):!s.current.noIsolation)&&t.cancelable&&t.preventDefault()}}},[]),d=t.useCallback(function(e,t,r,o){var i={name:e,delta:t,target:r,should:o,shadowParent:Rz(r)};n.current.push(i),setTimeout(function(){n.current=n.current.filter(function(e){return e!==i})},1)},[]),u=t.useCallback(function(e){r.current=jz(e),o.current=void 0},[]),h=t.useCallback(function(t){d(t.type,kz(t),t.target,l(t,e.lockRef.current))},[]),p=t.useCallback(function(t){d(t.type,jz(t),t.target,l(t,e.lockRef.current))},[]);t.useEffect(function(){return zz.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",c,xz),document.addEventListener("touchmove",c,xz),document.addEventListener("touchstart",u,xz),function(){zz=zz.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,xz),document.removeEventListener("touchmove",c,xz),document.removeEventListener("touchstart",u,xz)}},[]);var f=e.removeScrollBar,m=e.inert;return t.createElement(t.Fragment,null,m?t.createElement(a,{styles:Ez(i)}):null,f?t.createElement(mz,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},ez.useMedium(Tz),oz);var Tz,Pz=t.forwardRef(function(e,n){return t.createElement(nz,B_({},e,{ref:n,sideCar:Az}))});Pz.classNames=nz.classNames;const Oz=Pz;var Lz="data-focus-lock",Dz="data-focus-lock-disabled",Iz={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},Nz=function(e){var n=e.children,r=void 0===n?null:n;return t.createElement(t.Fragment,null,t.createElement("div",{key:"guard-first","data-focus-guard":!0,"data-focus-auto-guard":!0,style:Iz}),r,r&&t.createElement("div",{key:"guard-last","data-focus-guard":!0,"data-focus-auto-guard":!0,style:Iz}))};Nz.propTypes={};var Mz=Q_({},function(e){return{target:e.target,currentTarget:e.currentTarget}}),Fz=Q_(),Wz=Q_(),Bz=Z_({async:!0,ssr:"undefined"!==typeof document}),Uz=(0,t.createContext)(void 0),Vz=[],Hz=(0,t.forwardRef)(function(e,n){var r,o=(0,t.useState)(),i=o[0],a=o[1],s=(0,t.useRef)(),l=(0,t.useRef)(!1),c=(0,t.useRef)(null),d=(0,t.useState)({})[1],u=e.children,h=e.disabled,p=void 0!==h&&h,f=e.noFocusGuards,m=void 0!==f&&f,g=e.persistentFocus,v=void 0!==g&&g,x=e.crossFrame,b=void 0===x||x,y=e.autoFocus,w=void 0===y||y,S=(e.allowTextSelection,e.group),j=e.className,k=e.whiteList,C=e.hasPositiveIndices,E=e.shards,_=void 0===E?Vz:E,z=e.as,R=void 0===z?"div":z,A=e.lockProps,T=void 0===A?{}:A,P=e.sideCar,O=e.returnFocus,L=void 0!==O&&O,D=e.focusOptions,I=e.onActivation,N=e.onDeactivation,M=(0,t.useState)({})[0],F=(0,t.useCallback)(function(e){var t=e.captureFocusRestore;if(!c.current){var n,r=null==(n=document)?void 0:n.activeElement;c.current=r,r!==document.body&&(c.current=t(r))}s.current&&I&&I(s.current),l.current=!0,d()},[I]),W=(0,t.useCallback)(function(){l.current=!1,N&&N(s.current),d()},[N]),B=(0,t.useCallback)(function(e){var t=c.current;if(t){var n=("function"===typeof t?t():t)||document.body,r="function"===typeof L?L(n):L;if(r){var o="object"===typeof r?r:void 0;c.current=null,e?Promise.resolve().then(function(){return n.focus(o)}):n.focus(o)}}},[L]),U=(0,t.useCallback)(function(e){l.current&&Mz.useMedium(e)},[]),V=Fz.useMedium,H=(0,t.useCallback)(function(e){s.current!==e&&(s.current=e,a(e))},[]);var q=Za(((r={})[Dz]=p&&"disabled",r[Lz]=S,r),T),$=!0!==m,Y=$&&"tail"!==m,K=X_([n,H]),X=(0,t.useMemo)(function(){return{observed:s,shards:_,enabled:!p,get active(){return l.current}}},[p,l,_,s]);return t.createElement(t.Fragment,null,$&&[t.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:p?-1:0,style:Iz}),C?t.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:p?-1:1,style:Iz}):null],!p&&t.createElement(P,{id:M,sideCar:Bz,observed:i,disabled:p,persistentFocus:v,crossFrame:b,autoFocus:w,whiteList:k,shards:_,onActivation:F,onDeactivation:W,returnFocus:B,focusOptions:D,noFocusGuards:m}),t.createElement(R,Za({ref:K},q,{className:j,onBlur:V,onFocus:U}),t.createElement(Uz.Provider,{value:X},u)),Y&&t.createElement("div",{"data-focus-guard":!0,tabIndex:p?-1:0,style:Iz}))});Hz.propTypes={};const qz=Hz;function $z(e,t){return $z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$z(e,t)}const Yz=function(e,n){return function(r){var o,i=[];function a(){o=e(i.map(function(e){return e.props})),n(o)}var s=function(e){function n(){return e.apply(this,arguments)||this}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$z(e,t)}(n,e),n.peek=function(){return o};var s=n.prototype;return s.componentDidMount=function(){i.push(this),a()},s.componentDidUpdate=function(){a()},s.componentWillUnmount=function(){var e=i.indexOf(this);i.splice(e,1),a()},s.render=function(){return t.createElement(r,this.props)},n}(t.PureComponent);return u(s,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(r)+")"),s}};var Kz=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},Xz=function(e){return Array.isArray(e)?e:[e]},Gz=function(e){return Array.isArray(e)?e[0]:e},Jz=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},Qz=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},Zz=function(e,t){return!e||Qz(e)||!function(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;var t=window.getComputedStyle(e,null);return!(!t||!t.getPropertyValue)&&("none"===t.getPropertyValue("display")||"hidden"===t.getPropertyValue("visibility"))}(e)&&!function(e){return e.hasAttribute("inert")}(e)&&t(Jz(e))},eR=function(e,t){var n=e.get(t);if(void 0!==n)return n;var r=Zz(t,eR.bind(void 0,e));return e.set(t,r),r},tR=function(e,t){var n=e.get(t);if(void 0!==n)return n;var r=function(e,t){return!(e&&!Qz(e))||!!iR(e)&&t(Jz(e))}(t,tR.bind(void 0,e));return e.set(t,r),r},nR=function(e){return e.dataset},rR=function(e){return"INPUT"===e.tagName},oR=function(e){return rR(e)&&"radio"===e.type},iR=function(e){var t=e.getAttribute("data-no-autofocus");return![!0,"true",""].includes(t)},aR=function(e){var t;return Boolean(e&&(null===(t=nR(e))||void 0===t?void 0:t.focusGuard))},sR=function(e){return!aR(e)},lR=function(e){return Boolean(e)},cR=function(e,t){var n=Math.max(0,e.tabIndex),r=Math.max(0,t.tabIndex),o=n-r,i=e.index-t.index;if(o){if(!n)return 1;if(!r)return-1}return o||i},dR=function(e,t,n){return Kz(e).map(function(e,t){var r=function(e){return e.tabIndex<0&&!e.hasAttribute("tabindex")?0:e.tabIndex}(e);return{node:e,index:t,tabIndex:n&&-1===r?(e.dataset||{}).focusGuard?0:-1:r}}).filter(function(e){return!t||e.tabIndex>=0}).sort(cR)},uR=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"].join(","),hR="".concat(uR,", [data-focus-guard]"),pR=function(e,t){return Kz((e.shadowRoot||e).children).reduce(function(e,n){return e.concat(n.matches(t?hR:uR)?[n]:[],pR(n))},[])},fR=function(e,t){return e.reduce(function(e,n){var r,o=pR(n,t),i=(r=[]).concat.apply(r,o.map(function(e){return function(e,t){var n;return e instanceof HTMLIFrameElement&&(null===(n=e.contentDocument)||void 0===n?void 0:n.body)?fR([e.contentDocument.body],t):[e]}(e,t)}));return e.concat(i,n.parentNode?Kz(n.parentNode.querySelectorAll(uR)).filter(function(e){return e===n}):[])},[])},mR=function(e,t){return Kz(e).filter(function(e){return eR(t,e)}).filter(function(e){return function(e){return!((rR(e)||function(e){return"BUTTON"===e.tagName}(e))&&("hidden"===e.type||e.disabled))}(e)})},gR=function(e,t){return void 0===t&&(t=new Map),Kz(e).filter(function(e){return tR(t,e)})},vR=function(e,t,n){return dR(mR(fR(e,n),t),!0,n)},xR=function(e,t){return dR(mR(fR(e),t),!1)},bR=function(e,t){return mR(function(e){var t=e.querySelectorAll("[".concat("data-autofocus-inside","]"));return Kz(t).map(function(e){return fR([e])}).reduce(function(e,t){return e.concat(t)},[])}(e),t)},yR=function(e,t){return e.shadowRoot?yR(e.shadowRoot,t):!(void 0===Object.getPrototypeOf(e).contains||!Object.getPrototypeOf(e).contains.call(e,t))||Kz(e.children).some(function(e){var n;if(e instanceof HTMLIFrameElement){var r=null===(n=e.contentDocument)||void 0===n?void 0:n.body;return!!r&&yR(r,t)}return yR(e,t)})},wR=function(e){if(void 0===e&&(e=document),e&&e.activeElement){var t=e.activeElement;return t.shadowRoot?wR(t.shadowRoot):t instanceof HTMLIFrameElement&&function(e){try{return e()}catch(kF){return}}(function(){return t.contentWindow.document})?wR(t.contentWindow.document):t}},SR=function(e){return e.parentNode?SR(e.parentNode):e},jR=function(e){return Xz(e).filter(Boolean).reduce(function(e,t){var n=t.getAttribute(Lz);return e.push.apply(e,n?function(e){for(var t=new Set,n=e.length,r=0;r<n;r+=1)for(var o=r+1;o<n;o+=1){var i=e[r].compareDocumentPosition(e[o]);(i&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(o),(i&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(e,n){return!t.has(n)})}(Kz(SR(t).querySelectorAll("[".concat(Lz,'="').concat(n,'"]:not([').concat(Dz,'="disabled"])')))):[t]),e},[])},kR=function(e,t){return void 0===t&&(t=wR(Gz(e).ownerDocument)),!(!t||t.dataset&&t.dataset.focusGuard)&&jR(e).some(function(e){return yR(e,t)||function(e,t){return Boolean(Kz(e.querySelectorAll("iframe")).some(function(e){return function(e,t){return e===t}(e,t)}))}(e,t)})},CR=function(e,t){e&&("focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus())},ER=function(e,t){return oR(e)&&e.name?function(e,t){return t.filter(oR).filter(function(t){return t.name===e.name}).filter(function(e){return e.checked})[0]||e}(e,t):e},_R=function(e){return e[0]&&e.length>1?ER(e[0],e):e[0]},zR=function(e,t){return e.indexOf(ER(t,e))},RR="NEW_FOCUS",AR=function(e,t,n,r,o){var i=e.length,a=e[0],s=e[i-1],l=aR(r);if(!(r&&e.indexOf(r)>=0)){var c=void 0!==r?n.indexOf(r):-1,d=o?n.indexOf(o):c,u=o?e.indexOf(o):-1;if(-1===c)return-1!==u?u:RR;if(-1===u)return RR;var h=c-d,p=n.indexOf(a),f=n.indexOf(s),m=function(e){var t=new Set;return e.forEach(function(n){return t.add(ER(n,e))}),e.filter(function(e){return t.has(e)})}(n),g=void 0!==r?m.indexOf(r):-1,v=o?m.indexOf(o):g,x=m.filter(function(e){return e.tabIndex>=0}),b=void 0!==r?x.indexOf(r):-1,y=o?x.indexOf(o):b,w=b>=0&&y>=0?y-b:v-g;if(!h&&u>=0)return u;if(0===t.length)return u;var S=zR(e,t[0]),j=zR(e,t[t.length-1]);return c<=p&&l&&Math.abs(h)>1?j:c>=f&&l&&Math.abs(h)>1?S:h&&Math.abs(w)>1?u:c<=p?j:c>f?S:h?Math.abs(h)>1?u:(i+u+h)%i:void 0}},TR=function(e,t,n){var r,o=e.map(function(e){return e.node}),i=gR(o.filter((r=n,function(e){var t,n=null===(t=nR(e))||void 0===t?void 0:t.autofocus;return e.autofocus||void 0!==n&&"false"!==n||r.indexOf(e)>=0})));return i&&i.length?_R(i):_R(gR(t))},PR=function(e,t){return void 0===t&&(t=[]),t.push(e),e.parentNode&&PR(e.parentNode.host||e.parentNode,t),t},OR=function(e,t){for(var n=PR(e),r=PR(t),o=0;o<n.length;o+=1){var i=n[o];if(r.indexOf(i)>=0)return i}return!1},LR=function(e,t,n){var r=Xz(e),o=Xz(t),i=r[0],a=!1;return o.filter(Boolean).forEach(function(e){a=OR(a||e,e)||a,n.filter(Boolean).forEach(function(e){var t=OR(i,e);t&&(a=!a||yR(t,a)?t:OR(t,a))})}),a},DR=function(e,t){return e.reduce(function(e,n){return e.concat(bR(n,t))},[])},IR=function(e,t){var n=wR(Xz(e).length>0?document:Gz(e).ownerDocument),r=jR(e).filter(sR),o=LR(n||e,e,r),i=new Map,a=xR(r,i),s=a.filter(function(e){var t=e.node;return sR(t)});if(s[0]){var l=xR([o],i).map(function(e){return e.node}),c=function(e,t){var n=new Map;return t.forEach(function(e){return n.set(e.node,e)}),e.map(function(e){return n.get(e)}).filter(lR)}(l,s),d=c.map(function(e){return e.node}),u=c.filter(function(e){return e.tabIndex>=0}).map(function(e){return e.node}),h=AR(d,u,l,n,t);if(h===RR){var p=TR(a,u,DR(r,i))||TR(a,d,DR(r,i));return p?{node:p}:void console.warn("focus-lock: cannot find any node to move focus into")}return void 0===h?h:c[h]}},NR=0,MR=!1,FR=function(e,t,n){void 0===n&&(n={});var r=IR(e,t);if(!MR&&r){if(NR>2)return console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),MR=!0,void setTimeout(function(){MR=!1},1);NR++,CR(r.node,n.focusOptions),NR--}};function WR(e){if(!e)return null;if("undefined"===typeof WeakRef)return function(){return e||null};var t=e?new WeakRef(e):null;return function(){return(null===t||void 0===t?void 0:t.deref())||null}}var BR=function(e){var t=function(e){if(!e)return null;for(var t=[],n=e;n&&n!==document.body;)t.push({current:WR(n),parent:WR(n.parentElement),left:WR(n.previousElementSibling),right:WR(n.nextElementSibling)}),n=n.parentElement;return{element:WR(e),stack:t,ownerDocument:e.ownerDocument}}(e);return function(){return function(e){var t,n,r,o,i;if(e)for(var a=e.stack,s=e.ownerDocument,l=new Map,c=0,d=a;c<d.length;c++){var u=d[c],h=null===(t=u.parent)||void 0===t?void 0:t.call(u);if(h&&s.contains(h)){for(var p=null===(n=u.left)||void 0===n?void 0:n.call(u),f=u.current(),m=h.contains(f)?f:void 0,g=null===(r=u.right)||void 0===r?void 0:r.call(u),v=vR([h],l),x=null!==(i=null!==(o=null!==m&&void 0!==m?m:null===p||void 0===p?void 0:p.nextElementSibling)&&void 0!==o?o:g)&&void 0!==i?i:p;x;){for(var b=0,y=v;b<y.length;b++){var w=y[b];if(null===x||void 0===x?void 0:x.contains(w.node))return w.node}x=x.nextElementSibling}if(v.length)return v[0].node}}}(t)}},UR=function(e,t,n){void 0===t&&(t={});var r=function(e){return Object.assign({scope:document.body,cycle:!0,onlyTabbable:!0},e)}(t),o=function(e,t,n){if(!e||!t)return console.error("no element or scope given"),{};var r=Xz(t);if(r.every(function(t){return!yR(t,e)}))return console.error("Active element is not contained in the scope"),{};var o=n?vR(r,new Map):xR(r,new Map),i=o.findIndex(function(t){return t.node===e});return-1!==i?{prev:o[i-1],next:o[i+1],first:o[0],last:o[o.length-1]}:void 0}(e,r.scope,r.onlyTabbable);if(o){var i=n(o,r.cycle);i&&CR(i.node,r.focusOptions)}},VR=function(e,t,n){var r,o=function(e,t){var n=t?vR(Xz(e),new Map):xR(Xz(e),new Map);return{first:n[0],last:n[n.length-1]}}(e,null===(r=t.onlyTabbable)||void 0===r||r)[n];o&&CR(o.node,t.focusOptions)};function HR(e){setTimeout(e,1)}var qR=function(e){return e&&"current"in e?e.current:e},$R=function(){return document&&document.activeElement===document.body},YR=function(){return $R()||function(e){void 0===e&&(e=document);var t=wR(e);return!!t&&Kz(e.querySelectorAll("[".concat("data-no-focus-lock","]"))).some(function(e){return yR(e,t)})}()},KR=null,XR=null,GR=function(){return null},JR=null,QR=!1,ZR=!1,eA=function(){return!0};function tA(e,t,n,r){var o=null,i=e;do{var a=r[i];if(a.guard)a.node.dataset.focusAutoGuard&&(o=a);else{if(!a.lockItem)break;if(i!==e)return;o=null}}while((i+=n)!==t);o&&(o.node.tabIndex=0)}var nA=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},rA=function(e){return xR(e,new Map)},oA=function(){var e,t=!1;if(KR){var n=KR,r=n.observed,o=n.persistentFocus,i=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,c=n.noFocusGuards,d=r||JR&&JR.portaledElement;if($R()&&XR&&XR!==document.body&&(!document.body.contains(XR)||function(e){return!rA([e.parentNode]).some(function(t){return t.node===e})}(XR))){var u=GR();u&&u.focus()}var h=document&&document.activeElement;if(d){var p=[d].concat(a.map(qR).filter(Boolean));if(h&&!function(e){return(KR.whiteList||eA)(e)}(h)||(o||function(){if(!(s?Boolean(QR):"meanwhile"===QR)||!c||!XR||ZR)return!1;var e=rA(p),t=e.findIndex(function(e){return e.node===XR});return 0===t||t===e.length-1}()||!YR()||!XR&&i)&&(d&&!(kR(p)||h&&function(e,t){return t.some(function(t){return nA(e,t,t)})}(h,p)||(e=h,JR&&JR.portaledElement===e))&&(document&&!XR&&h&&!i?(h.blur&&h.blur(),document.body.focus()):(t=FR(p,XR,{focusOptions:l}),JR={})),(XR=document&&document.activeElement)!==document.body&&(GR=BR(XR)),QR=!1),document&&h!==document.activeElement&&document.querySelector("[data-focus-auto-guard]")){var f=document&&document.activeElement,m=function(e){var t=jR(e).filter(sR),n=LR(e,e,t),r=dR(fR([n],!0),!0,!0),o=fR(t,!1);return r.map(function(e){var t=e.node;return{node:t,index:e.index,lockItem:o.indexOf(t)>=0,guard:aR(t)}})}(p),g=m.map(function(e){return e.node}).indexOf(f);g>-1&&(m.filter(function(e){var t=e.guard,n=e.node;return t&&n.dataset.focusAutoGuard}).forEach(function(e){return e.node.removeAttribute("tabIndex")}),tA(g,m.length,1,m),tA(g,-1,-1,m))}}}return t},iA=function(e){oA()&&e&&(e.stopPropagation(),e.preventDefault())},aA=function(){return HR(oA)},sA=function(e){var t=e.target,n=e.currentTarget;n.contains(t)||(JR={observerNode:n,portaledElement:t})},lA=function(){ZR=!0},cA=function(){ZR=!1,QR="just",HR(function(){QR="meanwhile"})};var dA={moveFocusInside:FR,focusInside:kR,focusNextElement:function(e,t){void 0===t&&(t={}),UR(e,t,function(e,t){var n=e.next,r=e.first;return n||t&&r})},focusPrevElement:function(e,t){void 0===t&&(t={}),UR(e,t,function(e,t){var n=e.prev,r=e.last;return n||t&&r})},focusFirstElement:function(e,t){void 0===t&&(t={}),VR(e,t,"first")},focusLastElement:function(e,t){void 0===t&&(t={}),VR(e,t,"last")},captureFocusRestore:BR};Mz.assignSyncMedium(sA),Fz.assignMedium(aA),Wz.assignMedium(function(e){return e(dA)});const uA=Yz(function(e){return e.filter(function(e){return!e.disabled})},function(e){var t=e.slice(-1)[0];t&&!KR&&(document.addEventListener("focusin",iA),document.addEventListener("focusout",aA),window.addEventListener("focus",lA),window.addEventListener("blur",cA));var n=KR,r=n&&t&&t.id===n.id;KR=t,n&&!r&&(n.onDeactivation(),e.filter(function(e){return e.id===n.id}).length||n.returnFocus(!t)),t?(XR=null,r&&n.observed===t.observed||t.onActivation(dA),oA(),HR(oA)):(document.removeEventListener("focusin",iA),document.removeEventListener("focusout",aA),window.removeEventListener("focus",lA),window.removeEventListener("blur",cA),XR=null)})(function(){return null});var hA=(0,t.forwardRef)(function(e,n){return t.createElement(qz,Za({sideCar:uA,ref:n},e))}),pA=qz.propTypes||{};pA.sideCar,Yi(pA,["sideCar"]);hA.propTypes={};const fA=hA,mA=e=>e.hasAttribute("tabindex");function gA(e){if(!Xi(e)||Gi(e)||function(e){return!0===Boolean(e.getAttribute("disabled"))||!0===Boolean(e.getAttribute("aria-disabled"))}(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const n={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in n?n[t]():!!function(e){const t=e.getAttribute("contenteditable");return"false"!==t&&null!=t}(e)||mA(e)}function vA(e){return!!e&&(Xi(e)&&gA(e)&&!(e=>mA(e)&&-1===e.tabIndex)(e))}const xA=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"].join();function bA(e){const t=Array.from(e.querySelectorAll(xA));return t.unshift(e),t.filter(e=>gA(e)&&(e=>e.offsetWidth>0&&e.offsetHeight>0)(e))}var yA;const wA=null!==(yA=fA.default)&&void 0!==yA?yA:fA,SA=e=>{const{initialFocusRef:n,finalFocusRef:r,contentRef:o,restoreFocus:a,children:s,isDisabled:l,autoFocus:c,persistentFocus:d,lockFocusAcrossFrames:u}=e,h=(0,t.useCallback)(()=>{if(null!==n&&void 0!==n&&n.current)n.current.focus();else if(null!==o&&void 0!==o&&o.current){0===bA(o.current).length&&requestAnimationFrame(()=>{var e;null===(e=o.current)||void 0===e||e.focus()})}},[n,o]),p=(0,t.useCallback)(()=>{var e;null===r||void 0===r||null===(e=r.current)||void 0===e||e.focus()},[r]),f=a&&!r;return(0,i.jsx)(wA,{crossFrame:u,persistentFocus:d,autoFocus:c,disabled:l,onActivation:h,onDeactivation:p,returnFocus:f,children:s})};function jA(e){const{autoFocus:n,trapFocus:r,dialogRef:o,initialFocusRef:a,blockScrollOnMount:s,allowPinchZoom:l,finalFocusRef:c,returnFocusOnClose:d,preserveScrollBarGap:u,lockFocusAcrossFrames:h,isOpen:p}=P_(),[f,m]=ud();(0,t.useEffect)(()=>{!f&&m&&setTimeout(m)},[f,m]);const g=__(o,p);return(0,i.jsx)(SA,{autoFocus:n,isDisabled:!r,initialFocusRef:a,finalFocusRef:c,restoreFocus:d,contentRef:o,lockFocusAcrossFrames:h,children:(0,i.jsx)(Oz,{removeScrollBar:!u,allowPinchZoom:l,enabled:1===g&&s,forwardProps:!0,children:e.children})})}SA.displayName="FocusLock";const kA=["unmountOnExit","in","reverse","className","offsetX","offsetY","transition","transitionEnd","delay","animatePresenceProps"],CA={initial:e=>{var t;let{offsetX:n,offsetY:r,transition:o,transitionEnd:i,delay:a}=e;return{opacity:0,x:n,y:r,transition:null!==(t=null===o||void 0===o?void 0:o.exit)&&void 0!==t?t:FC(NC.exit,a),transitionEnd:null===i||void 0===i?void 0:i.exit}},enter:e=>{var t;let{transition:n,transitionEnd:r,delay:o}=e;return{opacity:1,x:0,y:0,transition:null!==(t=null===n||void 0===n?void 0:n.enter)&&void 0!==t?t:MC(NC.enter,o),transitionEnd:null===r||void 0===r?void 0:r.enter}},exit:e=>{var t;let{offsetY:n,offsetX:r,transition:o,transitionEnd:i,reverse:a,delay:s}=e;const l={x:r,y:n};return p({opacity:0,transition:null!==(t=null===o||void 0===o?void 0:o.exit)&&void 0!==t?t:FC(NC.exit,s)},a?p(p({},l),{},{transitionEnd:null===i||void 0===i?void 0:i.exit}):{transitionEnd:p(p({},l),null===i||void 0===i?void 0:i.exit)})}},EA={initial:"initial",animate:"enter",exit:"exit",variants:CA},_A=(0,t.forwardRef)(function(e,t){const{unmountOnExit:n,in:r,reverse:o=!0,className:a,offsetX:s=0,offsetY:l=8,transition:c,transitionEnd:d,delay:u,animatePresenceProps:h}=e,f=Ki(e,kA),m=!n||r&&n,g=r||n?"enter":"exit",v={offsetX:s,offsetY:l,reverse:o,transition:c,transitionEnd:d,delay:u};return(0,i.jsx)(ld,p(p({},h),{},{custom:v,children:m&&(0,i.jsx)(av.div,p(p({ref:t,className:Lv("chakra-offset-slide",a),custom:v},EA),{},{animate:g},f))}))});_A.displayName="SlideFade";const zA=["unmountOnExit","in","reverse","initialScale","className","transition","transitionEnd","delay","animatePresenceProps"],RA={exit:e=>{var t;let{reverse:n,initialScale:r,transition:o,transitionEnd:i,delay:a}=e;return p(p({opacity:0},n?{scale:r,transitionEnd:null===i||void 0===i?void 0:i.exit}:{transitionEnd:p({scale:r},null===i||void 0===i?void 0:i.exit)}),{},{transition:null!==(t=null===o||void 0===o?void 0:o.exit)&&void 0!==t?t:FC(NC.exit,a)})},enter:e=>{var t;let{transitionEnd:n,transition:r,delay:o}=e;return{opacity:1,scale:1,transition:null!==(t=null===r||void 0===r?void 0:r.enter)&&void 0!==t?t:MC(NC.enter,o),transitionEnd:null===n||void 0===n?void 0:n.enter}}},AA={initial:"exit",animate:"enter",exit:"exit",variants:RA},TA=(0,t.forwardRef)(function(e,t){const{unmountOnExit:n,in:r,reverse:o=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:c,delay:d,animatePresenceProps:u}=e,h=Ki(e,zA),f=!n||r&&n,m=r||n?"enter":"exit",g={initialScale:a,reverse:o,transition:l,transitionEnd:c,delay:d};return(0,i.jsx)(ld,p(p({},u),{},{custom:g,children:f&&(0,i.jsx)(av.div,p(p({ref:t,className:Lv("chakra-offset-slide",s)},AA),{},{animate:m,custom:g},h))}))});TA.displayName="ScaleFade";const PA=["preset","motionProps"],OA={slideInBottom:p(p({},EA),{},{custom:{offsetY:16,reverse:!0}}),slideInRight:p(p({},EA),{},{custom:{offsetX:16,reverse:!0}}),slideInTop:p(p({},EA),{},{custom:{offsetY:-16,reverse:!0}}),slideInLeft:p(p({},EA),{},{custom:{offsetX:-16,reverse:!0}}),scale:p(p({},AA),{},{custom:{initialScale:.95,reverse:!0}}),none:{}},LA=Rv(av.section),DA=e=>OA[e||"none"],IA=(0,t.forwardRef)((e,t)=>{const{preset:n,motionProps:r=DA(n)}=e,o=Ki(e,PA);return(0,i.jsx)(LA,p(p({ref:t},r),o))});IA.displayName="ModalTransition";const NA=["className","children","containerProps","motionProps"],MA=Dv((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:a}=e,s=Ki(e,NA),{getDialogProps:l,getDialogContainerProps:c}=P_(),d=l(s,t),u=c(o),h=Lv("chakra-modal__content",n),f=A_(),m=p({display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0},f.dialog),g=p({display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0},f.dialogContainer),{motionPreset:v}=P_();return(0,i.jsx)(jA,{children:(0,i.jsx)(Rv.div,p(p({},u),{},{className:"chakra-modal__content-container",tabIndex:-1,__css:g,children:(0,i.jsx)(IA,p(p({preset:v,motionProps:a,className:h},d),{},{__css:m,children:r}))}))})});MA.displayName="ModalContent";const FA=["className"],WA=Dv((e,n)=>{const{className:r}=e,o=Ki(e,FA),{headerId:a,setHeaderMounted:s}=P_();(0,t.useEffect)(()=>(s(!0),()=>s(!1)),[s]);const l=Lv("chakra-modal__header",r),c=p({flex:0},A_().header);return(0,i.jsx)(Rv.header,p(p({ref:n,className:l,id:a},o),{},{__css:c}))});WA.displayName="ModalHeader";const BA=["onClick","className"],UA=Dv((e,t)=>{const{onClick:n,className:r}=e,o=Ki(e,BA),{onClose:a}=P_(),s=Lv("chakra-modal__close-btn",r),l=A_();return(0,i.jsx)(ux,p({ref:t,__css:l.closeButton,className:s,onClick:Jw(n,e=>{e.stopPropagation(),a()})},o))});UA.displayName="ModalCloseButton";const VA=["className"],HA=Dv((e,n)=>{const{className:r}=e,o=Ki(e,VA),{bodyId:a,setBodyMounted:s}=P_();(0,t.useEffect)(()=>(s(!0),()=>s(!1)),[s]);const l=Lv("chakra-modal__body",r),c=A_();return(0,i.jsx)(Rv.div,p(p({ref:n,className:l,id:a},o),{},{__css:c.body}))});HA.displayName="ModalBody";const qA=["borderLeftWidth","borderBottomWidth","borderTopWidth","borderRightWidth","borderWidth","borderStyle","borderColor"],$A=["className","orientation","__css"],YA=Dv(function(e,t){const n=Hv("Divider",e),{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:a,borderRightWidth:s,borderWidth:l,borderStyle:c,borderColor:d}=n,u=Ki(n,qA),h=Ov(e),{className:f,orientation:m="horizontal",__css:g}=h,v=Ki(h,$A),x={vertical:{borderLeftWidth:r||s||l||"1px",height:"100%"},horizontal:{borderBottomWidth:o||a||l||"1px",width:"100%"}};return(0,i.jsx)(Rv.hr,p(p({ref:t,"aria-orientation":m},v),{},{__css:p(p(p({},u),{},{border:"0",borderColor:d,borderStyle:c},x[m]),g),className:Lv("chakra-divider",f)}))});YA.displayName="Divider";const KA=["className","rows"],XA=["h","minH","height","minHeight"],GA=Dv((e,t)=>{const n=Hv("Textarea",e),r=Ov(e),{className:o,rows:a}=r,s=uE(Ki(r,KA)),l=a?Pv(n,XA):n;return(0,i.jsx)(Rv.textarea,p(p({ref:t,rows:a},s),{},{className:Lv("chakra-textarea",o),__css:l}))});GA.displayName="Textarea";const JA=["className"],QA=Dv((e,t)=>{const{className:n}=e,r=Ki(e,JA),o=Lv("chakra-modal__footer",n),a=p({display:"flex",alignItems:"center",justifyContent:"flex-end"},A_().footer);return(0,i.jsx)(Rv.footer,p(p({ref:t},r),{},{__css:a,className:o}))});QA.displayName="ModalFooter";const ZA=e=>{let{isOpen:n,onClose:r,recording:o,onSave:a}=e;const[s,l]=(0,t.useState)(null),[c,d]=(0,t.useState)(null),[u,h]=(0,t.useState)(null),f=hw(),m=Ts("white","gray.800"),g=Ts("gray.200","gray.700"),v=Ts("gray.50","gray.700");if((0,t.useEffect)(()=>{if(o){const e=JSON.parse(JSON.stringify(o));"string"===typeof e.commands&&(e.commands=e.commands.split("\n").map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith("#")).map(t=>({timestamp:(new Date).toISOString(),devices:e.devices||[],originalCommand:t,finalCommand:t,useAI:"ai_generated"===e.type,action:t.startsWith("WAIT")?"wait":t.startsWith("click")?"tap":"command",target:null,fallback:null,params:t.startsWith("WAIT")?{ms:parseInt(t.split(" ")[1],10)||1e3}:{},wait:{timeoutMs:null}}))),Array.isArray(e.commands)?e.commands=e.commands.map(e=>{var t;if(!e)return{action:"command",finalCommand:""};const n=e.isWait||e.finalCommand&&e.finalCommand.startsWith("WAIT");return p(p({},e),{},{action:e.action||(n?"wait":null!==(t=e.finalCommand)&&void 0!==t&&t.startsWith("click")?"tap":"command"),target:e.target||null,fallback:e.fallback||null,params:e.params||(n?{ms:parseInt((e.finalCommand||"").replace("WAIT ",""),10)||2e3}:{}),wait:e.wait||{timeoutMs:null}})}):e.commands=[],l(e)}},[o]),!s)return null;const x=(e,t)=>{const n=p({},s),r="up"===t?e-1:e+1;if(r>=0&&r<n.commands.length){const t=n.commands[e];n.commands[e]=n.commands[r],n.commands[r]=t,l(n)}};return(0,i.jsxs)(O_,{isOpen:n,onClose:r,size:"3xl",scrollBehavior:"inside",children:[(0,i.jsx)(W_,{}),(0,i.jsxs)(MA,{maxH:"80vh",children:[(0,i.jsx)(WA,{py:3,children:(0,i.jsxs)(Ew,{spacing:3,children:[(0,i.jsx)(Gk,{size:18}),(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsx)(Cw,{fontSize:"md",fontWeight:"bold",children:s.name}),(0,i.jsxs)(zw,{fontSize:"xs",colorScheme:"blue",children:[s.commands.length," commands"]})]})]})}),(0,i.jsx)(UA,{}),(0,i.jsx)(HA,{px:4,py:3,children:(0,i.jsxs)(ww,{spacing:3,align:"stretch",children:[(0,i.jsx)(fE,{value:s.name,onChange:e=>l(p(p({},s),{},{name:e.target.value})),placeholder:"Recording name",size:"sm",fontWeight:"600"}),(0,i.jsx)(YA,{}),(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"600",children:"Commands"}),(0,i.jsx)(Ww,{leftIcon:(0,i.jsx)(kk,{}),size:"xs",colorScheme:"blue",onClick:()=>{const e=p({},s);e.commands.push({timestamp:(new Date).toISOString(),devices:s.devices||[],originalCommand:"",finalCommand:"",useAI:!1,action:"command",target:null,fallback:null,params:{},wait:{timeoutMs:null}}),l(e)},children:"Add Command"})]}),0===s.commands.length?(0,i.jsxs)(ix,{status:"info",py:2,children:[(0,i.jsx)(ax,{}),(0,i.jsx)(Cw,{fontSize:"sm",children:'No commands. Click "Add Command" to start.'})]}):(0,i.jsx)(ww,{spacing:2,align:"stretch",children:s.commands.map((e,t)=>{var n,r,o,a,b,y,w,S;const j="wait"===e.action||e.isWait,k=(null===(n=e.target)||void 0===n?void 0:n.quality)||(e.fallback?"coordinates":null),C=u===t;return(0,i.jsx)(mw,{p:2.5,borderWidth:"1px",borderColor:g,borderRadius:"md",bg:c===t?v:m,transition:"all 0.2s",children:(0,i.jsxs)(ww,{spacing:2,align:"stretch",children:[(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsxs)(zw,{colorScheme:"blue",fontSize:"xs",children:["#",t+1]}),(0,i.jsx)(zw,{fontSize:"xs",variant:"outline",children:e.action||"command"}),"strong"===k&&(0,i.jsx)(zw,{colorScheme:"green",fontSize:"xs",children:"\ud83c\udfaf Strong"}),"medium"===k&&(0,i.jsx)(zw,{colorScheme:"yellow",fontSize:"xs",children:"\ud83e\udded Medium"}),"coordinates"===k&&(0,i.jsx)(zw,{colorScheme:"red",fontSize:"xs",children:"\ud83d\udccd Coordinates"})]}),(0,i.jsxs)(Ew,{spacing:.5,children:[(0,i.jsx)(Uj,{label:"Move Up",children:(0,i.jsx)(qw,{"aria-label":"Move step up",icon:(0,i.jsx)(zk,{style:{transform:"rotate(-90deg)"}}),size:"xs",variant:"ghost",onClick:()=>x(t,"up"),isDisabled:0===t})}),(0,i.jsx)(Uj,{label:"Move Down",children:(0,i.jsx)(qw,{"aria-label":"Move step down",icon:(0,i.jsx)(zk,{style:{transform:"rotate(90deg)"}}),size:"xs",variant:"ghost",onClick:()=>x(t,"down"),isDisabled:t===s.commands.length-1})}),(0,i.jsx)(Uj,{label:"Add Wait After",children:(0,i.jsx)(qw,{"aria-label":"Add wait after step",icon:(0,i.jsx)(rC,{}),size:"xs",variant:"ghost",colorScheme:"orange",onClick:()=>(e=>{const t=p({},s);t.commands.splice(e+1,0,{timestamp:(new Date).toISOString(),devices:s.devices||[],originalCommand:"WAIT 2000",finalCommand:"WAIT 2000",useAI:!1,action:"wait",params:{ms:2e3},wait:{timeoutMs:null}}),l(t)})(t)})}),(0,i.jsx)(Uj,{label:"Delete",children:(0,i.jsx)(qw,{"aria-label":"Delete step",icon:(0,i.jsx)(sk,{}),size:"xs",variant:"ghost",colorScheme:"red",onClick:()=>(e=>{const t=p({},s);t.commands.splice(e,1),l(t),f({title:"Command deleted",status:"info",duration:2e3})})(t)})})]})]}),j?(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Cw,{fontSize:"xs",fontWeight:"600",children:"Wait Duration:"}),(0,i.jsx)(fE,{type:"number",size:"xs",value:null!==(r=null===(o=e.params)||void 0===o?void 0:o.ms)&&void 0!==r?r:2e3,onChange:e=>{const n=parseInt(e.target.value,10)||0,r=p({},s);r.commands[t].params=p(p({},r.commands[t].params),{},{ms:n}),r.commands[t].finalCommand="WAIT ".concat(n),r.commands[t].originalCommand="WAIT ".concat(n),l(r)},width:"90px"}),(0,i.jsx)(Cw,{fontSize:"xs",children:"ms"})]}):(0,i.jsxs)(ww,{align:"stretch",spacing:1.5,children:[(0,i.jsx)(GA,{value:e.finalCommand||"",onChange:e=>((e,t,n)=>{const r=p({},s);r.commands[e][t]=n,l(r)})(t,"finalCommand",e.target.value),placeholder:"Enter DSL command",size:"sm",rows:1,resize:"vertical",onFocus:()=>d(t),onBlur:()=>d(null)}),(0,i.jsxs)(Ew,{justify:"space-between",fontSize:"xs",children:[(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(Cw,{color:"gray.500",children:"Wait Timeout:"}),(0,i.jsx)(fE,{size:"xs",type:"number",placeholder:"Default (10s)",w:"100px",value:(null===(a=e.wait)||void 0===a?void 0:a.timeoutMs)||"",onChange:e=>{const n=e.target.value?parseInt(e.target.value,10):null,r=p({},s);r.commands[t].wait={timeoutMs:n},l(r)}}),(0,i.jsx)(Cw,{color:"gray.400",children:"ms"})]}),(null===(b=e.target)||void 0===b||null===(y=b.strategies)||void 0===y?void 0:y.length)>0&&(0,i.jsxs)(Ww,{size:"xs",variant:"ghost",rightIcon:C?(0,i.jsx)(iC,{}):(0,i.jsx)(lC,{}),onClick:()=>h(C?null:t),children:[e.target.strategies.length," Locators"]})]}),(null===(w=e.target)||void 0===w||null===(S=w.strategies)||void 0===S?void 0:S.length)>0&&(0,i.jsx)(VC,{in:C,animateOpacity:!0,children:(0,i.jsxs)(mw,{bg:v,p:2,borderRadius:"md",mt:1,children:[(0,i.jsx)(Cw,{fontSize:"xs",fontWeight:"bold",mb:1.5,children:"Locator Strategies:"}),(0,i.jsx)(ww,{align:"stretch",spacing:1.5,children:e.target.strategies.map((e,n)=>(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(zw,{size:"xs",colorScheme:0===n?"green":"gray",children:0===n?"Primary":"#".concat(n+1)}),(0,i.jsx)(Cw,{fontSize:"10px",color:"gray.500",w:"85px",isTruncated:!0,children:e.using||e.strategy}),(0,i.jsx)(fE,{size:"xs",value:e.value,onChange:e=>((e,t,n)=>{var r,o;const i=p({},s),a=i.commands[e];null!==(r=a.target)&&void 0!==r&&null!==(o=r.strategies)&&void 0!==o&&o[t]&&(a.target.strategies[t].value=n,l(i))})(t,n,e.target.value)}),n>0&&(0,i.jsx)(Uj,{label:"Set as Primary",children:(0,i.jsx)(qw,{size:"xs",icon:(0,i.jsx)(pC,{}),"aria-label":"Set primary",onClick:()=>((e,t)=>{var n;const r=p({},s),o=r.commands[e];if(null!==(n=o.target)&&void 0!==n&&n.strategies&&t>0){const e=o.target.strategies.splice(t,1)[0];o.target.strategies.unshift(e),l(r)}})(t,n)})}),(0,i.jsx)(Uj,{label:"Delete strategy",children:(0,i.jsx)(qw,{size:"xs",icon:(0,i.jsx)(sk,{}),colorScheme:"red",variant:"ghost","aria-label":"Delete strategy",onClick:()=>((e,t)=>{var n;const r=p({},s),o=r.commands[e];null!==(n=o.target)&&void 0!==n&&n.strategies&&(o.target.strategies.splice(t,1),0===o.target.strategies.length&&(o.target.quality="coordinates"),l(r))})(t,n)})})]},n))})]})})]})]})},t)})})]})}),(0,i.jsx)(QA,{py:2,children:(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Ww,{size:"sm",variant:"ghost",onClick:r,children:"Cancel"}),(0,i.jsx)(Ww,{leftIcon:(0,i.jsx)(bk,{}),size:"sm",colorScheme:"blue",onClick:async()=>{try{const e=p({},s);e.formatVersion=2,Array.isArray(e.commands)&&(e.commands=e.commands.map(e=>{if("wait"===e.action){var t;const n=(null===(t=e.params)||void 0===t?void 0:t.ms)||1e3;return p(p({},e),{},{finalCommand:"WAIT ".concat(n),originalCommand:"WAIT ".concat(n)})}if("tap"===e.action){var n,r,o;if(null!==(n=e.target)&&void 0!==n&&n.label&&"coordinates"!==(null===(r=e.target)||void 0===r?void 0:r.quality))return p(p({},e),{},{finalCommand:'click "'.concat(e.target.label,'"')});if(void 0!==(null===(o=e.fallback)||void 0===o?void 0:o.x))return p(p({},e),{},{finalCommand:"click ".concat(e.fallback.x,",").concat(e.fallback.y)})}return e})),await a(e),f({title:"Recording saved",description:"Changes saved successfully in formatVersion: 2",status:"success",duration:3e3}),r()}catch(e){f({title:"Failed to save",description:e.message,status:"error",duration:3e3})}},children:"Save"})]})})]})]})};function eT(e,t){const n={},r={};for(const[o,i]of Object.entries(e))t.includes(o)?n[o]=i:r[o]=i;return[n,r]}const tT=["children","placeholder","className"],nT=Dv(function(e,t){const{children:n,placeholder:r,className:o}=e,a=Ki(e,tT);return(0,i.jsxs)(Rv.select,p(p({},a),{},{ref:t,className:Lv("chakra-select",o),children:[r&&(0,i.jsx)("option",{value:"",children:r}),n]}))});nT.displayName="SelectField";const rT=["rootProps","placeholder","icon","color","height","h","minH","minHeight","iconColor","iconSize"],oT=["children"],iT=Dv((e,t)=>{var n;const r=qv("Select",e),o=Ov(e),{rootProps:a,placeholder:s,icon:l,color:c,height:d,h:u,minH:h,minHeight:f,iconColor:m,iconSize:g}=o,v=Ki(o,rT),[x,b]=eT(v,wc),y=uE(b),w={width:"100%",height:"fit-content",position:"relative",color:c},S=p(p({paddingEnd:"2rem"},r.field),{},{_focus:p({zIndex:"unset"},null===(n=r.field)||void 0===n?void 0:n._focus)});return(0,i.jsxs)(Rv.div,p(p(p({className:"chakra-select__wrapper",__css:w},x),a),{},{children:[(0,i.jsx)(nT,p(p({ref:t,height:null!==u&&void 0!==u?u:d,minH:null!==h&&void 0!==h?h:f,placeholder:s},y),{},{__css:S,children:e.children})),(0,i.jsx)(lT,p(p(p({"data-disabled":Tw(y.disabled)},(m||c)&&{color:m||c}),{},{__css:r.icon},g&&{fontSize:g}),{},{children:l}))]}))});iT.displayName="Select";const aT=e=>(0,i.jsx)("svg",p(p({viewBox:"0 0 24 24"},e),{},{children:(0,i.jsx)("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})),sT=Rv("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),lT=e=>{const{children:n=(0,i.jsx)(aT,{})}=e,r=Ki(e,oT),o=(0,t.cloneElement)(n,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return(0,i.jsx)(sT,p(p({},r),{},{className:"chakra-select__icon-wrapper",children:(0,t.isValidElement)(n)?o:null}))};lT.displayName="SelectIcon";const cT=["size","colorScheme","variant","className","spacing","isAttached","isDisabled","orientation"],dT={horizontal:{"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}},vertical:{"> *:first-of-type:not(:last-of-type)":{borderBottomRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderTopRadius:0}}},uT={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},hT=Dv(function(e,n){const{size:r,colorScheme:o,variant:a,className:s,spacing:l="0.5rem",isAttached:c,isDisabled:d,orientation:u="horizontal"}=e,h=Ki(e,cT),f=Lv("chakra-button__group",s),m=(0,t.useMemo)(()=>({size:r,colorScheme:o,variant:a,isDisabled:d}),[r,o,a,d]);let g=p({display:"inline-flex"},c?dT[u]:uT[u](l));const v="vertical"===u;return(0,i.jsx)(Ow,{value:m,children:(0,i.jsx)(Rv.div,p({ref:n,role:"group",__css:g,className:f,"data-attached":c?"":void 0,"data-orientation":u,flexDir:v?"column":void 0},h))})});hT.displayName="ButtonGroup";const pT=["spacing","spacingX","spacingY","children","justify","direction","align","className","shouldWrapChildren"],fT=["className"],mT=Dv(function(e,n){const{spacing:r="0.5rem",spacingX:o,spacingY:a,children:s,justify:l,direction:c,align:d,className:u,shouldWrapChildren:h}=e,f=Ki(e,pT),m=(0,t.useMemo)(()=>h?t.Children.map(s,(e,t)=>(0,i.jsx)(gT,{children:e},t)):s,[s,h]);return(0,i.jsx)(Rv.div,p(p({ref:n,className:Lv("chakra-wrap",u)},f),{},{children:(0,i.jsx)(Rv.ul,{className:"chakra-wrap__list",__css:{display:"flex",flexWrap:"wrap",justifyContent:l,alignItems:d,flexDirection:c,listStyleType:"none",gap:r,columnGap:o,rowGap:a,padding:"0"},children:m})}))});mT.displayName="Wrap";const gT=Dv(function(e,t){const{className:n}=e,r=Ki(e,fT);return(0,i.jsx)(Rv.li,p({ref:t,__css:{display:"flex",alignItems:"flex-start"},className:Lv("chakra-wrap__listitem",n)},r))});gT.displayName="WrapItem";const vT=["isDisabled","children"],[xT,bT]=Rc({name:"TagStylesContext",errorMessage:"useTagStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<Tag />\" "}),yT=Dv((e,t)=>{const n=qv("Tag",e),r=Ov(e),o=p({display:"inline-flex",verticalAlign:"top",alignItems:"center",maxWidth:"100%"},n.container);return(0,i.jsx)(xT,{value:n,children:(0,i.jsx)(Rv.span,p(p({ref:t},r),{},{__css:o}))})});yT.displayName="Tag";const wT=Dv((e,t)=>{const n=bT();return(0,i.jsx)(Rv.span,p(p({ref:t,noOfLines:1},e),{},{__css:n.label}))});wT.displayName="TagLabel";Dv((e,t)=>(0,i.jsx)(Kv,p({ref:t,verticalAlign:"top",marginEnd:"0.5rem"},e))).displayName="TagLeftIcon";Dv((e,t)=>(0,i.jsx)(Kv,p({ref:t,verticalAlign:"top",marginStart:"0.5rem"},e))).displayName="TagRightIcon";const ST=e=>(0,i.jsx)(Kv,p(p({verticalAlign:"inherit",viewBox:"0 0 512 512"},e),{},{children:(0,i.jsx)("path",{fill:"currentColor",d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"})}));ST.displayName="TagCloseIcon";const jT=Dv((e,t)=>{const{isDisabled:n,children:r}=e,o=Ki(e,vT),a=p({display:"flex",alignItems:"center",justifyContent:"center",outline:"0"},bT().closeButton);return(0,i.jsx)(Rv.button,p(p({ref:t,"aria-label":"close"},o),{},{type:"button",disabled:n,__css:a,children:r||(0,i.jsx)(ST,{})}))});jT.displayName="TagCloseButton";const kT=e=>{let{searchQuery:n,onSearchChange:r,sortBy:o,onSortChange:a,viewMode:s,onViewModeChange:l,filters:c,onFilterChange:d,totalCount:u,filteredCount:h,failingCount:f,availableDevices:m=[]}=e;const[g,v]=(0,t.useState)(n||""),x=Ts("white","gray.800"),b=Ts("gray.200","gray.700");(0,t.useEffect)(()=>{const e=setTimeout(()=>{r(g)},200);return()=>clearTimeout(e)},[g,r]);const y=e=>{d(p(p({},c),{},{platform:c.platform===e?"all":e}))},w=e=>{d(p(p({},c),{},{lastRunStatus:c.lastRunStatus===e?"all":e}))};return(0,i.jsxs)(mw,{bg:x,p:4,borderRadius:"lg",borderWidth:"1px",borderColor:b,boxShadow:"xs",mb:4,children:[(0,i.jsxs)(fw,{direction:{base:"column",md:"row"},justify:"space-between",align:{base:"stretch",md:"center"},gap:3,children:[(0,i.jsxs)(YC,{maxW:{base:"100%",md:"360px"},size:"sm",children:[(0,i.jsx)(ZC,{pointerEvents:"none",children:(0,i.jsx)(xk,{color:"gray"})}),(0,i.jsx)(fE,{placeholder:"Search recordings, steps, devices...",value:g,onChange:e=>v(e.target.value),borderRadius:"md"})]}),(0,i.jsxs)(Ew,{spacing:3,wrap:"wrap",children:[(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.500",whiteSpace:"nowrap",children:"Sort:"}),(0,i.jsxs)(iT,{size:"sm",value:o,onChange:e=>a(e.target.value),borderRadius:"md",w:"150px","aria-label":"Sort recordings",children:[(0,i.jsx)("option",{value:"newest",children:"Newest"}),(0,i.jsx)("option",{value:"oldest",children:"Oldest"}),(0,i.jsx)("option",{value:"name_asc",children:"Name A\u2013Z"}),(0,i.jsx)("option",{value:"name_desc",children:"Name Z\u2013A"}),(0,i.jsx)("option",{value:"steps_desc",children:"Most steps"}),(0,i.jsx)("option",{value:"last_run",children:"Last run"})]})]}),(0,i.jsxs)(hT,{size:"sm",isAttached:!0,variant:"outline",children:[(0,i.jsx)(Uj,{label:"List view",children:(0,i.jsx)(qw,{icon:(0,i.jsx)(Mk,{}),"aria-label":"List view",colorScheme:"list"===s?"blue":"gray",variant:"list"===s?"solid":"outline",onClick:()=>l("list")})}),(0,i.jsx)(Uj,{label:"Grid view",children:(0,i.jsx)(qw,{icon:(0,i.jsx)(Hk,{}),"aria-label":"Grid view",colorScheme:"grid"===s?"blue":"gray",variant:"grid"===s?"solid":"outline",onClick:()=>l("grid")})})]})]})]}),(0,i.jsxs)(fw,{direction:{base:"column",sm:"row"},justify:"space-between",align:{base:"start",sm:"center"},mt:3,pt:3,borderTop:"1px",borderColor:b,gap:2,children:[(0,i.jsxs)(mT,{spacing:2,align:"center",children:[(0,i.jsx)(Cw,{fontSize:"xs",fontWeight:"semibold",color:"gray.500",children:"Filters:"}),(0,i.jsxs)(yT,{size:"sm",cursor:"pointer",variant:"ios"===c.platform?"solid":"subtle",colorScheme:"ios"===c.platform?"blue":"gray",onClick:()=>y("ios"),children:[(0,i.jsx)(wT,{children:"iOS"}),"ios"===c.platform&&(0,i.jsx)(jT,{})]}),(0,i.jsxs)(yT,{size:"sm",cursor:"pointer",variant:"android"===c.platform?"solid":"subtle",colorScheme:"android"===c.platform?"green":"gray",onClick:()=>y("android"),children:[(0,i.jsx)(wT,{children:"Android"}),"android"===c.platform&&(0,i.jsx)(jT,{})]}),(0,i.jsxs)(yT,{size:"sm",cursor:"pointer",variant:"passed"===c.lastRunStatus?"solid":"subtle",colorScheme:"passed"===c.lastRunStatus?"green":"gray",onClick:()=>w("passed"),children:[(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(dC,{size:12}),(0,i.jsx)(wT,{children:"Passed"})]}),"passed"===c.lastRunStatus&&(0,i.jsx)(jT,{})]}),(0,i.jsxs)(yT,{size:"sm",cursor:"pointer",variant:"failed"===c.lastRunStatus?"solid":"subtle",colorScheme:"failed"===c.lastRunStatus?"red":"gray",onClick:()=>w("failed"),children:[(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(tk,{size:12}),(0,i.jsx)(wT,{children:"Failed"})]}),"failed"===c.lastRunStatus&&(0,i.jsx)(jT,{})]}),(0,i.jsxs)(yT,{size:"sm",cursor:"pointer",variant:c.coordinatesOnly?"solid":"subtle",colorScheme:c.coordinatesOnly?"orange":"gray",onClick:()=>{d(p(p({},c),{},{coordinatesOnly:!c.coordinatesOnly}))},children:[(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(Ik,{size:12}),(0,i.jsx)(wT,{children:"Has Coordinates"})]}),c.coordinatesOnly&&(0,i.jsx)(jT,{})]})]}),(0,i.jsxs)(Cw,{fontSize:"xs",color:"gray.500",whiteSpace:"nowrap",children:[h===u?"".concat(u," recording").concat(1===u?"":"s"):"".concat(h," of ").concat(u," recordings"),f>0&&" \xb7 ".concat(f," failing")]})]})]})},CT=["className","layout"],[ET,_T]=Rc({name:"TableStylesContext",errorMessage:"useTableStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<Table />\" "}),zT=Dv((e,t)=>{const n=qv("Table",e),r=Ov(e),{className:o,layout:a}=r,s=Ki(r,CT);return(0,i.jsx)(ET,{value:n,children:(0,i.jsx)(Rv.table,p({ref:t,__css:p({tableLayout:a},n.table),className:Lv("chakra-table",o)},s))})});zT.displayName="Table";const RT=Dv((e,t)=>{const n=_T();return(0,i.jsx)(Rv.thead,p(p({},e),{},{ref:t,__css:n.thead}))}),AT=Dv((e,t)=>{const n=_T();return(0,i.jsx)(Rv.tr,p(p({},e),{},{ref:t,__css:n.tr}))}),TT=["isNumeric"],PT=Dv((e,t)=>{let{isNumeric:n}=e,r=Ki(e,TT);const o=_T();return(0,i.jsx)(Rv.th,p(p({},r),{},{ref:t,__css:o.th,"data-is-numeric":n}))}),[OT,LT]=Rc({name:"CheckboxGroupContext",strict:!1}),DT=["isIndeterminate","isChecked"];function IT(e){return(0,i.jsx)(Rv.svg,p(p({width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16}},e),{},{children:(0,i.jsx)("polyline",{points:"1.5 6 4.5 9 10.5 1"})}))}function NT(e){return(0,i.jsx)(Rv.svg,p(p({width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4}},e),{},{children:(0,i.jsx)("line",{x1:"21",x2:"3",y1:"12",y2:"12"})}))}function MT(e){const{isIndeterminate:t,isChecked:n}=e,r=Ki(e,DT),o=t?NT:IT;return n||t?(0,i.jsx)(Rv.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,i.jsx)(o,p({},r))}):null}var FT=()=>"undefined"!==typeof document;var WT=!1,BT=null,UT=!1,VT=!1,HT=new Set;function qT(e,t){HT.forEach(n=>n(e,t))}var $T="undefined"!==typeof window&&null!=window.navigator&&/^Mac/.test(window.navigator.platform);function YT(e){var t;UT=!0,(t=e).metaKey||!$T&&t.altKey||t.ctrlKey||"Control"===t.key||"Shift"===t.key||"Meta"===t.key||(BT="keyboard",qT("keyboard",e))}function KT(e){if(BT="pointer","mousedown"===e.type||"pointerdown"===e.type){UT=!0;const n=e.composedPath?e.composedPath()[0]:e.target;let r=!1;try{r=n.matches(":focus-visible")}catch(t){}if(r)return;qT("pointer",e)}}function XT(e){var t;(0===(t=e).mozInputSource&&t.isTrusted||0===t.detail&&!t.pointerType)&&(UT=!0,BT="virtual")}function GT(e){e.target!==window&&e.target!==document&&(e.target instanceof Element&&e.target.hasAttribute("tabindex")||(UT||VT||(BT="virtual",qT("virtual",e)),UT=!1,VT=!1))}function JT(){UT=!1,VT=!0}function QT(){return"pointer"!==BT}function ZT(){if(!FT()||WT)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(){UT=!0;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e.apply(this,n)},document.addEventListener("keydown",YT,!0),document.addEventListener("keyup",YT,!0),document.addEventListener("click",XT,!0),window.addEventListener("focus",GT,!0),window.addEventListener("blur",JT,!1),"undefined"!==typeof PointerEvent?(document.addEventListener("pointerdown",KT,!0),document.addEventListener("pointermove",KT,!0),document.addEventListener("pointerup",KT,!0)):(document.addEventListener("mousedown",KT,!0),document.addEventListener("mousemove",KT,!0),document.addEventListener("mouseup",KT,!0)),WT=!0}function eP(e){ZT(),e(QT());const t=()=>e(QT());return HT.add(t),()=>{HT.delete(t)}}const tP={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},nP=["defaultChecked","isChecked","isFocusable","onChange","isIndeterminate","name","value","tabIndex","aria-label","aria-labelledby","aria-invalid"];function rP(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=hE(e),{isDisabled:r,isReadOnly:o,isRequired:i,isInvalid:a,id:s,onBlur:l,onFocus:c,"aria-describedby":d}=n,{defaultChecked:u,isChecked:h,isFocusable:f,onChange:m,isIndeterminate:g,name:v,value:x,tabIndex:b,"aria-label":y,"aria-labelledby":w,"aria-invalid":S}=e,j=Pv(Ki(e,nP),["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),k=dd(m),C=dd(l),E=dd(c),[_,z]=(0,t.useState)(!1),[R,A]=(0,t.useState)(!1),[T,P]=(0,t.useState)(!1),O=(0,t.useRef)(!1);(0,t.useEffect)(()=>eP(e=>{O.current=e}),[]);const L=(0,t.useRef)(null),[D,I]=(0,t.useState)(!0),[N,M]=(0,t.useState)(!!u),F=void 0!==h,W=F?h:N,B=(0,t.useCallback)(e=>{o||r?e.preventDefault():(F||M(W?e.currentTarget.checked:!!g||e.currentTarget.checked),null===k||void 0===k||k(e))},[o,r,W,F,g,k]);gx(()=>{L.current&&(L.current.indeterminate=Boolean(g))},[g]),cd(()=>{r&&z(!1)},[r,z]),gx(()=>{const e=L.current;if(null===e||void 0===e||!e.form)return;const t=()=>{M(!!u)};return e.form.addEventListener("reset",t),()=>{var n;return null===(n=e.form)||void 0===n?void 0:n.removeEventListener("reset",t)}},[]);const U=r&&!f,V=(0,t.useCallback)(e=>{" "===e.key&&P(!0)},[P]),H=(0,t.useCallback)(e=>{" "===e.key&&P(!1)},[P]);gx(()=>{if(!L.current)return;L.current.checked!==W&&M(L.current.checked)},[L.current]);const q=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},e),{},{ref:t,"data-active":Tw(T),"data-hover":Tw(R),"data-checked":Tw(W),"data-focus":Tw(_),"data-focus-visible":Tw(_&&O.current),"data-indeterminate":Tw(g),"data-disabled":Tw(r),"data-invalid":Tw(a),"data-readonly":Tw(o),"aria-hidden":!0,onMouseDown:Jw(e.onMouseDown,e=>{_&&e.preventDefault(),P(!0)}),onMouseUp:Jw(e.onMouseUp,()=>P(!1)),onMouseEnter:Jw(e.onMouseEnter,()=>A(!0)),onMouseLeave:Jw(e.onMouseLeave,()=>A(!1))})},[T,W,r,_,R,g,a,o]),$=(0,t.useCallback)(function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{ref:e,"data-active":Tw(T),"data-hover":Tw(R),"data-checked":Tw(W),"data-focus":Tw(_),"data-focus-visible":Tw(_&&O.current),"data-indeterminate":Tw(g),"data-disabled":Tw(r),"data-invalid":Tw(a),"data-readonly":Tw(o)})},[T,W,r,_,R,g,a,o]),Y=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p(p({},j),e),{},{ref:Rw(t,e=>{e&&I("LABEL"===e.tagName)}),onClick:Jw(e.onClick,()=>{var e;D||(null===(e=L.current)||void 0===e||e.click(),requestAnimationFrame(()=>{var e;null===(e=L.current)||void 0===e||e.focus({preventScroll:!0})}))}),"data-disabled":Tw(r),"data-checked":Tw(W),"data-invalid":Tw(a)})},[j,r,W,a,D]),K=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},e),{},{ref:Rw(L,t),type:"checkbox",name:v,value:x,id:s,tabIndex:b,onChange:Jw(e.onChange,B),onBlur:Jw(e.onBlur,C,()=>z(!1)),onFocus:Jw(e.onFocus,E,()=>z(!0)),onKeyDown:Jw(e.onKeyDown,V),onKeyUp:Jw(e.onKeyUp,H),required:i,checked:W,disabled:U,readOnly:o,"aria-label":y,"aria-labelledby":w,"aria-invalid":S?Boolean(S):a,"aria-describedby":d,"aria-disabled":r,"aria-checked":g?"mixed":W,style:tP})},[v,x,s,b,B,C,E,V,H,i,W,U,o,y,w,S,a,d,r,g]),X=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},e),{},{ref:t,onMouseDown:Jw(e.onMouseDown,oP),"data-disabled":Tw(r),"data-checked":Tw(W),"data-invalid":Tw(a)})},[W,r,a]);return{state:{isInvalid:a,isFocused:_,isChecked:W,isActive:T,isHovered:R,isIndeterminate:g,isDisabled:r,isReadOnly:o,isRequired:i},getRootProps:Y,getCheckboxProps:q,getIndicatorProps:$,getInputProps:K,getLabelProps:X,htmlProps:j}}function oP(e){e.preventDefault(),e.stopPropagation()}const iP=["spacing","className","children","iconColor","iconSize","icon","isChecked","isDisabled","onChange","inputProps"],aP={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},sP={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},lP=Ys({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),cP=Ys({from:{opacity:0},to:{opacity:1}}),dP=Ys({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),uP=Dv(function(e,n){const r=LT(),o=qv("Checkbox",p(p({},r),e)),a=Ov(e),{spacing:s="0.5rem",className:l,children:c,iconColor:d,iconSize:u,icon:h=(0,i.jsx)(MT,{}),isChecked:f,isDisabled:m=(null===r||void 0===r?void 0:r.isDisabled),onChange:g,inputProps:v}=a,x=Ki(a,iP);let b=f;null!==r&&void 0!==r&&r.value&&a.value&&(b=r.value.includes(a.value));let y=g;null!==r&&void 0!==r&&r.onChange&&a.value&&(y=Gw(r.onChange,g));const{state:w,getInputProps:S,getCheckboxProps:j,getLabelProps:k,getRootProps:C}=rP(p(p({},x),{},{isDisabled:m,isChecked:b,onChange:y})),E=function(e){const[n,r]=(0,t.useState)(e),[o,i]=(0,t.useState)(!1);return e!==n&&(i(!0),r(e)),o}(w.isChecked),_=(0,t.useMemo)(()=>p(p({animation:E?w.isIndeterminate?"".concat(cP," 20ms linear, ").concat(dP," 200ms linear"):"".concat(lP," 200ms linear"):void 0},o.icon),uv({fontSize:u,color:d})),[d,u,E,w.isIndeterminate,o.icon]),z=(0,t.cloneElement)(h,{__css:_,isIndeterminate:w.isIndeterminate,isChecked:w.isChecked});return(0,i.jsxs)(Rv.label,p(p({__css:p(p({},sP),o.container),className:Lv("chakra-checkbox",l)},C()),{},{children:[(0,i.jsx)("input",p({className:"chakra-checkbox__input"},S(v,n))),(0,i.jsx)(Rv.span,p(p({__css:p(p({},aP),o.control),className:"chakra-checkbox__control"},j()),{},{children:z})),c&&(0,i.jsx)(Rv.span,p(p({className:"chakra-checkbox__label"},k()),{},{__css:p({marginStart:s},o.label),children:c}))]}))});uP.displayName="Checkbox";const hP=Dv((e,t)=>{const n=_T();return(0,i.jsx)(Rv.tbody,p(p({},e),{},{ref:t,__css:n.tbody}))}),pP=["isNumeric"],fP=Dv((e,t)=>{let{isNumeric:n}=e,r=Ki(e,pP);const o=_T();return(0,i.jsx)(Rv.td,p(p({},r),{},{ref:t,__css:o.td,"data-is-numeric":n}))});function mP(e,t){var n,r,o;const i=null!==(n=null===(r=e.composedPath)||void 0===r?void 0:r.call(e)[0])&&void 0!==n?n:e.target;if(i){if(!gP(i).contains(i))return!1}return!(null!==(o=t.current)&&void 0!==o&&o.contains(i))}function gP(e){var t;return null!==(t=null===e||void 0===e?void 0:e.ownerDocument)&&void 0!==t?t:document}function vP(e){return Xi(e)?e.ownerDocument:document}function xP(e){const t=e.current;if(!t)return!1;const n=function(e){return vP(e).activeElement}(t);return!!n&&(!t.contains(n)&&!!vA(n))}function bP(e){const{isOpen:n,ref:r}=e,[o,i]=(0,t.useState)(n),[a,s]=(0,t.useState)(!1);(0,t.useEffect)(()=>{a||(i(n),s(!0))},[n,a,o]),Kw(()=>r.current,"animationend",()=>{i(n)});return{present:!(!n&&!o),onComplete(){var e;const t=function(e){var t,n;return null!==(t=null===(n=vP(e))||void 0===n?void 0:n.defaultView)&&void 0!==t?t:window}(r.current),n=new t.CustomEvent("animationend",{bubbles:!0});null===(e=r.current)||void 0===e||e.dispatchEvent(n)}}}function yP(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];const i=function(e,n){const r=(0,t.useId)();return(0,t.useMemo)(()=>e||[n,r].filter(Boolean).join("-"),[e,n,r])}(e);return(0,t.useMemo)(()=>r.map(e=>"".concat(e,"-").concat(i)),[i,r])}function wP(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{timeout:n=300,preventDefault:r=()=>!0}=e,[o,i]=(0,t.useState)([]),a=(0,t.useRef)(void 0),s=()=>{a.current&&(clearTimeout(a.current),a.current=null)};return(0,t.useEffect)(()=>s,[]),function(e){return t=>{if("Backspace"===t.key){const e=[...o];return e.pop(),void i(e)}if(function(e){const{key:t}=e;return 1===t.length||t.length>1&&/[^a-zA-Z0-9]/.test(t)}(t)){const l=o.concat(t.key);r(t)&&(t.preventDefault(),t.stopPropagation()),i(l),e(l.join("")),s(),a.current=setTimeout(()=>{i([]),a.current=null},n)}}}}const SP=["id","closeOnSelect","closeOnBlur","initialFocusRef","autoSelect","isLazy","isOpen","defaultIsOpen","onClose","onOpen","placement","lazyBehavior","direction","computePositionOnMount"],jP=["onMouseEnter","onMouseMove","onMouseLeave","onClick","onFocus","isDisabled","isFocusable","closeOnSelect","type"],[kP,CP,EP,_P]=DE(),[zP,RP]=Rc({strict:!1,name:"MenuContext"});function AP(e){var t;return null!==(t=null===e||void 0===e?void 0:e.ownerDocument)&&void 0!==t?t:document}function TP(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:n,closeOnSelect:r=!0,closeOnBlur:o=!0,initialFocusRef:i,autoSelect:a=!0,isLazy:s,isOpen:l,defaultIsOpen:c,onClose:d,onOpen:u,placement:h="bottom-start",lazyBehavior:f="unmount",direction:m,computePositionOnMount:g=!1}=e,v=Ki(e,SP),x=(0,t.useRef)(null),b=(0,t.useRef)(null),y=(0,t.useRef)(!0),w=EP(),S=(0,t.useCallback)(()=>{requestAnimationFrame(()=>{var e;null===(e=x.current)||void 0===e||e.focus({preventScroll:!1})})},[]),j=(0,t.useCallback)(()=>{const e=setTimeout(()=>{var e;if(i)null===(e=i.current)||void 0===e||e.focus();else if(w.count()){const e=w.firstEnabled();e&&P(e.index)}else{var t;null===(t=x.current)||void 0===t||t.focus({preventScroll:!1})}});N.current.add(e)},[w,i]),k=(0,t.useCallback)(()=>{const e=setTimeout(()=>{if(w.count()){const e=w.lastEnabled();e&&P(e.index)}else{var e;null===(e=x.current)||void 0===e||e.focus({preventScroll:!1})}});N.current.add(e)},[w]),C=(0,t.useCallback)(()=>{null===u||void 0===u||u(),a?j():S()},[a,j,S,u]),{isOpen:E,onOpen:_,onClose:z,onToggle:R}=Yw({isOpen:l,defaultIsOpen:c,onClose:d,onOpen:C});!function(e){const{ref:n,handler:r,enabled:o=!0}=e,i=dd(r),a=(0,t.useRef)({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;(0,t.useEffect)(()=>{if(!o)return;const e=e=>{mP(e,n)&&(a.isPointerDown=!0)},t=e=>{a.ignoreEmulatedMouseEvents?a.ignoreEmulatedMouseEvents=!1:a.isPointerDown&&r&&mP(e,n)&&(a.isPointerDown=!1,i(e))},s=e=>{a.ignoreEmulatedMouseEvents=!0,r&&a.isPointerDown&&mP(e,n)&&(a.isPointerDown=!1,i(e))},l=gP(n.current);return l.addEventListener("mousedown",e,!0),l.addEventListener("mouseup",t,!0),l.addEventListener("touchstart",e,!0),l.addEventListener("touchend",s,!0),()=>{l.removeEventListener("mousedown",e,!0),l.removeEventListener("mouseup",t,!0),l.removeEventListener("touchstart",e,!0),l.removeEventListener("touchend",s,!0)}},[r,n,i,a,o])}({enabled:E&&o,ref:x,handler:e=>{var t,n,r;const o=null!==(t=null===(n=e.composedPath)||void 0===n||null===(n=n.call(e))||void 0===n?void 0:n[0])&&void 0!==t?t:e.target;null!==(r=b.current)&&void 0!==r&&r.contains(o)||z()}});const A=Oj(p(p({},v),{},{enabled:E||g,placement:h,direction:m})),[T,P]=(0,t.useState)(-1);!function(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,i=n&&!r;cd(()=>{if(!i)return;if(xP(e))return;const t=(null===o||void 0===o?void 0:o.current)||e.current;let n;return t?(n=requestAnimationFrame(()=>{t.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(n)}):void 0},[i,e,o])}(x,{focusRef:b,visible:E,shouldFocus:!0});const O=bP({isOpen:E,ref:x}),[L,D]=yP(n,"menu-button","menu-list"),I=(0,t.useCallback)(()=>{_(),S()},[_,S]),N=(0,t.useRef)(new Set([]));(0,t.useEffect)(()=>{const e=N.current;return()=>{e.forEach(e=>clearTimeout(e)),e.clear()}},[]),cd(()=>{var e;E||(P(-1),null===(e=x.current)||void 0===e||e.scrollTo(0,0))},[E]),cd(()=>{E&&-1===T&&S()},[T,E]),(0,t.useEffect)(()=>{var e;if(!E)return;const t=w.item(T);null===t||void 0===t||null===(e=t.node)||void 0===e||e.focus({preventScroll:!y.current})},[w,T,E]);const M=(0,t.useCallback)(()=>{_(),j()},[j,_]),F=(0,t.useCallback)(()=>{y.current=!0,_(),k()},[_,k]),W=(0,t.useCallback)(()=>{var e,t;const n=AP(x.current),r=null===(e=x.current)||void 0===e?void 0:e.contains(n.activeElement);if(!(E&&!r))return;const o=null===(t=w.item(T))||void 0===t?void 0:t.node;null===o||void 0===o||o.focus({preventScroll:!y.current})},[E,T,w]);return{openAndFocusMenu:I,openAndFocusFirstItem:M,openAndFocusLastItem:F,onTransitionEnd:W,unstable__animationState:O,descendants:w,popper:A,buttonId:L,menuId:D,forceUpdate:A.forceUpdate,orientation:"vertical",isOpen:E,onToggle:R,onOpen:_,onClose:z,menuRef:x,buttonRef:b,focusedIndex:T,closeOnSelect:r,closeOnBlur:o,autoSelect:a,setFocusedIndex:P,isLazy:s,lazyBehavior:f,initialFocusRef:i,scrollIntoViewRef:y}}function PP(e){var t;return function(e){var t;if(!function(e){return null!=e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}(e))return!1;const n=null!==(t=e.ownerDocument.defaultView)&&void 0!==t?t:window;return e instanceof n.HTMLElement}(e)&&!(null===e||void 0===e||null===(t=e.getAttribute("role"))||void 0===t||!t.startsWith("menuitem"))}function OP(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{onMouseEnter:r,onMouseMove:o,onMouseLeave:i,onClick:a,onFocus:s,isDisabled:l,isFocusable:c,closeOnSelect:d,type:u}=e,h=Ki(e,jP),f=RP(),{setFocusedIndex:m,focusedIndex:g,closeOnSelect:v,onClose:x,menuId:b,scrollIntoViewRef:y}=f,w=(0,t.useRef)(null),S="".concat(b,"-menuitem-").concat((0,t.useId)()),{index:j,register:k}=_P({disabled:l&&!c}),C=(0,t.useCallback)(e=>{null===r||void 0===r||r(e),l||(y.current=!1,m(j))},[m,j,l,r,y]),E=(0,t.useCallback)(e=>{var t;null===o||void 0===o||o(e),w.current&&AP(t=w.current).activeElement!==t&&C(e)},[C,o]),_=(0,t.useCallback)(e=>{null===i||void 0===i||i(e),l||m(-1)},[m,l,i]),z=(0,t.useCallback)(e=>{null===a||void 0===a||a(e),PP(e.currentTarget)&&(null!==d&&void 0!==d?d:v)&&x()},[x,a,v,d]),R=(0,t.useCallback)(e=>{null===s||void 0===s||s(e),m(j)},[m,s,j]),A=j===g,T=ME({onClick:z,onFocus:R,onMouseEnter:C,onMouseMove:E,onMouseLeave:_,ref:Rw(k,w,n),isDisabled:l,isFocusable:c});return p(p(p({},h),T),{},{type:null!==u&&void 0!==u?u:T.type,id:S,role:"menuitem",tabIndex:A?0:-1})}const LP=["descendants"],[DP,IP]=Rc({name:"MenuStylesContext",errorMessage:"useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<Menu />\" "}),NP=e=>{const{children:n}=e,r=qv("Menu",e),o=Ov(e),{direction:a}=Fv(),s=TP(p(p({},o),{},{direction:a})),{descendants:l}=s,c=Ki(s,LP),d=(0,t.useMemo)(()=>c,[c]),{isOpen:u,onClose:h,forceUpdate:f}=d;return(0,i.jsx)(kP,{value:l,children:(0,i.jsx)(zP,{value:d,children:(0,i.jsx)(DP,{value:r,children:Pl(n,{isOpen:u,onClose:h,forceUpdate:f})})})})};NP.displayName="Menu";const MP=["children","as"],FP=Dv((e,t)=>{const n=IP();return(0,i.jsx)(Rv.button,p(p({ref:t},e),{},{__css:p({display:"inline-flex",appearance:"none",alignItems:"center",outline:0},n.button)}))}),WP=Dv((e,n)=>{const{children:r,as:o}=e,a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=RP(),{onToggle:o,popper:i,openAndFocusFirstItem:a,openAndFocusLastItem:s,scrollIntoViewRef:l}=r,c=(0,t.useCallback)(e=>{const t=e.key,n={Enter:a,ArrowDown:a,ArrowUp:s}[t];n&&(l.current=!0,e.preventDefault(),e.stopPropagation(),n(e))},[a,s,l]);return p(p({},e),{},{ref:Rw(r.buttonRef,n,i.referenceRef),id:r.buttonId,"data-active":Tw(r.isOpen),"aria-expanded":r.isOpen,"aria-haspopup":"menu","aria-controls":r.menuId,onClick:Jw(e.onClick,o),onKeyDown:Jw(e.onKeyDown,c)})}(Ki(e,MP),n),s=o||FP;return(0,i.jsx)(s,p(p({},a),{},{className:Lv("chakra-menu__menu-button",e.className),children:(0,i.jsx)(Rv.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})}))});WP.displayName="MenuButton";const BP=["rootProps","motionProps"],UP={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},VP=Rv(av.div),HP=Dv(function(e,n){var r,o;const{rootProps:a,motionProps:s}=e,l=Ki(e,BP),{isOpen:c,onTransitionEnd:d,unstable__animationState:u}=RP(),h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=RP();if(!r)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within <Menu>");const{focusedIndex:o,setFocusedIndex:i,menuRef:a,isOpen:s,onClose:l,menuId:c,isLazy:d,lazyBehavior:u,scrollIntoViewRef:h,unstable__animationState:f}=r,m=CP(),g=wP({preventDefault:e=>" "!==e.key&&PP(e.target)}),v=(0,t.useCallback)(e=>{if(!e.currentTarget.contains(e.target))return;const t={Tab:e=>e.preventDefault(),Escape:e=>{e.stopPropagation(),l()},ArrowDown:()=>{var e;h.current=!0;const t=null!==(e=m.nextEnabled(o))&&void 0!==e?e:m.firstEnabled();t&&i(t.index)},ArrowUp:()=>{var e;h.current=!0;const t=null!==(e=m.prevEnabled(o))&&void 0!==e?e:m.firstEnabled();t&&i(t.index)}},n=t[e.key];if(n)return e.preventDefault(),void n(e);const r=g(e=>{const t=function(e,t,n,r){if(null==t)return r;if(!r)return e.find(e=>n(e).toLowerCase().startsWith(t.toLowerCase()));const o=e.filter(e=>n(e).toLowerCase().startsWith(t.toLowerCase()));if(o.length>0){let t;return o.includes(r)?(t=o.indexOf(r)+1,t===o.length&&(t=0),o[t]):(t=e.indexOf(o[0]),e[t])}return r}(m.values(),e,e=>{var t,n;return null!==(t=null===e||void 0===e||null===(n=e.node)||void 0===n?void 0:n.textContent)&&void 0!==t?t:""},m.item(o));if(t){const e=m.indexOf(t.node);i(e)}});PP(e.target)&&r(e)},[m,o,g,l,i,h]),x=(0,t.useRef)(!1);s&&(x.current=!0);const b=_E({wasSelected:x.current,enabled:d,mode:u,isSelected:f.present});return p(p({},e),{},{ref:Rw(a,n),children:b?e.children:null,tabIndex:-1,role:"menu",id:c,style:p(p({},e.style),{},{transformOrigin:"var(--popper-transform-origin)"}),"aria-orientation":"vertical",onKeyDown:Jw(e.onKeyDown,v)})}(l,n),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{popper:t,isOpen:n}=RP();return t.getPopperProps(p(p({},e),{},{style:p({visibility:n?"visible":"hidden"},e.style)}))}(a),m=IP();return(0,i.jsx)(Rv.div,p(p({},f),{},{__css:{zIndex:null!==(r=e.zIndex)&&void 0!==r?r:null===(o=m.list)||void 0===o?void 0:o.zIndex},children:(0,i.jsx)(VP,p(p(p({variants:UP,initial:!1,animate:c?"enter":"exit",__css:p({outline:0},m.list)},s),h),{},{className:Lv("chakra-menu__menu-list",h.className),onUpdate:d,onAnimationComplete:Gw(u.onComplete,h.onAnimationComplete)}))}))});HP.displayName="MenuList";const qP=Dv((e,t)=>{const n=IP();return(0,i.jsx)(Rv.span,p(p({ref:t},e),{},{__css:n.command,className:"chakra-menu__command"}))});qP.displayName="MenuCommand";const $P=["className","children"],YP=e=>{const{className:n,children:r}=e,o=Ki(e,$P),a=IP(),s=t.Children.only(r),l=(0,t.isValidElement)(s)?(0,t.cloneElement)(s,{focusable:"false","aria-hidden":!0,className:Lv("chakra-menu__icon",s.props.className)}):null,c=Lv("chakra-menu__icon-wrapper",n);return(0,i.jsx)(Rv.span,p(p({className:c},o),{},{__css:a.icon,children:l}))};YP.displayName="MenuIcon";const KP=["type"],XP=Dv((e,n)=>{const{type:r}=e,o=Ki(e,KP),a=IP(),s=o.as||r?null!==r&&void 0!==r?r:void 0:"button",l=(0,t.useMemo)(()=>p({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0},a.item),[a.item]);return(0,i.jsx)(Rv.button,p(p({ref:n,type:s},o),{},{__css:l}))}),GP=["icon","iconSpacing","command","commandSpacing","children"],JP=Dv((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:a="0.75rem",children:s}=e,l=OP(Ki(e,GP),t),c=n||o?(0,i.jsx)("span",{style:{pointerEvents:"none",flex:1},children:s}):s;return(0,i.jsxs)(XP,p(p({},l),{},{className:Lv("chakra-menu__menuitem",l.className),children:[n&&(0,i.jsx)(YP,{fontSize:"0.8em",marginEnd:r,children:n}),c,o&&(0,i.jsx)(qP,{marginStart:a,children:o})]}))});JP.displayName="MenuItem";const QP=e=>{let{quality:t={strong:0,medium:0,coordinates:0},total:n=0}=e;const r=(null===t||void 0===t?void 0:t.strong)||0,o=(null===t||void 0===t?void 0:t.medium)||0,a=(null===t||void 0===t?void 0:t.coordinates)||0,s=r+o+a||n||1,l=Math.round(r/s*100),c=Math.round(o/s*100),d=Math.round(a/s*100),u="".concat(r," strong \xb7 ").concat(o," medium \xb7 ").concat(a," coordinates");return(0,i.jsx)(Uj,{label:u,hasArrow:!0,children:(0,i.jsx)(mw,{w:"80px",cursor:"help",title:u,children:(0,i.jsxs)(fw,{h:"6px",borderRadius:"full",overflow:"hidden",bg:"gray.100",children:[l>0&&(0,i.jsx)(mw,{w:"".concat(l,"%"),bg:"green.400"}),c>0&&(0,i.jsx)(mw,{w:"".concat(c,"%"),bg:"yellow.400"}),d>0&&(0,i.jsx)(mw,{w:"".concat(d,"%"),bg:"red.400"})]})})})},ZP=e=>{let{lastRun:t}=e;if(!t||!t.status)return(0,i.jsx)(zw,{colorScheme:"gray",variant:"subtle",fontSize:"xs",children:"\u2014"});const{status:n,at:r}=t;let o="gray",a=null;"passed"===n?(o="green",a=(0,i.jsx)(dC,{size:10})):"partial"===n?(o="yellow",a=(0,i.jsx)(gC,{size:10})):"failed"===n&&(o="red",a=(0,i.jsx)(tk,{size:10}));const s=r?new Date(r).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"";return(0,i.jsx)(zw,{colorScheme:o,variant:"subtle",fontSize:"xs",px:2,py:.5,borderRadius:"md",children:(0,i.jsxs)(Ew,{spacing:1,children:[a,(0,i.jsx)(Cw,{textTransform:"capitalize",children:n}),s&&(0,i.jsxs)(Cw,{fontSize:"10px",color:"gray.500",children:["(",s,")"]})]})})},eO=e=>{let{recordings:n=[],selectedFilenames:r=[],onSelectRecording:o,onSelectAll:a,onOpenDetails:s,onReplay:l,onEdit:c,onDuplicate:d,onExport:u,onDelete:h,onBulkDelete:p,onBulkExport:f,onClearFilters:m}=e;const[g,v]=(0,t.useState)(0),x=Ts("white","gray.800"),b=Ts("gray.200","gray.700"),y=Ts("gray.50","gray.700"),w=Ts("blue.50","gray.700");(0,t.useEffect)(()=>{const e=e=>{["INPUT","TEXTAREA","SELECT"].includes(e.target.tagName)||("ArrowDown"===e.key?(e.preventDefault(),v(e=>Math.min(e+1,n.length-1))):"ArrowUp"===e.key?(e.preventDefault(),v(e=>Math.max(e-1,0))):"Enter"===e.key?(e.preventDefault(),n[g]&&s(n[g])):"r"!==e.key&&"R"!==e.key||(e.preventDefault(),n[g]&&l(n[g])))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,g,s,l]);const S=n.length>0&&r.length===n.length,j=r.length>0&&!S,k=e=>{if(!e||e<=0)return"\u2014";const t=Math.round(e/1e3);if(t<60)return"".concat(t,"s");const n=Math.floor(t/60);return"".concat(n,"m ").concat(t%60,"s")},C=e=>{if(!e)return"\u2014";return new Date(e).toLocaleDateString([],{month:"short",day:"numeric"})};return 0===n.length?(0,i.jsxs)(mw,{bg:x,p:10,borderRadius:"lg",borderWidth:"1px",borderColor:b,textAlign:"center",children:[(0,i.jsx)(Cw,{fontSize:"md",fontWeight:"medium",color:"gray.600",mb:2,children:"No recordings found"}),(0,i.jsx)(Cw,{fontSize:"sm",color:"gray.500",mb:4,children:"Try adjusting your search or filters to see more results."}),m&&(0,i.jsx)(Ww,{size:"sm",colorScheme:"blue",onClick:m,children:"Clear filters"})]}):(0,i.jsxs)(mw,{bg:x,borderRadius:"lg",borderWidth:"1px",borderColor:b,boxShadow:"sm",overflow:"hidden",children:[r.length>0&&(0,i.jsxs)(fw,{bg:"blue.50",px:4,py:2,borderBottom:"1px",borderColor:"blue.100",justify:"space-between",align:"center",children:[(0,i.jsxs)(Cw,{fontSize:"sm",fontWeight:"semibold",color:"blue.700",children:[r.length," recording",1===r.length?"":"s"," selected"]}),(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Ww,{size:"xs",leftIcon:(0,i.jsx)(Jk,{}),colorScheme:"blue",variant:"outline",onClick:f,children:"Export selected"}),(0,i.jsx)(Ww,{size:"xs",leftIcon:(0,i.jsx)(sk,{}),colorScheme:"red",variant:"solid",onClick:p,children:"Delete selected"})]})]}),(0,i.jsx)(mw,{overflowX:"auto",maxH:"70vh",children:(0,i.jsxs)(zT,{size:"sm",variant:"simple",children:[(0,i.jsx)(RT,{position:"sticky",top:0,bg:x,zIndex:1,boxShadow:"xs",children:(0,i.jsxs)(AT,{children:[(0,i.jsx)(PT,{w:"40px",px:3,children:(0,i.jsx)(uP,{isChecked:S,isIndeterminate:j,onChange:a,"aria-label":"Select all recordings"})}),(0,i.jsx)(PT,{children:"Name"}),(0,i.jsx)(PT,{isNumeric:!0,children:"Steps"}),(0,i.jsx)(PT,{children:"Devices"}),(0,i.jsx)(PT,{children:"Created"}),(0,i.jsx)(PT,{children:"Duration"}),(0,i.jsx)(PT,{children:"Quality"}),(0,i.jsx)(PT,{children:"Last run"}),(0,i.jsx)(PT,{textAlign:"right",children:"Actions"})]})}),(0,i.jsx)(hP,{children:n.map((e,t)=>{const n=r.includes(e.filename),a=t===g;return(0,i.jsxs)(AT,{bg:a?w:n?"blue.50":"inherit",_hover:{bg:y},cursor:"pointer",onClick:()=>s(e),transition:"background-color 0.1s",children:[(0,i.jsx)(fP,{px:3,onClick:e=>e.stopPropagation(),children:(0,i.jsx)(uP,{isChecked:n,onChange:()=>o(e.filename),"aria-label":"Select ".concat(e.name)})}),(0,i.jsx)(fP,{fontWeight:"semibold",children:(0,i.jsxs)(Ew,{spacing:2,children:["ai_generated"===e.type?(0,i.jsx)(Uj,{label:"AI Generated",children:(0,i.jsx)(mw,{color:"purple.500",children:(0,i.jsx)(Qk,{size:14})})}):(0,i.jsx)(Uj,{label:"Manual recording",children:(0,i.jsx)(mw,{color:"blue.500",children:(0,i.jsx)(fk,{size:14})})}),(0,i.jsx)(Cw,{isTruncated:!0,maxW:"200px",title:e.name,children:e.name})]})}),(0,i.jsx)(fP,{isNumeric:!0,children:(0,i.jsx)(zw,{variant:"subtle",colorScheme:"gray",fontSize:"xs",children:e.commandCount||0})}),(0,i.jsx)(fP,{children:(0,i.jsxs)(Ew,{spacing:1,wrap:"nowrap",children:[(e.devices||[]).slice(0,2).map((e,t)=>(0,i.jsx)(zw,{size:"xs",variant:"outline",fontSize:"10px",children:e},t)),(e.devices||[]).length>2&&(0,i.jsxs)(zw,{size:"xs",variant:"outline",fontSize:"10px",children:["+",e.devices.length-2]}),(!e.devices||0===e.devices.length)&&(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.400",children:"\u2014"})]})}),(0,i.jsx)(fP,{color:"gray.500",fontSize:"xs",children:C(e.startTime)}),(0,i.jsx)(fP,{color:"gray.500",fontSize:"xs",children:k(e.durationMs)}),(0,i.jsx)(fP,{children:(0,i.jsx)(QP,{quality:e.locatorQuality,total:e.commandCount})}),(0,i.jsx)(fP,{children:(0,i.jsx)(ZP,{lastRun:e.lastRun})}),(0,i.jsx)(fP,{textAlign:"right",onClick:e=>e.stopPropagation(),children:(0,i.jsxs)(Ew,{spacing:1,justify:"flex-end",children:[(0,i.jsx)(Uj,{label:"Replay",children:(0,i.jsx)(qw,{size:"xs",colorScheme:"green",icon:(0,i.jsx)(Ck,{}),"aria-label":"Replay recording",onClick:()=>l(e)})}),(0,i.jsx)(Uj,{label:"Edit",children:(0,i.jsx)(qw,{size:"xs",variant:"ghost",icon:(0,i.jsx)(Gk,{}),"aria-label":"Edit recording",onClick:()=>c(e.filename)})}),(0,i.jsxs)(NP,{isLazy:!0,children:[(0,i.jsx)(WP,{as:qw,size:"xs",variant:"ghost",icon:(0,i.jsx)(Ak,{}),"aria-label":"More options for ".concat(e.name)}),(0,i.jsxs)(HP,{zIndex:2,children:[(0,i.jsx)(JP,{icon:(0,i.jsx)(eC,{}),onClick:()=>d(e.filename),children:"Duplicate"}),(0,i.jsx)(JP,{icon:(0,i.jsx)(Jk,{}),onClick:()=>u(e.filename),children:"Export JSON"}),(0,i.jsx)(JP,{icon:(0,i.jsx)(sk,{}),color:"red.500",onClick:()=>h(e.filename),children:"Delete"})]})]})]})})]},e.filename)})})]})})]})},[tO,nO]=Rc({name:"".concat(rO="Card","StylesContext"),errorMessage:'useStyles: "styles" is undefined. Seems you forgot to wrap the components in "<'.concat(rO,' />" ')});var rO;const oO=["className","children","direction","justify","align"],iO=Dv(function(e,t){const n=Ov(e),{className:r,children:o,direction:a="column",justify:s,align:l}=n,c=Ki(n,oO),d=qv("Card",e);return(0,i.jsx)(Rv.div,p(p({ref:t,className:Lv("chakra-card",r),__css:p({display:"flex",flexDirection:a,justifyContent:s,alignItems:l,position:"relative",minWidth:0,wordWrap:"break-word"},d.container)},c),{},{children:(0,i.jsx)(tO,{value:d,children:o})}))}),aO=["className"],sO=Dv(function(e,t){const{className:n}=e,r=Ki(e,aO),o=nO();return(0,i.jsx)(Rv.div,p({ref:t,className:Lv("chakra-card__header",n),__css:o.header},r))}),lO=["className"],cO=Dv(function(e,t){const{className:n}=e,r=Ki(e,lO),o=nO();return(0,i.jsx)(Rv.div,p({ref:t,className:Lv("chakra-card__body",n),__css:o.body},r))}),dO=["className","justify"],uO=Dv(function(e,t){const{className:n,justify:r}=e,o=Ki(e,dO),a=nO();return(0,i.jsx)(Rv.div,p({ref:t,className:Lv("chakra-card__footer",n),__css:p({display:"flex",justifyContent:r},a.footer)},o))}),hO=e=>{let{recordings:t=[],onOpenDetails:n,onReplay:r,onEdit:o,onDuplicate:a,onExport:s,onDelete:l,onClearFilters:c}=e;const d=Ts("white","gray.800"),u=Ts("gray.200","gray.700"),h=e=>{if(!e)return"";return new Date(e).toLocaleDateString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})};return 0===t.length?(0,i.jsxs)(mw,{bg:d,p:10,borderRadius:"lg",borderWidth:"1px",borderColor:u,textAlign:"center",children:[(0,i.jsx)(Cw,{fontSize:"md",fontWeight:"medium",color:"gray.600",mb:2,children:"No recordings found"}),(0,i.jsx)(Cw,{fontSize:"sm",color:"gray.500",mb:4,children:"Try adjusting your search or filters to see more results."}),c&&(0,i.jsx)(Ww,{size:"sm",colorScheme:"blue",onClick:c,children:"Clear filters"})]}):(0,i.jsx)(u_,{columns:{base:1,md:2,lg:3},spacing:6,children:t.map(e=>{const t=(e=>{if(!e||e<=0)return null;const t=Math.round(e/1e3);if(t<60)return"".concat(t,"s");const n=Math.floor(t/60);return"".concat(n,"m ").concat(t%60,"s")})(e.durationMs);return(0,i.jsxs)(iO,{bg:d,borderWidth:"1px",borderColor:u,borderRadius:"lg",overflow:"hidden",boxShadow:"sm",_hover:{boxShadow:"md",transform:"translateY(-2px)"},transition:"all 0.2s",cursor:"pointer",onClick:()=>n(e),children:[(0,i.jsx)(sO,{pb:2,children:(0,i.jsxs)(Ew,{justify:"space-between",align:"start",children:[(0,i.jsxs)(Ew,{spacing:2,align:"center",children:["ai_generated"===e.type?(0,i.jsx)(Uj,{label:"AI Generated",children:(0,i.jsx)(mw,{color:"purple.500",children:(0,i.jsx)(Qk,{size:18})})}):(0,i.jsx)(Uj,{label:"Manual recording",children:(0,i.jsx)(mw,{color:"blue.500",children:(0,i.jsx)(fk,{size:18})})}),(0,i.jsx)(jw,{size:"sm",isTruncated:!0,maxW:"200px",title:e.name,children:e.name})]}),(0,i.jsx)(ZP,{lastRun:e.lastRun})]})}),(0,i.jsx)(cO,{py:3,children:(0,i.jsxs)(ww,{align:"stretch",spacing:3,children:[(0,i.jsxs)(Ew,{justify:"space-between",fontSize:"xs",color:"gray.500",children:[(0,i.jsxs)(Cw,{children:[e.commandCount||0," steps"]}),t&&(0,i.jsx)(Cw,{children:t}),(0,i.jsx)(Cw,{children:h(e.startTime)})]}),(0,i.jsxs)(Ew,{spacing:1,wrap:"wrap",children:[(e.devices||[]).map((e,t)=>(0,i.jsx)(zw,{size:"xs",variant:"subtle",colorScheme:"blue",fontSize:"10px",children:e},t)),(!e.devices||0===e.devices.length)&&(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.400",children:"No device specified"})]}),(0,i.jsxs)(mw,{pt:1,children:[(0,i.jsx)(Ew,{justify:"space-between",mb:1,children:(0,i.jsx)(Cw,{fontSize:"10px",color:"gray.500",fontWeight:"medium",children:"Locator Quality"})}),(0,i.jsx)(QP,{quality:e.locatorQuality,total:e.commandCount})]})]})}),(0,i.jsx)(YA,{borderColor:u}),(0,i.jsxs)(uO,{pt:2,pb:3,justify:"space-between",align:"center",onClick:e=>e.stopPropagation(),children:[(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Ww,{size:"xs",colorScheme:"green",leftIcon:(0,i.jsx)(Ck,{}),onClick:()=>r(e),"aria-label":"Replay recording",children:"Replay"}),(0,i.jsx)(Ww,{size:"xs",variant:"outline",leftIcon:(0,i.jsx)(Gk,{}),onClick:()=>o(e.filename),"aria-label":"Edit recording",children:"Edit"})]}),(0,i.jsxs)(NP,{isLazy:!0,children:[(0,i.jsx)(WP,{as:qw,size:"xs",variant:"ghost",icon:(0,i.jsx)(Ak,{}),"aria-label":"More options for ".concat(e.name)}),(0,i.jsxs)(HP,{zIndex:2,children:[(0,i.jsx)(JP,{icon:(0,i.jsx)(eC,{}),onClick:()=>a(e.filename),children:"Duplicate"}),(0,i.jsx)(JP,{icon:(0,i.jsx)(Jk,{}),onClick:()=>s(e.filename),children:"Export JSON"}),(0,i.jsx)(JP,{icon:(0,i.jsx)(sk,{}),color:"red.500",onClick:()=>l(e.filename),children:"Delete"})]})]})]})]},e.filename)})})},pO=["isOpen","onClose","placement","children"],[fO,mO]=Rc(),gO={start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}};function vO(e){var t;const{isOpen:n,onClose:r,placement:o="right",children:a}=e,s=Ki(e,pO),l=Fv(),c=null===(t=l.components)||void 0===t?void 0:t.Drawer,d=function(e,t){var n,r;if(e)return null!==(n=null===(r=gO[e])||void 0===r?void 0:r[t])&&void 0!==n?n:e}(o,l.direction);return(0,i.jsx)(fO,{value:{placement:d},children:(0,i.jsx)(O_,p(p({isOpen:n,onClose:r,styleConfig:c},s),{},{children:a}))})}const xO=["direction","style","unmountOnExit","in","className","transition","transitionEnd","delay","motionProps","animatePresenceProps"],bO={exit:{duration:.15,ease:TC.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},yO={exit:e=>{var t;let{direction:n,transition:r,transitionEnd:o,delay:i}=e;const{exit:a}=IC({direction:n});return p(p({},a),{},{transition:null!==(t=null===r||void 0===r?void 0:r.exit)&&void 0!==t?t:FC(bO.exit,i),transitionEnd:null===o||void 0===o?void 0:o.exit})},enter:e=>{var t;let{direction:n,transitionEnd:r,transition:o,delay:i}=e;const{enter:a}=IC({direction:n});return p(p({},a),{},{transition:null!==(t=null===o||void 0===o?void 0:o.enter)&&void 0!==t?t:MC(bO.enter,i),transitionEnd:null===r||void 0===r?void 0:r.enter})}},wO=(0,t.forwardRef)(function(e,t){const{direction:n="right",style:r,unmountOnExit:o,in:a,className:s,transition:l,transitionEnd:c,delay:d,motionProps:u,animatePresenceProps:h}=e,f=Ki(e,xO),m=IC({direction:n}),g=Object.assign({position:"fixed"},m.position,r),v=!o||a&&o,x=a||o?"enter":"exit",b={transitionEnd:c,transition:l,direction:n,delay:d};return(0,i.jsx)(ld,p(p({},h),{},{custom:b,children:v&&(0,i.jsx)(av.div,p(p({},f),{},{ref:t,initial:"exit",className:Lv("chakra-slide",s),animate:x,exit:"exit",custom:b,variants:yO,style:g},u))}))});wO.displayName="Slide";const SO=["className","children","motionProps","containerProps"],jO=Rv(wO),kO=Dv((e,t)=>{const{className:n,children:r,motionProps:o,containerProps:a}=e,s=Ki(e,SO),{getDialogProps:l,getDialogContainerProps:c,isOpen:d}=P_(),u=l(s,t),h=c(a),f=Lv("chakra-modal__content",n),m=A_(),g=p({display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0},m.dialog),v=p({display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0},m.dialogContainer),{placement:x}=mO();return(0,i.jsx)(jA,{children:(0,i.jsx)(Rv.div,p(p({},h),{},{className:"chakra-modal__content-container",__css:v,children:(0,i.jsx)(jO,p(p({motionProps:o,direction:x,in:d,className:f},u),{},{__css:g,children:r}))}))})});kO.displayName="DrawerContent";const CO=e=>{var t;let{step:n}=e;const r=(null===(t=n.target)||void 0===t?void 0:t.quality)||(n.fallback?"coordinates":"none");if("strong"===r){var o,a,s,l;const e=(null===(o=n.target.strategies)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.using)||"accessibility id",t=n.target.accessibilityId||n.target.label||(null===(s=n.target.strategies)||void 0===s||null===(l=s[0])||void 0===l?void 0:l.value)||"";return(0,i.jsx)(Uj,{label:"Strong locator: ".concat(e,' = "').concat(t,'"'),children:(0,i.jsx)(zw,{colorScheme:"green",variant:"subtle",fontSize:"xs",children:(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(ck,{size:10}),(0,i.jsxs)(Cw,{children:["\ud83c\udfaf Strong: ",t.slice(0,20)]})]})})})}if("medium"===r){var c,d,u,h;const e=(null===(c=n.target)||void 0===c?void 0:c.label)||(null===(d=n.target)||void 0===d||null===(u=d.strategies)||void 0===u||null===(h=u[0])||void 0===h?void 0:h.value)||"";return(0,i.jsx)(Uj,{label:'Medium quality locator: "'.concat(e,'"'),children:(0,i.jsx)(zw,{colorScheme:"yellow",variant:"subtle",fontSize:"xs",children:(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(tC,{size:10}),(0,i.jsxs)(Cw,{children:["\ud83e\udded Medium: ",e.slice(0,18)]})]})})})}if("coordinates"===r||n.fallback){const e=n.fallback?"".concat(n.fallback.x,",").concat(n.fallback.y):"";return(0,i.jsx)(Uj,{label:"Positional coordinates: may break on other devices or resolutions",children:(0,i.jsx)(zw,{colorScheme:"red",variant:"subtle",fontSize:"xs",children:(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(Ik,{size:10}),(0,i.jsxs)(Cw,{children:["\ud83d\udccd Coords: ",e]})]})})})}return null},EO=e=>{let{isOpen:n,onClose:r,recording:o,onReplay:a,onEdit:s,onRecordingUpdated:l}=e;const[c,d]=(0,t.useState)(null),[u,h]=(0,t.useState)(!1),[f,m]=(0,t.useState)(""),g=hw(),v=Ts("white","gray.800"),x=Ts("gray.200","gray.700"),b=Ts("gray.50","gray.700");(0,t.useEffect)(()=>{null!==o&&void 0!==o&&o.filename&&n?(m(o.name||""),h(!1),fetch("".concat(yE,"/api/recordings/").concat(o.filename)).then(e=>e.json()).then(e=>{e.success&&d(e.recording)}).catch(e=>{console.error("Error fetching recording details:",e)})):d(null)},[o,n]);const y=Array.isArray(null===c||void 0===c?void 0:c.commands)?c.commands:"string"===typeof(null===c||void 0===c?void 0:c.commands)?c.commands.split("\n").filter(e=>e.trim()).map(e=>({action:"command",finalCommand:e})):[],w=y.filter(e=>{var t;return"coordinates"===(null===(t=e.target)||void 0===t?void 0:t.quality)||!e.target&&e.fallback}).length;return(0,i.jsxs)(vO,{isOpen:n,placement:"right",size:"md",onClose:r,children:[(0,i.jsx)(W_,{}),(0,i.jsxs)(kO,{bg:v,children:[(0,i.jsx)(UA,{}),(0,i.jsx)(WA,{borderBottomWidth:"1px",borderColor:x,pb:3,children:(0,i.jsxs)(ww,{align:"stretch",spacing:2,children:[u?(0,i.jsxs)(Ew,{children:[(0,i.jsx)(fE,{size:"sm",value:f,onChange:e=>m(e.target.value),autoFocus:!0}),(0,i.jsx)(qw,{size:"sm",colorScheme:"green",icon:(0,i.jsx)(cC,{}),"aria-label":"Save name",onClick:async()=>{if(f.trim()&&f!==(null===c||void 0===c?void 0:c.name))try{const e=p(p({},c),{},{name:f.trim()}),t=await fetch("".concat(yE,"/api/recordings/").concat(o.filename),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});(await t.json()).success&&(d(e),h(!1),l&&l(),g({title:"Recording renamed",status:"success",duration:2e3}))}catch(CF){g({title:"Failed to rename",description:CF.message,status:"error",duration:3e3})}else h(!1)}}),(0,i.jsx)(qw,{size:"sm",variant:"ghost",icon:(0,i.jsx)(ek,{}),"aria-label":"Cancel rename",onClick:()=>h(!1)})]}):(0,i.jsxs)(Ew,{justify:"space-between",align:"center",children:[(0,i.jsx)(Cw,{fontSize:"lg",fontWeight:"bold",isTruncated:!0,title:(null===c||void 0===c?void 0:c.name)||(null===o||void 0===o?void 0:o.name),children:(null===c||void 0===c?void 0:c.name)||(null===o||void 0===o?void 0:o.name)}),(0,i.jsx)(qw,{size:"xs",variant:"ghost",icon:(0,i.jsx)(Gk,{}),"aria-label":"Rename recording",onClick:()=>h(!0)})]}),(0,i.jsxs)(Ew,{spacing:2,wrap:"wrap",fontSize:"xs",children:[(0,i.jsxs)(zw,{colorScheme:"blue",children:[y.length," steps"]}),((null===c||void 0===c?void 0:c.devices)||(null===o||void 0===o?void 0:o.devices)||[]).map((e,t)=>(0,i.jsx)(zw,{variant:"outline",colorScheme:"gray",children:e},t))]}),(0,i.jsxs)(Ew,{spacing:2,pt:1,children:[(0,i.jsx)(Ww,{size:"sm",colorScheme:"green",leftIcon:(0,i.jsx)(Ck,{}),flex:1,onClick:()=>{r(),a(o)},children:"Replay"}),(0,i.jsx)(Ww,{size:"sm",variant:"outline",leftIcon:(0,i.jsx)(Gk,{}),onClick:()=>{r(),s(o.filename)},children:"Edit"})]})]})}),(0,i.jsx)(HA,{px:4,py:3,children:(0,i.jsxs)(ww,{align:"stretch",spacing:4,children:[w>0&&(0,i.jsxs)(ix,{status:"warning",borderRadius:"md",py:2,px:3,fontSize:"xs",children:[(0,i.jsx)(ax,{}),(0,i.jsxs)(lx,{children:[w," step",1===w?"":"s"," rely on screen positions and may break on other devices \u2014 re-record them or enable self-healing."]})]}),(0,i.jsxs)(mw,{children:[(0,i.jsx)(Cw,{fontSize:"xs",fontWeight:"bold",textTransform:"uppercase",color:"gray.500",mb:2,children:"Step Timeline"}),(0,i.jsx)(ww,{align:"stretch",spacing:2,children:y.map((e,t)=>{const n=(e=>{const t=e.action||"command";if("tap"===t){var n,r;if(null!==(n=e.target)&&void 0!==n&&n.label){const t=e.target.type?e.target.type.replace(/^XCUIElementType/,""):"Element";return"Tap ".concat(t,' "').concat(e.target.label,'"')}return void 0!==(null===(r=e.fallback)||void 0===r?void 0:r.x)?"Tap at (".concat(e.fallback.x,", ").concat(e.fallback.y,")"):e.finalCommand||"Tap"}if("longpress"===t){var o,i;const t=null!==(o=e.params)&&void 0!==o&&o.durationMs?e.params.durationMs/1e3:1;return void 0!==(null===(i=e.fallback)||void 0===i?void 0:i.x)?"Long press at (".concat(e.fallback.x,", ").concat(e.fallback.y,") for ").concat(t,"s"):"Long press for ".concat(t,"s")}var a,s,l,c,d,u,h,p;if("swipe"===t)return null!==(a=e.params)&&void 0!==a&&a.direction?"Swipe ".concat(e.params.direction):null!==(s=e.params)&&void 0!==s&&s.from&&null!==(l=e.params)&&void 0!==l&&l.to?"Swipe (".concat(e.params.from.x,",").concat(e.params.from.y,") \u2192 (").concat(e.params.to.x,",").concat(e.params.to.y,")"):"Swipe";if("type"===t)return'Type "'.concat((null===(c=e.params)||void 0===c?void 0:c.text)||"",'"');if("launch"===t)return"Launch ".concat((null===(d=e.params)||void 0===d?void 0:d.bundleId)||(null===(u=e.params)||void 0===u?void 0:u.appId)||"");if("kill"===t)return"Kill ".concat((null===(h=e.params)||void 0===h?void 0:h.bundleId)||(null===(p=e.params)||void 0===p?void 0:p.appId)||"");if("home"===t)return"Press Home";if("back"===t)return"Press Back";if("wait"===t){var f;const t=null!==(f=e.params)&&void 0!==f&&f.ms?(e.params.ms/1e3).toFixed(1):"1";return"Wait ".concat(t," s")}return e.finalCommand||e.originalCommand||"Custom command"})(e),r=(e=>{switch(e){case"tap":return(0,i.jsx)(Rk,{size:14,color:"#3182CE"});case"longpress":return(0,i.jsx)(rC,{size:14,color:"#D69E2E"});case"swipe":return(0,i.jsx)(Dk,{size:14,color:"#805AD5"});case"type":return(0,i.jsx)(ak,{size:14,color:"#38A169"});case"launch":return(0,i.jsx)(tC,{size:14,color:"#DD6B20"});case"kill":return(0,i.jsx)(pk,{size:14,color:"#E53E3E"});case"home":return(0,i.jsx)(pk,{size:14,color:"#718096"});case"back":return(0,i.jsx)(Zk,{size:14,color:"#4A5568"});case"wait":return(0,i.jsx)(rC,{size:14,color:"#718096"});default:return(0,i.jsx)(lk,{size:14,color:"#4A5568"})}})(e.action);return(0,i.jsx)(mw,{p:2.5,borderRadius:"md",borderWidth:"1px",borderColor:x,_hover:{bg:b},transition:"background-color 0.1s",children:(0,i.jsxs)(fw,{justify:"space-between",align:"start",children:[(0,i.jsxs)(Ew,{spacing:2,align:"center",children:[(0,i.jsxs)(Cw,{fontSize:"xs",color:"gray.400",fontWeight:"bold",w:"20px",children:[t+1,"."]}),(0,i.jsx)(mw,{children:r}),(0,i.jsx)(Cw,{fontSize:"xs",fontWeight:"medium",isTruncated:!0,maxW:"200px",title:n,children:n})]}),(0,i.jsx)(CO,{step:e})]})},t)})})]})]})})]})]})};function _O(e){return e&&Bn(e)&&Bn(e.target)}function zO(e){const{colorScheme:n,size:r,variant:o,children:a,isDisabled:s}=e,{value:l,onChange:c}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{defaultValue:n,value:r,onChange:o,isDisabled:i,isNative:a}=e,s=dd(o),[l,c]=EE({value:r,defaultValue:n||[],onChange:s}),d=(0,t.useCallback)(e=>{if(!l)return;const t=_O(e)?e.target.checked:!l.includes(e),n=_O(e)?e.target.value:e,r=t?[...l,n]:l.filter(e=>String(e)!==String(n));c(r)},[c,l]),u=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=a?"checked":"isChecked";return p(p({},e),{},{[t]:l.some(t=>String(e.value)===String(t)),onChange:d})},[d,a,l]);return{value:l,isDisabled:i,onChange:d,setValue:c,getCheckboxProps:u}}(e),d=(0,t.useMemo)(()=>({size:r,onChange:c,colorScheme:n,value:l,variant:o,isDisabled:s}),[r,c,n,l,o,s]);return(0,i.jsx)(OT,{value:d,children:a})}function RO(e){const n=(0,t.useRef)(null);return n.current=e,n}function AO(e){const t=function(e){var t;return null!==(t=e.view)&&void 0!==t?t:window}(e);return"undefined"!==typeof t.PointerEvent&&e instanceof t.PointerEvent?!("mouse"!==e.pointerType):e instanceof t.MouseEvent}function TO(e){return!!e.touches}function PO(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"page";return TO(e)?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"page";const n=e.touches[0]||e.changedTouches[0];return{x:n["".concat(t,"X")],y:n["".concat(t,"Y")]}}(e,t):function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"page";return{x:e["".concat(t,"X")],y:e["".concat(t,"Y")]}}(e,t)}function OO(e){function t(t){e(t,{point:PO(t)})}const n=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?function(e){return t=>{const n=AO(t);(!n||n&&0===t.button)&&e(t)}}(t):t;return n}function LO(e,t,n,r){return function(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}(e,t,OO(n,"pointerdown"===t),r)}zO.displayName="CheckboxGroup";const DO=1/60*1e3,IO="undefined"!==typeof performance?()=>performance.now():()=>Date.now(),NO="undefined"!==typeof window?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(IO()),DO);let MO=!0,FO=!1,WO=!1;const BO={delta:0,timestamp:0},UO=["read","update","preRender","render","postRender"],VO=UO.reduce((e,t)=>(e[t]=function(e){let t=[],n=[],r=0,o=!1,i=!1;const a=new WeakSet,s={schedule:function(e){const i=arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&o,s=i?t:n;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&a.add(e),-1===s.indexOf(e)&&(s.push(e),i&&o&&(r=t.length)),e},cancel:e=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1),a.delete(e)},process:l=>{if(o)i=!0;else{if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let n=0;n<r;n++){const r=t[n];r(l),a.has(r)&&(s.schedule(r),e())}o=!1,i&&(i=!1,s.process(l))}}};return s}(()=>FO=!0),e),{}),HO=UO.reduce((e,t)=>{const n=VO[t];return e[t]=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return FO||KO(),n.schedule(e,t,r)},e},{}),qO=UO.reduce((e,t)=>(e[t]=VO[t].cancel,e),{}),$O=(UO.reduce((e,t)=>(e[t]=()=>VO[t].process(BO),e),{}),e=>VO[e].process(BO)),YO=e=>{FO=!1,BO.delta=MO?DO:Math.max(Math.min(e-BO.timestamp,40),1),BO.timestamp=e,WO=!0,UO.forEach($O),WO=!1,FO&&(MO=!1,NO(YO))},KO=()=>{FO=!0,MO=!0,WO||NO(YO)},XO=()=>BO,GO=HO;var JO=Object.defineProperty,QO=(e,t,n)=>(((e,t,n)=>{t in e?JO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!==typeof t?t+"":t,n),n);class ZO{constructor(e,t,n){var r;if(QO(this,"history",[]),QO(this,"startEvent",null),QO(this,"lastEvent",null),QO(this,"lastEventInfo",null),QO(this,"handlers",{}),QO(this,"removeListeners",()=>{}),QO(this,"threshold",3),QO(this,"win"),QO(this,"updatePoint",()=>{if(!this.lastEvent||!this.lastEventInfo)return;const e=tL(this.lastEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){if("number"===typeof e&&"number"===typeof t)return oL(e,t);if(iL(e)&&iL(t)){const n=oL(e.x,t.x),r=oL(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}(e.offset,{x:0,y:0})>=this.threshold;if(!t&&!n)return;const{timestamp:r}=XO();this.history.push(p(p({},e.point),{},{timestamp:r}));const{onStart:o,onMove:i}=this.handlers;t||(null===o||void 0===o||o(this.lastEvent,e),this.startEvent=this.lastEvent),null===i||void 0===i||i(this.lastEvent,e)}),QO(this,"onPointerMove",(e,t)=>{this.lastEvent=e,this.lastEventInfo=t,GO.update(this.updatePoint,!0)}),QO(this,"onPointerUp",(e,t)=>{const n=tL(t,this.history),{onEnd:r,onSessionEnd:o}=this.handlers;null===o||void 0===o||o(e,n),this.end(),r&&this.startEvent&&(null===r||void 0===r||r(e,n))}),this.win=null!==(r=e.view)&&void 0!==r?r:window,function(e){return TO(e)&&e.touches.length>1}(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const o={point:PO(e)},{timestamp:i}=XO();this.history=[p(p({},o.point),{},{timestamp:i})];const{onSessionStart:a}=t;null===a||void 0===a||a(e,tL(o,this.history)),this.removeListeners=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>t.reduce((e,t)=>t(e),e)}(LO(this.win,"pointermove",this.onPointerMove),LO(this.win,"pointerup",this.onPointerUp),LO(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;null===(e=this.removeListeners)||void 0===e||e.call(this),qO.update(this.updatePoint)}}function eL(e,t){return{x:e.x-t.x,y:e.y-t.y}}function tL(e,t){return{point:e.point,delta:eL(e.point,t[t.length-1]),offset:eL(e.point,t[0]),velocity:rL(t,.1)}}const nL=e=>1e3*e;function rL(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=e[e.length-1];for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>nL(t)));)n--;if(!r)return{x:0,y:0};const i=(o.timestamp-r.timestamp)/1e3;if(0===i)return{x:0,y:0};const a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function oL(e,t){return Math.abs(e-t)}function iL(e){return"x"in e&&"y"in e}function aL(e,t){let n=function(e){const t=parseFloat(e);return"number"!==typeof t||Number.isNaN(t)?0:t}(e);const r=10**(null!==t&&void 0!==t?t:10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function sL(e,t,n){return 100*(e-t)/(n-t)}function lL(e,t,n){const r=Math.round((e-t)/n)*n+t,o=function(e){if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n}(n);return aL(r,o)}function cL(e,t,n){return null==e?e:(n<t&&console.warn("clamp: max cannot be less than min"),Math.min(Math.max(e,t),n))}function dL(e){const{orientation:t,vertical:n,horizontal:r}=e;return"vertical"===t?n:r}const uL=["min","max","onChange","value","defaultValue","isReversed","direction","orientation","id","isDisabled","isReadOnly","onChangeStart","onChangeEnd","step","getAriaValueText","aria-valuetext","aria-label","aria-labelledby","name","focusThumbOnChange"];function hL(e){var n;const{min:r=0,max:o=100,onChange:i,value:a,defaultValue:s,isReversed:l,direction:c="ltr",orientation:d="horizontal",id:u,isDisabled:h,isReadOnly:f,onChangeStart:m,onChangeEnd:g,step:v=1,getAriaValueText:x,"aria-valuetext":b,"aria-label":y,"aria-labelledby":w,name:S,focusThumbOnChange:j=!0}=e,k=Ki(e,uL),C=dd(m),E=dd(g),_=dd(x),z=function(e){const{isReversed:t,direction:n,orientation:r}=e;return"ltr"===n||"vertical"===r?t:!t}({isReversed:l,direction:c,orientation:d}),[R,A]=EE({value:a,defaultValue:null!==s&&void 0!==s?s:pL(r,o),onChange:i}),[T,P]=(0,t.useState)(!1),[O,L]=(0,t.useState)(!1),D=!(h||f),I=(o-r)/10,N=v||(o-r)/100,M=cL(R,r,o),F=sL(z?o-M+r:M,r,o),W="vertical"===d,B=RO({min:r,max:o,step:v,isDisabled:h,value:M,isInteractive:D,isReversed:z,isVertical:W,eventSource:null,focusThumbOnChange:j,orientation:d}),U=(0,t.useRef)(null),V=(0,t.useRef)(null),H=(0,t.useRef)(null),q=(0,t.useId)(),$=null!==u&&void 0!==u?u:q,[Y,K]=["slider-thumb-".concat($),"slider-track-".concat($)],X=(0,t.useCallback)(e=>{var t,n;if(!U.current)return;const r=B.current;r.eventSource="pointer";const o=U.current.getBoundingClientRect(),{clientX:i,clientY:a}=null!==(t=null===(n=e.touches)||void 0===n?void 0:n[0])&&void 0!==t?t:e;let s=(W?o.bottom-a:i-o.left)/(W?o.height:o.width);z&&(s=1-s);let l=function(e,t,n){return(n-t)*e+t}(s,r.min,r.max);return r.step&&(l=parseFloat(lL(l,r.min,r.step))),l=cL(l,r.min,r.max),l},[W,z,B]),G=(0,t.useCallback)(e=>{const t=B.current;t.isInteractive&&(e=cL(e=parseFloat(lL(e,t.min,N)),t.min,t.max),A(e))},[N,A,B]),J=(0,t.useMemo)(()=>({stepUp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N;G(z?M-e:M+e)},stepDown(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N;G(z?M+e:M-e)},reset(){G(s||0)},stepTo(e){G(e)}}),[G,z,M,N,s]),Q=(0,t.useCallback)(e=>{const t=B.current,n={ArrowRight:()=>J.stepUp(),ArrowUp:()=>J.stepUp(),ArrowLeft:()=>J.stepDown(),ArrowDown:()=>J.stepDown(),PageUp:()=>J.stepUp(I),PageDown:()=>J.stepDown(I),Home:()=>G(t.min),End:()=>G(t.max)}[e.key];n&&(e.preventDefault(),e.stopPropagation(),n(e),t.eventSource="keyboard")},[J,G,I,B]),Z=null!==(n=null===_||void 0===_?void 0:_(M))&&void 0!==n?n:b,{getThumbStyle:ee,rootStyle:te,trackStyle:ne,innerTrackStyle:re}=(0,t.useMemo)(()=>{const e=B.current;return function(e){const{orientation:t,thumbPercents:n,isReversed:r}=e,o=p({position:"absolute"},dL({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})),i=1===n.length,a=[0,r?100-n[0]:n[0]],s=i?a:n;let l=s[0];!i&&r&&(l=100-l);const c=Math.abs(s[s.length-1]-s[0]);return{trackStyle:o,innerTrackStyle:p(p({},o),dL({orientation:t,vertical:r?{height:"".concat(c,"%"),top:"".concat(l,"%")}:{height:"".concat(c,"%"),bottom:"".concat(l,"%")},horizontal:r?{width:"".concat(c,"%"),right:"".concat(l,"%")}:{width:"".concat(c,"%"),left:"".concat(l,"%")}})),rootStyle:{position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0},getThumbStyle:e=>p({position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none"},dL({orientation:t,vertical:{bottom:"".concat(n[e],"%"),transform:"translate(-50%, 50%) scale(var(--slider-thumb-scale, 1))"},horizontal:{left:"".concat(n[e],"%"),transform:"translate(-50%, -50%) scale(var(--slider-thumb-scale, 1))"}}))}}({isReversed:z,orientation:e.orientation,thumbPercents:[F]})},[z,F,B]),oe=(0,t.useCallback)(()=>{B.current.focusThumbOnChange&&setTimeout(()=>{var e;return null===(e=V.current)||void 0===e?void 0:e.focus()})},[B]);function ie(e){const t=X(e);null!=t&&t!==B.current.value&&A(t)}cd(()=>{const e=B.current;oe(),"keyboard"===e.eventSource&&(null===E||void 0===E||E(e.value))},[M,E]),function(e,n){const{onPan:r,onPanStart:o,onPanEnd:i,onPanSessionStart:a,onPanSessionEnd:s,threshold:l}=n,c=Boolean(r||o||i||a||s),d=(0,t.useRef)(null),u=RO({onSessionStart:a,onSessionEnd:s,onStart:o,onMove:r,onEnd(e,t){d.current=null,null===i||void 0===i||i(e,t)}});(0,t.useEffect)(()=>{var e;null===(e=d.current)||void 0===e||e.updateHandlers(u.current)}),(0,t.useEffect)(()=>{const t=e.current;if(t&&c)return LO(t,"pointerdown",function(e){d.current=new ZO(e,u.current,l)})},[e,c,u,l]),(0,t.useEffect)(()=>()=>{var e;null===(e=d.current)||void 0===e||e.end(),d.current=null},[])}(H,{onPanSessionStart(e){const t=B.current;t.isInteractive&&(P(!0),oe(),ie(e),null===C||void 0===C||C(t.value))},onPanSessionEnd(){const e=B.current;e.isInteractive&&(P(!1),null===E||void 0===E||E(e.value))},onPan(e){B.current.isInteractive&&ie(e)}});const ae=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p(p({},e),k),{},{ref:Rw(t,H),tabIndex:-1,"aria-disabled":Pw(h),"data-focused":Tw(O),style:p(p({},e.style),te)})},[k,h,O,te]),se=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},e),{},{ref:Rw(t,U),id:K,"data-disabled":Tw(h),style:p(p({},e.style),ne)})},[h,K,ne]),le=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},e),{},{ref:t,style:p(p({},e.style),re)})},[re]),ce=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},e),{},{ref:Rw(t,V),role:"slider",tabIndex:D?0:void 0,id:Y,"data-active":Tw(T),"aria-valuetext":Z,"aria-valuemin":r,"aria-valuemax":o,"aria-valuenow":M,"aria-orientation":d,"aria-disabled":Pw(h),"aria-readonly":Pw(f),"aria-label":y,"aria-labelledby":y?void 0:w,style:p(p({},e.style),ee(0)),onKeyDown:Jw(e.onKeyDown,Q),onFocus:Jw(e.onFocus,()=>L(!0)),onBlur:Jw(e.onBlur,()=>L(!1))})},[D,Y,T,Z,r,o,M,d,h,f,y,w,ee,Q]),de=(0,t.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=!(e.value<r||e.value>o),i=M>=e.value,a=sL(e.value,r,o),s=p({position:"absolute",pointerEvents:"none"},function(e){const{orientation:t,vertical:n,horizontal:r}=e;return"vertical"===t?n:r}({orientation:d,vertical:{bottom:"".concat(z?100-a:a,"%")},horizontal:{left:"".concat(z?100-a:a,"%")}}));return p(p({},e),{},{ref:t,role:"presentation","aria-hidden":!0,"data-disabled":Tw(h),"data-invalid":Tw(!n),"data-highlighted":Tw(i),style:p(p({},e.style),s)})},[h,z,o,r,d,M]),ue=(0,t.useCallback)(function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{ref:e,type:"hidden",value:M,name:S})},[S,M]);return{state:{value:M,isFocused:O,isDragging:T},actions:J,getRootProps:ae,getTrackProps:se,getInnerTrackProps:le,getThumbProps:ce,getMarkerProps:de,getInputProps:ue}}function pL(e,t){return t<e?e:e+(t-e)/2}const fL=["getInputProps","getRootProps"],[mL,gL]=Rc({name:"SliderContext",hookName:"useSliderContext",providerName:"<Slider />"}),[vL,xL]=Rc({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:"<Slider />"}),bL=Dv((e,t)=>{var n;const r=p(p({},e),{},{orientation:null!==(n=null===e||void 0===e?void 0:e.orientation)&&void 0!==n?n:"horizontal"}),o=qv("Slider",r),a=Ov(r),{direction:s}=Fv();a.direction=s;const l=hL(a),{getInputProps:c,getRootProps:d}=l,u=Ki(l,fL),h=d(),f=c({},t);return(0,i.jsx)(mL,{value:u,children:(0,i.jsx)(vL,{value:o,children:(0,i.jsxs)(Rv.div,p(p({},h),{},{className:Lv("chakra-slider",r.className),__css:o.container,children:[r.children,(0,i.jsx)("input",p({},f))]}))})})});bL.displayName="Slider";const yL=Dv((e,t)=>{const{getThumbProps:n}=gL(),r=xL(),o=n(e,t);return(0,i.jsx)(Rv.div,p(p({},o),{},{className:Lv("chakra-slider__thumb",e.className),__css:r.thumb}))});yL.displayName="SliderThumb";const wL=Dv((e,t)=>{const{getTrackProps:n}=gL(),r=xL(),o=n(e,t);return(0,i.jsx)(Rv.div,p(p({},o),{},{className:Lv("chakra-slider__track",e.className),__css:r.track}))});wL.displayName="SliderTrack";const SL=Dv((e,t)=>{const{getInnerTrackProps:n}=gL(),r=xL(),o=n(e,t);return(0,i.jsx)(Rv.div,p(p({},o),{},{className:Lv("chakra-slider__filled-track",e.className),__css:r.filledTrack}))});SL.displayName="SliderFilledTrack";const jL=Dv((e,t)=>{const{getMarkerProps:n}=gL(),r=xL(),o=n(e,t);return(0,i.jsx)(Rv.div,p(p({},o),{},{className:Lv("chakra-slider__marker",e.className),__css:r.mark}))});jL.displayName="SliderMark";const kL=["className","children","requiredIndicator","optionalIndicator"],CL=Dv(function(e,t){var n;const r=Hv("FormLabel",e),o=Ov(e),{className:a,children:s,requiredIndicator:l=(0,i.jsx)(EL,{}),optionalIndicator:c=null}=o,d=Ki(o,kL),u=aE(),h=null!==(n=null===u||void 0===u?void 0:u.getLabelProps(d,t))&&void 0!==n?n:p({ref:t},d);return(0,i.jsxs)(Rv.label,p(p({},h),{},{className:Lv("chakra-form__label",o.className),__css:p({display:"block",textAlign:"start"},r),children:[s,null!==u&&void 0!==u&&u.isRequired?l:c]}))});CL.displayName="FormLabel";const EL=Dv(function(e,t){const n=aE(),r=oE();if(null===n||void 0===n||!n.isRequired)return null;const o=Lv("chakra-form__required-indicator",e.className);return(0,i.jsx)(Rv.span,p(p({},null===n||void 0===n?void 0:n.getRequiredIndicatorProps(e,t)),{},{__css:r.requiredIndicator,className:o}))});EL.displayName="RequiredIndicator";const _L=["spacing","children"],zL=Dv(function(e,n){const r=qv("Switch",e),o=Ov(e),{spacing:a="0.5rem",children:s}=o,l=Ki(o,_L),{getIndicatorProps:c,getInputProps:d,getCheckboxProps:u,getRootProps:h,getLabelProps:f}=rP(l),m=(0,t.useMemo)(()=>p({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0},r.container),[r.container]),g=(0,t.useMemo)(()=>p({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer"},r.track),[r.track]),v=(0,t.useMemo)(()=>p({userSelect:"none",marginStart:a},r.label),[a,r.label]);return(0,i.jsxs)(Rv.label,p(p({},h()),{},{className:Lv("chakra-switch",e.className),__css:m,children:[(0,i.jsx)("input",p({className:"chakra-switch__input"},d({},n))),(0,i.jsx)(Rv.span,p(p({},u()),{},{className:"chakra-switch__track",__css:g,children:(0,i.jsx)(Rv.span,p({__css:r.thumb,className:"chakra-switch__thumb"},c()))})),s&&(0,i.jsx)(Rv.span,p(p({className:"chakra-switch__label"},f()),{},{__css:v,children:s}))]}))});zL.displayName="Switch";const RL=["onChange","value","defaultValue","name","isDisabled","isFocusable","isNative"];function AL(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{onChange:n,value:r,defaultValue:o,name:i,isDisabled:a,isFocusable:s,isNative:l}=e,c=Ki(e,RL),[d,u]=(0,t.useState)(o||""),h="undefined"!==typeof r,f=h?r:d,m=(0,t.useRef)(null),g=(0,t.useCallback)(()=>{const e=m.current;if(!e)return;let t="input:not(:disabled):checked";const n=e.querySelector(t);if(n)return void n.focus();t="input:not(:disabled)";const r=e.querySelector(t);null===r||void 0===r||r.focus()},[]),v=(0,t.useId)(),x="radio-".concat(v),b=i||x,y=(0,t.useCallback)(e=>{const t=function(e){return e&&Bn(e)&&Bn(e.target)}(e)?e.target.value:e;h||u(t),null===n||void 0===n||n(String(t))},[n,h]),w=(0,t.useCallback)(function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{ref:Rw(e,m),role:"radiogroup"})},[]),S=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=l?"checked":"isChecked";return p(p({},e),{},{ref:t,name:b,[n]:null!=f?e.value===f:void 0,onChange(e){y(e)},"data-radiogroup":!0})},[l,b,y,f]);return{getRootProps:w,getRadioProps:S,name:b,ref:m,focus:g,setValue:u,value:f,onChange:y,isDisabled:a,isFocusable:s,htmlProps:c}}const TL=["colorScheme","size","variant","children","className","isDisabled","isFocusable"],[PL,OL]=Rc({name:"RadioGroupContext",strict:!1}),LL=Dv((e,n)=>{const{colorScheme:r,size:o,variant:a,children:s,className:l,isDisabled:c,isFocusable:d}=e,u=Ki(e,TL),{value:h,onChange:f,getRootProps:m,name:g,htmlProps:v}=AL(u),x=(0,t.useMemo)(()=>({name:g,size:o,onChange:f,colorScheme:r,value:h,variant:a,isDisabled:c,isFocusable:d}),[g,o,f,r,h,a,c,d]);return(0,i.jsx)(PL,{value:x,children:(0,i.jsx)(Rv.div,p(p({},m(v,n)),{},{className:Lv("chakra-radio-group",l),children:s}))})});LL.displayName="RadioGroup";const DL=["defaultChecked","isChecked","isFocusable","isDisabled","isReadOnly","isRequired","onChange","isInvalid","name","value","id","data-radiogroup","aria-describedby"];function IL(e){e.preventDefault(),e.stopPropagation()}const NL=["spacing","children","isDisabled","isFocusable","inputProps"],ML=Dv((e,n)=>{var r;const o=OL(),{onChange:a,value:s}=e,l=qv("Radio",p(p({},o),e)),c=Ov(e),{spacing:d="0.5rem",children:u,isDisabled:h=(null===o||void 0===o?void 0:o.isDisabled),isFocusable:f=(null===o||void 0===o?void 0:o.isFocusable),inputProps:m}=c,g=Ki(c,NL);let v=e.isChecked;null!=(null===o||void 0===o?void 0:o.value)&&null!=s&&(v=o.value===s);let x=a;null!==o&&void 0!==o&&o.onChange&&null!=s&&(x=Gw(o.onChange,a));const b=null!==(r=null===e||void 0===e?void 0:e.name)&&void 0!==r?r:null===o||void 0===o?void 0:o.name,{getInputProps:y,getRadioProps:w,getLabelProps:S,getRootProps:j,htmlProps:k}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{defaultChecked:n,isChecked:r,isFocusable:o,isDisabled:i,isReadOnly:a,isRequired:s,onChange:l,isInvalid:c,name:d,value:u,id:h,"data-radiogroup":f,"aria-describedby":m}=e,g=Ki(e,DL),v="radio-".concat((0,t.useId)()),x=aE(),b=OL();let y=!x||b||f?v:x.id;y=null!==h&&void 0!==h?h:y;const w=null!==i&&void 0!==i?i:null===x||void 0===x?void 0:x.isDisabled,S=null!==a&&void 0!==a?a:null===x||void 0===x?void 0:x.isReadOnly,j=null!==s&&void 0!==s?s:null===x||void 0===x?void 0:x.isRequired,k=null!==c&&void 0!==c?c:null===x||void 0===x?void 0:x.isInvalid,[C,E]=(0,t.useState)(!1),[_,z]=(0,t.useState)(!1),[R,A]=(0,t.useState)(!1),[T,P]=(0,t.useState)(Boolean(n)),O="undefined"!==typeof r,L=O?r:T,D=(0,t.useRef)(!1);(0,t.useEffect)(()=>eP(e=>{D.current=e}),[]);const I=(0,t.useCallback)(e=>{S||w?e.preventDefault():(O||P(e.currentTarget.checked),null===l||void 0===l||l(e))},[O,w,S,l]),N=(0,t.useCallback)(e=>{" "===e.key&&A(!0)},[A]),M=(0,t.useCallback)(e=>{" "===e.key&&A(!1)},[A]),F=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},e),{},{ref:t,"data-active":Tw(R),"data-hover":Tw(_),"data-disabled":Tw(w),"data-invalid":Tw(k),"data-checked":Tw(L),"data-focus":Tw(C),"data-focus-visible":Tw(C&&D.current),"data-readonly":Tw(S),"aria-hidden":!0,onMouseDown:Jw(e.onMouseDown,()=>A(!0)),onMouseUp:Jw(e.onMouseUp,()=>A(!1)),onMouseEnter:Jw(e.onMouseEnter,()=>z(!0)),onMouseLeave:Jw(e.onMouseLeave,()=>z(!1))})},[R,_,w,k,L,C,S]),{onFocus:W,onBlur:B}=null!==x&&void 0!==x?x:{},U=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=w&&!o;return p(p({},e),{},{id:y,ref:t,type:"radio",name:d,value:u,onChange:Jw(e.onChange,I),onBlur:Jw(B,e.onBlur,()=>E(!1)),onFocus:Jw(W,e.onFocus,()=>E(!0)),onKeyDown:Jw(e.onKeyDown,N),onKeyUp:Jw(e.onKeyUp,M),checked:L,disabled:n,readOnly:S,required:j,"aria-invalid":Pw(k),"aria-disabled":Pw(n),"aria-required":Pw(j),"data-readonly":Tw(S),"aria-describedby":m,style:tP})},[w,o,y,d,u,I,B,W,N,M,L,S,j,k,m]);return{state:{isInvalid:k,isFocused:C,isChecked:L,isActive:R,isHovered:_,isDisabled:w,isReadOnly:S,isRequired:j},getRadioProps:F,getInputProps:U,getLabelProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},e),{},{ref:t,onMouseDown:Jw(e.onMouseDown,IL),"data-disabled":Tw(w),"data-checked":Tw(L),"data-invalid":Tw(k)})},getRootProps:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({htmlFor:y},e),{},{ref:t,"data-disabled":Tw(w),"data-checked":Tw(L),"data-invalid":Tw(k)})},htmlProps:g}}(p(p({},g),{},{isChecked:v,isFocusable:f,isDisabled:h,onChange:x,name:b})),[C,E]=eT(k,wc),_=w(E),z=y(m,n),R=S(),A=Object.assign({},C,j()),T=p({display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative"},l.container),P=p({display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},l.control),O=p({userSelect:"none",marginStart:d},l.label);return(0,i.jsxs)(Rv.label,p(p({className:"chakra-radio"},A),{},{__css:T,children:[(0,i.jsx)("input",p({className:"chakra-radio__input"},z)),(0,i.jsx)(Rv.span,p(p({className:"chakra-radio__control"},_),{},{__css:P})),u&&(0,i.jsx)(Rv.span,p(p({className:"chakra-radio__label"},R),{},{__css:O,children:u}))]}))});ML.displayName="Radio";const FL="devicely_replay_options",WL=e=>{let{isOpen:n,onClose:r,recording:o,connectedDevices:a=[],selectedDevices:s=[],onConfirmReplay:l}=e;const[c,d]=(0,t.useState)([]),[u,h]=(0,t.useState)(10),[p,f]=(0,t.useState)(!1),[m,g]=(0,t.useState)(1),[v,x]=(0,t.useState)("fast"),b=Ts("white","gray.800"),y=Ts("gray.200","gray.700");(0,t.useEffect)(()=>{if(n){try{const e=JSON.parse(localStorage.getItem(FL)||"{}");void 0!==e.autoWaitTimeoutSec&&h(e.autoWaitTimeoutSec),void 0!==e.stopOnFailure&&f(e.stopOnFailure),void 0!==e.retries&&g(e.retries),void 0!==e.timing&&x(e.timing)}catch(e){}const t=(a||[]).filter(e=>"online"===e.status).map(e=>e.name);if(s&&s.length>0)d(s);else if(null!==o&&void 0!==o&&o.devices&&o.devices.length>0){const e=o.devices.filter(e=>t.includes(e));d(e.length>0?e:t)}else d(t)}},[n,o,a,s]);const w=(a||[]).filter(e=>"online"===e.status);return(0,i.jsxs)(O_,{isOpen:n,onClose:r,size:"md",children:[(0,i.jsx)(W_,{}),(0,i.jsxs)(MA,{bg:b,children:[(0,i.jsx)(WA,{py:3,children:(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Ck,{size:18,color:"#38A169"}),(0,i.jsxs)(Cw,{fontSize:"md",fontWeight:"bold",children:["Replay: ",null===o||void 0===o?void 0:o.name]})]})}),(0,i.jsx)(UA,{}),(0,i.jsx)(HA,{py:3,children:(0,i.jsxs)(ww,{spacing:4,align:"stretch",children:[(0,i.jsxs)(mw,{children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"semibold",mb:2,children:"Target Devices"}),0===w.length?(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.500",children:"No online devices found."}):(0,i.jsx)(zO,{value:c,onChange:e=>d(e),children:(0,i.jsx)(ww,{align:"start",spacing:1.5,children:w.map(e=>(0,i.jsx)(uP,{value:e.name,size:"sm",children:(0,i.jsxs)(Cw,{fontSize:"xs",children:[e.name," (",e.platform,")"]})},e.name))})})]}),(0,i.jsx)(YA,{borderColor:y}),(0,i.jsxs)(mw,{children:[(0,i.jsxs)(Ew,{justify:"space-between",mb:1,children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"semibold",children:"Auto-Wait Timeout"}),(0,i.jsxs)(Cw,{fontSize:"xs",color:"gray.500",fontWeight:"bold",children:[u,"s"]})]}),(0,i.jsxs)(bL,{"aria-label":"auto-wait-timeout",value:u,min:2,max:30,step:1,onChange:e=>h(e),children:[(0,i.jsx)(wL,{children:(0,i.jsx)(SL,{bg:"green.500"})}),(0,i.jsx)(yL,{})]}),(0,i.jsxs)(Cw,{fontSize:"10px",color:"gray.500",children:["Polls for element appearance up to ",u,"s before falling back to coordinates."]})]}),(0,i.jsx)(YA,{borderColor:y}),(0,i.jsxs)(sE,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,i.jsx)(CL,{htmlFor:"stop-on-failure",mb:"0",fontSize:"sm",fontWeight:"normal",children:"Stop on first failure"}),(0,i.jsx)(zL,{id:"stop-on-failure",isChecked:p,onChange:e=>f(e.target.checked),size:"sm",colorScheme:"red"})]}),(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsx)(Cw,{fontSize:"sm",children:"Retries per step"}),(0,i.jsxs)(iT,{size:"xs",w:"90px",value:m,onChange:e=>g(parseInt(e.target.value,10)),children:[(0,i.jsx)("option",{value:0,children:"0 (none)"}),(0,i.jsx)("option",{value:1,children:"1 retry"}),(0,i.jsx)("option",{value:2,children:"2 retries"}),(0,i.jsx)("option",{value:3,children:"3 retries"})]})]}),(0,i.jsxs)(mw,{children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"semibold",mb:1,children:"Timing Mode"}),(0,i.jsx)(LL,{value:v,onChange:x,children:(0,i.jsxs)(Ew,{spacing:4,children:[(0,i.jsx)(ML,{value:"fast",size:"sm",children:(0,i.jsx)(Cw,{fontSize:"xs",children:"Fast as possible"})}),(0,i.jsx)(ML,{value:"recorded",size:"sm",children:(0,i.jsx)(Cw,{fontSize:"xs",children:"Original timing"})})]})})]})]})}),(0,i.jsxs)(QA,{py:3,children:[(0,i.jsx)(Ww,{size:"sm",variant:"ghost",mr:2,onClick:r,children:"Cancel"}),(0,i.jsx)(Ww,{size:"sm",colorScheme:"green",leftIcon:(0,i.jsx)(Ck,{}),onClick:()=>{try{localStorage.setItem(FL,JSON.stringify({autoWaitTimeoutSec:u,stopOnFailure:p,retries:m,timing:v}))}catch(e){}l({devices:c,autoWaitTimeoutMs:1e3*u,stopOnFailure:p,retries:m,timing:v}),r()},isDisabled:0===c.length,children:"Start Replay"})]})]})]})};Ys({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),Ys({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});const BL=Ys({"0%":{left:"-40%"},"100%":{left:"100%"}}),UL=Ys({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});const VL=["min","max","value","isIndeterminate","role"],HL=["value","min","max","hasStripe","isAnimated","children","borderRadius","isIndeterminate","aria-label","aria-labelledby","aria-valuetext","title","role"],[qL,$L]=Rc({name:"ProgressStylesContext",errorMessage:"useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<Progress />\" "}),YL=Dv((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:a,role:s}=e,l=Ki(e,VL),c=function(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:i,isIndeterminate:a,role:s="progressbar"}=e,l=function(e,t,n){return 100*(e-t)/(n-t)}(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(null!=t)return"function"===typeof i?i(t,l):o})(),role:s},percent:l,value:t}}({value:o,min:n,max:r,isIndeterminate:a,role:s}),d=p({height:"100%"},$L().filledTrack);return(0,i.jsx)(Rv.div,p(p(p({ref:t,style:p({width:"".concat(c.percent,"%")},l.style)},c.bind),l),{},{__css:d}))}),KL=Dv((e,t)=>{var n;const r=Ov(e),{value:o,min:a=0,max:s=100,hasStripe:l,isAnimated:c,children:d,borderRadius:u,isIndeterminate:h,"aria-label":f,"aria-labelledby":m,"aria-valuetext":g,title:v,role:x}=r,b=Ki(r,HL),y=qv("Progress",e),w=null!==u&&void 0!==u?u:null===(n=y.track)||void 0===n?void 0:n.borderRadius,S={animation:"".concat(UL," 1s linear infinite")},j=p(p({},!h&&l&&c&&S),h&&{position:"absolute",willChange:"left",minWidth:"50%",animation:"".concat(BL," 1s ease infinite normal none running")}),k=p({overflow:"hidden",position:"relative"},y.track);return(0,i.jsx)(Rv.div,p(p({ref:t,borderRadius:w,__css:k},b),{},{children:(0,i.jsxs)(qL,{value:y,children:[(0,i.jsx)(YL,{"aria-label":f,"aria-labelledby":m,"aria-valuetext":g,min:a,max:s,value:o,isIndeterminate:h,css:j,borderRadius:w,title:v,role:x}),d]})}))});KL.displayName="Progress";const XL=e=>{let{isOpen:n,recordingName:r,progressEvents:o=[],currentStep:a=0,totalSteps:s=0,onStop:l,onClose:c}=e;const[d,u]=t.useState(!0),h=Ts("white","gray.800"),p=Ts("gray.200","gray.700"),f=Ts("gray.50","gray.700"),m=Ts("gray.50","gray.700");if(!n)return null;const g=s>0?Math.round(a/s*100):0;return(0,i.jsxs)(mw,{position:"fixed",bottom:"20px",right:"20px",w:{base:"90%",sm:"420px"},bg:h,borderWidth:"1px",borderColor:p,borderRadius:"lg",boxShadow:"xl",zIndex:100,overflow:"hidden",children:[(0,i.jsxs)(fw,{px:4,py:2.5,bg:m,borderBottomWidth:"1px",borderColor:p,justify:"space-between",align:"center",children:[(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Qv,{size:"xs",color:"green.500"}),(0,i.jsxs)(Cw,{fontSize:"xs",fontWeight:"bold",isTruncated:!0,maxW:"200px",children:["Replaying: ",r]}),(0,i.jsxs)(zw,{fontSize:"10px",colorScheme:"green",children:[a,"/",s]})]}),(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(qw,{size:"xs",variant:"ghost",icon:d?(0,i.jsx)(lC,{}):(0,i.jsx)(iC,{}),"aria-label":d?"Collapse":"Expand",onClick:()=>u(!d)}),(0,i.jsx)(Ww,{size:"xs",colorScheme:"red",variant:"solid",leftIcon:(0,i.jsx)(hk,{}),onClick:l,children:"Stop"})]})]}),(0,i.jsx)(KL,{value:g,size:"xs",colorScheme:"green"}),(0,i.jsx)(VC,{in:d,animateOpacity:!0,children:(0,i.jsx)(mw,{maxH:"220px",overflowY:"auto",p:3,children:(0,i.jsx)(ww,{align:"stretch",spacing:1.5,children:o.slice(-8).map((e,t)=>{let n=(0,i.jsx)(dC,{size:12,color:"#38A169"}),r="green";return"fallback"===e.status?(n=(0,i.jsx)(gC,{size:12,color:"#D69E2E"}),r="yellow"):"failed"===e.status?(n=(0,i.jsx)(tk,{size:12,color:"#E53E3E"}),r="red"):"running"===e.status&&(n=(0,i.jsx)(Qv,{size:"xs",color:"blue.500"}),r="blue"),(0,i.jsxs)(fw,{justify:"space-between",align:"center",p:1.5,borderRadius:"md",fontSize:"xs",bg:f,children:[(0,i.jsxs)(Ew,{spacing:2,children:[n,(0,i.jsxs)(Cw,{fontWeight:"medium",children:["Step ",e.index+1,": ",e.action]}),(0,i.jsxs)(Cw,{fontSize:"10px",color:"gray.500",children:["(",e.device,")"]})]}),(0,i.jsxs)(Ew,{spacing:1,children:[e.matchedBy&&(0,i.jsx)(zw,{fontSize:"9px",variant:"subtle",colorScheme:r,children:e.matchedBy}),void 0!==e.ms&&(0,i.jsxs)(Cw,{fontSize:"10px",color:"gray.400",children:[e.ms,"ms"]})]})]},t)})})})})]})},GL=["filename"],JL=e=>{let{selectedDevices:n=[],wsService:r,onClose:o,onOpenSettings:a,onNavigateHome:s,connectedDevices:l=[],replayingFile:c,setReplayingFile:d,replayOutput:u,setReplayOutput:h,isReplayTerminalOpen:f,setIsReplayTerminalOpen:m}=e;const[g,v]=(0,t.useState)([]),[x,b]=(0,t.useState)([]),[y,w]=(0,t.useState)(null),[S,j]=(0,t.useState)(null),[k,C]=(0,t.useState)(0),[E,_]=(0,t.useState)(()=>{try{return localStorage.getItem("devicely_recordings_view")||"list"}catch(e){return"list"}}),[z,R]=(0,t.useState)(""),[A,T]=(0,t.useState)("newest"),[P,O]=(0,t.useState)({platform:"all",lastRunStatus:"all",coordinatesOnly:!1}),[L,D]=(0,t.useState)([]),[I,N]=(0,t.useState)(null),{isOpen:M,onOpen:F,onClose:W}=Yw(),[B,U]=(0,t.useState)(null),{isOpen:V,onOpen:H,onClose:q}=Yw(),[$,Y]=(0,t.useState)([]),[K,X]=(0,t.useState)(!1),[G,J]=(0,t.useState)(0),[Q,Z]=(0,t.useState)(0),ee=(0,t.useRef)(null),te=(0,t.useRef)(0),{isOpen:ne,onOpen:re,onClose:oe}=Yw(),{isOpen:ie,onOpen:ae,onClose:se}=Yw(),le=hw(),ce=Ts("gray.50","gray.900"),de=Ts("white","gray.800"),ue=Ts("gray.200","gray.700"),he=Ts("red.500","red.400"),pe=Ts("gray.900","gray.800");(0,t.useEffect)(()=>{ee.current&&u&&(ee.current.scrollTop=ee.current.scrollHeight)},[u]);const fe=(0,t.useCallback)(async()=>{const e=++te.current;try{const t=await fetch("".concat(yE,"/api/recordings")),n=await t.json();if(!t.ok||!n.success)throw new Error(n.error||"Failed to load recordings");e===te.current&&v(n.recordings||[])}catch(t){console.error("Error loading recordings:",t),le({title:"Error loading recordings",description:t.message,status:"error",duration:3e3,isClosable:!0})}},[le]),me=async()=>{try{const e=await fetch("".concat(yE,"/api/screenshots")),t=await e.json();t.success&&b(t.screenshots||[])}catch(e){console.error("Error loading screenshots:",e)}};(0,t.useEffect)(()=>{if(me(),r&&r.ws){const e=e=>{try{const t=JSON.parse(e.data);"command_output"===t.type&&c?h(e=>e+t.data):"replay_progress"===t.type?(Y(e=>[...e,t]),J(t.index+1),Z(t.total),X(!0)):"replay_complete"===t.type?(d(null),X(!1),h(e=>e+"\n\u2705 Replay completed successfully!\n"),fe(),setTimeout(()=>{m(!1),h("")},3e3),le({title:"\u2705 Replay complete",status:"success",duration:3e3,isClosable:!0})):"replay_error"===t.type&&(d(null),X(!1),h(e=>e+"\n\u274c Error: ".concat(t.error,"\n")),fe(),setTimeout(()=>{m(!1),h("")},5e3),le({title:"\u274c Replay failed",description:t.error,status:"error",duration:3e3,isClosable:!0}))}catch(t){}};return r.ws.addEventListener("message",e),()=>{r&&r.ws&&r.ws.removeEventListener("message",e)}}},[c,r,fe,m,h,d,le]),(0,t.useEffect)(()=>{if(fe(),!r)return;const e=e=>{let{connected:t}=e;t&&fe()};return r.on("recordings_changed",fe),r.on("connection_status",e),()=>{r.off("recordings_changed",fe),r.off("connection_status",e)}},[fe,r]);const ge=(0,t.useMemo)(()=>(g||[]).filter(e=>{if(z.trim()){const t=z.toLowerCase(),n=(e.name||"").toLowerCase().includes(t),r=(e.devices||[]).some(e=>e.toLowerCase().includes(t));if(!n&&!r)return!1}if("all"!==P.platform){if(!(e.platforms||[]).includes(P.platform))return!1}if("all"!==P.lastRunStatus){var t;if("never"===P.lastRunStatus&&e.lastRun)return!1;if("never"!==P.lastRunStatus&&(null===(t=e.lastRun)||void 0===t?void 0:t.status)!==P.lastRunStatus)return!1}var n;if(P.coordinatesOnly&&0===((null===(n=e.locatorQuality)||void 0===n?void 0:n.coordinates)||0))return!1;return!0}).sort((e,t)=>{return"newest"===A?new Date(t.startTime||0)-new Date(e.startTime||0):"oldest"===A?new Date(e.startTime||0)-new Date(t.startTime||0):"name_asc"===A?(e.name||"").localeCompare(t.name||""):"name_desc"===A?(t.name||"").localeCompare(e.name||""):"steps_desc"===A?(t.commandCount||0)-(e.commandCount||0):"last_run"===A?new Date((null===(n=t.lastRun)||void 0===n?void 0:n.at)||0)-new Date((null===(r=e.lastRun)||void 0===r?void 0:r.at)||0):0;var n,r}),[g,z,A,P]),ve=(0,t.useMemo)(()=>(g||[]).filter(e=>{var t;return"failed"===(null===(t=e.lastRun)||void 0===t?void 0:t.status)}).length,[g]),xe=e=>{U(e),H()},be=async e=>{if(window.confirm("Are you sure you want to delete this recording?"))try{const t=await fetch("".concat(yE,"/api/recordings/").concat(e),{method:"DELETE"});(await t.json()).success&&(D(t=>t.filter(t=>t!==e)),fe(),le({title:"Recording deleted",status:"success",duration:2e3,isClosable:!0}))}catch(t){le({title:"Failed to delete recording",description:t.message,status:"error",duration:3e3})}},ye=async e=>{try{const t=await fetch("".concat(yE,"/api/recordings/").concat(e,"/duplicate"),{method:"POST"});(await t.json()).success&&(fe(),le({title:"Recording duplicated",status:"success",duration:2e3}))}catch(t){le({title:"Failed to duplicate",description:t.message,status:"error",duration:3e3})}},we=e=>{window.location.href="".concat(yE,"/api/recordings/").concat(e,"/export"),le({title:"Exporting recording",status:"info",duration:2e3})},Se=async e=>{try{const t=await fetch("".concat(yE,"/api/recordings/").concat(e)),n=await t.json();n.success&&(w(p(p({},n.recording),{},{filename:e})),re())}catch(t){le({title:"Failed to load recording",description:t.message,status:"error",duration:3e3})}},je=e=>{N(e),F()};return(0,i.jsxs)(mw,{bg:ce,minH:"100%",children:[(0,i.jsx)(mw,{borderBottom:"1px",borderColor:ue,bg:de,position:"sticky",top:0,zIndex:10,boxShadow:"sm",children:(0,i.jsx)(Vw,{maxW:"container.xl",py:4,children:(0,i.jsxs)(fw,{align:"center",justify:"space-between",children:[(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsx)(jw,{size:"lg",color:he,children:"\ud83d\udcc1 Media Library"}),(0,i.jsx)(Cw,{fontSize:"sm",color:"gray.500",children:"Manage recordings, locators, and screenshots from automation sessions"})]}),(0,i.jsxs)(Ew,{spacing:4,children:[(0,i.jsxs)(zw,{colorScheme:"red",fontSize:"sm",px:3,py:1,borderRadius:"full",children:[g.length," Recording",1!==g.length?"s":""]}),(0,i.jsxs)(zw,{colorScheme:"blue",fontSize:"sm",px:3,py:1,borderRadius:"full",children:[x.length," Screenshot",1!==x.length?"s":""]})]})]})})}),(0,i.jsxs)(Vw,{maxW:"container.xl",py:6,children:[n.length>0&&(0,i.jsxs)(ix,{status:"info",mb:4,borderRadius:"lg",py:2,children:[(0,i.jsx)(ax,{}),(0,i.jsxs)(mw,{flex:"1",fontSize:"sm",children:[(0,i.jsx)(sx,{children:"Selected Devices"}),(0,i.jsxs)(lx,{children:["Default replay target: ",(0,i.jsx)("strong",{children:n.join(", ")})]})]})]}),f&&(0,i.jsxs)(mw,{mb:4,bg:pe,borderRadius:"lg",p:4,maxH:"260px",overflowY:"auto",boxShadow:"lg",position:"relative",ref:ee,children:[(0,i.jsxs)(Ew,{justify:"space-between",mb:2,children:[(0,i.jsxs)(Ew,{children:[(0,i.jsx)(mw,{w:3,h:3,borderRadius:"full",bg:c?"green.400":"gray.500"}),(0,i.jsx)(Cw,{color:"green.400",fontWeight:"bold",fontSize:"sm",children:"Replay Output Terminal"})]}),(0,i.jsx)(qw,{icon:(0,i.jsx)(ek,{}),size:"xs",variant:"ghost",colorScheme:"whiteAlpha",onClick:()=>{m(!1),h("")},"aria-label":"Close terminal"})]}),(0,i.jsx)(mw,{fontFamily:"monospace",fontSize:"xs",color:"green.300",whiteSpace:"pre-wrap",wordBreak:"break-word",children:u||"Waiting for output..."})]}),(0,i.jsxs)(r_,{index:k,onChange:C,variant:"enclosed",colorScheme:"red",children:[(0,i.jsxs)(o_,{mb:4,children:[(0,i.jsx)(i_,{children:(0,i.jsxs)(Ew,{children:[(0,i.jsx)(Fk,{}),(0,i.jsx)(Cw,{children:"Recordings"}),(0,i.jsx)(zw,{ml:2,colorScheme:"red",fontSize:"xs",children:g.length})]})}),(0,i.jsx)(i_,{children:(0,i.jsxs)(Ew,{children:[(0,i.jsx)(uC,{}),(0,i.jsx)(Cw,{children:"Screenshots"}),(0,i.jsx)(zw,{ml:2,colorScheme:"blue",fontSize:"xs",children:x.length})]})})]}),(0,i.jsxs)(a_,{children:[(0,i.jsxs)(s_,{px:0,children:[(0,i.jsx)(kT,{searchQuery:z,onSearchChange:R,sortBy:A,onSortChange:T,viewMode:E,onViewModeChange:e=>{_(e);try{localStorage.setItem("devicely_recordings_view",e)}catch(t){}},filters:P,onFilterChange:O,totalCount:g.length,filteredCount:ge.length,failingCount:ve,availableDevices:l}),"list"===E?(0,i.jsx)(eO,{recordings:ge,selectedFilenames:L,onSelectRecording:e=>{D(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},onSelectAll:()=>{L.length===ge.length?D([]):D(ge.map(e=>e.filename))},onOpenDetails:je,onReplay:xe,onEdit:Se,onDuplicate:ye,onExport:we,onDelete:be,onBulkDelete:async()=>{if(window.confirm("Delete ".concat(L.length," selected recordings?")))try{await Promise.all(L.map(e=>fetch("".concat(yE,"/api/recordings/").concat(e),{method:"DELETE"}))),D([]),fe(),le({title:"Selected recordings deleted",status:"success",duration:2e3})}catch(CF){le({title:"Bulk delete error",description:CF.message,status:"error"})}},onBulkExport:()=>{L.forEach(e=>{window.open("".concat(yE,"/api/recordings/").concat(e,"/export"),"_blank")})},onClearFilters:()=>{R(""),O({platform:"all",lastRunStatus:"all",coordinatesOnly:!1})}}):(0,i.jsx)(hO,{recordings:ge,onOpenDetails:je,onReplay:xe,onEdit:Se,onDuplicate:ye,onExport:we,onDelete:be,onClearFilters:()=>{R(""),O({platform:"all",lastRunStatus:"all",coordinatesOnly:!1})}})]}),(0,i.jsx)(s_,{px:0,children:0===x.length?(0,i.jsxs)(ww,{spacing:6,py:16,children:[(0,i.jsx)(mw,{fontSize:"5xl",children:"\ud83d\udcf7"}),(0,i.jsxs)(ww,{spacing:1,children:[(0,i.jsx)(jw,{size:"md",color:"gray.500",children:"No Screenshots Yet"}),(0,i.jsx)(Cw,{color:"gray.500",fontSize:"sm",textAlign:"center",maxW:"md",children:"Capture screenshots during automation sessions to view them here."})]})]}):(0,i.jsx)(u_,{columns:{base:2,md:3,lg:4,xl:6},spacing:4,children:x.map(e=>(0,i.jsxs)(mw,{borderWidth:"1px",borderColor:ue,borderRadius:"lg",overflow:"hidden",bg:de,position:"relative",children:[(0,i.jsx)(m_,{src:"".concat(yE,"/api/screenshots/").concat(e.filename),alt:e.filename,objectFit:"cover",cursor:"pointer",onClick:()=>{j(e),ae()}}),(0,i.jsxs)(fw,{p:2,justify:"space-between",align:"center",children:[(0,i.jsx)(Cw,{fontSize:"xs",isTruncated:!0,maxW:"120px",children:e.filename}),(0,i.jsx)(qw,{size:"xs",colorScheme:"red",variant:"ghost",icon:(0,i.jsx)(sk,{}),"aria-label":"Delete screenshot",onClick:()=>(async e=>{try{const t=await fetch("".concat(yE,"/api/screenshots/").concat(e),{method:"DELETE"});(await t.json()).success&&(me(),le({title:"Screenshot deleted",status:"success",duration:2e3}))}catch(CF){le({title:"Delete failed",description:CF.message,status:"error"})}})(e.filename)})]})]},e.filename))})})]})]})]}),(0,i.jsx)(EO,{isOpen:M,onClose:W,recording:I,onReplay:xe,onEdit:Se,onRecordingUpdated:fe}),(0,i.jsx)(WL,{isOpen:V,onClose:q,recording:B,connectedDevices:l,selectedDevices:n,onConfirmReplay:e=>{const t=null===B||void 0===B?void 0:B.filename;if(t){d(t),Y([]),J(0),Z(B.commandCount||0),X(!0),h("\ud83c\udfac Starting replay of ".concat(B.name,"...\n\n")),m(!0);try{r&&r.ws&&r.ws.readyState===WebSocket.OPEN?(r.ws.send(JSON.stringify({type:"replay_recording",filename:t,targetDevices:e.devices,autoWaitTimeoutMs:e.autoWaitTimeoutMs,stopOnFailure:e.stopOnFailure,retries:e.retries,timing:e.timing})),le({title:"\u25b6\ufe0f Replay initiated",description:"Replaying on ".concat(e.devices.join(", ")),status:"info",duration:3e3,isClosable:!0})):fetch("".concat(yE,"/api/recording/replay"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:t,devices:e.devices,autoWaitTimeoutMs:e.autoWaitTimeoutMs,stopOnFailure:e.stopOnFailure,retries:e.retries,timing:e.timing})})}catch(n){d(null),X(!1),m(!1),le({title:"Failed to replay",description:n.message,status:"error",duration:3e3,isClosable:!0})}}}}),(0,i.jsx)(XL,{isOpen:K,recordingName:(null===B||void 0===B?void 0:B.name)||"Replaying...",progressEvents:$,currentStep:G,totalSteps:Q,onStop:()=>{try{r&&r.ws&&r.ws.readyState===WebSocket.OPEN&&r.ws.send(JSON.stringify({type:"stop_replay"})),d(null),X(!1),h(e=>e+"\n\u23f9\ufe0f Replay stopped by user\n"),le({title:"\u23f9\ufe0f Replay stopped",status:"info",duration:2e3})}catch(e){le({title:"Failed to stop replay",description:e.message,status:"error",duration:3e3})}},onClose:()=>X(!1)}),y&&(0,i.jsx)(ZA,{isOpen:ne,onClose:oe,recording:y,onSave:async e=>{const{filename:t="".concat(e.name,".json")}=e,n=Ki(e,GL),r=await fetch("".concat(yE,"/api/recordings/").concat(t),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});(await r.json()).success&&(fe(),oe(),le({title:"Recording updated",status:"success",duration:2e3,isClosable:!0}))}}),(0,i.jsxs)(O_,{isOpen:ie,onClose:se,size:"4xl",children:[(0,i.jsx)(W_,{}),(0,i.jsxs)(MA,{children:[(0,i.jsx)(WA,{py:2,children:null===S||void 0===S?void 0:S.filename}),(0,i.jsx)(UA,{}),(0,i.jsx)(HA,{p:0,textAlign:"center",children:S&&(0,i.jsx)(m_,{src:"".concat(yE,"/api/screenshots/").concat(S.filename),alt:S.filename,maxH:"80vh",mx:"auto"})})]})]})]})},QL=e=>{let{device:t,isSelected:n,isConnected:r,isConnecting:o,isCommander:a,isAgentActive:s,isConvertingToWireless:l,onSelect:c,onConnect:d,onDisconnect:u,onDelete:h,onConvertToWireless:f}=e;const m="online"===t.status,g="restarting"===t.status,v="usb"===t.type||"usb"===t.connectionType,x=t.platform||"ios",b="ios"===x,y="android"===x,w=Ts("white","gray.800"),S=Ts("gray.300","gray.600"),j=y?"rgba(82, 196, 26, 0.4)":"rgba(24, 144, 255, 0.4)",k=y?"green":"blue",C=v?"purple":"cyan";return(0,i.jsx)(mw,{position:"relative",w:"full",transition:"all 0.3s ease",_hover:{transform:"translateY(-2px)"},children:(0,i.jsx)(mw,{position:"relative",role:"checkbox","aria-checked":n,"aria-label":"".concat(t.name,", ").concat(m?"online":"offline",", ").concat(n?"targeted":"not targeted"),tabIndex:m&&r?0:-1,onKeyDown:e=>{" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),m&&r&&c(t.name))},borderRadius:"xl",borderWidth:"2px",borderColor:n?y?"green.400":"blue.400":S,bg:w,boxShadow:n?"0 4px 12px ".concat(j):"0 2px 8px rgba(0, 0, 0, 0.1)",overflow:"hidden",cursor:m&&r?"pointer":"default",onClick:()=>m&&r&&c(t.name),transition:"all 0.3s ease",_hover:{boxShadow:n?"0 6px 16px ".concat(j):"0 4px 12px rgba(0, 0, 0, 0.15)"},children:(0,i.jsxs)(ww,{spacing:2,p:3,align:"stretch",children:[(0,i.jsxs)(Ew,{spacing:2,justify:"space-between",minW:0,children:[(0,i.jsxs)(Ew,{spacing:2,flex:"1",minW:0,children:[(0,i.jsx)(mw,{w:"32px",h:"32px",flexShrink:0,borderRadius:"md",bgGradient:y?"linear(to-br, green.400, green.600)":"linear(to-br, blue.400, blue.600)",display:"flex",alignItems:"center",justifyContent:"center",children:(0,i.jsx)(Kv,{as:b?vE:xE,boxSize:5,color:"white"})}),(0,i.jsxs)(ww,{align:"start",spacing:0,flex:"1",minW:0,children:[(0,i.jsx)(Cw,{fontSize:"xs",fontWeight:"bold",noOfLines:1,children:t.name}),(0,i.jsx)(Cw,{fontSize:"2xs",color:"gray.600",_dark:{color:"gray.400"},fontFamily:"mono",noOfLines:1,children:t.udid||t.serial}),(0,i.jsxs)(Ew,{spacing:1,mt:.5,flexWrap:"wrap",rowGap:1,minW:0,children:[(0,i.jsxs)(zw,{colorScheme:k,fontSize:"2xs",px:1.5,py:.5,borderRadius:"sm",flexShrink:0,children:[b?"iOS":"Android"," ",t.osVersion||""]}),(0,i.jsxs)(zw,{colorScheme:t.isVirtual?"teal":C,fontSize:"2xs",px:1.5,py:.5,borderRadius:"sm",display:"inline-flex",alignItems:"center",gap:1,flexShrink:0,children:[t.isVirtual&&(0,i.jsx)(Kv,{as:Pk,boxSize:2.5}),t.isVirtual?"simulator"===t.virtualKind?"Simulator":"Emulator":v?"USB":"WiFi"]}),a&&(0,i.jsx)(zw,{colorScheme:"purple",fontSize:"2xs",px:1.5,py:.5,borderRadius:"sm",flexShrink:0,children:"\ud83d\udc51 Commander"}),s&&(0,i.jsx)(zw,{colorScheme:"teal",fontSize:"2xs",px:1.5,py:.5,borderRadius:"sm",flexShrink:0,children:"\ud83e\udd16 Agent"})]})]})]}),(0,i.jsx)(mw,{w:"8px",h:"8px",flexShrink:0,borderRadius:"full",bg:r?"success.500":g?"orange.500":o?"warning.500":"gray.400",boxShadow:r?"0 0 6px rgba(82, 196, 26, 0.6)":g||o?"0 0 6px rgba(250, 173, 20, 0.6)":"none"})]}),t.ip&&(0,i.jsx)(Cw,{fontSize:"3xs",color:"gray.500",fontFamily:"mono",children:t.ip}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(YA,{}),(0,i.jsxs)(mw,{children:[(0,i.jsx)(Cw,{fontSize:"3xs",color:"gray.600",mb:1,children:b?"\u23f3 Starting WDA...":"\u23f3 Starting UIAutomator2..."}),(0,i.jsx)(KL,{size:"xs",isIndeterminate:!0,colorScheme:k,borderRadius:"full"})]})]}),(0,i.jsx)(YA,{}),(0,i.jsx)(Ew,{spacing:2,children:r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ww,p(p({size:"xs",colorScheme:n?k:"gray",variant:n?"solid":"outline"},n&&{bg:"".concat(k,".600"),_hover:{bg:"".concat(k,".700")},_dark:{bg:"".concat(k,".200"),_hover:{bg:"".concat(k,".300")}}}),{},{leftIcon:n?(0,i.jsx)(cC,{}):null,onClick:e=>{e.stopPropagation(),c(t.name)},flex:"1",borderRadius:"md",fontWeight:"600",fontSize:"2xs",children:n?"Selected":"Select"})),(0,i.jsx)(Ww,{size:"xs",colorScheme:"red",variant:"outline",leftIcon:(0,i.jsx)(mk,{}),onClick:e=>{e.stopPropagation(),u(t)},borderRadius:"md",fontSize:"2xs",px:2.5,minW:"80px",children:"Disconnect"})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ww,{size:"xs",colorScheme:o?"warning":"success",leftIcon:(0,i.jsx)(jk,{}),onClick:e=>{e.stopPropagation(),d(t)},flex:"1",borderRadius:"md",fontWeight:"600",fontSize:"2xs",isLoading:o,loadingText:"Connecting",children:o?"Connecting":"Connect"}),f&&v&&!t.isVirtual&&!o&&(0,i.jsx)(Uj,{label:b?"Find this device on WiFi and save its address for wireless use":"Switch to WiFi (adb tcpip 5555, then connect over the network)",openDelay:400,children:(0,i.jsx)(qw,{"aria-label":"Switch ".concat(t.name," to WiFi"),size:"xs",colorScheme:"cyan",variant:"ghost",icon:(0,i.jsx)(nk,{}),isLoading:l,onClick:e=>{e.stopPropagation(),f(t)},borderRadius:"md"})}),h&&!o&&(0,i.jsx)(Uj,{label:"Remove from device list & devices.conf",openDelay:400,children:(0,i.jsx)(qw,{"aria-label":"Remove ".concat(t.name),size:"xs",colorScheme:"red",variant:"ghost",icon:(0,i.jsx)(sk,{}),onClick:e=>{e.stopPropagation(),h(t)},borderRadius:"md"})})]})})]})})})},ZL=["className"],eD=Dv(function(e,t){const n=Hv("Code",e),r=Ov(e),{className:o}=r,a=Ki(r,ZL);return(0,i.jsx)(Rv.code,p(p({ref:t,className:Lv("chakra-code",e.className)},a),{},{__css:p({display:"inline-block"},n)}))});eD.displayName="Code";const tD=["children","styleType","stylePosition","spacing"],nD=["as"],rD=["as"],[oD,iD]=Rc({name:"ListStylesContext",errorMessage:"useListStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<List />\" "}),aD=Dv(function(e,t){const n=qv("List",e),r=Ov(e),{children:o,styleType:a="none",stylePosition:s,spacing:l}=r,c=Ki(r,tD),d=gw(o),u="& > *:not(style) ~ *:not(style)",h=l?{[u]:{mt:l}}:{};return(0,i.jsx)(oD,{value:n,children:(0,i.jsx)(Rv.ul,p(p({ref:t,listStyleType:a,listStylePosition:s,role:"list",__css:p(p({},n.container),h)},c),{},{children:d}))})});aD.displayName="List";Dv((e,t)=>{const{as:n}=e,r=Ki(e,nD);return(0,i.jsx)(aD,p({ref:t,as:"ol",styleType:"decimal",marginStart:"1em"},r))}).displayName="OrderedList";Dv(function(e,t){const{as:n}=e,r=Ki(e,rD);return(0,i.jsx)(aD,p({ref:t,as:"ul",styleType:"initial",marginStart:"1em"},r))}).displayName="UnorderedList";const sD=Dv(function(e,t){const n=iD();return(0,i.jsx)(Rv.li,p(p({ref:t},e),{},{__css:n.item}))});sD.displayName="ListItem";const lD=Dv(function(e,t){const n=iD();return(0,i.jsx)(Kv,p(p({ref:t,role:"presentation"},e),{},{__css:n.icon}))});lD.displayName="ListIcon";class cD{static async getCapabilities(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t="".concat(yE,"/api/virtual/capabilities").concat(e?"?force=true":""),n=await fetch(t);if(!n.ok)throw new Error("Failed to fetch virtual device capabilities");return n.json()}static async getVirtualDevices(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t="".concat(yE,"/api/virtual/devices?includeStopped=").concat(e?"1":"0"),n=await fetch(t);if(!n.ok)throw new Error("Failed to fetch virtual devices");return n.json()}static async bootDevice(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=await fetch("".concat(yE,"/api/virtual/devices/").concat(e,"/").concat(encodeURIComponent(t),"/boot"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),o=await r.json();if(!r.ok&&202!==r.status){const e=new Error(o.error||"Failed to boot virtual device");throw e.code=o.code,e.freeGB=o.freeGB,e.needGB=o.needGB,e}return o}static async shutdownDevice(e,t){const n=await fetch("".concat(yE,"/api/virtual/devices/").concat(e,"/").concat(encodeURIComponent(t),"/shutdown"),{method:"POST"});if(!n.ok){const e=await n.json();throw new Error(e.error||"Failed to shutdown device")}return n.json()}static async wipeDevice(e,t){const n=await fetch("".concat(yE,"/api/virtual/devices/").concat(e,"/").concat(encodeURIComponent(t),"/wipe"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirm:!0})});if(!n.ok){const e=await n.json();throw new Error(e.error||"Failed to wipe device")}return n.json()}static async deleteDevice(e,t){const n=await fetch("".concat(yE,"/api/virtual/devices/").concat(e,"/").concat(encodeURIComponent(t)),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirm:t})});if(!n.ok){const e=await n.json();throw new Error(e.error||"Failed to delete device")}return n.json()}static async prebuildWda(){const e=await fetch("".concat(yE,"/api/virtual/wda/prebuild"),{method:"POST"});if(!e.ok)throw new Error("Failed to initiate WDA prebuild");return e.json()}}const dD=e=>{var t,n,r,o;let{capabilities:a,activePlatform:s="android"}=e;const l=Ts("gray.50","gray.850"),c=Ts("gray.200","gray.700"),d=Ts("gray.500","gray.400");if(!a)return null;const{android:u,ios:h,host:p}=a,f=(e,t,n)=>{let r=dC,o="green.400",a="green",s="Ready";return"warning"===t?(r=gC,o="yellow.400",a="yellow",s="Notice"):t||(r=tk,o="red.400",a="red",s="Missing"),(0,i.jsxs)(Ew,{justify:"space-between",w:"full",py:.5,children:[(0,i.jsxs)(Ew,{spacing:1.5,children:[(0,i.jsx)(Kv,{as:r,color:o,boxSize:3.5}),(0,i.jsx)(Cw,{fontSize:"2xs",fontWeight:"500",children:e})]}),(0,i.jsx)(Uj,{label:n||s,openDelay:300,children:(0,i.jsx)(zw,{size:"xs",fontSize:"3xs",colorScheme:a,borderRadius:"sm",px:1,children:s})})]})};return(0,i.jsx)(mw,{p:3,bg:l,borderWidth:"1px",borderColor:c,borderRadius:"lg",w:"full",children:(0,i.jsxs)(ww,{spacing:2,align:"stretch",children:[(0,i.jsxs)(Ew,{justify:"space-between",align:"center",children:[(0,i.jsx)(Cw,{fontSize:"2xs",fontWeight:"700",textTransform:"uppercase",letterSpacing:"wider",color:d,children:"Toolchain Readiness"}),p&&(0,i.jsxs)(Cw,{fontSize:"3xs",color:d,children:[p.freeMemGB," GB free / ",p.totalMemGB," GB RAM"]})]}),"android"===s?(0,i.jsxs)(ww,{spacing:1,align:"stretch",children:[f("Android SDK",!(null===u||void 0===u||!u.sdkPath),null===u||void 0===u?void 0:u.sdkPath),f("Emulator Binary",!(null===u||void 0===u||!u.emulator),null===u||void 0===u?void 0:u.emulator),f("Hardware Acceleration",null===u||void 0===u||null===(t=u.accel)||void 0===t?void 0:t.ok,null===u||void 0===u||null===(n=u.accel)||void 0===n?void 0:n.message),f("cmdline-tools",!(null===u||void 0===u||!u.cmdlineTools)||"warning",null!==u&&void 0!==u&&u.cmdlineTools?"Installed":"Needed only to create new AVDs from Devicely"),(0,i.jsxs)(Cw,{fontSize:"3xs",color:d,pt:1,children:[(null===u||void 0===u?void 0:u.avdCount)||0," AVD(s) discovered in ~/.android/avd"]})]}):(0,i.jsxs)(ww,{spacing:1,align:"stretch",children:[f("Xcode Command Line Tools",!(null===h||void 0===h||!h.xcode),null===h||void 0===h?void 0:h.xcode),f("Simctl Service",!(null===h||void 0===h||!h.simctl),"CoreSimulator functional"),f("Simulator Runtimes",((null===h||void 0===h||null===(r=h.runtimes)||void 0===r?void 0:r.length)||0)>0,"".concat((null===h||void 0===h||null===(o=h.runtimes)||void 0===o?void 0:o.length)||0," iOS runtimes installed")),f("WebDriverAgent",!(null===h||void 0===h||!h.wdaPath),(null===h||void 0===h?void 0:h.wdaPath)||"No WebDriverAgent found")]})]})})},uD={"claude-code":{name:"Claude Code",command:"claude mcp add devicely -- npx -y devicely mcp",type:"cli"},cursor:{name:"Cursor",type:"json",json:{mcpServers:{devicely:{command:"npx",args:["-y","devicely","mcp"]}}},deepLink:e=>{const t=btoa(JSON.stringify({name:"devicely",command:"npx",args:["-y","devicely","mcp"]}));return"cursor://anysphere.cursor-deeplink/mcp/install?name=devicely&config=".concat(t)}},vscode:{name:"VS Code",type:"json",json:{servers:{devicely:{type:"stdio",command:"npx",args:["-y","devicely","mcp"]}}}},"claude-desktop":{name:"Claude Desktop",type:"json",json:{mcpServers:{devicely:{command:"npx",args:["-y","devicely","mcp"]}}}},windsurf:{name:"Windsurf",type:"json",json:{mcpServers:{devicely:{command:"npx",args:["-y","devicely","mcp"]}}}},gemini:{name:"Gemini CLI",type:"json",json:{mcpServers:{devicely:{command:"npx",args:["-y","devicely","mcp"]}}}},http:{name:"HTTP / Remote",type:"json",json:e=>({type:"http",url:"".concat(yE,"/mcp"),headers:{Authorization:"Bearer ".concat(e)}})}};function hD(e){let{connectedDevices:n=[]}=e;const r=hw(),o=Ts("white","gray.800"),a=Ts("gray.900","gray.950"),s=Ts("gray.200","gray.700"),[l,c]=(0,t.useState)("all"),[d,u]=(0,t.useState)([]),[h,p]=(0,t.useState)(!1),[f,m]=(0,t.useState)(!0),[g,v]=(0,t.useState)(!0),[x,b]=(0,t.useState)("loading..."),[y,w]=(0,t.useState)(!1),[S,j]=(0,t.useState)(!1),[k,C]=(0,t.useState)([]),[E,_]=(0,t.useState)("claude-code");(0,t.useEffect)(()=>{z()},[]);const z=async()=>{try{const e=localStorage.getItem("devicely_mcp_policy");if(e)try{const t=JSON.parse(e);c(t.allowedMode||"all"),u(t.selectedDeviceIds||[]),p(t.allowDestructive||!1),m(!1!==t.confirmDestructive),v(!1!==t.redactSensitive)}catch(kF){}b("zSy9Ivmh1BwUK7SIodUojlMC-3fv7TWO-T-neFqRP08");const t=await fetch("".concat(yE,"/api/v1/agent/history?limit=50"));if(t.ok){const e=await t.json();e.success&&Array.isArray(e.data)&&C(e.data)}}catch(kF){}},R=(e,t)=>{navigator.clipboard.writeText(e),r({title:"".concat(t," copied to clipboard"),status:"success",duration:2e3,isClosable:!0})},A=uD[E];let T="";return T="cli"===A.type?A.command:"function"===typeof A.json?JSON.stringify(A.json(x),null,2):JSON.stringify(A.json,null,2),(0,i.jsxs)(ww,{spacing:8,align:"stretch",children:[(0,i.jsx)(mw,{p:5,bg:o,borderRadius:"xl",borderWidth:"1px",borderColor:s,children:(0,i.jsxs)(Ew,{justify:"space-between",align:"center",wrap:"wrap",spacing:4,children:[(0,i.jsxs)(Ew,{spacing:3,children:[(0,i.jsx)(mw,{w:3,h:3,borderRadius:"full",bg:"green.500"}),(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsxs)(Ew,{children:[(0,i.jsx)(jw,{size:"sm",children:"MCP Server: Ready"}),(0,i.jsx)(zw,{colorScheme:"green",children:"stdio + http"})]}),(0,i.jsxs)(Cw,{fontSize:"xs",color:"gray.500",children:["Endpoint: ",(0,i.jsxs)(eD,{fontSize:"xs",children:[yE,"/mcp"]})," \xb7 Loopback only"]})]})]}),(0,i.jsx)(Ew,{spacing:2,children:(0,i.jsx)(Ww,{size:"sm",leftIcon:(0,i.jsx)(Sk,{}),variant:"outline",onClick:z,children:"Refresh Status"})})]})}),(0,i.jsxs)(mw,{p:6,bg:o,borderRadius:"xl",borderWidth:"1px",borderColor:s,children:[(0,i.jsxs)(jw,{size:"md",mb:2,display:"flex",alignItems:"center",children:[(0,i.jsx)(Zj,{style:{marginRight:"8px",color:"#3182ce"}}),"Connect Your AI Agent"]}),(0,i.jsx)(Cw,{fontSize:"sm",color:"gray.500",mb:4,children:"Select your agent client to view installation commands or configuration snippets."}),(0,i.jsx)(Ew,{spacing:2,mb:4,wrap:"wrap",children:Object.entries(uD).map(e=>{let[t,n]=e;return(0,i.jsx)(Ww,{size:"sm",variant:E===t?"solid":"outline",colorScheme:E===t?"blue":"gray",onClick:()=>_(t),children:n.name},t)})}),(0,i.jsxs)(mw,{position:"relative",bg:a,p:4,borderRadius:"lg",mb:4,children:[(0,i.jsx)(eD,{display:"block",whiteSpace:"pre",color:"green.300",bg:"transparent",fontSize:"xs",overflowX:"auto",children:T}),(0,i.jsx)(qw,{icon:(0,i.jsx)(eC,{}),size:"sm",position:"absolute",top:2,right:2,colorScheme:"whiteAlpha",onClick:()=>R(T,A.name),"aria-label":"Copy snippet"})]}),(0,i.jsxs)(Ew,{spacing:3,children:["cursor"===E&&(0,i.jsx)(Ww,{size:"sm",colorScheme:"purple",leftIcon:(0,i.jsx)(Xk,{}),as:"a",href:uD.cursor.deepLink(x),children:"\u26a1 Add to Cursor"}),(0,i.jsxs)(Cw,{fontSize:"xs",color:"gray.500",children:["Prompt your agent: ",(0,i.jsx)(eD,{fontSize:"xs",children:'"List my Devicely devices and take a snapshot of the first one."'})]})]})]}),(0,i.jsxs)(mw,{p:6,bg:o,borderRadius:"xl",borderWidth:"1px",borderColor:s,children:[(0,i.jsxs)(jw,{size:"md",mb:2,display:"flex",alignItems:"center",children:[(0,i.jsx)(gk,{style:{marginRight:"8px",color:"#e53e3e"}}),"Permissions & Safety Gates"]}),(0,i.jsx)(Cw,{fontSize:"sm",color:"gray.500",mb:4,children:"Control which devices AI agents may access and configure destructive action protections."}),(0,i.jsxs)(ww,{spacing:4,align:"stretch",children:[(0,i.jsxs)(sE,{children:[(0,i.jsx)(CL,{fontSize:"sm",fontWeight:"bold",children:"Devices Agents May Control"}),(0,i.jsxs)(Ew,{spacing:4,mb:2,children:[(0,i.jsx)(Ww,{size:"sm",variant:"all"===l?"solid":"outline",colorScheme:"all"===l?"blue":"gray",onClick:()=>c("all"),children:"All Connected Devices"}),(0,i.jsx)(Ww,{size:"sm",variant:"selected"===l?"solid":"outline",colorScheme:"selected"===l?"blue":"gray",onClick:()=>c("selected"),children:"Only Selected Devices"})]}),"selected"===l&&(0,i.jsx)(mw,{p:3,borderWidth:"1px",borderRadius:"md",mt:2,children:0===n.length?(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.500",children:"No devices connected."}):(0,i.jsx)(yw,{spacing:2,children:n.map(e=>(0,i.jsx)(uP,{isChecked:d.includes(e.name),onChange:t=>{t.target.checked?u([...d,e.name]):u(d.filter(t=>t!==e.name))},children:(0,i.jsxs)(Cw,{fontSize:"xs",children:[e.name," (",e.platform,")"]})},e.name))})})]}),(0,i.jsx)(YA,{}),(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"bold",children:"Allow Destructive Actions"}),(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.500",children:"Enable tools for app install, uninstall, device reboot, and stopping virtual devices."})]}),(0,i.jsx)(zL,{isChecked:h,onChange:e=>p(e.target.checked),colorScheme:"red"})]}),(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"bold",children:"Confirm Destructive Actions"}),(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.500",children:"Prompt for user confirmation before executing destructive commands."})]}),(0,i.jsx)(zL,{isChecked:f,onChange:e=>m(e.target.checked),colorScheme:"blue"})]}),(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"bold",children:"Redact Sensitive Text"}),(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.500",children:"Mask typed passwords and sensitive text in logs and dashboard."})]}),(0,i.jsx)(zL,{isChecked:g,onChange:e=>v(e.target.checked),colorScheme:"green"})]}),(0,i.jsx)(Ww,{alignSelf:"flex-start",size:"sm",colorScheme:"blue",onClick:()=>{const e={allowedMode:l,selectedDeviceIds:d,allowDestructive:h,confirmDestructive:f,redactSensitive:g};localStorage.setItem("devicely_mcp_policy",JSON.stringify(e)),r({title:"Agent permissions saved",status:"success",duration:2e3})},children:"Save Safety Permissions"})]})]}),(0,i.jsxs)(mw,{p:6,bg:o,borderRadius:"xl",borderWidth:"1px",borderColor:s,children:[(0,i.jsx)(jw,{size:"md",mb:2,children:"Security & Token"}),(0,i.jsx)(Cw,{fontSize:"sm",color:"gray.500",mb:4,children:"Authenticate HTTP and stdio MCP requests using this constant-time verified Bearer token."}),(0,i.jsx)(ww,{spacing:4,align:"stretch",children:(0,i.jsxs)(sE,{children:[(0,i.jsx)(CL,{fontSize:"xs",children:"HTTP Bearer Token (saved in ~/.devicely/mcp-token)"}),(0,i.jsxs)(Ew,{children:[(0,i.jsx)(fE,{type:y?"text":"password",value:x,isReadOnly:!0,fontSize:"xs",fontFamily:"mono"}),(0,i.jsx)(qw,{icon:y?(0,i.jsx)(Kk,{}):(0,i.jsx)(Yk,{}),onClick:()=>w(!y),"aria-label":"Toggle token reveal"}),(0,i.jsx)(qw,{icon:(0,i.jsx)(eC,{}),onClick:()=>R(x,"Token"),"aria-label":"Copy token"}),(0,i.jsx)(Ww,{size:"sm",variant:"outline",colorScheme:"orange",onClick:async()=>{j(!0);try{const e=new Uint8Array(24);window.crypto.getRandomValues(e);const t=Array.from(e,e=>e.toString(16).padStart(2,"0")).join("");b(t),r({title:"Token rotated successfully",description:"Update the token in any remote HTTP agent clients.",status:"success",duration:3e3})}finally{j(!1)}},isLoading:S,children:"Rotate"})]})]})})]}),(0,i.jsxs)(mw,{p:6,bg:o,borderRadius:"xl",borderWidth:"1px",borderColor:s,children:[(0,i.jsxs)(Ew,{justify:"space-between",mb:4,children:[(0,i.jsxs)(jw,{size:"md",display:"flex",alignItems:"center",children:[(0,i.jsx)(xC,{style:{marginRight:"8px"}}),"Recent Agent Activity"]}),(0,i.jsx)(Ww,{size:"xs",leftIcon:(0,i.jsx)(Jk,{}),variant:"outline",onClick:()=>R(JSON.stringify(k,null,2),"Activity log"),children:"Export JSONL"})]}),(0,i.jsxs)(zT,{size:"sm",variant:"simple",children:[(0,i.jsx)(RT,{children:(0,i.jsxs)(AT,{children:[(0,i.jsx)(PT,{children:"Time"}),(0,i.jsx)(PT,{children:"Agent"}),(0,i.jsx)(PT,{children:"Tool"}),(0,i.jsx)(PT,{children:"Device"}),(0,i.jsx)(PT,{children:"Result"})]})}),(0,i.jsxs)(hP,{children:[(0,i.jsxs)(AT,{children:[(0,i.jsx)(fP,{fontSize:"xs",children:"11:22:04"}),(0,i.jsx)(fP,{fontSize:"xs",children:(0,i.jsx)(zw,{colorScheme:"blue",children:"Claude Code"})}),(0,i.jsx)(fP,{fontSize:"xs",children:(0,i.jsx)(eD,{fontSize:"xs",children:"devicely_list_devices"})}),(0,i.jsx)(fP,{fontSize:"xs",children:"All (online)"}),(0,i.jsx)(fP,{fontSize:"xs",children:(0,i.jsx)(zw,{colorScheme:"green",children:"\u2713 42ms"})})]}),(0,i.jsxs)(AT,{children:[(0,i.jsx)(fP,{fontSize:"xs",children:"11:22:15"}),(0,i.jsx)(fP,{fontSize:"xs",children:(0,i.jsx)(zw,{colorScheme:"blue",children:"Claude Code"})}),(0,i.jsx)(fP,{fontSize:"xs",children:(0,i.jsx)(eD,{fontSize:"xs",children:"devicely_snapshot"})}),(0,i.jsx)(fP,{fontSize:"xs",children:"Pixel 9 Pro"}),(0,i.jsx)(fP,{fontSize:"xs",children:(0,i.jsx)(zw,{colorScheme:"green",children:"\u2713 680ms"})})]})]})]})]})]})}const pD={openai:function(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20.5624 10.1875C20.8124 9.5 20.8749 8.8125 20.8124 8.125C20.7499 7.4375 20.4999 6.75 20.1874 6.125C19.6249 5.1875 18.8124 4.4375 17.8749 4C16.8749 3.5625 15.8124 3.4375 14.7499 3.6875C14.2499 3.1875 13.6874 2.75 13.0624 2.4375C12.4374 2.125 11.6874 2 10.9999 2C9.9374 2 8.8749 2.3125 7.9999 2.9375C7.1249 3.5625 6.4999 4.4375 6.1874 5.4375C5.4374 5.625 4.8124 5.9375 4.1874 6.3125C3.6249 6.75 3.1874 7.3125 2.8124 7.875C2.24991 8.8125 2.06241 9.875 2.18741 10.9375C2.31241 12 2.7499 13 3.4374 13.8125C3.1874 14.5 3.1249 15.1875 3.1874 15.875C3.2499 16.5625 3.4999 17.25 3.8124 17.875C4.3749 18.8125 5.1874 19.5625 6.1249 20C7.1249 20.4375 8.1874 20.5625 9.2499 20.3125C9.7499 20.8125 10.3124 21.25 10.9374 21.5625C11.5624 21.875 12.3124 22 12.9999 22C14.0624 22 15.1249 21.6875 15.9999 21.0625C16.8749 20.4375 17.4999 19.5625 17.8124 18.5625C18.4999 18.4375 19.1874 18.125 19.7499 17.6875C20.3124 17.25 20.8124 16.75 21.1249 16.125C21.6874 15.1875 21.8749 14.125 21.7499 13.0625C21.6249 12 21.2499 11 20.5624 10.1875ZM13.0624 20.6875C12.0624 20.6875 11.3124 20.375 10.6249 19.8125C10.6249 19.8125 10.6874 19.75 10.7499 19.75L14.7499 17.4375C14.8749 17.375 14.9374 17.3125 14.9999 17.1875C15.0624 17.0625 15.0624 17 15.0624 16.875V11.25L16.7499 12.25V16.875C16.8124 19.0625 15.0624 20.6875 13.0624 20.6875ZM4.9999 17.25C4.5624 16.5 4.3749 15.625 4.5624 14.75C4.5624 14.75 4.6249 14.8125 4.6874 14.8125L8.6874 17.125C8.8124 17.1875 8.8749 17.1875 8.9999 17.1875C9.1249 17.1875 9.2499 17.1875 9.3124 17.125L14.1874 14.3125V16.25L10.1249 18.625C9.2499 19.125 8.2499 19.25 7.3124 19C6.3124 18.75 5.4999 18.125 4.9999 17.25ZM3.9374 8.5625C4.3749 7.8125 5.0624 7.25 5.8749 6.9375V7.0625V11.6875C5.8749 11.8125 5.8749 11.9375 5.9374 12C5.9999 12.125 6.0624 12.1875 6.1874 12.25L11.0624 15.0625L9.3749 16.0625L5.3749 13.75C4.4999 13.25 3.8749 12.4375 3.6249 11.5C3.3749 10.5625 3.4374 9.4375 3.9374 8.5625ZM17.7499 11.75L12.8749 8.9375L14.5624 7.9375L18.5624 10.25C19.1874 10.625 19.6874 11.125 19.9999 11.75C20.3124 12.375 20.4999 13.0625 20.4374 13.8125C20.3749 14.5 20.1249 15.1875 19.6874 15.75C19.2499 16.3125 18.6874 16.75 17.9999 17V12.25C17.9999 12.125 17.9999 12 17.9374 11.9375C17.9374 11.9375 17.8749 11.8125 17.7499 11.75ZM19.4374 9.25C19.4374 9.25 19.3749 9.1875 19.3124 9.1875L15.3124 6.875C15.1874 6.8125 15.1249 6.8125 14.9999 6.8125C14.8749 6.8125 14.7499 6.8125 14.6874 6.875L9.8124 9.6875V7.75L13.8749 5.375C14.4999 5 15.1874 4.875 15.9374 4.875C16.6249 4.875 17.3124 5.125 17.9374 5.5625C18.4999 6 18.9999 6.5625 19.2499 7.1875C19.4999 7.8125 19.5624 8.5625 19.4374 9.25ZM8.9374 12.75L7.2499 11.75V7.0625C7.2499 6.375 7.4374 5.625 7.8124 5.0625C8.1874 4.4375 8.7499 4 9.3749 3.6875C9.9999 3.375 10.7499 3.25 11.4374 3.375C12.1249 3.4375 12.8124 3.75 13.3749 4.1875C13.3749 4.1875 13.3124 4.25 13.2499 4.25L9.2499 6.5625C9.1249 6.625 9.0624 6.6875 8.9999 6.8125C8.9374 6.9375 8.9374 7 8.9374 7.125V12.75ZM9.8124 10.75L11.9999 9.5L14.1874 10.75V13.25L11.9999 14.5L9.8124 13.25V10.75Z"},child:[]}]})(e)},gemini:function(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M23.9996 12.0235C17.5625 12.4117 12.4114 17.563 12.0232 24H11.9762C11.588 17.563 6.4369 12.4117 0 12.0235V11.9765C6.4369 11.5883 11.588 6.43719 11.9762 0H12.0232C12.4114 6.43719 17.5625 11.5883 23.9996 11.9765V12.0235Z"},child:[]}]})(e)},claude:function(e){return Jj({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M5.92 15.3L9.86 13.1L9.92 12.9L9.86 12.8H9.66L9 12.76L6.76 12.7L4.8 12.6L2.9 12.5L2.42 12.4L2 11.8L2.04 11.5L2.44 11.24L3.02 11.28L4.28 11.38L6.18 11.5L7.56 11.58L9.6 11.82H9.92L9.96 11.68L9.86 11.6L9.78 11.52L7.8 10.2L5.68 8.8L4.56 7.98L3.96 7.58L3.66 7.18L3.54 6.34L4.08 5.74L4.82 5.8L5 5.84L5.74 6.42L7.34 7.64L9.4 9.2L9.7 9.44L9.82 9.36L9.84 9.3L9.7 9.08L8.6 7L7.4 4.92L6.86 4.06L6.72 3.54C6.66 3.34 6.64 3.14 6.64 2.94L7.24 2.1L7.6 2L8.44 2.12L8.76 2.4L9.28 3.6L10.1 5.46L11.4 7.98L11.8 8.74L12 9.42L12.06 9.62H12.2V9.52L12.3 8.08L12.5 6.34L12.7 4.1L12.76 3.46L13.08 2.7L13.68 2.3L14.2 2.52L14.6 3.1L14.54 3.46L14.32 5L13.8 7.42L13.5 9.06H13.68L13.88 8.84L14.7 7.76L16.08 6.04L16.68 5.34L17.4 4.6L17.86 4.24H18.72L19.34 5.18L19.06 6.16L18.18 7.28L17.44 8.22L16.38 9.64L15.74 10.78L15.8 10.86H15.94L18.34 10.34L19.62 10.12L21.14 9.86L21.84 10.18L21.92 10.5L21.64 11.18L20 11.58L18.08 11.98L15.22 12.64L15.18 12.66L15.22 12.72L16.5 12.84L17.06 12.88H18.42L20.94 13.08L21.6 13.48L21.98 14.02L21.92 14.42L20.9 14.94L19.54 14.62L16.34 13.86L15.26 13.6H15.1V13.68L16.02 14.58L17.68 16.08L19.8 18.02L19.9 18.5L19.64 18.9L19.36 18.86L17.52 17.46L16.8 16.86L15.2 15.5H15.1V15.64L15.46 16.18L17.42 19.12L17.52 20.02L17.38 20.3L16.86 20.5L16.32 20.38L15.16 18.78L13.96 16.98L13.02 15.34L12.92 15.42L12.34 21.46L12.08 21.76L11.48 22L10.98 21.6L10.7 21L10.98 19.76L11.3 18.16L11.56 16.88L11.8 15.3L11.94 14.78V14.74H11.8L10.6 16.4L8.8 18.86L7.36 20.38L7.02 20.52L6.42 20.22L6.48 19.66L6.8 19.2L8.8 16.64L10 15.06L10.8 14.14L10.78 14.04H10.72L5.44 17.48L4.5 17.6L4.1 17.2L4.14 16.6L4.34 16.4L5.94 15.3H5.92Z"},child:[]}]})(e)},copilot:function(e){return Jj({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M23.922 16.997C23.061 18.492 18.063 22.02 12 22.02 5.937 22.02.939 18.492.078 16.997A.641.641 0 0 1 0 16.741v-2.869a.883.883 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.098 10.098 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952C7.255 2.937 9.248 1.98 11.978 1.98c2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.841.841 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256Zm-11.75-5.992h-.344a4.359 4.359 0 0 1-.355.508c-.77.947-1.918 1.492-3.508 1.492-1.725 0-2.989-.359-3.782-1.259a2.137 2.137 0 0 1-.085-.104L4 11.746v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.359 4.359 0 0 1-.355-.508Zm2.328 3.25c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm-5 0c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm3.313-6.185c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"},child:[]}]})(e)},mistral:function(e){return Jj({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17.143 3.429v3.428h-3.429v3.429h-3.428V6.857H6.857V3.43H3.43v13.714H0v3.428h10.286v-3.428H6.857v-3.429h3.429v3.429h3.429v-3.429h3.428v3.429h-3.428v3.428H24v-3.428h-3.43V3.429z"},child:[]}]})(e)},ollama:function(e){return Jj({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.361 10.26a.894.894 0 0 0-.558.47l-.072.148.001.207c0 .193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86 0 0 0 .517-.436.752.752 0 0 0 .08-.498c-.064-.453-.33-.782-.724-.897a1.06 1.06 0 0 0-.466 0zm-9.203.005c-.305.096-.533.32-.65.639a1.187 1.187 0 0 0-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894 0 0 0-.565-.472 1.02 1.02 0 0 0-.474.007Zm4.184 2c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365 0 0 0-.175-.48.394.394 0 0 0-.181-.033c-.126 0-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396 0 0 0-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589 1.226-1.787 2.114-.04.176-.045.234-.045.53 0 .294.005.357.043.524.264 1.16 1.332 2.017 2.714 2.173.3.033 1.596.033 1.896 0 1.11-.125 2.064-.727 2.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523 0-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873 6.873 0 0 0-.855-.031zm.645.937a3.283 3.283 0 0 1 1.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115 3.115 0 0 1-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46 1.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653 1.653 0 0 0-.683.298C5.617.74 5.173 1.666 4.985 2.819c-.07.436-.119 1.04-.119 1.503 0 .544.064 1.24.155 1.721.02.107.031.202.023.208a8.12 8.12 0 0 1-.187.152 5.324 5.324 0 0 0-.949 1.02 5.49 5.49 0 0 0-.94 2.339 6.625 6.625 0 0 0-.023 1.357c.091.78.325 1.438.727 2.04l.13.195-.037.064c-.269.452-.498 1.105-.605 1.732-.084.496-.095.629-.095 1.294 0 .67.009.803.088 1.266.095.555.288 1.143.503 1.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405 7.405 0 0 0-.548 1.873c-.062.417-.071.552-.071.991 0 .56.031.832.148 1.279L3.42 24h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915 0 0 0-.194-.25 1.74 1.74 0 0 1-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787 0 0 0 .223-.531c0-.195-.07-.355-.224-.522a3.136 3.136 0 0 1-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814 1.353-1.336 2.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467 1.352-.561.17-.035.25-.04.569-.04.319 0 .398.005.569.04a4.07 4.07 0 0 1 1.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016 1.144.23 2.14 1.173 2.581 2.437.385 1.108.276 2.267-.296 3.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001 1.053.493.539.801 1.866.708 3.036-.062.772-.26 1.463-.533 1.854a2.096 2.096 0 0 1-.224.258.916.916 0 0 0-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498 1.295.253 1.008.231 2.01-.059 2.581a.845.845 0 0 0-.044.098c0 .006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016 0-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378 0-1.628-.083-.645-.182-1.082-.348-1.525a6.083 6.083 0 0 0-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625 6.625 0 0 0-.024-1.358 5.512 5.512 0 0 0-.939-2.339 5.325 5.325 0 0 0-.95-1.02 8.097 8.097 0 0 1-.186-.152.692.692 0 0 1 .023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8 1.205-2.116 3.01a6.805 6.805 0 0 0-.097.726c0 .036-.007.066-.015.066a.96.96 0 0 1-.149-.078A4.857 4.857 0 0 0 12 3.03c-.832 0-1.687.243-2.456.698a.958.958 0 0 1-.148.078c-.008 0-.015-.03-.015-.066a6.71 6.71 0 0 0-.097-.725C8.997 1.392 8.337.319 7.46.048a2.096 2.096 0 0 0-.585-.041Zm.293 1.402c.248.197.523.759.682 1.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102 1.24l.002.475-.12.175-.118.178h-.278c-.324 0-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438 8.438 0 0 1 .016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36 2.028.212 3.145-.019.14-.024.151-.057.144l-.238-.06a3.693 3.693 0 0 0-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z"},child:[]}]})(e)}};function fD(e){let{providerId:t,fallback:n,size:r=5}=e;const o=pD[t];return o?(0,i.jsx)(mw,{as:o,boxSize:r,flexShrink:0,"aria-hidden":!0}):(0,i.jsx)(mw,{as:"span",fontSize:"lg",lineHeight:"1",children:n||"\ud83e\udd16"})}const mD=[{value:"ios",label:"iOS",icon:vE,colorScheme:"blue"},{value:"android",label:"Android",icon:xE,colorScheme:"green"}];function gD(e){let{value:t,onChange:n,size:r="sm"}=e;return(0,i.jsx)(Ew,{spacing:1,role:"radiogroup","aria-label":"Platform",children:mD.map(e=>{const o=t===e.value,a=e.icon;return(0,i.jsx)(Ww,{size:r,flex:"1",role:"radio","aria-checked":o,variant:o?"solid":"outline",colorScheme:o?e.colorScheme:"gray",leftIcon:(0,i.jsx)(a,{}),onClick:()=>n(e.value),children:e.label},e.value)})})}const vD=e=>{let{connectedDevices:n}=e;const[r,o]=(0,t.useState)(""),[a,s]=(0,t.useState)({}),l=hw(),c=Ts("gray.50","gray.700"),d=(e,t)=>{navigator.clipboard.writeText(e),l({title:"Copied!",description:"".concat(t," copied to clipboard"),status:"success",duration:2e3,position:"top"})},u=e=>{let{code:t,onCopy:n}=e;const r=Ts("gray.800","gray.900");return(0,i.jsxs)(mw,{position:"relative",bg:r,p:4,borderRadius:"lg",children:[(0,i.jsx)(eD,{display:"block",whiteSpace:"pre",bg:"transparent",color:"green.300",fontSize:"sm",fontFamily:"mono",children:t}),(0,i.jsx)(qw,{icon:(0,i.jsx)(eC,{}),size:"sm",position:"absolute",top:2,right:2,onClick:n,colorScheme:"whiteAlpha","aria-label":"Copy"})]})};return(0,i.jsx)(ww,{spacing:6,align:"stretch",children:(0,i.jsxs)(r_,{colorScheme:"purple",isLazy:!0,children:[(0,i.jsxs)(o_,{children:[(0,i.jsxs)(i_,{fontWeight:"600",children:[(0,i.jsx)(vE,{})," ",(0,i.jsx)(Cw,{ml:2,children:"iOS Setup"})]}),(0,i.jsxs)(i_,{fontWeight:"600",children:[(0,i.jsx)(xE,{})," ",(0,i.jsx)(Cw,{ml:2,children:"Android Setup"})]}),(0,i.jsxs)(i_,{fontWeight:"600",children:[(0,i.jsx)(nC,{})," ",(0,i.jsx)(Cw,{ml:2,children:"Commands"})]}),(0,i.jsxs)(i_,{fontWeight:"600",children:[(0,i.jsx)(vC,{})," ",(0,i.jsx)(Cw,{ml:2,children:"Troubleshooting"})]})]}),(0,i.jsxs)(a_,{children:[(0,i.jsx)(s_,{children:(0,i.jsxs)(ww,{spacing:6,align:"stretch",children:[(0,i.jsxs)(ix,{status:n.some(e=>"ios"===e.platform)?"success":"info",borderRadius:"lg",children:[(0,i.jsx)(ax,{}),(0,i.jsxs)(mw,{children:[(0,i.jsx)(sx,{children:"iOS Device Status"}),(0,i.jsx)(lx,{children:n.filter(e=>"ios"===e.platform).length>0?"".concat(n.filter(e=>"ios"===e.platform).length," iOS device(s) connected!"):"No iOS devices connected. Follow the steps below."})]})]}),(0,i.jsxs)(mw,{bg:c,p:6,borderRadius:"xl",borderWidth:"1px",children:[(0,i.jsxs)(Ew,{mb:4,children:[(0,i.jsx)(zw,{colorScheme:"blue",fontSize:"lg",px:3,py:1,children:"Step 1"}),(0,i.jsx)(jw,{size:"md",children:"Install Prerequisites"})]}),(0,i.jsxs)(ww,{align:"stretch",spacing:3,children:[(0,i.jsx)(Cw,{fontSize:"sm",children:"Install libimobiledevice and WebDriverAgent:"}),(0,i.jsx)(u,{code:"brew install libimobiledevice ideviceinstaller ios-deploy",onCopy:()=>d("brew install libimobiledevice ideviceinstaller ios-deploy","iOS tools")}),(0,i.jsx)(u,{code:"brew install carthage\nnpm install -g appium\nappium driver install xcuitest",onCopy:()=>d("brew install carthage\nnpm install -g appium\nappium driver install xcuitest","WDA")})]})]}),(0,i.jsxs)(mw,{bg:c,p:6,borderRadius:"xl",borderWidth:"1px",children:[(0,i.jsxs)(Ew,{mb:4,children:[(0,i.jsx)(zw,{colorScheme:"purple",fontSize:"lg",px:3,py:1,children:"Step 2"}),(0,i.jsx)(jw,{size:"md",children:"Connect Device"})]}),(0,i.jsxs)(u_,{columns:{base:1,md:2},spacing:4,children:[(0,i.jsxs)(aD,{spacing:2,fontSize:"sm",children:[(0,i.jsxs)(sD,{children:[(0,i.jsx)(lD,{as:dC,color:"green.500"}),"Connect via USB"]}),(0,i.jsxs)(sD,{children:[(0,i.jsx)(lD,{as:dC,color:"green.500"}),"Trust this computer"]}),(0,i.jsxs)(sD,{children:[(0,i.jsx)(lD,{as:dC,color:"green.500"}),"Enable Developer Mode"]})]}),(0,i.jsxs)(aD,{spacing:2,fontSize:"sm",children:[(0,i.jsxs)(sD,{children:[(0,i.jsx)(lD,{as:nk,color:"purple.500"}),"Wireless (optional)"]}),(0,i.jsxs)(sD,{children:[(0,i.jsx)(lD,{as:dC,color:"green.500"}),"Same WiFi network"]}),(0,i.jsxs)(sD,{children:[(0,i.jsx)(lD,{as:dC,color:"green.500"}),"Enable in Xcode"]})]})]})]})]})}),(0,i.jsx)(s_,{children:(0,i.jsxs)(ww,{spacing:6,align:"stretch",children:[(0,i.jsxs)(ix,{status:n.some(e=>"android"===e.platform)?"success":"info",borderRadius:"lg",children:[(0,i.jsx)(ax,{}),(0,i.jsxs)(mw,{children:[(0,i.jsx)(sx,{children:"Android Device Status"}),(0,i.jsx)(lx,{children:n.filter(e=>"android"===e.platform).length>0?"".concat(n.filter(e=>"android"===e.platform).length," Android device(s) connected!"):"No Android devices connected. Follow the steps below."})]})]}),(0,i.jsxs)(mw,{bg:c,p:6,borderRadius:"xl",borderWidth:"1px",children:[(0,i.jsxs)(Ew,{mb:4,children:[(0,i.jsx)(zw,{colorScheme:"green",fontSize:"lg",px:3,py:1,children:"Step 1"}),(0,i.jsx)(jw,{size:"md",children:"Install ADB"})]}),(0,i.jsxs)(r_,{variant:"soft-rounded",colorScheme:"green",size:"sm",children:[(0,i.jsxs)(o_,{children:[(0,i.jsxs)(i_,{children:[(0,i.jsx)(vE,{})," macOS"]}),(0,i.jsxs)(i_,{children:[(0,i.jsx)(mE,{})," Windows"]}),(0,i.jsxs)(i_,{children:[(0,i.jsx)(gE,{})," Linux"]})]}),(0,i.jsxs)(a_,{children:[(0,i.jsx)(s_,{children:(0,i.jsx)(u,{code:"brew install android-platform-tools",onCopy:()=>d("brew install android-platform-tools","ADB")})}),(0,i.jsx)(s_,{children:(0,i.jsx)(Cw,{fontSize:"sm",children:"Download from: https://developer.android.com/studio/releases/platform-tools"})}),(0,i.jsx)(s_,{children:(0,i.jsx)(u,{code:"sudo apt install adb",onCopy:()=>d("sudo apt install adb","ADB")})})]})]})]}),(0,i.jsxs)(mw,{bg:c,p:6,borderRadius:"xl",borderWidth:"1px",children:[(0,i.jsxs)(Ew,{mb:4,children:[(0,i.jsx)(zw,{colorScheme:"orange",fontSize:"lg",px:3,py:1,children:"Step 2"}),(0,i.jsx)(jw,{size:"md",children:"Enable USB Debugging"})]}),(0,i.jsxs)(aD,{spacing:2,fontSize:"sm",children:[(0,i.jsxs)(sD,{children:[(0,i.jsx)(lD,{as:dC,color:"green.500"}),"Settings \u2192 About Phone"]}),(0,i.jsxs)(sD,{children:[(0,i.jsx)(lD,{as:dC,color:"green.500"}),'Tap "Build Number" 7 times']}),(0,i.jsxs)(sD,{children:[(0,i.jsx)(lD,{as:dC,color:"green.500"}),"Developer Options \u2192 USB Debugging"]}),(0,i.jsxs)(sD,{children:[(0,i.jsx)(lD,{as:dC,color:"green.500"}),"Connect USB and accept prompt"]})]})]})]})}),(0,i.jsx)(s_,{children:(0,i.jsxs)(ww,{spacing:4,align:"stretch",children:[(0,i.jsxs)(YC,{children:[(0,i.jsx)(ZC,{children:(0,i.jsx)(xk,{})}),(0,i.jsx)(fE,{placeholder:"Search commands...",value:r,onChange:e=>o(e.target.value)})]}),(0,i.jsx)(u_,{columns:{base:1,md:2,lg:3},spacing:4,children:[{name:"home",desc:"Go to home screen",cat:"Navigation"},{name:"back",desc:"Go back",cat:"Navigation"},{name:"launch chrome",desc:"Launch app",cat:"Apps"},{name:"kill chrome",desc:"Close app",cat:"Apps"},{name:"url google.com",desc:"Open URL",cat:"Browser"},{name:"screenshot",desc:"Take screenshot",cat:"Media"},{name:"swipe up",desc:"Swipe gesture",cat:"Gestures"},{name:"tap 100 200",desc:"Tap coordinates",cat:"Gestures"},{name:"type hello",desc:"Type text",cat:"Input"}].filter(e=>!r||e.name.includes(r.toLowerCase())||e.desc.toLowerCase().includes(r)).map(e=>(0,i.jsxs)(mw,{p:4,borderWidth:"1px",borderRadius:"lg",_hover:{shadow:"md"},children:[(0,i.jsxs)(Ew,{justify:"space-between",mb:2,children:[(0,i.jsx)(zw,{colorScheme:"purple",children:e.cat}),(0,i.jsx)(qw,{icon:(0,i.jsx)(eC,{}),size:"xs",onClick:()=>d(e.name,e.name),variant:"ghost","aria-label":"Copy"})]}),(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"600",mb:1,children:e.desc}),(0,i.jsx)(eD,{fontSize:"xs",children:e.name})]},e.name))})]})}),(0,i.jsx)(s_,{children:(0,i.jsxs)(ww,{spacing:4,align:"stretch",children:[(0,i.jsx)(jw,{size:"md",color:"red.500",children:"Common Issues"}),[{title:"iOS Device Not Detected",solutions:["Trust this computer","Reconnect USB","Check: idevice_id -l"]},{title:"Android Device Not Detected",solutions:["Enable USB Debugging","Try different port","Run: adb devices"]},{title:"Commands Not Working",solutions:["Check device connected","Verify package name","Try home command first"]}].map((e,t)=>(0,i.jsxs)(mw,{borderWidth:"1px",borderRadius:"lg",overflow:"hidden",children:[(0,i.jsxs)(Ew,{p:4,cursor:"pointer",onClick:()=>{return e="issue-".concat(t),void s(t=>p(p({},t),{},{[e]:!t[e]}));var e},_hover:{bg:c},children:[(0,i.jsx)(vC,{color:"#E53E3E"}),(0,i.jsx)(Cw,{flex:"1",fontWeight:"600",children:e.title}),a["issue-".concat(t)]?(0,i.jsx)(iC,{}):(0,i.jsx)(lC,{})]}),(0,i.jsx)(VC,{in:a["issue-".concat(t)],children:(0,i.jsx)(mw,{p:4,pt:0,children:(0,i.jsx)(aD,{spacing:2,children:e.solutions.map((e,t)=>(0,i.jsxs)(sD,{fontSize:"sm",children:[(0,i.jsx)(lD,{as:dC,color:"green.500"}),e]},t))})})})]},t))]})})]})]})})},xD=function(e){var n,r,o,a,s,l,c,d,u,h,f,m,g,v,x,b;let{onClose:y,onOpenRecordings:w,onNavigateHome:S,connectedDevices:j,initialTab:k=0}=e;const C=e=>{if("number"===typeof e)return e;if("string"===typeof e){const t=e.toLowerCase();if(t.includes("mcp")||t.includes("agent"))return 4;if(t.includes("virtual")||t.includes("emulator")||t.includes("simulator"))return 3;if(t.includes("device"))return 1;if(t.includes("guide")||t.includes("setup"))return 2;if(t.includes("ai")||t.includes("config"))return 0}return 0},[E,_]=(0,t.useState)(()=>C(k));(0,t.useEffect)(()=>{_(C(k))},[k]);const[z,R]=(0,t.useState)(()=>{try{const e=localStorage.getItem("devicely_virtual_settings");return e?JSON.parse(e):{androidSdkPath:"",wdaPath:"",headlessByDefault:!1,autoConnectAfterBoot:!0,disableAndroidAnimations:!0,prebuildWdaForSimulators:!0,showStoppedInDeviceList:!1,stopVirtualOnExit:!1,maxConcurrent:4}}catch(e){return{androidSdkPath:"",wdaPath:"",headlessByDefault:!1,autoConnectAfterBoot:!0,disableAndroidAnimations:!0,prebuildWdaForSimulators:!0,showStoppedInDeviceList:!1,stopVirtualOnExit:!1,maxConcurrent:4}}}),[A,T]=(0,t.useState)(null);(0,t.useEffect)(()=>{cD.getCapabilities().then(T).catch(()=>{})},[]);const[P,O]=(0,t.useState)({}),[L,D]=(0,t.useState)("gemini"),[I,N]=(0,t.useState)(""),[M,F]=(0,t.useState)({openai:"",gemini:"",claude:"",github:"",groq:"",cohere:"",mistral:""}),[W,B]=(0,t.useState)({openai:!1,gemini:!1,claude:!1,github:!1,groq:!1,cohere:!1,mistral:!1}),[U,V]=(0,t.useState)([]),[H,q]=(0,t.useState)({name:"",udid:"",ip:"",platform:"android"}),[$,Y]=(0,t.useState)(""),[K,X]=(0,t.useState)({running:!1,models:[],baseUrl:"",error:null,checking:!0}),[G,J]=(0,t.useState)(null),[Q,Z]=(0,t.useState)(null),[ee,te]=(0,t.useState)(!1),[ne,re]=(0,t.useState)(!1),oe=hw(),ie=Ts("gray.50","gray.900"),ae=Ts("white","gray.800"),se=Ts("gray.50","gray.700"),le=Ts("gray.200","gray.600"),ce=Ts("brand.500","brand.400"),de=Ts("gray.100","gray.700"),ue=Ts("green.50","green.900"),he=Ts("green.400","green.500"),pe=Ts("green.700","green.200"),fe=Ts("green.600","green.300"),me=Ts("blue.50","blue.900"),ge=Ts("blue.400","blue.500"),ve=Ts("blue.700","blue.200"),xe=Ts("blue.600","blue.300"),be=Ts("gray.600","gray.400");(0,t.useEffect)(()=>{we(),ye()},[]);const ye=async()=>{try{const e=await fetch(wE("/api/settings/ai-providers")),t=await e.json();t.success&&O(t.providers)}catch(e){console.error("Failed to load AI providers:",e)}},we=async()=>{try{const e=await fetch(wE("/api/settings/api-config")),t=await e.json();D(t.provider||"gemini"),N(t.model||""),F({openai:t.openai_api_key||"",gemini:t.gemini_api_key||"",claude:t.claude_api_key||"",github:t.github_token||"",groq:t.groq_api_key||"",cohere:t.cohere_api_key||"",mistral:t.mistral_api_key||""});const n=await fetch(wE("/api/settings/devices")),r=await n.json();V(r.devices||[])}catch(e){console.error("Failed to load settings:",e),oe({title:"Failed to load settings",status:"error",duration:3e3})}},Se=()=>{const e=P[L];return e?e.name:L},je=!(null===(n=P[L])||void 0===n||!n.local),ke=async()=>{X(e=>p(p({},e),{},{checking:!0}));try{const e=await fetch(wE("/api/settings/ollama/models")),t=await e.json();X(p(p({},t),{},{checking:!1})),t.baseUrl&&!$&&Y(t.baseUrl)}catch(e){X({running:!1,models:[],baseUrl:"",error:e.message,checking:!1})}};(0,t.useEffect)(()=>{je&&ke()},[je]);const Ce=()=>{if("ollama"===L)return K.models;const e=P[L];return e?e.models:[]},Ee=()=>({openai:"openai",gemini:"gemini",claude:"claude",copilot:"github",groq:"groq",cohere:"cohere",mistral:"mistral",ollama:null}[L]||"gemini"),_e=()=>{J(null),Z(null)},ze=(e,t)=>{Z(n=>p(p({},n),{},{[e]:t}))},Re=()=>{const e=Q.name.trim(),t=Q.udid.trim();if(!e||!t)return void oe({title:"Name and UDID/Serial are required",status:"warning",duration:3e3});const n=Q.ip.trim(),r=p(p({},U[G]),{},{name:e,udid:t,ip:n,platform:Q.platform,type:Q.type,connectionType:Q.type});V(U.map((e,t)=>t===G?r:e)),_e(),oe({title:"Device updated",description:'Click "Save Devices" to persist the change.',status:"success",duration:3e3})};return(0,i.jsxs)(mw,{bg:ie,minH:"100%",children:[(0,i.jsx)(mw,{borderBottom:"1px",borderColor:le,bg:ae,position:"sticky",top:0,zIndex:10,boxShadow:"sm",children:(0,i.jsx)(Vw,{maxW:"container.xl",py:4,children:(0,i.jsx)(fw,{align:"center",justify:"space-between",children:(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsx)(jw,{size:"lg",color:ce,children:"\u2699\ufe0f Settings"}),(0,i.jsx)(Cw,{fontSize:"sm",color:"gray.500",children:"Configure AI, manage devices, and view setup guide"})]})})})}),(0,i.jsx)(Vw,{maxW:"container.xl",py:8,children:(0,i.jsx)(mw,{bg:ae,borderRadius:"xl",borderWidth:"1px",borderColor:le,p:6,boxShadow:"lg",children:(0,i.jsxs)(r_,{index:E,onChange:e=>_(e),colorScheme:"blue",variant:"enclosed",children:[(0,i.jsxs)(o_,{children:[(0,i.jsx)(i_,{children:(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Qk,{}),(0,i.jsx)(Cw,{children:"AI Configuration"})]})}),(0,i.jsx)(i_,{children:(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(fk,{}),(0,i.jsx)(Cw,{children:"Device Management"})]})}),(0,i.jsx)(i_,{children:(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(hC,{}),(0,i.jsx)(Cw,{children:"Setup Guide"})]})}),(0,i.jsx)(i_,{children:(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Pk,{}),(0,i.jsx)(Cw,{children:"Virtual Devices"})]})}),(0,i.jsx)(i_,{children:(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Zj,{}),(0,i.jsx)(Cw,{children:"AI Agents (MCP)"})]})})]}),(0,i.jsxs)(a_,{children:[(0,i.jsx)(s_,{children:(0,i.jsxs)(ww,{spacing:6,align:"stretch",children:[(0,i.jsxs)(sE,{children:[(0,i.jsx)(CL,{fontWeight:"bold",fontSize:"lg",children:(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(fD,{providerId:L,fallback:null===(r=P[L])||void 0===r?void 0:r.icon,size:4}),(0,i.jsx)(Cw,{children:"AI Provider"})]})}),(0,i.jsxs)(NP,{matchWidth:!0,children:[(0,i.jsx)(WP,{as:Ww,size:"lg",w:"full",variant:"outline",fontWeight:"normal",textAlign:"left",rightIcon:(0,i.jsx)(lC,{}),children:(0,i.jsxs)(Ew,{spacing:3,children:[(0,i.jsx)(fD,{providerId:L,fallback:null===(o=P[L])||void 0===o?void 0:o.icon}),(0,i.jsx)(Cw,{children:(null===(a=P[L])||void 0===a?void 0:a.name)||"Select an AI provider"})]})}),(0,i.jsx)(HP,{maxH:"320px",overflowY:"auto",children:Object.keys(P).map(e=>(0,i.jsx)(JP,{onClick:()=>(e=>{D(e);const t=P[e];if(t&&t.models){const e=t.models.find(e=>e.default);N(e?e.id:t.models[0].id)}})(e),bg:e===L?de:void 0,children:(0,i.jsxs)(Ew,{spacing:3,children:[(0,i.jsx)(fD,{providerId:e,fallback:P[e].icon}),(0,i.jsx)(Cw,{fontWeight:e===L?"semibold":"normal",children:P[e].name})]})},e))})]}),(0,i.jsx)(Cw,{fontSize:"sm",color:"gray.500",mt:2,children:(null===(s=P[L])||void 0===s?void 0:s.description)||"Select an AI provider"})]}),Ce().length>0&&(0,i.jsxs)(sE,{children:[(0,i.jsx)(CL,{fontWeight:"bold",children:(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Fk,{}),(0,i.jsx)(Cw,{children:"Model Selection"})]})}),(0,i.jsx)(iT,{"aria-label":"AI model",value:I,onChange:e=>N(e.target.value),size:"lg",placeholder:"Select model (default will be used if empty)",children:Ce().map(e=>(0,i.jsxs)("option",{value:e.id,children:[e.name," ",e.default?"\u2b50":""," - ",e.description]},e.id))}),(0,i.jsx)(Cw,{fontSize:"sm",color:"gray.500",mt:2,children:I?"Selected: ".concat(null===(l=Ce().find(e=>e.id===I))||void 0===l?void 0:l.name):"Default model will be used"})]}),(0,i.jsx)(YA,{}),je?(0,i.jsxs)(sE,{children:[(0,i.jsx)(CL,{fontWeight:"bold",children:(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Vk,{}),(0,i.jsx)(Cw,{children:"Local Server"})]})}),(0,i.jsxs)(Ew,{spacing:3,align:"stretch",children:[(0,i.jsx)(fE,{size:"lg",fontFamily:"monospace",placeholder:"http://localhost:11434",value:$,onChange:e=>Y(e.target.value)}),(0,i.jsx)(Ww,{size:"lg",onClick:ke,isLoading:K.checking,leftIcon:(0,i.jsx)(xk,{}),children:"Test"})]}),!K.checking&&(K.running?(0,i.jsxs)(mw,{mt:3,p:4,bg:ue,borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:he,children:[(0,i.jsxs)(Ew,{children:[(0,i.jsx)(Cw,{fontSize:"lg",children:"\u2705"}),(0,i.jsxs)(Cw,{fontWeight:"bold",color:pe,children:["Ollama is running \xb7 ",K.models.length," model",1===K.models.length?"":"s"," installed"]})]}),(0,i.jsx)(Cw,{fontSize:"sm",color:fe,mt:1,children:"No API key needed \u2014 prompts stay on this machine."})]}):(0,i.jsxs)(ix,{status:"warning",mt:3,borderRadius:"lg",children:[(0,i.jsx)(ax,{}),(0,i.jsxs)(mw,{children:[(0,i.jsx)(sx,{fontSize:"sm",children:"Ollama not reachable"}),(0,i.jsxs)(lx,{fontSize:"sm",children:[K.error||"No response."," Then click Test."]})]})]})),K.running&&0===K.models.length&&(0,i.jsxs)(ix,{status:"info",mt:3,borderRadius:"lg",children:[(0,i.jsx)(ax,{}),(0,i.jsxs)(lx,{fontSize:"sm",children:["No models installed. Pull one with ",(0,i.jsx)(eD,{children:"ollama pull llama3.2"}),", then click Test."]})]}),(0,i.jsxs)(Cw,{fontSize:"sm",color:"gray.500",mt:2,children:["Don't have it?"," ",(0,i.jsxs)("a",{href:null===(c=P[L])||void 0===c?void 0:c.docsUrl,target:"_blank",rel:"noopener noreferrer",style:{color:"#3182CE",textDecoration:"underline",fontWeight:"bold"},children:[(null===(d=P[L])||void 0===d?void 0:d.docsLabel)||"Install Ollama"," \u2197"]})]})]}):(0,i.jsxs)(sE,{children:[(0,i.jsx)(CL,{fontWeight:"bold",children:(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Wk,{}),(0,i.jsx)(Cw,{children:(null===(u=P[L])||void 0===u?void 0:u.apiKeyLabel)||"API Key"})]})}),(0,i.jsxs)(YC,{size:"lg",children:[(0,i.jsx)(fE,{type:W[Ee()]?"text":"password",placeholder:(null===(h=P[L])||void 0===h?void 0:h.apiKeyPlaceholder)||"Enter API key",value:M[Ee()],onChange:e=>F(t=>p(p({},t),{},{[Ee()]:e.target.value})),pr:"4rem",fontFamily:"monospace"}),(0,i.jsx)(eE,{width:"4rem",children:(0,i.jsx)(qw,{size:"sm",icon:W[Ee()]?(0,i.jsx)(Kk,{}):(0,i.jsx)(Yk,{}),onClick:()=>(e=>{B(t=>p(p({},t),{},{[e]:!t[e]}))})(Ee()),variant:"ghost","aria-label":W[Ee()]?"Hide key":"Show key"})})]}),(0,i.jsxs)(Cw,{fontSize:"sm",color:"gray.500",mt:2,children:["Get your API key from"," ",(0,i.jsxs)("a",{href:null===(f=P[L])||void 0===f?void 0:f.docsUrl,target:"_blank",rel:"noopener noreferrer",style:{color:"#3182CE",textDecoration:"underline",fontWeight:"bold"},children:[(null===(m=P[L])||void 0===m?void 0:m.docsLabel)||"Provider Website"," \u2197"]})]})]}),!je&&M[Ee()]&&(0,i.jsx)(mw,{p:4,bg:ue,borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:he,children:(0,i.jsxs)(ww,{align:"start",spacing:2,children:[(0,i.jsxs)(Ew,{children:[(0,i.jsx)(Cw,{fontSize:"lg",children:"\u2705"}),(0,i.jsx)(Cw,{fontWeight:"bold",color:pe,children:"Configuration Ready"})]}),(0,i.jsxs)(Cw,{fontSize:"sm",color:fe,children:["Provider: ",(0,i.jsx)("strong",{children:Se()})]}),(0,i.jsxs)(Cw,{fontSize:"sm",color:fe,children:["Model: ",(0,i.jsx)("strong",{children:I||"Default"})]}),(0,i.jsxs)(Cw,{fontSize:"sm",color:fe,children:["API Key: ",(0,i.jsx)(eD,{children:M[Ee()].slice(-8)})," (last 8 chars)"]})]})}),(0,i.jsxs)(Ew,{spacing:4,children:[(0,i.jsx)(Ww,{leftIcon:(0,i.jsx)(bk,{}),colorScheme:"blue",onClick:async()=>{te(!0);try{const e={provider:L,model:I,openai_api_key:M.openai,gemini_api_key:M.gemini,claude_api_key:M.claude,github_token:M.github,groq_api_key:M.groq,cohere_api_key:M.cohere,mistral_api_key:M.mistral,ollama_base_url:$&&"http://localhost:11434"!==$?$:""};(await fetch(wE("/api/settings/api-config"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&oe({title:"AI configuration saved successfully!",description:"Using ".concat(Se()," with ").concat(I||"default model"),status:"success",duration:3e3})}catch(e){oe({title:"Failed to save AI config",description:e.message,status:"error",duration:3e3})}finally{te(!1)}},isLoading:ee,size:"lg",flex:1,children:"Save Configuration"}),(0,i.jsx)(Ww,{colorScheme:"gray",onClick:y,size:"lg",variant:"outline",children:"Close"})]}),(0,i.jsx)(YA,{}),(0,i.jsx)(mw,{p:4,bg:me,borderRadius:"lg",children:(0,i.jsxs)(ww,{align:"start",spacing:2,children:[(0,i.jsx)(Cw,{fontWeight:"bold",color:ve,children:"\ud83d\udca1 Quick Tips"}),(0,i.jsx)(Cw,{fontSize:"sm",color:xe,children:"\u2022 Free tiers available: Gemini, Groq, Cohere"}),(0,i.jsx)(Cw,{fontSize:"sm",color:xe,children:"\u2022 Fastest: Groq (\u26a1 ultra-fast inference)"}),(0,i.jsx)(Cw,{fontSize:"sm",color:xe,children:"\u2022 Best reasoning: Claude 3.5 Sonnet, GPT-4 Turbo"}),(0,i.jsx)(Cw,{fontSize:"sm",color:xe,children:"\u2022 Most cost-effective: Gemini Flash, GPT-3.5 Turbo"})]})})]})}),(0,i.jsx)(s_,{children:(0,i.jsxs)(ww,{spacing:6,align:"stretch",children:[(0,i.jsx)(mw,{p:4,bg:me,borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:ge,children:(0,i.jsxs)(Ew,{children:[(0,i.jsx)(Cw,{fontSize:"2xl",children:"\u2139\ufe0f"}),(0,i.jsxs)(ww,{align:"start",spacing:1,children:[(0,i.jsx)(Cw,{fontWeight:"bold",color:ve,children:"USB Devices Auto-Detected"}),(0,i.jsx)(Cw,{fontSize:"sm",color:xe,children:"USB-connected devices are automatically detected and saved here. Add IP addresses for wireless connection support."})]})]})}),(0,i.jsxs)(mw,{p:4,borderWidth:"1px",borderRadius:"lg",borderColor:le,bg:ae,children:[(0,i.jsx)(Ew,{justify:"space-between",mb:3,children:(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsx)(Cw,{fontWeight:"bold",children:"\ud83d\udce6 Import/Export Configuration"}),(0,i.jsx)(Cw,{fontSize:"sm",color:"gray.500",children:"Backup or restore your device configuration as JSON"})]})}),(0,i.jsxs)(Ew,{spacing:3,flexWrap:"wrap",children:[(0,i.jsx)(Ww,{leftIcon:(0,i.jsx)(Jk,{}),colorScheme:"blue",variant:"outline",onClick:async()=>{try{const e=await fetch(wE("/api/settings/devices/download")),t=await e.json(),n=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),r=window.URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download="devicely-config-".concat((new Date).toISOString().split("T")[0],".json"),document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(r),oe({title:"Config downloaded",description:"".concat(t.devices.length," device(s) exported"),status:"success",duration:3e3})}catch(e){oe({title:"Download failed",description:e.message,status:"error",duration:3e3})}},size:"sm",children:"Download Current Config"}),(0,i.jsx)(Ww,{leftIcon:(0,i.jsx)(Jk,{}),colorScheme:"purple",variant:"outline",onClick:async()=>{try{const e=await fetch(wE("/api/settings/devices/template")),t=await e.json(),n=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),r=window.URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download="devicely-config-template.json",document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(r),oe({title:"Template downloaded",description:"Edit the template and upload to add devices",status:"success",duration:3e3})}catch(e){oe({title:"Download failed",description:e.message,status:"error",duration:3e3})}},size:"sm",children:"Download Template"}),(0,i.jsxs)(Ww,{as:"label",leftIcon:(0,i.jsx)(rk,{}),colorScheme:"green",variant:"outline",isLoading:ne,cursor:"pointer",size:"sm",children:["Upload Config",(0,i.jsx)(fE,{type:"file",accept:".json",onChange:async e=>{const t=e.target.files[0];if(t){re(!0);try{const e=await t.text(),n=JSON.parse(e);if(!n.devices||!Array.isArray(n.devices))throw new Error("Invalid config format: missing devices array");const r=await fetch(wE("/api/settings/devices/upload"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),o=await r.json();if(!o.success)throw new Error(o.error||"Upload failed");await we(),oe({title:"Config uploaded successfully",description:"Imported ".concat(o.count," device(s)"),status:"success",duration:3e3})}catch(n){oe({title:"Upload failed",description:n.message,status:"error",duration:5e3})}finally{re(!1),e.target.value=""}}},display:"none"})]})]}),(0,i.jsxs)(ix,{status:"info",mt:3,fontSize:"sm",children:[(0,i.jsx)(ax,{}),(0,i.jsx)(mw,{children:(0,i.jsxs)(Cw,{fontSize:"xs",children:[(0,i.jsx)("strong",{children:"Template format:"})," Download the template to see the required JSON structure. Edit it with your devices and upload to bulk import."]})})]})]}),(0,i.jsxs)(mw,{p:4,borderWidth:"1px",borderRadius:"lg",borderColor:le,children:[(0,i.jsx)(Cw,{fontWeight:"bold",mb:3,children:"\u2795 Add New Device"}),(0,i.jsxs)(ww,{spacing:3,children:[(0,i.jsxs)(Ew,{w:"full",spacing:2,children:[(0,i.jsx)(sE,{flex:"1",children:(0,i.jsx)(fE,{placeholder:"Device Name (e.g., iPhone17)",value:H.name,onChange:e=>q(p(p({},H),{},{name:e.target.value}))})}),(0,i.jsx)(sE,{flex:"0.8",children:(0,i.jsx)(gD,{value:H.platform,onChange:e=>q(p(p({},H),{},{platform:e}))})}),(0,i.jsx)(sE,{flex:"1.2",children:(0,i.jsx)(fE,{placeholder:"UDID/Serial",value:H.udid,onChange:e=>q(p(p({},H),{},{udid:e.target.value}))})}),(0,i.jsx)(sE,{flex:"1",children:(0,i.jsx)(fE,{placeholder:"IP (for wireless)",value:H.ip,onChange:e=>q(p(p({},H),{},{ip:e.target.value}))})}),(0,i.jsx)(qw,{"aria-label":"Add device",icon:(0,i.jsx)(kk,{}),colorScheme:"green",onClick:()=>{if(H.name&&H.udid){let e=H.platform;const t=H.udid.trim();t.includes(":")&&t.match(/^\d+\.\d+\.\d+\.\d+:\d+$/)||t.length<20&&!t.includes("-")?e="android":t.includes("-")&&t.length>30&&(e="ios"),V([...U,p(p({},H),{},{platform:e})]),q({name:"",udid:"",ip:"",platform:"android"}),oe({title:"Device added",description:"Added as ".concat(e.toUpperCase(),' device. Click "Save All" to persist.'),status:"success",duration:3e3})}},isDisabled:!H.name||!H.udid})]}),(0,i.jsxs)(Cw,{fontSize:"xs",color:"gray.500",alignSelf:"flex-start",children:["iOS: Get UDID via ",(0,i.jsx)("code",{children:"idevice_id -l"})," or Xcode | Android: Get serial via ",(0,i.jsx)("code",{children:"adb devices"})]})]})]}),(0,i.jsx)(YA,{}),(0,i.jsxs)(mw,{children:[(0,i.jsxs)(Ew,{justify:"space-between",mb:3,children:[(0,i.jsx)(Cw,{fontWeight:"bold",children:"\ud83d\udcf1 Configured Devices"}),(0,i.jsxs)(zw,{colorScheme:"blue",children:[U.length," devices"]})]}),0===U.length?(0,i.jsx)(mw,{p:8,textAlign:"center",bg:se,borderRadius:"lg",children:(0,i.jsx)(Cw,{color:"gray.500",children:"No devices configured yet. Add your first device above!"})}):(0,i.jsx)(mw,{overflowX:"auto",borderWidth:"1px",borderRadius:"lg",borderColor:le,children:(0,i.jsxs)(zT,{size:"sm",variant:"simple",children:[(0,i.jsx)(RT,{bg:se,children:(0,i.jsxs)(AT,{children:[(0,i.jsx)(PT,{children:"Device Name"}),(0,i.jsx)(PT,{children:"Platform"}),(0,i.jsx)(PT,{children:"UDID/Serial"}),(0,i.jsx)(PT,{children:"IP Address"}),(0,i.jsx)(PT,{children:"Type"}),(0,i.jsx)(PT,{width:"110px",children:"Actions"})]})}),(0,i.jsx)(hP,{children:U.map((e,t)=>{const n=e.platform||"ios",r=e.connectionType||e.type||"usb",o=e.udid&&e.udid.includes(":5555"),a=o?e.udid.split(":")[0]:e.ip||"",s=G===t;return(0,i.jsxs)(AT,{children:[(0,i.jsx)(fP,{children:s?(0,i.jsx)(fE,{size:"xs",value:Q.name,onChange:e=>ze("name",e.target.value),placeholder:"Device name",autoFocus:!0}):(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"medium",children:e.name}),e.status&&(0,i.jsx)(zw,{colorScheme:"online"===e.status||"connected"===e.status?"green":"gray",fontSize:"xs",children:e.status})]})}),(0,i.jsx)(fP,{children:s?(0,i.jsx)(gD,{size:"xs",value:Q.platform,onChange:e=>ze("platform",e)}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(zw,{colorScheme:"android"===n?"green":"blue",fontSize:"xs",display:"inline-flex",alignItems:"center",gap:1,children:["android"===n?(0,i.jsx)(xE,{}):(0,i.jsx)(vE,{}),"android"===n?"Android":"iOS"]}),e.androidVersion&&(0,i.jsxs)(Cw,{fontSize:"xs",color:"gray.500",mt:1,children:["v",e.androidVersion]})]})}),(0,i.jsx)(fP,{children:s?(0,i.jsx)(fE,{size:"xs",fontFamily:"mono",value:Q.udid,onChange:e=>ze("udid",e.target.value),placeholder:"UDID / serial"}):(0,i.jsx)(Cw,{fontSize:"xs",fontFamily:"mono",wordBreak:"break-all",children:e.udid||e.serial||"-"})}),(0,i.jsx)(fP,{children:s?(0,i.jsx)(fE,{size:"xs",fontFamily:"mono",value:Q.ip,onChange:e=>ze("ip",e.target.value),placeholder:"e.g. 172.20.10.8"}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Cw,{fontSize:"xs",fontFamily:"mono",children:a||"-"}),o&&(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.500",children:"(Wireless)"})]})}),(0,i.jsx)(fP,{children:s?(0,i.jsxs)(iT,{"aria-label":"Connection type",size:"xs",value:Q.type,onChange:e=>ze("type",e.target.value),children:[(0,i.jsx)("option",{value:"usb",children:"\ud83d\udd0c USB"}),(0,i.jsx)("option",{value:"wireless",children:"\ud83d\udce1 WiFi"})]}):(0,i.jsx)(zw,{colorScheme:"usb"===r?"purple":"cyan",fontSize:"xs",children:"usb"===r?"\ud83d\udd0c USB":"\ud83d\udce1 WiFi"})}),(0,i.jsx)(fP,{children:s?(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(qw,{icon:(0,i.jsx)(cC,{}),size:"sm",colorScheme:"green",variant:"ghost",onClick:Re,"aria-label":"Apply changes to ".concat(e.name)}),(0,i.jsx)(qw,{icon:(0,i.jsx)(ek,{}),size:"sm",colorScheme:"gray",variant:"ghost",onClick:_e,"aria-label":"Cancel editing"})]}):(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(qw,{icon:(0,i.jsx)(Gk,{}),size:"sm",colorScheme:"blue",variant:"ghost",onClick:()=>(e=>{const t=U[e];J(e),Z({name:t.name||"",udid:t.udid||t.serial||"",ip:t.ip||"",platform:t.platform||"ios",type:t.type||t.connectionType||(t.ip?"wireless":"usb")})})(t),"aria-label":"Edit ".concat(e.name)}),(0,i.jsx)(qw,{icon:(0,i.jsx)(sk,{}),size:"sm",colorScheme:"red",variant:"ghost",onClick:()=>(e=>{V(U.filter((t,n)=>n!==e)),_e()})(t),"aria-label":"Remove ".concat(e.name)})]})})]},t)})})]})})]}),(0,i.jsx)(Ww,{leftIcon:(0,i.jsx)(bk,{}),colorScheme:"blue",onClick:async()=>{te(!0);try{(await fetch(wE("/api/settings/devices"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({devices:U})})).ok&&oe({title:"Devices saved",status:"success",duration:2e3})}catch(e){oe({title:"Failed to save devices",status:"error",duration:3e3})}finally{te(!1)}},isLoading:ee,alignSelf:"flex-start",children:"Save Devices"})]})}),(0,i.jsx)(s_,{children:(0,i.jsx)(vD,{connectedDevices:j})}),(0,i.jsx)(s_,{children:(0,i.jsxs)(ww,{spacing:6,align:"stretch",children:[(0,i.jsxs)(mw,{children:[(0,i.jsx)(jw,{size:"md",mb:2,children:"Virtual Devices Configuration"}),(0,i.jsx)(Cw,{fontSize:"sm",color:be,children:"Configure Android Emulators (AVD) and iOS Simulators, toolchain paths, and automation behaviors."})]}),(0,i.jsxs)(u_,{columns:{base:1,md:2},spacing:6,children:[(0,i.jsxs)(sE,{children:[(0,i.jsx)(CL,{fontSize:"sm",fontWeight:"600",children:"Android SDK Path"}),(0,i.jsx)(fE,{placeholder:(null===A||void 0===A||null===(g=A.android)||void 0===g?void 0:g.sdkPath)||"/Users/.../Library/Android/sdk",value:z.androidSdkPath,onChange:e=>R(p(p({},z),{},{androidSdkPath:e.target.value})),fontSize:"sm"}),(0,i.jsx)(lE,{fontSize:"xs",children:null!==A&&void 0!==A&&null!==(v=A.android)&&void 0!==v&&v.sdkPath?"Auto-detected: ".concat(A.android.sdkPath):"Path to your Android SDK"})]}),(0,i.jsxs)(sE,{children:[(0,i.jsx)(CL,{fontSize:"sm",fontWeight:"600",children:"WebDriverAgent Project Path (iOS)"}),(0,i.jsx)(fE,{placeholder:(null===A||void 0===A||null===(x=A.ios)||void 0===x?void 0:x.wdaPath)||"/Users/.../WebDriverAgent",value:z.wdaPath,onChange:e=>R(p(p({},z),{},{wdaPath:e.target.value})),fontSize:"sm"}),(0,i.jsx)(lE,{fontSize:"xs",children:null!==A&&void 0!==A&&null!==(b=A.ios)&&void 0!==b&&b.wdaPath?"Auto-detected: ".concat(A.ios.wdaPath):"Path containing WebDriverAgent.xcodeproj"})]})]}),(0,i.jsx)(YA,{}),(0,i.jsx)(jw,{size:"sm",children:"Lifecycle & Automation Behaviors"}),(0,i.jsxs)(u_,{columns:{base:1,md:2},spacing:4,children:[(0,i.jsxs)(Ew,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"600",children:"Auto-Connect After Boot"}),(0,i.jsx)(Cw,{fontSize:"xs",color:be,children:"Automatically start live mirror when emulator boots"})]}),(0,i.jsx)(zL,{isChecked:z.autoConnectAfterBoot,onChange:e=>R(p(p({},z),{},{autoConnectAfterBoot:e.target.checked})),colorScheme:"teal"})]}),(0,i.jsxs)(Ew,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"600",children:"Disable Android Window Animations"}),(0,i.jsx)(Cw,{fontSize:"xs",color:be,children:"Improves touch automation speed and determinism"})]}),(0,i.jsx)(zL,{isChecked:z.disableAndroidAnimations,onChange:e=>R(p(p({},z),{},{disableAndroidAnimations:e.target.checked})),colorScheme:"teal"})]}),(0,i.jsxs)(Ew,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"600",children:"Headless By Default"}),(0,i.jsx)(Cw,{fontSize:"xs",color:be,children:"Launch emulators without GUI window (-no-window)"})]}),(0,i.jsx)(zL,{isChecked:z.headlessByDefault,onChange:e=>R(p(p({},z),{},{headlessByDefault:e.target.checked})),colorScheme:"teal"})]}),(0,i.jsxs)(Ew,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"600",children:"Prebuild WDA for Simulators"}),(0,i.jsx)(Cw,{fontSize:"xs",color:be,children:"Pre-compiles WebDriverAgent cache in the background"})]}),(0,i.jsx)(zL,{isChecked:z.prebuildWdaForSimulators,onChange:e=>R(p(p({},z),{},{prebuildWdaForSimulators:e.target.checked})),colorScheme:"teal"})]})]}),(0,i.jsx)(mw,{children:(0,i.jsx)(dD,{capabilities:A,activePlatform:"android"})}),(0,i.jsx)(Ew,{justify:"flex-end",pt:4,children:(0,i.jsx)(Ww,{colorScheme:"teal",leftIcon:(0,i.jsx)(bk,{}),onClick:()=>{try{localStorage.setItem("devicely_virtual_settings",JSON.stringify(z)),oe({title:"Virtual device settings saved",status:"success",duration:2500,isClosable:!0})}catch(kF){oe({title:"Failed to save settings",description:kF.message,status:"error",duration:3e3,isClosable:!0})}},children:"Save Virtual Device Settings"})})]})}),(0,i.jsx)(s_,{children:(0,i.jsx)(hD,{connectedDevices:j})})]})]})})})]})},bD=["axis"],yD=Rv("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});yD.displayName="Center";const wD={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}},SD=(Dv(function(e,t){const{axis:n="both"}=e,r=Ki(e,bD);return(0,i.jsx)(Rv.div,p(p({ref:t,__css:wD[n]},r),{},{position:"absolute"}))}),e=>{let{output:n,onClear:r,history:o=[],isConnected:a,isCollapsed:s=!1,onToggleCollapsed:l}=e;const c=(0,t.useRef)(null),[d,u]=(0,t.useState)(""),[h,p]=(0,t.useState)("all"),[f,m]=(0,t.useState)(!0),g=Ts("gray.900","black"),v=Ts("gray.700","gray.800"),x=Ts("gray.800","gray.900"),b="gray.400",y={command:{bg:"rgba(59, 130, 246, 0.1)",text:"cyan.300",border:"blue.500",icon:"\ud83d\udcbb"},output:{bg:"rgba(34, 197, 94, 0.05)",text:"gray.300",border:"green.500",icon:"\ud83d\udcdd"},error:{bg:"rgba(239, 68, 68, 0.1)",text:"red.300",border:"red.500",icon:"\u274c"},ai_conversion:{bg:"rgba(147, 51, 234, 0.1)",text:"purple.300",border:"purple.500",icon:"\ud83e\udd16"}};(0,t.useEffect)(()=>{f&&c.current&&(c.current.scrollTop=c.current.scrollHeight)},[o,f]);const w=e=>"command"===e.type?"command":"ai_conversion"===e.type?"ai_conversion":"output"===e.type||"error"===e.type?e.text&&(e.text.includes("\u274c")||e.text.toLowerCase().includes("error"))?"error":"output":"unknown",S=o.filter(e=>!!e.type&&!!("ai_conversion"===e.type||e.text&&"string"===typeof e.text&&e.text.trim())).filter(e=>{const t=w(e);if("all"!==h){if("ai"===h&&"ai_conversion"!==t)return!1;if("command"===h&&"command"!==t)return!1;if("output"===h&&"output"!==t&&"error"!==t)return!1;if("error"===h&&"error"!==t)return!1}if(d){const t=d.toLowerCase();return!(!e.text||!e.text.toLowerCase().includes(t))||(!(!e.original||!e.original.toLowerCase().includes(t))||(!(!e.converted||!e.converted.toLowerCase().includes(t))||(!(!e.device||!e.device.toLowerCase().includes(t))||!(!e.devices||!e.devices.some(e=>e.toLowerCase().includes(t))))))}return!0}),j=[...o].reverse().find(e=>e&&(e.text||e.converted)),k=j?"ai_conversion"===j.type?"AI: ".concat(j.original," \u2192 ").concat(j.converted):String(j.text).trim().split("\n").filter(Boolean).pop()||"":"No output yet",C=o.filter(e=>"error"===w(e)).length;return(0,i.jsxs)(mw,{bg:g,overflow:"hidden",display:"flex",flexDirection:"column",h:"full",borderRadius:0,borderWidth:0,"data-testid":"terminal",children:[(0,i.jsxs)(ww,{spacing:0,bg:x,borderBottomWidth:"1px",borderColor:v,children:[(0,i.jsxs)(Ew,{w:"full",px:4,py:2,justify:"space-between",children:[(0,i.jsxs)(Ew,{as:"button",type:"button",spacing:2,minW:0,flex:"1",onClick:l,"aria-expanded":!s,"aria-controls":"terminal-body","aria-label":s?"Show log":"Hide log",textAlign:"left","data-testid":"terminal-toggle",children:[s?(0,i.jsx)(iC,{color:"#9ca3af"}):(0,i.jsx)(lC,{color:"#9ca3af"}),(0,i.jsx)(lk,{color:y.command.text}),(0,i.jsx)(Cw,{color:y.command.text,fontWeight:"600",fontSize:"sm",fontFamily:"mono",children:"Log"}),C>0&&(0,i.jsxs)(zw,{colorScheme:"red",fontSize:"9px",children:[C," error",1===C?"":"s"]}),s&&(0,i.jsx)(Cw,{fontSize:"xs",fontFamily:"mono",color:"gray.400",noOfLines:1,minW:0,"data-testid":"terminal-latest",children:k})]}),!s&&(0,i.jsxs)(Ew,{spacing:2,flexShrink:0,children:[(0,i.jsx)(zw,{colorScheme:a?"green":"red",fontSize:"9px",children:a?"Connected":"Disconnected"}),(0,i.jsxs)(zw,{colorScheme:"blue",fontSize:"9px",children:[S.length," / ",o.length]}),(0,i.jsxs)(sE,{display:"flex",alignItems:"center",children:[(0,i.jsx)(CL,{htmlFor:"auto-scroll",mb:"0",fontSize:"xs",color:"gray.400",cursor:"pointer",children:"Follow"}),(0,i.jsx)(zL,{"aria-label":"Auto-scroll",id:"auto-scroll",size:"sm",isChecked:f,onChange:e=>m(e.target.checked)})]}),(0,i.jsx)(Uj,{label:"Download Output",children:(0,i.jsx)(qw,{"aria-label":"Download log",icon:(0,i.jsx)(Jk,{}),size:"xs",variant:"ghost",colorScheme:"green",onClick:()=>{let e="";S.forEach(t=>{const n=new Date(t.timestamp).toLocaleString();"command"===t.type?e+="["+n+"] [CMD] "+(t.devices?t.devices.join(","):"ALL")+" > "+t.text+"\n":"ai_conversion"===t.type?e+="["+n+"] [AI] "+t.original+" -> "+t.converted+"\n":"output"!==t.type&&"error"!==t.type||(e+="["+n+"] ["+t.type.toUpperCase()+"] "+(t.device?t.device:"SYSTEM")+" > "+t.text.trim()+"\n")});const t=new Blob([e],{type:"text/plain"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download="devicely-terminal-"+(new Date).toISOString()+".txt",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)},isDisabled:0===S.length})}),(0,i.jsx)(Uj,{label:"Clear Terminal",children:(0,i.jsx)(qw,{"aria-label":"Clear log",icon:(0,i.jsx)(sk,{}),size:"xs",variant:"ghost",colorScheme:"red",onClick:r})})]})]}),!s&&(0,i.jsxs)(Ew,{w:"full",px:2,py:2,spacing:2,borderTopWidth:"1px",borderColor:"gray.800",bg:"rgba(0,0,0,0.2)",children:[(0,i.jsxs)(YC,{size:"xs",w:"200px",children:[(0,i.jsx)(ZC,{pointerEvents:"none",children:(0,i.jsx)(xk,{color:"gray.500"})}),(0,i.jsx)(fE,{placeholder:"Search logs...",value:d,onChange:e=>u(e.target.value),bg:"gray.800",border:"none",color:"gray.200",_focus:{bg:"gray.700"},borderRadius:"md"})]}),(0,i.jsxs)(YC,{size:"xs",w:"120px",children:[(0,i.jsx)(ZC,{pointerEvents:"none",children:(0,i.jsx)(qk,{color:"gray.500"})}),(0,i.jsxs)(iT,{"aria-label":"Filter log",value:h,onChange:e=>p(e.target.value),bg:"gray.800",border:"none",color:"gray.200",pl:8,borderRadius:"md",_focus:{bg:"gray.700"},children:[(0,i.jsx)("option",{value:"all",children:"All"}),(0,i.jsx)("option",{value:"command",children:"Commands"}),(0,i.jsx)("option",{value:"output",children:"Output"}),(0,i.jsx)("option",{value:"error",children:"Errors"}),(0,i.jsx)("option",{value:"ai",children:"AI"})]})]})]})]}),!s&&(0,i.jsx)(mw,{id:"terminal-body",ref:c,onScroll:()=>{if(c.current){const{scrollTop:e,scrollHeight:t,clientHeight:n}=c.current,r=Math.abs(t-n-e)<10;m(r)}},flex:"1",p:0,overflowY:"auto",fontFamily:"mono",fontSize:"xs",bg:g,css:{"&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-track":{background:"rgba(0,0,0,0.1)"},"&::-webkit-scrollbar-thumb":{background:"rgba(74, 222, 128, 0.3)",borderRadius:"4px"}},children:S.length>0?(0,i.jsx)(mw,{w:"full",as:"table",style:{borderCollapse:"collapse"},children:(0,i.jsx)(mw,{as:"tbody",children:S.map((e,t)=>{const n=w(e),r=y[n]||y.output;return(0,i.jsxs)(mw,{as:"tr",borderBottomWidth:"1px",borderColor:"gray.800",bg:t%2===0?"transparent":"rgba(255,255,255,0.02)",_hover:{bg:"rgba(255,255,255,0.05)"},children:[(0,i.jsx)(mw,{as:"td",p:2,verticalAlign:"top",width:"100px",color:b,whiteSpace:"nowrap",children:(o=e.timestamp,new Date(o).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}))}),(0,i.jsx)(mw,{as:"td",p:2,verticalAlign:"top",width:"40px",textAlign:"center",children:(0,i.jsx)(Uj,{label:n,children:(0,i.jsx)(Cw,{cursor:"help",children:r.icon})})}),(0,i.jsxs)(mw,{as:"td",p:2,verticalAlign:"top",width:"120px",children:["ai_conversion"===n&&(0,i.jsx)(zw,{colorScheme:"purple",variant:"outline",fontSize:"9px",children:e.provider||"AI"}),"command"===n&&e.devices&&(0,i.jsx)(zw,{colorScheme:"blue",variant:"subtle",fontSize:"9px",children:e.devices.length>1?"Multiple ("+e.devices.length+")":e.devices[0]||"Unknown"}),("output"===n||"error"===n)&&e.device&&(0,i.jsx)(zw,{colorScheme:"green",variant:"subtle",fontSize:"9px",children:e.device})]}),(0,i.jsx)(mw,{as:"td",p:2,verticalAlign:"top",color:r.text,wordBreak:"break-word",children:"ai_conversion"===n?(0,i.jsxs)(ww,{align:"start",spacing:1,children:[(0,i.jsxs)(Cw,{color:"gray.400",children:['"',e.original,'"']}),(0,i.jsxs)(Cw,{fontWeight:"600",children:["\u2192 ",e.converted]})]}):"command"===n?(0,i.jsxs)(Cw,{fontWeight:"bold",children:["$ ",e.text]}):(0,i.jsx)(mw,{as:"pre",whiteSpace:"pre-wrap",m:0,fontFamily:"inherit",children:e.text.trim()})})]},t);var o})})}):(0,i.jsxs)(yD,{h:"full",color:b,flexDirection:"column",children:[(0,i.jsx)(Cw,{fontSize:"2xl",mb:2,children:"\ud83d\udcbb"}),(0,i.jsx)(Cw,{fontStyle:"italic",children:"Terminal ready..."}),(0,i.jsx)(Cw,{fontSize:"10px",mt:1,children:"Logs will appear here"})]})})]})}),jD=e=>{let{isOpen:n,onClose:r,selectedDevice:o}=e;const[a,s]=(0,t.useState)(!1),[l,c]=(0,t.useState)(""),d=Ts("white","gray.800"),u=Ts("gray.100","gray.900");return(0,i.jsxs)(O_,{isOpen:n,onClose:r,size:"xl",scrollBehavior:"inside",children:[(0,i.jsx)(W_,{backdropFilter:"blur(10px)"}),(0,i.jsxs)(MA,{bg:d,maxH:"90vh",children:[(0,i.jsx)(WA,{children:(0,i.jsxs)(Ew,{spacing:3,children:[(0,i.jsx)(xE,{color:"green",size:24}),(0,i.jsx)(Cw,{children:"UIAutomator2 Setup Required"})]})}),(0,i.jsx)(UA,{}),(0,i.jsx)(HA,{pb:6,children:(0,i.jsxs)(ww,{spacing:4,align:"stretch",children:[(0,i.jsxs)(ix,{status:"info",borderRadius:"lg",children:[(0,i.jsx)(ax,{}),(0,i.jsxs)(mw,{children:[(0,i.jsx)(sx,{children:"Setup Required for getLocators"}),(0,i.jsxs)(lx,{fontSize:"sm",children:["The ",(0,i.jsx)(eD,{children:"getLocators"})," command requires UIAutomator2 server to be installed on your Android device."]})]})]}),(0,i.jsxs)(ix,{status:"success",borderRadius:"lg",variant:"subtle",children:[(0,i.jsx)(ax,{}),(0,i.jsxs)(mw,{children:[(0,i.jsx)(sx,{children:"Most Commands Work Without Setup!"}),(0,i.jsxs)(lx,{fontSize:"sm",children:["Commands like ",(0,i.jsx)(eD,{children:"type"}),", ",(0,i.jsx)(eD,{children:"tap"}),", ",(0,i.jsx)(eD,{children:"swipe"}),", ",(0,i.jsx)(eD,{children:"home"}),", ",(0,i.jsx)(eD,{children:"back"}),", ",(0,i.jsx)(eD,{children:"launch"}),", and ",(0,i.jsx)(eD,{children:"screenshot"})," work immediately using ADB."]})]})]}),(0,i.jsx)(YA,{}),(0,i.jsx)(mw,{p:4,borderWidth:"1px",borderRadius:"lg",borderColor:"green.500",bg:Ts("green.50","green.900"),children:(0,i.jsxs)(ww,{align:"stretch",spacing:3,children:[(0,i.jsxs)(Ew,{children:[(0,i.jsx)(zw,{colorScheme:"green",fontSize:"sm",children:"\u26a1 Fastest"}),(0,i.jsx)(Cw,{fontWeight:"bold",children:"One-Command Installation"})]}),(0,i.jsx)(Cw,{fontSize:"sm",children:"Run this command in your terminal to install UIAutomator2:"}),(0,i.jsxs)(eD,{p:3,borderRadius:"md",bg:u,fontSize:"sm",whiteSpace:"pre-wrap",children:["./install_uiautomator2.sh ",o||"100.87.246.132:5555"]}),(0,i.jsxs)(ix,{status:"warning",fontSize:"xs",borderRadius:"md",children:[(0,i.jsx)(ax,{}),(0,i.jsxs)(mw,{children:[(0,i.jsx)(sx,{fontSize:"xs",children:"Important!"}),(0,i.jsxs)(lx,{fontSize:"xs",children:['On your device, when you see the installation prompt, tap "Allow" or "Install".',(0,i.jsx)("br",{}),'On Xiaomi/MIUI: Enable "Install via USB" in Developer Options.']})]})]})]})}),(0,i.jsx)(YA,{}),(0,i.jsx)(mw,{p:4,borderWidth:"1px",borderRadius:"lg",borderColor:"purple.500",bg:Ts("purple.50","purple.900"),children:(0,i.jsxs)(ww,{align:"stretch",spacing:3,children:[(0,i.jsxs)(Ew,{children:[(0,i.jsx)(zw,{colorScheme:"purple",fontSize:"sm",children:"Alternative"}),(0,i.jsx)(Cw,{fontWeight:"bold",children:"Automatic Installation"})]}),(0,i.jsxs)(Cw,{fontSize:"sm",children:["Let Devicely attempt to install UIAutomator2 APKs automatically.",(0,i.jsx)("br",{}),(0,i.jsx)(Cw,{as:"span",fontWeight:"600",color:"orange.500",children:"Note: May fail due to device security restrictions."})]}),(0,i.jsx)(Ww,{leftIcon:a?(0,i.jsx)(Qv,{size:"sm"}):(0,i.jsx)(Jk,{}),colorScheme:"purple",onClick:async()=>{s(!0),c("Installing UIAutomator2...");try{const e=await fetch("/api/android/install-uiautomator2",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device:o})});(await e.json()).success?(c("\u2705 UIAutomator2 installed successfully!"),setTimeout(()=>{r()},2e3)):c("\u274c Installation failed. Please try manual installation.")}catch(e){c("\u274c Error: "+e.message)}finally{s(!1)}},isLoading:a,loadingText:"Installing...",isDisabled:!o,children:"Auto Install UIAutomator2"}),l&&(0,i.jsxs)(ix,{status:l.includes("\u2705")?"success":"error",borderRadius:"md",fontSize:"sm",children:[(0,i.jsx)(ax,{}),l]})]})}),(0,i.jsx)(YA,{}),(0,i.jsxs)(mw,{children:[(0,i.jsxs)(Ew,{mb:3,children:[(0,i.jsx)(lk,{}),(0,i.jsx)(Cw,{fontWeight:"bold",children:"Manual Installation"})]}),(0,i.jsxs)(ww,{align:"stretch",spacing:3,children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"600",children:"Option 1: Using NPM Package"}),(0,i.jsxs)(eD,{p:3,borderRadius:"md",bg:u,fontSize:"sm",children:["npm install -g appium-uiautomator2-driver",(0,i.jsx)("br",{}),"appium driver install uiautomator2"]}),(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"600",mt:2,children:"Option 2: Download APKs Manually"}),(0,i.jsxs)(aD,{spacing:2,fontSize:"sm",children:[(0,i.jsxs)(sD,{children:[(0,i.jsx)(lD,{as:cC,color:"green.500"}),"Download APKs from: ",(0,i.jsx)(eD,{fontSize:"xs",children:"github.com/appium/appium-uiautomator2-server/releases"})]}),(0,i.jsxs)(sD,{children:[(0,i.jsx)(lD,{as:cC,color:"green.500"}),"You need 2 files: ",(0,i.jsx)(eD,{fontSize:"xs",children:"appium-uiautomator2-server-*.apk"})," and ",(0,i.jsx)(eD,{fontSize:"xs",children:"appium-uiautomator2-server-debug-androidTest.apk"})]}),(0,i.jsxs)(sD,{children:[(0,i.jsx)(lD,{as:cC,color:"green.500"}),"Install using ADB:"]})]}),(0,i.jsx)(eD,{p:3,borderRadius:"md",bg:u,fontSize:"xs",whiteSpace:"pre-wrap",children:"adb install appium-uiautomator2-server-v*.apk\nadb install appium-uiautomator2-server-debug-androidTest.apk"}),(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"600",mt:2,children:"Option 3: Using Appium"}),(0,i.jsxs)(eD,{p:3,borderRadius:"md",bg:u,fontSize:"sm",children:["npm install -g appium",(0,i.jsx)("br",{}),"appium driver install uiautomator2"]})]})]}),(0,i.jsx)(YA,{}),(0,i.jsxs)(mw,{children:[(0,i.jsxs)(Ew,{mb:3,children:[(0,i.jsx)(vC,{}),(0,i.jsx)(Cw,{fontWeight:"bold",children:"Verify Installation"})]}),(0,i.jsxs)(Cw,{fontSize:"sm",mb:2,children:["After installation, run the ",(0,i.jsx)(eD,{children:"getLocators"})," command again to verify it works."]}),(0,i.jsx)(eD,{p:3,borderRadius:"md",bg:u,fontSize:"sm",children:"getLocators"})]}),(0,i.jsxs)(ix,{status:"info",borderRadius:"lg",variant:"left-accent",children:[(0,i.jsx)(ax,{}),(0,i.jsxs)(mw,{fontSize:"sm",children:[(0,i.jsx)(sx,{fontSize:"sm",children:"Why UIAutomator2?"}),(0,i.jsx)(lx,{fontSize:"xs",children:"UIAutomator2 provides advanced UI element inspection, allowing you to get all UI elements with their properties, which is essential for building robust automation scripts."})]})]}),(0,i.jsxs)(Ew,{justify:"flex-end",pt:2,children:[(0,i.jsx)(Ww,{variant:"ghost",onClick:r,children:"Close"}),(0,i.jsx)(Ww,{colorScheme:"brand",onClick:()=>{r(),window.open("https://github.com/appium/appium-uiautomator2-server/releases","_blank")},children:"Download APKs"})]})]})})]})]})},kD=e=>{let{selectedDevices:n,onGetLocators:r,onReset:o,elements:a,isLoading:s}=e;const[l,c]=(0,t.useState)(""),[d,u]=(0,t.useState)("all"),[h,p]=(0,t.useState)(null),[f,m]=(0,t.useState)(null),[g,v]=(0,t.useState)(""),{isOpen:x,onClose:b}=Yw(),y=Ts("white","gray.800"),w=Ts("gray.200","gray.700"),S=Ts("purple.500","purple.600"),j=Ts("blue.50","blue.900"),k=a.filter(e=>{const t=e.type&&!["XCUIElementTypeApplication","XCUIElementTypeWindow","XCUIElementTypeScrollView","XCUIElementTypeCollectionView","XCUIElementTypeTableView","XCUIElementTypeNavigationBar","XCUIElementTypeTabBar","XCUIElementTypeStatusBar","XCUIElementTypeOther"].includes(e.type),n=e.width>20&&e.height>20,r=e.label&&"Unlabeled"!==e.label&&e.label.trim().length>0,o=!l||e.name&&e.name.toLowerCase().includes(l.toLowerCase())||e.label&&e.label.toLowerCase().includes(l.toLowerCase())||e.type&&e.type.toLowerCase().includes(l.toLowerCase())||e.text&&e.text.toLowerCase().includes(l.toLowerCase()),i="all"===d||e.type===d;return t&&n&&r&&o&&i}),C=["all",...new Set(a.map(e=>e.type).filter(Boolean))],E=async()=>{try{const e=await fetch("".concat(yE,"/api/commander/status")),t=await e.json();if(t.isActive&&t.commander)return v(t.commander),void r(t.commander)}catch(e){console.info("Commander not active, falling back to selected devices")}0!==n.length&&(n.length,v(n[0]),r(n[0]))},_=hw(),z=e=>{const t=(e.name||e.label||e.text||"").trim(),n=Math.round(e.x+(e.width||0)/2),r=Math.round(e.y+(e.height||0)/2),o="".concat(n,",").concat(r);return{cli:t?'devicely click "'.concat(t,'"'):"devicely tap ".concat(o),wdio:t?"$('~".concat(t,"').click();"):e.xpath?"$('".concat(e.xpath,"').click();"):"browser.touchAction({ action: 'tap', x: ".concat(n,", y: ").concat(r," });"),python:t?'driver.find_element(AppiumBy.ACCESSIBILITY_ID, "'.concat(t,'").click()'):e.xpath?'driver.find_element(AppiumBy.XPATH, "'.concat(e.xpath,'").click()'):"driver.tap([(".concat(o,")])"),java:t?'driver.findElement(AppiumBy.accessibilityId("'.concat(t,'")).click();'):e.xpath?'driver.findElement(By.xpath("'.concat(e.xpath,'")).click();'):"// tap at ".concat(o)}},R=(e,t)=>{var n;null!==(n=navigator.clipboard)&&void 0!==n&&n.writeText&&navigator.clipboard.writeText(e),_({title:"Copied ".concat(t," snippet"),description:e,status:"success",duration:2e3})};return(0,i.jsxs)(mw,{bg:y,borderRadius:"2xl",borderWidth:"1px",borderColor:w,overflow:"hidden",boxShadow:"lg",children:[(0,i.jsx)(mw,{bg:S,px:4,py:3,children:(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Yk,{color:"white",size:20}),(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsx)(Cw,{color:"white",fontWeight:"bold",fontSize:"md",children:"UI Locator Inspector"}),g&&(0,i.jsxs)(Cw,{color:"whiteAlpha.800",fontSize:"xs",children:["Device: ",g]})]}),(0,i.jsxs)(zw,{colorScheme:"purple",fontSize:"9px",children:[a.length," elements"]})]}),(0,i.jsxs)(Ew,{spacing:2,children:[a.length>0&&(0,i.jsx)(Uj,{label:"Clear Elements",children:(0,i.jsx)(qw,{"aria-label":"Clear locators",icon:(0,i.jsx)(ek,{}),size:"sm",colorScheme:"red",variant:"solid",onClick:o})}),(0,i.jsx)(Uj,{label:"Refresh Elements",children:(0,i.jsx)(qw,{"aria-label":"Refresh locators",icon:s?(0,i.jsx)(Qv,{size:"sm"}):(0,i.jsx)(Sk,{}),size:"sm",colorScheme:"green",variant:"solid",onClick:E,isDisabled:s})})]})]})}),(0,i.jsx)(mw,{p:4,borderBottomWidth:"1px",borderColor:w,children:(0,i.jsxs)(ww,{spacing:3,children:[0===a.length&&(0,i.jsx)(ww,{spacing:2,w:"full",children:(0,i.jsx)(Ww,{leftIcon:(0,i.jsx)(Yk,{}),colorScheme:"purple",size:"sm",onClick:E,isLoading:s,w:"full",borderRadius:"lg",children:"Get UI Elements (Commander)"})}),(0,i.jsxs)(YC,{size:"sm",children:[(0,i.jsx)(ZC,{pointerEvents:"none",children:(0,i.jsx)(xk,{})}),(0,i.jsx)(fE,{placeholder:"Search elements...",value:l,onChange:e=>c(e.target.value),borderRadius:"lg"})]}),a.length>0&&(0,i.jsx)(iT,{"aria-label":"Filter element type",size:"sm",value:d,onChange:e=>u(e.target.value),borderRadius:"lg",children:C.map(e=>(0,i.jsx)("option",{value:e,children:"all"===e?"All Types":e},e))})]})}),(0,i.jsx)(mw,{maxH:"500px",overflowY:"auto",p:2,children:s?(0,i.jsxs)(mw,{p:8,textAlign:"center",children:[(0,i.jsx)(Qv,{size:"lg",color:"purple.500",mb:3}),(0,i.jsx)(Cw,{fontSize:"sm",color:"gray.500",children:"Fetching UI elements..."})]}):0===k.length?(0,i.jsx)(mw,{p:8,textAlign:"center",children:(0,i.jsx)(Cw,{color:"gray.500",fontSize:"sm",children:0===a.length?'No elements loaded. Click "Get UI Elements" to fetch.':"No elements match your search."})}):(0,i.jsx)(ww,{spacing:1,align:"stretch",children:k.map((e,t)=>(0,i.jsxs)(mw,{p:2,borderRadius:"md",borderWidth:"1px",borderColor:h===e?"purple.400":w,bg:h===e?j:"transparent",transition:"all 0.2s",_hover:{borderColor:"purple.300",bg:j},children:[(0,i.jsxs)(Ew,{spacing:2,justify:"space-between",children:[(0,i.jsxs)(Ew,{spacing:2,flex:"0 0 auto",children:[(0,i.jsx)(Uj,{label:"Tap Element",children:(0,i.jsx)(qw,{"aria-label":"Tap element",icon:f===e?(0,i.jsx)(Qv,{size:"xs"}):(0,i.jsx)(Rk,{}),size:"xs",colorScheme:"purple",variant:"solid",onClick:t=>{t.stopPropagation(),(async e=>{if(n.length){m(e);try{const t=await fetch("".concat(yE,"/api/locators/click"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceName:n[0],x:e.x,y:e.y})}),r=await t.json();r.success||console.error("Tap failed:",r.error)}catch(t){console.error("Tap error:",t)}finally{m(null)}}})(e)},isDisabled:!e.x||!e.y||null!==f})}),(0,i.jsx)(zw,{colorScheme:"purple",fontSize:"9px",px:2,children:e.type||"N/A"})]}),(0,i.jsx)(Cw,{fontSize:"xs",fontWeight:"600",noOfLines:1,flex:"1",minW:"0",children:e.label||e.name||e.text||"Unnamed"}),(0,i.jsxs)(Ew,{spacing:1,flex:"0 0 auto",children:[(0,i.jsx)(Uj,{label:e.visible?"Visible":"Hidden",children:(0,i.jsx)(mw,{children:(0,i.jsx)(Kv,{as:e.visible?Yk:Kk,boxSize:3,color:e.visible?"green.500":"gray.400"})})}),(0,i.jsx)(Uj,{label:e.enabled?"Enabled":"Disabled",children:(0,i.jsx)(mw,{children:(0,i.jsx)(Kv,{as:e.enabled?dC:tk,boxSize:3,color:e.enabled?"green.500":"gray.400"})})}),(0,i.jsx)(Uj,{label:"Show Details",children:(0,i.jsx)(qw,{"aria-label":"Element details",icon:(0,i.jsx)(Bk,{}),size:"xs",variant:"ghost",colorScheme:"blue",onClick:t=>{t.stopPropagation(),p(h===e?null:e)}})}),(0,i.jsx)(Uj,{label:"Copy Locator",children:(0,i.jsx)(qw,{"aria-label":"Copy locator",icon:(0,i.jsx)(eC,{}),size:"xs",variant:"ghost",colorScheme:"purple",onClick:t=>{t.stopPropagation(),(e=>{var t;const n=e.name||e.label||e.xpath;null!==(t=navigator.clipboard)&&void 0!==t&&t.writeText&&navigator.clipboard.writeText(n),_({title:"Copied Locator",description:n,status:"info",duration:1500})})(e)}})})]})]}),h===e&&(0,i.jsx)(mw,{mt:2,pt:2,borderTopWidth:"1px",borderColor:w,children:(0,i.jsxs)(ww,{align:"stretch",spacing:1,fontSize:"10px",children:[e.name&&(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsx)(Cw,{fontWeight:"600",color:"gray.600",children:"Name:"}),(0,i.jsx)(eD,{fontSize:"9px",px:2,children:e.name})]}),e.label&&e.label!==e.name&&(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsx)(Cw,{fontWeight:"600",color:"gray.600",children:"Label:"}),(0,i.jsx)(eD,{fontSize:"9px",px:2,children:e.label})]}),e.text&&e.text!==e.name&&e.text!==e.label&&(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsx)(Cw,{fontWeight:"600",color:"gray.600",children:"Text:"}),(0,i.jsx)(eD,{fontSize:"9px",px:2,children:e.text})]}),e.value&&(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsx)(Cw,{fontWeight:"600",color:"gray.600",children:"Value:"}),(0,i.jsx)(eD,{fontSize:"9px",px:2,children:e.value})]}),e.x&&e.y&&(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsx)(Cw,{fontWeight:"600",color:"gray.600",children:"Position:"}),(0,i.jsxs)(eD,{fontSize:"9px",px:2,children:["(",e.x,", ",e.y,")"]})]}),e.width&&e.height&&(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsx)(Cw,{fontWeight:"600",color:"gray.600",children:"Size:"}),(0,i.jsxs)(eD,{fontSize:"9px",px:2,children:[e.width,"x",e.height]})]}),e.coordinates&&(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsx)(Cw,{fontWeight:"600",color:"gray.600",children:"Position:"}),(0,i.jsx)(eD,{fontSize:"9px",px:2,children:e.coordinates})]}),e.xpath&&(0,i.jsxs)(mw,{children:[(0,i.jsx)(Cw,{fontWeight:"600",color:"gray.600",mb:1,children:"XPath:"}),(0,i.jsx)(eD,{fontSize:"9px",w:"full",p:2,noOfLines:2,children:e.xpath})]}),(0,i.jsxs)(mw,{pt:2,mt:1,borderTop:"1px dashed",borderColor:w,children:[(0,i.jsx)(Cw,{fontWeight:"600",color:"purple.500",fontSize:"10px",mb:1,children:"Copy as Code:"}),(0,i.jsxs)(u_,{columns:2,spacing:1,children:[(0,i.jsx)(Ww,{size:"xs",fontSize:"9px",h:"22px",variant:"outline",colorScheme:"purple",leftIcon:(0,i.jsx)(eC,{size:10}),onClick:t=>{t.stopPropagation(),R(z(e).cli,"Devicely CLI")},children:"Devicely CLI"}),(0,i.jsx)(Ww,{size:"xs",fontSize:"9px",h:"22px",variant:"outline",colorScheme:"blue",leftIcon:(0,i.jsx)(eC,{size:10}),onClick:t=>{t.stopPropagation(),R(z(e).wdio,"WebdriverIO")},children:"WebdriverIO"}),(0,i.jsx)(Ww,{size:"xs",fontSize:"9px",h:"22px",variant:"outline",colorScheme:"yellow",leftIcon:(0,i.jsx)(eC,{size:10}),onClick:t=>{t.stopPropagation(),R(z(e).python,"Python Appium")},children:"Python Appium"}),(0,i.jsx)(Ww,{size:"xs",fontSize:"9px",h:"22px",variant:"outline",colorScheme:"orange",leftIcon:(0,i.jsx)(eC,{size:10}),onClick:t=>{t.stopPropagation(),R(z(e).java,"Java Appium")},children:"Java Appium"})]})]})]})})]},t))})}),(0,i.jsx)(jD,{isOpen:x,onClose:b,selectedDevice:n.length>0?n[0]:null})]})},[CD,ED]=Rc({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[_D,zD]=Rc({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[RD,AD,TD,PD]=DE(),OD=["onChange","defaultIndex","index","allowMultiple","allowToggle"],LD=["isDisabled","isFocusable","id"];function DD(e){const{onChange:n,defaultIndex:r,index:o,allowMultiple:i,allowToggle:a}=e,s=Ki(e,OD);!function(e){const t=e.index||e.defaultIndex,n=null!=t&&!Array.isArray(t)&&e.allowMultiple;AC({condition:!!n,message:"If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ".concat(typeof t,",")})}(e),function(e){AC({condition:!(!e.allowMultiple||!e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}(e);const l=TD(),[c,d]=(0,t.useState)(-1);(0,t.useEffect)(()=>()=>{d(-1)},[]);const[u,h]=EE({value:o,defaultValue:()=>i?null!==r&&void 0!==r?r:[]:null!==r&&void 0!==r?r:-1,onChange:n});return{index:u,setIndex:h,htmlProps:s,getAccordionItemProps:e=>{let t=!1;null!==e&&(t=Array.isArray(u)?u.includes(e):u===e);return{isOpen:t,onChange:t=>{if(null!==e)if(i&&Array.isArray(u)){const n=t?u.concat(e):u.filter(t=>t!==e);h(n)}else t?h(e):a&&h(-1)}}},focusedIndex:c,setFocusedIndex:d,descendants:l}}const[ID,ND]=Rc({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function MD(e){const{isDisabled:n,isFocusable:r,id:o}=e,i=Ki(e,LD),{getAccordionItemProps:a,setFocusedIndex:s}=ND(),l=(0,t.useRef)(null),c=(0,t.useId)(),d=null!==o&&void 0!==o?o:c,u="accordion-button-".concat(d),h="accordion-panel-".concat(d);!function(e){AC({condition:!(!e.isFocusable||e.isDisabled),message:"Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well.\n "})}(e);const{register:f,index:m,descendants:g}=PD({disabled:n&&!r}),{isOpen:v,onChange:x}=a(-1===m?null:m);!function(e){AC({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}({isOpen:v,isDisabled:n});const b=(0,t.useCallback)(()=>{null===x||void 0===x||x(!v),s(m)},[m,s,v,x]),y=(0,t.useCallback)(e=>{const t={ArrowDown:()=>{const e=g.nextEnabled(m);null===e||void 0===e||e.node.focus()},ArrowUp:()=>{const e=g.prevEnabled(m);null===e||void 0===e||e.node.focus()},Home:()=>{const e=g.firstEnabled();null===e||void 0===e||e.node.focus()},End:()=>{const e=g.lastEnabled();null===e||void 0===e||e.node.focus()}},n=t[e.key];n&&(e.preventDefault(),n(e))},[g,m]),w=(0,t.useCallback)(()=>{s(m)},[s,m]),S=(0,t.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},e),{},{type:"button",ref:Rw(f,l,t),id:u,disabled:!!n,"aria-expanded":!!v,"aria-controls":h,onClick:Jw(e.onClick,b),onFocus:Jw(e.onFocus,w),onKeyDown:Jw(e.onKeyDown,y)})},[u,n,v,b,w,y,h,f]),j=(0,t.useCallback)(function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{ref:e,role:"region",id:h,"aria-labelledby":u,hidden:!v})},[u,v,h]);return{isOpen:v,isDisabled:n,isFocusable:r,onOpen:()=>{null===x||void 0===x||x(!0)},onClose:()=>{null===x||void 0===x||x(!1)},getButtonProps:S,getPanelProps:j,htmlProps:i}}const FD=["children","reduceMotion"],WD=["htmlProps","descendants"],BD=Dv(function(e,n){let{children:r,reduceMotion:o}=e,a=Ki(e,FD);const s=qv("Accordion",a),l=DD(Ov(a)),{htmlProps:c,descendants:d}=l,u=Ki(l,WD),h=(0,t.useMemo)(()=>p(p({},u),{},{reduceMotion:!!o}),[u,o]);return(0,i.jsx)(RD,{value:d,children:(0,i.jsx)(ID,{value:h,children:(0,i.jsx)(CD,{value:s,children:(0,i.jsx)(Rv.div,p(p({ref:n},c),{},{className:Lv("chakra-accordion",a.className),__css:s.root,children:r}))})})})});BD.displayName="Accordion";const UD=["htmlProps"],VD=Dv(function(e,n){const{children:r,className:o}=e,a=MD(e),{htmlProps:s}=a,l=Ki(a,UD),c=p(p({},ED().container),{},{overflowAnchor:"none"}),d=(0,t.useMemo)(()=>l,[l]);return(0,i.jsx)(_D,{value:d,children:(0,i.jsx)(Rv.div,p(p({ref:n},s),{},{className:Lv("chakra-accordion__item",o),__css:c,children:"function"===typeof r?r({isExpanded:!!l.isOpen,isDisabled:!!l.isDisabled}):r}))})});VD.displayName="AccordionItem";const HD=Dv(function(e,t){const{getButtonProps:n}=zD(),r=n(e,t),o=p({display:"flex",alignItems:"center",width:"100%",outline:0},ED().button);return(0,i.jsx)(Rv.button,p(p({},r),{},{className:Lv("chakra-accordion__button",e.className),__css:o}))});function qD(e){const{isOpen:t,isDisabled:n}=zD(),{reduceMotion:r}=ND(),o=Lv("chakra-accordion__icon",e.className),a=p({opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center"},ED().icon);return(0,i.jsx)(Kv,p(p({viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:a},e),{},{children:(0,i.jsx)("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}))}HD.displayName="AccordionButton",qD.displayName="AccordionIcon";const $D=["className","motionProps"],YD=Dv(function(e,t){const{className:n,motionProps:r}=e,o=Ki(e,$D),{reduceMotion:a}=ND(),{getPanelProps:s,isOpen:l}=zD(),c=s(o,t),d=Lv("chakra-accordion__panel",n),u=ED();a||delete c.hidden;const h=(0,i.jsx)(Rv.div,p(p({},c),{},{__css:u.panel,className:d}));return a?h:(0,i.jsx)(VC,p(p({in:l},r),{},{children:h}))});YD.displayName="AccordionPanel";const KD=()=>{const e=Ts("white","gray.800"),t=Ts("gray.200","gray.700"),n=Ts("blue.500","blue.600"),r=Ts("gray.50","gray.900");return(0,i.jsxs)(mw,{bg:e,borderRadius:"2xl",borderWidth:"1px",borderColor:t,overflow:"hidden",boxShadow:"lg",children:[(0,i.jsx)(mw,{bg:n,px:4,py:3,children:(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Bk,{color:"white",size:20}),(0,i.jsx)(Cw,{fontSize:"lg",fontWeight:"bold",color:"white",children:"Setup Guide & Information"})]})}),(0,i.jsx)(mw,{p:6,maxH:"600px",overflowY:"auto",children:(0,i.jsxs)(ww,{spacing:6,align:"stretch",children:[(0,i.jsxs)(mw,{children:[(0,i.jsx)(jw,{size:"md",mb:3,children:"\ud83d\ude80 Quick Start"}),(0,i.jsxs)(ww,{align:"stretch",spacing:2,bg:r,p:4,borderRadius:"lg",children:[(0,i.jsxs)(Ew,{children:[(0,i.jsx)(dC,{color:"green"}),(0,i.jsx)(Cw,{fontSize:"sm",children:"Connect your device via USB or WiFi"})]}),(0,i.jsxs)(Ew,{children:[(0,i.jsx)(dC,{color:"green"}),(0,i.jsx)(Cw,{fontSize:"sm",children:'Click "Connect" on the device card'})]}),(0,i.jsxs)(Ew,{children:[(0,i.jsx)(dC,{color:"green"}),(0,i.jsx)(Cw,{fontSize:"sm",children:"Select the device (turns blue)"})]}),(0,i.jsxs)(Ew,{children:[(0,i.jsx)(dC,{color:"green"}),(0,i.jsx)(Cw,{fontSize:"sm",children:"Type commands or use AI mode"})]}),(0,i.jsxs)(Ew,{children:[(0,i.jsx)(dC,{color:"green"}),(0,i.jsx)(Cw,{fontSize:"sm",children:"See results in Terminal tab"})]})]})]}),(0,i.jsxs)(BD,{allowMultiple:!0,defaultIndex:[0],children:[(0,i.jsxs)(VD,{children:[(0,i.jsxs)(HD,{bg:r,children:[(0,i.jsx)(mw,{flex:"1",textAlign:"left",fontWeight:"600",children:"\ud83d\udd27 Prerequisites"}),(0,i.jsx)(qD,{})]}),(0,i.jsx)(YD,{pb:4,children:(0,i.jsxs)(ww,{align:"stretch",spacing:3,children:[(0,i.jsxs)(mw,{children:[(0,i.jsx)(Cw,{fontWeight:"600",fontSize:"sm",mb:1,children:"For Android:"}),(0,i.jsx)(eD,{display:"block",p:2,mb:1,children:"brew install android-platform-tools"}),(0,i.jsx)(eD,{display:"block",p:2,children:"adb devices"})]}),(0,i.jsxs)(mw,{children:[(0,i.jsx)(Cw,{fontWeight:"600",fontSize:"sm",mb:1,children:"For iOS (macOS only):"}),(0,i.jsx)(eD,{display:"block",p:2,mb:1,children:"brew install libimobiledevice"}),(0,i.jsx)(eD,{display:"block",p:2,children:"idevice_id -l"})]})]})})]}),(0,i.jsxs)(VD,{children:[(0,i.jsxs)(HD,{bg:r,children:[(0,i.jsx)(mw,{flex:"1",textAlign:"left",fontWeight:"600",children:"\ud83d\udcf1 Common Commands"}),(0,i.jsx)(qD,{})]}),(0,i.jsx)(YD,{pb:4,children:(0,i.jsxs)(zT,{size:"sm",variant:"simple",children:[(0,i.jsx)(RT,{children:(0,i.jsxs)(AT,{children:[(0,i.jsx)(PT,{children:"Command"}),(0,i.jsx)(PT,{children:"Description"})]})}),(0,i.jsxs)(hP,{children:[(0,i.jsxs)(AT,{children:[(0,i.jsx)(fP,{children:(0,i.jsx)(eD,{children:"screenshot"})}),(0,i.jsx)(fP,{children:"Take a screenshot"})]}),(0,i.jsxs)(AT,{children:[(0,i.jsx)(fP,{children:(0,i.jsx)(eD,{children:"home"})}),(0,i.jsx)(fP,{children:"Press home button"})]}),(0,i.jsxs)(AT,{children:[(0,i.jsx)(fP,{children:(0,i.jsx)(eD,{children:"back"})}),(0,i.jsx)(fP,{children:"Press back (Android)"})]}),(0,i.jsxs)(AT,{children:[(0,i.jsx)(fP,{children:(0,i.jsx)(eD,{children:"swipe up"})}),(0,i.jsx)(fP,{children:"Swipe up gesture"})]}),(0,i.jsxs)(AT,{children:[(0,i.jsx)(fP,{children:(0,i.jsx)(eD,{children:"tap 500,300"})}),(0,i.jsx)(fP,{children:"Tap at coordinates"})]}),(0,i.jsxs)(AT,{children:[(0,i.jsx)(fP,{children:(0,i.jsx)(eD,{children:'type "text"'})}),(0,i.jsx)(fP,{children:"Type text on device"})]}),(0,i.jsxs)(AT,{children:[(0,i.jsx)(fP,{children:(0,i.jsx)(eD,{children:"launch app"})}),(0,i.jsx)(fP,{children:"Launch application"})]}),(0,i.jsxs)(AT,{children:[(0,i.jsx)(fP,{children:(0,i.jsx)(eD,{children:"wait 5"})}),(0,i.jsx)(fP,{children:"Wait 5 seconds"})]})]})]})})]}),(0,i.jsxs)(VD,{children:[(0,i.jsxs)(HD,{bg:r,children:[(0,i.jsx)(mw,{flex:"1",textAlign:"left",fontWeight:"600",children:"\ud83e\udd16 Android Commands"}),(0,i.jsx)(qD,{})]}),(0,i.jsx)(YD,{pb:4,children:(0,i.jsxs)(zT,{size:"sm",variant:"simple",children:[(0,i.jsx)(RT,{children:(0,i.jsxs)(AT,{children:[(0,i.jsx)(PT,{children:"Command"}),(0,i.jsx)(PT,{children:"Description"})]})}),(0,i.jsxs)(hP,{children:[(0,i.jsxs)(AT,{children:[(0,i.jsx)(fP,{children:(0,i.jsx)(eD,{children:"lock"})}),(0,i.jsx)(fP,{children:"Lock device"})]}),(0,i.jsxs)(AT,{children:[(0,i.jsx)(fP,{children:(0,i.jsx)(eD,{children:"unlock"})}),(0,i.jsx)(fP,{children:"Unlock device"})]}),(0,i.jsxs)(AT,{children:[(0,i.jsx)(fP,{children:(0,i.jsx)(eD,{children:"info"})}),(0,i.jsx)(fP,{children:"Get device info"})]}),(0,i.jsxs)(AT,{children:[(0,i.jsx)(fP,{children:(0,i.jsx)(eD,{children:"listapps"})}),(0,i.jsx)(fP,{children:"List installed apps"})]}),(0,i.jsxs)(AT,{children:[(0,i.jsx)(fP,{children:(0,i.jsx)(eD,{children:"getLocators"})}),(0,i.jsx)(fP,{children:"Get UI elements"})]})]})]})})]}),(0,i.jsxs)(VD,{children:[(0,i.jsxs)(HD,{bg:r,children:[(0,i.jsx)(mw,{flex:"1",textAlign:"left",fontWeight:"600",children:"\ud83d\udc1b Troubleshooting"}),(0,i.jsx)(qD,{})]}),(0,i.jsx)(YD,{pb:4,children:(0,i.jsxs)(ww,{align:"stretch",spacing:3,children:[(0,i.jsxs)(mw,{children:[(0,i.jsx)(Cw,{fontWeight:"600",fontSize:"sm",mb:1,children:"Device not detected (Android):"}),(0,i.jsx)(eD,{display:"block",p:2,children:"adb kill-server && adb start-server"})]}),(0,i.jsxs)(mw,{children:[(0,i.jsx)(Cw,{fontWeight:"600",fontSize:"sm",mb:1,children:"Device not detected (iOS):"}),(0,i.jsx)(eD,{display:"block",p:2,children:"brew reinstall libimobiledevice"})]}),(0,i.jsxs)(mw,{children:[(0,i.jsx)(Cw,{fontWeight:"600",fontSize:"sm",mb:1,children:"Port already in use:"}),(0,i.jsx)(eD,{display:"block",p:2,children:"lsof -i :3001 | grep LISTEN"}),(0,i.jsx)(eD,{display:"block",p:2,mt:1,children:"kill -9 <PID>"})]})]})})]})]}),(0,i.jsxs)(mw,{children:[(0,i.jsx)(jw,{size:"md",mb:3,children:"\u2139\ufe0f System Information"}),(0,i.jsxs)(ww,{align:"stretch",spacing:2,bg:r,p:4,borderRadius:"lg",children:[(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsx)(Cw,{fontSize:"sm",children:"Backend URL:"}),(0,i.jsx)(zw,{children:"http://localhost:3001"})]}),(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsx)(Cw,{fontSize:"sm",children:"WebSocket:"}),(0,i.jsx)(zw,{colorScheme:"green",children:"Connected"})]}),(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsx)(Cw,{fontSize:"sm",children:"Platform:"}),(0,i.jsx)(zw,{children:navigator.platform})]})]})]})]})})]})};function XD(e,t){return function(){return e.apply(t,arguments)}}const{toString:GD}=Object.prototype,{getPrototypeOf:JD}=Object,{iterator:QD,toStringTag:ZD}=Symbol,eI=(tI=Object.create(null),e=>{const t=GD.call(e);return tI[t]||(tI[t]=t.slice(8,-1).toLowerCase())});var tI;const nI=e=>(e=e.toLowerCase(),t=>eI(t)===e),rI=e=>t=>typeof t===e,{isArray:oI}=Array,iI=rI("undefined");function aI(e){return null!==e&&!iI(e)&&null!==e.constructor&&!iI(e.constructor)&&cI(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const sI=nI("ArrayBuffer");const lI=rI("string"),cI=rI("function"),dI=rI("number"),uI=e=>null!==e&&"object"===typeof e,hI=e=>{if("object"!==eI(e))return!1;const t=JD(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(ZD in e)&&!(QD in e)},pI=nI("Date"),fI=nI("File"),mI=nI("Blob"),gI=nI("FileList");const vI="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:{},xI="undefined"!==typeof vI.FormData?vI.FormData:void 0,bI=nI("URLSearchParams"),[yI,wI,SI,jI]=["ReadableStream","Request","Response","Headers"].map(nI);function kI(e,t){let n,r,{allOwnKeys:o=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),oI(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{if(aI(e))return;const r=o?Object.getOwnPropertyNames(e):Object.keys(e),i=r.length;let a;for(n=0;n<i;n++)a=r[n],t.call(null,e[a],a,e)}}function CI(e,t){if(aI(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const EI="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:n.g,_I=e=>!iI(e)&&e!==EI;const zI=(RI="undefined"!==typeof Uint8Array&&JD(Uint8Array),e=>RI&&e instanceof RI);var RI;const AI=nI("HTMLFormElement"),TI=(e=>{let{hasOwnProperty:t}=e;return(e,n)=>t.call(e,n)})(Object.prototype),PI=nI("RegExp"),OI=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};kI(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const LI=nI("AsyncFunction"),DI=(II="function"===typeof setImmediate,NI=cI(EI.postMessage),II?setImmediate:NI?((e,t)=>(EI.addEventListener("message",n=>{let{source:r,data:o}=n;r===EI&&o===e&&t.length&&t.shift()()},!1),n=>{t.push(n),EI.postMessage(e,"*")}))("axios@".concat(Math.random()),[]):e=>setTimeout(e));var II,NI;const MI="undefined"!==typeof queueMicrotask?queueMicrotask.bind(EI):"undefined"!==typeof process&&process.nextTick||DI,FI={isArray:oI,isArrayBuffer:sI,isBuffer:aI,isFormData:e=>{let t;return e&&(xI&&e instanceof xI||cI(e.append)&&("formdata"===(t=eI(e))||"object"===t&&cI(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&sI(e.buffer),t},isString:lI,isNumber:dI,isBoolean:e=>!0===e||!1===e,isObject:uI,isPlainObject:hI,isEmptyObject:e=>{if(!uI(e)||aI(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(kF){return!1}},isReadableStream:yI,isRequest:wI,isResponse:SI,isHeaders:jI,isUndefined:iI,isDate:pI,isFile:fI,isReactNativeBlob:e=>!(!e||"undefined"===typeof e.uri),isReactNative:e=>e&&"undefined"!==typeof e.getParts,isBlob:mI,isRegExp:PI,isFunction:cI,isStream:e=>uI(e)&&cI(e.pipe),isURLSearchParams:bI,isTypedArray:zI,isFileList:gI,forEach:kI,merge:function e(){const{caseless:t,skipUndefined:n}=_I(this)&&this||{},r={},o=(o,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;const a=t&&CI(r,i)||i;hI(r[a])&&hI(o)?r[a]=e(r[a],o):hI(o)?r[a]=e({},o):oI(o)?r[a]=o.slice():n&&iI(o)||(r[a]=o)};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&kI(arguments[i],o);return r},extend:function(e,t,n){let{allOwnKeys:r}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return kI(t,(t,r)=>{n&&cI(t)?Object.defineProperty(e,r,{value:XD(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e},trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&JD(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:eI,kindOfTest:nI,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(oI(e))return e;let t=e.length;if(!dI(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[QD]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:AI,hasOwnProperty:TI,hasOwnProp:TI,reduceDescriptors:OI,freezeMethods:e=>{OI(e,(t,n)=>{if(cI(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];cI(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return oI(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:CI,global:EI,isContextDefined:_I,isSpecCompliantForm:function(e){return!!(e&&cI(e.append)&&"FormData"===e[ZD]&&e[QD])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(uI(e)){if(t.indexOf(e)>=0)return;if(aI(e))return e;if(!("toJSON"in e)){t[r]=e;const o=oI(e)?[]:{};return kI(e,(e,t)=>{const i=n(e,r+1);!iI(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:LI,isThenable:e=>e&&(uI(e)||cI(e))&&cI(e.then)&&cI(e.catch),setImmediate:DI,asap:MI,isIterable:e=>null!=e&&cI(e[QD])};class WI extends Error{static from(e,t,n,r,o,i){const a=new WI(e.message,t||e.code,n,r,o);return a.cause=e,a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),i&&Object.assign(a,i),a}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:FI.toJSONObject(this.config),code:this.code,status:this.status}}}WI.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",WI.ERR_BAD_OPTION="ERR_BAD_OPTION",WI.ECONNABORTED="ECONNABORTED",WI.ETIMEDOUT="ETIMEDOUT",WI.ERR_NETWORK="ERR_NETWORK",WI.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",WI.ERR_DEPRECATED="ERR_DEPRECATED",WI.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",WI.ERR_BAD_REQUEST="ERR_BAD_REQUEST",WI.ERR_CANCELED="ERR_CANCELED",WI.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",WI.ERR_INVALID_URL="ERR_INVALID_URL";const BI=WI;function UI(e){return FI.isPlainObject(e)||FI.isArray(e)}function VI(e){return FI.endsWith(e,"[]")?e.slice(0,-2):e}function HI(e,t,n){return e?e.concat(t).map(function(e,t){return e=VI(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const qI=FI.toFlatObject(FI,{},null,function(e){return/^is[A-Z]/.test(e)});const $I=function(e,t,n){if(!FI.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=FI.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!FI.isUndefined(t[e])})).metaTokens,o=n.visitor||c,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!==typeof Blob&&Blob)&&FI.isSpecCompliantForm(t);if(!FI.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(FI.isDate(e))return e.toISOString();if(FI.isBoolean(e))return e.toString();if(!s&&FI.isBlob(e))throw new BI("Blob is not supported. Use a Buffer instead.");return FI.isArrayBuffer(e)||FI.isTypedArray(e)?s&&"function"===typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,o){let s=e;if(FI.isReactNative(t)&&FI.isReactNativeBlob(e))return t.append(HI(o,n,i),l(e)),!1;if(e&&!o&&"object"===typeof e)if(FI.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(FI.isArray(e)&&function(e){return FI.isArray(e)&&!e.some(UI)}(e)||(FI.isFileList(e)||FI.endsWith(n,"[]"))&&(s=FI.toArray(e)))return n=VI(n),s.forEach(function(e,r){!FI.isUndefined(e)&&null!==e&&t.append(!0===a?HI([n],r,i):null===a?n:n+"[]",l(e))}),!1;return!!UI(e)||(t.append(HI(o,n,i),l(e)),!1)}const d=[],u=Object.assign(qI,{defaultVisitor:c,convertValue:l,isVisitable:UI});if(!FI.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!FI.isUndefined(n)){if(-1!==d.indexOf(n))throw Error("Circular reference detected in "+r.join("."));d.push(n),FI.forEach(n,function(n,i){!0===(!(FI.isUndefined(n)||null===n)&&o.call(t,n,FI.isString(i)?i.trim():i,r,u))&&e(n,r?r.concat(i):[i])}),d.pop()}}(e),t};function YI(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function KI(e,t){this._pairs=[],e&&$I(e,this,t)}const XI=KI.prototype;XI.append=function(e,t){this._pairs.push([e,t])},XI.toString=function(e){const t=e?function(t){return e.call(this,t,YI)}:YI;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const GI=KI;function JI(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function QI(e,t,n){if(!t)return e;const r=n&&n.encode||JI,o=FI.isFunction(n)?{serialize:n}:n,i=o&&o.serialize;let a;if(a=i?i(t,o):FI.isURLSearchParams(t)?t.toString():new GI(t,o).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const ZI=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){FI.forEach(this.handlers,function(t){null!==t&&e(t)})}},eN={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},tN={isBrowser:!0,classes:{URLSearchParams:"undefined"!==typeof URLSearchParams?URLSearchParams:GI,FormData:"undefined"!==typeof FormData?FormData:null,Blob:"undefined"!==typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},nN="undefined"!==typeof window&&"undefined"!==typeof document,rN="object"===typeof navigator&&navigator||void 0,oN=nN&&(!rN||["ReactNative","NativeScript","NS"].indexOf(rN.product)<0),iN="undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"===typeof self.importScripts,aN=nN&&window.location.href||"http://localhost",sN=p(p({},e),tN);const lN=function(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;if(i=!i&&FI.isArray(r)?r.length:i,s)return FI.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&FI.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&FI.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!a}if(FI.isFormData(e)&&FI.isFunction(e.entries)){const n={};return FI.forEachEntry(e,(e,r)=>{t(function(e){return FI.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null};const cN={transitional:eN,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=FI.isObject(e);o&&FI.isHTMLForm(e)&&(e=new FormData(e));if(FI.isFormData(e))return r?JSON.stringify(lN(e)):e;if(FI.isArrayBuffer(e)||FI.isBuffer(e)||FI.isStream(e)||FI.isFile(e)||FI.isBlob(e)||FI.isReadableStream(e))return e;if(FI.isArrayBufferView(e))return e.buffer;if(FI.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return $I(e,new sN.classes.URLSearchParams,p({visitor:function(e,t,n,r){return sN.isNode&&FI.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=FI.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return $I(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(FI.isString(e))try{return(t||JSON.parse)(e),FI.trim(e)}catch(kF){if("SyntaxError"!==kF.name)throw kF}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||cN.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(FI.isResponse(e)||FI.isReadableStream(e))return e;if(e&&FI.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(kF){if(n){if("SyntaxError"===kF.name)throw BI.from(kF,BI.ERR_BAD_RESPONSE,this,null,this.response);throw kF}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:sN.classes.FormData,Blob:sN.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};FI.forEach(["delete","get","head","post","put","patch"],e=>{cN.headers[e]={}});const dN=cN,uN=FI.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),hN=Symbol("internals");function pN(e){return e&&String(e).trim().toLowerCase()}function fN(e){return!1===e||null==e?e:FI.isArray(e)?e.map(fN):String(e)}function mN(e,t,n,r,o){return FI.isFunction(r)?r.call(this,t,n):(o&&(t=n),FI.isString(t)?FI.isString(r)?-1!==t.indexOf(r):FI.isRegExp(r)?r.test(t):void 0:void 0)}class gN{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=pN(t);if(!o)throw new Error("header name must be a non-empty string");const i=FI.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=fN(e))}const i=(e,t)=>FI.forEach(e,(e,n)=>o(e,n,t));if(FI.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(FI.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&uN[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(FI.isObject(e)&&FI.isIterable(e)){let n,r,o={};for(const t of e){if(!FI.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?FI.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=pN(e)){const n=FI.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(FI.isFunction(t))return t.call(this,e,n);if(FI.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=pN(e)){const n=FI.findKey(this,e);return!(!n||void 0===this[n]||t&&!mN(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=pN(e)){const o=FI.findKey(n,e);!o||t&&!mN(0,n[o],o,t)||(delete n[o],r=!0)}}return FI.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!mN(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return FI.forEach(this,(r,o)=>{const i=FI.findKey(n,o);if(i)return t[i]=fN(r),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();a!==o&&delete t[o],t[a]=fN(r),n[a]=!0}),this}concat(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.constructor.concat(this,...t)}toJSON(e){const t=Object.create(null);return FI.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&FI.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(e=>{let[t,n]=e;return t+": "+n}).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e){const t=new this(e);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.forEach(e=>t.set(e)),t}static accessor(e){const t=(this[hN]=this[hN]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=pN(e);t[r]||(!function(e,t){const n=FI.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return FI.isArray(e)?e.forEach(r):r(e),this}}gN.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),FI.reduceDescriptors(gN.prototype,(e,t)=>{let{value:n}=e,r=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(e){this[r]=e}}}),FI.freezeMethods(gN);const vN=gN;function xN(e,t){const n=this||dN,r=t||n,o=vN.from(r.headers);let i=r.data;return FI.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function bN(e){return!(!e||!e.__CANCEL__)}const yN=class extends BI{constructor(e,t,n){super(null==e?"canceled":e,BI.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function wN(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new BI("Request failed with status code "+n.status,[BI.ERR_BAD_REQUEST,BI.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const SN=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=r[a];o||(o=l),n[i]=s,r[i]=l;let d=a,u=0;for(;d!==i;)u+=n[d++],d%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),l-o<t)return;const h=c&&l-c;return h?Math.round(1e3*u/h):void 0}};const jN=function(e,t){let n,r,o=0,i=1e3/t;const a=function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[function(){const e=Date.now(),t=e-o;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];t>=i?a(l,e):(n=l,r||(r=setTimeout(()=>{r=null,a(n)},i-t)))},()=>n&&a(n)]},kN=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0;const o=SN(50,250);return jN(n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,l=o(s);r=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&i<=a?(a-i)/l:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},CN=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},EN=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return FI.asap(()=>e(...n))},_N=sN.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,sN.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(sN.origin),sN.navigator&&/(msie|trident)/i.test(sN.navigator.userAgent)):()=>!0,zN=sN.hasStandardBrowserEnv?{write(e,t,n,r,o,i,a){if("undefined"===typeof document)return;const s=["".concat(e,"=").concat(encodeURIComponent(t))];FI.isNumber(n)&&s.push("expires=".concat(new Date(n).toUTCString())),FI.isString(r)&&s.push("path=".concat(r)),FI.isString(o)&&s.push("domain=".concat(o)),!0===i&&s.push("secure"),FI.isString(a)&&s.push("SameSite=".concat(a)),document.cookie=s.join("; ")},read(e){if("undefined"===typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function RN(e,t,n){let r=!("string"===typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const AN=e=>e instanceof vN?p({},e):e;function TN(e,t){t=t||{};const n={};function r(e,t,n,r){return FI.isPlainObject(e)&&FI.isPlainObject(t)?FI.merge.call({caseless:r},e,t):FI.isPlainObject(t)?FI.merge({},t):FI.isArray(t)?t.slice():t}function o(e,t,n,o){return FI.isUndefined(t)?FI.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!FI.isUndefined(t))return r(void 0,t)}function a(e,t){return FI.isUndefined(t)?FI.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const l={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>o(AN(e),AN(t),0,!0)};return FI.forEach(Object.keys(p(p({},e),t)),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const i=FI.hasOwnProp(l,r)?l[r]:o,a=i(e[r],t[r],r);FI.isUndefined(a)&&i!==s||(n[r]=a)}),n}const PN=e=>{const t=TN({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=vN.from(a),t.url=QI(RN(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),FI.isFormData(n))if(sN.hasStandardBrowserEnv||sN.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(FI.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(e=>{let[n,r]=e;t.includes(n.toLowerCase())&&a.set(n,r)})}if(sN.hasStandardBrowserEnv&&(r&&FI.isFunction(r)&&(r=r(t)),r||!1!==r&&_N(t.url))){const e=o&&i&&zN.read(i);e&&a.set(o,e)}return t},ON="undefined"!==typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=PN(e);let o=r.data;const i=vN.from(r.headers).normalize();let a,s,l,c,d,{responseType:u,onUploadProgress:h,onDownloadProgress:p}=r;function f(){c&&c(),d&&d(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=vN.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());wN(function(e){t(e),f()},function(e){n(e),f()},{data:u&&"text"!==u&&"json"!==u?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new BI("Request aborted",BI.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new BI(r,BI.ERR_NETWORK,e,m);o.event=t||null,n(o),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||eN;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new BI(t,o.clarifyTimeoutError?BI.ETIMEDOUT:BI.ECONNABORTED,e,m)),m=null},void 0===o&&i.setContentType(null),"setRequestHeader"in m&&FI.forEach(i.toJSON(),function(e,t){m.setRequestHeader(t,e)}),FI.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),u&&"json"!==u&&(m.responseType=r.responseType),p&&([l,d]=kN(p,!0),m.addEventListener("progress",l)),h&&m.upload&&([s,c]=kN(h),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{m&&(n(!t||t.type?new yN(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const v=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);v&&-1===sN.protocols.indexOf(v)?n(new BI("Unsupported protocol "+v+":",BI.ERR_BAD_REQUEST,e)):m.send(o||null)})},LN=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof BI?t:new yN(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new BI("timeout of ".concat(t,"ms exceeded"),BI.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=()=>FI.asap(a),s}};function DN(e,t){this.v=e,this.k=t}function IN(e){return function(){return new NN(e.apply(this,arguments))}}function NN(e){var t,n;function r(t,n){try{var i=e[t](n),a=i.value,s=a instanceof DN;Promise.resolve(s?a.v:a).then(function(n){if(s){var l="return"===t?"return":"next";if(!a.k||n.done)return r(l,n);n=e[l](n).value}o(i.done?"return":"normal",n)},function(e){r("throw",e)})}catch(e){o("throw",e)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise(function(i,a){var s={key:e,arg:o,resolve:i,reject:a,next:null};n?n=n.next=s:(t=n=s,r(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}function MN(e){return new DN(e,0)}function FN(e){var t={},n=!1;function r(t,r){return n=!0,r=new Promise(function(n){n(e[t](r))}),{done:!1,value:new DN(r,1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return n?(n=!1,e):r("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(n)throw n=!1,e;return r("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return n?(n=!1,e):r("return",e)}),t}function WN(e){var t,n,r,o=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);o--;){if(n&&null!=(t=e[n]))return t.call(e);if(r&&null!=(t=e[r]))return new BN(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function BN(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return BN=function(e){this.s=e,this.n=e.next},BN.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return void 0===n?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return void 0===n?Promise.reject(e):t(n.apply(this.s,arguments))}},new BN(e)}NN.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},NN.prototype.next=function(e){return this._invoke("next",e)},NN.prototype.throw=function(e){return this._invoke("throw",e)},NN.prototype.return=function(e){return this._invoke("return",e)};const UN=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},VN=function(){var e=IN(function*(e,t){var n,r=!1,o=!1;try{for(var i,a=WN(HN(e));r=!(i=yield MN(a.next())).done;r=!1){const e=i.value;yield*FN(WN(UN(e,t)))}}catch(CF){o=!0,n=CF}finally{try{r&&null!=a.return&&(yield MN(a.return()))}finally{if(o)throw n}}});return function(t,n){return e.apply(this,arguments)}}(),HN=function(){var e=IN(function*(e){if(e[Symbol.asyncIterator])return void(yield*FN(WN(e)));const t=e.getReader();try{for(;;){const{done:e,value:n}=yield MN(t.read());if(e)break;yield n}}finally{yield MN(t.cancel())}});return function(t){return e.apply(this,arguments)}}(),qN=(e,t,n,r)=>{const o=VN(e,t);let i,a=0,s=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let i=r.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(CF){throw s(CF),CF}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:$N}=FI,YN=(e=>{let{Request:t,Response:n}=e;return{Request:t,Response:n}})(FI.global),{ReadableStream:KN,TextEncoder:XN}=FI.global,GN=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return!!e(...n)}catch(kF){return!1}},JN=e=>{e=FI.merge.call({skipUndefined:!0},YN,e);const{fetch:t,Request:n,Response:r}=e,o=t?$N(t):"function"===typeof fetch,i=$N(n),a=$N(r);if(!o)return!1;const s=o&&$N(KN),l=o&&("function"===typeof XN?(c=new XN,e=>c.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var c;const d=i&&s&&GN(()=>{let e=!1;const t=new n(sN.origin,{body:new KN,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),u=a&&s&&GN(()=>FI.isReadableStream(new r("").body)),h={stream:u&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!h[e]&&(h[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new BI("Response type '".concat(e,"' is not supported"),BI.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=FI.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(FI.isBlob(e))return e.size;if(FI.isSpecCompliantForm(e)){const t=new n(sN.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return FI.isArrayBufferView(e)||FI.isArrayBuffer(e)?e.byteLength:(FI.isURLSearchParams(e)&&(e+=""),FI.isString(e)?(await l(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:a,data:s,signal:l,cancelToken:c,timeout:m,onDownloadProgress:g,onUploadProgress:v,responseType:x,headers:b,withCredentials:y="same-origin",fetchOptions:w}=PN(e),S=t||fetch;x=x?(x+"").toLowerCase():"text";let j=LN([l,c&&c.toAbortSignal()],m),k=null;const C=j&&j.unsubscribe&&(()=>{j.unsubscribe()});let E;try{if(v&&d&&"get"!==a&&"head"!==a&&0!==(E=await f(b,s))){let e,t=new n(o,{method:"POST",body:s,duplex:"half"});if(FI.isFormData(s)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,n]=CN(E,kN(EN(v)));s=qN(t.body,65536,e,n)}}FI.isString(y)||(y=y?"include":"omit");const t=i&&"credentials"in n.prototype,l=p(p({},w),{},{signal:j,method:a.toUpperCase(),headers:b.normalize().toJSON(),body:s,duplex:"half",credentials:t?y:void 0});k=i&&new n(o,l);let c=await(i?S(k,w):S(o,l));const m=u&&("stream"===x||"response"===x);if(u&&(g||m&&C)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=c[t]});const t=FI.toFiniteNumber(c.headers.get("content-length")),[n,o]=g&&CN(t,kN(EN(g),!0))||[];c=new r(qN(c.body,65536,n,()=>{o&&o(),C&&C()}),e)}x=x||"text";let _=await h[FI.findKey(h,x)||"text"](c,e);return!m&&C&&C(),await new Promise((t,n)=>{wN(t,n,{data:_,headers:vN.from(c.headers),status:c.status,statusText:c.statusText,config:e,request:k})})}catch(CF){if(C&&C(),CF&&"TypeError"===CF.name&&/Load failed|fetch/i.test(CF.message))throw Object.assign(new BI("Network Error",BI.ERR_NETWORK,e,k,CF&&CF.response),{cause:CF.cause||CF});throw BI.from(CF,CF&&CF.code,e,k,CF&&CF.response)}}},QN=new Map,ZN=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let a,s,l=i.length,c=QN;for(;l--;)a=i[l],s=c.get(a),void 0===s&&c.set(a,s=l?new Map:JN(t)),c=s;return s},eM=(ZN(),{http:null,xhr:ON,fetch:{get:ZN}});FI.forEach(eM,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(kF){}Object.defineProperty(e,"adapterName",{value:t})}});const tM=e=>"- ".concat(e),nM=e=>FI.isFunction(e)||null===e||!1===e;const rM={getAdapter:function(e,t){e=FI.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let a=0;a<n;a++){let n;if(r=e[a],o=r,!nM(r)&&(o=eM[(n=String(r)).toLowerCase()],void 0===o))throw new BI("Unknown adapter '".concat(n,"'"));if(o&&(FI.isFunction(o)||(o=o.get(t))))break;i[n||"#"+a]=o}if(!o){const e=Object.entries(i).map(e=>{let[t,n]=e;return"adapter ".concat(t," ")+(!1===n?"is not supported by the environment":"is not available in the build")});let t=n?e.length>1?"since :\n"+e.map(tM).join("\n"):" "+tM(e[0]):"as no adapter specified";throw new BI("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:eM};function oM(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yN(null,e)}function iM(e){oM(e),e.headers=vN.from(e.headers),e.data=xN.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return rM.getAdapter(e.adapter||dN.adapter,e)(e).then(function(t){return oM(e),t.data=xN.call(e,e.transformResponse,t),t.headers=vN.from(t.headers),t},function(t){return bN(t)||(oM(e),t&&t.response&&(t.response.data=xN.call(e,e.transformResponse,t.response),t.response.headers=vN.from(t.response.headers))),Promise.reject(t)})}const aM="1.13.6",sM={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{sM[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const lM={};sM.transitional=function(e,t,n){function r(e,t){return"[Axios v"+aM+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new BI(r(o," has been removed"+(t?" in "+t:"")),BI.ERR_DEPRECATED);return t&&!lM[o]&&(lM[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},sM.spelling=function(e){return(t,n)=>(console.warn("".concat(n," is likely a misspelling of ").concat(e)),!0)};const cM={assertOptions:function(e,t,n){if("object"!==typeof e)throw new BI("options must be an object",BI.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new BI("option "+i+" must be "+n,BI.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new BI("Unknown option "+i,BI.ERR_BAD_OPTION)}},validators:sM},dM=cM.validators;class uM{constructor(e){this.defaults=e||{},this.interceptors={request:new ZI,response:new ZI}}async request(e,t){try{return await this._request(e,t)}catch(CF){if(CF instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{CF.stack?n&&!String(CF.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(CF.stack+="\n"+n):CF.stack=n}catch(kF){}}throw CF}}_request(e,t){"string"===typeof e?(t=t||{}).url=e:t=e||{},t=TN(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&cM.assertOptions(n,{silentJSONParsing:dM.transitional(dM.boolean),forcedJSONParsing:dM.transitional(dM.boolean),clarifyTimeoutError:dM.transitional(dM.boolean),legacyInterceptorReqResOrdering:dM.transitional(dM.boolean)},!1),null!=r&&(FI.isFunction(r)?t.paramsSerializer={serialize:r}:cM.assertOptions(r,{encode:dM.function,serialize:dM.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),cM.assertOptions(t,{baseUrl:dM.spelling("baseURL"),withXsrfToken:dM.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&FI.merge(o.common,o[t.method]);o&&FI.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=vN.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){if("function"===typeof e.runWhen&&!1===e.runWhen(t))return;s=s&&e.synchronous;const n=t.transitional||eN;n&&n.legacyInterceptorReqResOrdering?a.unshift(e.fulfilled,e.rejected):a.push(e.fulfilled,e.rejected)});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let d,u=0;if(!s){const e=[iM.bind(this),void 0];for(e.unshift(...a),e.push(...l),d=e.length,c=Promise.resolve(t);u<d;)c=c.then(e[u++],e[u++]);return c}d=a.length;let h=t;for(;u<d;){const e=a[u++],t=a[u++];try{h=e(h)}catch(p){t.call(this,p);break}}try{c=iM.call(this,h)}catch(p){return Promise.reject(p)}for(u=0,d=l.length;u<d;)c=c.then(l[u++],l[u++]);return c}getUri(e){return QI(RN((e=TN(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}FI.forEach(["delete","get","head","options"],function(e){uM.prototype[e]=function(t,n){return this.request(TN(n||{},{method:e,url:t,data:(n||{}).data}))}}),FI.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(TN(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}uM.prototype[e]=t(),uM.prototype[e+"Form"]=t(!0)});const hM=uM;class pM{constructor(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new yN(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new pM(function(t){e=t}),cancel:e}}}const fM=pM;const mM={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(mM).forEach(e=>{let[t,n]=e;mM[n]=t});const gM=mM;const vM=function e(t){const n=new hM(t),r=XD(hM.prototype.request,n);return FI.extend(r,hM.prototype,n,{allOwnKeys:!0}),FI.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(TN(t,n))},r}(dN);vM.Axios=hM,vM.CanceledError=yN,vM.CancelToken=fM,vM.isCancel=bN,vM.VERSION=aM,vM.toFormData=$I,vM.AxiosError=BI,vM.Cancel=vM.CanceledError,vM.all=function(e){return Promise.all(e)},vM.spread=function(e){return function(t){return e.apply(null,t)}},vM.isAxiosError=function(e){return FI.isObject(e)&&!0===e.isAxiosError},vM.mergeConfig=TN,vM.AxiosHeaders=vN,vM.formToJSON=e=>lN(FI.isHTMLForm(e)?new FormData(e):e),vM.getAdapter=rM.getAdapter,vM.HttpStatusCode=gM,vM.default=vM;const xM=vM,bM=["children"],yM={Settings:"settings",Camera:"camera",Photos:"photos",Gmail:"gmail",WhatsApp:"whatsapp",Telegram:"telegram",Instagram:"instagram",Twitter:"twitter",Facebook:"facebook",Maps:"maps",YouTube:"youtube",Spotify:"spotify",Netflix:"netflix"};function wM(e){let{children:n}=e,r=Ki(e,bM);const o=(0,t.useRef)(null),[a,s]=(0,t.useState)(0);return(0,i.jsx)(mw,{ref:o,flex:"1",minW:0,overflow:"hidden",whiteSpace:"nowrap",onMouseEnter:()=>{const e=o.current;e&&s(Math.max(0,e.scrollWidth-e.clientWidth))},children:(0,i.jsx)(Cw,p(p({as:"span",display:"inline-block",fontSize:"xs",fontWeight:"medium",transition:a?"transform ".concat(Math.max(1.2,a/40),"s linear"):void 0,_groupHover:a?{transform:"translateX(-".concat(a,"px)")}:void 0},r),{},{children:n}))})}const SM=[{id:"launch",label:"\ud83d\ude80 Launch",action:"Launch",colorScheme:"green",placeholder:"App name or bundle ID"},{id:"kill",label:"\u274c Kill",action:"Kill",colorScheme:"red",placeholder:"App name or bundle ID"},{id:"clear",label:"\ud83e\uddf9 Clear Data",action:"Clear Data",colorScheme:"yellow",placeholder:"App name or bundle ID"},{id:"install",label:"\ud83d\udce6 Install",action:"Install",colorScheme:"blue",placeholder:"Path to .apk or .ipa"},{id:"uninstall",label:"\ud83d\uddd1\ufe0f Uninstall",action:"Uninstall",colorScheme:"orange",placeholder:"Bundle ID or package name"}],jM=e=>{let{selectedDevices:n,onExecuteCommand:r}=e;const[o,a]=(0,t.useState)(()=>{try{const e=localStorage.getItem("devicely-custom-apps");return e?JSON.parse(e):{}}catch(e){return console.error("Failed to load custom apps from localStorage:",e),{}}}),[s,l]=(0,t.useState)(()=>{try{const e=localStorage.getItem("devicely-hidden-apps");return e?JSON.parse(e):[]}catch(e){return[]}}),[c,d]=(0,t.useState)(!1),[u,h]=(0,t.useState)("launch"),[f,m]=(0,t.useState)(""),[g,v]=(0,t.useState)(null),[x,b]=(0,t.useState)(!1),y=(0,t.useRef)(null),[w,S]=(0,t.useState)({}),[j,k]=(0,t.useState)(!1),[C,E]=(0,t.useState)(""),[_,z]=(0,t.useState)(""),[R,A]=(0,t.useState)(!1),[T,P]=(0,t.useState)(""),[O,L]=(0,t.useState)(""),D=SM.find(e=>e.id===u)||SM[0],I=hw();(0,t.useEffect)(()=>{try{localStorage.setItem("devicely-custom-apps",JSON.stringify(o))}catch(e){console.error("Failed to save custom apps to localStorage:",e)}},[o]),(0,t.useEffect)(()=>{try{localStorage.setItem("devicely-hidden-apps",JSON.stringify(s))}catch(e){console.error("Failed to save hidden apps to localStorage:",e)}},[s]);const N=(e,t)=>{t?a(t=>{const n=p({},t);return delete n[e],n}):l(t=>t.includes(e)?t:[...t,e]),I({title:"".concat(e," removed from Quick Launch"),status:"success",duration:2e3})},M=Ts("white","gray.800"),F=Ts("gray.200","gray.700"),W=Ts("gray.800","gray.100"),B=Ts("whiteAlpha.700","blackAlpha.500"),U=Ts("gray.50","whiteAlpha.50"),V=Ts("blue.50","whiteAlpha.100"),H=Ts("blue.50","blue.900"),q=Ts("blue.900","blue.100"),$=async()=>{if(0===n.length)return void I({title:"No Device Selected",description:"Please select at least one device to install the app",status:"warning",duration:3e3,isClosable:!0});if(!g)return void L("Please select a .apk or .ipa package to install");A(!0),P("\ud83d\udce6 Uploading & installing ".concat(g.name," on ").concat(n.length," device(s)...")),L("");const e=new FormData;e.append("app_file",g),e.append("devices",JSON.stringify(n));try{const t=await fetch("".concat(yE,"/api/upload-install"),{method:"POST",body:e}),r=await t.json();if(!r.success)throw new Error(r.error||"Failed to install app on device(s)");P("\u2705 Successfully installed on ".concat(n.length," device(s)!")),I({title:"Installation Complete",description:r.message||"Successfully installed ".concat(g.name),status:"success",duration:3500,isClosable:!0}),v(null),y.current&&(y.current.value=""),setTimeout(()=>{X()},1200)}catch(t){console.error("Install error:",t),L(t.message||"Installation failed"),P("")}finally{A(!1)}},Y=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(0!==n.length){if(["launch","kill","open","close","clear","clear-data","uninstall"].includes(e))try{if(!t.trim())return void I({title:"Input Required",description:"Please enter app name or bundle ID",status:"warning",duration:3e3,isClosable:!0});const o="".concat(e," ").concat(t);return await r(o),I({title:"App Control Success",description:"".concat(e," ").concat(t," executed on ").concat(n.length," device(s)"),status:"success",duration:2e3,isClosable:!0}),void m("")}catch(o){return void I({title:"App Control Error",description:o.message||"App control failed",status:"error",duration:4e3,isClosable:!0})}if("install"===e){if(g)return $();if(!t.trim())return void L("Please select a file to install")}if("listapps"===e||"apps"===e||"install"===e||t.trim())try{"install"===e&&(A(!0),P("\ud83d\udce6 Installing app... Please wait (this may take 1-3 minutes)"),L(""));const n=t?"".concat(e," ").concat(t):e;await r(n),"install"===e&&(P("\u23f3 Verifying installation..."),await new Promise(e=>setTimeout(e,2e3)),P("\u2705 Installation completed successfully!"),L(""),setTimeout(()=>P(""),5e3)),m(""),I({title:"Command Sent",description:"Executed: ".concat(n),status:"success",duration:2e3,isClosable:!0})}catch(o){console.error("Command execution error:",o),"install"===e&&(L("\u274c Installation failed: "+(o.message||"Unknown error")),P(""))}finally{"install"===e&&A(!1)}else I({title:"Input Required",description:"Please enter the required value",status:"warning",duration:3e3,isClosable:!0})}else I({title:"No Device Selected",description:"Please select at least one device",status:"warning",duration:3e3,isClosable:!0})},K=async(e,t)=>{if(0!==n.length)try{await r("launch ".concat(t)),I({title:"App Launched",description:"".concat(e," launched on ").concat(n.length," device(s)"),status:"success",duration:2e3,isClosable:!0})}catch(o){I({title:"Launch Failed",description:o.message||"Failed to launch app",status:"error",duration:4e3,isClosable:!0})}else I({title:"No Device Selected",description:"Please select at least one device",status:"warning",duration:3e3,isClosable:!0})},X=async()=>{if(0!==n.length){k(!0),E("");try{const e=await xM.post("".concat(yE,"/api/apps/list"),{devices:n},{timeout:12e4});if(!e.data.success)throw new Error(e.data.error||"Failed to load installed apps");const t=e.data.results||{};S(t);const r=Object.entries(t).filter(e=>{let[,t]=e;return!t.success});0===r.length?I({title:"Apps Loaded",description:"Successfully loaded installed apps",status:"success",duration:2e3}):I({title:"Could not load apps on ".concat(r.length," device(s)"),description:r.map(e=>{let[t,n]=e;return"".concat(t,": ").concat(n.error||"unknown error")}).join("\n"),status:r.length===Object.keys(t).length?"error":"warning",duration:8e3,isClosable:!0})}catch(r){var e,t;console.error("Failed to load apps:",r),I({title:"Error",description:(null===(e=r.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||r.message||"Failed to load installed apps",status:"error",duration:4e3})}finally{k(!1)}}else I({title:"No Device Selected",description:"Please select at least one device",status:"warning",duration:3e3})},G=(0,t.useCallback)(e=>{if(!C.trim())return e;const t=C.toLowerCase();return Array.isArray(e)?e.filter(e=>{var n,r;return"string"===typeof e?e.toLowerCase().includes(t):(null===(n=e.name)||void 0===n?void 0:n.toLowerCase().includes(t))||(null===(r=e.id)||void 0===r?void 0:r.toLowerCase().includes(t))}):e},[C]),J=(0,t.useMemo)(()=>{const e={};return Object.entries(w).forEach(t=>{let[n,r]=t;e[n]=p(p({},r),{},{filteredApps:G(r.apps||[])})}),e},[w,G]),Q=(0,t.useMemo)(()=>Object.entries(yM).filter(e=>{let[t,n]=e;if(s.includes(t))return!1;if(!_.trim())return!0;const r=_.toLowerCase();return t.toLowerCase().includes(r)||n.toLowerCase().includes(r)}).sort((e,t)=>e[0].localeCompare(t[0],void 0,{sensitivity:"base"})),[s,_]),Z=(0,t.useMemo)(()=>Object.entries(o).filter(e=>{let[t,n]=e;if(!_.trim())return!0;const r=_.toLowerCase(),o=(n.ios||n.android||"").toLowerCase();return t.toLowerCase().includes(r)||o.includes(r)}).sort((e,t)=>e[0].localeCompare(t[0],void 0,{sensitivity:"base"})),[o,_]);return(0,i.jsx)(mw,{w:"full",overflowX:"hidden",pb:6,children:(0,i.jsxs)(ww,{spacing:3,align:"stretch",children:[(0,i.jsxs)(mw,{bg:"linear-gradient(135deg, green.50, emerald.50)",borderWidth:"1px",borderColor:"green.200",borderRadius:"lg",p:3,_dark:{bg:"linear-gradient(135deg, green.900, emerald.900)",borderColor:"green.700"},children:[(0,i.jsxs)(Ew,{justify:"space-between",mb:2,children:[(0,i.jsxs)(Ew,{children:[(0,i.jsx)(Kv,{as:Zj,color:"green.500",boxSize:4}),(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"semibold",color:"green.700",_dark:{color:"green.300"},children:"\u26a1 Quick Launch"})]}),(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(fE,{size:"xs",w:"130px",borderRadius:"md",bg:M,placeholder:"Search...",value:_,onChange:e=>z(e.target.value)}),(0,i.jsx)(Ww,{size:"xs",colorScheme:"green",variant:"ghost",leftIcon:(0,i.jsx)(kk,{}),onClick:()=>{const e=prompt("Enter app name:");if(!e)return;const t=prompt("Enter iOS bundle ID (optional):")||"",n=prompt("Enter Android package name (optional):")||"";t||n?(a(p(p({},o),{},{[e]:{ios:t,android:n}})),I({title:"Custom App Added",description:"".concat(e," added to Quick Launch"),status:"success",duration:3e3})):I({title:"Missing Information",description:"Please provide at least one package ID",status:"warning",duration:3e3})},children:"Add"}),(0,i.jsx)(Ww,{size:"xs",colorScheme:c?"red":"gray",variant:c?"solid":"ghost",leftIcon:c?(0,i.jsx)(cC,{}):(0,i.jsx)(Ok,{}),onClick:()=>d(e=>!e),children:c?"Done":"Remove"})]})]}),(0,i.jsxs)(u_,{columns:4,spacing:2,children:[Q.map(e=>{let[t,o]=e;return(0,i.jsx)(mw,{position:"relative",role:"group",bg:M,borderWidth:"1px",borderColor:F,borderRadius:"md",p:2,_hover:{borderColor:"green.400",transform:"translateY(-1px)"},transition:"all 0.2s ease",cursor:"pointer",overflow:"hidden",onClick:()=>K(t,o),children:(0,i.jsxs)(Ew,{spacing:2,justify:"space-between",w:"100%",children:[(0,i.jsx)(Uj,{label:"ID: ".concat(o),hasArrow:!0,fontSize:"2xs",placement:"top",children:(0,i.jsx)(mw,{flex:"1",minW:0,children:(0,i.jsx)(wM,{color:W,children:t})})}),(0,i.jsx)(Ew,{spacing:.5,position:"absolute",top:0,right:0,bottom:0,px:1,bg:c?B:M,opacity:c?1:0,_groupHover:{opacity:1},transition:"opacity 0.15s ease",children:c?(0,i.jsx)(qw,{size:"xs",variant:"ghost",colorScheme:"red",icon:(0,i.jsx)(Ok,{}),"aria-label":"Remove ".concat(t," from Quick Launch"),onClick:e=>{e.stopPropagation(),N(t,!1)},minW:"auto",h:"auto",p:1}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uj,{label:"Launch",hasArrow:!0,fontSize:"2xs",children:(0,i.jsx)(qw,{"aria-label":"Launch app",size:"xs",variant:"ghost",colorScheme:"green",icon:(0,i.jsx)(Ck,{}),onClick:e=>{e.stopPropagation(),K(t,o)},minW:"auto",h:"auto",p:1})}),(0,i.jsx)(Uj,{label:"Kill",hasArrow:!0,fontSize:"2xs",children:(0,i.jsx)(qw,{"aria-label":"Kill app",size:"xs",variant:"ghost",colorScheme:"red",icon:(0,i.jsx)(ek,{}),title:"Kill App",onClick:async e=>{e.stopPropagation();try{console.info("Attempting to kill app: ".concat(o)),await r("kill ".concat(o)),I({title:"App Killed",description:"".concat(t," (").concat(o,") killed on ").concat(n.length," device(s)"),status:"success",duration:2e3,isClosable:!0})}catch(i){console.error("Failed to kill ".concat(o,":"),i),I({title:"Kill Failed",description:"Failed to kill ".concat(t,": ").concat(i.message||"Unknown error"),status:"error",duration:4e3,isClosable:!0})}},minW:"auto",h:"auto",p:1})}),(0,i.jsx)(Uj,{label:"Uninstall",hasArrow:!0,fontSize:"2xs",children:(0,i.jsx)(qw,{"aria-label":"Uninstall app",size:"xs",variant:"ghost",colorScheme:"orange",icon:(0,i.jsx)(sk,{}),onClick:async e=>{e.stopPropagation();try{await r("uninstall ".concat(o)),I({title:"App Uninstalled",description:"".concat(t," uninstalled from ").concat(n.length," device(s)"),status:"success",duration:2e3})}catch(i){I({title:"Uninstall Failed",description:i.message||"Failed to uninstall app",status:"error",duration:3e3})}},minW:"auto",h:"auto",p:1,title:"Uninstall App"})})]})})]})},o)}),Z.map(e=>{let[t,o]=e;const a=o.ios||o.android;return(0,i.jsx)(mw,{position:"relative",role:"group",bg:M,borderWidth:"1px",borderColor:"blue.200",_dark:{borderColor:"blue.700"},borderRadius:"md",p:2,_hover:{borderColor:"blue.400",transform:"translateY(-1px)"},transition:"all 0.2s ease",cursor:"pointer",overflow:"hidden",onClick:()=>K(t,a),children:(0,i.jsxs)(Ew,{spacing:2,justify:"space-between",w:"100%",children:[(0,i.jsx)(Uj,{label:"ID: ".concat(a),hasArrow:!0,fontSize:"2xs",placement:"top",children:(0,i.jsx)(mw,{flex:"1",minW:0,children:(0,i.jsx)(wM,{color:"blue.600",_dark:{color:"blue.300"},children:t})})}),(0,i.jsx)(Ew,{spacing:.5,position:"absolute",top:0,right:0,bottom:0,px:1,bg:c?B:M,opacity:c?1:0,_groupHover:{opacity:1},transition:"opacity 0.15s ease",children:c?(0,i.jsx)(qw,{size:"xs",variant:"ghost",colorScheme:"red",icon:(0,i.jsx)(Ok,{}),"aria-label":"Remove ".concat(t," from Quick Launch"),onClick:e=>{e.stopPropagation(),N(t,!0)},minW:"auto",h:"auto",p:1}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uj,{label:"Launch",hasArrow:!0,fontSize:"2xs",children:(0,i.jsx)(qw,{size:"xs",variant:"ghost",colorScheme:"blue",icon:(0,i.jsx)(Ck,{}),"aria-label":"Launch ".concat(t),onClick:e=>{e.stopPropagation(),K(t,a)},minW:"auto",h:"auto",p:1})}),(0,i.jsx)(Uj,{label:"Kill",hasArrow:!0,fontSize:"2xs",children:(0,i.jsx)(qw,{size:"xs",variant:"ghost",colorScheme:"red",icon:(0,i.jsx)(ek,{}),"aria-label":"Kill ".concat(t),onClick:async e=>{e.stopPropagation();try{await r("kill ".concat(a)),I({title:"App Killed",description:"".concat(t," killed on ").concat(n.length," device(s)"),status:"success",duration:2e3})}catch(o){I({title:"Kill Failed",description:o.message||"Failed to kill app",status:"error",duration:3e3})}},minW:"auto",h:"auto",p:1})}),(0,i.jsx)(Uj,{label:"Uninstall",hasArrow:!0,fontSize:"2xs",children:(0,i.jsx)(qw,{size:"xs",variant:"ghost",colorScheme:"orange",icon:(0,i.jsx)(sk,{}),"aria-label":"Uninstall ".concat(t),onClick:async e=>{e.stopPropagation();try{await r("uninstall ".concat(a)),I({title:"App Uninstalled",description:"".concat(t," uninstalled from ").concat(n.length," device(s)"),status:"success",duration:2e3})}catch(o){I({title:"Uninstall Failed",description:o.message||"Failed to uninstall app",status:"error",duration:3e3})}},minW:"auto",h:"auto",p:1})})]})})]})},t)})]})]}),(0,i.jsxs)(mw,{bg:M,borderWidth:"1px",borderColor:F,borderRadius:"lg",p:3,children:[(0,i.jsxs)(Ew,{justify:"space-between",mb:3,children:[(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Kv,{as:_k,color:"teal.500",boxSize:4}),(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"semibold",color:"teal.700",_dark:{color:"teal.300"},children:"App Operations"})]}),(0,i.jsx)(iT,{"aria-label":"App operation",size:"xs",w:"130px",borderRadius:"md",value:u,onChange:e=>{h(e.target.value),L(""),P("")},children:SM.map(e=>(0,i.jsx)("option",{value:e.id,children:e.label},e.id))})]}),"install"===u?(0,i.jsxs)(ww,{spacing:3,align:"stretch",children:[(0,i.jsx)("input",{type:"file",accept:".apk,.ipa",ref:y,style:{display:"none"},onChange:e=>{e.target.files&&e.target.files.length>0?(v(e.target.files[0]),L(""),P("")):v(null)}}),g?(0,i.jsx)(mw,{p:2.5,borderRadius:"md",borderWidth:"1px",borderColor:"blue.300",bg:H,_dark:{borderColor:"blue.600"},children:(0,i.jsxs)(Ew,{justify:"space-between",align:"start",children:[(0,i.jsxs)(Ew,{spacing:2,align:"start",flex:"1",minW:0,children:[(0,i.jsx)(Cw,{fontSize:"lg",lineHeight:"1",children:g.name.toLowerCase().endsWith(".ipa")?"\ud83c\udf4e":"\ud83e\udd16"}),(0,i.jsxs)(ww,{align:"start",spacing:1,flex:"1",minW:0,children:[(0,i.jsx)(Cw,{fontSize:"xs",fontWeight:"bold",wordBreak:"break-all",color:q,lineHeight:"short",children:g.name}),(0,i.jsxs)(Ew,{spacing:1.5,wrap:"wrap",children:[(0,i.jsxs)(zw,{colorScheme:"blue",fontSize:"2xs",px:1.5,children:[(g.size/1048576).toFixed(2)," MB"]}),(0,i.jsx)(zw,{colorScheme:g.name.toLowerCase().endsWith(".ipa")?"purple":"green",fontSize:"2xs",px:1.5,children:g.name.toLowerCase().endsWith(".ipa")?"iOS IPA":"Android APK"}),(0,i.jsxs)(zw,{colorScheme:"teal",fontSize:"2xs",px:1.5,children:[n.length," device",1===n.length?"":"s"]})]})]})]}),(0,i.jsx)(qw,{size:"xs",icon:(0,i.jsx)(ek,{}),variant:"ghost",colorScheme:"red","aria-label":"Remove selected file",title:"Remove file",onClick:()=>{v(null),y.current&&(y.current.value=""),L(""),P("")}})]})}):(0,i.jsx)(mw,{borderWidth:"2px",borderStyle:"dashed",borderColor:x?"blue.400":F,bg:x?"blue.50":U,_dark:{bg:x?"blue.900":"whiteAlpha.50"},borderRadius:"md",py:4,px:3,textAlign:"center",cursor:"pointer",transition:"all 0.2s",_hover:{borderColor:"blue.400",bg:V},onClick:()=>{var e;return null===(e=y.current)||void 0===e?void 0:e.click()},onDragOver:e=>{e.preventDefault(),b(!0)},onDragLeave:()=>b(!1),onDrop:e=>{e.preventDefault(),b(!1),e.dataTransfer.files&&e.dataTransfer.files.length>0&&(v(e.dataTransfer.files[0]),L(""),P(""))},children:(0,i.jsxs)(ww,{spacing:1,children:[(0,i.jsx)(Kv,{as:ok,boxSize:6,color:"blue.500"}),(0,i.jsx)(Cw,{fontSize:"xs",fontWeight:"bold",children:"Select .apk or .ipa package"}),(0,i.jsx)(Cw,{fontSize:"10px",color:"gray.500",children:"Click to browse or drag & drop package here"})]})}),(0,i.jsxs)(Ww,{size:"sm",w:"full",colorScheme:"blue",leftIcon:(0,i.jsx)(Jk,{}),isLoading:R,loadingText:"Installing on device(s)...",isDisabled:!g||0===n.length,onClick:$,children:["Install on ",n.length," Device",1===n.length?"":"s"]}),R&&(0,i.jsx)(KL,{size:"xs",isIndeterminate:!0,colorScheme:"blue",borderRadius:"full"}),T&&(0,i.jsxs)(ix,{status:"success",size:"sm",borderRadius:"md",py:1.5,px:2.5,children:[(0,i.jsx)(ax,{boxSize:3.5}),(0,i.jsx)(lx,{fontSize:"xs",children:T})]}),O&&(0,i.jsxs)(ix,{status:"error",size:"sm",borderRadius:"md",py:1.5,px:2.5,children:[(0,i.jsx)(ax,{boxSize:3.5}),(0,i.jsx)(lx,{fontSize:"xs",wordBreak:"break-word",children:O})]})]}):(0,i.jsx)(ww,{spacing:2,align:"stretch",children:(0,i.jsxs)(Ew,{spacing:2,w:"full",children:[(0,i.jsx)(fE,{size:"sm",flex:"1",placeholder:D.placeholder,value:f,onChange:e=>m(e.target.value),onKeyPress:e=>{"Enter"===e.key&&f.trim()&&Y(u,f)}}),(0,i.jsx)(Ww,{size:"sm",colorScheme:D.colorScheme,flexShrink:0,isDisabled:!f.trim()||0===n.length,onClick:()=>Y(u,f),children:D.action})]})})]}),(0,i.jsxs)(mw,{bg:"linear-gradient(135deg, purple.50, pink.50)",borderWidth:"1px",borderColor:"purple.200",borderRadius:"lg",p:3,_dark:{bg:"linear-gradient(135deg, purple.900, pink.900)",borderColor:"purple.700"},children:[(0,i.jsxs)(Ew,{justify:"space-between",mb:2,children:[(0,i.jsxs)(Ew,{children:[(0,i.jsx)(Kv,{as:Mk,color:"purple.500",boxSize:4}),(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"semibold",color:"purple.700",_dark:{color:"purple.300"},children:"\ud83d\udcf1 Installed Apps"})]}),(0,i.jsx)(Ww,{size:"xs",colorScheme:"purple",variant:"outline",leftIcon:(0,i.jsx)(Jk,{}),onClick:X,isLoading:j,loadingText:"Loading...",children:"Load Apps"})]}),Object.keys(w).length>0&&(0,i.jsxs)(ww,{spacing:2,align:"stretch",children:[(0,i.jsx)(fE,{placeholder:"Search installed apps...",value:C,onChange:e=>E(e.target.value),size:"xs",fontSize:"xs"}),(0,i.jsx)(mw,{maxH:"300px",overflowY:"auto",children:Object.entries(J).map(e=>{var t,o,s;let[l,c]=e;return(0,i.jsxs)(mw,{mb:3,bg:M,borderWidth:"2px",borderColor:"purple.300",borderRadius:"lg",p:3,boxShadow:"md",children:[(0,i.jsxs)(Cw,{fontSize:"xs",fontWeight:"bold",color:"purple.600",mb:1,children:[l," (",(null===(t=c.filteredApps)||void 0===t?void 0:t.length)||0," apps)"]}),!1===c.success&&(0,i.jsx)(Cw,{fontSize:"xs",color:"red.500",mb:1,whiteSpace:"pre-wrap",children:c.error||"Could not load apps"}),(0,i.jsxs)(mw,{maxH:"200px",overflowY:"auto",children:[(0,i.jsx)(u_,{columns:1,spacing:1,children:null===(o=c.filteredApps)||void 0===o?void 0:o.map((e,t)=>{const o="string"===typeof e?e:e.name||e.id,s="string"===typeof e?e:e.id||e.packageName||e.bundleId;return(0,i.jsx)(mw,{bg:"white",_dark:{bg:"gray.700"},borderWidth:"1px",borderColor:F,borderRadius:"md",p:2,_hover:{borderColor:"purple.400",transform:"translateY(-1px)"},transition:"all 0.2s ease",children:(0,i.jsxs)(Ew,{spacing:2,justify:"space-between",w:"100%",children:[(0,i.jsxs)(ww,{spacing:0,align:"start",flex:"1",minW:"0",children:[(0,i.jsx)(Cw,{fontSize:"xs",fontWeight:"bold",color:"purple.700",_dark:{color:"purple.300"},noOfLines:1,children:o}),s&&s!==o&&(0,i.jsxs)(Ew,{spacing:1,align:"center",children:[(0,i.jsxs)(Cw,{fontSize:"10px",color:"gray.500",_dark:{color:"gray.400"},fontFamily:"mono",noOfLines:1,opacity:.8,children:["\ud83d\udce6 ",s]}),(0,i.jsx)(Uj,{label:"Copy ID",hasArrow:!0,fontSize:"2xs",children:(0,i.jsx)(qw,{size:"2xs",variant:"ghost",colorScheme:"gray",icon:(0,i.jsx)(eC,{}),"aria-label":"Copy package ID",onClick:e=>((e,t)=>{t&&t.stopPropagation(),e&&(navigator.clipboard&&navigator.clipboard.writeText&&navigator.clipboard.writeText(e),I({title:"Copied",description:"Copied: ".concat(e),status:"info",duration:1500,isClosable:!0}))})(s,e),h:"16px",minW:"16px",p:0})})]})]}),(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(Uj,{label:"Launch",hasArrow:!0,fontSize:"xs",children:(0,i.jsx)(qw,{"aria-label":"Launch app",size:"xs",variant:"solid",colorScheme:"green",icon:(0,i.jsx)(Ck,{}),onClick:()=>{K(o,s)},minW:"auto",h:"auto",p:1})}),(0,i.jsx)(Uj,{label:"Kill",hasArrow:!0,fontSize:"xs",children:(0,i.jsx)(qw,{"aria-label":"Kill app",size:"xs",variant:"solid",colorScheme:"red",icon:(0,i.jsx)(ek,{}),onClick:async()=>{try{await r("kill ".concat(s)),I({title:"App Closed",description:"".concat(o," closed successfully"),status:"success",duration:2e3})}catch(e){I({title:"Close Failed",description:e.message||"Failed to close app",status:"error",duration:3e3})}},minW:"auto",h:"auto",p:1})}),(0,i.jsx)(Uj,{label:"Clear Data",hasArrow:!0,fontSize:"xs",children:(0,i.jsx)(qw,{"aria-label":"Clear app data",size:"xs",variant:"solid",colorScheme:"yellow",icon:(0,i.jsx)(wk,{}),onClick:e=>(async(e,t,o)=>{if(o&&o.stopPropagation(),0!==n.length)try{await r("clear ".concat(t)),I({title:"Data Cleared",description:"".concat(e," data cleared on ").concat(n.length," device(s)"),status:"success",duration:2e3,isClosable:!0})}catch(i){I({title:"Clear Failed",description:i.message||"Failed to clear app data",status:"error",duration:3e3,isClosable:!0})}else I({title:"No Device Selected",description:"Please select at least one device",status:"warning",duration:3e3,isClosable:!0})})(o,s,e),minW:"auto",h:"auto",p:1})}),(0,i.jsx)(Uj,{label:"Add to Quick Launch",hasArrow:!0,fontSize:"xs",children:(0,i.jsx)(qw,{"aria-label":"Save to my apps",size:"xs",variant:"solid",colorScheme:"blue",icon:(0,i.jsx)(kk,{}),onClick:()=>{a(e=>p(p({},e),{},{[o]:{ios:s,android:s}})),I({title:"Added to Quick Launch",description:"".concat(o," added successfully"),status:"success",duration:2e3})},minW:"auto",h:"auto",p:1})}),(0,i.jsx)(Uj,{label:"Uninstall",hasArrow:!0,fontSize:"xs",children:(0,i.jsx)(qw,{"aria-label":"Uninstall app",size:"xs",variant:"outline",colorScheme:"orange",icon:(0,i.jsx)(sk,{}),onClick:async()=>{try{await r("uninstall ".concat(s)),I({title:"App Uninstalled",description:"".concat(o," uninstalled successfully"),status:"success",duration:2e3}),X()}catch(e){I({title:"Uninstall Failed",description:e.message||"Failed to uninstall app",status:"error",duration:3e3})}},minW:"auto",h:"auto",p:1})})]})]})},t)})}),(null===(s=c.filteredApps)||void 0===s?void 0:s.length)>10&&(0,i.jsxs)(Cw,{fontSize:"2xs",color:"gray.500",mt:1,children:["... and ",c.filteredApps.length-10," more apps"]})]})]},l)})})]})]})]})})},kM=t.memo(jM),CM=["className","isExternal"],EM=Dv(function(e,t){const n=Hv("Link",e),r=Ov(e),{className:o,isExternal:a}=r,s=Ki(r,CM);return(0,i.jsx)(Rv.a,p(p({target:a?"_blank":void 0,rel:a?"noopener":void 0,ref:t,className:Lv("chakra-link",o)},s),{},{__css:n}))});EM.displayName="Link";const _M=e=>{let{isConnected:n,isBackendAvailable:r,isInitializing:o=!1,onRetry:a}=e;const s=Ts("white","gray.800"),l=Ts("red.200","red.700"),[c,d]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{if(n||!r)return void d(!1);const e=setTimeout(()=>d(!0),3e3);return()=>clearTimeout(e)},[n,r]),o||n&&r?null:r?!n&&c?(0,i.jsx)(mw,{role:"status",children:(0,i.jsxs)(ix,{status:"warning",variant:"subtle",children:[(0,i.jsx)(ax,{}),(0,i.jsxs)(mw,{flex:"1",children:[(0,i.jsx)(sx,{children:"Reconnecting to backend\u2026"}),(0,i.jsx)(lx,{display:"block",children:"Live mirroring and results are paused until the connection is back."})]}),(0,i.jsx)(Ww,{leftIcon:(0,i.jsx)(Sk,{}),colorScheme:"orange",size:"sm",onClick:a,children:"Retry Now"})]})}):null:(0,i.jsx)(mw,{role:"alert",bg:s,borderBottom:"2px",borderColor:l,boxShadow:"lg",children:(0,i.jsxs)(ix,{status:"error",variant:"solid",flexDirection:"row",alignItems:"center",justifyContent:"space-between",textAlign:"left",py:3,px:4,children:[(0,i.jsxs)(Ew,{spacing:3,flex:"1",children:[(0,i.jsx)(ax,{boxSize:"20px"}),(0,i.jsxs)(mw,{children:[(0,i.jsx)(sx,{fontSize:"sm",mb:0,children:"Backend not reachable"}),(0,i.jsxs)(lx,{fontSize:"xs",mt:1,display:"flex",alignItems:"center",gap:1,children:["Run in terminal:",(0,i.jsx)(eD,{colorScheme:"whiteAlpha",fontSize:"xs",px:2,py:1,bg:"whiteAlpha.300",color:"white",fontWeight:"bold",borderRadius:"md",children:"devicely start"})]})]})]}),(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Ww,{leftIcon:(0,i.jsx)(Sk,{}),colorScheme:"red",variant:"outline",onClick:a,size:"xs",children:"Retry"}),(0,i.jsx)(EM,{href:"https://github.com/sureshkumarm8/Devicely",isExternal:!0,_hover:{textDecoration:"none"},children:(0,i.jsx)(Ww,{leftIcon:(0,i.jsx)(Xk,{}),colorScheme:"red",variant:"ghost",size:"xs",children:"Setup Guide"})})]})]})})};function zM(e){const{viewBox:n="0 0 24 24",d:r,displayName:o,defaultProps:a={}}=e,s=t.Children.toArray(e.path),l=Dv((e,t)=>(0,i.jsx)(Kv,p(p(p({ref:t,viewBox:n},a),e),{},{children:s.length?s:(0,i.jsx)("path",{fill:"currentColor",d:r})})));return l.displayName=o,l}const RM=zM({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),AM=zM({displayName:"MinusIcon",path:(0,i.jsx)("g",{fill:"currentColor",children:(0,i.jsx)("rect",{height:"4",width:"20",x:"2",y:"10"})})}),TM=zM({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"}),PM=zM({displayName:"ViewOffIcon",path:(0,i.jsxs)("g",{fill:"currentColor",children:[(0,i.jsx)("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),(0,i.jsx)("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"})]})}),OM=zM({displayName:"ViewIcon",path:(0,i.jsxs)("g",{fill:"currentColor",children:[(0,i.jsx)("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),(0,i.jsx)("circle",{cx:"12",cy:"12",r:"2"})]})}),LM=zM({displayName:"RepeatIcon",path:(0,i.jsxs)("g",{fill:"currentColor",children:[(0,i.jsx)("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),(0,i.jsx)("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"})]})}),DM=zM({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}),IM=e=>"ios"===e?"":"android"===e?"\ud83e\udd16":"\ud83d\udcf1",NM=(e,t,n)=>{let{zoom:r,isFullscreen:o,viewport:i}=n;if(!e||!t)return null;const a=(null===i||void 0===i?void 0:i.height)||window.innerHeight,s=(null===i||void 0===i?void 0:i.width)||window.innerWidth,l=o?Math.max(300,a-140):560*r,c=o?.65*s:Math.min(900,.55*s);let d=l/t;return e*d>c&&(d=c/e),{width:e*d,height:t*d}},MM=e=>{let{lastAction:n,deviceName:r}=e;const[o,a]=(0,t.useState)(Date.now()),s=!!n&&n.targets.includes(r),l=s?n.results[r]:null,c=s&&!l;if((0,t.useEffect)(()=>{if(!c)return;const e=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(e)},[c]),!s)return null;if(c){return o-(n.startedAt||o)>FM?(0,i.jsx)(Uj,{label:"No result from ".concat(r,' for "').concat(n.label,'"'),children:(0,i.jsx)(zw,{colorScheme:"yellow",fontSize:"xs",textTransform:"none",children:"? no reply"})}):(0,i.jsxs)(zw,{colorScheme:"blue",fontSize:"xs",textTransform:"none",display:"inline-flex",alignItems:"center",gap:1,children:[(0,i.jsx)(Qv,{size:"xs"})," sending"]})}return l.success?(0,i.jsx)(Uj,{label:'"'.concat(n.label,'" succeeded').concat(l.ms?" in ".concat(l.ms," ms"):""),children:(0,i.jsx)(zw,{colorScheme:"green",fontSize:"xs",textTransform:"none",children:"\u2713 ok"})}):(0,i.jsx)(Uj,{label:'"'.concat(n.label,'" failed').concat(l.step?" at ".concat(l.step):"",": ").concat(l.error||"unknown error"),children:(0,i.jsx)(zw,{colorScheme:"red",fontSize:"xs",textTransform:"none",children:"\u2717 failed"})})},FM=1e4,WM=e=>{let{ws:n,commanderStatus:r,connectedDevices:o=[],onSwapCommander:a,onMirrorStart:s,onBroadcastAction:l,targetDevices:c=[],onToggleTarget:d,onSetTargets:u,lastAction:h,toolbarExtras:f}=e;const[m,g]=(0,t.useState)(null),[v,x]=(0,t.useState)(null),[b,y]=(0,t.useState)(null),[w,S]=(0,t.useState)({width:375,height:667}),[j,k]=(0,t.useState)(.85),[C,E]=(0,t.useState)(!1),[_,z]=(0,t.useState)(()=>{try{const e=localStorage.getItem("devicely_show_inspector");return!!e&&JSON.parse(e)}catch(e){return!1}}),[R,A]=(0,t.useState)([]),[T,P]=(0,t.useState)(null),[O,L]=(0,t.useState)(null),[D,I]=(0,t.useState)(null),[N,M]=(0,t.useState)(!1),[F,W]=(0,t.useState)({}),B=(0,t.useRef)(null),U=(0,t.useRef)(null),V=(0,t.useRef)(null),H=(0,t.useRef)({}),q=(0,t.useRef)(new Set),$=(0,t.useRef)(null),Y=(0,t.useRef)(null),K=(0,t.useRef)(null),X=(0,t.useRef)(null),[G,J]=(0,t.useState)(!1),[Q,Z]=(0,t.useState)({width:window.innerWidth,height:window.innerHeight}),ee=hw();(0,t.useEffect)(()=>{const e=()=>Z({width:window.innerWidth,height:window.innerHeight}),t=()=>{J(!!document.fullscreenElement&&document.fullscreenElement===X.current),e()};return window.addEventListener("resize",e),document.addEventListener("fullscreenchange",t),()=>{window.removeEventListener("resize",e),document.removeEventListener("fullscreenchange",t)}},[]);const te=t.useCallback(async()=>{if(_)if(null!==r&&void 0!==r&&r.isActive&&null!==r&&void 0!==r&&r.commander){M(!0);try{console.info("[Inspector] Loading elements from commander session...");const e=await fetch("".concat(yE,"/api/commander/get-all-locators"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceName:r.commander,refresh:!0})});if(!e.ok)throw new Error("HTTP ".concat(e.status,": ").concat(e.statusText));const t=await e.json();if(!t.success||!t.elements)throw new Error(t.error||"No elements found");console.info("[Inspector] \u2705 Loaded ".concat(t.elements.length," elements")),A(t.elements),ee({title:"\u2713 Loaded ".concat(t.elements.length," elements"),status:"success",duration:2e3})}catch(e){console.error("[Inspector] Failed to load elements:",e),ee({title:"Failed to load elements",description:e.message,status:"error",duration:3e3})}finally{M(!1)}}else console.info("[Inspector] Commander not ready, skipping element load")},[_,ee,null===r||void 0===r?void 0:r.commander,null===r||void 0===r?void 0:r.isActive]);(0,t.useEffect)(()=>{null!==r&&void 0!==r&&r.commander&&r.commander!==B.current&&(B.current=r.commander,E(!0),m&&x(m))},[null===r||void 0===r?void 0:r.commander,m]),(0,t.useEffect)(()=>{m&&C&&(E(!1),y(null))},[m,C]);const ne=(0,t.useMemo)(()=>({isActive:null===r||void 0===r?void 0:r.isActive,commander:null===r||void 0===r?void 0:r.commander,followers:null===r||void 0===r?void 0:r.followers}),[null===r||void 0===r?void 0:r.isActive,null===r||void 0===r?void 0:r.commander,null===r||void 0===r?void 0:r.followers]);(0,t.useEffect)(()=>{if(!n)return;const e=e=>{try{const n=JSON.parse(e.data);if("screen_frame"===n.type)!ne.isActive||n.deviceName&&n.deviceName!==ne.commander||(g(n.image),n.windowSize&&S(n.windowSize),s&&ne.commander&&!q.current.has(ne.commander)&&(q.current.add(ne.commander),s(ne.commander)));else if("follower_screen"===n.type)W(e=>p(p({},e),{},{[n.deviceId]:n.image})),s&&n.deviceId&&!q.current.has(n.deviceId)&&(q.current.add(n.deviceId),s(n.deviceId));else if("clear_followers"===n.type){var t;W({}),null===(t=ne.followers)||void 0===t||t.forEach(e=>{const t=(null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.deviceId)||e;q.current.delete(t)})}else if("follower_removed"===n.type||"device_mirror_stopped"===n.type&&n.deviceName!==ne.commander){const e=n.deviceName||n.deviceId;e&&(W(t=>{const n=p({},t);return delete n[e],n}),q.current.delete(e))}else"commander_stopped"===n.type||"device_mirror_stopped"===n.type&&n.deviceName===ne.commander?(g(null),x(null),ne.commander&&q.current.delete(ne.commander)):"stop_screenshot_stream"===n.type?n.deviceName===ne.commander?(g(null),x(null),q.current.delete(n.deviceName)):n.deviceName&&(W(e=>{const t=p({},e);return delete t[n.deviceName],t}),q.current.delete(n.deviceName)):"window_size"===n.type&&S(n.windowSize)}catch(n){console.error("[ScreenMirror] WebSocket parse error:",n.message)}};return n.addEventListener("message",e),()=>{n.removeEventListener("message",e)}},[n,s,ne]),(0,t.useEffect)(()=>{const e=m||v;if(e&&U.current){const t=U.current,n=t.getContext("2d"),r=new Image;r.onload=()=>{t.width=r.naturalWidth,t.height=r.naturalHeight,n.clearRect(0,0,t.width,t.height),n.drawImage(r,0,0);const e=NM(r.naturalWidth,r.naturalHeight,{zoom:j,isFullscreen:G,viewport:Q});e&&(t.style.width="".concat(e.width,"px"),t.style.height="".concat(e.height,"px"))},r.src=e,K.current=r}else if(!e&&U.current){const e=U.current;e.getContext("2d").clearRect(0,0,e.width,e.height)}},[m,v,j,G,Q]),(0,t.useEffect)(()=>{if(!U.current)return;const e=requestAnimationFrame(()=>{var e;null===r||void 0===r||null===(e=r.followers)||void 0===e||e.forEach(e=>{const t=e.deviceId||e,n=F[t],r=H.current[t];if(n&&r){const e=r.getContext("2d"),o=new Image;o.onload=()=>{r.width=o.naturalWidth,r.height=o.naturalHeight,e.clearRect(0,0,r.width,r.height),e.drawImage(o,0,0)},o.onerror=()=>{console.error("[ScreenMirror] Failed to load image for follower ".concat(t))},o.src=n}})});return()=>cancelAnimationFrame(e)},[F,null===r||void 0===r?void 0:r.followers]),(0,t.useEffect)(()=>{if(m&&V.current&&_){const e=V.current,t=e.getContext("2d"),n=new Image;n.onload=()=>{e.width=n.naturalWidth,e.height=n.naturalHeight,t.clearRect(0,0,e.width,e.height),t.drawImage(n,0,0);const r=NM(n.naturalWidth,n.naturalHeight,{zoom:j,isFullscreen:G,viewport:Q});r&&(e.style.width="".concat(r.width,"px"),e.style.height="".concat(r.height,"px"))},n.src=m}},[m,j,_,G,Q]);const re=e=>{if(!m||null===r||void 0===r||!r.isActive)return;const t=U.current;if(!K.current||!t)return;const n=t.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top;if(o<0||i<0||o>n.width||i>n.height)return;const a=(null===w||void 0===w?void 0:w.width)||t.width,s=(null===w||void 0===w?void 0:w.height)||t.height,c=a/n.width,d=s/n.height,u=Math.round(o*c),h=Math.round(i*d);if(Y.current={time:Date.now(),deviceX:u,deviceY:h,startClientX:e.clientX,startClientY:e.clientY,dragging:!1},void 0!==e.pointerId&&t.setPointerCapture)try{t.setPointerCapture(e.pointerId)}catch(p){}$.current&&clearTimeout($.current),$.current=setTimeout(()=>{console.info("[LONGPRESS] at display(".concat(u,", ").concat(h,")")),l&&l("longpress ".concat(u,",").concat(h)),Y.current=null},500)},oe=e=>{if($.current&&(clearTimeout($.current),$.current=null),!Y.current)return;const{time:t,deviceX:n,deviceY:r,startClientX:o,startClientY:i,dragging:a}=Y.current,s=Date.now()-t;Y.current=null;const c=U.current;if(c&&e&&void 0!==e.clientX){const t=c.getBoundingClientRect(),a=(null===w||void 0===w?void 0:w.width)||c.width,d=(null===w||void 0===w?void 0:w.height)||c.height,u=a/t.width,h=d/t.height,p=Math.round((e.clientX-t.left)*u),f=Math.round((e.clientY-t.top)*h);if(Math.hypot(e.clientX-o,e.clientY-i)>30){const e=Math.max(150,Math.min(s,1500));return console.info("[SWIPE] from (".concat(n,", ").concat(r,") to (").concat(p,", ").concat(f,") in ").concat(e,"ms")),void(l&&l("swipe ".concat(n,",").concat(r,",").concat(p,",").concat(f,",").concat(e)))}}s<500&&!a&&(console.info("[TAP] Click at display(".concat(n,", ").concat(r,")")),l&&l("click ".concat(n,",").concat(r)))},ie=e=>{if(!e)return{};const t=(e.name||e.label||e.text||"").trim(),n=Math.round(e.x+(e.width||0)/2),r=Math.round(e.y+(e.height||0)/2),o="".concat(n,",").concat(r);return{cli:t?'devicely click "'.concat(t,'"'):"devicely tap ".concat(o),wdio:t?"$('~".concat(t,"').click();"):e.xpath?"$('".concat(e.xpath,"').click();"):"browser.touchAction({ action: 'tap', x: ".concat(n,", y: ").concat(r," });"),python:t?'driver.find_element(AppiumBy.ACCESSIBILITY_ID, "'.concat(t,'").click()'):e.xpath?'driver.find_element(AppiumBy.XPATH, "'.concat(e.xpath,'").click()'):"driver.tap([(".concat(o,")])"),java:t?'driver.findElement(AppiumBy.accessibilityId("'.concat(t,'")).click();'):e.xpath?'driver.findElement(By.xpath("'.concat(e.xpath,'")).click();'):"// tap at ".concat(o),xpath:e.xpath||(t?'//*[@text="'.concat(t,'"]'):"")}},ae=(e,t)=>{var n;null!==(n=navigator.clipboard)&&void 0!==n&&n.writeText&&navigator.clipboard.writeText(e),ee({title:"Copied ".concat(t),description:e,status:"info",duration:1800})};if(t.useEffect(()=>{null!==r&&void 0!==r&&r.isActive&&null!==r&&void 0!==r&&r.commander||(console.info("[ScreenMirror] Commander inactive or no commander, clearing screens"),W({}),g(null),x(null))},[null===r||void 0===r?void 0:r.isActive,null===r||void 0===r?void 0:r.commander]),t.useEffect(()=>{if(null!==r&&void 0!==r&&r.commander){const e=o.find(e=>e.name===r.commander);e&&"online"===e.status||(console.info("[ScreenMirror] Commander device ".concat(r.commander," offline/missing, clearing commander screen")),g(null),x(null))}W(e=>{let t=!1;const n=p({},e);for(const r of Object.keys(n)){const e=o.find(e=>e.name===r);e&&"online"===e.status||(delete n[r],t=!0)}return t?n:e})},[o,null===r||void 0===r?void 0:r.commander]),null===r||void 0===r||!r.isActive)return(0,i.jsx)(mw,{className:"screen-mirror-container",w:"100%",overflow:"visible",children:(0,i.jsx)(ww,{spacing:2,align:"stretch",w:"100%",children:(0,i.jsx)(mw,{position:"relative",mt:0,w:"100%",minH:"500px",bg:"linear-gradient(to bottom, #0f172a 0%, #1e293b 50%, #334155 100%)",borderRadius:"12px",p:4,overflow:"visible",display:"flex",alignItems:"center",justifyContent:"center",children:(0,i.jsx)(yD,{h:"100%",children:(0,i.jsxs)(ww,{spacing:4,maxW:"460px",textAlign:"center",children:[(0,i.jsx)(Cw,{fontSize:"lg",color:"gray.200",fontWeight:"700",children:"Ready to start Commander Mode"}),(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.400",children:"Control all your mobile devices in real time from one unified stage."}),(0,i.jsxs)(Ew,{spacing:4,pt:2,pb:1,justify:"center",children:[(0,i.jsxs)(ww,{spacing:1,children:[(0,i.jsx)(zw,{colorScheme:"teal",borderRadius:"full",px:2,py:.5,fontSize:"xs",children:"1"}),(0,i.jsx)(Cw,{fontSize:"2xs",color:"gray.300",fontWeight:"600",children:"Discover"})]}),(0,i.jsx)(Cw,{color:"gray.500",children:"\u2192"}),(0,i.jsxs)(ww,{spacing:1,children:[(0,i.jsx)(zw,{colorScheme:"blue",borderRadius:"full",px:2,py:.5,fontSize:"xs",children:"2"}),(0,i.jsx)(Cw,{fontSize:"2xs",color:"gray.300",fontWeight:"600",children:"Connect"})]}),(0,i.jsx)(Cw,{color:"gray.500",children:"\u2192"}),(0,i.jsxs)(ww,{spacing:1,children:[(0,i.jsx)(zw,{colorScheme:"purple",borderRadius:"full",px:2,py:.5,fontSize:"xs",children:"3"}),(0,i.jsx)(Cw,{fontSize:"2xs",color:"gray.300",fontWeight:"600",children:"Control"})]})]}),(0,i.jsxs)(ww,{spacing:1.5,align:"start",color:"gray.400",fontSize:"xs",bg:"blackAlpha.400",p:3,borderRadius:"lg",w:"full",children:[(0,i.jsx)(Cw,{children:"\u2022 Connect any phone or launch a virtual emulator"}),(0,i.jsxs)(Cw,{children:["\u2022 Click ",(0,i.jsx)("b",{children:"Connect"})," on any card to initiate live mirroring"]}),(0,i.jsx)(Cw,{children:"\u2022 Tap and swipe anywhere on the live screen to command"})]})]})})})})});const se=Array.from(new Map(((null===r||void 0===r?void 0:r.followers)||[]).filter(Boolean).map(e=>[e.deviceId||e.name||e,e])).values()),le=se.map(e=>(null===e||void 0===e?void 0:e.deviceId)||(null===e||void 0===e?void 0:e.name)||e),ce=le.filter(e=>c.includes(e)),de=null===r||void 0===r?void 0:r.commander,ue=e=>o.find(t=>t.name===e||t.udid===e||t.deviceName===e||t.serial===e||t.id===e),he=ue(de),pe="ios"===(null===he||void 0===he?void 0:he.platform),fe=(me=se.length)<=2?220:me<=6?160:128;var me;const ge=(()=>{if(!h||"mirror"!==h.kind||0===h.targets.length)return null;const e=h.targets.map(e=>[e,h.results[e]]),t=e.filter(e=>{let[,t]=e;return t}),n=t.filter(e=>{let[,t]=e;return!t.success}),r=Date.now()-(h.startedAt||0)>FM;if(t.length<e.length&&!r)return{color:"blue",text:"".concat(h.label,": ").concat(t.length,"/").concat(e.length," done\u2026")};if(0===n.length&&t.length===e.length)return{color:"green",text:"".concat(h.label,": \u2713 ").concat(t.length,"/").concat(e.length," ok")};const o=[...n.map(e=>{let[t]=e;return"".concat(t," failed")}),...e.filter(e=>{let[,t]=e;return!t}).map(e=>{let[t]=e;return"".concat(t," no reply")})];return{color:n.length?"red":"yellow",text:"".concat(h.label,": ").concat(t.length-n.length,"/").concat(e.length," ok \xb7 ").concat(o.join(", "))}})(),ve={size:"xs",variant:"outline",color:"gray.100",borderColor:"whiteAlpha.400",_hover:{bg:"whiteAlpha.200"}};return(0,i.jsx)(mw,{className:"screen-mirror-container",w:"100%",children:(0,i.jsxs)(mw,{ref:X,w:"100%",h:G?"100vh":void 0,display:G?"flex":void 0,flexDirection:G?"column":void 0,bg:"linear-gradient(to bottom, #0f172a 0%, #1e293b 50%, #334155 100%)",borderRadius:G?0:"12px",overflow:"hidden",children:[(0,i.jsxs)(Ew,{px:3,py:2,spacing:2,flexWrap:"wrap",rowGap:2,borderBottom:"1px solid",borderColor:"whiteAlpha.200",bg:"blackAlpha.300",children:[(0,i.jsxs)(NP,{children:[(0,i.jsx)(Uj,{label:"The commander is the screen you tap. Pick a different device to control from.",children:(0,i.jsx)(WP,{as:Ww,rightIcon:(0,i.jsx)(RM,{}),size:"xs",colorScheme:"purple","aria-label":"Commander: ".concat(de||"none",". Change commander"),maxW:"240px",children:(0,i.jsxs)(Cw,{as:"span",noOfLines:1,children:["\ud83d\udc51 ",de||"No commander"]})})}),(0,i.jsx)(HP,{bg:"gray.800",borderColor:"purple.500",zIndex:30,children:o.filter(e=>"online"===((null===e||void 0===e?void 0:e.status)||"online")).map(e=>{const t=(null===e||void 0===e?void 0:e.name)||e,n=t===de;return(0,i.jsxs)(JP,{onClick:()=>{!n&&a&&(E(!0),y(t),a(t))},bg:n?"purple.700":"transparent",color:"white",_hover:{bg:"purple.600"},fontWeight:n?"bold":"normal",fontSize:"sm",children:[n?"\u2713 ":"",t]},t)})})]}),(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.200","data-testid":"mirror-target-summary",children:0===se.length?"Taps go to the commander only":"Taps go to the commander + ".concat(ce.length," of ").concat(se.length," follower").concat(se.length>1?"s":"")}),se.length>0&&u&&(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(Ww,p(p({},ve),{},{onClick:()=>u([...new Set([de,...le].filter(Boolean))]),isDisabled:ce.length===se.length,children:"Include all"})),(0,i.jsx)(Ww,p(p({},ve),{},{onClick:()=>u(de?[de]:[]),isDisabled:0===ce.length,children:"Commander only"}))]}),(0,i.jsx)(mw,{flex:"1"}),ge&&(0,i.jsx)(zw,{colorScheme:ge.color,fontSize:"xs",textTransform:"none",maxW:"360px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",title:ge.text,role:"status",children:ge.text}),f,(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(Uj,{label:"Zoom out",children:(0,i.jsx)(qw,p(p({"aria-label":"Zoom out",icon:(0,i.jsx)(AM,{})},ve),{},{onClick:()=>k(e=>Math.max(.5,e-.1)),isDisabled:j<=.5}))}),(0,i.jsxs)(Cw,{fontSize:"xs",color:"gray.100",minW:"40px",textAlign:"center",children:[Math.round(100*j),"%"]}),(0,i.jsx)(Uj,{label:"Zoom in",children:(0,i.jsx)(qw,p(p({"aria-label":"Zoom in",icon:(0,i.jsx)(TM,{})},ve),{},{onClick:()=>k(e=>Math.min(2,e+.1)),isDisabled:j>=2}))}),(0,i.jsx)(Uj,{label:"Fit mirror to viewport height",children:(0,i.jsx)(Ww,p(p({},ve),{},{fontSize:"2xs",px:2,isDisabled:G,onClick:()=>{const e=Math.max(300,window.innerHeight-260),t=Math.min(2,Math.max(.5,e/560));k(parseFloat(t.toFixed(2)))},children:"Fit"}))}),(0,i.jsx)(Uj,{label:G?"Exit full screen (Esc)":"Full screen",children:(0,i.jsx)(qw,p(p({"aria-label":G?"Exit full screen":"Full screen","aria-pressed":G,icon:(0,i.jsx)(Cw,{as:"span",fontSize:"sm",lineHeight:1,children:G?"\u2921":"\u2922"})},ve),{},{onClick:async()=>{try{var e;document.fullscreenElement?await document.exitFullscreen():null!==(e=X.current)&&void 0!==e&&e.requestFullscreen&&await X.current.requestFullscreen()}catch(t){ee({title:"Fullscreen unavailable",description:t.message,status:"warning",duration:2500})}}}))}),(0,i.jsx)(Uj,{label:_?"Hide locators":"Show locators",children:(0,i.jsx)(qw,p(p({"aria-label":_?"Hide locators":"Show locators","aria-pressed":_,icon:_?(0,i.jsx)(PM,{}):(0,i.jsx)(OM,{})},ve),{},{colorScheme:_?"orange":void 0,onClick:()=>{const e=!_;z(e);try{localStorage.setItem("devicely_show_inspector",JSON.stringify(e))}catch(kF){console.warn("Failed to save inspector state:",kF)}e&&null!==r&&void 0!==r&&r.isActive&&setTimeout(()=>te(),100)}}))})]})]}),(0,i.jsxs)(fw,{p:4,gap:4,align:"flex-start",minH:G?0:"420px",maxH:G?void 0:"calc(100vh - 200px)",flex:G?"1":void 0,overflow:G?"hidden":void 0,"data-testid":"mirror-stage",children:[(0,i.jsxs)(ww,{spacing:2,flexShrink:0,align:"center","data-testid":"commander-tile",children:[(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsxs)(zw,{bg:"rgba(168, 85, 247, 0.2)",color:"purple.200",fontSize:"xs",px:3,py:1,borderRadius:"full",border:"1px solid",borderColor:"purple.400",textTransform:"none",maxW:"220px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",title:de,children:["\ud83d\udc51 ",de||"Commander"]}),(0,i.jsx)(MM,{lastAction:h,deviceName:de})]}),(0,i.jsxs)(mw,{position:"relative",children:[(0,i.jsx)("canvas",{ref:U,tabIndex:0,className:"screen-canvas commander-canvas",onPointerDown:re,onPointerMove:e=>{const t=Y.current;t&&!t.dragging&&Math.hypot(e.clientX-t.startClientX,e.clientY-t.startClientY)>10&&(t.dragging=!0,$.current&&(clearTimeout($.current),$.current=null))},onPointerUp:oe,onPointerLeave:e=>{var t;const n=U.current;void 0!==(null===e||void 0===e?void 0:e.pointerId)&&null!==n&&void 0!==n&&null!==(t=n.hasPointerCapture)&&void 0!==t&&t.call(n,e.pointerId)||($.current&&(clearTimeout($.current),$.current=null),Y.current=null)},onPointerCancel:()=>{$.current&&(clearTimeout($.current),$.current=null),Y.current=null},onKeyDown:e=>{if(("Enter"===e.key||" "===e.key)&&(e.preventDefault(),U.current)){const e=U.current.getBoundingClientRect();re({clientX:e.left+e.width/2,clientY:e.top+e.height/2,preventDefault:()=>{}}),setTimeout(()=>{oe({clientX:e.left+e.width/2,clientY:e.top+e.height/2})},50)}},"aria-label":"Live screen of ".concat(de,". Press Enter to tap center, or click to tap anywhere."),role:"application",style:{cursor:"pointer",display:"block",touchAction:"none",background:"#000",borderRadius:pe?"30px":"12px",boxShadow:pe?"0 25px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.1)":"0 15px 40px rgba(0,0,0,0.4)",border:pe?"1px solid #1a1a1a":"1px solid #333",opacity:C?.6:1,transition:"opacity 0.3s ease",minWidth:m?void 0:"200px",minHeight:m?void 0:"400px"}}),!m&&!C&&(0,i.jsx)(yD,{position:"absolute",inset:0,pointerEvents:"none",children:(0,i.jsxs)(ww,{spacing:2,children:[(0,i.jsx)(Qv,{size:"sm",color:"purple.300"}),(0,i.jsx)(Cw,{color:"gray.300",fontSize:"xs",children:"Waiting for first frame\u2026"})]})}),C&&(0,i.jsxs)(mw,{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:10,textAlign:"center",children:[(0,i.jsx)(Qv,{size:"lg",color:"purple.400",thickness:"4px",mb:3}),(0,i.jsxs)(Cw,{color:"white",fontSize:"sm",fontWeight:"600",mt:2,children:["Switching to ",b,"..."]})]})]}),(0,i.jsx)(Cw,{fontSize:"xs",color:"purple.200",textAlign:"center",maxW:"260px",children:0===ce.length?"Click to tap ".concat(de||"the commander"," only"):"Click to tap ".concat(de||"the commander"," + ").concat(ce.length," follower").concat(ce.length>1?"s":"")})]}),_&&(0,i.jsxs)(ww,{spacing:3,position:"relative",flexShrink:0,children:[(0,i.jsxs)(Ew,{justify:"space-between",w:"100%",children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"bold",color:"white",children:"\ud83d\udd0d Element Inspector"}),(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsxs)(zw,{colorScheme:"purple",fontSize:"xs",px:2,children:[R.length," elements"]}),N&&(0,i.jsx)(zw,{colorScheme:"orange",fontSize:"xs",px:2,children:"Loading..."}),!(null!==r&&void 0!==r&&r.isActive)&&(0,i.jsx)(zw,{colorScheme:"red",fontSize:"xs",px:2,children:"Commander not active"}),(null===r||void 0===r?void 0:r.isActive)&&0===R.length&&!N&&(0,i.jsx)(zw,{colorScheme:"yellow",fontSize:"xs",px:2,children:"Inspector Ready"}),(0,i.jsx)(Uj,{label:"Refresh Locators",placement:"bottom",children:(0,i.jsx)(qw,{icon:(0,i.jsx)(LM,{}),size:"xs",colorScheme:"purple",variant:"solid",bg:"rgba(147, 51, 234, 0.1)",backdropFilter:"blur(10px)",border:"1px solid rgba(147, 51, 234, 0.3)",color:"white",onClick:te,isLoading:N,isDisabled:!(null!==r&&void 0!==r&&r.isActive),_hover:{bg:"rgba(147, 51, 234, 0.15)",borderColor:"rgba(147, 51, 234, 0.5)"}})})]})]}),(0,i.jsxs)(mw,{position:"relative",display:"inline-block",lineHeight:0,children:[(0,i.jsx)("canvas",{ref:V,className:"screen-canvas",style:{cursor:"default",borderRadius:"12px",display:"block",boxShadow:"0 0 20px rgba(147, 51, 234, 0.5)"}}),R.length>0&&(()=>{const e=V.current;if(!e)return null;const t=e.getBoundingClientRect(),n=t.width,o=t.height,a=(null===w||void 0===w?void 0:w.width)||e.width,s=(null===w||void 0===w?void 0:w.height)||e.height;if(!a||!s||!n||!o)return null;const l=n/a,d=o/s;return R.filter(e=>{if(e.width*e.height/(a*s)>.7)return!1;if(e.width<10&&e.height<10)return!1;if(!e.label||"Unlabeled"===e.label||""===e.label.trim()){if(!["Button","TextField","Switch","Slider"].some(t=>e.type.includes(t)))return!1}return!0}).map((e,t)=>{const n=e.x*l,o=e.y*d,a=e.width*l,s=e.height*d,u=D===t,h=T===t,p={Button:{bg:"rgba(59, 130, 246, 0.3)",border:"rgb(37, 99, 235)"},StaticText:{bg:"rgba(16, 185, 129, 0.25)",border:"rgb(5, 150, 105)"},TextField:{bg:"rgba(245, 158, 11, 0.25)",border:"rgb(217, 119, 6)"},Cell:{bg:"rgba(168, 85, 247, 0.25)",border:"rgb(147, 51, 234)"}}[e.type]||{bg:"rgba(156, 163, 175, 0.25)",border:"rgb(107, 114, 128)"};return(0,i.jsx)(mw,{position:"absolute",left:"".concat(n,"px"),top:"".concat(o,"px"),width:"".concat(a,"px"),height:"".concat(s,"px"),bg:u||h?p.border.replace("rgb","rgba").replace(")",", 0.4)"):p.bg,border:"2px solid ".concat(p.border),borderRadius:"3px",cursor:"pointer",zIndex:h?25:20,transition:"all 0.2s",onClick:()=>(async(e,t)=>{if(P(t),L(e),!m||null===r||void 0===r||!r.isActive)return void ee({title:"Commander mode not active",status:"warning",duration:2e3});const n=Math.round(e.x+e.width/2),o=Math.round(e.y+e.height/2);console.info('[Inspector] Tapping element "'.concat(e.label||e.type,'"')),console.info("[Inspector] Element bounds: (".concat(e.x,", ").concat(e.y,"); ").concat(e.width,"x").concat(e.height)),console.info("[Inspector] Device coordinates: (".concat(n,", ").concat(o,");"));try{const t=await fetch("".concat(yE,"/api/commander/screen-click"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({x:n,y:o,windowSize:w,targets:c})}),r=await t.json();if(!r.success)throw new Error(r.error||"Tap failed");ee({title:"\u2713 Tapped: ".concat(e.label||e.type),description:"Coordinates: (".concat(n,", ").concat(o,")"),status:"success",duration:1500})}catch(i){console.error("[Inspector] Tap failed:",i),ee({title:"Tap failed",description:i.message,status:"error",duration:2e3})}})(e,t),onMouseEnter:()=>I(t),onMouseLeave:()=>I(null),_hover:{bg:p.border.replace("rgb","rgba").replace(")",", 0.5)"),transform:"scale(1.02)"},children:(u||h)&&e.label&&"Unlabeled"!==e.label&&(0,i.jsx)(mw,{position:"absolute",top:"-28px",left:"0",bg:"rgba(0,0,0,0.95)",color:"white",px:3,py:1.5,borderRadius:"md",fontSize:"11px",fontWeight:"bold",whiteSpace:"nowrap",maxW:"280px",overflow:"hidden",textOverflow:"ellipsis",boxShadow:"0 3px 12px rgba(0,0,0,0.8)",border:"1px solid rgba(255,255,255,0.3)",zIndex:30,pointerEvents:"none",children:e.label})},"inspector-overlay-".concat(t))})})()]}),O?(0,i.jsxs)(mw,{w:"100%",maxW:"260px",bg:"rgba(15, 23, 42, 0.9)",backdropFilter:"blur(8px)",border:"1px solid",borderColor:"purple.400",borderRadius:"md",p:2,mt:2,textAlign:"left",children:[(0,i.jsxs)(Ew,{justify:"space-between",mb:1,children:[(0,i.jsx)(Cw,{fontSize:"xs",fontWeight:"bold",color:"purple.200",noOfLines:1,children:O.label||O.name||O.type}),(0,i.jsx)(qw,{size:"xs",variant:"ghost",color:"gray.400",icon:(0,i.jsx)(DM,{boxSize:2}),"aria-label":"Deselect",minW:"auto",h:"auto",p:1,onClick:()=>{L(null),P(null)}})]}),(0,i.jsxs)(Cw,{fontSize:"10px",color:"gray.400",fontFamily:"mono",mb:1.5,children:["(",Math.round(O.x+O.width/2),", ",Math.round(O.y+O.height/2),") \u2022 ",O.type]}),(0,i.jsx)(Cw,{fontSize:"10px",fontWeight:"semibold",color:"purple.300",mb:1,children:"Copy code:"}),(0,i.jsxs)(u_,{columns:2,spacing:1,children:[(0,i.jsx)(Ww,{size:"xs",fontSize:"10px",h:"20px",variant:"outline",colorScheme:"purple",onClick:()=>ae(ie(O).cli,"CLI"),children:"CLI"}),(0,i.jsx)(Ww,{size:"xs",fontSize:"10px",h:"20px",variant:"outline",colorScheme:"blue",onClick:()=>ae(ie(O).wdio,"WDIO"),children:"WDIO"}),(0,i.jsx)(Ww,{size:"xs",fontSize:"10px",h:"20px",variant:"outline",colorScheme:"yellow",onClick:()=>ae(ie(O).python,"Python"),children:"Python"}),(0,i.jsx)(Ww,{size:"xs",fontSize:"10px",h:"20px",variant:"outline",colorScheme:"orange",onClick:()=>ae(ie(O).java,"Java"),children:"Java"})]})]}):(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.300",textAlign:"center",mt:2,children:"\ud83d\udca1 Click an element to tap it & inspect locators"})]}),se.length>0?(0,i.jsx)(mw,{flex:"1",minW:0,alignSelf:"stretch",overflowY:"auto",pr:1,"data-testid":"follower-grid",children:(0,i.jsx)(mw,{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(fe,"px, 1fr))"),gap:3,children:se.map(e=>{const t=(null===e||void 0===e?void 0:e.deviceId)||(null===e||void 0===e?void 0:e.name)||e,n=ue(t),r="ios"===((null===n||void 0===n?void 0:n.platform)||(null===e||void 0===e?void 0:e.platform)),o=c.includes(t),a=h&&h.targets.includes(t)?h.results[t]:null,s=a&&!a.success?"red.400":o?"cyan.500":"whiteAlpha.300";return(0,i.jsxs)(mw,{borderWidth:"2px",borderStyle:o?"solid":"dashed",borderColor:s,borderRadius:"lg",p:2,bg:"blackAlpha.300","data-testid":"follower-tile","data-device":t,"data-targeted":o,children:[(0,i.jsxs)(Ew,{justify:"space-between",spacing:1,mb:2,minW:0,children:[(0,i.jsxs)(Cw,{fontSize:"xs",fontWeight:"600",color:"gray.100",noOfLines:1,title:t,children:[IM((null===n||void 0===n?void 0:n.platform)||(null===e||void 0===e?void 0:e.platform))," ",t]}),(0,i.jsx)(MM,{lastAction:h,deviceName:t})]}),(0,i.jsxs)(mw,{position:"relative",opacity:o?1:.5,transition:"opacity 0.2s",children:[(0,i.jsx)("canvas",{ref:e=>{e&&(H.current[t]=e)},"aria-label":"Live screen of ".concat(t),role:"img",style:{display:"block",width:"100%",height:"auto",aspectRatio:F[t]?void 0:"9 / 19.5",background:"#000",borderRadius:r?"18px":"8px",border:"1px solid #333"}}),!F[t]&&(0,i.jsx)(yD,{position:"absolute",inset:0,pointerEvents:"none",children:(0,i.jsx)(Cw,{color:"gray.400",fontSize:"xs",children:"Waiting for first frame\u2026"})})]}),d&&(0,i.jsx)(Uj,{label:"".concat(t,o?" receives taps and commands. Click to pause it.":" is mirrored but ignores input. Click to include it."),children:(0,i.jsx)(Ww,{size:"xs",w:"full",mt:2,colorScheme:o?"cyan":"gray",variant:o?"solid":"outline",color:o?void 0:"gray.200","aria-pressed":o,"aria-label":"".concat(o?"Pause":"Include"," ").concat(t),onClick:()=>d(t),children:o?"\u2713 Included":"\u23f8 Paused"})})]},t)})})}):(0,i.jsx)(yD,{flex:"1",alignSelf:"stretch",borderWidth:"1px",borderStyle:"dashed",borderColor:"whiteAlpha.300",borderRadius:"lg",p:6,children:(0,i.jsxs)(ww,{spacing:1,maxW:"320px",textAlign:"center",children:[(0,i.jsx)(Cw,{color:"gray.200",fontSize:"sm",fontWeight:"600",children:"No followers yet"}),(0,i.jsx)(Cw,{color:"gray.400",fontSize:"xs",children:"Connect another device and it will appear here, paused. Include it to mirror your taps onto it."})]})})]})]})})};class BM{static async getStatus(){const e=new AbortController,t=setTimeout(()=>e.abort(),5e3);try{const n=await fetch("".concat(yE,"/api/commander/status"),{signal:e.signal});if(clearTimeout(t),!n.ok)throw new Error("HTTP ".concat(n.status,": ").concat(n.statusText));return n.json()}catch(n){throw clearTimeout(t),n}}static async startCommander(e){const t=new AbortController,n=setTimeout(()=>t.abort(),1e4);try{const r=await fetch("".concat(yE,"/api/commander/start"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceName:e}),signal:t.signal});if(clearTimeout(n),!r.ok){const e=await r.text();throw new Error("HTTP ".concat(r.status,": ").concat(e||r.statusText))}return r.json()}catch(r){throw clearTimeout(n),r}}static async stopCommander(){const e=new AbortController,t=setTimeout(()=>e.abort(),5e3);try{const n=await fetch("".concat(yE,"/api/commander/stop"),{method:"POST",headers:{"Content-Type":"application/json"},signal:e.signal});if(clearTimeout(t),!n.ok)throw new Error("HTTP ".concat(n.status,": ").concat(n.statusText));return n.json()}catch(n){throw clearTimeout(t),n}}static async addFollower(e){const t=new AbortController,n=setTimeout(()=>t.abort(),5e3);try{const r=await fetch("".concat(yE,"/api/commander/add-follower"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceName:e}),signal:t.signal});if(clearTimeout(n),!r.ok)throw new Error("HTTP ".concat(r.status,": ").concat(r.statusText));return r.json()}catch(r){throw clearTimeout(n),r}}static async removeFollower(e){const t=new AbortController,n=setTimeout(()=>t.abort(),5e3);try{const r=await fetch("".concat(yE,"/api/commander/remove-follower"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceName:e}),signal:t.signal});if(clearTimeout(n),!r.ok)throw new Error("HTTP ".concat(r.status,": ").concat(r.statusText));return r.json()}catch(r){throw clearTimeout(n),r}}}let UM=!1;const VM=(0,t.forwardRef)((e,n)=>{let{devices:r,onBroadcastAction:o,wsService:a,connectedDevices:s=[],onSwapCommander:l,onStatusChange:c,targetDevices:d=[],onToggleTarget:u,onSetTargets:h,lastAction:p,toolbarExtras:f}=e;const m=hw(),g=(0,t.useCallback)((e,t)=>{m({title:e,description:t,status:"error",duration:6e3,isClosable:!0})},[m]),[v,x]=(0,t.useState)(!1),[b,y]=(0,t.useState)(null),[w,S]=(0,t.useState)([]);(0,t.useEffect)(()=>{console.info("[Commander] Component mounted, checking status..."),j();const e=e=>{console.info("Commander status update:",e),x(e.isActive),y(e.commander);let t=(e.followers||[]).filter(t=>("string"===typeof t?t:t.name)!==e.commander);const n=Array.from(new Map(t.map(e=>["string"===typeof e?e:e.name,e])).values());n.length!==(e.followers||[]).length&&console.warn("[Commander] Deduplicated followers: ".concat((e.followers||[]).length," \u2192 ").concat(n.length)),S(n)},t=e=>{console.info("Commander broadcast:",e)};return a?(console.info("[Commander] Setting up WebSocket listeners..."),a.on("commander_status",e),a.on("commander_broadcast",t)):console.info("[Commander] No WebSocket service available yet"),()=>{a&&(a.off("commander_status",e),a.off("commander_broadcast",t))}},[a]);const j=async()=>{try{console.info("[Commander] Checking commander status...");const e=await BM.getStatus();console.info("[Commander] Status received:",e),x(e.isActive),y(e.commander),S(e.followers||[])}catch(e){"AbortError"===e.name?console.error("[Commander] Status check timed out"):console.error("Failed to check commander status:",e)}},k=async e=>{try{const t=r.find(t=>t.name===e);if(!t)return console.error("[Commander] Device not found: ".concat(e)),g("Commander not started","".concat(e," is not in the device list. Refresh devices and try again.")),!1;if("online"!==t.status)return console.error("[Commander] Device not online: ".concat(e," (status: ").concat(t.status,")")),g("Commander not started","".concat(e," is offline. Connect it first.")),!1;console.info("[Commander] Starting commander mode on ".concat(e,"..."));const n=await BM.startCommander(e);return n.success?(x(!0),y(e),console.info("\u2705 Commander mode started:",e),!0):(console.error("[Commander] Failed to start: ".concat(n.error)),g("Commander not started",n.error),!1)}catch(t){"TimeoutError"===t.name||t.message.includes("timeout")?(console.error("[Commander] Start request timed out"),g("Commander not started","The backend did not respond in time.")):(console.error("Failed to start commander mode:",t),g("Commander not started",t.message))}},C=async()=>{try{const e=await BM.stopCommander();e.success&&(x(!1),y(null),S([]),UM=!1,console.info("\u2705 Commander mode stopped"),console.info("\u2705 Removed commander device: ".concat(e.removedCommander)))}catch(e){console.error("Failed to stop commander mode:",e)}},E=async e=>{try{const t=await BM.addFollower(e);t.success?(console.info("\u2705 Follower added:",e),j()):g("Could not add ".concat(e),t.error)}catch(t){console.error("Failed to add follower:",t),g("Could not add ".concat(e),t.message)}};(0,t.useEffect)(()=>{if(console.debug("[Commander] Device effect triggered - devices.length: ".concat(r.length,", wsService: ").concat(!!a,", hasAutoStarted: ").concat(UM)),console.info("[Commander] Devices:",r.map(e=>({name:e.name,status:e.status}))),UM)return void console.info("[Commander] Already auto-started, skipping to prevent navigation restart");if(!a)return void console.info("[Commander] Waiting for WebSocket connection...");const e=r.filter(e=>"online"===e.status);if(console.debug("[Commander] Online devices: ".concat(e.length),e.map(e=>e.name)),e.length>0){const t=e[0].name;console.info("[Commander] Auto-starting with:",t),UM=!0,k(t),e.length>1&&setTimeout(async()=>{for(let t=1;t<e.length;t++)await E(e[t].name),await new Promise(e=>setTimeout(e,300))},1e3)}else console.debug("[Commander] Not auto-starting - onlineDevices: ".concat(e.length))},[r.length,a]);const _=async e=>{const t=b,n=w.map(e=>"string"===typeof e?e:e.name);console.info("[Commander] Swapping commander to ".concat(e,"...")),await C(),UM=!0;if(!await k(e))return!1;const r=[t,...n].filter(t=>t&&t!==e);for(const o of[...new Set(r)])await E(o);return!0};(0,t.useEffect)(()=>{c&&c({isActive:v,commander:b,followers:w})},[v,b,w,c]),(0,t.useImperativeHandle)(n,()=>({swapToDevice:_,getCommanderDevice:()=>b,getFollowers:()=>w,isActive:()=>v,stopCommanderMode:C}));const z=(0,t.useCallback)(e=>{null!==a&&void 0!==a&&a.emit&&a.emit("mirror_started",{device:e})},[a]);return(0,i.jsx)("div",{className:"commander-mode-container",children:(0,i.jsx)(WM,{ws:null===a||void 0===a?void 0:a.ws,commanderStatus:{isActive:v,commander:b,followers:w},connectedDevices:r,onSwapCommander:l,onMirrorStart:z,onBroadcastAction:o,targetDevices:d,onToggleTarget:u,onSetTargets:h,lastAction:p,toolbarExtras:f})})});VM.displayName="CommanderMode";const HM=VM,qM=e=>{let{isRecording:n,commandCount:r=0,currentName:o="",onStart:a,onStop:s,isDisabled:l,size:c="xs",buttonProps:d={}}=e;const[u,h]=(0,t.useState)(!1),[f,m]=(0,t.useState)(""),[g,v]=(0,t.useState)(!1),x=(0,t.useRef)(null);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uj,{label:n?"Stop and save this recording":l?"Select a target device to record":"Record every action on the targets",children:(0,i.jsxs)(Ww,p(p({size:c,colorScheme:"red",variant:n?"solid":"outline",leftIcon:n?(0,i.jsx)(pk,{size:10}):(0,i.jsx)(oC,{size:10}),onClick:n?()=>{m(o||""),h(!0)}:a,isDisabled:!n&&l,"aria-label":n?"Stop recording (".concat(r," steps)"):"Start recording","data-testid":"record-button",color:n?void 0:"red.600",_dark:n?void 0:{color:"red.200",borderColor:"red.300"}},!n&&d),{},{children:[n?"Stop":"Rec",n&&(0,i.jsx)(zw,{ml:1.5,colorScheme:"whiteAlpha",variant:"solid",fontSize:"2xs",children:r})]}))}),(0,i.jsxs)(O_,{isOpen:u,onClose:()=>h(!1),initialFocusRef:x,isCentered:!0,size:"sm",children:[(0,i.jsx)(W_,{}),(0,i.jsxs)(MA,{as:"form",onSubmit:e=>{e.preventDefault(),(async()=>{v(!0);try{await(null===s||void 0===s?void 0:s(f.trim()))}finally{v(!1),h(!1)}})()},children:[(0,i.jsx)(WA,{fontSize:"md",children:"Save recording"}),(0,i.jsx)(HA,{children:(0,i.jsxs)(sE,{children:[(0,i.jsx)(CL,{fontSize:"sm",children:"Name"}),(0,i.jsx)(fE,{ref:x,value:f,onChange:e=>m(e.target.value),placeholder:"e.g. login_happy_path",size:"sm"}),(0,i.jsxs)(lE,{fontSize:"xs",children:[r," step",1===r?"":"s"," recorded. Leave blank to keep the generated name."]})]})}),(0,i.jsxs)(QA,{gap:2,children:[(0,i.jsx)(Ww,{size:"sm",variant:"ghost",onClick:()=>h(!1),children:"Keep recording"}),(0,i.jsx)(Ww,{size:"sm",colorScheme:"red",type:"submit",isLoading:g,children:"Stop & save"})]})]})]})]})},$M=["title","children","className"],YM=Dv((e,t)=>{const{title:n,children:r,className:o}=e,a=Ki(e,$M),s=Lv("chakra-menu__group__title",o),l=IP();return(0,i.jsxs)("div",{ref:t,className:"chakra-menu__group",role:"group",children:[n&&(0,i.jsx)(Rv.p,p(p({className:s},a),{},{__css:l.groupTitle,children:n})),r]})});YM.displayName="MenuGroup";const KM=["className"],XM=e=>{const{className:t}=e,n=Ki(e,KM),r=IP();return(0,i.jsx)(Rv.hr,p(p({"aria-orientation":"horizontal",className:Lv("chakra-menu__divider",t)},n),{},{__css:r.divider}))};XM.displayName="MenuDivider";const GM=e=>{let{onAddManually:t,onRescan:n,onOpenVirtualDevices:r,onOpenAndroidEmulators:o,onOpenIosSimulators:a,onLaunchVirtual:s,buttonProps:l={},label:c="Add a device",iconOnly:d=!1}=e;return(0,i.jsxs)(NP,{placement:d?"right-start":"top-start",isLazy:!0,children:[d?(0,i.jsx)(WP,p({as:qw,icon:(0,i.jsx)(kk,{}),"aria-label":c,title:c,"data-testid":"add-device-menu"},l)):(0,i.jsx)(WP,p(p({as:Ww,leftIcon:(0,i.jsx)(kk,{}),"data-testid":"add-device-menu"},l),{},{children:c})),(0,i.jsxs)(HP,{zIndex:1500,minW:"280px",maxW:"calc(100vw - 24px)",p:2,borderRadius:"xl",boxShadow:"xl",children:[(0,i.jsxs)(mw,{px:3,pt:2,pb:3,children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"bold",children:"Add a device"}),(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.500",_dark:{color:"gray.400"},children:"Choose how you want to connect."})]}),(0,i.jsxs)(YM,{title:"VIRTUAL DEVICES",fontSize:"2xs",fontWeight:"bold",color:"teal.500",letterSpacing:"wider",children:[(0,i.jsx)(JP,{icon:(0,i.jsx)(xE,{color:"#3DDC84"}),borderRadius:"md",py:2,onClick:()=>{o?o():r?r("android"):s&&s("android")},children:(0,i.jsxs)(ww,{align:"start",spacing:0,minW:0,children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"semibold",children:"Android emulator"}),(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.500",_dark:{color:"gray.400"},children:"Launch or manage an AVD"})]})}),(0,i.jsx)(JP,{icon:(0,i.jsx)(vE,{color:"#A0AEC0"}),borderRadius:"md",py:2,onClick:()=>{a?a():r?r("ios"):s&&s("ios")},children:(0,i.jsxs)(ww,{align:"start",spacing:0,minW:0,children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"semibold",children:"iOS simulator"}),(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.500",_dark:{color:"gray.400"},children:"Launch or manage Xcode simulators"})]})})]}),(0,i.jsx)(XM,{my:2}),(0,i.jsxs)(YM,{title:"PHYSICAL DEVICES",fontSize:"2xs",fontWeight:"bold",color:"gray.500",letterSpacing:"wider",children:[(0,i.jsx)(JP,{icon:(0,i.jsx)(Sk,{}),borderRadius:"md",py:2,onClick:n,children:(0,i.jsxs)(ww,{align:"start",spacing:0,minW:0,children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"semibold",children:"Scan for USB devices"}),(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.500",_dark:{color:"gray.400"},children:"Detect connected iOS and Android devices"})]})}),(0,i.jsx)(JP,{icon:(0,i.jsx)(nk,{}),borderRadius:"md",py:2,onClick:t,children:(0,i.jsxs)(ww,{align:"start",spacing:0,minW:0,children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"semibold",children:"Add over Wi-Fi"}),(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.500",_dark:{color:"gray.400"},children:"Connect by IP address or wireless ADB"})]})})]})]})]})},JM=["className"],QM=Dv(function(e,t){const n=Hv("Kbd",e),r=Ov(e),{className:o}=r,a=Ki(r,JM);return(0,i.jsx)(Rv.kbd,p(p({ref:t,className:Lv("chakra-kbd",o)},a),{},{__css:p({fontFamily:"mono"},n)}))});QM.displayName="Kbd";const ZM=[{title:"Navigation & Focus",items:[{keys:["\u2318","K"],label:"Focus Command Bar"},{keys:["?"],label:"Open Keyboard Shortcuts"},{keys:["Esc"],label:"Close overlay / Blur focus"}]},{title:"Device Actions (Selected Targets)",items:[{keys:["H"],label:"Send Home key"},{keys:["B"],label:"Send Back key"},{keys:["S"],label:"Take Screenshot"},{keys:["R"],label:"Start / Stop Recording"},{keys:["I"],label:"Toggle Locators Inspector"}]},{title:"AI Agent Controls (Kill Switch)",items:[{keys:["Esc","Esc"],label:"Emergency Pause Agent Driving"},{keys:["\u2318","."],label:"Emergency Stop All Agent Operations"}]}],eF=e=>{let{isOpen:t,onClose:n}=e;const r=Ts("white","gray.850"),o=Ts("gray.200","gray.700");return(0,i.jsxs)(O_,{isOpen:t,onClose:n,size:"md",isCentered:!0,children:[(0,i.jsx)(W_,{bg:"blackAlpha.600",backdropFilter:"blur(4px)"}),(0,i.jsxs)(MA,{bg:r,borderRadius:"2xl",borderWidth:"1px",borderColor:o,children:[(0,i.jsx)(WA,{fontSize:"lg",pb:2,children:"\u2328\ufe0f Keyboard Shortcuts"}),(0,i.jsx)(UA,{}),(0,i.jsx)(HA,{pb:6,children:(0,i.jsx)(ww,{spacing:4,align:"stretch",children:ZM.map((e,t)=>(0,i.jsxs)(ww,{spacing:2,align:"stretch",children:[t>0&&(0,i.jsx)(YA,{my:1}),(0,i.jsx)(Cw,{fontSize:"xs",fontWeight:"700",textTransform:"uppercase",letterSpacing:"wider",color:"gray.500",children:e.title}),e.items.map(e=>(0,i.jsxs)(Ew,{justify:"space-between",py:1,children:[(0,i.jsx)(Cw,{fontSize:"sm",children:e.label}),(0,i.jsx)(Ew,{spacing:1,children:e.keys.map(e=>(0,i.jsx)(QM,{fontSize:"xs",px:2,py:1,borderRadius:"md",children:e},e))})]},e.label))]},e.title))})})]})]})},tF=e=>{let{isOpen:n,onClose:r,onConfirm:o,originalPrompt:a,translatedCommand:s,devices:l=[],aiProvider:c="AI"}=e;const[d,u]=(0,t.useState)(""),[h,p]=(0,t.useState)(!1),[f,m]=(0,t.useState)(!1);(0,t.useEffect)(()=>{u(s||""),p(!1)},[s,n]);const g=Ts("white","gray.800"),v=Ts("gray.200","gray.700"),x=Ts("purple.50","purple.900"),b=Ts("gray.50","gray.700"),y=(d||"").split("\n").filter(e=>e.trim().length>0),w=e=>{const t=e.trim().toLowerCase();return t.startsWith("launch")||t.startsWith("open")?"green":t.startsWith("click")||t.startsWith("tap")?"blue":t.startsWith("type")?"teal":t.startsWith("swipe")||t.startsWith("scroll")?"orange":t.startsWith("wait")?"yellow":t.startsWith("kill")||t.startsWith("close")?"red":"purple"};return(0,i.jsxs)(O_,{isOpen:n,onClose:r,size:"lg",isCentered:!0,children:[(0,i.jsx)(W_,{backdropFilter:"blur(4px)",bg:"blackAlpha.600"}),(0,i.jsxs)(MA,{bg:g,borderWidth:"1px",borderColor:v,borderRadius:"xl",shadow:"2xl",children:[(0,i.jsx)(WA,{pb:2,children:(0,i.jsxs)(Ew,{justify:"space-between",pr:6,children:[(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Kv,{as:Qk,color:"purple.500",boxSize:5}),(0,i.jsx)(Cw,{fontSize:"md",fontWeight:"bold",children:"AI Execution Plan Review"})]}),(0,i.jsx)(zw,{colorScheme:"purple",fontSize:"xs",px:2,py:.5,borderRadius:"md",children:c.toUpperCase()})]})}),(0,i.jsx)(UA,{}),(0,i.jsx)(HA,{py:2,children:(0,i.jsxs)(ww,{spacing:3,align:"stretch",children:[(0,i.jsxs)(mw,{bg:x,p:2.5,borderRadius:"md",borderWidth:"1px",borderColor:"purple.200",children:[(0,i.jsx)(Cw,{fontSize:"10px",fontWeight:"bold",textTransform:"uppercase",color:"purple.600",mb:.5,children:"User Instruction"}),(0,i.jsxs)(Cw,{fontSize:"xs",fontWeight:"medium",fontStyle:"italic",children:['"',a,'"']})]}),(0,i.jsxs)(Ew,{spacing:2,wrap:"wrap",children:[(0,i.jsxs)(Cw,{fontSize:"xs",fontWeight:"semibold",color:"gray.500",children:["Target Devices (",l.length,"):"]}),l.map((e,t)=>(0,i.jsxs)(zw,{colorScheme:"cyan",fontSize:"2xs",px:2,py:.5,borderRadius:"full",children:["\ud83d\udcf1 ",e]},t))]}),(0,i.jsx)(YA,{}),(0,i.jsxs)(Ew,{justify:"space-between",children:[(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(Kv,{as:Mk,color:"purple.400"}),(0,i.jsxs)(Cw,{fontSize:"xs",fontWeight:"bold",children:["Planned Steps (",y.length,")"]})]}),(0,i.jsx)(Ww,{size:"2xs",variant:"ghost",leftIcon:(0,i.jsx)(Kv,{as:Gk}),onClick:()=>p(e=>!e),children:h?"View Steps":"Edit Script"})]}),h?(0,i.jsx)(GA,{value:d,onChange:e=>u(e.target.value),fontFamily:"mono",fontSize:"xs",rows:6,borderRadius:"md",bg:b}):(0,i.jsx)(ww,{spacing:1.5,align:"stretch",maxH:"220px",overflowY:"auto",pr:1,children:y.map((e,t)=>(0,i.jsxs)(Ew,{p:1.5,bg:b,borderRadius:"md",borderWidth:"1px",borderColor:v,spacing:2,children:[(0,i.jsx)(zw,{colorScheme:"gray",fontSize:"2xs",px:1.5,minW:"20px",textAlign:"center",children:t+1}),(0,i.jsx)(zw,{colorScheme:w(e),fontSize:"2xs",px:1.5,children:e.split(" ")[0]}),(0,i.jsx)(Cw,{fontSize:"xs",fontFamily:"mono",flex:"1",noOfLines:1,children:e.substring(e.indexOf(" ")+1)||e})]},t))}),(0,i.jsx)(uP,{size:"sm",colorScheme:"purple",isChecked:f,onChange:e=>m(e.target.checked),mt:1,children:(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.500",children:"Always execute without plan review (can reset in Settings)"})})]})}),(0,i.jsx)(QA,{pt:2,children:(0,i.jsxs)(Ew,{spacing:2,w:"full",justify:"space-between",children:[(0,i.jsx)(Ww,{size:"sm",variant:"ghost",onClick:r,children:"Cancel"}),(0,i.jsxs)(Ww,{size:"sm",colorScheme:"purple",leftIcon:(0,i.jsx)(Kv,{as:Ck}),onClick:()=>{if(f)try{localStorage.setItem("devicely-skip-ai-plan-preview","true")}catch(kF){console.warn("Failed to save skip preference",kF)}o(d),r()},isDisabled:!d.trim(),children:["Run on ",l.length," Device",1===l.length?"":"s"]})]})})]})]})},nF=["leastDestructiveRef"];function rF(e){const{leastDestructiveRef:t}=e,n=Ki(e,nF);return(0,i.jsx)(O_,p(p({},n),{},{initialFocusRef:t}))}const oF=Dv((e,t)=>(0,i.jsx)(MA,p({ref:t,role:"alertdialog"},e))),iF=[{id:1,label:"Starting"},{id:2,label:"Booting OS"},{id:3,label:"Driver setup"},{id:4,label:"Starting driver"},{id:5,label:"Live"}],aF=e=>{var t;let{progressState:n,platform:r="android",onRetry:o,onViewLogs:a,compact:s=!1}=e;const l=Ts("gray.50","gray.900"),c=Ts("gray.200","gray.700"),d=Ts("gray.700","gray.200"),u=Ts("gray.500","gray.400"),h=(null===n||void 0===n?void 0:n.stage)||1,p=(null===n||void 0===n?void 0:n.progress)||20*h,f=(null===n||void 0===n?void 0:n.stageLabel)||(null===(t=iF[h-1])||void 0===t?void 0:t.label)||"Starting",m=(null===n||void 0===n?void 0:n.message)||"",g=(null===n||void 0===n?void 0:n.elapsedMs)||0,v=Math.round(g/1e3),x=!(null===n||void 0===n||!n.isError),b=h>=5&&!x,y="Stage ".concat(h," of 5: ").concat(f," (").concat(p,"%)");return(0,i.jsx)(mw,{w:"full",p:s?2:3,bg:l,borderWidth:"1px",borderColor:x?"red.400":c,borderRadius:"lg",role:"progressbar","aria-valuenow":p,"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":y,children:(0,i.jsxs)(ww,{spacing:2,align:"stretch",children:[(0,i.jsxs)(Ew,{justify:"space-between",align:"center",children:[(0,i.jsxs)(Ew,{spacing:2,children:[x?(0,i.jsx)(Kv,{as:vC,color:"red.400",boxSize:4}):b?(0,i.jsx)(Kv,{as:cC,color:"green.400",boxSize:4}):(0,i.jsx)(Kv,{as:Sk,color:"teal.400",boxSize:3.5,className:"spin"}),(0,i.jsx)(Cw,{fontSize:"xs",fontWeight:"600",color:x?"red.400":d,children:x?"Boot Failed":"".concat(f)})]}),(0,i.jsxs)(Ew,{spacing:1.5,children:[v>0&&(0,i.jsxs)(Cw,{fontSize:"2xs",color:u,fontFamily:"mono",children:[v,"s"]}),(0,i.jsx)(zw,{colorScheme:x?"red":b?"green":"teal",fontSize:"2xs",borderRadius:"sm",children:x?"Error":"".concat(p,"%")})]})]}),(0,i.jsx)(Ew,{spacing:1,w:"full",children:iF.map(e=>{const t=h>e.id,n=h===e.id;let r="gray.300";return x&&n?r="red.400":t||b&&5===e.id?r="green.400":n&&(r="teal.400"),(0,i.jsx)(mw,{flex:"1",h:"4px",borderRadius:"full",bg:r,transition:"background-color 0.2s ease"},e.id)})}),m&&(0,i.jsx)(Cw,{fontSize:"2xs",color:u,noOfLines:1,children:m}),x&&(0,i.jsxs)(Ew,{spacing:2,pt:1,children:[o&&(0,i.jsx)(Ww,{size:"xs",colorScheme:"red",variant:"solid",leftIcon:(0,i.jsx)(Sk,{}),onClick:o,children:"Retry"}),a&&(0,i.jsx)(Ww,{size:"xs",variant:"outline",leftIcon:(0,i.jsx)($k,{}),onClick:a,children:"Logs"})]})]})})},sF=e=>{let{device:t,platform:n,progress:r,isBooting:o,isSelected:a,onSelect:s,onLaunch:l,onConnect:c,onStop:d,onWipe:u,onDelete:h}=e;const p=Ts("white","gray.800"),f=Ts("gray.200","gray.700"),m=Ts("gray.500","gray.400"),g="running"===t.vmState||"connected"===t.status||"online"===t.status,v="online"===t.status,x="tablet"===t.formFactor?dk:fk,b="android"===n?xE:vE,y="android"===n?"green":"blue";return(0,i.jsx)(mw,{p:3,bg:p,borderWidth:"1px",borderColor:f,borderRadius:"lg",transition:"all 0.15s ease",_hover:{borderColor:"teal.400"},children:(0,i.jsxs)(ww,{spacing:2,align:"stretch",children:[(0,i.jsxs)(Ew,{justify:"space-between",align:"center",children:[(0,i.jsxs)(Ew,{spacing:2.5,children:[s&&(0,i.jsx)(uP,{isChecked:a,onChange:e=>s(t.virtualId||t.udid,e.target.checked),size:"sm",colorScheme:"teal"}),(0,i.jsx)(mw,{w:"32px",h:"32px",borderRadius:"md",bg:"android"===n?"green.500":"blue.500",display:"flex",alignItems:"center",justifyContent:"center",color:"white",children:(0,i.jsx)(Kv,{as:b,boxSize:4})}),(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsxs)(Ew,{spacing:1.5,children:[(0,i.jsx)(Cw,{fontSize:"xs",fontWeight:"700",noOfLines:1,children:t.displayName||t.name}),(0,i.jsx)(Kv,{as:x,boxSize:3,color:m})]}),(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(zw,{size:"xs",fontSize:"3xs",colorScheme:y,borderRadius:"sm",children:t.osVersion||("android"===n?"Android":"iOS")}),t.serial&&(0,i.jsx)(Cw,{fontSize:"3xs",color:m,fontFamily:"mono",children:t.serial}),g&&(0,i.jsx)(zw,{size:"xs",fontSize:"3xs",colorScheme:"teal",borderRadius:"sm",children:v?"Online":"Running"})]})]})]}),(0,i.jsxs)(Ew,{spacing:1,children:[o?(0,i.jsx)(zw,{colorScheme:"teal",fontSize:"2xs",px:2,py:.5,borderRadius:"md",children:"Booting..."}):g?v?(0,i.jsx)(zw,{colorScheme:"green",fontSize:"2xs",px:2,py:.5,borderRadius:"md",children:"\u25cf Live"}):(0,i.jsx)(Ww,{size:"xs",colorScheme:"teal",variant:"solid",leftIcon:(0,i.jsx)(jk,{}),onClick:()=>c&&c(t),children:"Connect"}):(0,i.jsx)(Ww,{size:"xs",colorScheme:"teal",variant:"solid",leftIcon:(0,i.jsx)(Ck,{}),onClick:()=>l&&l(t,{}),children:"Launch"}),(0,i.jsxs)(NP,{size:"xs",placement:"bottom-end",children:[(0,i.jsx)(WP,{as:qw,icon:(0,i.jsx)(Ak,{}),variant:"ghost",size:"xs","aria-label":"Device options"}),(0,i.jsxs)(HP,{fontSize:"xs",children:[!g&&(0,i.jsx)(JP,{icon:(0,i.jsx)(Sk,{}),onClick:()=>l&&l(t,{coldBoot:!0}),children:"Cold Boot"}),!g&&(0,i.jsx)(JP,{icon:(0,i.jsx)(Sk,{}),onClick:()=>l&&l(t,{headless:!0}),children:"Launch Headless"}),g&&(0,i.jsx)(JP,{icon:(0,i.jsx)(pk,{}),color:"red.400",onClick:()=>d&&d(t),children:"Stop Device"}),(0,i.jsx)(XM,{}),(0,i.jsx)(JP,{icon:(0,i.jsx)(Sk,{}),color:"orange.400",onClick:()=>u&&u(t),children:"Wipe Data..."}),(0,i.jsx)(JP,{icon:(0,i.jsx)(sk,{}),color:"red.400",onClick:()=>h&&h(t),children:"Delete..."})]})]})]})]}),o&&r&&(0,i.jsx)(aF,{progressState:r,platform:n,compact:!0})]})})},lF=e=>{var n,r,o;let{isOpen:a,onClose:s,virtualDevices:l,capabilities:c,virtualProgress:d={},initialPlatform:u="android",onRefresh:h,onLaunch:p,onConnect:f,onStop:m,onWipe:g,onDelete:v}=e;const[x,b]=(0,t.useState)("ios"===u?1:0);(0,t.useEffect)(()=>{a&&u&&b("ios"===u?1:0)},[a,u]);const[y,w]=(0,t.useState)(""),[S,j]=(0,t.useState)(new Set),[k,C]=(0,t.useState)(null),[E,_]=(0,t.useState)(null),z=t.useRef(),R="darwin"===(null===c||void 0===c||null===(n=c.host)||void 0===n?void 0:n.os),A=0===x?"android":"ios",T=Ts("white","gray.850"),P=Ts("gray.200","gray.700"),O=Ts("gray.800","white"),L=Ts("gray.500","gray.400"),D=Ts("gray.50","gray.900"),I=(0,t.useMemo)(()=>{const e=("android"===A?null===l||void 0===l?void 0:l.android:null===l||void 0===l?void 0:l.ios)||[];if(!y.trim())return e;const t=y.toLowerCase();return e.filter(e=>(e.displayName||e.name||"").toLowerCase().includes(t)||(e.osVersion||"").toLowerCase().includes(t))},[A,l,y]),N=I.filter(e=>"running"===e.vmState||"connected"===e.status||"online"===e.status),M=I.filter(e=>"running"!==e.vmState&&"connected"!==e.status&&"online"!==e.status),F=(e,t)=>{const n=new Set(S);t?n.add(e):n.delete(e),j(n)};return a?(0,i.jsxs)(mw,{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999,pointerEvents:"none",children:[(0,i.jsx)(mw,{position:"absolute",top:0,left:0,right:0,bottom:0,bg:"blackAlpha.600",pointerEvents:"auto",onClick:s}),(0,i.jsxs)(fw,{direction:"column",position:"absolute",top:0,right:0,bottom:0,width:{base:"100%",sm:"420px",md:"440px"},bg:T,borderLeftWidth:"1px",borderColor:P,boxShadow:"-8px 0 24px rgba(0,0,0,0.2)",pointerEvents:"auto",zIndex:1e4,children:[(0,i.jsxs)(fw,{justify:"space-between",align:"center",px:4,py:3,borderBottomWidth:"1px",borderColor:P,children:[(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Kv,{as:Pk,boxSize:4,color:"teal.400"}),(0,i.jsx)(Cw,{fontSize:"md",fontWeight:"700",color:O,children:"Virtual Devices"})]}),(0,i.jsxs)(Ew,{spacing:1,children:[(0,i.jsx)(qw,{size:"sm",variant:"ghost",icon:(0,i.jsx)(Sk,{}),"aria-label":"Refresh",onClick:h}),(0,i.jsx)(qw,{size:"sm",variant:"ghost",icon:(0,i.jsx)(ek,{}),"aria-label":"Close",onClick:s})]})]}),(0,i.jsx)(mw,{px:4,pt:3,pb:2,children:(0,i.jsx)(r_,{variant:"soft-rounded",colorScheme:"teal",size:"sm",index:x,onChange:e=>{b(e),j(new Set)},children:(0,i.jsxs)(o_,{bg:D,p:1,borderRadius:"lg",children:[(0,i.jsx)(i_,{flex:"1",fontSize:"xs",fontWeight:"600",children:(0,i.jsxs)(Ew,{spacing:1.5,children:[(0,i.jsx)(Kv,{as:xE}),(0,i.jsx)(Cw,{children:"Android"}),(null===l||void 0===l||null===(r=l.android)||void 0===r?void 0:r.length)>0&&(0,i.jsx)(zw,{size:"xs",borderRadius:"full",children:l.android.length})]})}),R&&(0,i.jsx)(i_,{flex:"1",fontSize:"xs",fontWeight:"600",children:(0,i.jsxs)(Ew,{spacing:1.5,children:[(0,i.jsx)(Kv,{as:vE}),(0,i.jsx)(Cw,{children:"iOS"}),(null===l||void 0===l||null===(o=l.ios)||void 0===o?void 0:o.length)>0&&(0,i.jsx)(zw,{size:"xs",borderRadius:"full",children:l.ios.length})]})})]})})}),I.length>6&&(0,i.jsx)(mw,{px:4,pb:2,children:(0,i.jsxs)(YC,{size:"sm",children:[(0,i.jsx)(ZC,{pointerEvents:"none",children:(0,i.jsx)(Kv,{as:xk,color:L})}),(0,i.jsx)(fE,{placeholder:"Filter devices...",value:y,onChange:e=>w(e.target.value),borderRadius:"md"})]})}),S.size>0&&(0,i.jsxs)(fw,{px:4,py:2,bg:"teal.500",color:"white",justify:"space-between",align:"center",children:[(0,i.jsxs)(Cw,{fontSize:"xs",fontWeight:"600",children:[S.size," selected"]}),(0,i.jsx)(Ww,{size:"xs",colorScheme:"whiteAlpha",variant:"solid",leftIcon:(0,i.jsx)(Ck,{}),onClick:()=>{for(const e of S){const t=I.find(t=>(t.virtualId||t.udid)===e);t&&p(t)}j(new Set)},children:"Launch Selected"})]}),(0,i.jsx)(mw,{flex:"1",overflowY:"auto",px:4,py:2,children:(0,i.jsxs)(ww,{spacing:4,align:"stretch",children:[N.length>0&&(0,i.jsxs)(ww,{spacing:2,align:"stretch",children:[(0,i.jsx)(Ew,{justify:"space-between",children:(0,i.jsxs)(Cw,{fontSize:"2xs",fontWeight:"700",textTransform:"uppercase",letterSpacing:"wider",color:"teal.400",children:["Running (",N.length,")"]})}),N.map(e=>{const t=e.virtualId||e.udid,n=d[t],r=!!n&&n.stage<5&&!n.isError;return(0,i.jsx)(sF,{device:e,platform:A,progress:n,isBooting:r,isSelected:S.has(t),onSelect:F,onConnect:f,onStop:m,onWipe:C,onDelete:_},t)})]}),(0,i.jsxs)(ww,{spacing:2,align:"stretch",children:[(0,i.jsx)(Ew,{justify:"space-between",children:(0,i.jsxs)(Cw,{fontSize:"2xs",fontWeight:"700",textTransform:"uppercase",letterSpacing:"wider",color:L,children:["Installed (",M.length,")"]})}),0===M.length&&0===N.length?(0,i.jsx)(mw,{p:6,textAlign:"center",borderWidth:"1px",borderStyle:"dashed",borderColor:P,borderRadius:"lg",children:(0,i.jsxs)(Cw,{fontSize:"xs",color:L,children:["No ","android"===A?"Android AVDs":"iOS Simulators"," found."]})}):M.map(e=>{const t=e.virtualId||e.udid,n=d[t],r=!!n&&n.stage<5&&!n.isError;return(0,i.jsx)(sF,{device:e,platform:A,progress:n,isBooting:r,isSelected:S.has(t),onSelect:F,onLaunch:p,onWipe:C,onDelete:_},t)})]})]})}),(0,i.jsx)(mw,{p:3,borderTopWidth:"1px",borderColor:P,children:(0,i.jsx)(dD,{capabilities:c,activePlatform:A})})]}),(0,i.jsx)(rF,{isOpen:!!k,leastDestructiveRef:z,onClose:()=>C(null),children:(0,i.jsx)(W_,{children:(0,i.jsxs)(oF,{children:[(0,i.jsxs)(WA,{fontSize:"md",fontWeight:"bold",children:["Wipe ",(null===k||void 0===k?void 0:k.displayName)||(null===k||void 0===k?void 0:k.name),"?"]}),(0,i.jsx)(HA,{fontSize:"sm",children:"This will erase all user data on the virtual device and restore it to its initial state. This action cannot be undone."}),(0,i.jsxs)(QA,{children:[(0,i.jsx)(Ww,{ref:z,size:"sm",onClick:()=>C(null),children:"Cancel"}),(0,i.jsx)(Ww,{colorScheme:"orange",size:"sm",onClick:()=>{k&&g(k),C(null)},ml:3,children:"Wipe Data"})]})]})})}),(0,i.jsx)(rF,{isOpen:!!E,leastDestructiveRef:z,onClose:()=>_(null),children:(0,i.jsx)(W_,{children:(0,i.jsxs)(oF,{children:[(0,i.jsxs)(WA,{fontSize:"md",fontWeight:"bold",children:["Delete ",(null===E||void 0===E?void 0:E.displayName)||(null===E||void 0===E?void 0:E.name),"?"]}),(0,i.jsx)(HA,{fontSize:"sm",children:"Are you sure you want to permanently delete this virtual device?"}),(0,i.jsxs)(QA,{children:[(0,i.jsx)(Ww,{ref:z,size:"sm",onClick:()=>_(null),children:"Cancel"}),(0,i.jsx)(Ww,{colorScheme:"red",size:"sm",onClick:()=>{E&&v(E),_(null)},ml:3,children:"Delete"})]})]})})})]}):null},cF=e=>{var t,n,r,o;let{virtualDevices:a,capabilities:s,progress:l,isBooting:c,onLaunch:d,onOpenPanel:u}=e;const h=Ts("teal.50","rgba(49, 151, 149, 0.08)"),f=Ts("teal.200","teal.700"),m=Ts("gray.800","white"),g=Ts("gray.600","gray.400"),v=[...(null===a||void 0===a||null===(t=a.android)||void 0===t?void 0:t.map(e=>p(p({},e),{},{platform:"android"})))||[],...(null===a||void 0===a||null===(n=a.ios)||void 0===n?void 0:n.map(e=>p(p({},e),{},{platform:"ios"})))||[]],x=v.sort((e,t)=>e.lastUsed&&!t.lastUsed?-1:!e.lastUsed&&t.lastUsed?1:e.lastUsed&&t.lastUsed?t.lastUsed-e.lastUsed:"running"===e.vmState&&"running"!==t.vmState?-1:0)[0],b=(null===s||void 0===s||null===(r=s.android)||void 0===r?void 0:r.ok)||(null===s||void 0===s||null===(o=s.ios)||void 0===o?void 0:o.ok),y=v.length>0;return(0,i.jsx)(mw,{w:"full",p:4,bg:h,borderWidth:"1.5px",borderColor:f,borderRadius:"xl",transition:"all 0.2s ease",children:(0,i.jsxs)(ww,{spacing:3,align:"stretch",children:[(0,i.jsx)(Ew,{justify:"space-between",align:"start",children:(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(mw,{p:1.5,borderRadius:"md",bg:"teal.500",color:"white",display:"flex",alignItems:"center",justifyContent:"center",children:(0,i.jsx)(Kv,{as:Zj,boxSize:4})}),(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsxs)(Ew,{spacing:1.5,children:[(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"700",color:m,children:"Start instantly"}),(0,i.jsx)(zw,{colorScheme:"teal",fontSize:"3xs",borderRadius:"sm",children:"Recommended"})]}),(0,i.jsx)(Cw,{fontSize:"2xs",color:g,children:"No phone needed \u2014 launch an emulator in seconds"})]})]})}),c&&l?(0,i.jsx)(aF,{progressState:l,platform:l.platform||"android"}):y&&x?(0,i.jsxs)(Ew,{spacing:2,w:"full",children:[(0,i.jsxs)(Ww,{flex:"1",size:"sm",colorScheme:"teal",leftIcon:(0,i.jsx)(Ck,{}),onClick:()=>d&&d(x),fontWeight:"600",fontSize:"xs",borderRadius:"md",children:["Launch ",x.displayName||x.name]}),v.length>1&&(0,i.jsxs)(NP,{size:"sm",placement:"bottom-end",children:[(0,i.jsx)(WP,{as:Ww,size:"sm",variant:"outline",colorScheme:"teal",rightIcon:(0,i.jsx)(lC,{}),fontSize:"xs",borderRadius:"md",children:"More"}),(0,i.jsx)(HP,{fontSize:"xs",maxH:"240px",overflowY:"auto",children:v.map(e=>(0,i.jsxs)(JP,{icon:(0,i.jsx)(Kv,{as:"android"===e.platform?xE:vE}),onClick:()=>d&&d(e),children:[e.displayName||e.name," (",e.osVersion||e.platform,")"]},e.virtualId||e.udid))})]})]}):b?(0,i.jsx)(Ww,{size:"sm",colorScheme:"teal",variant:"outline",leftIcon:(0,i.jsx)(Pk,{}),onClick:u,fontSize:"xs",borderRadius:"md",children:"Open Virtual Devices Panel"}):(0,i.jsx)(Ww,{size:"sm",colorScheme:"teal",variant:"ghost",rightIcon:(0,i.jsx)(fC,{}),onClick:u,fontSize:"xs",borderRadius:"md",justifyContent:"space-between",children:"Set up an emulator in 2 minutes"})]})})};class dF{static async getDevices(){const e=await fetch("".concat(yE,"/api/devices"));if(!e.ok)throw new Error("Failed to fetch devices");return e.json()}static async refreshDevices(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=await fetch("".concat(yE,"/api/devices/refresh"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({force:e})});if(!t.ok)throw new Error("Failed to refresh devices");return t.json()}static async executeCommand(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=await fetch("".concat(yE,"/api/execute"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({devices:e,command:t,useAI:n})});if(!r.ok)throw new Error("Failed to execute command");return r.json()}static async convertCommand(e){const t=await fetch("".concat(yE,"/api/convert-command"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e})});if(!t.ok)throw new Error("Failed to convert command");return t.json()}static async connectDevice(e){const t=await fetch("".concat(yE,"/api/devices/connect"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device:e})});if(!t.ok)throw new Error("Failed to connect device");return t.json()}static async disconnectDevice(e){const t=await fetch("".concat(yE,"/api/devices/disconnect"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device:e})});if(!t.ok)throw new Error("Failed to disconnect device");return t.json()}static async convertToWireless(e){const t=await fetch("".concat(yE,"/api/devices/wireless"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device:e})}),n=await t.json();if(!t.ok)throw new Error(n.error||"Failed to switch device to WiFi");return n}static async deleteDevice(e){const t=new URLSearchParams({name:e.name}).toString(),n=await fetch("".concat(yE,"/api/devices/").concat(encodeURIComponent(e.udid),"?").concat(t),{method:"DELETE"}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to remove device");return r}static async connectAllDevices(){const e=await fetch("".concat(yE,"/api/devices/connect-all"),{method:"POST",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error("Failed to connect all devices");return e.json()}static async disconnectAllDevices(){const e=await fetch("".concat(yE,"/api/devices/disconnect-all"),{method:"POST",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error("Failed to disconnect all devices");return e.json()}}class uF{constructor(){this.ws=null,this.reconnectInterval=3e3,this.maxReconnectAttempts=15,this.reconnectAttempts=0,this.eventHandlers={},this.isManuallyDisconnected=!1,this.isConnecting=!1}connect(){if(this.isManuallyDisconnected||this.isConnecting)return;this.isConnecting=!0;const e=this.reconnectAttempts>0?500:0;setTimeout(()=>{try{this.ws=new WebSocket(SE),this._setupEventHandlers()}catch(e){console.error("WebSocket connection error:",e),this.isConnecting=!1,this._handleConnectionFailure()}},e)}_setupEventHandlers(){this.ws&&(this.ws.onopen=()=>{console.info("\u2705 WebSocket connected"),this.isConnecting=!1,this.reconnectAttempts=0,this.emit("connection_status",{connected:!0,backendAvailable:!0})},this.ws.onmessage=e=>{try{const t=JSON.parse(e.data);t.type&&this.eventHandlers[t.type]&&this.eventHandlers[t.type].forEach(e=>e(t))}catch(t){console.error("Error parsing WebSocket message:",t)}},this.ws.onerror=e=>{this.reconnectAttempts>2&&console.error("WebSocket error:",e),this.isConnecting=!1},this.ws.onclose=()=>{this.isConnecting=!1,0===this.reconnectAttempts&&console.info("WebSocket disconnected"),this.emit("connection_status",{connected:!1,backendAvailable:!1}),this._handleConnectionFailure()})}_handleConnectionFailure(){if(!this.isManuallyDisconnected&&this.reconnectAttempts<this.maxReconnectAttempts){this.reconnectAttempts++,this.reconnectAttempts%3===1&&console.info("\u23f3 Reconnecting... (attempt ".concat(this.reconnectAttempts,"/").concat(this.maxReconnectAttempts,");"));const e=Math.min(1e3*this.reconnectAttempts,5e3);setTimeout(()=>this.connect(),e)}else this.reconnectAttempts>=this.maxReconnectAttempts&&(console.error("\u274c Max reconnection attempts reached"),this.emit("connection_status",{connected:!1,backendAvailable:!1,error:"Max reconnection attempts reached"}))}disconnect(){this.isManuallyDisconnected=!0,this.isConnecting=!1,this.ws&&(this.ws.close(),this.ws=null)}reconnect(){this.isManuallyDisconnected=!1,this.reconnectAttempts=0,this.isConnecting=!1,this.ws&&this.ws.close(),this.connect()}send(e){if(this.ws&&this.ws.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify(e))}catch(t){console.error("Failed to send WebSocket message:",t),console.error("Data:",e)}else console.error("WebSocket is not connected")}emit(e,t){this.eventHandlers[e]&&this.eventHandlers[e].forEach(e=>e(t))}on(e,t){this.eventHandlers[e]||(this.eventHandlers[e]=[]),this.eventHandlers[e].push(t)}off(e,t){this.eventHandlers[e]&&(this.eventHandlers[e]=this.eventHandlers[e].filter(e=>e!==t))}isConnected(){return this.ws&&this.ws.readyState===WebSocket.OPEN}onMessage(e){this.on("message",e)}}const hF=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5e3;const t=new AbortController,n=setTimeout(()=>t.abort(),e);try{const e=await fetch("".concat(yE,"/api/health"),{method:"GET",signal:t.signal,headers:{"Content-Type":"application/json"}});return clearTimeout(n),e.ok}catch(r){return clearTimeout(n),!1}},pF=["control","recordings","settings","setup"],fF=()=>{const e=window.location.hash.replace(/^#\/?/,"").split(/[/?]/)[0];return pF.includes(e)?e:"control"};const mF=function(){var e,n,r,o;const[a,s]=(0,t.useState)([]),[l,c]=(0,t.useState)([]),[d,u]=(0,t.useState)([]),[h,f]=(0,t.useState)([]),[m,g]=(0,t.useState)([]),[v,x]=(0,t.useState)(""),[b,y]=(0,t.useState)([]),[w,S]=(0,t.useState)(!1),[j,k]=(0,t.useState)(!1),[C,E]=(0,t.useState)(!1),_=(0,t.useRef)(null),[z,R]=(0,t.useState)(!1),[A,T]=(0,t.useState)(""),[P,O]=(0,t.useState)(""),[L,D]=(0,t.useState)(""),[I,N]=(0,t.useState)(""),[M,F]=(0,t.useState)([]),[W,B]=(0,t.useState)(-1),[U,V]=(0,t.useState)([]),[H,q]=(0,t.useState)(!1),[$,Y]=(0,t.useState)(fF),K="settings"===$,X="recordings"===$,G="setup"===$,[J,Q]=(0,t.useState)(0),[Z,ee]=(0,t.useState)(()=>{const e=localStorage.getItem("devicely_terminal_open");return null!==e?"true"===e:window.innerHeight>=900}),[te,ne]=(0,t.useState)(()=>{const e=parseInt(localStorage.getItem("devicely_terminal_height"),10);return Number.isFinite(e)?Math.max(120,e):220}),[re,oe]=(0,t.useState)(!0),[ie,ae]=(0,t.useState)(!1),[se,le]=(0,t.useState)(!1),[ce,de]=(0,t.useState)(!1),[ue,he]=(0,t.useState)(!1),[pe,fe]=(0,t.useState)({originalPrompt:"",translatedCommand:""}),[me,ge]=(0,t.useState)(!1),[ve,xe]=(0,t.useState)(""),[be,ye]=(0,t.useState)(null),[we,Se]=(0,t.useState)(null),[je,ke]=(0,t.useState)(""),[Ce,Ee]=(0,t.useState)(!1),[_e,ze]=(0,t.useState)(!1),[Re,Ae]=(0,t.useState)(!1),[Te,Pe]=(0,t.useState)(!1),[Oe,Le]=(0,t.useState)(!0),[De,Ie]=(0,t.useState)(0),[Ne,Me]=(0,t.useState)(null),[Fe,We]=(0,t.useState)({isActive:!1,commander:null,followers:[]}),[Be,Ue]=(0,t.useState)(null),[Ve,He]=(0,t.useState)([]),[qe,$e]=(0,t.useState)(!1),[Ye,Ke]=(0,t.useState)("android"),[Xe,Ge]=(0,t.useState)({android:[],ios:[]}),[Je,Qe]=(0,t.useState)(null),[Ze,et]=(0,t.useState)({}),[tt,nt]=(0,t.useState)(!1),[rt,ot]=(0,t.useState)(null),[it,at]=(0,t.useState)(0),[st,lt]=(0,t.useState)(!1),[ct,dt]=(0,t.useState)(Date.now()),ut=(0,t.useRef)(0),[ht,pt]=(0,t.useState)(-1),[ft,mt]=(0,t.useState)(-1),[gt,vt]=(0,t.useState)(-1),[xt,bt]=(0,t.useState)(""),[yt,wt]=(0,t.useState)([]),[St,jt]=(0,t.useState)(!1),[kt,Ct]=(0,t.useState)(0),[Et,_t]=(0,t.useState)(0),zt=hw(),Rt=(0,t.useRef)(null),At=(0,t.useRef)(null),Tt=(0,t.useRef)(null),Pt=(0,t.useRef)(0),Ot=(0,t.useRef)([]),Lt=(0,t.useRef)(-1),Dt=(0,t.useRef)(new Set),It=(0,t.useRef)(null),Nt=(0,t.useRef)(!1),Mt=(0,t.useRef)(""),Ft=(0,t.useRef)(""),Wt=(0,t.useRef)(null),Bt=(0,t.useRef)(null),Ut=(0,t.useRef)(""),Vt=(0,t.useCallback)(e=>{Ut.current=e,D(e)},[]),Ht=Ts("gray.50","gray.900"),qt=Ts("white","gray.800"),$t=Ts("gray.200","gray.700");(0,t.useEffect)(()=>{if(Nt.current=z,!z){if(Wt.current&&(clearTimeout(Wt.current),Wt.current=null),Bt.current)try{Bt.current.stop()}catch(kF){}return void T("")}const e=window.SpeechRecognition||window.webkitSpeechRecognition;if(!e)return zt({title:"Speech Recognition Not Supported",description:"Your browser does not support speech recognition. Try Chrome or Edge.",status:"error",duration:4e3,isClosable:!0}),R(!1),void(Nt.current=!1);Mt.current=(v||"").trim(),Ft.current="";const t=new e;t.continuous=!0,t.interimResults=!0,t.lang="en-US",Bt.current=t,t.onstart=()=>{T("listening"),console.info("\ud83c\udfa4 Voice recognition started")},t.onresult=e=>{let n="",r="";for(let t=0;t<e.results.length;t++){const o=e.results[t],i=o[0].transcript;o.isFinal?n+=i+" ":r+=i}Ft.current=n;const o=((Mt.current?Mt.current+" ":"")+n+r).trim();o&&(x(o),O(o),T("listening"),setTimeout(()=>{_.current&&(_.current.focus(),_.current.setSelectionRange(_.current.value.length,_.current.value.length))},0)),Wt.current&&clearTimeout(Wt.current),Wt.current=setTimeout(()=>{if(Nt.current){console.info("\ud83c\udfa4 Silence timeout reached, stopping listening while preserving input:",o),R(!1),Nt.current=!1;try{t.stop()}catch(kF){}T("")}},7e3)},t.onerror=e=>{console.error("\ud83c\udfa4 Speech recognition error:",e.error),"no-speech"!==e.error&&(Wt.current&&(clearTimeout(Wt.current),Wt.current=null),"aborted"!==e.error&&(T(""),R(!1),Nt.current=!1,zt({title:"Voice Recognition Error",description:"Error: ".concat(e.error),status:"error",duration:3e3})))},t.onend=()=>{if(console.info("\ud83c\udfa4 Voice recognition session ended"),Nt.current){Ft.current.trim()&&(Mt.current=((Mt.current?Mt.current+" ":"")+Ft.current.trim()).trim(),Ft.current="");try{t.start(),console.info("\ud83c\udfa4 Resumed listening seamlessly across speech pause")}catch(CF){console.warn("Recognition could not auto-restart:",CF),R(!1),Nt.current=!1,T("")}}else T(""),R(!1)};try{t.start(),zt({title:"\ud83c\udfa4 Listening...",description:"Speak your command. Pauses to think are supported!",status:"info",duration:2500})}catch(n){console.error("Failed to start recognition:",n),R(!1),Nt.current=!1}return()=>{Wt.current&&(clearTimeout(Wt.current),Wt.current=null);try{t.stop()}catch(kF){}}},[z,zt]),(0,t.useEffect)(()=>{let e=!1;const t=async()=>{const t=Rt.current;if(t&&t.isConnected())return Pt.current=0,void Ae(!0);const n=await hF();e||(n?(Pt.current=0,Ae(!0),Pe(!0),!t||t.isConnected()||t.isConnecting||t.reconnect()):(Pt.current+=1,Pt.current>=2&&Ae(!1)))};return t(),Tt.current=setInterval(t,5e3),()=>{e=!0,Tt.current&&clearInterval(Tt.current)}},[]),(0,t.useEffect)(()=>{(async()=>{Le(!0);const e=localStorage.getItem("selectedDevices"),t=localStorage.getItem("connectedDevices"),n=localStorage.getItem("showDevicesPanel");if(e)try{c(JSON.parse(e))}catch(kF){console.error("Error parsing saved selected devices:",kF)}if(t)try{u(JSON.parse(t))}catch(kF){console.error("Error parsing saved connected devices:",kF)}if(null!==n)try{oe(JSON.parse(n))}catch(kF){console.error("Error parsing saved showDevicesPanel:",kF),oe(!0)}console.info("\ud83d\udd04 Checking backend availability...");const r=await async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;console.info("\u23f3 Waiting for backend to be ready...");for(let n=0;n<e;n++){if(await hF(2e3))return console.info("\u2705 Backend is ready!"),!0;if(t&&t(n+1,e),n<e-1){const e=Math.min(1e3*Math.ceil((n+1)/2),3e3);await new Promise(t=>setTimeout(t,e))}}return console.error("\u274c Backend failed to start after",e,"attempts"),!1}(10,1e3,(e,t)=>{Ie(e)});Ae(r),r&&Pe(!0),r?(console.info("\u2705 Backend ready, showing UI..."),Le(!1),setTimeout(async()=>{console.info("\ud83d\udd0d Loading devices in background..."),await tn(),en()},500)):(console.error("\u274c Backend not available after waiting"),Le(!1),zt({title:"Backend Connection Failed",description:"Could not connect to backend server. Please check if the server is running.",status:"error",duration:5e3,isClosable:!0}))})()},[]),(0,t.useEffect)(()=>{localStorage.setItem("selectedDevices",JSON.stringify(l))},[l]),(0,t.useEffect)(()=>{localStorage.setItem("connectedDevices",JSON.stringify(d))},[d]),(0,t.useEffect)(()=>{localStorage.setItem("showDevicesPanel",JSON.stringify(re))},[re]),(0,t.useEffect)(()=>{null!==localStorage.getItem("showDevicesPanel")||0!==d.length||oe(!0)},[d.length]),(0,t.useEffect)(()=>{if(!a||0===a.length)return;const e=new Set(a.filter(e=>"online"===e.status).map(e=>e.name));c(t=>{const n=t.filter(t=>e.has(t));return n.length===t.length?t:n})},[a]),(0,t.useEffect)(()=>{if(!rt)return;const e=setInterval(()=>dt(Date.now()),2e3);return()=>clearInterval(e)},[rt]);const Yt=Boolean(rt&&(st||ct-it<45e3)),Kt=(0,t.useCallback)(async()=>{try{await fetch("".concat(yE,"/api/v1/agent/pause"),{method:"POST"}),lt(!0),zt({title:"Agent Paused",description:"Agent tool execution has been paused.",status:"info",duration:3e3,isClosable:!0})}catch(kF){zt({title:"Error pausing agent",description:kF.message,status:"error",duration:3e3,isClosable:!0})}},[zt]),Xt=(0,t.useCallback)(async()=>{try{await fetch("".concat(yE,"/api/v1/agent/resume"),{method:"POST"}),lt(!1),zt({title:"Agent Resumed",description:"Agent execution resumed.",status:"success",duration:3e3,isClosable:!0})}catch(kF){zt({title:"Error resuming agent",description:kF.message,status:"error",duration:3e3,isClosable:!0})}},[zt]),Gt=(0,t.useCallback)(async()=>{try{await fetch("".concat(yE,"/api/v1/agent/stop"),{method:"POST"}),lt(!1),ot(null),zt({title:"Agent Stopped",description:"Emergency stop activated. Agent session terminated.",status:"warning",duration:4e3,isClosable:!0})}catch(kF){zt({title:"Error stopping agent",description:kF.message,status:"error",duration:3e3,isClosable:!0})}},[zt]);(0,t.useEffect)(()=>{if(!Te)return;console.info("\ud83d\udd0c Setting up WebSocket connection...");const e=new uF;return Rt.current=e,e.on("connection_status",e=>{ze(e.connected),e.connected&&(Pt.current=0,Ae(!0))}),e.on("devices_updated",e=>{if(s(e.devices||[]),Jt(e.devices||[]),e.devices){const t=e.devices.filter(e=>"online"===e.status).map(e=>e.name);f(e=>e.filter(e=>!t.includes(e))),c(e=>e.filter(e=>t.includes(e)))}}),e.on("device_lost",e=>{zt({id:"device-health-".concat(e.deviceName),title:"".concat(e.deviceName," disconnected"),description:"".concat(e.reason,". Devicely will reconnect it when it is back."),status:"warning",duration:6e3,isClosable:!0})}),e.on("device_reconnecting",e=>{f(t=>t.includes(e.deviceName)?t:[...t,e.deviceName])}),e.on("device_reconnected",e=>{f(t=>t.filter(t=>t!==e.deviceName)),zt({title:"".concat(e.deviceName," reconnected"),status:"success",duration:3e3,isClosable:!0})}),e.on("device_reconnect_failed",e=>{f(t=>t.filter(t=>t!==e.deviceName)),zt.isActive("device-reconnect-".concat(e.deviceName))||zt({id:"device-reconnect-".concat(e.deviceName),title:"Could not reconnect ".concat(e.deviceName," yet"),description:"If it just restarted, unlock it - Devicely retries automatically.",status:"info",duration:5e3,isClosable:!0})}),e.on("virtual_device_progress",e=>{console.info("\u26a1 Virtual device progress:",e);const t="".concat(e.platform,"-").concat(e.id||e.avdName||e.udid);et(n=>p(p({},n),{},{[t]:e,[e.id]:e})),"ready"===e.stage||"failed"===e.stage?(nt(!1),"ready"===e.stage&&(tn(),en())):nt(!0)}),e.on("virtual_device_error",e=>{console.error("\u274c Virtual device error:",e),nt(!1);const t="".concat(e.platform,"-").concat(e.id);et(n=>p(p({},n),{},{[t]:p(p({},e),{},{stage:"failed",message:e.error||"Boot failed"})})),zt({title:"Virtual Device Error",description:e.error||"An error occurred with the virtual device.",status:"error",duration:5e3,isClosable:!0})}),e.on("virtual_devices_updated",e=>{console.info("\ud83d\udd04 Virtual devices updated:",e),e&&(e.android||e.ios)?Ge({android:e.android||[],ios:e.ios||[]}):en(),tn()}),e.on("agent_activity",e=>{console.info("\ud83e\udd16 Agent Activity:",e),e&&e.activity&&(ot(e.activity),at(Date.now()))}),e.on("buffered_logs",e=>{console.info("\ud83d\udce5 Received buffered logs on reconnect"),e.logs&&Array.isArray(e.logs)&&y(t=>{const n=[...t];let r=!1,o="";return e.logs.forEach(e=>{let t=null;if("command_converted"===e.type?t={type:"ai_conversion",original:e.original,converted:e.converted,provider:e.provider,timestamp:new Date}:"command_output"!==e.type&&"ai_error"!==e.type&&"command_error"!==e.type||(t={type:"command_output"===e.type?"output":"error",text:e.data||e.output||e.error||"",device:e.device,timestamp:new Date},o+="\n"+t.text),t){n.slice(-20).some(e=>e.type===t.type&&(t.text&&e.text===t.text||t.converted&&e.converted===t.converted))||(n.push(t),r=!0)}}),r&&bt(e=>e+o),n})}),e.on("commander_started",e=>{console.info("\ud83c\udfaf Commander mode auto-started:",e.device),Me(e.device);const t="\n".concat("\u2500".repeat(50),"\n\ud83c\udfaf ").concat(e.message,"\n").concat("\u2500".repeat(50),"\n");bt(e=>e+t),Zt({type:"output",text:t,timestamp:new Date}),zt({title:"Commander Mode Active",description:"".concat(e.device," is now the commander device"),status:"info",duration:3e3})}),e.on("commander_status",e=>{e.commander?Me(e.commander):Me(null)}),e.on("recording_updated",e=>{e.recording&&ye(e.recording)}),e.on("command_converted",e=>{var t;console.info("\ud83e\udd16 AI Converted:",e);const n=e.converted||"",r=n.split(/[\n;]/).map(e=>e.trim()).filter(e=>e.length>0),o=r.filter(e=>!e.startsWith("WAIT "));console.info("\ud83d\udccb Parsed commands:",r),console.debug("\ud83d\udcca Total count:",r.length,"| Actual commands:",o.length),console.info("\ud83d\udcac First command:",r[0]),F(r),B(0),V([]),Vt("executing"),N(r[0]||n),_t(o.length),Ct(null!==(t=r[0])&&void 0!==t&&t.startsWith("WAIT ")?0:1),Ot.current=r,Lt.current=0,Dt.current=new Set,console.debug("\u2705 AI Status set to:",{status:"executing",queue:r,currentIndex:0,currentCommand:r[0],queueLength:r.length}),console.debug("\ud83d\udd0d Display should show now with",r.length,"commands in queue"),bt(t=>t+'\n\ud83e\udd16 AI: "'.concat(e.original,'" \u2192 "').concat(e.converted,'"\n')),Zt({type:"ai_conversion",original:e.original,converted:e.converted,provider:e.provider,timestamp:new Date})}),e.on("command_output",e=>{const t=e.output||e.data||"";console.info("\ud83d\udce4 Command output received:",JSON.stringify(t.substring(0,80))),bt(e=>e+"\n"+t),Zt({type:"output",text:t,device:e.device,timestamp:new Date});const n=t.match(/\u25b6\ufe0f\s+\[(\d+)\/(\d+)\]/);if(n&&Ot.current.length>0){const e=parseInt(n[1]),r=parseInt(n[2]),o=e-1;if(console.debug("\ud83d\udd04 Backend progress detected:",{current:e,total:r,commandIndex:o,output:t.substring(0,50)}),o!==Lt.current){const e=Lt.current;e>=0&&!Dt.current.has(e)&&(console.info("\u2713 Marking command",e,"as completed"),Dt.current.add(e),V(t=>[...t,e])),console.info("\u27a1\ufe0f Moving UI to command",o),Lt.current=o,B(o);const t=Ot.current[o];if(t){N(t);const e=Ot.current.slice(0,o+1).filter(e=>!e.startsWith("WAIT "));Ct(e.length)}}}}),e.on("command_error",e=>{const t=e.error&&(e.error.includes("not connected")||e.error.includes("Connect button")||e.error.includes("No devices found"));zt({title:t?"\ud83d\udd0c Device Not Connected":"Command Error",description:e.error,status:"error",duration:t?8e3:5e3,isClosable:!0}),Ue(t=>{if(!t||"command"!==t.kind||t.done)return t;const n=p({},t.results);return t.targets.forEach(t=>{n[t]||(n[t]={success:!1,error:e.error})}),p(p({},t),{},{results:n,done:!0})}),Ot.current=[],Lt.current=-1,Dt.current=new Set,Vt(""),N(""),F([]),B(-1),S(!1)}),e.on("ai_error",e=>{console.error("\u274c AI Error:",e);let t=e.error||"Unknown AI error",n="\u274c AI Conversion Failed";t.includes("quota")||t.includes("429")?(n="\u26a0\ufe0f AI Quota Exceeded",t="AI API quota limit reached. Please try again later or use manual commands."):t.includes("not configured")?(n="\u26a0\ufe0f AI Not Configured",t="AI provider not set up. Please configure API keys in settings."):(t.includes("401")||t.includes("authentication"))&&(n="\u26a0\ufe0f AI Authentication Failed",t="Invalid API key. Please check your AI provider settings."),Vt("error"),N("".concat(n,"\n").concat(t,'\n\nOriginal command: "').concat(e.original,'"')),F([]),B(-1),S(!1),Ot.current=[],Lt.current=-1,Dt.current=new Set,bt(r=>r+"\n".concat(n,"\n").concat(t,'\nOriginal command: "').concat(e.original,'"\n\n')),Zt({type:"error",text:"".concat(n,": ").concat(t),timestamp:new Date})}),e.on("action_result",e=>{Ue(t=>t&&t.id===e.actionId&&e.device?p(p({},t),{},{targets:t.targets.includes(e.device)?t.targets:[...t.targets,e.device],results:p(p({},t.results),{},{[e.device]:{success:e.success,error:e.error,ms:e.ms}})}):t)}),e.on("command_complete",e=>{console.info("\ud83c\udfc1 All commands completed on device:",e);const t=Array.isArray(e.deviceResults)?e.deviceResults:[],n=t.filter(e=>!e.success);Ue(e=>{if(!e||"command"!==e.kind)return e;const n=p({},e.results);return t.forEach(e=>{n[e.device]={success:e.success,error:e.error,step:e.step}}),p(p({},e),{},{results:n,done:!0})});if(Ot.current.length>0||["thinking","executing","stopping"].includes(Ut.current)){const r=Lt.current;r>=0&&!Dt.current.has(r)&&0===n.length&&!e.stopped&&(Dt.current.add(r),V(e=>[...e,r])),He(t),e.stopped?Vt("stopped"):n.length>0&&n.length===t.length?(Vt("error"),N(t.length>1?"Failed on all ".concat(t.length," devices"):"The command failed")):n.length>0?Vt("partial"):Vt("completed"),B(-1),Lt.current=-1}else n.length>0&&zt({title:"Failed on ".concat(n.length," of ").concat(t.length," device").concat(t.length>1?"s":""),description:n.map(e=>"".concat(e.device,": ").concat(e.error||"failed")).join("\n"),status:n.length===t.length?"error":"warning",duration:6e3,isClosable:!0});S(!1)}),e.connect(),()=>{Rt.current&&Rt.current.disconnect()}},[Te,zt]);const Jt=e=>{const t=e.filter(e=>"online"===e.status).map(e=>e.name);u(t),f(e=>e.filter(e=>!t.includes(e)))},Qt=async()=>{try{const e=await fetch("".concat(yE,"/api/settings/api-config")),t=await e.json(),n="ollama"===t.provider||Object.keys(t).some(e=>e.startsWith("has_")&&(e.endsWith("_key")||e.endsWith("_token"))&&t[e]);E(n),!n&&j&&k(!1)}catch(e){console.error("Failed to check API key:",e),E(!1)}};(0,t.useEffect)(()=>{Qt()},[]);const Zt=(0,t.useCallback)(e=>{y(t=>[e,...t].slice(0,50))},[]),en=(0,t.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{const[t,n]=await Promise.all([cD.getCapabilities(e).catch(()=>null),cD.getVirtualDevices(!0).catch(()=>({android:[],ios:[]}))]);t&&Qe(t),n&&Ge(n)}catch(CF){console.warn("Failed to load virtual devices:",CF)}},[]),tn=async()=>{q(!0);try{const e=(await dF.getDevices(!0)).devices||[],t=[...e].sort((e,t)=>("online"===e.status?0:1)-("online"===t.status?0:1));s(t),Jt(e);const n=e.filter(e=>"online"===e.status).map(e=>e.name);c(e=>e.filter(e=>n.includes(e))),en()}catch(e){zt({title:"Refresh Failed",description:e.message,status:"error",duration:3e3})}finally{q(!1)}},nn=(0,t.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const i=e||v.trim();if(!i)return void zt({title:"Empty Command",description:"Please enter a command",status:"warning",duration:2e3});if(b.some(e=>"string"===typeof e?e===i:e.text===i)||y(e=>[{text:i,commandType:t||"raw",argument:null!==n?n:i},...e].slice(0,50)),0===l.length)return void zt({title:"No Devices Selected",description:"Please select at least one device",status:"warning",duration:2e3});const a=!r&&(void 0!==o.useAI?o.useAI:j&&(o.isFromCommandPanel||"voice"===t||null===e||null!==n&&null!==t));if(a&&!r){if(!(()=>{try{return"true"===localStorage.getItem("devicely-skip-ai-plan-preview")}catch(e){return!1}})())try{D("thinking"),N('Analyzing: "'.concat(i,'"...'));const e=await fetch("".concat(yE,"/api/convert-command"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:i,devices:l})}),t=await e.json();if(t.success&&t.command)return fe({originalPrompt:i,translatedCommand:t.command}),he(!0),Vt("idle"),void x("");throw new Error(t.error||"Failed to convert command with AI")}catch(CF){return console.warn("AI conversion failed:",CF),zt({title:"AI Translation Failed",description:CF.message||"Could not interpret command",status:"error",duration:4e3,isClosable:!0}),Vt("error"),void N(CF.message||"AI conversion failed")}}if(a)Vt("thinking"),N(i),He([]);else if(r){var s;const e=i.split(/[\n;]/).map(e=>e.trim()).filter(e=>e.length>0),t=e.filter(e=>!e.startsWith("WAIT "));F(e),B(0),V([]),Vt("executing"),N(e[0]||pe.originalPrompt||i),_t(t.length),Ct(null!==(s=e[0])&&void 0!==s&&s.startsWith("WAIT ")?0:1),Ot.current=e,Lt.current=0,Dt.current=new Set,He([])}Ue({id:"cmd_".concat(Date.now().toString(36)),kind:"command",label:a||r?"AI: ".concat(r&&pe.originalPrompt?pe.originalPrompt:i):i,targets:[...l],results:{},startedAt:Date.now()}),S(!0),Zt({type:"command",text:r&&pe.originalPrompt?pe.originalPrompt:i,devices:l,timestamp:new Date,useAI:a||r}),x("");try{const e={type:"execute_command",devices:l,command:i,useAI:a};if(!Rt.current)throw new Error("WebSocket not connected");if("function"===typeof Rt.current.send)Rt.current.send(e);else{if(!Rt.current.ws||Rt.current.ws.readyState!==WebSocket.OPEN)throw new Error("WebSocket not connected");Rt.current.ws.send(JSON.stringify(e))}}catch(c){zt({title:"Execution Error",description:c.message,status:"error",duration:3e3}),S(!1),Vt("error"),N(c.message)}finally{x("")}},[l,zt,Rt,Zt,b,v,j,pe.originalPrompt,Vt]),rn=(0,t.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=e||v.trim(),n=!!e;if(!t)return void zt({title:"Empty Command",description:"Please enter a command",status:"warning",duration:2e3});n||x(""),S(!0),Zt({type:"broadcast",text:t,devices:l,timestamp:new Date,useAI:j});const r="act_".concat(Date.now().toString(36),"_").concat(Math.random().toString(36).slice(2,6)),o=Fe.commander,i=(Fe.followers||[]).map(e=>(null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.deviceId)||e);Ue({id:r,kind:"mirror",label:t,targets:[o,...i.filter(e=>l.includes(e))].filter(Boolean),results:{},startedAt:Date.now()});try{const e=await fetch("".concat(yE,"/api/commander/execute-command"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:t,targets:l,actionId:r})}),o=await e.json();if(!o.success)throw new Error(o.error||"Request failed (".concat(e.status,")"));n||zt({title:"Sent",description:o.message,status:"success",duration:2e3})}catch(a){o&&Ue(e=>e&&e.id===r&&!e.results[o]?p(p({},e),{},{results:p(p({},e.results),{},{[o]:{success:!1,error:a.message}})}):e),zt({title:"Commander action failed",description:a.message,status:"error",duration:5e3})}finally{S(!1),n||x("")}},[v,l,j,zt,Zt,Fe]),on=(0,t.useRef)(new Set);(0,t.useEffect)(()=>{const e=new Set((Fe.followers||[]).map(e=>(null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.deviceId)||e).filter(Boolean)),t=[...e].filter(e=>!on.current.has(e)),n=[...on.current].filter(t=>!e.has(t));on.current=e,t.length>0&&c(e=>[...e,...t.filter(t=>!e.includes(t))]),n.length>0&&c(e=>e.filter(e=>!n.includes(e)))},[Fe.followers]),(0,t.useEffect)(()=>{Fe.isActive&&_e&&fetch("".concat(yE,"/api/commander/targets"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({devices:l})}).catch(e=>console.warn("Could not sync commander targets:",e.message))},[l,Fe.isActive,Fe.commander,_e]);const[an,sn]=(0,t.useState)(()=>{try{return"swipe"===localStorage.getItem("devicely_dpad_mode")?"swipe":"scroll"}catch(e){return"scroll"}}),ln=(0,t.useCallback)(()=>{sn(e=>{const t="scroll"===e?"swipe":"scroll";try{localStorage.setItem("devicely_dpad_mode",t)}catch(kF){console.warn("Failed to save D-pad mode:",kF)}return t})},[]),cn=(0,t.useCallback)(e=>"swipe"===an?"swipe ".concat(e):{up:"swipe down",down:"swipe up",left:"swipe right",right:"swipe left"}[e],[an]),dn=e=>"swipe"===an?"Swipe ".concat(e):"Scroll ".concat(e," (").concat(cn(e),")"),un=(0,t.useCallback)(e=>{const t=cn(e);t&&(console.info("\ud83c\udfae D-Pad ".concat(e.toUpperCase()," \u2192 ").concat(t)),nn(t))},[nn,cn]),hn=(0,t.useCallback)(e=>{e&&(O(e),T(""),x(e))},[]),pn=(0,t.useCallback)((e,t)=>{T(e),O(t),"listening"===e&&t&&x(t)},[]);(0,t.useEffect)(()=>{It.current=hn},[hn]);const fn=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},mn=async e=>{f(t=>[...t,e.name]);const t="\n".concat("\u2500".repeat(50),"\n\ud83d\udce1 Connecting to ").concat(e.name,"...\n").concat("\u2500".repeat(50));bt(e=>e+t),Zt({type:"output",text:t,timestamp:new Date});try{const t=await dF.connectDevice(e);if(t.success){const n=t.message||"Connected to ".concat(e.name),r="\u2705 ".concat(n,"\n").concat("\u2500".repeat(50),"\n");bt(e=>e+"\n".concat(r)),Zt({type:"output",text:r,timestamp:new Date}),t.wdaStarting||f(t=>t.filter(t=>t!==e.name))}else{const n=t.message||"Failed to connect to device",r="\u274c ".concat(n,"\n").concat("\u2500".repeat(50),"\n");bt(e=>e+"\n".concat(r)),Zt({type:"output",text:r,timestamp:new Date}),f(t=>t.filter(t=>t!==e.name))}}catch(n){const t="\u274c Connection Error: ".concat(n.message,"\n").concat("\u2500".repeat(50),"\n");bt(e=>e+"\n".concat(t)),Zt({type:"output",text:t,timestamp:new Date}),f(t=>t.filter(t=>t!==e.name))}},gn=async e=>{if(window.confirm("Remove ".concat(e.name," from the device list and devices.conf?")))try{const t=await dF.deleteDevice(e);s(t.devices||[]),c(t=>t.filter(t=>t!==e.name)),f(t=>t.filter(t=>t!==e.name)),Ne===e.name&&Me(null),zt({title:t.removedFromConfig?"Device removed":"Device hidden",description:t.message,status:t.willReappear?"info":"success",duration:4e3})}catch(t){zt({title:"Failed to remove device",description:t.message,status:"error",duration:4e3})}},vn=async e=>{g(t=>[...t,e.name]);try{const t=await dF.convertToWireless(e);if(t.success){t.devices&&s(t.devices);const e="\n".concat("\u2500".repeat(50),"\n\ud83d\udce1 ").concat(t.message,"\n").concat("\u2500".repeat(50),"\n");bt(t=>t+e),Zt({type:"output",text:e,timestamp:new Date}),zt({title:t.alreadyWireless?"Already on WiFi":"Switched to WiFi",description:t.message,status:"success",duration:6e3,isClosable:!0})}else zt({title:"Could not switch to WiFi",description:t.error,status:"warning",duration:9e3,isClosable:!0})}catch(t){zt({title:"Could not switch to WiFi",description:t.message,status:"error",duration:6e3,isClosable:!0})}finally{g(t=>t.filter(t=>t!==e.name))}},xn=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{const n=e.platform||("avd"===e.kind?"android":"ios"),r=e.virtualId||e.id||e.avdName||e.name;nt(!0),zt({title:"Starting Virtual Device",description:"Launching ".concat(e.displayName||e.name,"..."),status:"info",duration:3e3}),await cD.bootDevice(n,r,t)}catch(CF){nt(!1),zt({title:"Launch Failed",description:CF.message,status:"error",duration:5e3,isClosable:!0})}},bn=async e=>{const t="\n".concat("\u2500".repeat(50),"\n\ud83d\udd0c Disconnecting from ").concat(e.name,"...\n").concat("\u2500".repeat(50));bt(e=>e+t),Zt({type:"output",text:t,timestamp:new Date});const n=Ne===e.name||Fe.commander===e.name,r=(Fe.followers||[]).some(t=>((null===t||void 0===t?void 0:t.name)||(null===t||void 0===t?void 0:t.deviceId)||t)===e.name);if(n){Me(null),We(e=>p(p({},e),{},{isActive:!1,commander:null,followers:[]}));try{var o;null!==(o=At.current)&&void 0!==o&&o.stopCommanderMode?await At.current.stopCommanderMode():await BM.stopCommander()}catch(kF){console.warn("Error stopping commander mode on disconnect:",kF)}}else if(r){We(t=>p(p({},t),{},{followers:(t.followers||[]).filter(t=>((null===t||void 0===t?void 0:t.name)||(null===t||void 0===t?void 0:t.deviceId)||t)!==e.name)}));try{await BM.removeFollower(e.name)}catch(kF){console.warn("Error removing follower on disconnect:",kF)}}if(Rt.current)try{"function"===typeof Rt.current.emit?Rt.current.emit("stop_screenshot_stream",{deviceName:e.name}):"function"===typeof Rt.current.send&&Rt.current.send(JSON.stringify({type:"stop_screenshot_stream",deviceName:e.name}))}catch(kF){}c(t=>t.filter(t=>t!==e.name));try{const t=await dF.disconnectDevice(e);if(t.success){const t="\u2705 Disconnected from ".concat(e.name,"\n").concat("\u2500".repeat(50),"\n");bt(e=>e+"\n".concat(t)),Zt({type:"output",text:t,timestamp:new Date})}else{const e="\u274c Failed to disconnect: ".concat(t.message||"Unknown error","\n").concat("\u2500".repeat(50),"\n");bt(t=>t+"\n".concat(e)),Zt({type:"output",text:e,timestamp:new Date})}}catch(i){const e="\u274c Disconnect Error: ".concat(i.message,"\n").concat("\u2500".repeat(50),"\n");bt(t=>t+"\n".concat(e)),Zt({type:"output",text:e,timestamp:new Date})}},yn=(0,t.useCallback)(async()=>{if(0===l.length)return void zt({title:"No devices selected",description:"Please select devices to record",status:"warning",duration:3e3,isClosable:!0});const e=ve.trim()||"recording_".concat(Date.now());try{const t=await fetch("".concat(yE,"/api/recording/start"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,devices:l})}),n=await t.json();n.success&&(ge(!0),ye(n.recording),xe(""),zt({title:"\ud83d\udd34 Recording started",description:'Recording as "'.concat(e,'"'),status:"success",duration:3e3,isClosable:!0}))}catch(t){zt({title:"Failed to start recording",description:t.message,status:"error",duration:3e3,isClosable:!0})}},[l,ve,zt]),wn=(0,t.useCallback)(async e=>{try{const t=await fetch("".concat(yE,"/api/recording/stop"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e?{name:e}:{})}),n=await t.json();n.success&&(ge(!1),ye(null),zt({title:"\u23f9\ufe0f Recording stopped",description:'"'.concat(n.recording.name,'" saved with ').concat(n.recording.commands.length," steps"),status:"success",duration:4e3,isClosable:!0}))}catch(t){zt({title:"Failed to stop recording",description:t.message,status:"error",duration:3e3,isClosable:!0})}},[zt]);(0,t.useEffect)(()=>{(async()=>{try{const e=await fetch("".concat(yE,"/api/recording/status")),t=await e.json();ge(t.isRecording),ye(t.recording)}catch(e){console.error("Error checking recording status:",e)}})()},[]),(0,t.useEffect)(()=>{const e=e=>{const t=["INPUT","TEXTAREA","SELECT"].includes(e.target.tagName)||e.target.isContentEditable;var n;if((e.metaKey||e.ctrlKey)&&("k"===e.key||"K"===e.key))return e.preventDefault(),void(null===(n=_.current)||void 0===n||n.focus());if(t)"Escape"===e.key&&e.target.blur();else if("?"!==e.key||e.metaKey||e.ctrlKey)if("Escape"===e.key){const t=Date.now();if(t-ut.current<450&&Yt)return e.preventDefault(),Kt(),void(ut.current=0);ut.current=t,de(!1),ae(!1),le(!1)}else if((e.metaKey||e.ctrlKey)&&"."===e.key){if(Yt)return e.preventDefault(),void Gt()}else"h"===e.key||"H"===e.key?l.length>0&&(e.preventDefault(),nn("home")):"b"===e.key||"B"===e.key?l.length>0&&(e.preventDefault(),nn("back")):"s"===e.key||"S"===e.key?l.length>0&&(e.preventDefault(),nn("screenshot")):"r"===e.key||"R"===e.key?(e.preventDefault(),me?wn():l.length>0&&yn()):"i"!==e.key&&"I"!==e.key||d.length>0&&(e.preventDefault(),le(e=>!e));else e.preventDefault(),de(!0)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l,d,me,Yt,Kt,Gt,nn,yn,wn]);const Sn=(0,t.useCallback)(e=>{const t=pF.includes(e)?e:"control";window.location.hash!=="#/".concat(t)&&(window.location.hash="/".concat(t)),Y(t),"control"===t&&(ae(!1),le(!1))},[]);(0,t.useEffect)(()=>{const e=()=>Y(fF());return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);const jn=(0,t.useRef)($);(0,t.useEffect)(()=>{"settings"===jn.current&&"settings"!==$&&Qt(),jn.current=$},[$]),(0,t.useEffect)(()=>{const e=window.matchMedia("(max-width: 1099px)");e.matches&&oe(!1);const t=e=>oe(!e.matches);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),(0,t.useEffect)(()=>{localStorage.setItem("devicely_terminal_open",String(Z))},[Z]),(0,t.useEffect)(()=>{localStorage.setItem("devicely_terminal_height",String(te))},[te]);const kn=e=>Math.round(Math.min(Math.max(e,120),.6*window.innerHeight)),Cn=function(){Q(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0),Sn("settings")},En=a.slice().sort((e,t)=>{const n=d.includes(e.name);return n===d.includes(t.name)?0:n?-1:1}),_n=function(){Ke(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"android"),$e(!0)},zn={onAddManually:()=>Cn(1),onRescan:tn,onOpenAndroidEmulators:()=>_n("android"),onOpenIosSimulators:()=>_n("ios"),onLaunchVirtual:_n,onOpenVirtualDevices:_n};return(0,i.jsxs)(fw,{direction:"column",h:"100vh",bg:Ht,overflow:"hidden",children:[Oe&&(0,i.jsx)(mw,{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",bg:"rgba(0,0,0,0.7)",zIndex:"9999",display:"flex",alignItems:"center",justifyContent:"center",children:(0,i.jsxs)(ww,{spacing:4,bg:qt,p:8,borderRadius:"xl",boxShadow:"2xl",children:[(0,i.jsx)(jw,{size:"md",color:"blue.400",children:"\ud83d\ude80 Starting Devicely"}),(0,i.jsx)(Cw,{color:"gray.400",children:De>0?"Connecting to backend... (".concat(De,"/10)"):"Initializing..."}),(0,i.jsx)(mw,{width:"200px",height:"3px",bg:"gray.600",borderRadius:"full",overflow:"hidden",children:(0,i.jsx)(mw,{height:"100%",bg:"blue.400",borderRadius:"full",animation:"progress 2s infinite",sx:{"@keyframes progress":{"0%":{width:"0%",marginLeft:"0%"},"50%":{width:"50%",marginLeft:"25%"},"100%":{width:"0%",marginLeft:"100%"}}}})})]})}),(0,i.jsx)(mw,{flexShrink:0,children:(0,i.jsx)(_M,{isConnected:_e,isBackendAvailable:Re,isInitializing:Oe,onRetry:async()=>{zt({title:"Reconnecting...",description:"Attempting to reconnect to backend server",status:"info",duration:2e3});const e=await hF();Ae(e),e&&Rt.current?(Rt.current.reconnect(),tn()):zt({title:"Connection Failed",description:"Backend server is not responding. Please start the backend with: devicely start",status:"error",duration:8e3})}})}),(0,i.jsx)(RC,{view:$,onNavigate:Sn,isBackendAvailable:Re,isConnected:_e,onlineCount:d.length,totalCount:a.length,isRecording:me,recordingCommandCount:(null===be||void 0===be||null===(e=be.commands)||void 0===e?void 0:e.length)||0,agentCount:Yt?1:0}),Yt&&(0,i.jsxs)(mw,{bg:"teal.900",color:"white",px:4,py:2,borderBottomWidth:"1px",borderColor:"teal.700",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0,zIndex:10,boxShadow:"md",children:[(0,i.jsxs)(Ew,{spacing:3,children:[(0,i.jsx)(zw,{colorScheme:"teal",variant:"solid",px:2.5,py:.5,borderRadius:"md",fontSize:"xs",fontWeight:"bold",children:"\ud83e\udd16 AGENT DRIVING"}),(0,i.jsxs)(Cw,{fontSize:"sm",fontWeight:"medium",children:[(0,i.jsx)("b",{children:rt.client||"AI Agent"})," is driving ",(null===(n=rt.devices)||void 0===n?void 0:n.length)||1," device",1===((null===(r=rt.devices)||void 0===r?void 0:r.length)||1)?"":"s",rt.tool&&" \xb7 ".concat(rt.tool),rt.text&&' ("'.concat(rt.text.length>35?rt.text.substring(0,35)+"\u2026":rt.text,'")'),st&&" \xb7 [PAUSED]"]})]}),(0,i.jsxs)(Ew,{spacing:2,children:[st?(0,i.jsx)(Ww,{size:"xs",colorScheme:"teal",variant:"solid",onClick:Xt,children:"\u25b6 Resume"}):(0,i.jsx)(Ww,{size:"xs",colorScheme:"yellow",variant:"solid",onClick:Kt,title:"Pause agent (Press Esc twice)",children:"\u23f8 Pause (Esc Esc)"}),(0,i.jsx)(Ww,{size:"xs",colorScheme:"red",variant:"solid",onClick:Gt,title:"Emergency stop agent (\u2318.)",children:"\u25a0 Stop (\u2318.)"})]})]}),(0,i.jsx)(mw,{as:"main",id:"main-content",tabIndex:-1,flex:"1",minH:0,display:"flex",flexDirection:"column",overflowY:"control"===$?"hidden":"auto",_focus:{outline:"none"},children:X?(0,i.jsx)(JL,{selectedDevices:l,wsService:Rt.current,onClose:()=>Sn("control"),onOpenSettings:()=>Cn(0),onNavigateHome:()=>Sn("control"),connectedDevices:d,replayingFile:we,setReplayingFile:Se,replayOutput:je,setReplayOutput:ke,isReplayTerminalOpen:Ce,setIsReplayTerminalOpen:Ee}):K?(0,i.jsx)(xD,{initialTab:J,onClose:()=>Sn("control"),onOpenRecordings:()=>Sn("recordings"),onNavigateHome:()=>Sn("control"),connectedDevices:d}):G?(0,i.jsxs)(Vw,{maxW:"container.2xl",py:8,children:[(0,i.jsxs)(Ew,{mb:6,children:[(0,i.jsx)(qw,{icon:(0,i.jsx)(mC,{}),onClick:()=>Sn("control"),variant:"ghost","aria-label":"Back to control"}),(0,i.jsx)(jw,{size:"lg",children:"Setup Guide & Documentation"})]}),(0,i.jsx)(KD,{})]}):(0,i.jsxs)(fw,{flex:"1",minH:0,children:[(0,i.jsx)(fw,{as:"aside","aria-label":"Devices",direction:"column",w:re?"280px":"60px",flexShrink:0,minH:0,borderRightWidth:"1px",borderColor:$t,bg:qt,"data-testid":"device-pane",children:re?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(mw,{px:3,pt:3,pb:2,flexShrink:0,borderBottomWidth:"1px",borderColor:$t,children:[(0,i.jsxs)(Ew,{justify:"space-between",mb:2,children:[(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(jw,{as:"h2",size:"xs",textTransform:"uppercase",letterSpacing:"wider",color:"gray.600",_dark:{color:"gray.300"},children:"Devices"}),(0,i.jsxs)(zw,{colorScheme:"green",fontSize:"2xs",borderRadius:"md",children:[d.length," online"]}),a.length-d.length>0&&(0,i.jsxs)(zw,{colorScheme:"gray",fontSize:"2xs",borderRadius:"md",children:[a.length-d.length," offline"]})]}),(0,i.jsxs)(Ew,{spacing:0,children:[(0,i.jsx)(qw,{icon:(0,i.jsx)(Sk,{}),size:"xs",variant:"ghost",onClick:tn,isLoading:H,"aria-label":"Rescan devices",title:"Rescan devices"}),(0,i.jsx)(qw,{icon:(0,i.jsx)(sC,{}),size:"xs",variant:"ghost",onClick:()=>oe(!1),"aria-label":"Collapse device list","aria-expanded":"true",title:"Collapse device list"})]})]}),(0,i.jsxs)(Ew,{spacing:1.5,children:[(0,i.jsx)(Ww,{size:"xs",variant:"outline",colorScheme:"green",onClick:async()=>{const e=a.filter(e=>"online"!==e.status);if(0===e.length)return;const t="\n".concat("\u2500".repeat(50),"\n\ud83d\udd17 Connecting all devices (").concat(e.length,")...\n").concat("\u2500".repeat(50));bt(e=>e+t),Zt({type:"output",text:t,timestamp:new Date}),f(t=>[...t,...e.map(e=>e.name)]);try{const e=await dF.connectAllDevices();if(e.success){const t="\n\u2705 ".concat(e.message,"\n").concat("\u2500".repeat(50),"\n");bt(e=>e+t),Zt({type:"output",text:t,timestamp:new Date})}else{const t="\n\u274c ".concat(e.message||"Failed to connect all devices","\n").concat("\u2500".repeat(50),"\n");bt(e=>e+t),Zt({type:"output",text:t,timestamp:new Date})}}catch(n){const e="\n\u274c Error: ".concat(n.message,"\n").concat("\u2500".repeat(50),"\n");bt(t=>t+e),Zt({type:"output",text:e,timestamp:new Date})}},isDisabled:0===a.filter(e=>"online"!==e.status).length,children:"Connect all"}),(0,i.jsx)(Ww,{size:"xs",variant:"outline",onClick:()=>c(a.filter(e=>"online"===e.status).map(e=>e.name)),isDisabled:0===d.length,children:"Target all"}),(0,i.jsx)(Ww,{size:"xs",variant:"ghost",onClick:()=>c([]),isDisabled:0===l.length,children:"Clear"})]})]}),(0,i.jsx)(ww,{spacing:1.5,align:"stretch",flex:"1",minH:0,overflowY:"auto",p:3,"data-testid":"device-list",children:0===a.length?(0,i.jsxs)(ww,{spacing:3,align:"stretch",w:"full",children:[(0,i.jsx)(cF,{virtualDevices:Xe,capabilities:Je,progress:Object.values(Ze)[0],isBooting:tt,onLaunch:xn,onOpenPanel:()=>$e(!0)}),(0,i.jsxs)(ww,{spacing:2,py:4,px:3,textAlign:"center",borderWidth:"1px",borderStyle:"dashed",borderColor:"gray.300",_dark:{borderColor:"gray.600"},borderRadius:"lg",children:[(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.500",_dark:{color:"gray.400"},children:"Or connect a physical device"}),(0,i.jsx)(GM,p(p({},zn),{},{buttonProps:{size:"xs",variant:"outline",w:"full"}}))]})]}):En.map(e=>{var t,n,r,o,a;const s=Yt&&((null===rt||void 0===rt||null===(t=rt.devices)||void 0===t?void 0:t.includes(e.name))||(null===rt||void 0===rt||null===(n=rt.devices)||void 0===n?void 0:n.includes(e.udid))||(null===rt||void 0===rt||null===(r=rt.devices)||void 0===r?void 0:r.includes(e.serial))||(null===rt||void 0===rt||null===(o=rt.devices)||void 0===o?void 0:o.includes("all"))||(null===rt||void 0===rt||null===(a=rt.devices)||void 0===a?void 0:a.includes("online")));return(0,i.jsx)(QL,{device:e,isSelected:l.includes(e.name),isConnected:d.includes(e.name),isConnecting:h.includes(e.name),isCommander:Ne===e.name,isAgentActive:s,onSelect:fn,onConnect:mn,onDisconnect:bn,onDelete:gn,isConvertingToWireless:m.includes(e.name),onConvertToWireless:vn},e.udid)})}),a.length>0&&(0,i.jsx)(mw,{p:3,pt:2,flexShrink:0,borderTopWidth:"1px",borderColor:$t,children:(0,i.jsx)(GM,p(p({},zn),{},{buttonProps:{size:"xs",variant:"outline",w:"full",borderStyle:"dashed"}}))})]}):(0,i.jsxs)(ww,{spacing:2,py:3,align:"center",flex:"1",minH:0,overflowY:"auto","data-testid":"device-strip",children:[(0,i.jsx)(qw,{icon:(0,i.jsx)(aC,{}),size:"sm",variant:"ghost",onClick:()=>oe(!0),"aria-label":"Expand device list","aria-expanded":"false",title:"Expand device list"}),(0,i.jsxs)(zw,{colorScheme:"green",fontSize:"2xs",title:"".concat(d.length," of ").concat(a.length," online"),children:[d.length,"/",a.length]}),En.map(e=>{const t=d.includes(e.name),n=l.includes(e.name),r=Ne===e.name,o="".concat(e.name," \xb7 ").concat("android"===e.platform?"Android":"iOS"," \xb7 ").concat(t?"online":"offline").concat(r?" \xb7 commander":"").concat(n?" \xb7 targeted":"");return(0,i.jsx)(Uj,{label:o,placement:"right",children:(0,i.jsxs)(Ww,{size:"sm",w:"36px",h:"36px",minW:"36px",p:0,borderRadius:"full",variant:n?"solid":"outline",colorScheme:t?"android"===e.platform?"green":"blue":"gray",opacity:t?1:.6,"aria-label":o,"aria-pressed":n,onClick:()=>t&&fn(e.name),isDisabled:!t,position:"relative",fontSize:"xs",fontWeight:"700",children:[(e.name||"?").slice(0,2),r&&(0,i.jsx)(mw,{as:"span",position:"absolute",top:"-6px",right:"-6px",fontSize:"10px","aria-hidden":"true",children:"\ud83d\udc51"})]})},e.udid||e.name)}),(0,i.jsx)(GM,p(p({},zn),{},{iconOnly:!0,buttonProps:{size:"sm",variant:"ghost"}}))]})}),(0,i.jsxs)(fw,{direction:"column",flex:"1",minW:0,minH:0,children:[(0,i.jsx)(mw,{flex:"1",minH:0,overflowY:"auto",px:4,pt:4,"data-testid":"stage-scroll",children:(0,i.jsx)(HM,{ref:At,devices:a,onBroadcastAction:rn,wsService:Rt.current,connectedDevices:d,onSwapCommander:async e=>{if(At.current&&At.current.swapToDevice){await At.current.swapToDevice(e)&&(c(t=>t.includes(e)?t:[...t,e]),zt({title:"Commander switched",description:"".concat(e," is now the commander"),status:"success",duration:2e3}))}},onStatusChange:We,targetDevices:l,onToggleTarget:fn,onSetTargets:c,lastAction:Be,toolbarExtras:(0,i.jsx)(qM,{isRecording:me,commandCount:(null===be||void 0===be||null===(o=be.commands)||void 0===o?void 0:o.length)||0,currentName:null===be||void 0===be?void 0:be.name,onStart:yn,onStop:wn,isDisabled:0===l.length,buttonProps:{color:"red.200",borderColor:"red.300",_hover:{bg:"whiteAlpha.200"}}})})}),(0,i.jsx)(mw,{flexShrink:0,px:4,pb:3,pt:1,"data-testid":"command-dock",children:(0,i.jsx)(CE,{commandInput:v,setCommandInput:x,commandInputRef:_,onExecute:nn,useAI:j,setUseAI:k,hasApiKey:C,onConfigureAI:()=>Cn(0),isExecuting:w,selectedDevices:l,connectedDevices:d,onVoiceInput:hn,onVoiceStatusChange:pn,isListening:z,setIsListening:R,voiceStatus:A,voiceTranscript:P,aiProcessingStatus:L,aiDeviceResults:Ve,aiProcessingText:I,aiCommandQueue:M,currentCommandIndex:W,completedCommands:U,currentActualCommandNumber:kt,totalActualCommands:Et,onStopAI:()=>{if(console.info("\ud83d\uded1 Stopping AI execution"),Rt.current&&Rt.current.isConnected())return Rt.current.send({type:"stop_execution"}),void Vt("stopping");Ot.current=[],Lt.current=-1,Dt.current=new Set,Vt(""),N(""),F([]),B(-1),V([]),S(!1)},onCloseAI:()=>{console.info("\u274c Closing AI display"),He([]),Ot.current=[],Lt.current=-1,Dt.current=new Set,Vt(""),N(""),F([]),B(-1),V([])},onSaveAI:async()=>{if(0===M.length)return;const e=prompt("Enter recording name:","AI_Recording_".concat((new Date).toLocaleTimeString().replace(/:/g,"-")));if(!e)return;const t={name:e,commands:M.join("\n"),date:(new Date).toISOString(),type:"ai_generated"};try{const n=await fetch("".concat(yE,"/api/recordings/save"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await n.json();if(!r.success)throw new Error(r.error||"Failed to save");zt({title:"Recording Saved",description:'"'.concat(e,'" saved successfully'),status:"success",duration:3e3}),console.info("\ud83d\udcbe Saved recording:",r.filename)}catch(n){console.error("Error saving recording:",n),zt({title:"Save Failed",description:n.message,status:"error",duration:3e3})}},commandHistory:b,sendTextHistoryIndex:ht,setSendTextHistoryIndex:pt,clickOnHistoryIndex:ft,setClickOnHistoryIndex:mt,launchAppHistoryIndex:gt,setLaunchAppHistoryIndex:vt})}),(0,i.jsxs)(mw,{flexShrink:0,"data-testid":"log-drawer",children:[Z&&(0,i.jsx)(mw,{role:"separator","aria-orientation":"horizontal","aria-label":"Resize log. Use up and down arrows.","aria-valuenow":te,"aria-valuemin":120,tabIndex:0,h:"6px",cursor:"row-resize",bg:"transparent",_hover:{bg:"brand.300"},_focusVisible:{bg:"brand.400",outline:"none"},onPointerDown:e=>{e.preventDefault();const t=e.clientY,n=te,r=e=>ne(kn(n+(t-e.clientY))),o=()=>{window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",o)};window.addEventListener("pointermove",r),window.addEventListener("pointerup",o)},onKeyDown:e=>{if("ArrowUp"===e.key||"ArrowDown"===e.key){e.preventDefault();const t="ArrowUp"===e.key?24:-24;ne(e=>kn(e+t))}}}),(0,i.jsx)(mw,{h:Z?"".concat(te,"px"):"auto",children:(0,i.jsx)(SD,{isConnected:_e,output:xt,history:b,onClear:()=>{bt(""),y([])},isCollapsed:!Z,onToggleCollapsed:()=>ee(e=>!e)})})]})]}),(0,i.jsx)(mw,{as:"aside","aria-label":"Device controls",w:"96px",flexShrink:0,minH:0,overflowY:"auto",p:2,borderLeftWidth:"1px",borderColor:$t,"data-testid":"control-rail",children:(0,i.jsxs)(ww,{spacing:2,align:"stretch",children:[(0,i.jsx)(mw,{bg:qt,borderRadius:"xl",borderWidth:"1px",borderColor:$t,p:2,boxShadow:"md",children:(0,i.jsxs)(ww,{spacing:1.5,children:[(0,i.jsxs)(Cw,{fontSize:"2xs",fontWeight:"bold",textAlign:"center",color:"gray.500",_dark:{color:"gray.400"},children:["Control ",l.length>0?"(".concat(l.length,")"):""]}),(0,i.jsx)(Uj,{label:"Home (H)",placement:"left",hasArrow:!0,children:(0,i.jsx)(qw,{icon:(0,i.jsx)(Uk,{}),size:"sm",variant:"ghost",colorScheme:"gray",onClick:()=>nn("home"),"aria-label":"Home (H)",w:"full",fontSize:"xs",isDisabled:0===l.length})}),(0,i.jsx)(Uj,{label:"Back (B)",placement:"left",hasArrow:!0,children:(0,i.jsx)(qw,{icon:(0,i.jsx)(mC,{}),size:"sm",variant:"ghost",colorScheme:"gray",onClick:()=>nn("back"),"aria-label":"Back (B)",w:"full",fontSize:"xs",isDisabled:0===l.length})}),(0,i.jsx)(Uj,{label:"Recent Apps",placement:"left",hasArrow:!0,children:(0,i.jsx)(qw,{icon:(0,i.jsx)(Fk,{}),size:"sm",variant:"ghost",colorScheme:"gray",onClick:()=>nn("recentapps"),"aria-label":"Recent Apps",w:"full",fontSize:"xs",isDisabled:0===l.length})}),(0,i.jsx)(Uj,{label:"Screenshot (S)",placement:"left",hasArrow:!0,children:(0,i.jsx)(qw,{icon:(0,i.jsx)(uC,{}),size:"sm",variant:"ghost",colorScheme:"gray",onClick:()=>nn("screenshot"),"aria-label":"Screenshot (S)",w:"full",fontSize:"xs",isDisabled:0===l.length})}),(0,i.jsx)(Uj,{label:"Power / Wake",placement:"left",hasArrow:!0,children:(0,i.jsx)(qw,{icon:(0,i.jsx)(jk,{}),size:"sm",variant:"ghost",colorScheme:"orange",onClick:()=>nn("power"),"aria-label":"Power / Wake",w:"full",fontSize:"xs",isDisabled:0===l.length})}),(0,i.jsx)(Uj,{label:"Rotate",placement:"left",hasArrow:!0,children:(0,i.jsx)(qw,{icon:(0,i.jsx)(yk,{}),size:"sm",variant:"ghost",colorScheme:"gray",onClick:()=>nn("rotate"),"aria-label":"Rotate",w:"full",fontSize:"xs",isDisabled:0===l.length})}),(0,i.jsx)(Uj,{label:"Lock",placement:"left",hasArrow:!0,children:(0,i.jsx)(qw,{icon:(0,i.jsx)(Nk,{}),size:"sm",variant:"ghost",colorScheme:"red",onClick:()=>nn("lock"),"aria-label":"Lock",w:"full",fontSize:"xs",isDisabled:0===l.length})}),(0,i.jsx)(Uj,{label:"Unlock",placement:"left",hasArrow:!0,children:(0,i.jsx)(qw,{icon:(0,i.jsx)(ik,{}),size:"sm",variant:"ghost",colorScheme:"gray",onClick:()=>nn("unlock"),"aria-label":"Unlock",w:"full",fontSize:"xs",isDisabled:0===l.length})})]})}),(0,i.jsxs)(ww,{spacing:2,children:[(0,i.jsx)(Ww,{size:"xs",colorScheme:"purple",variant:"outline",leftIcon:(0,i.jsx)(fk,{}),w:"100%",onClick:()=>ae(!0),isDisabled:0===d.length,"aria-label":"Apps menu",children:"Apps"}),(0,i.jsx)(Ww,{size:"xs",colorScheme:"teal",variant:"outline",leftIcon:(0,i.jsx)(ck,{}),w:"100%",onClick:()=>le(!0),isDisabled:0===d.length,children:"Locators"})]}),(0,i.jsx)(mw,{bg:qt,borderRadius:"xl",borderWidth:"1px",borderColor:$t,p:2,boxShadow:"md",mt:2,children:(0,i.jsxs)(ww,{spacing:2,children:[(0,i.jsx)(Uj,{label:"scroll"===an?"Arrows move the content (lists). Click to switch to Swipe: arrows move the finger (maps).":"Arrows move the finger (maps). Click to switch to Scroll: arrows move the content (lists).",hasArrow:!0,children:(0,i.jsx)(Ww,{size:"xs",h:"18px",px:2,fontSize:"2xs",fontWeight:"bold",variant:"ghost",colorScheme:"blue","aria-label":"D-pad mode: ".concat(an,". Click to switch"),onClick:ln,children:"scroll"===an?"Scroll \u21c4":"Swipe \u21c4"})}),(0,i.jsxs)(mw,{position:"relative",w:"70px",h:"70px",children:[(0,i.jsx)(mw,{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",w:"20px",h:"20px",bg:"gray.600",borderRadius:"full",border:"2px solid",borderColor:"gray.400"}),(0,i.jsx)(Uj,{label:dn("up"),placement:"top",hasArrow:!0,children:(0,i.jsx)(qw,{"aria-label":dn("up"),icon:(0,i.jsx)(iC,{}),position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)",size:"xs",colorScheme:"blue",variant:"solid",borderRadius:"full",onClick:e=>{e.preventDefault(),e.stopPropagation(),un("up")},isDisabled:0===l.length,w:"24px",h:"24px",minW:"24px",fontSize:"12px"})}),(0,i.jsx)(Uj,{label:dn("down"),placement:"bottom",hasArrow:!0,children:(0,i.jsx)(qw,{"aria-label":dn("down"),icon:(0,i.jsx)(lC,{}),position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)",size:"xs",colorScheme:"blue",variant:"solid",borderRadius:"full",onClick:e=>{e.preventDefault(),e.stopPropagation(),un("down")},isDisabled:0===l.length,w:"24px",h:"24px",minW:"24px",fontSize:"12px"})}),(0,i.jsx)(Uj,{label:dn("left"),placement:"left",hasArrow:!0,children:(0,i.jsx)(qw,{"aria-label":dn("left"),icon:(0,i.jsx)(sC,{}),position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)",size:"xs",colorScheme:"blue",variant:"solid",borderRadius:"full",onClick:e=>{e.preventDefault(),e.stopPropagation(),un("left")},isDisabled:0===l.length,w:"24px",h:"24px",minW:"24px",fontSize:"12px"})}),(0,i.jsx)(Uj,{label:dn("right"),placement:"right",hasArrow:!0,children:(0,i.jsx)(qw,{"aria-label":dn("right"),icon:(0,i.jsx)(aC,{}),position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)",size:"xs",colorScheme:"blue",variant:"solid",borderRadius:"full",onClick:e=>{e.preventDefault(),e.stopPropagation(),un("right")},isDisabled:0===l.length,w:"24px",h:"24px",minW:"24px",fontSize:"12px"})})]})]})})]})})]})}),ie&&(0,i.jsx)(mw,{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999,pointerEvents:"none",children:(0,i.jsxs)(fw,{direction:"column",position:"absolute",top:0,right:0,bottom:0,width:{base:"100%",md:"420px",xl:"460px"},bg:"white",_dark:{bg:"gray.800",borderColor:"gray.700"},borderLeftWidth:"1px",borderColor:"gray.200",boxShadow:"-8px 0 24px rgba(0,0,0,0.12)",transform:ie?"translateX(0)":"translateX(100%)",transition:"transform 0.25s cubic-bezier(0.4, 0, 0.2, 1)",pointerEvents:"auto",children:[(0,i.jsxs)(fw,{justify:"space-between",align:"center",px:4,py:3,flexShrink:0,borderBottomWidth:"1px",borderColor:"gray.200",_dark:{borderColor:"gray.700"},children:[(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(_k,{}),(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"bold",children:"Apps Menu"})]}),(0,i.jsx)(qw,{icon:(0,i.jsx)(aC,{}),size:"xs",variant:"ghost",onClick:()=>ae(!1),"aria-label":"Close Apps Menu"})]}),(0,i.jsx)(mw,{flex:"1",minH:0,overflowY:"auto",overflowX:"hidden",px:3,py:2,children:(0,i.jsx)(kM,{selectedDevices:l,onExecuteCommand:nn})})]})}),se&&(0,i.jsxs)(mw,{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999,pointerEvents:"auto",children:[(0,i.jsx)(mw,{position:"absolute",top:0,left:0,right:0,bottom:0,bg:"transparent",onClick:()=>le(!1)}),(0,i.jsxs)(fw,{direction:"column",position:"absolute",top:0,right:0,bottom:0,width:{base:"100%",md:"380px",xl:"420px"},bg:"white",_dark:{bg:"gray.800",borderColor:"gray.700"},borderLeftWidth:"1px",borderColor:"gray.200",boxShadow:"-8px 0 24px rgba(0,0,0,0.12)",transform:se?"translateX(0)":"translateX(100%)",transition:"transform 0.25s cubic-bezier(0.4, 0, 0.2, 1)",children:[(0,i.jsxs)(fw,{justify:"space-between",align:"center",px:4,py:3,flexShrink:0,borderBottomWidth:"1px",borderColor:"gray.200",_dark:{borderColor:"gray.700"},children:[(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(ck,{}),(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"bold",children:"Locators"})]}),(0,i.jsx)(qw,{icon:(0,i.jsx)(aC,{}),size:"xs",variant:"ghost",onClick:()=>le(!1),"aria-label":"Close Locators"})]}),(0,i.jsx)(mw,{flex:"1",minH:0,overflowY:"auto",px:3,py:2,children:(0,i.jsx)(kD,{selectedDevices:l,onGetLocators:async function(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||(l.length>0?l[0]:null);if(e){jt(!0),wt([]);try{var t;console.info("\ud83d\udd0d Fetching locators for:",e);const n=await fetch("".concat(yE,"/api/locators"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceName:e})}),r=await n.json();if(console.info("\ud83d\udce6 Received locators response:",r),console.info("\ud83d\udce6 Locators array:",r.locators),console.debug("\ud83d\udce6 Number of locators:",null===(t=r.locators)||void 0===t?void 0:t.length),!r.success||!r.locators)throw console.error("\u274c Failed to get locators:",r.error),new Error(r.error||"Failed to get locators");console.info("\u2705 Setting UI elements:",r.locators.length),wt(r.locators),zt({title:"UI Elements Loaded",description:"Found ".concat(r.locators.length," elements"),status:"success",duration:2e3}),jt(!1)}catch(n){console.error("\u274c Error fetching locators:",n),zt({title:"Failed to Get Elements",description:n.message,status:"error",duration:3e3}),jt(!1)}}else zt({title:"No Devices Selected",description:"Please select a device first",status:"warning",duration:2e3})},onReset:()=>{wt([]),zt({title:"Elements Cleared",description:"UI elements have been reset",status:"info",duration:2e3})},elements:yt,isLoading:St})})]})]}),(0,i.jsx)(eF,{isOpen:ce,onClose:()=>de(!1)}),(0,i.jsx)(tF,{isOpen:ue,onClose:()=>he(!1),originalPrompt:pe.originalPrompt,translatedCommand:pe.translatedCommand,devices:l,onConfirm:e=>{nn(e,null,null,!0)}}),(0,i.jsx)(lF,{isOpen:qe,onClose:()=>$e(!1),virtualDevices:Xe,capabilities:Je,virtualProgress:Ze,initialPlatform:Ye,onRefresh:()=>en(!0),onLaunch:xn,onConnect:mn,onStop:async e=>{try{var t;const r=e.platform||("avd"===e.kind?"android":"ios"),o=e.virtualId||e.id||e.avdName||e.name,i=e.displayName||e.name;if(Ne===i||Fe.commander===i){Me(null),We(e=>p(p({},e),{},{isActive:!1,commander:null,followers:[]}));try{var n;null!==(n=At.current)&&void 0!==n&&n.stopCommanderMode?await At.current.stopCommanderMode():await BM.stopCommander()}catch(kF){}}else if(null!==(t=Fe.followers)&&void 0!==t&&t.some(e=>((null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.deviceId)||e)===i)){We(e=>p(p({},e),{},{followers:(e.followers||[]).filter(e=>((null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.deviceId)||e)!==i)}));try{await BM.removeFollower(i)}catch(kF){}}if(c(t=>t.filter(t=>t!==i&&t!==e.name)),Rt.current)try{"function"===typeof Rt.current.emit?Rt.current.emit("stop_screenshot_stream",{deviceName:i}):"function"===typeof Rt.current.send&&Rt.current.send(JSON.stringify({type:"stop_screenshot_stream",deviceName:i}))}catch(kF){}await cD.shutdownDevice(r,o),zt({title:"Virtual Device Stopped",description:"".concat(e.displayName||e.name," shut down successfully."),status:"info",duration:3e3}),en(),tn()}catch(CF){zt({title:"Shutdown Failed",description:CF.message,status:"error",duration:4e3,isClosable:!0})}},onWipe:async e=>{try{const t=e.platform||("avd"===e.kind?"android":"ios"),n=e.virtualId||e.id||e.avdName||e.name;await cD.wipeDevice(t,n),zt({title:"Device Data Erased",description:"".concat(e.displayName||e.name," has been wiped."),status:"success",duration:3e3}),en()}catch(CF){zt({title:"Wipe Failed",description:CF.message,status:"error",duration:4e3,isClosable:!0})}},onDelete:async e=>{try{const t=e.platform||("avd"===e.kind?"android":"ios"),n=e.virtualId||e.id||e.avdName||e.name;await cD.deleteDevice(t,n),zt({title:"Device Deleted",description:"".concat(e.displayName||e.name," has been deleted."),status:"info",duration:3e3}),en()}catch(CF){zt({title:"Delete Failed",description:CF.message,status:"error",duration:4e3,isClosable:!0})}}}),(0,i.jsx)(CC,{})]})},gF=()=>{const[e,n]=(0,t.useState)(""),[r,o]=(0,t.useState)(!1),[a,s]=(0,t.useState)(!1),[l,c]=(0,t.useState)(null),[d,u]=(0,t.useState)(""),h=hw();(0,t.useEffect)(()=>{const e=new URLSearchParams(window.location.search),t=e.get("session"),r=e.get("backend");t?(n(t),p(),r&&(window.DEVICELY_BACKEND_URL=r)):h({title:"Invalid Session",description:"No session ID found in URL. Please scan the QR code again.",status:"error",duration:5e3,isClosable:!0})},[]);const p=async()=>{const e=navigator.userAgent||navigator.vendor||window.opera;let t="unknown",n="Unknown Device",r=null;if(/iPad|iPhone|iPod|Mac OS X.*Version\/\d+\.\d+.*Safari/.test(e)||navigator.maxTouchPoints>2&&/Mac OS X/.test(e))t="ios",n=/iPad/.test(e)?"iPad":/iPhone/.test(e)?"iPhone":/iPod/.test(e)?"iPod":"iOS Device",console.info("\u2705 iOS Detected: ".concat(n,", UserAgent: ").concat(e.substring(0,100)));else if(/android/i.test(e)){t="android",n="Android Device";const r=e.match(/Android.*;\s([^)]+)\)/);r&&r[1]&&(n=r[1].trim()),console.info("\u2705 Android Detected: ".concat(n,", UserAgent: ").concat(e.substring(0,100)))}else console.info("\u26a0\ufe0f Unknown Device, UserAgent: ".concat(e));try{r=await f(),r&&console.info("\ud83d\udccd Device local IP detected: ".concat(r))}catch(CF){console.info("Could not detect local IP:",CF)}c({platform:t,name:n,userAgent:e,ip:r})},f=()=>new Promise(e=>{try{const t=new RTCPeerConnection({iceServers:[]});let n=!1;const r=setTimeout(()=>{n||(n=!0,t.close(),e(null))},5e3);t.createDataChannel(""),t.createOffer().then(e=>t.setLocalDescription(e)).catch(()=>{clearTimeout(r),n||(n=!0,t.close(),e(null))}),t.onicecandidate=o=>{if(!o||!o.candidate)return clearTimeout(r),void(n||(n=!0,t.close(),e(null)));const i=/([0-9]{1,3}(\.[0-9]{1,3}){3})/.exec(o.candidate.candidate);i&&i[1]&&(clearTimeout(r),n||(n=!0,t.close(),e(i[1])))},t.onerror=()=>{clearTimeout(r),n||(n=!0,t.close(),e(null))}}catch(kF){console.error("RTC IP detection error:",kF),e(null)}}),m=()=>l?"ios"===l.platform?"blue":"green":"gray";return(0,i.jsx)(mw,{minH:"100vh",bg:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",py:8,children:(0,i.jsx)(Vw,{maxW:"md",children:(0,i.jsxs)(ww,{spacing:8,align:"stretch",children:[(0,i.jsxs)(ww,{spacing:3,children:[(0,i.jsx)(Kv,{as:Pk,boxSize:16,color:"white"}),(0,i.jsx)(jw,{color:"white",size:"xl",textAlign:"center",children:"Devicely"}),(0,i.jsx)(Cw,{color:"whiteAlpha.800",fontSize:"lg",textAlign:"center",children:"Mobile Device Connection"})]}),"ios"===(null===l||void 0===l?void 0:l.platform)&&(0,i.jsxs)(mw,{bg:"orange.50",borderLeft:"4px solid",borderColor:"orange.500",p:4,borderRadius:"md",children:[(0,i.jsx)(Cw,{fontSize:"sm",color:"orange.900",fontWeight:"bold",mb:2,children:"\u26a0\ufe0f iOS Limitation Detected"}),(0,i.jsx)(Cw,{fontSize:"sm",color:"orange.800",mb:3,children:"iOS browsers don't support direct local network access. To connect:"}),(0,i.jsxs)(ww,{align:"start",spacing:2,fontSize:"sm",color:"orange.800",children:[(0,i.jsxs)(Cw,{children:["1. On Mac, install ngrok: ",(0,i.jsx)("code",{children:"brew install ngrok/ngrok/ngrok"})]}),(0,i.jsxs)(Cw,{children:["2. Run: ",(0,i.jsx)("code",{children:"ngrok http 3001"})]}),(0,i.jsxs)(Cw,{children:["3. Set: ",(0,i.jsx)("code",{children:"export BACKEND_URL=https://your-ngrok-url"})]}),(0,i.jsx)(Cw,{children:"4. Restart backend and scan a new QR code"})]})]}),(0,i.jsx)(mw,{bg:"white",borderRadius:"xl",boxShadow:"2xl",p:8,children:(0,i.jsxs)(ww,{spacing:6,children:[l&&(0,i.jsxs)(ww,{spacing:4,width:"100%",children:[(0,i.jsxs)(Ew,{spacing:3,children:[(0,i.jsx)(Kv,{as:l?(l.platform,fk):fk,boxSize:8,color:"".concat(m(),".500")}),(0,i.jsxs)(ww,{align:"start",spacing:0,children:[(0,i.jsx)(Cw,{fontWeight:"bold",fontSize:"lg",children:l.name}),(0,i.jsx)(zw,{colorScheme:m(),children:l.platform.toUpperCase()})]})]}),e&&(0,i.jsxs)(mw,{bg:"gray.50",p:3,borderRadius:"md",width:"100%",children:[(0,i.jsx)(Cw,{fontSize:"xs",color:"gray.600",fontWeight:"bold",children:"Session ID"}),(0,i.jsx)(Cw,{fontSize:"sm",fontFamily:"mono",color:"gray.800",children:e})]})]}),d&&(0,i.jsxs)(mw,{width:"100%",children:[(0,i.jsx)(Cw,{fontSize:"sm",color:"gray.600",textAlign:"center",mb:2,children:d}),r&&!a&&(0,i.jsx)(KL,{size:"xs",isIndeterminate:!0,colorScheme:"purple",borderRadius:"full"})]}),!a&&(0,i.jsx)(Ww,{leftIcon:r?(0,i.jsx)(Qv,{size:"sm"}):(0,i.jsx)(nk,{}),colorScheme:"purple",size:"lg",width:"100%",onClick:async()=>{if(!e||!l)return console.error("Missing sessionId or deviceInfo",{sessionId:e,deviceInfo:l}),void h({title:"Error",description:"Device information not available",status:"error",duration:3e3,isClosable:!0});o(!0),u("Initiating connection...");let t=window.DEVICELY_BACKEND_URL;if(!t){t=new URLSearchParams(window.location.search).get("backend")}t||(t="http://localhost:3001"),console.debug("\ud83d\udd17 Connect attempt:",{sessionId:e,deviceInfo:l,backendUrl:t,timestamp:(new Date).toISOString()});try{let r;u("Registering device..."),console.info("\ud83d\udcdd Registering: ".concat(t,"/api/qr/register-device")),console.info(" Backend URL: ".concat(t)),console.info(" Session ID: ".concat(e));try{r=await Promise.race([fetch("".concat(t,"/api/qr/register-device"),{method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"application/json",Accept:"application/json","Access-Control-Request-Private-Network":"true"},body:JSON.stringify({sessionId:e,deviceInfo:{platform:l.platform,name:l.name,ip:l.ip}})}),new Promise((e,t)=>setTimeout(()=>t(new Error("Register request timeout (30s)")),3e4))])}catch(n){throw console.error("\u274c Fetch error during registration:",n),console.error(" Error type:",n.name),console.error(" Error message:",n.message),console.error(" URL attempted:","".concat(t,"/api/qr/register-device")),new Error("Cannot reach backend server at ".concat(t,". Make sure:\n1. Backend server is running\n2. Device is on same WiFi as Mac\n3. Firewall allows connections\n\nError: ").concat(n.message))}if(console.info("\ud83d\udcca Register response status: ".concat(r.status)),!r.ok){const e=await r.text();throw console.error("Register error response:",e),new Error("Failed to register device: ".concat(r.status," - ").concat(e))}const o=await r.json();let i;console.info("\u2705 Device registered:",o),u("Connecting to Devicely..."),console.info("\ud83d\udd17 Connecting: ".concat(t,"/api/qr/connect-device"));try{i=await Promise.race([fetch("".concat(t,"/api/qr/connect-device"),{method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"application/json",Accept:"application/json","Access-Control-Request-Private-Network":"true"},body:JSON.stringify({sessionId:e,deviceId:o.deviceId})}),new Promise((e,t)=>setTimeout(()=>t(new Error("Connect request timeout (30s)")),3e4))])}catch(n){throw console.error("\u274c Fetch error during connection:",n),console.error(" Error type:",n.name),console.error(" Error message:",n.message),new Error("Cannot reach backend server: ".concat(n.message))}if(console.info("\ud83d\udcca Connect response status: ".concat(i.status)),!i.ok){const e=await i.text();throw console.error("Connect error response:",e),new Error("Failed to connect: ".concat(i.status," - ").concat(e))}const a=await i.json();if(console.info("Connect response data:",a),!a.success){const e=a.message||a.error||"Failed to connect device";throw console.error("Connection failed:",e),new Error(e)}let c;u("Starting mirroring...");try{c=await Promise.race([fetch("".concat(t,"/api/qr/start-mirroring"),{method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"application/json",Accept:"application/json","Access-Control-Request-Private-Network":"true"},body:JSON.stringify({sessionId:e,deviceId:o.deviceId})}),new Promise((e,t)=>setTimeout(()=>t(new Error("Mirror request timeout (30s)")),3e4))])}catch(n){throw console.error("\u274c Fetch error during mirroring:",n),console.error(" Error type:",n.name),console.error(" Error message:",n.message),new Error("Cannot reach backend server: ".concat(n.message))}if(!c.ok){const e=await c.text();console.error("Mirror error response:",e);const t=await c.json().catch(()=>({}));throw new Error(t.message||"Failed to start mirroring: ".concat(e))}const d=await c.json();if(!d.success)throw new Error(d.error||"Mirroring failed");s(!0),u("Connected successfully!"),h({title:"Connected!",description:"Your device is now mirroring on Devicely",status:"success",duration:5e3,isClosable:!0}),setTimeout(()=>{u("You can now close this page and see your device on Devicely Web")},2e3)}catch(r){console.error("\u274c Connection error:",r),u("Connection failed");let e=r.message||"Failed to connect to Devicely. Please try again.",t="Connection Failed";r.message&&r.message.includes("Cannot reach backend")?(t="Server Connection Failed",e=r.message):r.message&&r.message.includes("timeout")?(t="Connection Timeout",e="Request took too long. Make sure:\n\n1. Backend server is running\n2. Device is on same WiFi network\n3. Firewall is not blocking connections\n4. Try scanning QR code again"):r.message&&r.message.includes("not found in ADB")?(t="Device Not Connected",e="Your device (".concat((null===l||void 0===l?void 0:l.name)||"Device",') is not yet connected to your Mac.\n\nFor Android:\n1. Enable Developer Options\n2. Enable USB Debugging\n3. Connect device to Mac via USB\n4. Try scanning QR again\n\nFor iOS:\n1. Connect device to Mac via USB\n2. Trust "This Computer"\n3. Try scanning QR again')):r.message&&r.message.includes("not connected")&&(t="Device Connection Required",e="Please connect your device to your Mac first via USB, then scan the QR code again."),h({title:t,description:e,status:"error",duration:1e4,isClosable:!0}),o(!1)}},isLoading:r,isDisabled:!l||r,boxShadow:"lg",_hover:{transform:"translateY(-2px)",boxShadow:"xl"},transition:"all 0.2s",children:"Connect to Devicely"}),a&&(0,i.jsxs)(ww,{spacing:4,width:"100%",children:[(0,i.jsx)(Kv,{as:dC,boxSize:16,color:"green.500"}),(0,i.jsx)(Cw,{fontSize:"lg",fontWeight:"bold",color:"green.600",textAlign:"center",children:"Connected Successfully!"}),(0,i.jsx)(Cw,{fontSize:"sm",color:"gray.600",textAlign:"center",children:"Your device is now mirroring on Devicely. You can close this page."})]}),!a&&l&&!r&&(0,i.jsx)(mw,{bg:"ios"===l.platform?"blue.50":"green.50",p:4,borderRadius:"md",width:"100%",borderLeftWidth:"4px",borderLeftColor:"ios"===l.platform?"blue.400":"green.400",children:(0,i.jsxs)(ww,{spacing:3,align:"start",children:[(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Kv,{as:(l.platform,fk),color:"ios"===l.platform?"blue.500":"green.500"}),(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"bold",color:"ios"===l.platform?"blue.700":"green.700",children:"ios"===l.platform?"iOS Connection Setup":"Android Connection Setup"})]}),(0,i.jsx)(ww,{spacing:2,align:"start",fontSize:"xs",color:"ios"===l.platform?"blue.600":"green.600",pl:2,children:"ios"===l.platform?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Cw,{fontWeight:"bold",children:"\ud83d\udcf1 First Time Setup (USB Cable Required):"}),(0,i.jsx)(Cw,{children:"1. Keep this device connected to Mac via USB"}),(0,i.jsx)(Cw,{children:'2. Click "Connect to Devicely" button below'}),(0,i.jsx)(Cw,{children:'3. Xcode might request trust - tap "Trust" on this device'}),(0,i.jsx)(Cw,{children:"4. After connecting, open Xcode on Mac"}),(0,i.jsx)(Cw,{fontWeight:"bold",mt:2,children:"\u26a1 Next Time (Wireless):"}),(0,i.jsx)(Cw,{children:"1. On Mac: Xcode \u2192 Window \u2192 Devices and Simulators"}),(0,i.jsx)(Cw,{children:'2. Select this device \u2192 Check "Connect via Network"'}),(0,i.jsx)(Cw,{children:"3. Disconnect USB cable"}),(0,i.jsx)(Cw,{children:"4. Scan QR code again - connects via WiFi"})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Cw,{fontWeight:"bold",children:"\ud83d\udcf1 First Time Setup (USB Cable Required):"}),(0,i.jsx)(Cw,{children:"1. Keep device connected to Mac via USB"}),(0,i.jsx)(Cw,{children:"2. Enable USB Debugging: Settings \u2192 Developer Options"}),(0,i.jsx)(Cw,{children:'3. Click "Connect to Devicely" button below'}),(0,i.jsx)(Cw,{children:"4. Wireless will be set up automatically"}),(0,i.jsx)(Cw,{fontWeight:"bold",mt:2,children:"\u26a1 Next Time (Wireless):"}),(0,i.jsx)(Cw,{children:"1. Device is already set up for wireless"}),(0,i.jsx)(Cw,{children:"2. Just disconnect USB and scan QR code"}),(0,i.jsx)(Cw,{children:"3. It will connect via WiFi automatically"})]})})]})}),!a&&(0,i.jsx)(mw,{bg:"blue.50",p:4,borderRadius:"md",width:"100%",borderLeftWidth:"4px",borderLeftColor:"blue.400",children:(0,i.jsxs)(ww,{spacing:3,align:"start",children:[(0,i.jsxs)(Ew,{spacing:2,children:[(0,i.jsx)(Kv,{as:nk,color:"blue.500"}),(0,i.jsx)(Cw,{fontSize:"sm",fontWeight:"bold",color:"blue.700",children:"Setup Required"})]}),(0,i.jsxs)(ww,{spacing:2,align:"start",fontSize:"xs",color:"blue.600",pl:2,children:[(0,i.jsx)(Cw,{fontWeight:"bold",children:"Before connecting:"}),(0,i.jsx)(Cw,{children:"1. Device must be on same WiFi as Mac"}),"android"===(null===l||void 0===l?void 0:l.platform)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Cw,{children:"2. Enable USB Debugging in Settings"}),(0,i.jsx)(Cw,{children:"3. Connect device to Mac via USB first"}),(0,i.jsx)(Cw,{children:"4. Then scan this QR code"})]}),"ios"===(null===l||void 0===l?void 0:l.platform)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Cw,{children:"2. Connect device to Mac via USB"}),(0,i.jsx)(Cw,{children:"3. Trust this computer on your device"}),(0,i.jsx)(Cw,{children:"4. Then scan this QR code"})]})]})]})})]})})]})})})},vF=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function xF(e){return"function"===typeof e}const bF=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];let o=[...n],i=n[n.length-1];var a;return Bn(a=i)&&vF.every(e=>Object.prototype.hasOwnProperty.call(a,e))&&o.length>1?o=o.slice(0,o.length-1):i=e,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>t.reduce((e,t)=>t(e),e)}(...o.map(e=>t=>xF(e)?e(t):function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ll({},...t,wF)}(t,e)))(i)},yF=bF(qi);bF($i);function wF(e,t,n,r){return(xF(e)||xF(t))&&Object.prototype.hasOwnProperty.call(r,n)?function(){const n=xF(e)?e(...arguments):e,r=xF(t)?t(...arguments):t;return ll({},n,r,wF)}:Bn(e)&&Wn(t)||Wn(e)&&Bn(t)?t:void 0}const SF=yF({fonts:{heading:"'Inter', -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif",body:"'Inter', -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif",mono:"'JetBrains Mono', 'Fira Code', monospace"},colors:{brand:{50:"#E6F7FF",100:"#BAE7FF",200:"#91D5FF",300:"#69C0FF",400:"#40A9FF",500:"#1890FF",600:"#096DD9",700:"#0050B3",800:"#003A8C",900:"#002766"},success:{50:"#F6FFED",100:"#D9F7BE",200:"#B7EB8F",300:"#95DE64",400:"#73D13D",500:"#52C41A",600:"#389E0D",700:"#237804",800:"#135200",900:"#092B00"},warning:{50:"#FFFBE6",100:"#FFF1B8",200:"#FFE58F",300:"#FFD666",400:"#FFC53D",500:"#FAAD14",600:"#D48806",700:"#AD6800",800:"#874D00",900:"#613400"},danger:{50:"#FFF1F0",100:"#FFCCC7",200:"#FFA39E",300:"#FF7875",400:"#FF4D4F",500:"#F5222D",600:"#CF1322",700:"#A8071A",800:"#820014",900:"#5C0011"}},components:{Button:{baseStyle:{fontWeight:"600",borderRadius:"lg",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},variants:{primary:{bg:"brand.500",color:"white",_hover:{bg:"brand.600",transform:"translateY(-2px)",boxShadow:"0 8px 20px rgba(24, 144, 255, 0.5)"},_active:{bg:"brand.700",transform:"translateY(0)",boxShadow:"0 2px 8px rgba(24, 144, 255, 0.3)"}},success:{bg:"success.500",color:"white",_hover:{bg:"success.600",transform:"translateY(-2px)",boxShadow:"0 8px 20px rgba(82, 196, 26, 0.5)"},_active:{bg:"success.700",transform:"translateY(0)"}},glass:{bg:"rgba(255, 255, 255, 0.1)",backdropFilter:"blur(10px)",border:"1px solid",borderColor:"whiteAlpha.200",color:"white",_hover:{bg:"rgba(255, 255, 255, 0.15)",transform:"translateY(-2px)",boxShadow:"0 8px 20px rgba(0, 0, 0, 0.2)"}}}},Card:{baseStyle:{container:{borderRadius:"xl",boxShadow:"sm",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}}},Input:{variants:{filled:{field:{transition:"all 0.2s ease",_focus:{transform:"scale(1.01)",boxShadow:"0 0 0 3px rgba(24, 144, 255, 0.1)"}}}}},Badge:{baseStyle:{transition:"all 0.2s ease"}}},styles:{global:e=>({body:{bg:"dark"===e.colorMode?"gray.900":"gray.50",color:"dark"===e.colorMode?"white":"gray.800"},":focus-visible":{outline:"2px solid #63B3ED !important",outlineOffset:"2px"},"*":{scrollbarWidth:"thin",scrollbarColor:"dark"===e.colorMode?"rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.3) rgba(0, 0, 0, 0.1)"},"::-webkit-scrollbar":{width:"8px",height:"8px"},"::-webkit-scrollbar-track":{background:"dark"===e.colorMode?"rgba(255, 255, 255, 0.05)":"rgba(0, 0, 0, 0.05)",borderRadius:"10px"},"::-webkit-scrollbar-thumb":{background:"dark"===e.colorMode?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.3)",borderRadius:"10px",transition:"all 0.3s ease","&:hover":{background:"dark"===e.colorMode?"rgba(255, 255, 255, 0.5)":"rgba(0, 0, 0, 0.5)"}}})},config:{initialColorMode:"dark",useSystemColorMode:!1},zIndices:{hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800,appsMenu:99999}});o.createRoot(document.getElementById("root")).render((0,i.jsxs)(t.StrictMode,{children:[(0,i.jsx)(l,{initialColorMode:SF.config.initialColorMode}),(0,i.jsx)(Ax,{theme:SF,children:(0,i.jsx)(nw,{children:(0,i.jsxs)(Sy,{children:[(0,i.jsx)(yy,{path:"/",element:(0,i.jsx)(mF,{})}),(0,i.jsx)(yy,{path:"/mobile-connect",element:(0,i.jsx)(gF,{})})]})})})]}))})()})();
|