total-recall-brain 3.41.2 → 3.41.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/total-recall.mjs +19 -4
- package/frontend/dist/assets/{index-BG9NkVUy.css → index-BIQmqDKP.css} +1 -1
- package/frontend/dist/assets/{index-BtuiZqwP.js → index-CRzjQLu7.js} +7 -7
- package/frontend/dist/index.html +2 -2
- package/frontend/dist/sw.js +8 -5
- package/frontend/src/api/auth.ts +0 -3
- package/frontend/src/components/plugins/PluginPanel.tsx +7 -3
- package/frontend/src/components/plugins/card/CardEngine.tsx +1 -1
- package/frontend/src/pages/LoginPage.tsx +1 -41
- package/frontend/src/pages/PluginsPage.tsx +14 -7
- package/package.json +7 -5
- package/scaffold/.agent/skills/plugin/scripts/record.mjs +6 -3
- package/scaffold/.agent/skills/total-recall/plugins/auth/cli.mjs +197 -31
- package/scaffold/.agent/skills/total-recall/plugins/auth/package-lock.json +6 -6
- package/scaffold/.agent/skills/total-recall/plugins/auth/package.json +1 -1
- package/scaffold/.agent/skills/total-recall/plugins/auth/plugin.json +8 -1
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/cli-secret.mjs +48 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/login-projections.mjs +42 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/mesh-secrets.mjs +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/routes/secrets.mjs +5 -2
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/secrets-carriers.mjs +76 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/secrets-prune.mjs +37 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/secrets-sync.mjs +53 -17
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/DESIGN.md +56 -8
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/card.js +1068 -204
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/panel.js +4 -2
- package/scaffold/.agent/skills/total-recall/plugins/cli-agents/ui/DESIGN.md +32 -0
- package/scaffold/.agent/skills/total-recall/plugins/cli-agents/ui/card.js +436 -274
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/package-lock.json +12 -12
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/package.json +1 -1
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/DESIGN.md +16 -2
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/card.js +461 -242
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/package-lock.json +12 -12
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/package.json +1 -1
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/plugin.json +1 -7
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/DESIGN.md +17 -2
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/card.js +426 -300
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/package-lock.json +23 -8
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/package.json +6 -2
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/DESIGN.md +32 -0
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/card.js +350 -283
- package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/package-lock.json +23 -8
- package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/package.json +5 -1
- package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/ui/card.js +31 -19
- package/scaffold/.agent/skills/total-recall/plugins/mesh/package-lock.json +23 -10
- package/scaffold/.agent/skills/total-recall/plugins/mesh/package.json +5 -3
- package/scaffold/.agent/skills/total-recall/plugins/mesh/plugin.json +1 -1
- package/scaffold/.agent/skills/total-recall/plugins/mesh/src/cli/grants.mjs +7 -3
- package/scaffold/.agent/skills/total-recall/plugins/mesh/src/cli/mesh.mjs +61 -38
- package/scaffold/.agent/skills/total-recall/plugins/mesh/src/core/leader-election.mjs +57 -2
- package/scaffold/.agent/skills/total-recall/plugins/mesh/src/core/mesh.mjs +220 -36
- package/scaffold/.agent/skills/total-recall/plugins/mesh/src/server/routes/mesh.mjs +7 -2
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/README.md +65 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/capability/BRICK.md +59 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/capability/index.mjs +534 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/cli.mjs +139 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/package-lock.json +2849 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/package.json +26 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/plugin.json +376 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/skills/meta-harness/SKILL.md +37 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/adapters/dsh.mjs +446 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/alerts.mjs +23 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/coordinator.mjs +398 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/documentation.mjs +152 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/executor.mjs +82 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/learner.mjs +90 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/router.mjs +415 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/runtime.mjs +36 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/setup.mjs +35 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/tracker.mjs +133 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/worker.mjs +233 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/DESIGN.md +32 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/card.js +845 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/capability/BRICK.md +64 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/capability/index.mjs +250 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/cli.mjs +344 -14
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/package-lock.json +2917 -140
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/package.json +9 -3
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/plugin.json +223 -5
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/config.mjs +129 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/refresh.mjs +355 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/upstream-watcher.mjs +375 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/DESIGN.md +37 -10
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/card.js +986 -280
- package/scaffold/.agent/skills/total-recall/plugins/security/cli.mjs +7 -1
- package/scaffold/.agent/skills/total-recall/plugins/security/package-lock.json +25 -10
- package/scaffold/.agent/skills/total-recall/plugins/security/package.json +6 -2
- package/scaffold/.agent/skills/total-recall/plugins/security/plugin.json +1 -1
- package/scaffold/.agent/skills/total-recall/plugins/security/src/scanner.mjs +17 -3
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/DESIGN.md +38 -15
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/card.js +60 -34
- package/src/cli/command.mjs +23 -18
- package/src/cli/config.mjs +3 -0
- package/src/cli/connect.mjs +12 -116
- package/src/cli/daemon.mjs +23 -1
- package/src/cli/harness.mjs +0 -1
- package/src/cli/plugin/copies.mjs +8 -5
- package/src/cli/plugin/create.mjs +56 -3
- package/src/cli/plugin/index.mjs +40 -5
- package/src/cli/plugin/monetization.mjs +232 -12
- package/src/cli/preflight.mjs +161 -0
- package/src/cli/rebuild.mjs +22 -0
- package/src/cli/reset-password.mjs +3 -2
- package/src/cli/skill.mjs +8 -2
- package/src/cli/status.mjs +25 -7
- package/src/core/automatic-brain-updates.mjs +9 -3
- package/src/core/brain-updates.mjs +63 -5
- package/src/core/cli-commands.mjs +2 -0
- package/src/core/context-compiler.mjs +8 -1
- package/src/core/default-plugins.mjs +1 -1
- package/src/core/global-brain-updates.mjs +21 -1
- package/src/core/mesh-brain-updates.mjs +5 -2
- package/src/core/meta-harness.mjs +32 -79
- package/src/core/plugin-dependencies.mjs +6 -1
- package/src/core/plugin-runner.mjs +6 -1
- package/src/core/plugin-store.mjs +67 -1
- package/src/core/plugin-updates.mjs +1 -1
- package/src/core/portable-skills-maintenance.mjs +19 -0
- package/src/core/preflight-gate.mjs +77 -0
- package/src/core/preflight-receipt.mjs +123 -0
- package/src/core/required-plugins.mjs +7 -0
- package/src/core/runtime.mjs +0 -3
- package/src/core/skills-registry.mjs +33 -3
- package/src/core/surface.mjs +38 -1
- package/src/server/auth.mjs +41 -1
- package/src/server/memory-app.mjs +2 -1
- package/src/server/routes/auth.mjs +25 -1
- package/src/server/routes/plugins.mjs +17 -4
|
@@ -8,7 +8,7 @@ Error generating stack: `+e.message+`
|
|
|
8
8
|
`+e.stack}}var we=Object.prototype.hasOwnProperty,Te=t.unstable_scheduleCallback,Ee=t.unstable_cancelCallback,F=t.unstable_shouldYield,De=t.unstable_requestPaint,Oe=t.unstable_now,ke=t.unstable_getCurrentPriorityLevel,Ae=t.unstable_ImmediatePriority,je=t.unstable_UserBlockingPriority,Me=t.unstable_NormalPriority,Ne=t.unstable_LowPriority,Pe=t.unstable_IdlePriority,Fe=t.log,Ie=t.unstable_setDisableYieldValue,Le=null,Re=null;function ze(e){if(typeof Fe==`function`&&Ie(e),Re&&typeof Re.setStrictMode==`function`)try{Re.setStrictMode(Le,e)}catch{}}var Be=Math.clz32?Math.clz32:Ue,Ve=Math.log,He=Math.LN2;function Ue(e){return e>>>=0,e===0?32:31-(Ve(e)/He|0)|0}var We=256,Ge=262144,Ke=4194304;function qe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Je(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=qe(n))):i=qe(o):i=qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=qe(n))):i=qe(o)):i=qe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ye(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ze(){var e=Ke;return Ke<<=1,!(Ke&62914560)&&(Ke=4194304),e}function Qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $e(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function et(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Be(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&tt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function tt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Be(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function nt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Be(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function rt(e,t){var n=t&-t;return n=n&42?1:it(n),(n&(e.suspendedLanes|t))===0?n:0}function it(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function at(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ot(){var e=re.p;return e===0?(e=window.event,e===void 0?32:wp(e.type)):e}function st(e,t){var n=re.p;try{return re.p=e,t()}finally{re.p=n}}var ct=Math.random().toString(36).slice(2),lt=`__reactFiber$`+ct,ut=`__reactProps$`+ct,dt=`__reactContainer$`+ct,ft=`__reactEvents$`+ct,pt=`__reactListeners$`+ct,mt=`__reactHandles$`+ct,ht=`__reactResources$`+ct,gt=`__reactMarker$`+ct;function _t(e){delete e[lt],delete e[ut],delete e[ft],delete e[pt],delete e[mt]}function vt(e){var t=e[lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[dt]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Sf(e);e!==null;){if(n=e[lt])return n;e=Sf(e)}return t}e=n,n=e.parentNode}return null}function yt(e){if(e=e[lt]||e[dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function bt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function xt(e){var t=e[ht];return t||=e[ht]={hoistableStyles:new Map,hoistableScripts:new Map},t}function St(e){e[gt]=!0}var Ct=new Set,wt={};function Tt(e,t){Et(e,t),Et(e+`Capture`,t)}function Et(e,t){for(wt[e]=t,e=0;e<t.length;e++)Ct.add(t[e])}var Dt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Ot={},kt={};function At(e){return we.call(kt,e)?!0:we.call(Ot,e)?!1:Dt.test(e)?kt[e]=!0:(Ot[e]=!0,!1)}function jt(e,t,n){if(At(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function Mt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Nt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Pt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ft(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function It(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Lt(e){if(!e._valueTracker){var t=Ft(e)?`checked`:`value`;e._valueTracker=It(e,t,``+e[t])}}function Rt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ft(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function zt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Bt=/[\n"\\]/g;function Vt(e){return e.replace(Bt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ht(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Pt(t)):e.value!==``+Pt(t)&&(e.value=``+Pt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Wt(e,o,Pt(n)):Wt(e,o,Pt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Pt(s):e.removeAttribute(`name`)}function Ut(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Lt(e);return}n=n==null?``:``+Pt(n),t=t==null?n:``+Pt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Lt(e)}function Wt(e,t,n){t===`number`&&zt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Gt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Pt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Kt(e,t,n){t!=null&&(t=``+Pt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Pt(n)}function qt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Pt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Lt(e)}function Jt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Xt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Yt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Zt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Xt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Xt(e,o,t[o])}function Qt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var $t=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),en=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function tn(e){return en.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function nn(){}var rn=null;function an(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var on=null,sn=null;function cn(e){var t=yt(e);if(t&&(e=t.stateNode)){var n=e[ut]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ht(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Vt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ut]||null;if(!a)throw Error(i(90));Ht(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Rt(r)}break a;case`textarea`:Kt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Gt(e,!!n.multiple,t,!1)}}}var ln=!1;function un(e,t,n){if(ln)return e(t,n);ln=!0;try{return e(t)}finally{if(ln=!1,(on!==null||sn!==null)&&(Ou(),on&&(t=on,e=sn,sn=on=null,cn(t),e)))for(t=0;t<e.length;t++)cn(e[t])}}function dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ut]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var fn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,pn=!1;if(fn)try{var mn={};Object.defineProperty(mn,"passive",{get:function(){pn=!0}}),window.addEventListener(`test`,mn,mn),window.removeEventListener(`test`,mn,mn)}catch{pn=!1}var hn=null,gn=null,_n=null;function vn(){if(_n)return _n;var e,t=gn,n=t.length,r,i=`value`in hn?hn.value:hn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return _n=i.slice(e,1<r?1-r:void 0)}function yn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function bn(){return!0}function xn(){return!1}function Sn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?bn:xn,this.isPropagationStopped=xn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=bn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=bn)},persist:function(){},isPersistent:bn}),t}var Cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wn=Sn(Cn),Tn=h({},Cn,{view:0,detail:0}),En=Sn(Tn),Dn,On,kn,An=h({},Tn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==kn&&(kn&&e.type===`mousemove`?(Dn=e.screenX-kn.screenX,On=e.screenY-kn.screenY):On=Dn=0,kn=e),Dn)},movementY:function(e){return`movementY`in e?e.movementY:On}}),jn=Sn(An),Mn=Sn(h({},An,{dataTransfer:0})),Nn=Sn(h({},Tn,{relatedTarget:0})),Pn=Sn(h({},Cn,{animationName:0,elapsedTime:0,pseudoElement:0})),Fn=Sn(h({},Cn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),In=Sn(h({},Cn,{data:0})),Ln={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},I={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`},Rn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rn[e])?!!t[e]:!1}function Bn(){return zn}var Vn=Sn(h({},Tn,{key:function(e){if(e.key){var t=Ln[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=yn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?I[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bn,charCode:function(e){return e.type===`keypress`?yn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?yn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),L=Sn(h({},An,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Hn=Sn(h({},Tn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bn})),Un=Sn(h({},Cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Wn=Sn(h({},An,{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})),Gn=Sn(h({},Cn,{newState:0,oldState:0})),Kn=[9,13,27,32],qn=fn&&`CompositionEvent`in window,Jn=null;fn&&`documentMode`in document&&(Jn=document.documentMode);var Yn=fn&&`TextEvent`in window&&!Jn,Xn=fn&&(!qn||Jn&&8<Jn&&11>=Jn),Zn=` `,Qn=!1;function $n(e,t){switch(e){case`keyup`:return Kn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var tr=!1;function nr(e,t){switch(e){case`compositionend`:return er(t);case`keypress`:return t.which===32?(Qn=!0,Zn):null;case`textInput`:return e=t.data,e===Zn&&Qn?null:e;default:return null}}function rr(e,t){if(tr)return e===`compositionend`||!qn&&$n(e,t)?(e=vn(),_n=gn=hn=null,tr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Xn&&t.locale!==`ko`?null:t.data;default:return null}}var ir={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 ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ir[e.type]:t===`textarea`}function or(e,t,n,r){on?sn?sn.push(r):sn=[r]:on=r,t=Id(t,`onChange`),0<t.length&&(n=new wn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var sr=null,cr=null;function lr(e){Od(e,0)}function ur(e){if(Rt(bt(e)))return e}function dr(e,t){if(e===`change`)return t}var fr=!1;if(fn){var pr;if(fn){var mr=`oninput`in document;if(!mr){var hr=document.createElement(`div`);hr.setAttribute(`oninput`,`return;`),mr=typeof hr.oninput==`function`}pr=mr}else pr=!1;fr=pr&&(!document.documentMode||9<document.documentMode)}function gr(){sr&&(sr.detachEvent(`onpropertychange`,_r),cr=sr=null)}function _r(e){if(e.propertyName===`value`&&ur(cr)){var t=[];or(t,cr,e,an(e)),un(lr,t)}}function vr(e,t,n){e===`focusin`?(gr(),sr=t,cr=n,sr.attachEvent(`onpropertychange`,_r)):e===`focusout`&&gr()}function yr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ur(cr)}function br(e,t){if(e===`click`)return ur(t)}function xr(e,t){if(e===`input`||e===`change`)return ur(t)}function Sr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Cr=typeof Object.is==`function`?Object.is:Sr;function wr(e,t){if(Cr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!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 i=n[r];if(!we.call(t,i)||!Cr(e[i],t[i]))return!1}return!0}function Tr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Er(e,t){var n=Tr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Tr(n)}}function Dr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Or(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=zt(e.document)}return t}function kr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ar=fn&&`documentMode`in document&&11>=document.documentMode,jr=null,Mr=null,Nr=null,Pr=!1;function Fr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pr||jr==null||jr!==zt(r)||(r=jr,`selectionStart`in r&&kr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Nr&&wr(Nr,r)||(Nr=r,r=Id(Mr,`onSelect`),0<r.length&&(t=new wn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=jr)))}function Ir(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Lr={animationend:Ir(`Animation`,`AnimationEnd`),animationiteration:Ir(`Animation`,`AnimationIteration`),animationstart:Ir(`Animation`,`AnimationStart`),transitionrun:Ir(`Transition`,`TransitionRun`),transitionstart:Ir(`Transition`,`TransitionStart`),transitioncancel:Ir(`Transition`,`TransitionCancel`),transitionend:Ir(`Transition`,`TransitionEnd`)},Rr={},zr={};fn&&(zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Lr.animationend.animation,delete Lr.animationiteration.animation,delete Lr.animationstart.animation),`TransitionEvent`in window||delete Lr.transitionend.transition);function Br(e){if(Rr[e])return Rr[e];if(!Lr[e])return e;var t=Lr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zr)return Rr[e]=t[n];return e}var Vr=Br(`animationend`),Hr=Br(`animationiteration`),Ur=Br(`animationstart`),Wr=Br(`transitionrun`),Gr=Br(`transitionstart`),Kr=Br(`transitioncancel`),qr=Br(`transitionend`),Jr=new Map,Yr=`abort auxClick beforeToggle 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(` `);Yr.push(`scrollEnd`);function Xr(e,t){Jr.set(e,t),Tt(t,[e])}var Zr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Qr=[],$r=0,ei=0;function ti(){for(var e=$r,t=ei=$r=0;t<e;){var n=Qr[t];Qr[t++]=null;var r=Qr[t];Qr[t++]=null;var i=Qr[t];Qr[t++]=null;var a=Qr[t];if(Qr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ai(n,i,a)}}function ni(e,t,n,r){Qr[$r++]=e,Qr[$r++]=t,Qr[$r++]=n,Qr[$r++]=r,ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ri(e,t,n,r){return ni(e,t,n,r),oi(e)}function ii(e,t){return ni(e,null,null,t),oi(e)}function ai(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Be(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function oi(e){if(50<yu)throw yu=0,bu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var si={};function ci(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.refCleanup=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 li(e,t,n,r){return new ci(e,t,n,r)}function ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function di(e,t){var n=e.alternate;return n===null?(n=li(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function fi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function pi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ui(e)&&(s=1);else if(typeof e==`string`)s=ep(e,n,ue.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ee:return e=li(31,n,t,a),e.elementType=ee,e.lanes=o,e;case y:return mi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=li(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=li(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=li(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=li(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function mi(e,t,n,r){return e=li(7,e,r,t),e.lanes=n,e}function hi(e,t,n){return e=li(6,e,null,t),e.lanes=n,e}function gi(e){var t=li(18,null,null,0);return t.stateNode=e,t}function _i(e,t,n){return t=li(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vi=new WeakMap;function yi(e,t){if(typeof e==`object`&&e){var n=vi.get(e);return n===void 0?(t={value:e,source:t,stack:P(t)},vi.set(e,t),t):n}return{value:e,source:t,stack:P(t)}}var bi=[],xi=0,Si=null,Ci=0,wi=[],Ti=0,Ei=null,Di=1,Oi=``;function ki(e,t){bi[xi++]=Ci,bi[xi++]=Si,Si=e,Ci=t}function Ai(e,t,n){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Ei=e;var r=Di;e=Oi;var i=32-Be(r)-1;r&=~(1<<i),n+=1;var a=32-Be(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Di=1<<32-Be(t)+i|n<<i|r,Oi=a+e}else Di=1<<a|n<<i|r,Oi=e}function ji(e){e.return!==null&&(ki(e,1),Ai(e,1,0))}function Mi(e){for(;e===Si;)Si=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null;for(;e===Ei;)Ei=wi[--Ti],wi[Ti]=null,Oi=wi[--Ti],wi[Ti]=null,Di=wi[--Ti],wi[Ti]=null}function R(e,t){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Di=t.id,Oi=t.overflow,Ei=e}var Ni=null,Pi=null,Fi=!1,Ii=null,Li=!1,Ri=Error(i(519));function zi(e){throw Gi(yi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ri}function Bi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[lt]=e,t[ut]=r,n){case`dialog`:kd(`cancel`,t),kd(`close`,t);break;case`iframe`:case`object`:case`embed`:kd(`load`,t);break;case`video`:case`audio`:for(n=0;n<Ed.length;n++)kd(Ed[n],t);break;case`source`:kd(`error`,t);break;case`img`:case`image`:case`link`:kd(`error`,t),kd(`load`,t);break;case`details`:kd(`toggle`,t);break;case`input`:kd(`invalid`,t),Ut(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:kd(`invalid`,t);break;case`textarea`:kd(`invalid`,t),qt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Hd(t.textContent,n)?(r.popover!=null&&(kd(`beforetoggle`,t),kd(`toggle`,t)),r.onScroll!=null&&kd(`scroll`,t),r.onScrollEnd!=null&&kd(`scrollend`,t),r.onClick!=null&&(t.onclick=nn),t=!0):t=!1,t||zi(e,!0)}function Vi(e){for(Ni=e.return;Ni;)switch(Ni.tag){case 5:case 31:case 13:Li=!1;return;case 27:case 3:Li=!0;return;default:Ni=Ni.return}}function Hi(e){if(e!==Ni)return!1;if(!Fi)return Vi(e),Fi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||ef(e.type,e.memoizedProps)),n=!n),n&&Pi&&zi(e),Vi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Pi=xf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Pi=xf(e)}else t===27?(t=Pi,lf(e.type)?(e=bf,bf=null,Pi=e):Pi=t):Pi=Ni?yf(e.stateNode.nextSibling):null;return!0}function Ui(){Pi=Ni=null,Fi=!1}function Wi(){var e=Ii;return e!==null&&(au===null?au=e:au.push.apply(au,e),Ii=null),e}function Gi(e){Ii===null?Ii=[e]:Ii.push(e)}var Ki=se(null),qi=null,Ji=null;function Yi(e,t,n){le(Ki,t._currentValue),t._currentValue=n}function Xi(e){e._currentValue=Ki.current,ce(Ki)}function Zi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Qi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Zi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Zi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function $i(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Cr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===pe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[cp]:e.push(cp))}a=a.return}e!==null&&Qi(t,e,n,r),t.flags|=262144}function ea(e){for(e=e.firstContext;e!==null;){if(!Cr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ta(e){qi=e,Ji=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function na(e){return ia(qi,e)}function ra(e,t){return qi===null&&ta(e),ia(e,t)}function ia(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ji===null){if(e===null)throw Error(i(308));Ji=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ji=Ji.next=t;return n}var aa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},oa=t.unstable_scheduleCallback,sa=t.unstable_NormalPriority,ca={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function la(){return{controller:new aa,data:new Map,refCount:0}}function ua(e){e.refCount--,e.refCount===0&&oa(sa,function(){e.controller.abort()})}var da=null,fa=0,pa=0,ma=null;function ha(e,t){if(da===null){var n=da=[];fa=0,pa=bd(),ma={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return fa++,t.then(ga,ga),t}function ga(){if(--fa===0&&da!==null){ma!==null&&(ma.status=`fulfilled`);var e=da;da=null,pa=0,ma=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _a(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var va=N.S;N.S=function(e,t){cu=Oe(),typeof t==`object`&&t&&typeof t.then==`function`&&ha(e,t),va!==null&&va(e,t)};var ya=se(null);function ba(){var e=ya.current;return e===null?Ul.pooledCache:e}function xa(e,t){t===null?le(ya,ya.current):le(ya,t.pool)}function Sa(){var e=ba();return e===null?null:{parent:ca._currentValue,pool:e}}var Ca=Error(i(460)),wa=Error(i(474)),Ta=Error(i(542)),Ea={then:function(){}};function Da(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Oa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(nn,nn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ma(e),e;default:if(typeof t.status==`string`)t.then(nn,nn);else{if(e=Ul,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ma(e),e}throw Aa=t,Ca}}function ka(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Aa=e,Ca):e}}var Aa=null;function ja(){if(Aa===null)throw Error(i(459));var e=Aa;return Aa=null,e}function Ma(e){if(e===Ca||e===Ta)throw Error(i(483))}var Na=null,Pa=0;function Fa(e){var t=Pa;return Pa+=1,Na===null&&(Na=[]),Oa(Na,e,t)}function Ia(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function La(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ra(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=di(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=hi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&ka(i)===t.type)?(t=a(t,n.props),Ia(t,n),t.return=e,t):(t=pi(n.type,n.key,n.props,null,e.mode,r),Ia(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=_i(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=mi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=pi(t.type,t.key,t.props,null,e.mode,n),Ia(n,t),n.return=e,n;case v:return t=_i(t,e.mode,n),t.return=e,t;case O:return t=ka(t),f(e,t,n)}if(ne(t)||A(t))return t=mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Fa(t),n);if(t.$$typeof===C)return f(e,ra(e,t),n);La(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=ka(n),p(e,t,n,r)}if(ne(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Fa(n),r);if(n.$$typeof===C)return p(e,t,ra(e,n),r);La(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=ka(r),m(e,t,n,r,i)}if(ne(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Fa(r),i);if(r.$$typeof===C)return m(e,t,n,ra(t,r),i);La(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Fi&&ki(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Fi&&ki(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Fi&&ki(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Fi&&ki(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Fi&&ki(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Fi&&ki(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&ka(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ia(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=mi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=pi(o.type,o.key,o.props,null,e.mode,c),Ia(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=_i(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=ka(o),b(e,r,o,c)}if(ne(o))return h(e,r,o,c);if(A(o)){if(l=A(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Fa(o),c);if(o.$$typeof===C)return b(e,r,ra(e,o),c);La(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Pa=0;var i=b(e,t,n,r);return Na=null,i}catch(t){if(t===Ca||t===Ta)throw t;var a=li(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var za=Ra(!0),Ba=Ra(!1),Va=!1;function Ha(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ua(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ga(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Hl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=oi(e),ai(e,null,n),t}return ni(e,r,t,n),oi(e)}function Ka(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nt(e,n)}}function qa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ja=!1;function Ya(){if(Ja){var e=ma;if(e!==null)throw e}}function Xa(e,t,n,r){Ja=!1;var i=e.updateQueue;Va=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Gl&f)===f:(r&f)===f){f!==0&&f===pa&&(Ja=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Va=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),$l|=o,e.lanes=o,e.memoizedState=d}}function Za(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Za(n[e],t)}var $a=se(null),eo=se(0);function to(e,t){e=Zl,le(eo,e),le($a,t),Zl=e|t.baseLanes}function no(){le(eo,Zl),le($a,$a.current)}function ro(){Zl=eo.current,ce($a),ce(eo)}var io=se(null),ao=null;function oo(e){var t=e.alternate;le(fo,fo.current&1),le(io,e),ao===null&&(t===null||$a.current!==null||t.memoizedState!==null)&&(ao=e)}function so(e){le(fo,fo.current),le(io,e),ao===null&&(ao=e)}function co(e){e.tag===22?(le(fo,fo.current),le(io,e),ao===null&&(ao=e)):lo(e)}function lo(){le(fo,fo.current),le(io,io.current)}function uo(e){ce(io),ao===e&&(ao=null),ce(fo)}var fo=se(0);function po(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||gf(n)||_f(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var mo=0,ho=null,go=null,_o=null,vo=!1,yo=!1,bo=!1,xo=0,So=0,Co=null,wo=0;function To(){throw Error(i(321))}function Eo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Cr(e[n],t[n]))return!1;return!0}function Do(e,t,n,r,i,a){return mo=a,ho=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Bs:Vs,bo=!1,a=n(r,i),bo=!1,yo&&(a=ko(t,n,r,i)),Oo(e),a}function Oo(e){N.H=zs;var t=go!==null&&go.next!==null;if(mo=0,_o=go=ho=null,vo=!1,So=0,Co=null,t)throw Error(i(300));e===null||ic||(e=e.dependencies,e!==null&&ea(e)&&(ic=!0))}function ko(e,t,n,r){ho=e;var a=0;do{if(yo&&(Co=null),So=0,yo=!1,25<=a)throw Error(i(301));if(a+=1,_o=go=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Hs,o=t(n,r)}while(yo);return o}function Ao(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Lo(t):t,e=e.useState()[0],(go===null?null:go.memoizedState)!==e&&(ho.flags|=1024),t}function jo(){var e=xo!==0;return xo=0,e}function Mo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function No(e){if(vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vo=!1}mo=0,_o=go=ho=null,yo=!1,So=xo=0,Co=null}function Po(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _o===null?ho.memoizedState=_o=e:_o=_o.next=e,_o}function Fo(){if(go===null){var e=ho.alternate;e=e===null?null:e.memoizedState}else e=go.next;var t=_o===null?ho.memoizedState:_o.next;if(t!==null)_o=t,go=e;else{if(e===null)throw ho.alternate===null?Error(i(467)):Error(i(310));go=e,e={memoizedState:go.memoizedState,baseState:go.baseState,baseQueue:go.baseQueue,queue:go.queue,next:null},_o===null?ho.memoizedState=_o=e:_o=_o.next=e}return _o}function Io(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Lo(e){var t=So;return So+=1,Co===null&&(Co=[]),e=Oa(Co,e,t),t=ho,(_o===null?t.memoizedState:_o.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Bs:Vs),e}function Ro(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Lo(e);if(e.$$typeof===C)return na(e)}throw Error(i(438,String(e)))}function zo(e){var t=null,n=ho.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=ho.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Io(),ho.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=k;return t.index++,n}function Bo(e,t){return typeof t==`function`?t(e):t}function Vo(e){return Ho(Fo(),go,e)}function Ho(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(mo&f)===f:(Gl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===pa&&(d=!0);else if((mo&p)===p){u=u.next,p===pa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,ho.lanes|=p,$l|=p;f=u.action,bo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,ho.lanes|=f,$l|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Cr(o,e.memoizedState)&&(ic=!0,d&&(n=ma,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Uo(e){var t=Fo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Cr(o,t.memoizedState)||(ic=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Wo(e,t,n){var r=ho,a=Fo(),o=Fi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Cr((go||a).memoizedState,n);if(s&&(a.memoizedState=n,ic=!0),a=a.queue,ps(qo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||_o!==null&&_o.memoizedState.tag&1){if(r.flags|=2048,cs(9,{destroy:void 0},Ko.bind(null,r,a,n,t),null),Ul===null)throw Error(i(349));o||mo&127||Go(r,t,n)}return n}function Go(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ho.updateQueue,t===null?(t=Io(),ho.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ko(e,t,n,r){t.value=n,t.getSnapshot=r,Jo(t)&&z(e)}function qo(e,t,n){return n(function(){Jo(t)&&z(e)})}function Jo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Cr(e,n)}catch{return!0}}function z(e){var t=ii(e,2);t!==null&&Cu(t,e,2)}function B(e){var t=Po();if(typeof e==`function`){var n=e;if(e=n(),bo){ze(!0);try{n()}finally{ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:e},t}function Yo(e,t,n,r){return e.baseState=n,Ho(e,go,typeof r==`function`?r:Bo)}function Xo(e,t,n,r,a){if(Is(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Zo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Zo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Qo(e,t,s)}catch(n){es(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Qo(e,t,a)}catch(n){es(e,t,n)}}function Qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){$o(e,t,n)},function(n){return es(e,t,n)}):$o(e,t,n)}function $o(e,t,n){t.status=`fulfilled`,t.value=n,ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Zo(e,n)))}function es(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ts(t),t=t.next;while(t!==r)}e.action=null}function ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ns(e,t){return t}function rs(e,t){if(Fi){var n=Ul.formState;if(n!==null){a:{var r=ho;if(Fi){if(Pi){b:{for(var i=Pi,a=Li;i.nodeType!==8;)if(!a||(i=yf(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Pi=yf(i.nextSibling),r=i.data===`F!`;break a}}zi(r)}r=!1}r&&(t=n[0])}}return n=Po(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:t},n.queue=r,n=Ns.bind(null,ho,r),r.dispatch=n,r=B(!1),a=Fs.bind(null,ho,!1,r.queue),r=Po(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Xo.bind(null,ho,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function is(e){return as(Fo(),go,e)}function as(e,t,n){if(t=Ho(e,t,ns)[0],e=Vo(Bo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Lo(t)}catch(e){throw e===Ca?Ta:e}else r=t;t=Fo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(ho.flags|=2048,cs(9,{destroy:void 0},os.bind(null,i,n),null)),[r,a,e]}function os(e,t){e.action=t}function ss(e){var t=Fo(),n=go;if(n!==null)return as(t,n,e);Fo(),t=t.memoizedState,n=Fo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function cs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=ho.updateQueue,t===null&&(t=Io(),ho.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ls(){return Fo().memoizedState}function us(e,t,n,r){var i=Po();ho.flags|=e,i.memoizedState=cs(1|t,{destroy:void 0},n,r===void 0?null:r)}function ds(e,t,n,r){var i=Fo();r=r===void 0?null:r;var a=i.memoizedState.inst;go!==null&&r!==null&&Eo(r,go.memoizedState.deps)?i.memoizedState=cs(t,a,n,r):(ho.flags|=e,i.memoizedState=cs(1|t,a,n,r))}function fs(e,t){us(8390656,8,e,t)}function ps(e,t){ds(2048,8,e,t)}function ms(e){ho.flags|=4;var t=ho.updateQueue;if(t===null)t=Io(),ho.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function hs(e){var t=Fo().memoizedState;return ms({ref:t,nextImpl:e}),function(){if(Hl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function gs(e,t){return ds(4,2,e,t)}function _s(e,t){return ds(4,4,e,t)}function vs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ys(e,t,n){n=n==null?null:n.concat([e]),ds(4,4,vs.bind(null,t,e),n)}function bs(){}function xs(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Eo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ss(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Eo(t,r[1]))return r[0];if(r=e(),bo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r}function Cs(e,t,n){return n===void 0||mo&1073741824&&!(Gl&261930)?e.memoizedState=t:(e.memoizedState=n,e=Su(),ho.lanes|=e,$l|=e,n)}function ws(e,t,n,r){return Cr(n,t)?n:$a.current===null?!(mo&42)||mo&1073741824&&!(Gl&261930)?(ic=!0,e.memoizedState=n):(e=Su(),ho.lanes|=e,$l|=e,t):(e=Cs(e,n,r),Cr(e,t)||(ic=!0),e)}function Ts(e,t,n,r,i){var a=re.p;re.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,Fs(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ps(e,t,_a(c,r),xu(e)):Ps(e,t,r,xu(e))}catch(n){Ps(e,t,{then:function(){},status:`rejected`,reason:n},xu())}finally{re.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function Es(){}function V(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ds(e).queue;Ts(e,a,t,ie,n===null?Es:function(){return H(e),n(r)})}function Ds(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:ie},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function H(e){var t=Ds(e);t.next===null&&(t=e.alternate.memoizedState),Ps(e,t.next.queue,{},xu())}function Os(){return na(cp)}function ks(){return Fo().memoizedState}function As(){return Fo().memoizedState}function js(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=xu();e=Wa(n);var r=Ga(t,e,n);r!==null&&(Cu(r,t,n),Ka(r,t,n)),t={cache:la()},e.payload=t;return}t=t.return}}function Ms(e,t,n){var r=xu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Is(e)?Ls(t,n):(n=ri(e,t,n,r),n!==null&&(Cu(n,e,r),Rs(n,t,r)))}function Ns(e,t,n){Ps(e,t,n,xu())}function Ps(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Is(e))Ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Cr(s,o))return ni(e,t,i,0),Ul===null&&ti(),!1}catch{}if(n=ri(e,t,i,r),n!==null)return Cu(n,e,r),Rs(n,t,r),!0}return!1}function Fs(e,t,n,r){if(r={lane:2,revertLane:bd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Is(e)){if(t)throw Error(i(479))}else t=ri(e,n,r,2),t!==null&&Cu(t,e,2)}function Is(e){var t=e.alternate;return e===ho||t!==null&&t===ho}function Ls(e,t){yo=vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nt(e,n)}}var zs={readContext:na,use:Ro,useCallback:To,useContext:To,useEffect:To,useImperativeHandle:To,useLayoutEffect:To,useInsertionEffect:To,useMemo:To,useReducer:To,useRef:To,useState:To,useDebugValue:To,useDeferredValue:To,useTransition:To,useSyncExternalStore:To,useId:To,useHostTransitionStatus:To,useFormState:To,useActionState:To,useOptimistic:To,useMemoCache:To,useCacheRefresh:To};zs.useEffectEvent=To;var Bs={readContext:na,use:Ro,useCallback:function(e,t){return Po().memoizedState=[e,t===void 0?null:t],e},useContext:na,useEffect:fs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),us(4194308,4,vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return us(4194308,4,e,t)},useInsertionEffect:function(e,t){us(4,2,e,t)},useMemo:function(e,t){var n=Po();t=t===void 0?null:t;var r=e();if(bo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Po();if(n!==void 0){var i=n(t);if(bo){ze(!0);try{n(t)}finally{ze(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ms.bind(null,ho,e),[r.memoizedState,e]},useRef:function(e){var t=Po();return e={current:e},t.memoizedState=e},useState:function(e){e=B(e);var t=e.queue,n=Ns.bind(null,ho,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:bs,useDeferredValue:function(e,t){return Cs(Po(),e,t)},useTransition:function(){var e=B(!1);return e=Ts.bind(null,ho,e.queue,!0,!1),Po().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=ho,a=Po();if(Fi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ul===null)throw Error(i(349));Gl&127||Go(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,fs(qo.bind(null,r,o,e),[e]),r.flags|=2048,cs(9,{destroy:void 0},Ko.bind(null,r,o,n,t),null),n},useId:function(){var e=Po(),t=Ul.identifierPrefix;if(Fi){var n=Oi,r=Di;n=(r&~(1<<32-Be(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=xo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=wo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Os,useFormState:rs,useActionState:rs,useOptimistic:function(e){var t=Po();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Fs.bind(null,ho,!0,n),n.dispatch=t,[e,t]},useMemoCache:zo,useCacheRefresh:function(){return Po().memoizedState=js.bind(null,ho)},useEffectEvent:function(e){var t=Po(),n={impl:e};return t.memoizedState=n,function(){if(Hl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Vs={readContext:na,use:Ro,useCallback:xs,useContext:na,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:Vo,useRef:ls,useState:function(){return Vo(Bo)},useDebugValue:bs,useDeferredValue:function(e,t){return ws(Fo(),go.memoizedState,e,t)},useTransition:function(){var e=Vo(Bo)[0],t=Fo().memoizedState;return[typeof e==`boolean`?e:Lo(e),t]},useSyncExternalStore:Wo,useId:ks,useHostTransitionStatus:Os,useFormState:is,useActionState:is,useOptimistic:function(e,t){return Yo(Fo(),go,e,t)},useMemoCache:zo,useCacheRefresh:As};Vs.useEffectEvent=hs;var Hs={readContext:na,use:Ro,useCallback:xs,useContext:na,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:Uo,useRef:ls,useState:function(){return Uo(Bo)},useDebugValue:bs,useDeferredValue:function(e,t){var n=Fo();return go===null?Cs(n,e,t):ws(n,go.memoizedState,e,t)},useTransition:function(){var e=Uo(Bo)[0],t=Fo().memoizedState;return[typeof e==`boolean`?e:Lo(e),t]},useSyncExternalStore:Wo,useId:ks,useHostTransitionStatus:Os,useFormState:ss,useActionState:ss,useOptimistic:function(e,t){var n=Fo();return go===null?(n.baseState=e,[e,n.queue.dispatch]):Yo(n,go,e,t)},useMemoCache:zo,useCacheRefresh:As};Hs.useEffectEvent=hs;function Us(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ws={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=xu(),i=Wa(r);i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,r),t!==null&&(Cu(t,e,r),Ka(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=xu(),i=Wa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,r),t!==null&&(Cu(t,e,r),Ka(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=xu(),r=Wa(n);r.tag=2,t!=null&&(r.callback=t),t=Ga(e,r,n),t!==null&&(Cu(t,e,n),Ka(t,e,n))}};function Gs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!wr(n,r)||!wr(i,a):!0}function Ks(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ws.enqueueReplaceState(t,t.state,null)}function qs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Js(e){Zr(e)}function Ys(e){console.error(e)}function Xs(e){Zr(e)}function Zs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Qs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function $s(e,t,n){return n=Wa(n),n.tag=3,n.payload={element:null},n.callback=function(){Zs(e,t)},n}function ec(e){return e=Wa(e),e.tag=3,e}function tc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Qs(t,n,r),typeof i!=`function`&&(du===null?du=new Set([this]):du.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function nc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&$i(t,n,a,!0),n=io.current,n!==null){switch(n.tag){case 31:case 13:return ao===null?Fu():n.alternate===null&&Ql===0&&(Ql=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ea?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ed(e,r,a)),!1;case 22:return n.flags|=65536,r===Ea?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),ed(e,r,a)),!1}throw Error(i(435,n.tag))}return ed(e,r,a),Fu(),!1}if(Fi)return t=io.current,t===null?(r!==Ri&&(t=Error(i(423),{cause:r}),Gi(yi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=yi(r,n),a=$s(e.stateNode,r,a),qa(e,a),Ql!==4&&(Ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ri&&(e=Error(i(422),{cause:r}),Gi(yi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=yi(o,n),iu===null?iu=[o]:iu.push(o),Ql!==4&&(Ql=2),t===null)return!0;r=yi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=$s(n.stateNode,r,e),qa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(du===null||!du.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ec(a),tc(a,e,n,r),qa(n,a),!1}n=n.return}while(n!==null);return!1}var rc=Error(i(461)),ic=!1;function ac(e,t,n,r){t.child=e===null?Ba(t,null,n,r):za(t,e.child,n,r)}function oc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ta(t),r=Do(e,t,n,o,a,i),s=jo(),e!==null&&!ic?(Mo(e,t,i),Ac(e,t,i)):(Fi&&s&&ji(t),t.flags|=1,ac(e,t,r,i),t.child)}function sc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ui(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,cc(e,t,a,r,i)):(e=pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!jc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?wr:n,n(o,r)&&e.ref===t.ref)return Ac(e,t,i)}return t.flags|=1,e=di(a,r),e.ref=t.ref,e.return=t,t.child=e}function cc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(wr(a,r)&&e.ref===t.ref){if(ic=!1,t.pendingProps=r=a,jc(e,i))e.flags&131072&&(ic=!0);else return t.lanes=e.lanes,Ac(e,t,i)}}return gc(e,t,n,r,i)}function lc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return dc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&xa(t,a===null?null:a.cachePool),a===null?no():to(t,a),co(t);else return r=t.lanes=536870912,dc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&xa(t,null),no(),lo(t)):(xa(t,a.cachePool),to(t,a),lo(t),t.memoizedState=null);return ac(e,t,i,n),t.child}function uc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function dc(e,t,n,r,i){var a=ba();return a=a===null?null:{parent:ca._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&xa(t,null),no(),co(t),e!==null&&$i(e,t,r,!0),t.childLanes=i,null}function fc(e,t){return t=Tc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function pc(e,t,n){return za(t,e.child,null,n),e=fc(t,t.pendingProps),e.flags|=2,uo(t),t.memoizedState=null,e}function mc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Fi){if(r.mode===`hidden`)return e=fc(t,r),t.lanes=536870912,uc(null,e);if(so(t),(e=Pi)?(e=hf(e,Li),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw zi(t);return t.lanes=536870912,null}return fc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(so(t),a){if(t.flags&256)t.flags&=-257,t=pc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(ic||$i(e,t,n,!1),a=(n&e.childLanes)!==0,ic||a){if(r=Ul,r!==null&&(s=rt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ii(e,s),Cu(r,e,s),rc;Fu(),t=pc(e,t,n)}else e=o.treeContext,Pi=yf(s.nextSibling),Ni=t,Fi=!0,Ii=null,Li=!1,e!==null&&R(t,e),t=fc(t,r),t.flags|=4096;return t}return e=di(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function hc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function gc(e,t,n,r,i){return ta(t),n=Do(e,t,n,r,void 0,i),r=jo(),e!==null&&!ic?(Mo(e,t,i),Ac(e,t,i)):(Fi&&r&&ji(t),t.flags|=1,ac(e,t,n,i),t.child)}function _c(e,t,n,r,i,a){return ta(t),t.updateQueue=null,n=ko(t,r,n,i),Oo(e),r=jo(),e!==null&&!ic?(Mo(e,t,a),Ac(e,t,a)):(Fi&&r&&ji(t),t.flags|=1,ac(e,t,n,a),t.child)}function vc(e,t,n,r,i){if(ta(t),t.stateNode===null){var a=si,o=n.contextType;typeof o==`object`&&o&&(a=na(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ws,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ha(t),o=n.contextType,a.context=typeof o==`object`&&o?na(o):si,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Us(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ws.enqueueReplaceState(a,a.state,null),Xa(t,r,a,i),Ya(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=qs(n,s);a.props=c;var l=a.context,u=n.contextType;o=si,typeof u==`object`&&u&&(o=na(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ks(t,a,r,o),Va=!1;var f=t.memoizedState;a.state=f,Xa(t,r,a,i),Ya(),l=t.memoizedState,s||f!==l||Va?(typeof d==`function`&&(Us(t,n,d,r),l=t.memoizedState),(c=Va||Gs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ua(e,t),o=t.memoizedProps,u=qs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=si,typeof l==`object`&&l&&(c=na(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ks(t,a,r,c),Va=!1,f=t.memoizedState,a.state=f,Xa(t,r,a,i),Ya();var p=t.memoizedState;o!==d||f!==p||Va||e!==null&&e.dependencies!==null&&ea(e.dependencies)?(typeof s==`function`&&(Us(t,n,s,r),p=t.memoizedState),(u=Va||Gs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ea(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,hc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=za(t,e.child,null,i),t.child=za(t,null,n,i)):ac(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ac(e,t,i),e}function yc(e,t,n,r){return Ui(),t.flags|=256,ac(e,t,n,r),t.child}var bc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xc(e){return{baseLanes:e,cachePool:Sa()}}function Sc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=nu),e}function Cc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(fo.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Fi){if(a?oo(t):lo(t),(e=Pi)?(e=hf(e,Li),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw zi(t);return _f(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(lo(t),a=t.mode,c=Tc({mode:`hidden`,children:c},a),r=mi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=xc(n),r.childLanes=Sc(e,s,n),t.memoizedState=bc,uc(null,r)):(oo(t),wc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(oo(t),t.flags&=-257,t=Ec(e,t,n)):t.memoizedState===null?(lo(t),c=r.fallback,a=t.mode,r=Tc({mode:`visible`,children:r.children},a),c=mi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,za(t,e.child,null,n),r=t.child,r.memoizedState=xc(n),r.childLanes=Sc(e,s,n),t.memoizedState=bc,t=uc(null,r)):(lo(t),t.child=e.child,t.flags|=128,t=null);else if(oo(t),_f(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Gi({value:r,source:null,stack:null}),t=Ec(e,t,n)}else if(ic||$i(e,t,n,!1),s=(n&e.childLanes)!==0,ic||s){if(s=Ul,s!==null&&(r=rt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ii(e,r),Cu(s,e,r),rc;gf(c)||Fu(),t=Ec(e,t,n)}else gf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Pi=yf(c.nextSibling),Ni=t,Fi=!0,Ii=null,Li=!1,e!==null&&R(t,e),t=wc(t,r.children),t.flags|=4096);return t}return a?(lo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=di(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=mi(c,a,n,null),c.flags|=2):c=di(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,uc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=xc(n):(a=c.cachePool,a===null?a=Sa():(l=ca._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Sc(e,s,n),t.memoizedState=bc,uc(e.child,r)):(oo(t),n=e.child,e=n.sibling,n=di(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function wc(e,t){return t=Tc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Tc(e,t){return e=li(22,e,null,t),e.lanes=0,e}function Ec(e,t,n){return za(t,e.child,null,n),e=wc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Zi(e.return,t,n)}function Oc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function kc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=fo.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,le(fo,o),ac(e,t,r,n),r=Fi?Ci:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Dc(e,n,t);else if(e.tag===19)Dc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&po(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Oc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&po(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Oc(t,!0,n,null,a,r);break;case`together`:Oc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ac(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),$l|=t.lanes,(n&t.childLanes)===0){if(e!==null){if($i(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function jc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ea(e)))}function Mc(e,t,n){switch(t.tag){case 3:me(t,t.stateNode.containerInfo),Yi(t,ca,e.memoizedState.cache),Ui();break;case 27:case 5:ge(t);break;case 4:me(t,t.stateNode.containerInfo);break;case 10:Yi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,so(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(oo(t),e=Ac(e,t,n),e===null?null:e.sibling):Cc(e,t,n):(oo(t),t.flags|=128,null);oo(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=($i(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return kc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),le(fo,fo.current),r)break;return null;case 22:return t.lanes=0,lc(e,t,n,t.pendingProps);case 24:Yi(t,ca,e.memoizedState.cache)}return Ac(e,t,n)}function Nc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)ic=!0;else{if(!jc(e,n)&&!(t.flags&128))return ic=!1,Mc(e,t,n);ic=!!(e.flags&131072)}}else ic=!1,Fi&&t.flags&1048576&&Ai(t,Ci,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ka(t.elementType),t.type=e,typeof e==`function`)ui(e)?(r=qs(e,r),t.tag=1,t=vc(null,t,e,r,n)):(t.tag=0,t=gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=oc(null,t,e,r,n);break a}if(a===D){t.tag=14,t=sc(null,t,e,r,n);break a}}throw t=M(e)||e,Error(i(306,t,``))}}return t;case 0:return gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=qs(r,t.pendingProps),vc(e,t,r,a,n);case 3:a:{if(me(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ua(e,t),Xa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Yi(t,ca,r),r!==o.cache&&Qi(t,[ca],n,!0),Ya(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=yc(e,t,r,n);break a}if(r!==a){a=yi(Error(i(424)),t),Gi(a),t=yc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Pi=yf(e.firstChild),Ni=t,Fi=!0,Ii=null,Li=!0,n=Ba(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ui(),r===a){t=Ac(e,t,n);break a}ac(e,t,r,n)}t=t.child}return t;case 26:return hc(e,t),e===null?(n=Bf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Fi||(n=t.type,e=t.pendingProps,r=Zd(fe.current).createElement(n),r[lt]=t,r[ut]=e,Gd(r,n,e),St(r),t.stateNode=r):t.memoizedState=Bf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ge(t),e===null&&Fi&&(r=t.stateNode=Cf(t.type,t.pendingProps,fe.current),Ni=t,Li=!0,a=Pi,lf(t.type)?(bf=a,Pi=yf(r.firstChild)):Pi=a),ac(e,t,t.pendingProps.children,n),hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Fi&&((a=r=Pi)&&(r=pf(r,t.type,t.pendingProps,Li),r===null?a=!1:(t.stateNode=r,Ni=t,Pi=yf(r.firstChild),Li=!1,a=!0)),a||zi(t)),ge(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,ef(a,o)?r=null:s!==null&&ef(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Do(e,t,Ao,null,null,n),cp._currentValue=a),hc(e,t),ac(e,t,r,n),t.child;case 6:return e===null&&Fi&&((e=n=Pi)&&(n=mf(n,t.pendingProps,Li),n===null?e=!1:(t.stateNode=n,Ni=t,Pi=null,e=!0)),e||zi(t)),null;case 13:return Cc(e,t,n);case 4:return me(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=za(t,null,r,n):ac(e,t,r,n),t.child;case 11:return oc(e,t,t.type,t.pendingProps,n);case 7:return ac(e,t,t.pendingProps,n),t.child;case 8:return ac(e,t,t.pendingProps.children,n),t.child;case 12:return ac(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Yi(t,t.type,r.value),ac(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ta(t),a=na(a),r=r(a),t.flags|=1,ac(e,t,r,n),t.child;case 14:return sc(e,t,t.type,t.pendingProps,n);case 15:return cc(e,t,t.type,t.pendingProps,n);case 19:return kc(e,t,n);case 31:return mc(e,t,n);case 22:return lc(e,t,n,t.pendingProps);case 24:return ta(t),r=na(ca),e===null?(a=ba(),a===null&&(a=Ul,o=la(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ha(t),Yi(t,ca,a)):((e.lanes&n)!==0&&(Ua(e,t),Xa(t,null,null,n),Ya()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Yi(t,ca,r),r!==a.cache&&Qi(t,[ca],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Yi(t,ca,r))),ac(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Pc(e){e.flags|=4}function Fc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Mu())e.flags|=8192;else throw Aa=Ea,wa}}else e.flags&=-16777217}function Ic(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!tp(t)){if(Mu())e.flags|=8192;else throw Aa=Ea,wa}}function Lc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ze(),e.lanes|=t,ru|=t)}function Rc(e,t){if(!Fi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function zc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Bc(e,t,n){var r=t.pendingProps;switch(Mi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zc(t),null;case 1:return zc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Xi(ca),he(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?Pc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Wi())),zc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Pc(t),o===null?(zc(t),Fc(t,a,null,r,n)):(zc(t),Ic(t,o))):o?o===e.memoizedState?(zc(t),t.flags&=-16777217):(Pc(t),zc(t),Ic(t,o)):(e=e.memoizedProps,e!==r&&Pc(t),zc(t),Fc(t,a,e,r,n)),null;case 27:if(_e(t),n=fe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return zc(t),null}e=ue.current,Hi(t)?Bi(t,e):(e=Cf(a,r,n),t.stateNode=e,Pc(t))}return zc(t),null;case 5:if(_e(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return zc(t),null}if(o=ue.current,Hi(t))Bi(t,o);else{var s=Zd(fe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[lt]=t,o[ut]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Gd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Pc(t)}}return zc(t),Fc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=fe.current,Hi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ni,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[lt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Hd(e.nodeValue,n)),e||zi(t,!0)}else e=Zd(e).createTextNode(r),e[lt]=t,t.stateNode=e}return zc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[lt]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zc(t),e=!1}else n=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(uo(t),t):(uo(t),null);if(t.flags&128)throw Error(i(558))}return zc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Hi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[lt]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zc(t),a=!1}else a=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(uo(t),t):(uo(t),null)}return uo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Lc(t,t.updateQueue),zc(t),null);case 4:return he(),e===null&&Md(t.stateNode.containerInfo),zc(t),null;case 10:return Xi(t.type),zc(t),null;case 19:if(ce(fo),r=t.memoizedState,r===null)return zc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Rc(r,!1);else{if(Ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=po(e),o!==null){for(t.flags|=128,Rc(r,!1),e=o.updateQueue,t.updateQueue=e,Lc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fi(n,e),n=n.sibling;return le(fo,fo.current&1|2),Fi&&ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Oe()>lu&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=po(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Lc(t,e),Rc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Fi)return zc(t),null}else 2*Oe()-r.renderingStartTime>lu&&n!==536870912&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(zc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Oe(),e.sibling=null,n=fo.current,le(fo,a?n&1|2:n&1),Fi&&ki(t,r.treeForkCount),e);case 22:case 23:return uo(t),ro(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(zc(t),t.subtreeFlags&6&&(t.flags|=8192)):zc(t),n=t.updateQueue,n!==null&&Lc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ce(ya),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Xi(ca),zc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Vc(e,t){switch(Mi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xi(ca),he(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(uo(t),t.alternate===null)throw Error(i(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(uo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ce(fo),null;case 4:return he(),null;case 10:return Xi(t.type),null;case 22:case 23:return uo(t),ro(),e!==null&&ce(ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Xi(ca),null;case 25:return null;default:return null}}function Hc(e,t){switch(Mi(t),t.tag){case 3:Xi(ca),he();break;case 26:case 27:case 5:_e(t);break;case 4:he();break;case 31:t.memoizedState!==null&&uo(t);break;case 13:uo(t);break;case 19:ce(fo);break;case 10:Xi(t.type);break;case 22:case 23:uo(t),ro(),e!==null&&ce(ya);break;case 24:Xi(ca)}}function Uc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){$u(t,t.return,e)}}function Wc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){$u(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){$u(t,t.return,e)}}function Gc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Qa(t,n)}catch(t){$u(e,e.return,t)}}}function Kc(e,t,n){n.props=qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){$u(e,t,n)}}function qc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){$u(e,t,n)}}function Jc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){$u(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){$u(e,t,n)}else n.current=null}}function Yc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){$u(e,e.return,t)}}function Xc(e,t,n){try{var r=e.stateNode;Kd(r,e.type,n,t),r[ut]=t}catch(t){$u(e,e.return,t)}}function Zc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&lf(e.type)||e.tag===4}function Qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Zc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&lf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $c(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=nn));else if(r!==4&&(r===27&&lf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&lf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Gd(t,r,n),t[lt]=e,t[ut]=n}catch(t){$u(e,e.return,t)}}var nl=!1,rl=!1,il=!1,al=typeof WeakSet==`function`?WeakSet:Set,ol=null;function sl(e,t){if(e=e.containerInfo,Yd=_p,e=Or(e),kr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Xd={focusedElem:e,selectionRange:n},_p=!1,ol=t;ol!==null;)if(t=ol,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ol=e;else for(;ol!==null;){switch(t=ol,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=qs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){$u(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ff(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ff(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,ol=e;break}ol=t.return}}function cl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Cl(e,n),r&4&&Uc(5,n);break;case 1:if(Cl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){$u(n,n.return,e)}else{var i=qs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){$u(n,n.return,e)}}}r&64&&Gc(n),r&512&&qc(n,n.return);break;case 3:if(Cl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Qa(e,t)}catch(e){$u(n,n.return,e)}}break;case 27:t===null&&r&4&&tl(n);case 26:case 5:Cl(e,n),t===null&&r&4&&Yc(n),r&512&&qc(n,n.return);break;case 12:Cl(e,n);break;case 31:Cl(e,n),r&4&&ml(e,n);break;case 13:Cl(e,n),r&4&&hl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=rd.bind(null,n),vf(e,n))));break;case 22:if(r=n.memoizedState!==null||nl,!r){t=t!==null&&t.memoizedState!==null||rl,i=nl;var a=rl;nl=r,(rl=t)&&!a?Tl(e,n,!!(n.subtreeFlags&8772)):Cl(e,n),nl=i,rl=a}break;case 30:break;default:Cl(e,n)}}function ll(e){var t=e.alternate;t!==null&&(e.alternate=null,ll(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_t(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ul=null,dl=!1;function fl(e,t,n){for(n=n.child;n!==null;)pl(e,t,n),n=n.sibling}function pl(e,t,n){if(Re&&typeof Re.onCommitFiberUnmount==`function`)try{Re.onCommitFiberUnmount(Le,n)}catch{}switch(n.tag){case 26:rl||Jc(n,t),fl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:rl||Jc(n,t);var r=ul,i=dl;lf(n.type)&&(ul=n.stateNode,dl=!1),fl(e,t,n),wf(n.stateNode),ul=r,dl=i;break;case 5:rl||Jc(n,t);case 6:if(r=ul,i=dl,ul=null,fl(e,t,n),ul=r,dl=i,ul!==null){if(dl)try{(ul.nodeType===9?ul.body:ul.nodeName===`HTML`?ul.ownerDocument.body:ul).removeChild(n.stateNode)}catch(e){$u(n,t,e)}else try{ul.removeChild(n.stateNode)}catch(e){$u(n,t,e)}}break;case 18:ul!==null&&(dl?(e=ul,uf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Up(e)):uf(ul,n.stateNode));break;case 4:r=ul,i=dl,ul=n.stateNode.containerInfo,dl=!0,fl(e,t,n),ul=r,dl=i;break;case 0:case 11:case 14:case 15:Wc(2,n,t),rl||Wc(4,n,t),fl(e,t,n);break;case 1:rl||(Jc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Kc(n,t,r)),fl(e,t,n);break;case 21:fl(e,t,n);break;case 22:rl=(r=rl)||n.memoizedState!==null,fl(e,t,n),rl=r;break;default:fl(e,t,n)}}function ml(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Up(e)}catch(e){$u(t,t.return,e)}}}function hl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Up(e)}catch(e){$u(t,t.return,e)}}function gl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new al),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new al),t;default:throw Error(i(435,e.tag))}}function _l(e,t){var n=gl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=id.bind(null,e,t);t.then(r,r)}})}function vl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(lf(c.type)){ul=c.stateNode,dl=!1;break a}break;case 5:ul=c.stateNode,dl=!1;break a;case 3:case 4:ul=c.stateNode.containerInfo,dl=!0;break a}c=c.return}if(ul===null)throw Error(i(160));pl(o,s,a),ul=null,dl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)bl(t,e),t=t.sibling}var yl=null;function bl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:vl(t,e),xl(e),r&4&&(Wc(3,e,e.return),Uc(3,e),Wc(5,e,e.return));break;case 1:vl(t,e),xl(e),r&512&&(rl||n===null||Jc(n,n.return)),r&64&&nl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=yl;if(vl(t,e),xl(e),r&512&&(rl||n===null||Jc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[gt]||o[lt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Gd(o,r,n),o[lt]=e,St(o),r=o;break a;case`link`:var s=Qf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Gd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Qf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Gd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[lt]=e,St(o),r=o}e.stateNode=r}else $f(a,e.type,e.stateNode)}else e.stateNode=qf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Xc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?$f(a,e.type,e.stateNode):qf(a,r,e.memoizedProps))}break;case 27:vl(t,e),xl(e),r&512&&(rl||n===null||Jc(n,n.return)),n!==null&&r&4&&Xc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(vl(t,e),xl(e),r&512&&(rl||n===null||Jc(n,n.return)),e.flags&32){a=e.stateNode;try{Jt(a,``)}catch(t){$u(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Xc(e,a,n===null?a:n.memoizedProps)),r&1024&&(il=!0);break;case 6:if(vl(t,e),xl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){$u(e,e.return,t)}}break;case 3:if(Zf=null,a=yl,yl=Df(t.containerInfo),vl(t,e),yl=a,xl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Up(t.containerInfo)}catch(t){$u(e,e.return,t)}il&&(il=!1,Sl(e));break;case 4:r=yl,yl=Df(e.stateNode.containerInfo),vl(t,e),xl(e),yl=r;break;case 12:vl(t,e),xl(e);break;case 31:vl(t,e),xl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 13:vl(t,e),xl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(su=Oe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=nl,d=rl;if(nl=u||a,rl=d||l,vl(t,e),rl=d,nl=u,xl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||nl||rl||wl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){$u(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){$u(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?df(m,!0):df(l.stateNode,!1)}catch(e){$u(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,_l(e,n))));break;case 19:vl(t,e),xl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 30:break;case 21:break;default:vl(t,e),xl(e)}}function xl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Zc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;el(e,Qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Jt(o,``),n.flags&=-33),el(e,Qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;$c(e,Qc(e),s);break;default:throw Error(i(161))}}catch(t){$u(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Sl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Cl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)cl(e,t.alternate,t),t=t.sibling}function wl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Wc(4,t,t.return),wl(t);break;case 1:Jc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Kc(t,t.return,n),wl(t);break;case 27:wf(t.stateNode);case 26:case 5:Jc(t,t.return),wl(t);break;case 22:t.memoizedState===null&&wl(t);break;case 30:wl(t);break;default:wl(t)}e=e.sibling}}function Tl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Tl(i,a,n),Uc(4,a);break;case 1:if(Tl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){$u(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Za(c[i],s)}catch(e){$u(r,r.return,e)}}n&&o&64&&Gc(a),qc(a,a.return);break;case 27:tl(a);case 26:case 5:Tl(i,a,n),n&&r===null&&o&4&&Yc(a),qc(a,a.return);break;case 12:Tl(i,a,n);break;case 31:Tl(i,a,n),n&&o&4&&ml(i,a);break;case 13:Tl(i,a,n),n&&o&4&&hl(i,a);break;case 22:a.memoizedState===null&&Tl(i,a,n),qc(a,a.return);break;case 30:break;default:Tl(i,a,n)}t=t.sibling}}function El(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ua(n))}function Dl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ua(e))}function Ol(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)kl(e,t,n,r),t=t.sibling}function kl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Ol(e,t,n,r),i&2048&&Uc(9,t);break;case 1:Ol(e,t,n,r);break;case 3:Ol(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ua(e)));break;case 12:if(i&2048){Ol(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){$u(t,t.return,e)}}else Ol(e,t,n,r);break;case 31:Ol(e,t,n,r);break;case 13:Ol(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Ol(e,t,n,r):(a._visibility|=2,Al(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Ol(e,t,n,r):jl(e,t),i&2048&&El(o,t);break;case 24:Ol(e,t,n,r),i&2048&&Dl(t.alternate,t);break;default:Ol(e,t,n,r)}}function Al(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Al(a,o,s,c,i),Uc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Al(a,o,s,c,i)):u._visibility&2?Al(a,o,s,c,i):jl(a,o),i&&l&2048&&El(o.alternate,o);break;case 24:Al(a,o,s,c,i),i&&l&2048&&Dl(o.alternate,o);break;default:Al(a,o,s,c,i)}t=t.sibling}}function jl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:jl(n,r),i&2048&&El(r.alternate,r);break;case 24:jl(n,r),i&2048&&Dl(r.alternate,r);break;default:jl(n,r)}t=t.sibling}}var Ml=8192;function Nl(e,t,n){if(e.subtreeFlags&Ml)for(e=e.child;e!==null;)Pl(e,t,n),e=e.sibling}function Pl(e,t,n){switch(e.tag){case 26:Nl(e,t,n),e.flags&Ml&&e.memoizedState!==null&&np(n,yl,e.memoizedState,e.memoizedProps);break;case 5:Nl(e,t,n);break;case 3:case 4:var r=yl;yl=Df(e.stateNode.containerInfo),Nl(e,t,n),yl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ml,Ml=16777216,Nl(e,t,n),Ml=r):Nl(e,t,n));break;default:Nl(e,t,n)}}function Fl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Il(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ol=r,zl(r,e)}Fl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ll(e),e=e.sibling}function Ll(e){switch(e.tag){case 0:case 11:case 15:Il(e),e.flags&2048&&Wc(9,e,e.return);break;case 3:Il(e);break;case 12:Il(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Rl(e)):Il(e);break;default:Il(e)}}function Rl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ol=r,zl(r,e)}Fl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Wc(8,t,t.return),Rl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Rl(t));break;default:Rl(t)}e=e.sibling}}function zl(e,t){for(;ol!==null;){var n=ol;switch(n.tag){case 0:case 11:case 15:Wc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ua(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ol=r;else a:for(n=e;ol!==null;){r=ol;var i=r.sibling,a=r.return;if(ll(r),r===n){ol=null;break a}if(i!==null){i.return=a,ol=i;break a}ol=a}}}var Bl={getCacheForType:function(e){var t=na(ca),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return na(ca).controller.signal}},Vl=typeof WeakMap==`function`?WeakMap:Map,Hl=0,Ul=null,Wl=null,Gl=0,Kl=0,ql=null,Jl=!1,Yl=!1,Xl=!1,Zl=0,Ql=0,$l=0,eu=0,tu=0,nu=0,ru=0,iu=null,au=null,ou=!1,su=0,cu=0,lu=1/0,uu=null,du=null,fu=0,pu=null,mu=null,hu=0,gu=0,_u=null,vu=null,yu=0,bu=null;function xu(){return Hl&2&&Gl!==0?Gl&-Gl:N.T===null?ot():bd()}function Su(){if(nu===0){if(!(Gl&536870912)||Fi){var e=Ge;Ge<<=1,!(Ge&3932160)&&(Ge=262144),nu=e}else nu=536870912}return e=io.current,e!==null&&(e.flags|=32),nu}function Cu(e,t,n){(e===Ul&&(Kl===2||Kl===9)||e.cancelPendingCommit!==null)&&(Au(e,0),Du(e,Gl,nu,!1)),$e(e,n),Hl&2&&e===Ul||(e===Ul&&(!(Hl&2)&&(eu|=n),Ql===4&&Du(e,Gl,nu,!1)),fd(e))}function wu(e,t,n){if(Hl&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ye(e,t),a=r?Ru(e,t):Iu(e,t,!0),o=r;do{if(a===0){Yl&&!r&&Du(e,t,0,!1);break}if(n=e.current.alternate,o&&!Eu(n))a=Iu(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=iu;var l=c.current.memoizedState.isDehydrated;if(l&&(Au(c,s).flags|=256),s=Iu(c,s,!1),s!==2){if(Xl&&!l){c.errorRecoveryDisabledLanes|=o,eu|=o,a=4;break a}o=au,au=a,o!==null&&(au===null?au=o:au.push.apply(au,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Au(e,0),Du(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Du(r,t,nu,!Jl);break a;case 2:au=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=su+300-Oe(),10<a)){if(Du(r,t,nu,!Jl),Je(r,0,!0)!==0)break a;hu=t,r.timeoutHandle=rf(Tu.bind(null,r,n,au,uu,ou,t,nu,eu,ru,Jl,o,`Throttled`,-0,0),a);break a}Tu(r,n,au,uu,ou,t,nu,eu,ru,Jl,o,null,-0,0)}break}}while(1);fd(e)}function Tu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nn},Pl(t,a,d);var m=(a&62914560)===a?su-Oe():(a&4194048)===a?cu-Oe():0;if(m=ip(d,m),m!==null){hu=a,e.cancelPendingCommit=m(Gu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Du(e,a,o,!l);return}}Gu(e,t,a,n,r,i,o,s,c)}function Eu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Cr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Du(e,t,n,r){t&=~tu,t&=~eu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Be(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&tt(e,n,t)}function Ou(){return Hl&6?!0:(pd(0,!1),!1)}function ku(){if(Wl!==null){if(Kl===0)var e=Wl.return;else e=Wl,Ji=qi=null,No(e),Na=null,Pa=0,e=Wl;for(;e!==null;)Hc(e.alternate,e),e=e.return;Wl=null}}function Au(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,af(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),hu=0,ku(),Ul=e,Wl=n=di(e.current,null),Gl=t,Kl=0,ql=null,Jl=!1,Yl=Ye(e,t),Xl=!1,ru=nu=tu=eu=$l=Ql=0,au=iu=null,ou=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Be(r),a=1<<i;t|=e[i],r&=~a}return Zl=t,ti(),n}function ju(e,t){ho=null,N.H=zs,t===Ca||t===Ta?(t=ja(),Kl=3):t===wa?(t=ja(),Kl=4):Kl=t===rc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ql=t,Wl===null&&(Ql=1,Zs(e,yi(t,e.current)))}function Mu(){var e=io.current;return e===null?!0:(Gl&4194048)===Gl?ao===null:(Gl&62914560)===Gl||Gl&536870912?e===ao:!1}function Nu(){var e=N.H;return N.H=zs,e===null?zs:e}function Pu(){var e=N.A;return N.A=Bl,e}function Fu(){Ql=4,Jl||(Gl&4194048)!==Gl&&io.current!==null||(Yl=!0),!($l&134217727)&&!(eu&134217727)||Ul===null||Du(Ul,Gl,nu,!1)}function Iu(e,t,n){var r=Hl;Hl|=2;var i=Nu(),a=Pu();(Ul!==e||Gl!==t)&&(uu=null,Au(e,t)),t=!1;var o=Ql;a:do try{if(Kl!==0&&Wl!==null){var s=Wl,c=ql;switch(Kl){case 8:ku(),o=6;break a;case 3:case 2:case 9:case 6:io.current===null&&(t=!0);var l=Kl;if(Kl=0,ql=null,Hu(e,s,c,l),n&&Yl){o=0;break a}break;default:l=Kl,Kl=0,ql=null,Hu(e,s,c,l)}}Lu(),o=Ql;break}catch(t){ju(e,t)}while(1);return t&&e.shellSuspendCounter++,Ji=qi=null,Hl=r,N.H=i,N.A=a,Wl===null&&(Ul=null,Gl=0,ti()),o}function Lu(){for(;Wl!==null;)Bu(Wl)}function Ru(e,t){var n=Hl;Hl|=2;var r=Nu(),a=Pu();Ul!==e||Gl!==t?(uu=null,lu=Oe()+500,Au(e,t)):Yl=Ye(e,t);a:do try{if(Kl!==0&&Wl!==null){t=Wl;var o=ql;b:switch(Kl){case 1:Kl=0,ql=null,Hu(e,t,o,1);break;case 2:case 9:if(Da(o)){Kl=0,ql=null,Vu(t);break}t=function(){Kl!==2&&Kl!==9||Ul!==e||(Kl=7),fd(e)},o.then(t,t);break a;case 3:Kl=7;break a;case 4:Kl=5;break a;case 7:Da(o)?(Kl=0,ql=null,Vu(t)):(Kl=0,ql=null,Hu(e,t,o,7));break;case 5:var s=null;switch(Wl.tag){case 26:s=Wl.memoizedState;case 5:case 27:var c=Wl;if(s?tp(s):c.stateNode.complete){Kl=0,ql=null;var l=c.sibling;if(l!==null)Wl=l;else{var u=c.return;u===null?Wl=null:(Wl=u,Uu(u))}break b}}Kl=0,ql=null,Hu(e,t,o,5);break;case 6:Kl=0,ql=null,Hu(e,t,o,6);break;case 8:ku(),Ql=6;break a;default:throw Error(i(462))}}zu();break}catch(t){ju(e,t)}while(1);return Ji=qi=null,N.H=r,N.A=a,Hl=n,Wl===null?(Ul=null,Gl=0,ti(),Ql):0}function zu(){for(;Wl!==null&&!F();)Bu(Wl)}function Bu(e){var t=Nc(e.alternate,e,Zl);e.memoizedProps=e.pendingProps,t===null?Uu(e):Wl=t}function Vu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=_c(n,t,t.pendingProps,t.type,void 0,Gl);break;case 11:t=_c(n,t,t.pendingProps,t.type.render,t.ref,Gl);break;case 5:No(t);default:Hc(n,t),t=Wl=fi(t,Zl),t=Nc(n,t,Zl)}e.memoizedProps=e.pendingProps,t===null?Uu(e):Wl=t}function Hu(e,t,n,r){Ji=qi=null,No(t),Na=null,Pa=0;var i=t.return;try{if(nc(e,i,t,n,Gl)){Ql=1,Zs(e,yi(n,e.current)),Wl=null;return}}catch(t){if(i!==null)throw Wl=i,t;Ql=1,Zs(e,yi(n,e.current)),Wl=null;return}t.flags&32768?(Fi||r===1?e=!0:Yl||Gl&536870912?e=!1:(Jl=e=!0,(r===2||r===9||r===3||r===6)&&(r=io.current,r!==null&&r.tag===13&&(r.flags|=16384))),Wu(t,e)):Uu(t)}function Uu(e){var t=e;do{if(t.flags&32768){Wu(t,Jl);return}e=t.return;var n=Bc(t.alternate,t,Zl);if(n!==null){Wl=n;return}if(t=t.sibling,t!==null){Wl=t;return}Wl=t=e}while(t!==null);Ql===0&&(Ql=5)}function Wu(e,t){do{var n=Vc(e.alternate,e);if(n!==null){n.flags&=32767,Wl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Wl=e;return}Wl=e=n}while(e!==null);Ql=6,Wl=null}function Gu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Xu();while(fu!==0);if(Hl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ei,et(e,n,o,s,c,l),e===Ul&&(Wl=Ul=null,Gl=0),mu=t,pu=e,hu=n,gu=o,_u=a,vu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ad(Me,function(){return Zu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=N.T,N.T=null,a=re.p,re.p=2,s=Hl,Hl|=4;try{sl(e,t,n)}finally{Hl=s,re.p=a,N.T=r}}fu=1,Ku(),qu(),Ju()}}function Ku(){if(fu===1){fu=0;var e=pu,t=mu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=re.p;re.p=2;var i=Hl;Hl|=4;try{bl(t,e);var a=Xd,o=Or(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Dr(s.ownerDocument.documentElement,s)){if(c!==null&&kr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Er(s,h),v=Er(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}_p=!!Yd,Xd=Yd=null}finally{Hl=i,re.p=r,N.T=n}}e.current=t,fu=2}}function qu(){if(fu===2){fu=0;var e=pu,t=mu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=re.p;re.p=2;var i=Hl;Hl|=4;try{cl(e,t.alternate,t)}finally{Hl=i,re.p=r,N.T=n}}fu=3}}function Ju(){if(fu===4||fu===3){fu=0,De();var e=pu,t=mu,n=hu,r=vu;t.subtreeFlags&10256||t.flags&10256?fu=5:(fu=0,mu=pu=null,Yu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(du=null),at(n),t=t.stateNode,Re&&typeof Re.onCommitFiberRoot==`function`)try{Re.onCommitFiberRoot(Le,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=re.p,re.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,re.p=i}}hu&3&&Xu(),fd(e),i=e.pendingLanes,n&261930&&i&42?e===bu?yu++:(yu=0,bu=e):yu=0,pd(0,!1)}}function Yu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ua(t)))}function Xu(){return Ku(),qu(),Ju(),Zu()}function Zu(){if(fu!==5)return!1;var e=pu,t=gu;gu=0;var n=at(hu),r=N.T,a=re.p;try{re.p=32>n?32:n,N.T=null,n=_u,_u=null;var o=pu,s=hu;if(fu=0,mu=pu=null,hu=0,Hl&6)throw Error(i(331));var c=Hl;if(Hl|=4,Ll(o.current),kl(o,o.current,s,n),Hl=c,pd(0,!1),Re&&typeof Re.onPostCommitFiberRoot==`function`)try{Re.onPostCommitFiberRoot(Le,o)}catch{}return!0}finally{re.p=a,N.T=r,Yu(e,t)}}function Qu(e,t,n){t=yi(n,t),t=$s(e.stateNode,t,2),e=Ga(e,t,2),e!==null&&($e(e,2),fd(e))}function $u(e,t,n){if(e.tag===3)Qu(e,e,n);else for(;t!==null;){if(t.tag===3){Qu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(du===null||!du.has(r))){e=yi(n,e),n=ec(2),r=Ga(t,n,2),r!==null&&(tc(n,r,t,e),$e(r,2),fd(r));break}}t=t.return}}function ed(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Vl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Xl=!0,i.add(n),e=td.bind(null,e,t,n),t.then(e,e))}function td(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ul===e&&(Gl&n)===n&&(Ql===4||Ql===3&&(Gl&62914560)===Gl&&300>Oe()-su?!(Hl&2)&&Au(e,0):tu|=n,ru===Gl&&(ru=0)),fd(e)}function nd(e,t){t===0&&(t=Ze()),e=ii(e,t),e!==null&&($e(e,t),fd(e))}function rd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),nd(e,n)}function id(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),nd(e,n)}function ad(e,t){return Te(e,t)}var od=null,sd=null,cd=!1,ld=!1,ud=!1,dd=0;function fd(e){e!==sd&&e.next===null&&(sd===null?od=sd=e:sd=sd.next=e),ld=!0,cd||(cd=!0,yd())}function pd(e,t){if(!ud&&ld){ud=!0;do for(var n=!1,r=od;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Be(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,vd(r,a))}else a=Gl,a=Je(r,r===Ul?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ye(r,a)||(n=!0,vd(r,a))}r=r.next}while(n);ud=!1}}function md(){hd()}function hd(){ld=cd=!1;var e=0;dd!==0&&nf()&&(e=dd);for(var t=Oe(),n=null,r=od;r!==null;){var i=r.next,a=gd(r,t);a===0?(r.next=null,n===null?od=i:n.next=i,i===null&&(sd=n)):(n=r,(e!==0||a&3)&&(ld=!0)),r=i}fu!==0&&fu!==5||pd(e,!1),dd!==0&&(dd=0)}function gd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Be(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Xe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ul,n=Gl,n=Je(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Kl===2||Kl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ee(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ye(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ee(r),at(n)){case 2:case 8:n=je;break;case 32:n=Me;break;case 268435456:n=Pe;break;default:n=Me}return r=_d.bind(null,e),n=Te(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ee(r),e.callbackPriority=2,e.callbackNode=null,2}function _d(e,t){if(fu!==0&&fu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Xu()&&e.callbackNode!==n)return null;var r=Gl;return r=Je(e,e===Ul?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(wu(e,r,t),gd(e,Oe()),e.callbackNode!=null&&e.callbackNode===n?_d.bind(null,e):null)}function vd(e,t){if(Xu())return null;wu(e,t,!0)}function yd(){sf(function(){Hl&6?Te(Ae,md):hd()})}function bd(){if(dd===0){var e=pa;e===0&&(e=We,We<<=1,!(We&261888)&&(We=256)),dd=e}return dd}function xd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:tn(``+e)}function Sd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Cd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=xd((i[ut]||null).action),o=r.submitter;o&&(t=(t=o[ut]||null)?xd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new wn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(dd!==0){var e=o?Sd(i,o):new FormData(i);V(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Sd(i,o):new FormData(i),V(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var wd=0;wd<Yr.length;wd++){var Td=Yr[wd];Xr(Td.toLowerCase(),`on`+(Td[0].toUpperCase()+Td.slice(1)))}Xr(Vr,`onAnimationEnd`),Xr(Hr,`onAnimationIteration`),Xr(Ur,`onAnimationStart`),Xr(`dblclick`,`onDoubleClick`),Xr(`focusin`,`onFocus`),Xr(`focusout`,`onBlur`),Xr(Wr,`onTransitionRun`),Xr(Gr,`onTransitionStart`),Xr(Kr,`onTransitionCancel`),Xr(qr,`onTransitionEnd`),Et(`onMouseEnter`,[`mouseout`,`mouseover`]),Et(`onMouseLeave`,[`mouseout`,`mouseover`]),Et(`onPointerEnter`,[`pointerout`,`pointerover`]),Et(`onPointerLeave`,[`pointerout`,`pointerover`]),Tt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Tt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Tt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Tt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Tt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Tt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Ed=`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(` `),Dd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Ed));function Od(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Zr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Zr(e)}i.currentTarget=null,a=c}}}}function kd(e,t){var n=t[ft];n===void 0&&(n=t[ft]=new Set);var r=e+`__bubble`;n.has(r)||(Nd(t,e,2,!1),n.add(r))}function Ad(e,t,n){var r=0;t&&(r|=4),Nd(n,e,r,t)}var jd=`_reactListening`+Math.random().toString(36).slice(2);function Md(e){if(!e[jd]){e[jd]=!0,Ct.forEach(function(t){t!==`selectionchange`&&(Dd.has(t)||Ad(t,!1,e),Ad(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[jd]||(t[jd]=!0,Ad(`selectionchange`,!1,t))}}function Nd(e,t,n,r){switch(wp(t)){case 2:var i=vp;break;case 8:i=yp;break;default:i=bp}n=i.bind(null,t,n,e),i=void 0,!pn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Pd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=vt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}un(function(){var r=a,i=an(n),s=[];a:{var c=Jr.get(e);if(c!==void 0){var l=wn,u=e;switch(e){case`keypress`:if(yn(n)===0)break a;case`keydown`:case`keyup`:l=Vn;break;case`focusin`:u=`focus`,l=Nn;break;case`focusout`:u=`blur`,l=Nn;break;case`beforeblur`:case`afterblur`:l=Nn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=jn;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=Hn;break;case Vr:case Hr:case Ur:l=Pn;break;case qr:l=Un;break;case`scroll`:case`scrollend`:l=En;break;case`wheel`:l=Wn;break;case`copy`:case`cut`:case`paste`:l=Fn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=L;break;case`toggle`:case`beforetoggle`:l=Gn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=dn(m,p),g!=null&&d.push(Fd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==rn&&(u=n.relatedTarget||n.fromElement)&&(vt(u)||u[dt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?vt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=jn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=L,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:bt(l),h=u==null?c:bt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,vt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ld,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Rd(s,c,l,d,!1),u!==null&&f!==null&&Rd(s,f,u,d,!0)}}a:{if(c=r?bt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=dr;else if(ar(c)){if(fr)v=xr;else{v=yr;var y=vr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Qt(r.elementType)&&(v=dr):v=br;if(v&&=v(e,r)){or(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Wt(c,`number`,c.value)}switch(y=r?bt(r):window,e){case`focusin`:(ar(y)||y.contentEditable===`true`)&&(jr=y,Mr=r,Nr=null);break;case`focusout`:Nr=Mr=jr=null;break;case`mousedown`:Pr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Pr=!1,Fr(s,n,i);break;case`selectionchange`:if(Ar)break;case`keydown`:case`keyup`:Fr(s,n,i)}var b;if(qn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else tr?$n(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Xn&&n.locale!==`ko`&&(tr||x!==`onCompositionStart`?x===`onCompositionEnd`&&tr&&(b=vn()):(hn=i,gn=`value`in hn?hn.value:hn.textContent,tr=!0)),y=Id(r,x),0<y.length&&(x=new In(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=er(n),b!==null&&(x.data=b)))),(b=Yn?nr(e,n):rr(e,n))&&(x=Id(r,`onBeforeInput`),0<x.length&&(y=new In(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Cd(s,e,r,n,i)}Od(s,t)})}function Fd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Id(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=dn(e,n),i!=null&&r.unshift(Fd(e,i,a)),i=dn(e,t),i!=null&&r.push(Fd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ld(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Rd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=dn(n,a),l!=null&&o.unshift(Fd(n,l,c))):i||(l=dn(n,a),l!=null&&o.push(Fd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var zd=/\r\n?/g,Bd=/\u0000|\uFFFD/g;function Vd(e){return(typeof e==`string`?e:``+e).replace(zd,`
|
|
9
9
|
`).replace(Bd,``)}function Hd(e,t){return t=Vd(t),Vd(e)===t}function Ud(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Jt(e,``+r);break;case`className`:Mt(e,`class`,r);break;case`tabIndex`:Mt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Mt(e,n,r);break;case`style`:Zt(e,r,o);break;case`data`:if(t!==`object`){Mt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Ud(e,t,`name`,a.name,a,null),Ud(e,t,`formEncType`,a.formEncType,a,null),Ud(e,t,`formMethod`,a.formMethod,a,null),Ud(e,t,`formTarget`,a.formTarget,a,null)):(Ud(e,t,`encType`,a.encType,a,null),Ud(e,t,`method`,a.method,a,null),Ud(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`onScroll`:r!=null&&kd(`scroll`,e);break;case`onScrollEnd`:r!=null&&kd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=tn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:kd(`beforetoggle`,e),kd(`toggle`,e),jt(e,`popover`,r);break;case`xlinkActuate`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:jt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=$t.get(n)||n,jt(e,n,r))}}function Wd(e,t,n,r,a,o){switch(n){case`style`:Zt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Jt(e,``+r);break;case`onScroll`:r!=null&&kd(`scroll`,e);break;case`onScrollEnd`:r!=null&&kd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!wt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ut]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):jt(e,n,r)}}}function Gd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:kd(`error`,e),kd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ud(e,t,o,s,n,null)}}a&&Ud(e,t,`srcSet`,n.srcSet,n,null),r&&Ud(e,t,`src`,n.src,n,null);return;case`input`:kd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Ud(e,t,r,d,n,null)}}Ut(e,o,c,l,u,s,a,!1);return;case`select`:for(a in kd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Ud(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Gt(e,!!r,n,!0):Gt(e,!!r,t,!1);return;case`textarea`:for(s in kd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Ud(e,t,s,c,n,null)}qt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Ud(e,t,l,r,n,null)}return;case`dialog`:kd(`beforetoggle`,e),kd(`toggle`,e),kd(`cancel`,e),kd(`close`,e);break;case`iframe`:case`object`:kd(`load`,e);break;case`video`:case`audio`:for(r=0;r<Ed.length;r++)kd(Ed[r],e);break;case`image`:kd(`error`,e),kd(`load`,e);break;case`details`:kd(`toggle`,e);break;case`embed`:case`source`:case`link`:kd(`error`,e),kd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ud(e,t,u,r,n,null)}return;default:if(Qt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Wd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Ud(e,t,c,r,n,null))}function Kd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Ud(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Ud(e,t,p,m,r,f)}}Ht(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Ud(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Ud(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Gt(e,!!n,n?[]:``,!1):Gt(e,!!n,t,!0)):Gt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Ud(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Ud(e,t,s,a,r,o)}Kt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Ud(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Ud(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Ud(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Ud(e,t,u,p,r,m)}return;default:if(Qt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Wd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Wd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Ud(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Ud(e,t,f,p,r,m)}function qd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Jd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&qd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&qd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Yd=null,Xd=null;function Zd(e){return e.nodeType===9?e:e.ownerDocument}function Qd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function $d(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function ef(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var tf=null;function nf(){var e=window.event;return e&&e.type===`popstate`?e!==tf&&(tf=e,!0):(tf=null,!1)}var rf=typeof setTimeout==`function`?setTimeout:void 0,af=typeof clearTimeout==`function`?clearTimeout:void 0,of=typeof Promise==`function`?Promise:void 0,sf=typeof queueMicrotask==`function`?queueMicrotask:of===void 0?rf:function(e){return of.resolve(null).then(e).catch(cf)};function cf(e){setTimeout(function(){throw e})}function lf(e){return e===`head`}function uf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Up(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)wf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,wf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[gt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&wf(e.ownerDocument.body)}n=i}while(n);Up(t)}function df(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function ff(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ff(n),_t(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function pf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[gt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=yf(e.nextSibling),e===null)break}return null}function mf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=yf(e.nextSibling),e===null))return null;return e}function hf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=yf(e.nextSibling),e===null))return null;return e}function gf(e){return e.data===`$?`||e.data===`$~`}function _f(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function vf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function yf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var bf=null;function xf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return yf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Sf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Cf(e,t,n){switch(t=Zd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function wf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_t(e)}var Tf=new Map,Ef=new Set;function Df(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Of=re.d;re.d={f:kf,r:Af,D:Nf,C:Pf,L:Ff,m:If,X:Rf,S:Lf,M:zf};function kf(){var e=Of.f(),t=Ou();return e||t}function Af(e){var t=yt(e);t!==null&&t.tag===5&&t.type===`form`?H(t):Of.r(e)}var jf=typeof document>`u`?null:document;function Mf(e,t,n){var r=jf;if(r&&typeof t==`string`&&t){var i=Vt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Ef.has(i)||(Ef.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Gd(t,`link`,e),St(t),r.head.appendChild(t)))}}function Nf(e){Of.D(e),Mf(`dns-prefetch`,e,null)}function Pf(e,t){Of.C(e,t),Mf(`preconnect`,e,t)}function Ff(e,t,n){Of.L(e,t,n);var r=jf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Vt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Vt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Vt(n.imageSizes)+`"]`)):i+=`[href="`+Vt(e)+`"]`;var a=i;switch(t){case`style`:a=Vf(e);break;case`script`:a=Gf(e)}Tf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Tf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Hf(a))||t===`script`&&r.querySelector(Kf(a))||(t=r.createElement(`link`),Gd(t,`link`,e),St(t),r.head.appendChild(t)))}}function If(e,t){Of.m(e,t);var n=jf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Vt(r)+`"][href="`+Vt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Gf(e)}if(!Tf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),Tf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Kf(a)))return}r=n.createElement(`link`),Gd(r,`link`,e),St(r),n.head.appendChild(r)}}}function Lf(e,t,n){Of.S(e,t,n);var r=jf;if(r&&e){var i=xt(r).hoistableStyles,a=Vf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Hf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Tf.get(a))&&Yf(e,n);var c=o=r.createElement(`link`);St(c),Gd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Jf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Rf(e,t){Of.X(e,t);var n=jf;if(n&&e){var r=xt(n).hoistableScripts,i=Gf(e),a=r.get(i);a||(a=n.querySelector(Kf(i)),a||(e=h({src:e,async:!0},t),(t=Tf.get(i))&&Xf(e,t),a=n.createElement(`script`),St(a),Gd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zf(e,t){Of.M(e,t);var n=jf;if(n&&e){var r=xt(n).hoistableScripts,i=Gf(e),a=r.get(i);a||(a=n.querySelector(Kf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=Tf.get(i))&&Xf(e,t),a=n.createElement(`script`),St(a),Gd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bf(e,t,n,r){var a=(a=fe.current)?Df(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Vf(n.href),n=xt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Vf(n.href);var o=xt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Hf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Tf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Tf.set(e,n),o||Wf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Gf(n),n=xt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Vf(e){return`href="`+Vt(e)+`"`}function Hf(e){return`link[rel="stylesheet"][`+e+`]`}function Uf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Wf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Gd(t,`link`,n),St(t),e.head.appendChild(t))}function Gf(e){return`[src="`+Vt(e)+`"]`}function Kf(e){return`script[async]`+e}function qf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Vt(n.href)+`"]`);if(r)return t.instance=r,St(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),St(r),Gd(r,`style`,a),Jf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Vf(n.href);var o=e.querySelector(Hf(a));if(o)return t.state.loading|=4,t.instance=o,St(o),o;r=Uf(n),(a=Tf.get(a))&&Yf(r,a),o=(e.ownerDocument||e).createElement(`link`),St(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Gd(o,`link`,r),t.state.loading|=4,Jf(o,n.precedence,e),t.instance=o;case`script`:return o=Gf(n.src),(a=e.querySelector(Kf(o)))?(t.instance=a,St(a),a):(r=n,(a=Tf.get(o))&&(r=h({},n),Xf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),St(a),Gd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Jf(r,n.precedence,e));return t.instance}function Jf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Yf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Xf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Zf=null;function Qf(e,t,n){if(Zf===null){var r=new Map,i=Zf=new Map;i.set(n,r)}else i=Zf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[gt]||a[lt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function $f(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function ep(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function tp(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function np(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Vf(r.href),a=t.querySelector(Hf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ap.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,St(a);return}a=t.ownerDocument||t,r=Uf(r),(i=Tf.get(i))&&Yf(r,i),a=a.createElement(`link`),St(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Gd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ap.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var rp=0;function ip(e,t){return e.stylesheets&&e.count===0&&sp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&sp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&rp===0&&(rp=62500*Jd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>rp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ap(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var op=null;function sp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,op=new Map,t.forEach(U,e),op=null,ap.call(e))}function U(e,t){if(!(t.state.loading&4)){var n=op.get(e);if(n)var r=n.get(null);else{n=new Map,op.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ap.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var cp={$$typeof:C,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function lp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qe(0),this.hiddenUpdates=Qe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function up(e,t,n,r,i,a,o,s,c,l,u,d){return e=new lp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=li(3,null,null,t),e.current=a,a.stateNode=e,t=la(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ha(a),e}function dp(e){return e?(e=si,e):si}function fp(e,t,n,r,i,a){i=dp(i),r.context===null?r.context=i:r.pendingContext=i,r=Wa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ga(e,r,t),n!==null&&(Cu(n,e,t),Ka(n,e,t))}function pp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mp(e,t){pp(e,t),(e=e.alternate)&&pp(e,t)}function hp(e){if(e.tag===13||e.tag===31){var t=ii(e,67108864);t!==null&&Cu(t,e,67108864),mp(e,67108864)}}function gp(e){if(e.tag===13||e.tag===31){var t=xu();t=it(t);var n=ii(e,t);n!==null&&Cu(n,e,t),mp(e,t)}}var _p=!0;function vp(e,t,n,r){var i=N.T;N.T=null;var a=re.p;try{re.p=2,bp(e,t,n,r)}finally{re.p=a,N.T=i}}function yp(e,t,n,r){var i=N.T;N.T=null;var a=re.p;try{re.p=8,bp(e,t,n,r)}finally{re.p=a,N.T=i}}function bp(e,t,n,r){if(_p){var i=xp(r);if(i===null)Pd(e,t,r,Sp,n),Np(e,r);else if(Fp(i,e,t,n,r))r.stopPropagation();else if(Np(e,r),t&4&&-1<Mp.indexOf(e)){for(;i!==null;){var a=yt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=qe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Be(o);s.entanglements[1]|=c,o&=~c}fd(a),!(Hl&6)&&(lu=Oe()+500,pd(0,!1))}}break;case 31:case 13:s=ii(a,2),s!==null&&Cu(s,a,2),Ou(),mp(a,2)}if(a=xp(r),a===null&&Pd(e,t,r,Sp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Pd(e,t,r,null,n)}}function xp(e){return e=an(e),Cp(e)}var Sp=null;function Cp(e){if(Sp=null,e=vt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Sp=e,null}function wp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(ke()){case Ae:return 2;case je:return 8;case Me:case Ne:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var Tp=!1,Ep=null,Dp=null,Op=null,kp=new Map,Ap=new Map,jp=[],Mp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Np(e,t){switch(e){case`focusin`:case`focusout`:Ep=null;break;case`dragenter`:case`dragleave`:Dp=null;break;case`mouseover`:case`mouseout`:Op=null;break;case`pointerover`:case`pointerout`:kp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ap.delete(t.pointerId)}}function Pp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=yt(t),t!==null&&hp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Fp(e,t,n,r,i){switch(t){case`focusin`:return Ep=Pp(Ep,e,t,n,r,i),!0;case`dragenter`:return Dp=Pp(Dp,e,t,n,r,i),!0;case`mouseover`:return Op=Pp(Op,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return kp.set(a,Pp(kp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ap.set(a,Pp(Ap.get(a)||null,e,t,n,r,i)),!0}return!1}function Ip(e){var t=vt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,st(e.priority,function(){gp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,st(e.priority,function(){gp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Lp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);rn=r,n.target.dispatchEvent(r),rn=null}else return t=yt(n),t!==null&&hp(t),e.blockedOn=n,!1;t.shift()}return!0}function Rp(e,t,n){Lp(e)&&n.delete(t)}function zp(){Tp=!1,Ep!==null&&Lp(Ep)&&(Ep=null),Dp!==null&&Lp(Dp)&&(Dp=null),Op!==null&&Lp(Op)&&(Op=null),kp.forEach(Rp),Ap.forEach(Rp)}function Bp(e,n){e.blockedOn===n&&(e.blockedOn=null,Tp||(Tp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,zp)))}var Vp=null;function Hp(e){Vp!==e&&(Vp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vp===e&&(Vp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Cp(r||n)===null)continue;break}var a=yt(n);a!==null&&(e.splice(t,3),t-=3,V(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Up(e){function t(t){return Bp(t,e)}Ep!==null&&Bp(Ep,e),Dp!==null&&Bp(Dp,e),Op!==null&&Bp(Op,e),kp.forEach(t),Ap.forEach(t);for(var n=0;n<jp.length;n++){var r=jp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<jp.length&&(n=jp[0],n.blockedOn===null);)Ip(n),n.blockedOn===null&&jp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ut]||null;if(typeof a==`function`)o||Hp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ut]||null)s=o.formAction;else if(Cp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Hp(n)}}}function Wp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Gp(e){this._internalRoot=e}Kp.prototype.render=Gp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;fp(n,xu(),e,t,null,null)},Kp.prototype.unmount=Gp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fp(e.current,2,null,e,null,null),Ou(),t[dt]=null}};function Kp(e){this._internalRoot=e}Kp.prototype.unstable_scheduleHydration=function(e){if(e){var t=ot();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jp.length&&t!==0&&t<jp[n].priority;n++);jp.splice(n,0,e),n===0&&Ip(e)}};var qp=n.version;if(qp!==`19.2.8`)throw Error(i(527,qp,`19.2.8`));re.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Jp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Yp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yp.isDisabled&&Yp.supportsFiber)try{Le=Yp.inject(Jp),Re=Yp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Js,s=Ys,c=Xs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=up(e,1,!1,null,null,n,r,null,o,s,c,Wp),e[dt]=t.current,Md(e),new Gp(t)}})),g=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=c(u(),1),v=g(),y=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,b=/^[\\/]{2}/;function x(e,t){return t+e.replace(/\\/g,`/`)}var S=`popstate`;function C(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function w(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return ee(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:k(t)}return A(t,n,null,e)}function T(e,t){if(e===!1||e==null)throw Error(t)}function E(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function D(){return Math.random().toString(36).substring(2,10)}function O(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 ee(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?te(t):t,state:n,key:t&&t.key||r||D(),mask:i}}function k({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function te(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 A(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=C(e)?e:ee(h.location,e,t);n&&n(r,e),l=u()+1;let d=O(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=C(e)?e:ee(h.location,e,t);n&&n(r,e),l=u();let i=O(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return j(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(S,d),c=e,()=>{i.removeEventListener(S,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function j(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),T(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:k(t);return i=i.replace(/ $/,`%20`),!n&&b.test(i)&&(i=r+i),new URL(i,r)}function M(e,t,n=`/`){return ne(e,t,n,!1)}function ne(e,t,n,r,i){let a=be((typeof t==`string`?te(t):t).pathname||`/`,n);if(a==null)return null;let o=i??N(e),s=null,c=ye(a);for(let e=0;s==null&&e<o.length;++e)s=he(o[e],c,r);return s}function N(e){let t=re(e);return ae(t),t}function re(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;T(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=F([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(T(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),re(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:pe(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=ve(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ie(e.path))a(e,t,!0,n)}),t}function ie(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ie(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ae(e){e.sort((e,t)=>e.score===t.score?me(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var oe=/^:[\w-]+$/,se=3,ce=2,le=1,ue=10,de=-2,fe=e=>e===`*`;function pe(e,t){let n=e.split(`/`),r=n.length;return n.some(fe)&&(r+=de),t&&(r+=ce),n.filter(e=>!fe(e)).reduce((e,t)=>e+(oe.test(t)?se:t===``?le:ue),r)}function me(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function he(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?_e(u,l,s.matcher,s.compiledParams):ge(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=ge({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:F([a,d.pathname]),pathnameBase:Oe(F([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=F([a,d.pathnameBase]))}return o}function ge(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ve(e.path,e.caseSensitive,e.end);return _e(e,t,n,r)}function _e(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=De(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=De(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function ve(e,t=!1,n=!0){E(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ye(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return E(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function be(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 xe(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?te(e):e,a;return n?(n=Ee(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?Se(n.substring(1),`/`):Se(n,t)):a=t,{pathname:a,search:ke(r),hash:Ae(i)}}function Se(e,t){let n=De(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Ce(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function P(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function we(e){let t=P(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Te(e,t,n,r=!1){let i;typeof e==`string`?i=te(e):(i={...e},T(!i.pathname||!i.pathname.includes(`?`),Ce(`?`,`pathname`,`search`,i)),T(!i.pathname||!i.pathname.includes(`#`),Ce(`#`,`pathname`,`hash`,i)),T(!i.search||!i.search.includes(`#`),Ce(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=xe(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Ee=e=>e.replace(/[\\/]{2,}/g,`/`),F=e=>Ee(e.join(`/`));function De(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Oe=e=>De(e).replace(/^\/*/,`/`),ke=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ae=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,je=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Me(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ne(e){return F(e.map(e=>e.route.path).filter(Boolean))||`/`}var Pe=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Fe(e,t){let n=e;if(typeof n!=`string`||!y.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Pe)try{let e=new URL(window.location.href),r=b.test(n)?new URL(x(n,e.protocol)):new URL(n),a=be(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{E(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ie=new URL(`http://localhost`);function Le(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ie)}catch{return Ie}}function Re(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function ze(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Be(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Re(i,n),s=!Re(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!ze(e,i)||!Re(i,a)))throw Error(`External navigation is not allowed`)}var Ve=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Ve);var He=[`GET`,...Ve];new Set(He);var Ue=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function We(e){try{return Ue.includes(new URL(e).protocol)}catch{return!1}}var Ge=_.createContext(null);Ge.displayName=`DataRouter`;var Ke=_.createContext(null);Ke.displayName=`DataRouterState`;var qe=_.createContext(!1);function Je(){return _.useContext(qe)}var Ye=_.createContext({isTransitioning:!1});Ye.displayName=`ViewTransition`;var Xe=_.createContext(new Map);Xe.displayName=`Fetchers`;var Ze=_.createContext(null);Ze.displayName=`Await`;var Qe=_.createContext(null);Qe.displayName=`Navigation`;var $e=_.createContext(null);$e.displayName=`Location`;var et=_.createContext({outlet:null,matches:[],isDataRoute:!1});et.displayName=`Route`;var tt=_.createContext(null);tt.displayName=`RouteError`;var nt=`REACT_ROUTER_ERROR`,rt=`REDIRECT`,it=`ROUTE_ERROR_RESPONSE`;function at(e){if(e.startsWith(`${nt}:${rt}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function ot(e){if(e.startsWith(`${nt}:${it}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new je(t.status,t.statusText,t.data)}catch{}}function st(e,{relative:t}={}){T(ct(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=_.useContext(Qe),{hash:i,pathname:a,search:o}=mt(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:F([n,a])),r.createHref({pathname:s,search:o,hash:i})}function ct(){return _.useContext($e)!=null}function lt(){return T(ct(),`useLocation() may be used only in the context of a <Router> component.`),_.useContext($e).location}var ut=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function dt(e){_.useContext(Qe).static||_.useLayoutEffect(e)}function ft(){let{isDataRoute:e}=_.useContext(et);return e?jt():pt()}function pt(){T(ct(),`useNavigate() may be used only in the context of a <Router> component.`);let e=_.useContext(Ge),{basename:t,navigator:n}=_.useContext(Qe),{matches:r}=_.useContext(et),{pathname:i}=lt(),a=JSON.stringify(we(r)),o=_.useRef(!1);return dt(()=>{o.current=!0}),_.useCallback((r,s={})=>{if(E(o.current,ut),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Te(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:F([t,c.pathname])),Be(typeof r==`string`?r:k(r),n.createHref(c),Le(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}_.createContext(null);function mt(e,{relative:t}={}){let{matches:n}=_.useContext(et),{pathname:r}=lt(),i=JSON.stringify(we(n));return _.useMemo(()=>Te(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function ht(e,t){return gt(e,t)}function gt(e,t,n){T(ct(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=_.useContext(Qe),{matches:i}=_.useContext(et),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Nt(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${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.
|
|
10
10
|
|
|
11
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=lt(),d;if(t){let e=typeof t==`string`?te(t):t;T(c===`/`||e.pathname?.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 "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):M(e,{pathname:p});E(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),E(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.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 h=Ct(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:F([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:F([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?_.createElement($e.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function _t(){let e=At(),t=Me(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=_.createElement(_.Fragment,null,_.createElement(`p`,null,`💿 Hey developer 👋`),_.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,_.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,_.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),_.createElement(_.Fragment,null,_.createElement(`h2`,null,`Unexpected Application Error!`),_.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?_.createElement(`pre`,{style:i},n):null,o)}var vt=_.createElement(_t,null),yt=class extends _.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||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.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&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=ot(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:_.createElement(et.Provider,{value:this.props.routeContext},_.createElement(tt.Provider,{value:e,children:this.props.component}));return this.context?_.createElement(xt,{error:e},t):t}};yt.contextType=qe;var bt=new WeakMap;function xt({children:e,error:t}){let{basename:n,navigator:r}=_.useContext(Qe);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=at(t.digest);if(e){let i=bt.get(t);if(i)throw i;let a=Fe(e.location,n),o=a.absoluteURL||a.to;if(Be(e.location,o,Le(r),`allow-explicit`),We(o))throw Error(`Invalid redirect location`);if(Pe&&!bt.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw bt.set(t,n),n}}return _.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function St({routeContext:e,match:t,children:n}){let r=_.useContext(Ge);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(et.Provider,{value:e},n)}function Ct(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);T(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ne(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||vt,o&&(s<0&&c===0?(Nt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?_.createElement(n.route.Component,null):n.route.element?n.route.element:e,_.createElement(St,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?_.createElement(yt,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function wt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Tt(e){let t=_.useContext(Ge);return T(t,wt(e)),t}function Et(e){let t=_.useContext(Ke);return T(t,wt(e)),t}function Dt(e){let t=_.useContext(et);return T(t,wt(e)),t}function Ot(e){let t=Dt(e),n=t.matches[t.matches.length-1];return T(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function kt(){return Ot(`useRouteId`)}function At(){let e=_.useContext(tt),t=Et(`useRouteError`),n=Ot(`useRouteError`);return e===void 0?t.errors?.[n]:e}function jt(){let{router:e}=Tt(`useNavigate`),t=Ot(`useNavigate`),n=_.useRef(!1);return dt(()=>{n.current=!0}),_.useCallback(async(r,i={})=>{E(n.current,ut),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Mt={};function Nt(e,t,n){!t&&!Mt[e]&&(Mt[e]=!0,E(!1,n))}_.memo(Pt);function Pt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return gt(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Ft({to:e,replace:t,state:n,relative:r}){T(ct(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=_.useContext(Qe);E(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=_.useContext(et),{pathname:s}=lt(),c=ft(),l=Te(e,we(o),s,r===`path`);Be(typeof e==`string`?e:k(e),a.createHref(l),Le(a),`reject`);let u=JSON.stringify(l);return _.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function It(e){T(!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 Lt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){T(!ct(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=_.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=te(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=_.useMemo(()=>{let e=be(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return E(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:_.createElement(Qe.Provider,{value:c},_.createElement($e.Provider,{children:t,value:h}))}function Rt({children:e,location:t}){return ht(zt(e),t)}_.Component;function zt(e,t=[]){let n=[];return _.Children.forEach(e,(e,r)=>{if(!_.isValidElement(e))return;let i=[...t,r];if(e.type===_.Fragment){n.push.apply(n,zt(e.props.children,i));return}T(e.type===It,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),T(!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:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=zt(e.props.children,i)),n.push(a)}),n}var Bt=`get`,Vt=`application/x-www-form-urlencoded`;function Ht(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Ut(e){return Ht(e)&&e.tagName.toLowerCase()===`button`}function Wt(e){return Ht(e)&&e.tagName.toLowerCase()===`form`}function Gt(e){return Ht(e)&&e.tagName.toLowerCase()===`input`}function Kt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qt(e,t){return e.button===0&&(!t||t===`_self`)&&!Kt(e)}function Jt(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Yt(e,t){let n=Jt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Xt=null;function Zt(){if(Xt===null)try{new FormData(document.createElement(`form`),0),Xt=!1}catch{Xt=!0}return Xt}var Qt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function $t(e){return e!=null&&!Qt.has(e)?(E(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Vt}"`),null):e}function en(e,t){let n,r,i,a,o;if(Wt(e)){let o=e.getAttribute(`action`);r=o?be(o,t):null,n=e.getAttribute(`method`)||Bt,i=$t(e.getAttribute(`enctype`))||Vt,a=new FormData(e)}else if(Ut(e)||Gt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?be(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Bt,i=$t(e.getAttribute(`formenctype`))||$t(o.getAttribute(`enctype`))||Vt,a=new FormData(o,e),!Zt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Ht(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Bt,r=null,i=Vt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function tn(e,t){if(e===!1||e==null)throw Error(t)}function nn(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&be(i.pathname,t)===`/`?`${De(t)}/_root.${r}`:`${De(i.pathname)}.${r}`,i}async function rn(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(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function an(e){return e!=null&&typeof e.page==`string`}function on(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function sn(e,t,n){return fn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await rn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(on).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function cn(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function ln(e,t,{includeHydrateFallback:n}={}){return un(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function un(e){return[...new Set(e)]}function dn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function fn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!an(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(dn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function pn(){let e=_.useContext(Ge);return tn(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function mn(){let e=_.useContext(Ke);return tn(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var hn=_.createContext(void 0);hn.displayName=`FrameworkContext`;function gn(){let e=_.useContext(hn);return tn(e,`You must render this element inside a <HydratedRouter> element`),e}function _n(e,t){let n=_.useContext(hn),[r,i]=_.useState(!1),[a,o]=_.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=_.useRef(null);_.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),_.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:vn(s,p),onBlur:vn(c,m),onMouseEnter:vn(l,p),onMouseLeave:vn(u,m),onTouchStart:vn(d,p)}]:[a,f,{}]:[!1,f,{}]}function vn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function yn({page:e,...t}){let n=Je(),{nonce:r}=gn(),{router:i}=pn(),a=_.useMemo(()=>M(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?_.createElement(xn,{page:e,matches:a,...t}):_.createElement(Sn,{page:e,matches:a,...t})):null}function bn(e){let{manifest:t,routeModules:n}=gn(),[r,i]=_.useState([]);return _.useEffect(()=>{let r=!1;return sn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function xn({page:e,matches:t,...n}){let r=lt(),{future:i}=gn(),{basename:a}=pn(),o=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=nn(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return _.createElement(_.Fragment,null,o.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Sn({page:e,matches:t,...n}){let r=lt(),{future:i,manifest:a,routeModules:o}=gn(),{basename:s}=pn(),{loaderData:c,matches:l}=mn(),u=_.useMemo(()=>cn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=_.useMemo(()=>cn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=nn(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=_.useMemo(()=>ln(d,a),[d,a]),m=bn(d);return _.createElement(_.Fragment,null,f.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>_.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>_.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Cn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}_.Component;var wn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{wn&&(window.__reactRouterVersion=`7.18.4`)}catch{}function Tn({basename:e,children:t,useTransitions:n,window:r}){let i=_.useRef();i.current??=w({window:r,v5Compat:!0});let a=i.current,[o,s]=_.useState({action:a.action,location:a.location}),c=_.useCallback(e=>{n===!1?s(e):_.startTransition(()=>s(e))},[n]);return _.useLayoutEffect(()=>a.listen(c),[a,c]),_.createElement(Lt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var En=_.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:v}=_.useContext(Qe),b=typeof l==`string`&&y.test(l),x=Fe(l,h);l=x.to;let S=st(l,{relative:r}),C=lt(),w=null;if(o){let e=Te(o,[],C.mask?C.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:F([h,e.pathname])),w=g.createHref(e)}let[T,E,D]=_n(n,p),O=jn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:v});function ee(t){e&&e(t),t.defaultPrevented||O(t)}let k=!(x.isExternal||i),te=_.createElement(`a`,{...p,...D,href:(k?w:void 0)||x.absoluteURL||S,onClick:k?ee:e,ref:Cn(m,E),target:c,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?_.createElement(_.Fragment,null,te,_.createElement(yn,{page:S})):te});En.displayName=`Link`;var Dn=_.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=mt(a,{relative:c.relative}),d=lt(),f=_.useContext(Ke),{navigator:p,basename:m}=_.useContext(Qe),h=f!=null&&Ln(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=be(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=v===g||!r&&v.startsWith(g)&&v.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return _.createElement(En,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Dn.displayName=`NavLink`;var On=_.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Bt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=_.useContext(Qe),g=Fn(),v=In(s,{relative:l}),b=o.toLowerCase()===`get`?`get`:`post`,x=typeof s==`string`&&y.test(s);return _.createElement(`form`,{ref:m,method:b,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?_.startTransition(()=>p()):p()},...p,"data-discover":!x&&e===`render`?`true`:void 0})});On.displayName=`Form`;function kn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function An(e){let t=_.useContext(Ge);return T(t,kn(e)),t}function jn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=ft(),d=lt(),f=mt(e,{relative:o});return _.useCallback(p=>{if(qt(p,t)){p.preventDefault();let t=n===void 0?k(d)===k(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?_.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Mn(e){E(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=_.useRef(Jt(e)),n=_.useRef(!1),r=lt(),i=_.useMemo(()=>Yt(r.search,n.current?null:t.current),[r.search]),a=ft();return[i,_.useCallback((e,t)=>{let r=Jt(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Nn=0,Pn=()=>`__${String(++Nn)}__`;function Fn(){let{router:e}=An(`useSubmit`),{basename:t}=_.useContext(Qe),n=kt(),r=e.fetch,i=e.navigate;return _.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=en(e,t);if(a.navigate===!1){let e=a.fetcherKey||Pn();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function In(e,{relative:t}={}){let{basename:n}=_.useContext(Qe),r=_.useContext(et);T(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...mt(e||`.`,{relative:t})},o=lt();if(e==null){a.search=o.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?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:F([n,a.pathname])),k(a)}function Ln(e,{relative:t}={}){let n=_.useContext(Ye);T(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=An(`useViewTransitionState`),i=mt(e,{relative:t});if(!n.isTransitioning)return!1;let a=be(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=be(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ge(i.pathname,o)!=null||ge(i.pathname,a)!=null}var I=localStorage.getItem(`TOTAL_RECALL_API_BASE`)||``;function Rn(){return I}function zn(e){I=e,localStorage.setItem(`TOTAL_RECALL_API_BASE`,e),window.location.reload()}var Bn=null;function Vn(e){Bn=e}async function L(e,t={}){let n=localStorage.getItem(`total-recall-active-brain`),r=new Headers(t.headers||{});n&&r.set(`x-total-recall-brain`,n);let i=await fetch(e,{credentials:`include`,...t,headers:r});return i.status===401&&Bn?.(),i}async function Hn(e){let t=await L(I+e);if(!t.ok)throw Error(`GET ${e} failed: ${t.status}`);return t.json()}async function Un(e,t){let n=await L(I+e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw Error(`POST ${e} failed: ${n.status}`);return n.json()}async function Wn(e){let t=await L(I+e,{method:`DELETE`});if(!t.ok)throw Error(`DELETE ${e} failed: ${t.status}`);return t.json()}async function Gn(){try{return(await fetch(I+`/auth/me`,{credentials:`include`})).ok}catch{return!1}}async function Kn(e){try{let t=await fetch(I+`/auth/login`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({password:e})}),n=await t.json().catch(()=>({}));return t.ok?{ok:!0,requiresPasswordReset:n.requiresPasswordReset}:{ok:!1,error:n.error||`Invalid password`}}catch{return{ok:!1,error:`Network error — is the server running?`}}}async function qn(e){try{let t=await fetch(I+`/auth/change-password`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({newPassword:e})});return t.ok?{ok:!0}:{ok:!1,error:(await t.json().catch(()=>({}))).error||`Failed to change password`}}catch{return{ok:!1,error:`Network error`}}}async function Jn(){try{let e=await fetch(I+`/auth/status`);return e.ok?await e.json():{configured:!0}}catch{return{configured:!0}}}async function Yn(e){try{let t=await fetch(I+`/auth/setup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({newPassword:e})}),n=await t.json().catch(()=>({}));return t.ok?{ok:!0}:{ok:!1,error:n.error||`Failed to setup password`}}catch{return{ok:!1,error:`Network error — is the server running?`}}}async function Xn(){await fetch(I+`/auth/logout`,{method:`POST`,credentials:`include`}).catch(()=>{})}async function Zn(){try{let e=await fetch(I+`/auth/providers`,{credentials:`include`});return e.ok?await e.json():{password:{configured:!0},passkey:{enabled:!1,has_passkeys:!1,count:0},google:{configured:!1,client_id:null}}}catch{return{password:{configured:!0},passkey:{enabled:!1,has_passkeys:!1,count:0},google:{configured:!1,client_id:null}}}}async function Qn(){let e=await fetch(I+`/auth/passkey/options`,{method:`POST`,credentials:`include`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||`Failed to start passkey login`)}return e.json()}async function $n(e){try{let t=await fetch(I+`/auth/passkey/verify`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({response:e})}),n=await t.json().catch(()=>({}));return t.ok?{ok:!0}:{ok:!1,error:n.error||`Passkey verification failed`}}catch{return{ok:!1,error:`Network error during passkey verification`}}}async function er(e,t,n,r,i,a){let o={"Content-Type":`application/json`};n&&(o[`x-session-id`]=n);let s=await L(I+`/v1/chat/completions`,{method:`POST`,signal:t,headers:o,body:JSON.stringify({messages:e,groundingNodes:r,model:i,brainId:a})});if(!s.ok)throw Error(`Chat API error: ${s.status}`);return(await s.json()).choices?.[0]?.message?.content||`(empty response)`}async function tr(e){let t={};e&&(t[`x-session-id`]=e);let n=await L(I+`/v1/chat/history`,{headers:t});if(!n.ok)throw Error(`Chat history error: ${n.status}`);return(await n.json()).messages??[]}async function nr(){let e=await L(I+`/v1/chat/threads`);if(!e.ok)throw Error(`Chat threads list error: ${e.status}`);return e.json()}async function rr(e){let t=await L(I+`/v1/chat/threads/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Delete chat thread error: ${t.status}`);return t.json()}async function ir(){try{let e=await L(I+`/api/tts/status`);return e.ok?e.json():{enabled:!1}}catch{return{enabled:!1}}}async function ar(e){let t=await L(I+`/api/tts`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:e})});if(t.status===503)return null;if(!t.ok)throw Error(`TTS error: ${t.status}`);return t.blob()}async function or(e,t,n){let r=new URLSearchParams;if(t&&r.set(`category`,t),n&&r.set(`status`,n),!e){let e=await L(`${I}/api/memory?${r}`);if(!e.ok)throw Error(`Memory API error: ${e.status}`);let t=await e.json();return Array.isArray(t)?t:t.nodes||[]}let i=e.split(`,`),a=i.map(async e=>{let t=e===`global`?`${I}/api/memory?${r}`:`${I}/api/brains/${e}/nodes?${r}`;try{let e=await L(t);if(!e.ok)return[];let n=await e.json();return Array.isArray(n)?n:n.nodes||[]}catch{return[]}}),o=await Promise.all(a),s=[],c=new Set,l=o.map((e,t)=>({nodes:e,id:i[t]})).sort((e,t)=>e.id===`global`?1:t.id===`global`?-1:0);for(let{nodes:e}of l)for(let t of e)c.has(t.slug)||(c.add(t.slug),s.push(t));return s}async function sr(e,t){let n=new URLSearchParams({q:e});t&&n.set(`category`,t);let r=await L(`${I}/api/memory?${n}`);if(!r.ok)throw Error(`Memory API error: ${r.status}`);let i=await r.json();return Array.isArray(i)?i:i.nodes||[]}async function cr(e,t){let n=new URLSearchParams;t&&n.set(`brain`,t);let r=n.toString(),i=await L(`${I}/api/memory/${encodeURIComponent(e)}${r?`?${r}`:``}`);if(i.status===404)return null;if(!i.ok)throw Error(`Memory API error: ${i.status}`);return i.json()}async function lr(e,t,n){let r=new URLSearchParams;n&&r.set(`brain`,n);let i=r.toString(),a=await L(`${I}/api/memory/${encodeURIComponent(e)}${i?`?${i}`:``}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!a.ok)throw Error(`Failed to save memory: ${a.status}`);return a.json()}async function ur(e,t){let n=new URLSearchParams;t&&n.set(`brain`,t);let r=n.toString(),i=await L(`${I}/api/memory${r?`?${r}`:``}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!i.ok)throw Error(`Failed to create memory: ${i.status}`);return i.json()}async function dr(e,t){let n=new URLSearchParams;t&&n.set(`brain`,t);let r=n.toString(),i=await L(`${I}/api/memory/${encodeURIComponent(e)}${r?`?${r}`:``}`,{method:`DELETE`});if(!i.ok)throw Error(`Failed to delete memory: ${i.status}`)}async function fr(){let e=await L(`${I}/api/conflicts`);if(!e.ok)throw Error(`Conflicts API error: ${e.status}`);return e.json()}async function pr(e,t,n){let r=await L(`${I}/api/conflicts/resolve`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({conflict_id:e,action:t,winner_slug:n})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error||`Conflict resolution API error: ${r.status}`)}return r.json()}async function mr(e,t=5e3){try{let n=await L(`${I}/api/sandbox`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({code:e,timeout_ms:t})});if(!n.ok)throw Error(`Sandbox API error: ${n.status}`);let r=await n.json();return{success:r.success,output:r.output||`(no output)`,isError:!r.success}}catch(e){return{success:!1,output:e.message,isError:!0}}}async function hr(){let e=await L(I+`/api/skills`);if(!e.ok)throw Error(`Skills API error: ${e.status}`);return e.json()}async function gr(e,t){let n=t?`?repo=${encodeURIComponent(t)}`:``,r=await L(`${I}/api/skills/${encodeURIComponent(e)}${n}`);if(!r.ok)throw Error(`Skill fetch API error: ${r.status}`);return r.json()}async function _r(e,t,n){let r=new URLSearchParams({dir:t});n&&r.set(`repo`,n);let i=await L(`${I}/api/skills/${encodeURIComponent(e)}/files?${r}`);if(!i.ok)throw Error(`Skill files fetch API error: ${i.status}`);return i.json()}async function vr(e,t,n){let r=n?`?repo=${encodeURIComponent(n)}`:``,i=await L(`${I}/api/skills/${encodeURIComponent(e)}${r}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:t,repo:n})});if(!i.ok)throw Error(`Skill save API error: ${i.status}`)}async function yr(e,t){let n=t?`?repo=${encodeURIComponent(t)}`:``,r=await L(`${I}/api/skills/${encodeURIComponent(e)}${n}`,{method:`DELETE`});if(!r.ok)throw Error(`Skill delete API error: ${r.status}`)}async function br(e){let t=new URLSearchParams({q:e}),n=await L(`${I}/api/skills/search?${t}`);if(!n.ok)throw Error(`Registry search API error: ${n.status}`);return n.json()}async function xr(e){let t=await L(`${I}/api/skills/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pkg:e})});if(!t.ok)throw Error(`Registry installation API error: ${t.status}`);return t.json()}async function Sr(e,t,n){let r=await L(`${I}/api/skills/toggle`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({skillName:e,targetRepo:t,enabled:n})});if(!r.ok)throw Error(`API error: ${r.status}`);return r.json()}async function Cr(e,t){let n=await L(`${I}/api/skills/preview`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({skillName:e,targetRepo:t})});if(!n.ok)throw Error(`API error: ${n.status}`);return n.json()}async function wr(e,t){let n=await L(`${I}/api/skills/audit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({skillName:e,repoPath:t})});if(!n.ok)throw Error(`API error: ${n.status}`);return n.json()}async function Tr(e,t){let n=await L(`${I}/api/skills/generate-expert`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({repoPath:e,force:t})});if(!n.ok)throw Error(`API error: ${n.status}`);return n.json()}async function Er(){let e=await L(`${I}/api/keys`);if(!e.ok)throw Error(`Keys API error: ${e.status}`);let t=await e.json();return Array.isArray(t)?{keys:t,available_scopes:[`*`]}:{keys:t.keys||[],available_scopes:t.available_scopes||[`*`]}}async function Dr(e,t,n){let r=await L(`${I}/api/keys`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,scopes:t,expires_at:n||null})});if(!r.ok)throw Error(`Keys API error: ${r.status}`);return r.json()}async function Or(e){let t=await L(`${I}/api/keys/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Keys API error: ${t.status}`)}async function kr(){let e=await L(`${I}/api/secrets/scan-env`);if(!e.ok)throw Error(`Env scan failed: ${e.status}`);return e.json()}async function Ar(e){let t=await L(`${I}/api/secrets/parse-env`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||`Parse failed: ${t.status}`)}return t.json()}async function jr(e){let t=await L(`${I}/api/secrets/import-env`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||`Import failed: ${t.status}`)}return t.json()}async function Mr(e){let t=new URLSearchParams;e&&t.set(`status`,e);let n=await L(`${I}/api/research?${t}`);if(!n.ok)throw Error(`Research API error: ${n.status}`);return n.json()}async function Nr(e,t,n){let r=await L(`${I}/api/research`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({topic:e,priority:t,notes:n})});if(!r.ok)throw Error(`Research API error: ${r.status}`);return r.json()}async function Pr(e,t){let n=await L(`${I}/api/research/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw Error(`Research PATCH error: ${n.status}`);return n.json()}async function Fr(e){let t=await L(`${I}/api/research/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Research DELETE error: ${t.status}`)}async function Ir(){let e=await L(I+`/health`);if(!e.ok)throw Error(`Health API error: ${e.status}`);return e.json()}async function Lr(e){let t=await L(`${I}/api/logs/${e}`);if(!t.ok)throw Error(`Logs API error: ${t.status}`);return t.json()}async function Rr(){let e=await L(`${I}/api/vault/compile`,{method:`POST`});if(!e.ok)throw Error(`Recompile API error: ${e.status}`);return e.json()}async function zr(){let e=await L(`${I}/api/diagnostics/agents`,{method:`POST`});if(!e.ok)throw Error(`Diagnostics API error: ${e.status}`);return e.json()}async function Br(){let e=await L(`${I}/api/daemon/restart`,{method:`POST`});if(!e.ok)throw Error(`Restart daemon API error: ${e.status}`);return e.json()}async function Vr(){let e=await L(`${I}/api/server/restart`,{method:`POST`}),t=await e.json().catch(()=>({}));if(!e.ok&&e.status!==409)throw Error(t.message||t.error||`Restart server API error: ${e.status}`);return{success:!!t.success,scheduled:!!t.scheduled,message:t.message||(t.scheduled?`Server restarting.`:`Server did not restart.`),supervisor:t.supervisor}}async function Hr(){let e=await L(I+`/api/tasks`);if(!e.ok)throw Error(`Tasks API error: ${e.status}`);return e.json()}async function Ur(e,t,n,r){let i=await L(I+`/api/tasks`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({category:e,target:t,body:n,priority:r})});if(!i.ok)throw Error(`Tasks API error: ${i.status}`);return i.json()}async function Wr(e){let t=await L(`${I}/api/share`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(`Share API error: ${t.status}`);return t.json()}async function Gr(){let e=await L(`${I}/api/update/check`);if(!e.ok)throw Error(`Check update API error: ${e.status}`);let t=await e.json();return{currentVersion:t.currentVersion??t.current??``,latestVersion:t.latestVersion??t.latest??``,updateAvailable:!!(t.updateAvailable??t.update_available),versionStatus:t.versionStatus??t.version_status,previewFeatures:!!(t.previewFeatures??t.version_status===`preview_features`),consumerUpdatesAvailable:!!(t.consumerUpdatesAvailable??t.consumers_behind>0),consumersBehind:Number(t.consumers_behind||0)}}async function Kr(){let e=await L(`${I}/api/update/run`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({force:!0})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||t.message||`Run update API error: ${e.status}`);let n=Number(t.summary?.failed??0),r=typeof t.success==`boolean`?t.success:n===0&&t.summary?.skipped!==!0;return{success:r,message:t.message||(r?`Package auto-update finished`:`Package auto-update failed`),restart:t.restart?{required:!!t.restart.required,scheduled:!!t.restart.scheduled,reason:String(t.restart.reason??``)}:void 0,summary:t.summary}}async function qr(){let e=await L(`${I}/api/gemini-models?t=${Date.now()}`);if(!e.ok)throw Error(`Gemini models API error: ${e.status}`);return(await e.json()).models??[]}async function Jr(){let e=await L(`${I}/api/help`);if(!e.ok)throw Error(`Failed to load help topics`);return e.json()}async function Yr(e){let t=await L(`${I}/api/help?topic=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`Failed to load help content`);return t.json()}async function Xr(){let e=await L(`${I}/api/extension/status`);return e.ok?e.json():{available:!1,connected:!1}}async function Zr(e=50,t=0){let n=new URLSearchParams({limit:String(e),offset:String(t)}),r=await L(`${I}/api/sessions?${n}`);if(!r.ok)throw Error(`Sessions API error: ${r.status}`);return r.json()}async function Qr(e){let t=await L(`${I}/api/sessions/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Failed to delete session: ${t.status}`)}async function $r(e,t){let n=await L(`${I}/api/integrations/connect`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({client:e,baseUrl:t})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||`Connection error: ${n.status}`)}return n.json()}async function ei(){let e=await L(`${I}/api/integrations/active`,{method:`GET`});if(!e.ok)throw Error(`Integrations API error: ${e.status}`);return e.json()}async function ti(){let e=await L(`${I}/api/config-json`);if(!e.ok){let t=`Config JSON API error: ${e.status}`;try{let n=await e.json();n?.error&&(t=n.error)}catch{}throw Error(t)}return e.json()}async function ni(e){let t=await L(`${I}/api/config-json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=`Config JSON API error: ${t.status}`;try{let n=await t.json();n?.error&&(e=n.error)}catch{}throw Error(e)}}async function ri(e){try{return await e.json()}catch{return{}}}async function ii(e,t,n=`POST`){try{let r=await L(e,{method:n,headers:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t)}),i=await ri(r);return r.ok?{success:!0,...i}:{success:!1,error:i.error||i.message||`Request failed (${r.status})`}}catch(e){return{success:!1,error:e?.message||`Network error`}}}async function ai(){try{let e=await L(`${I}/api/plugins`);if(!e.ok)return[];let t=await ri(e);return Array.isArray(t.plugins)?t.plugins:[]}catch{return[]}}async function oi(e){try{let t=await L(`${I}/api/plugins/${encodeURIComponent(e)}`);return t.ok&&(await ri(t)).plugin||null}catch{return null}}async function si(){try{let e=await L(`${I}/api/plugins/available`);if(!e.ok)return[];let t=await ri(e);return Array.isArray(t.plugins)?t.plugins:[]}catch{return[]}}async function ci(){try{let e=await L(`${I}/api/plugins/peers`);if(!e.ok)return null;let t=await ri(e);return{mesh:t.mesh||{available:!1,configured:!1},peers:Array.isArray(t.peers)?t.peers:[]}}catch{return null}}function li(e){return ii(`${I}/api/plugins/install`,e)}function ui(e,t=!1){return ii(`${I}/api/plugins/${encodeURIComponent(e)}${t?`?global=true`:``}`,void 0,`DELETE`)}function di(e,t){return ii(`${I}/api/plugins/${encodeURIComponent(e)}/share`,{shared:t})}function fi(e,t){return ii(`${I}/api/plugins/${encodeURIComponent(e)}/branding`,{branding:t})}function pi(e,t){return ii(`${I}/api/plugins/${encodeURIComponent(e)}/lock`,{locked:t})}function mi(e,t){return ii(`${I}/api/plugins/${encodeURIComponent(e)}/activation`,{enabled:t},`PUT`)}function hi(e,t=!0){return ii(`${I}/api/plugins/${encodeURIComponent(e)}/deploy-store`,{autoLock:t})}async function gi(e,t=``,n=[],r){let i=await ii(`${I}/api/plugins/${encodeURIComponent(e)}/run`,{subcommand:t,args:n,...r||{}});return i.error?{success:!1,error:i.error}:{success:!!i.ok,output:i.output||``,exitCode:i.exitCode,timedOut:i.timedOut}}async function _i(e){try{let t=await L(`${I}/api/plugins/${encodeURIComponent(e)}/readme`);return t.ok&&(await ri(t)).readme||``}catch{return``}}function vi(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function yi(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function bi(){return xi.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var xi={stubThis:e=>e};function Si(e){let{id:t}=e;return{...e,id:yi(t),transports:e.transports}}function Ci(e){return e===`localhost`||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var wi=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}},Ti=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},Ei=[`cross-platform`,`platform`];function Di(e){if(e&&!(Ei.indexOf(e)<0))return e}function Oi(){if(!bi())return ki.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?ki.stubThis(new Promise(e=>e(!1))):ki.stubThis(e.isConditionalMediationAvailable())}var ki={stubThis:e=>e};function Ai({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new wi({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new wi({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!Ci(t))return new wi({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new wi({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new wi({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function ji(e){!e.optionsJSON&&e.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!bi())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(Si));let a={...t,challenge:yi(t.challenge),allowCredentials:i},o={};if(n){if(!await Oi())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=Ti.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw Ai({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=vi(u.userHandle)),{id:c,rawId:vi(l),response:{authenticatorData:vi(u.authenticatorData),clientDataJSON:vi(u.clientDataJSON),signature:vi(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:Di(s.authenticatorAttachment)}}var Mi=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),R=o(((e,t)=>{t.exports=Mi()}))();function Ni({size:e=42,className:t=``,alt:n=`Total Recall Animated Mark`}){let r={width:e,height:e,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,perspective:800};return(0,R.jsx)(`div`,{className:`animated-brand-mark ${t}`,style:r,title:n,children:(0,R.jsxs)(`svg`,{viewBox:`0 0 100 100`,width:e,height:e,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{overflow:`visible`},children:[(0,R.jsxs)(`defs`,{children:[(0,R.jsxs)(`filter`,{id:`tr-glow`,x:`-20%`,y:`-20%`,width:`140%`,height:`140%`,children:[(0,R.jsx)(`feGaussianBlur`,{stdDeviation:`3`,result:`blur`}),(0,R.jsx)(`feComposite`,{in:`SourceGraphic`,in2:`blur`,operator:`over`})]}),(0,R.jsxs)(`linearGradient`,{id:`tr-top-facet`,x1:`50`,y1:`20`,x2:`80`,y2:`40`,gradientUnits:`userSpaceOnUse`,children:[(0,R.jsx)(`stop`,{offset:`0%`,stopColor:`#60a5fa`,stopOpacity:`0.95`}),(0,R.jsx)(`stop`,{offset:`100%`,stopColor:`#3b82f6`,stopOpacity:`0.8`})]}),(0,R.jsxs)(`linearGradient`,{id:`tr-left-facet`,x1:`20`,y1:`38`,x2:`50`,y2:`80`,gradientUnits:`userSpaceOnUse`,children:[(0,R.jsx)(`stop`,{offset:`0%`,stopColor:`#2563eb`,stopOpacity:`0.9`}),(0,R.jsx)(`stop`,{offset:`100%`,stopColor:`#1e3a8a`,stopOpacity:`0.85`})]}),(0,R.jsxs)(`linearGradient`,{id:`tr-right-facet`,x1:`80`,y1:`38`,x2:`50`,y2:`80`,gradientUnits:`userSpaceOnUse`,children:[(0,R.jsx)(`stop`,{offset:`0%`,stopColor:`#3b82f6`,stopOpacity:`0.85`}),(0,R.jsx)(`stop`,{offset:`100%`,stopColor:`#1d4ed8`,stopOpacity:`0.95`})]}),(0,R.jsxs)(`linearGradient`,{id:`tr-orbit-ring`,x1:`10`,y1:`50`,x2:`90`,y2:`50`,gradientUnits:`userSpaceOnUse`,children:[(0,R.jsx)(`stop`,{offset:`0%`,stopColor:`#38bdf8`,stopOpacity:`0.1`}),(0,R.jsx)(`stop`,{offset:`50%`,stopColor:`#60a5fa`,stopOpacity:`0.7`}),(0,R.jsx)(`stop`,{offset:`100%`,stopColor:`#818cf8`,stopOpacity:`0.1`})]})]}),(0,R.jsx)(`style`,{children:`
|
|
11
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=lt(),d;if(t){let e=typeof t==`string`?te(t):t;T(c===`/`||e.pathname?.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 "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):M(e,{pathname:p});E(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),E(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.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 h=Ct(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:F([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:F([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?_.createElement($e.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function _t(){let e=At(),t=Me(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=_.createElement(_.Fragment,null,_.createElement(`p`,null,`💿 Hey developer 👋`),_.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,_.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,_.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),_.createElement(_.Fragment,null,_.createElement(`h2`,null,`Unexpected Application Error!`),_.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?_.createElement(`pre`,{style:i},n):null,o)}var vt=_.createElement(_t,null),yt=class extends _.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||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.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&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=ot(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:_.createElement(et.Provider,{value:this.props.routeContext},_.createElement(tt.Provider,{value:e,children:this.props.component}));return this.context?_.createElement(xt,{error:e},t):t}};yt.contextType=qe;var bt=new WeakMap;function xt({children:e,error:t}){let{basename:n,navigator:r}=_.useContext(Qe);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=at(t.digest);if(e){let i=bt.get(t);if(i)throw i;let a=Fe(e.location,n),o=a.absoluteURL||a.to;if(Be(e.location,o,Le(r),`allow-explicit`),We(o))throw Error(`Invalid redirect location`);if(Pe&&!bt.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw bt.set(t,n),n}}return _.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function St({routeContext:e,match:t,children:n}){let r=_.useContext(Ge);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(et.Provider,{value:e},n)}function Ct(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);T(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ne(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||vt,o&&(s<0&&c===0?(Nt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?_.createElement(n.route.Component,null):n.route.element?n.route.element:e,_.createElement(St,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?_.createElement(yt,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function wt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Tt(e){let t=_.useContext(Ge);return T(t,wt(e)),t}function Et(e){let t=_.useContext(Ke);return T(t,wt(e)),t}function Dt(e){let t=_.useContext(et);return T(t,wt(e)),t}function Ot(e){let t=Dt(e),n=t.matches[t.matches.length-1];return T(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function kt(){return Ot(`useRouteId`)}function At(){let e=_.useContext(tt),t=Et(`useRouteError`),n=Ot(`useRouteError`);return e===void 0?t.errors?.[n]:e}function jt(){let{router:e}=Tt(`useNavigate`),t=Ot(`useNavigate`),n=_.useRef(!1);return dt(()=>{n.current=!0}),_.useCallback(async(r,i={})=>{E(n.current,ut),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Mt={};function Nt(e,t,n){!t&&!Mt[e]&&(Mt[e]=!0,E(!1,n))}_.memo(Pt);function Pt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return gt(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Ft({to:e,replace:t,state:n,relative:r}){T(ct(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=_.useContext(Qe);E(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=_.useContext(et),{pathname:s}=lt(),c=ft(),l=Te(e,we(o),s,r===`path`);Be(typeof e==`string`?e:k(e),a.createHref(l),Le(a),`reject`);let u=JSON.stringify(l);return _.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function It(e){T(!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 Lt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){T(!ct(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=_.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=te(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=_.useMemo(()=>{let e=be(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return E(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:_.createElement(Qe.Provider,{value:c},_.createElement($e.Provider,{children:t,value:h}))}function Rt({children:e,location:t}){return ht(zt(e),t)}_.Component;function zt(e,t=[]){let n=[];return _.Children.forEach(e,(e,r)=>{if(!_.isValidElement(e))return;let i=[...t,r];if(e.type===_.Fragment){n.push.apply(n,zt(e.props.children,i));return}T(e.type===It,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),T(!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:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=zt(e.props.children,i)),n.push(a)}),n}var Bt=`get`,Vt=`application/x-www-form-urlencoded`;function Ht(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Ut(e){return Ht(e)&&e.tagName.toLowerCase()===`button`}function Wt(e){return Ht(e)&&e.tagName.toLowerCase()===`form`}function Gt(e){return Ht(e)&&e.tagName.toLowerCase()===`input`}function Kt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qt(e,t){return e.button===0&&(!t||t===`_self`)&&!Kt(e)}function Jt(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Yt(e,t){let n=Jt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Xt=null;function Zt(){if(Xt===null)try{new FormData(document.createElement(`form`),0),Xt=!1}catch{Xt=!0}return Xt}var Qt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function $t(e){return e!=null&&!Qt.has(e)?(E(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Vt}"`),null):e}function en(e,t){let n,r,i,a,o;if(Wt(e)){let o=e.getAttribute(`action`);r=o?be(o,t):null,n=e.getAttribute(`method`)||Bt,i=$t(e.getAttribute(`enctype`))||Vt,a=new FormData(e)}else if(Ut(e)||Gt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?be(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Bt,i=$t(e.getAttribute(`formenctype`))||$t(o.getAttribute(`enctype`))||Vt,a=new FormData(o,e),!Zt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Ht(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Bt,r=null,i=Vt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function tn(e,t){if(e===!1||e==null)throw Error(t)}function nn(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&be(i.pathname,t)===`/`?`${De(t)}/_root.${r}`:`${De(i.pathname)}.${r}`,i}async function rn(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(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function an(e){return e!=null&&typeof e.page==`string`}function on(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function sn(e,t,n){return fn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await rn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(on).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function cn(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function ln(e,t,{includeHydrateFallback:n}={}){return un(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function un(e){return[...new Set(e)]}function dn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function fn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!an(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(dn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function pn(){let e=_.useContext(Ge);return tn(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function mn(){let e=_.useContext(Ke);return tn(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var hn=_.createContext(void 0);hn.displayName=`FrameworkContext`;function gn(){let e=_.useContext(hn);return tn(e,`You must render this element inside a <HydratedRouter> element`),e}function _n(e,t){let n=_.useContext(hn),[r,i]=_.useState(!1),[a,o]=_.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=_.useRef(null);_.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),_.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:vn(s,p),onBlur:vn(c,m),onMouseEnter:vn(l,p),onMouseLeave:vn(u,m),onTouchStart:vn(d,p)}]:[a,f,{}]:[!1,f,{}]}function vn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function yn({page:e,...t}){let n=Je(),{nonce:r}=gn(),{router:i}=pn(),a=_.useMemo(()=>M(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?_.createElement(xn,{page:e,matches:a,...t}):_.createElement(Sn,{page:e,matches:a,...t})):null}function bn(e){let{manifest:t,routeModules:n}=gn(),[r,i]=_.useState([]);return _.useEffect(()=>{let r=!1;return sn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function xn({page:e,matches:t,...n}){let r=lt(),{future:i}=gn(),{basename:a}=pn(),o=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=nn(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return _.createElement(_.Fragment,null,o.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Sn({page:e,matches:t,...n}){let r=lt(),{future:i,manifest:a,routeModules:o}=gn(),{basename:s}=pn(),{loaderData:c,matches:l}=mn(),u=_.useMemo(()=>cn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=_.useMemo(()=>cn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=nn(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=_.useMemo(()=>ln(d,a),[d,a]),m=bn(d);return _.createElement(_.Fragment,null,f.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>_.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>_.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Cn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}_.Component;var wn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{wn&&(window.__reactRouterVersion=`7.18.4`)}catch{}function Tn({basename:e,children:t,useTransitions:n,window:r}){let i=_.useRef();i.current??=w({window:r,v5Compat:!0});let a=i.current,[o,s]=_.useState({action:a.action,location:a.location}),c=_.useCallback(e=>{n===!1?s(e):_.startTransition(()=>s(e))},[n]);return _.useLayoutEffect(()=>a.listen(c),[a,c]),_.createElement(Lt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var En=_.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:v}=_.useContext(Qe),b=typeof l==`string`&&y.test(l),x=Fe(l,h);l=x.to;let S=st(l,{relative:r}),C=lt(),w=null;if(o){let e=Te(o,[],C.mask?C.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:F([h,e.pathname])),w=g.createHref(e)}let[T,E,D]=_n(n,p),O=jn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:v});function ee(t){e&&e(t),t.defaultPrevented||O(t)}let k=!(x.isExternal||i),te=_.createElement(`a`,{...p,...D,href:(k?w:void 0)||x.absoluteURL||S,onClick:k?ee:e,ref:Cn(m,E),target:c,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?_.createElement(_.Fragment,null,te,_.createElement(yn,{page:S})):te});En.displayName=`Link`;var Dn=_.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=mt(a,{relative:c.relative}),d=lt(),f=_.useContext(Ke),{navigator:p,basename:m}=_.useContext(Qe),h=f!=null&&Ln(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=be(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=v===g||!r&&v.startsWith(g)&&v.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return _.createElement(En,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Dn.displayName=`NavLink`;var On=_.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Bt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=_.useContext(Qe),g=Fn(),v=In(s,{relative:l}),b=o.toLowerCase()===`get`?`get`:`post`,x=typeof s==`string`&&y.test(s);return _.createElement(`form`,{ref:m,method:b,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?_.startTransition(()=>p()):p()},...p,"data-discover":!x&&e===`render`?`true`:void 0})});On.displayName=`Form`;function kn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function An(e){let t=_.useContext(Ge);return T(t,kn(e)),t}function jn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=ft(),d=lt(),f=mt(e,{relative:o});return _.useCallback(p=>{if(qt(p,t)){p.preventDefault();let t=n===void 0?k(d)===k(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?_.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Mn(e){E(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=_.useRef(Jt(e)),n=_.useRef(!1),r=lt(),i=_.useMemo(()=>Yt(r.search,n.current?null:t.current),[r.search]),a=ft();return[i,_.useCallback((e,t)=>{let r=Jt(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Nn=0,Pn=()=>`__${String(++Nn)}__`;function Fn(){let{router:e}=An(`useSubmit`),{basename:t}=_.useContext(Qe),n=kt(),r=e.fetch,i=e.navigate;return _.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=en(e,t);if(a.navigate===!1){let e=a.fetcherKey||Pn();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function In(e,{relative:t}={}){let{basename:n}=_.useContext(Qe),r=_.useContext(et);T(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...mt(e||`.`,{relative:t})},o=lt();if(e==null){a.search=o.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?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:F([n,a.pathname])),k(a)}function Ln(e,{relative:t}={}){let n=_.useContext(Ye);T(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=An(`useViewTransitionState`),i=mt(e,{relative:t});if(!n.isTransitioning)return!1;let a=be(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=be(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ge(i.pathname,o)!=null||ge(i.pathname,a)!=null}var I=localStorage.getItem(`TOTAL_RECALL_API_BASE`)||``;function Rn(){return I}function zn(e){I=e,localStorage.setItem(`TOTAL_RECALL_API_BASE`,e),window.location.reload()}var Bn=null;function Vn(e){Bn=e}async function L(e,t={}){let n=localStorage.getItem(`total-recall-active-brain`),r=new Headers(t.headers||{});n&&r.set(`x-total-recall-brain`,n);let i=await fetch(e,{credentials:`include`,...t,headers:r});return i.status===401&&Bn?.(),i}async function Hn(e){let t=await L(I+e);if(!t.ok)throw Error(`GET ${e} failed: ${t.status}`);return t.json()}async function Un(e,t){let n=await L(I+e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw Error(`POST ${e} failed: ${n.status}`);return n.json()}async function Wn(e){let t=await L(I+e,{method:`DELETE`});if(!t.ok)throw Error(`DELETE ${e} failed: ${t.status}`);return t.json()}async function Gn(){try{return(await fetch(I+`/auth/me`,{credentials:`include`})).ok}catch{return!1}}async function Kn(e){try{let t=await fetch(I+`/auth/login`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({password:e})}),n=await t.json().catch(()=>({}));return t.ok?{ok:!0,requiresPasswordReset:n.requiresPasswordReset}:{ok:!1,error:n.error||`Invalid password`}}catch{return{ok:!1,error:`Network error — is the server running?`}}}async function qn(e){try{let t=await fetch(I+`/auth/change-password`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({newPassword:e})});return t.ok?{ok:!0}:{ok:!1,error:(await t.json().catch(()=>({}))).error||`Failed to change password`}}catch{return{ok:!1,error:`Network error`}}}async function Jn(){try{let e=await fetch(I+`/auth/status`);return e.ok?await e.json():{configured:!0}}catch{return{configured:!0}}}async function Yn(e){try{let t=await fetch(I+`/auth/setup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({newPassword:e})}),n=await t.json().catch(()=>({}));return t.ok?{ok:!0}:{ok:!1,error:n.error||`Failed to setup password`}}catch{return{ok:!1,error:`Network error — is the server running?`}}}async function Xn(){await fetch(I+`/auth/logout`,{method:`POST`,credentials:`include`}).catch(()=>{})}async function Zn(){try{let e=await fetch(I+`/auth/providers`,{credentials:`include`});return e.ok?await e.json():{password:{configured:!0},passkey:{enabled:!1,has_passkeys:!1,count:0}}}catch{return{password:{configured:!0},passkey:{enabled:!1,has_passkeys:!1,count:0}}}}async function Qn(){let e=await fetch(I+`/auth/passkey/options`,{method:`POST`,credentials:`include`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||`Failed to start passkey login`)}return e.json()}async function $n(e){try{let t=await fetch(I+`/auth/passkey/verify`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({response:e})}),n=await t.json().catch(()=>({}));return t.ok?{ok:!0}:{ok:!1,error:n.error||`Passkey verification failed`}}catch{return{ok:!1,error:`Network error during passkey verification`}}}async function er(e,t,n,r,i,a){let o={"Content-Type":`application/json`};n&&(o[`x-session-id`]=n);let s=await L(I+`/v1/chat/completions`,{method:`POST`,signal:t,headers:o,body:JSON.stringify({messages:e,groundingNodes:r,model:i,brainId:a})});if(!s.ok)throw Error(`Chat API error: ${s.status}`);return(await s.json()).choices?.[0]?.message?.content||`(empty response)`}async function tr(e){let t={};e&&(t[`x-session-id`]=e);let n=await L(I+`/v1/chat/history`,{headers:t});if(!n.ok)throw Error(`Chat history error: ${n.status}`);return(await n.json()).messages??[]}async function nr(){let e=await L(I+`/v1/chat/threads`);if(!e.ok)throw Error(`Chat threads list error: ${e.status}`);return e.json()}async function rr(e){let t=await L(I+`/v1/chat/threads/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Delete chat thread error: ${t.status}`);return t.json()}async function ir(){try{let e=await L(I+`/api/tts/status`);return e.ok?e.json():{enabled:!1}}catch{return{enabled:!1}}}async function ar(e){let t=await L(I+`/api/tts`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:e})});if(t.status===503)return null;if(!t.ok)throw Error(`TTS error: ${t.status}`);return t.blob()}async function or(e,t,n){let r=new URLSearchParams;if(t&&r.set(`category`,t),n&&r.set(`status`,n),!e){let e=await L(`${I}/api/memory?${r}`);if(!e.ok)throw Error(`Memory API error: ${e.status}`);let t=await e.json();return Array.isArray(t)?t:t.nodes||[]}let i=e.split(`,`),a=i.map(async e=>{let t=e===`global`?`${I}/api/memory?${r}`:`${I}/api/brains/${e}/nodes?${r}`;try{let e=await L(t);if(!e.ok)return[];let n=await e.json();return Array.isArray(n)?n:n.nodes||[]}catch{return[]}}),o=await Promise.all(a),s=[],c=new Set,l=o.map((e,t)=>({nodes:e,id:i[t]})).sort((e,t)=>e.id===`global`?1:t.id===`global`?-1:0);for(let{nodes:e}of l)for(let t of e)c.has(t.slug)||(c.add(t.slug),s.push(t));return s}async function sr(e,t){let n=new URLSearchParams({q:e});t&&n.set(`category`,t);let r=await L(`${I}/api/memory?${n}`);if(!r.ok)throw Error(`Memory API error: ${r.status}`);let i=await r.json();return Array.isArray(i)?i:i.nodes||[]}async function cr(e,t){let n=new URLSearchParams;t&&n.set(`brain`,t);let r=n.toString(),i=await L(`${I}/api/memory/${encodeURIComponent(e)}${r?`?${r}`:``}`);if(i.status===404)return null;if(!i.ok)throw Error(`Memory API error: ${i.status}`);return i.json()}async function lr(e,t,n){let r=new URLSearchParams;n&&r.set(`brain`,n);let i=r.toString(),a=await L(`${I}/api/memory/${encodeURIComponent(e)}${i?`?${i}`:``}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!a.ok)throw Error(`Failed to save memory: ${a.status}`);return a.json()}async function ur(e,t){let n=new URLSearchParams;t&&n.set(`brain`,t);let r=n.toString(),i=await L(`${I}/api/memory${r?`?${r}`:``}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!i.ok)throw Error(`Failed to create memory: ${i.status}`);return i.json()}async function dr(e,t){let n=new URLSearchParams;t&&n.set(`brain`,t);let r=n.toString(),i=await L(`${I}/api/memory/${encodeURIComponent(e)}${r?`?${r}`:``}`,{method:`DELETE`});if(!i.ok)throw Error(`Failed to delete memory: ${i.status}`)}async function fr(){let e=await L(`${I}/api/conflicts`);if(!e.ok)throw Error(`Conflicts API error: ${e.status}`);return e.json()}async function pr(e,t,n){let r=await L(`${I}/api/conflicts/resolve`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({conflict_id:e,action:t,winner_slug:n})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error||`Conflict resolution API error: ${r.status}`)}return r.json()}async function mr(e,t=5e3){try{let n=await L(`${I}/api/sandbox`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({code:e,timeout_ms:t})});if(!n.ok)throw Error(`Sandbox API error: ${n.status}`);let r=await n.json();return{success:r.success,output:r.output||`(no output)`,isError:!r.success}}catch(e){return{success:!1,output:e.message,isError:!0}}}async function hr(){let e=await L(I+`/api/skills`);if(!e.ok)throw Error(`Skills API error: ${e.status}`);return e.json()}async function gr(e,t){let n=t?`?repo=${encodeURIComponent(t)}`:``,r=await L(`${I}/api/skills/${encodeURIComponent(e)}${n}`);if(!r.ok)throw Error(`Skill fetch API error: ${r.status}`);return r.json()}async function _r(e,t,n){let r=new URLSearchParams({dir:t});n&&r.set(`repo`,n);let i=await L(`${I}/api/skills/${encodeURIComponent(e)}/files?${r}`);if(!i.ok)throw Error(`Skill files fetch API error: ${i.status}`);return i.json()}async function vr(e,t,n){let r=n?`?repo=${encodeURIComponent(n)}`:``,i=await L(`${I}/api/skills/${encodeURIComponent(e)}${r}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:t,repo:n})});if(!i.ok)throw Error(`Skill save API error: ${i.status}`)}async function yr(e,t){let n=t?`?repo=${encodeURIComponent(t)}`:``,r=await L(`${I}/api/skills/${encodeURIComponent(e)}${n}`,{method:`DELETE`});if(!r.ok)throw Error(`Skill delete API error: ${r.status}`)}async function br(e){let t=new URLSearchParams({q:e}),n=await L(`${I}/api/skills/search?${t}`);if(!n.ok)throw Error(`Registry search API error: ${n.status}`);return n.json()}async function xr(e){let t=await L(`${I}/api/skills/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pkg:e})});if(!t.ok)throw Error(`Registry installation API error: ${t.status}`);return t.json()}async function Sr(e,t,n){let r=await L(`${I}/api/skills/toggle`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({skillName:e,targetRepo:t,enabled:n})});if(!r.ok)throw Error(`API error: ${r.status}`);return r.json()}async function Cr(e,t){let n=await L(`${I}/api/skills/preview`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({skillName:e,targetRepo:t})});if(!n.ok)throw Error(`API error: ${n.status}`);return n.json()}async function wr(e,t){let n=await L(`${I}/api/skills/audit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({skillName:e,repoPath:t})});if(!n.ok)throw Error(`API error: ${n.status}`);return n.json()}async function Tr(e,t){let n=await L(`${I}/api/skills/generate-expert`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({repoPath:e,force:t})});if(!n.ok)throw Error(`API error: ${n.status}`);return n.json()}async function Er(){let e=await L(`${I}/api/keys`);if(!e.ok)throw Error(`Keys API error: ${e.status}`);let t=await e.json();return Array.isArray(t)?{keys:t,available_scopes:[`*`]}:{keys:t.keys||[],available_scopes:t.available_scopes||[`*`]}}async function Dr(e,t,n){let r=await L(`${I}/api/keys`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,scopes:t,expires_at:n||null})});if(!r.ok)throw Error(`Keys API error: ${r.status}`);return r.json()}async function Or(e){let t=await L(`${I}/api/keys/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Keys API error: ${t.status}`)}async function kr(){let e=await L(`${I}/api/secrets/scan-env`);if(!e.ok)throw Error(`Env scan failed: ${e.status}`);return e.json()}async function Ar(e){let t=await L(`${I}/api/secrets/parse-env`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||`Parse failed: ${t.status}`)}return t.json()}async function jr(e){let t=await L(`${I}/api/secrets/import-env`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||`Import failed: ${t.status}`)}return t.json()}async function Mr(e){let t=new URLSearchParams;e&&t.set(`status`,e);let n=await L(`${I}/api/research?${t}`);if(!n.ok)throw Error(`Research API error: ${n.status}`);return n.json()}async function Nr(e,t,n){let r=await L(`${I}/api/research`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({topic:e,priority:t,notes:n})});if(!r.ok)throw Error(`Research API error: ${r.status}`);return r.json()}async function Pr(e,t){let n=await L(`${I}/api/research/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw Error(`Research PATCH error: ${n.status}`);return n.json()}async function Fr(e){let t=await L(`${I}/api/research/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Research DELETE error: ${t.status}`)}async function Ir(){let e=await L(I+`/health`);if(!e.ok)throw Error(`Health API error: ${e.status}`);return e.json()}async function Lr(e){let t=await L(`${I}/api/logs/${e}`);if(!t.ok)throw Error(`Logs API error: ${t.status}`);return t.json()}async function Rr(){let e=await L(`${I}/api/vault/compile`,{method:`POST`});if(!e.ok)throw Error(`Recompile API error: ${e.status}`);return e.json()}async function zr(){let e=await L(`${I}/api/diagnostics/agents`,{method:`POST`});if(!e.ok)throw Error(`Diagnostics API error: ${e.status}`);return e.json()}async function Br(){let e=await L(`${I}/api/daemon/restart`,{method:`POST`});if(!e.ok)throw Error(`Restart daemon API error: ${e.status}`);return e.json()}async function Vr(){let e=await L(`${I}/api/server/restart`,{method:`POST`}),t=await e.json().catch(()=>({}));if(!e.ok&&e.status!==409)throw Error(t.message||t.error||`Restart server API error: ${e.status}`);return{success:!!t.success,scheduled:!!t.scheduled,message:t.message||(t.scheduled?`Server restarting.`:`Server did not restart.`),supervisor:t.supervisor}}async function Hr(){let e=await L(I+`/api/tasks`);if(!e.ok)throw Error(`Tasks API error: ${e.status}`);return e.json()}async function Ur(e,t,n,r){let i=await L(I+`/api/tasks`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({category:e,target:t,body:n,priority:r})});if(!i.ok)throw Error(`Tasks API error: ${i.status}`);return i.json()}async function Wr(e){let t=await L(`${I}/api/share`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(`Share API error: ${t.status}`);return t.json()}async function Gr(){let e=await L(`${I}/api/update/check`);if(!e.ok)throw Error(`Check update API error: ${e.status}`);let t=await e.json();return{currentVersion:t.currentVersion??t.current??``,latestVersion:t.latestVersion??t.latest??``,updateAvailable:!!(t.updateAvailable??t.update_available),versionStatus:t.versionStatus??t.version_status,previewFeatures:!!(t.previewFeatures??t.version_status===`preview_features`),consumerUpdatesAvailable:!!(t.consumerUpdatesAvailable??t.consumers_behind>0),consumersBehind:Number(t.consumers_behind||0)}}async function Kr(){let e=await L(`${I}/api/update/run`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({force:!0})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||t.message||`Run update API error: ${e.status}`);let n=Number(t.summary?.failed??0),r=typeof t.success==`boolean`?t.success:n===0&&t.summary?.skipped!==!0;return{success:r,message:t.message||(r?`Package auto-update finished`:`Package auto-update failed`),restart:t.restart?{required:!!t.restart.required,scheduled:!!t.restart.scheduled,reason:String(t.restart.reason??``)}:void 0,summary:t.summary}}async function qr(){let e=await L(`${I}/api/gemini-models?t=${Date.now()}`);if(!e.ok)throw Error(`Gemini models API error: ${e.status}`);return(await e.json()).models??[]}async function Jr(){let e=await L(`${I}/api/help`);if(!e.ok)throw Error(`Failed to load help topics`);return e.json()}async function Yr(e){let t=await L(`${I}/api/help?topic=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`Failed to load help content`);return t.json()}async function Xr(){let e=await L(`${I}/api/extension/status`);return e.ok?e.json():{available:!1,connected:!1}}async function Zr(e=50,t=0){let n=new URLSearchParams({limit:String(e),offset:String(t)}),r=await L(`${I}/api/sessions?${n}`);if(!r.ok)throw Error(`Sessions API error: ${r.status}`);return r.json()}async function Qr(e){let t=await L(`${I}/api/sessions/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Failed to delete session: ${t.status}`)}async function $r(e,t){let n=await L(`${I}/api/integrations/connect`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({client:e,baseUrl:t})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||`Connection error: ${n.status}`)}return n.json()}async function ei(){let e=await L(`${I}/api/integrations/active`,{method:`GET`});if(!e.ok)throw Error(`Integrations API error: ${e.status}`);return e.json()}async function ti(){let e=await L(`${I}/api/config-json`);if(!e.ok){let t=`Config JSON API error: ${e.status}`;try{let n=await e.json();n?.error&&(t=n.error)}catch{}throw Error(t)}return e.json()}async function ni(e){let t=await L(`${I}/api/config-json`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=`Config JSON API error: ${t.status}`;try{let n=await t.json();n?.error&&(e=n.error)}catch{}throw Error(e)}}async function ri(e){try{return await e.json()}catch{return{}}}async function ii(e,t,n=`POST`){try{let r=await L(e,{method:n,headers:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t)}),i=await ri(r);return r.ok?{success:!0,...i}:{success:!1,error:i.error||i.message||`Request failed (${r.status})`}}catch(e){return{success:!1,error:e?.message||`Network error`}}}async function ai(){try{let e=await L(`${I}/api/plugins`);if(!e.ok)return[];let t=await ri(e);return Array.isArray(t.plugins)?t.plugins:[]}catch{return[]}}async function oi(e){try{let t=await L(`${I}/api/plugins/${encodeURIComponent(e)}`);return t.ok&&(await ri(t)).plugin||null}catch{return null}}async function si(){try{let e=await L(`${I}/api/plugins/available`);if(!e.ok)return[];let t=await ri(e);return Array.isArray(t.plugins)?t.plugins:[]}catch{return[]}}async function ci(){try{let e=await L(`${I}/api/plugins/peers`);if(!e.ok)return null;let t=await ri(e);return{mesh:t.mesh||{available:!1,configured:!1},peers:Array.isArray(t.peers)?t.peers:[]}}catch{return null}}function li(e){return ii(`${I}/api/plugins/install`,e)}function ui(e,t=!1){return ii(`${I}/api/plugins/${encodeURIComponent(e)}${t?`?global=true`:``}`,void 0,`DELETE`)}function di(e,t){return ii(`${I}/api/plugins/${encodeURIComponent(e)}/share`,{shared:t})}function fi(e,t){return ii(`${I}/api/plugins/${encodeURIComponent(e)}/branding`,{branding:t})}function pi(e,t){return ii(`${I}/api/plugins/${encodeURIComponent(e)}/lock`,{locked:t})}function mi(e,t){return ii(`${I}/api/plugins/${encodeURIComponent(e)}/activation`,{enabled:t},`PUT`)}function hi(e,t=!0){return ii(`${I}/api/plugins/${encodeURIComponent(e)}/deploy-store`,{autoLock:t})}async function gi(e,t=``,n=[],r){let i=await ii(`${I}/api/plugins/${encodeURIComponent(e)}/run`,{subcommand:t,args:n,...r||{}});return i.error?{success:!1,error:i.error}:{success:!!i.ok,output:i.output||``,exitCode:i.exitCode,timedOut:i.timedOut}}async function _i(e){try{let t=await L(`${I}/api/plugins/${encodeURIComponent(e)}/readme`);return t.ok&&(await ri(t)).readme||``}catch{return``}}function vi(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function yi(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function bi(){return xi.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var xi={stubThis:e=>e};function Si(e){let{id:t}=e;return{...e,id:yi(t),transports:e.transports}}function Ci(e){return e===`localhost`||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var wi=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}},Ti=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},Ei=[`cross-platform`,`platform`];function Di(e){if(e&&!(Ei.indexOf(e)<0))return e}function Oi(){if(!bi())return ki.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?ki.stubThis(new Promise(e=>e(!1))):ki.stubThis(e.isConditionalMediationAvailable())}var ki={stubThis:e=>e};function Ai({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new wi({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new wi({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!Ci(t))return new wi({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new wi({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new wi({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function ji(e){!e.optionsJSON&&e.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!bi())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(Si));let a={...t,challenge:yi(t.challenge),allowCredentials:i},o={};if(n){if(!await Oi())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=Ti.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw Ai({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=vi(u.userHandle)),{id:c,rawId:vi(l),response:{authenticatorData:vi(u.authenticatorData),clientDataJSON:vi(u.clientDataJSON),signature:vi(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:Di(s.authenticatorAttachment)}}var Mi=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),R=o(((e,t)=>{t.exports=Mi()}))();function Ni({size:e=42,className:t=``,alt:n=`Total Recall Animated Mark`}){let r={width:e,height:e,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,perspective:800};return(0,R.jsx)(`div`,{className:`animated-brand-mark ${t}`,style:r,title:n,children:(0,R.jsxs)(`svg`,{viewBox:`0 0 100 100`,width:e,height:e,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{overflow:`visible`},children:[(0,R.jsxs)(`defs`,{children:[(0,R.jsxs)(`filter`,{id:`tr-glow`,x:`-20%`,y:`-20%`,width:`140%`,height:`140%`,children:[(0,R.jsx)(`feGaussianBlur`,{stdDeviation:`3`,result:`blur`}),(0,R.jsx)(`feComposite`,{in:`SourceGraphic`,in2:`blur`,operator:`over`})]}),(0,R.jsxs)(`linearGradient`,{id:`tr-top-facet`,x1:`50`,y1:`20`,x2:`80`,y2:`40`,gradientUnits:`userSpaceOnUse`,children:[(0,R.jsx)(`stop`,{offset:`0%`,stopColor:`#60a5fa`,stopOpacity:`0.95`}),(0,R.jsx)(`stop`,{offset:`100%`,stopColor:`#3b82f6`,stopOpacity:`0.8`})]}),(0,R.jsxs)(`linearGradient`,{id:`tr-left-facet`,x1:`20`,y1:`38`,x2:`50`,y2:`80`,gradientUnits:`userSpaceOnUse`,children:[(0,R.jsx)(`stop`,{offset:`0%`,stopColor:`#2563eb`,stopOpacity:`0.9`}),(0,R.jsx)(`stop`,{offset:`100%`,stopColor:`#1e3a8a`,stopOpacity:`0.85`})]}),(0,R.jsxs)(`linearGradient`,{id:`tr-right-facet`,x1:`80`,y1:`38`,x2:`50`,y2:`80`,gradientUnits:`userSpaceOnUse`,children:[(0,R.jsx)(`stop`,{offset:`0%`,stopColor:`#3b82f6`,stopOpacity:`0.85`}),(0,R.jsx)(`stop`,{offset:`100%`,stopColor:`#1d4ed8`,stopOpacity:`0.95`})]}),(0,R.jsxs)(`linearGradient`,{id:`tr-orbit-ring`,x1:`10`,y1:`50`,x2:`90`,y2:`50`,gradientUnits:`userSpaceOnUse`,children:[(0,R.jsx)(`stop`,{offset:`0%`,stopColor:`#38bdf8`,stopOpacity:`0.1`}),(0,R.jsx)(`stop`,{offset:`50%`,stopColor:`#60a5fa`,stopOpacity:`0.7`}),(0,R.jsx)(`stop`,{offset:`100%`,stopColor:`#818cf8`,stopOpacity:`0.1`})]})]}),(0,R.jsx)(`style`,{children:`
|
|
12
12
|
@keyframes tr-float {
|
|
13
13
|
0%, 100% {
|
|
14
14
|
transform: translateY(0px) rotate(0deg);
|
|
@@ -52,7 +52,7 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
|
|
|
52
52
|
transform-origin: 50px 50px;
|
|
53
53
|
animation: tr-pulse 3s ease-in-out infinite;
|
|
54
54
|
}
|
|
55
|
-
`}),(0,R.jsxs)(`g`,{className:`tr-orbit-plane`,children:[(0,R.jsx)(`ellipse`,{cx:`50`,cy:`50`,rx:`42`,ry:`42`,stroke:`url(#tr-orbit-ring)`,strokeWidth:`1.5`,strokeDasharray:`16 8`}),(0,R.jsx)(`circle`,{cx:`92`,cy:`50`,r:`3.5`,fill:`#38bdf8`,filter:`url(#tr-glow)`}),(0,R.jsx)(`circle`,{cx:`92`,cy:`50`,r:`1.8`,fill:`#ffffff`})]}),(0,R.jsxs)(`g`,{className:`tr-cube-group`,children:[(0,R.jsx)(`polygon`,{points:`50,22 80,38 50,54 20,38`,fill:`url(#tr-top-facet)`,stroke:`rgba(255,255,255,0.25)`,strokeWidth:`0.8`}),(0,R.jsx)(`polygon`,{points:`20,38 50,54 50,86 20,70`,fill:`url(#tr-left-facet)`,stroke:`rgba(255,255,255,0.15)`,strokeWidth:`0.8`}),(0,R.jsx)(`polygon`,{points:`50,54 80,38 80,70 50,86`,fill:`url(#tr-right-facet)`,stroke:`rgba(255,255,255,0.15)`,strokeWidth:`0.8`}),(0,R.jsxs)(`g`,{className:`tr-inner-core`,children:[(0,R.jsx)(`polygon`,{points:`50,42 62,49 50,56 38,49`,fill:`rgba(147, 197, 253, 0.4)`}),(0,R.jsx)(`circle`,{cx:`50`,cy:`49`,r:`2.5`,fill:`#ffffff`,filter:`url(#tr-glow)`})]})]})]})})}var Pi={lockup:`/brand/total-recall-lockup.png`,icon:`/brand/total-recall-icon.svg`,badge:`/brand/total-recall-badge.jpg`,mark:`/brand/total-recall-mark.svg`};function Fi({variant:e=`lockup`,height:t=40,className:n=``,alt:r=`Total Recall`,plate:i=!1,animated:a=!1}){if(a||e===`animated`)return(0,R.jsx)(Ni,{size:t,className:n,alt:r});let o=e===`icon`||e===`badge`||e===`mark`,s=(0,R.jsx)(`img`,{src:Pi[e],alt:r,height:t,width:o?t:void 0,className:n,style:{height:t,width:o?t:`auto`,maxWidth:`100%`,objectFit:`contain`,display:`block`},draggable:!1});return i?(0,R.jsx)(`div`,{className:`brand-plate`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,padding:e===`lockup`?`10px 14px`:8,borderRadius:e===`lockup`?14:16,background:`linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%)`,boxShadow:`0 1px 0 rgba(255,255,255,0.6) inset, 0 12px 32px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(148,163,184,0.25)`},children:s}):s}function Ii({onAuthenticated:e}){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(!1),[v,y]=(0,_.useState)(!0),b=(0,_.useRef)(null);(0,_.useEffect)(()=>{async function e(){try{let e=await Jn();e&&!e.configured&&g(!0)}catch{}try{if(typeof Zn==`function`){let e=await Zn();e&&f(e)}}catch{}finally{y(!1)}}e()},[]);async function x(){if(!(s||l)){if(d?.passkey&&!d.passkey.has_passkeys)o(`No passkeys enrolled yet. Log in with password and configure biometric passkeys in the Auth Plugin.`);else{u(!0),o(``);try{if(!bi()){o(`Your browser does not support WebAuthn passkeys.`),u(!1);return}let t=await $n(await ji(await Qn()));t.ok?e():o(t.error||`Passkey verification failed`)}catch(e){e?.name===`NotAllowedError`?o(`Passkey request was dismissed.`):o(e.message||`Failed to authenticate with passkey.`)}finally{u(!1)}}}}function S(){d?.google&&!d.google.configured?o(`Google OAuth2 is not configured. Provide GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET in the Auth Plugin.`):window.location.href=`/auth/google`}(0,_.useEffect)(()=>{b.current?.focus()},[p,h]);async function C(i){if(i.preventDefault(),!s){c(!0),o(``);try{if(h){if(r.length<8){o(`New password must be at least 8 characters`),c(!1);return}let t=await Yn(r);if(t.ok){let t=await Kn(r);t.ok?e():(o(t.error||`Password was set, but automatic sign in failed.`),g(!1))}else o(t.error||`Failed to setup password`)}else if(p){if(r.length<8){o(`New password must be at least 8 characters`),c(!1);return}let t=await qn(r);t.ok?e():o(t.error||`Failed to change password`)}else{let r=await Kn(t);r.ok?r.requiresPasswordReset?(m(!0),n(``)):e():o(r.error||`Invalid password`)}}catch{o(`Network error — is the server running?`)}finally{c(!1)}}}let w=s||(h||p?!r:!t);return v?(0,R.jsxs)(`div`,{style:{minHeight:`100vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`var(--bg-primary)`},children:[(0,R.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--text-tertiary)`,strokeWidth:`2.5`,strokeLinecap:`round`,style:{animation:`spin 0.8s linear infinite`},children:(0,R.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),(0,R.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})]}):(0,R.jsxs)(`div`,{className:`login-shell`,children:[(0,R.jsxs)(`div`,{className:`login-card`,children:[(0,R.jsxs)(`div`,{style:{textAlign:`center`,display:`flex`,flexDirection:`column`,alignItems:`center`,gap:16},children:[p||h?(0,R.jsx)(`div`,{style:{width:56,height:56,borderRadius:16,background:`linear-gradient(135deg, #f59e0b, #d97706)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 12px 32px rgba(245, 158, 11, 0.35)`},children:(0,R.jsxs)(`svg`,{width:`26`,height:`26`,viewBox:`0 0 24 24`,fill:`none`,stroke:`white`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`}),(0,R.jsx)(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`})]})}):(0,R.jsx)(`div`,{style:{width:`100%`,maxWidth:280,borderRadius:16,padding:`14px 18px`,background:`linear-gradient(180deg, #f8fafc 0%, #e8eef9 100%)`,boxShadow:`0 1px 0 rgba(255,255,255,0.75) inset, 0 16px 40px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(148,163,184,0.25)`},children:(0,R.jsx)(Fi,{variant:`lockup`,height:56,alt:`Total Recall`})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{style:{fontSize:22,fontWeight:700,color:`var(--text-primary)`,margin:0,letterSpacing:`-0.03em`},children:p?`Action Required`:h?`Setup Admin Password`:`Welcome back`}),(0,R.jsx)(`p`,{style:{fontSize:13.5,color:`var(--text-secondary)`,margin:`8px 0 0`,lineHeight:1.5},children:p?`You must change your temporary password to continue.`:h?`Choose a strong password to secure your local memory dashboard.`:`Portable personal memory · any IDE`})]})]}),(0,R.jsxs)(`form`,{onSubmit:C,style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,R.jsx)(`input`,{type:`text`,name:`username`,autoComplete:`username`,style:{display:`none`}}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,R.jsx)(`label`,{htmlFor:`login-password`,style:{fontSize:11,fontWeight:600,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:`0.08em`},children:p||h?`New Password`:`Password`}),(0,R.jsx)(`input`,{id:`login-password`,ref:b,type:`password`,value:h||p?r:t,onChange:e=>{h||p?i(e.target.value):n(e.target.value),o(``)},placeholder:h||p?`Minimum 8 characters`:`Enter admin password`,autoComplete:h||p?`new-password`:`current-password`,disabled:s,style:{background:`rgba(7, 11, 20, 0.65)`,border:`1px solid ${a?`rgba(248,113,113,0.55)`:`var(--border)`}`,borderRadius:12,padding:`12px 16px`,color:`var(--text-primary)`,fontSize:14,outline:`none`,transition:`border-color 0.15s, box-shadow 0.15s`,boxShadow:a?`0 0 0 3px rgba(248,113,113,0.12)`:`inset 0 1px 2px rgba(0,0,0,0.25)`},onFocus:e=>{a||(e.currentTarget.style.borderColor=`var(--border-accent)`,e.currentTarget.style.boxShadow=`0 0 0 3px var(--accent-glow)`)},onBlur:e=>{e.currentTarget.style.borderColor=a?`rgba(248,113,113,0.55)`:`var(--border)`,e.currentTarget.style.boxShadow=a?`0 0 0 3px rgba(248,113,113,0.12)`:`inset 0 1px 2px rgba(0,0,0,0.25)`}})]}),a&&(0,R.jsxs)(`div`,{style:{background:`rgba(248,113,113,0.1)`,border:`1px solid rgba(248,113,113,0.3)`,borderRadius:12,padding:`11px 14px`,fontSize:13,color:`#fca5a5`,display:`flex`,alignItems:`center`,gap:8},children:[(0,R.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:[(0,R.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,R.jsx)(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`}),(0,R.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`})]}),a]}),(0,R.jsx)(`button`,{id:`login-submit`,type:`submit`,disabled:w,className:w?void 0:`btn btn-primary`,style:{width:`100%`,justifyContent:`center`,padding:`12px 0`,fontSize:14,borderRadius:12,border:`none`,cursor:w?`not-allowed`:`pointer`,background:w?`var(--bg-tertiary)`:void 0,color:w?`var(--text-tertiary)`:void 0,display:`flex`,alignItems:`center`,gap:8},children:s?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,style:{animation:`spin 0.8s linear infinite`},children:(0,R.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),h||p?`Saving…`:`Authenticating…`]}):h?`Create Password & Continue`:p?`Save & Continue`:`Sign In`})]}),!p&&!h&&(d?.passkey?.has_passkeys||d?.google?.configured)&&(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10,marginTop:-4},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,margin:`6px 0`},children:[(0,R.jsx)(`div`,{style:{flex:1,height:1,background:`var(--border)`}}),(0,R.jsx)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:`0.08em`},children:`OR`}),(0,R.jsx)(`div`,{style:{flex:1,height:1,background:`var(--border)`}})]}),d?.passkey?.has_passkeys&&(0,R.jsx)(`button`,{type:`button`,id:`btn-passkey-login`,onClick:x,disabled:l||s,className:`btn btn-secondary`,style:{width:`100%`,minHeight:44,justifyContent:`center`,fontSize:13.5,borderRadius:12,display:`flex`,alignItems:`center`,gap:8,background:`rgba(99, 102, 241, 0.12)`,borderColor:`rgba(99, 102, 241, 0.35)`,color:`#c7d2fe`,cursor:l||s?`not-allowed`:`pointer`},children:l?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,style:{animation:`spin 0.8s linear infinite`},children:(0,R.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),`Verifying Passkey…`]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,R.jsx)(`path`,{d:`M7 12a5 5 0 0 1 9.9-1`}),(0,R.jsx)(`path`,{d:`M8.5 16.5a8 8 0 0 1 10.5-3.5`}),(0,R.jsx)(`path`,{d:`M5 12a7 7 0 0 1 14 0`})]}),`Sign in with Passkey`]})}),d?.google?.configured&&(0,R.jsxs)(`button`,{type:`button`,id:`btn-google-login`,onClick:S,disabled:s||l,className:`btn btn-secondary`,style:{width:`100%`,minHeight:44,justifyContent:`center`,fontSize:13.5,borderRadius:12,display:`flex`,alignItems:`center`,gap:8,background:`rgba(255, 255, 255, 0.05)`,borderColor:`rgba(255, 255, 255, 0.15)`,color:`var(--text-primary)`,cursor:s||l?`not-allowed`:`pointer`},children:[(0,R.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,children:[(0,R.jsx)(`path`,{fill:`#4285F4`,d:`M23.745 12.27c0-.7-.06-1.4-.19-2.07H12v4.51h6.6c-.29 1.52-1.14 2.82-2.4 3.68v3.05h3.88c2.27-2.09 3.665-5.17 3.665-9.17z`}),(0,R.jsx)(`path`,{fill:`#34A853`,d:`M12 24c3.24 0 5.95-1.08 7.93-2.91l-3.88-3.05c-1.08.72-2.45 1.16-4.05 1.16-3.12 0-5.77-2.1-6.72-4.93H1.25v3.15C3.26 21.36 7.33 24 12 24z`}),(0,R.jsx)(`path`,{fill:`#FBBC05`,d:`M5.28 14.27c-.25-.72-.38-1.49-.38-2.27s.13-1.55.38-2.27V6.58H1.25C.45 8.18 0 9.99 0 12s.45 3.82 1.25 5.42l4.03-3.15z`}),(0,R.jsx)(`path`,{fill:`#EA4335`,d:`M12 4.75c1.77 0 3.35.61 4.6 1.8l3.42-3.42C17.95 1.19 15.24 0 12 0 7.33 0 3.26 2.64 1.25 6.58l4.03 3.15c.95-2.83 3.6-4.98 6.72-4.98z`})]}),`Sign in with Google`]})]}),!p&&!h&&(0,R.jsxs)(`p`,{style:{textAlign:`center`,fontSize:11,color:`var(--text-tertiary)`,margin:0,lineHeight:1.5},children:[`Local-first vault · credentials in`,` `,(0,R.jsx)(`code`,{style:{color:`#93c5fd`,fontSize:11},children:`~/.agent/config/security.yml`})]})]}),(0,R.jsx)(`style`,{children:`
|
|
55
|
+
`}),(0,R.jsxs)(`g`,{className:`tr-orbit-plane`,children:[(0,R.jsx)(`ellipse`,{cx:`50`,cy:`50`,rx:`42`,ry:`42`,stroke:`url(#tr-orbit-ring)`,strokeWidth:`1.5`,strokeDasharray:`16 8`}),(0,R.jsx)(`circle`,{cx:`92`,cy:`50`,r:`3.5`,fill:`#38bdf8`,filter:`url(#tr-glow)`}),(0,R.jsx)(`circle`,{cx:`92`,cy:`50`,r:`1.8`,fill:`#ffffff`})]}),(0,R.jsxs)(`g`,{className:`tr-cube-group`,children:[(0,R.jsx)(`polygon`,{points:`50,22 80,38 50,54 20,38`,fill:`url(#tr-top-facet)`,stroke:`rgba(255,255,255,0.25)`,strokeWidth:`0.8`}),(0,R.jsx)(`polygon`,{points:`20,38 50,54 50,86 20,70`,fill:`url(#tr-left-facet)`,stroke:`rgba(255,255,255,0.15)`,strokeWidth:`0.8`}),(0,R.jsx)(`polygon`,{points:`50,54 80,38 80,70 50,86`,fill:`url(#tr-right-facet)`,stroke:`rgba(255,255,255,0.15)`,strokeWidth:`0.8`}),(0,R.jsxs)(`g`,{className:`tr-inner-core`,children:[(0,R.jsx)(`polygon`,{points:`50,42 62,49 50,56 38,49`,fill:`rgba(147, 197, 253, 0.4)`}),(0,R.jsx)(`circle`,{cx:`50`,cy:`49`,r:`2.5`,fill:`#ffffff`,filter:`url(#tr-glow)`})]})]})]})})}var Pi={lockup:`/brand/total-recall-lockup.png`,icon:`/brand/total-recall-icon.svg`,badge:`/brand/total-recall-badge.jpg`,mark:`/brand/total-recall-mark.svg`};function Fi({variant:e=`lockup`,height:t=40,className:n=``,alt:r=`Total Recall`,plate:i=!1,animated:a=!1}){if(a||e===`animated`)return(0,R.jsx)(Ni,{size:t,className:n,alt:r});let o=e===`icon`||e===`badge`||e===`mark`,s=(0,R.jsx)(`img`,{src:Pi[e],alt:r,height:t,width:o?t:void 0,className:n,style:{height:t,width:o?t:`auto`,maxWidth:`100%`,objectFit:`contain`,display:`block`},draggable:!1});return i?(0,R.jsx)(`div`,{className:`brand-plate`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,padding:e===`lockup`?`10px 14px`:8,borderRadius:e===`lockup`?14:16,background:`linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%)`,boxShadow:`0 1px 0 rgba(255,255,255,0.6) inset, 0 12px 32px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(148,163,184,0.25)`},children:s}):s}function Ii({onAuthenticated:e}){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(!1),[v,y]=(0,_.useState)(!0),b=(0,_.useRef)(null);(0,_.useEffect)(()=>{async function e(){try{let e=await Jn();e&&!e.configured&&g(!0)}catch{}try{if(typeof Zn==`function`){let e=await Zn();e&&f(e)}}catch{}finally{y(!1)}}e()},[]);async function x(){if(!(s||l)){if(d?.passkey&&!d.passkey.has_passkeys)o(`No passkeys enrolled yet. Log in with password and configure biometric passkeys in the Auth Plugin.`);else{u(!0),o(``);try{if(!bi()){o(`Your browser does not support WebAuthn passkeys.`),u(!1);return}let t=await $n(await ji(await Qn()));t.ok?e():o(t.error||`Passkey verification failed`)}catch(e){e?.name===`NotAllowedError`?o(`Passkey request was dismissed.`):o(e.message||`Failed to authenticate with passkey.`)}finally{u(!1)}}}}(0,_.useEffect)(()=>{b.current?.focus()},[p,h]);async function S(i){if(i.preventDefault(),!s){c(!0),o(``);try{if(h){if(r.length<8){o(`New password must be at least 8 characters`),c(!1);return}let t=await Yn(r);if(t.ok){let t=await Kn(r);t.ok?e():(o(t.error||`Password was set, but automatic sign in failed.`),g(!1))}else o(t.error||`Failed to setup password`)}else if(p){if(r.length<8){o(`New password must be at least 8 characters`),c(!1);return}let t=await qn(r);t.ok?e():o(t.error||`Failed to change password`)}else{let r=await Kn(t);r.ok?r.requiresPasswordReset?(m(!0),n(``)):e():o(r.error||`Invalid password`)}}catch{o(`Network error — is the server running?`)}finally{c(!1)}}}let C=s||(h||p?!r:!t);return v?(0,R.jsxs)(`div`,{style:{minHeight:`100vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`var(--bg-primary)`},children:[(0,R.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--text-tertiary)`,strokeWidth:`2.5`,strokeLinecap:`round`,style:{animation:`spin 0.8s linear infinite`},children:(0,R.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),(0,R.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})]}):(0,R.jsxs)(`div`,{className:`login-shell`,children:[(0,R.jsxs)(`div`,{className:`login-card`,children:[(0,R.jsxs)(`div`,{style:{textAlign:`center`,display:`flex`,flexDirection:`column`,alignItems:`center`,gap:16},children:[p||h?(0,R.jsx)(`div`,{style:{width:56,height:56,borderRadius:16,background:`linear-gradient(135deg, #f59e0b, #d97706)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 12px 32px rgba(245, 158, 11, 0.35)`},children:(0,R.jsxs)(`svg`,{width:`26`,height:`26`,viewBox:`0 0 24 24`,fill:`none`,stroke:`white`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`}),(0,R.jsx)(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`})]})}):(0,R.jsx)(`div`,{style:{width:`100%`,maxWidth:280,borderRadius:16,padding:`14px 18px`,background:`linear-gradient(180deg, #f8fafc 0%, #e8eef9 100%)`,boxShadow:`0 1px 0 rgba(255,255,255,0.75) inset, 0 16px 40px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(148,163,184,0.25)`},children:(0,R.jsx)(Fi,{variant:`lockup`,height:56,alt:`Total Recall`})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{style:{fontSize:22,fontWeight:700,color:`var(--text-primary)`,margin:0,letterSpacing:`-0.03em`},children:p?`Action Required`:h?`Setup Admin Password`:`Welcome back`}),(0,R.jsx)(`p`,{style:{fontSize:13.5,color:`var(--text-secondary)`,margin:`8px 0 0`,lineHeight:1.5},children:p?`You must change your temporary password to continue.`:h?`Choose a strong password to secure your local memory dashboard.`:`Portable personal memory · any IDE`})]})]}),(0,R.jsxs)(`form`,{onSubmit:S,style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,R.jsx)(`input`,{type:`text`,name:`username`,autoComplete:`username`,style:{display:`none`}}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,R.jsx)(`label`,{htmlFor:`login-password`,style:{fontSize:11,fontWeight:600,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:`0.08em`},children:p||h?`New Password`:`Password`}),(0,R.jsx)(`input`,{id:`login-password`,ref:b,type:`password`,value:h||p?r:t,onChange:e=>{h||p?i(e.target.value):n(e.target.value),o(``)},placeholder:h||p?`Minimum 8 characters`:`Enter admin password`,autoComplete:h||p?`new-password`:`current-password`,disabled:s,style:{background:`rgba(7, 11, 20, 0.65)`,border:`1px solid ${a?`rgba(248,113,113,0.55)`:`var(--border)`}`,borderRadius:12,padding:`12px 16px`,color:`var(--text-primary)`,fontSize:14,outline:`none`,transition:`border-color 0.15s, box-shadow 0.15s`,boxShadow:a?`0 0 0 3px rgba(248,113,113,0.12)`:`inset 0 1px 2px rgba(0,0,0,0.25)`},onFocus:e=>{a||(e.currentTarget.style.borderColor=`var(--border-accent)`,e.currentTarget.style.boxShadow=`0 0 0 3px var(--accent-glow)`)},onBlur:e=>{e.currentTarget.style.borderColor=a?`rgba(248,113,113,0.55)`:`var(--border)`,e.currentTarget.style.boxShadow=a?`0 0 0 3px rgba(248,113,113,0.12)`:`inset 0 1px 2px rgba(0,0,0,0.25)`}})]}),a&&(0,R.jsxs)(`div`,{style:{background:`rgba(248,113,113,0.1)`,border:`1px solid rgba(248,113,113,0.3)`,borderRadius:12,padding:`11px 14px`,fontSize:13,color:`#fca5a5`,display:`flex`,alignItems:`center`,gap:8},children:[(0,R.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:[(0,R.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,R.jsx)(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`}),(0,R.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`})]}),a]}),(0,R.jsx)(`button`,{id:`login-submit`,type:`submit`,disabled:C,className:C?void 0:`btn btn-primary`,style:{width:`100%`,justifyContent:`center`,padding:`12px 0`,fontSize:14,borderRadius:12,border:`none`,cursor:C?`not-allowed`:`pointer`,background:C?`var(--bg-tertiary)`:void 0,color:C?`var(--text-tertiary)`:void 0,display:`flex`,alignItems:`center`,gap:8},children:s?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,style:{animation:`spin 0.8s linear infinite`},children:(0,R.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),h||p?`Saving…`:`Authenticating…`]}):h?`Create Password & Continue`:p?`Save & Continue`:`Sign In`})]}),!p&&!h&&d?.passkey?.has_passkeys&&(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10,marginTop:-4},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,margin:`6px 0`},children:[(0,R.jsx)(`div`,{style:{flex:1,height:1,background:`var(--border)`}}),(0,R.jsx)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`,textTransform:`uppercase`,letterSpacing:`0.08em`},children:`OR`}),(0,R.jsx)(`div`,{style:{flex:1,height:1,background:`var(--border)`}})]}),d?.passkey?.has_passkeys&&(0,R.jsx)(`button`,{type:`button`,id:`btn-passkey-login`,onClick:x,disabled:l||s,className:`btn btn-secondary`,style:{width:`100%`,minHeight:44,justifyContent:`center`,fontSize:13.5,borderRadius:12,display:`flex`,alignItems:`center`,gap:8,background:`rgba(99, 102, 241, 0.12)`,borderColor:`rgba(99, 102, 241, 0.35)`,color:`#c7d2fe`,cursor:l||s?`not-allowed`:`pointer`},children:l?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,style:{animation:`spin 0.8s linear infinite`},children:(0,R.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),`Verifying Passkey…`]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,R.jsx)(`path`,{d:`M7 12a5 5 0 0 1 9.9-1`}),(0,R.jsx)(`path`,{d:`M8.5 16.5a8 8 0 0 1 10.5-3.5`}),(0,R.jsx)(`path`,{d:`M5 12a7 7 0 0 1 14 0`})]}),`Sign in with Passkey`]})})]}),!p&&!h&&(0,R.jsxs)(`p`,{style:{textAlign:`center`,fontSize:11,color:`var(--text-tertiary)`,margin:0,lineHeight:1.5},children:[`Local-first vault · credentials in`,` `,(0,R.jsx)(`code`,{style:{color:`#93c5fd`,fontSize:11},children:`~/.agent/config/security.yml`})]})]}),(0,R.jsx)(`style`,{children:`
|
|
56
56
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
57
57
|
`})]})}function Li(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Ri(e,t,n){return t=Yi(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zi(e,t){return Hi(e)||Li(e,t)||Wi(e,t)||qi()}function Bi(e){return Vi(e)||Ui(e)||Wi(e)||Ki()}function Vi(e){if(Array.isArray(e))return Gi(e)}function Hi(e){if(Array.isArray(e))return e}function Ui(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Wi(e,t){if(e){if(typeof e==`string`)return Gi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gi(e,t)}}function Gi(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ki(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
58
58
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qi(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
@@ -5597,7 +5597,7 @@ try{
|
|
|
5597
5597
|
new ResizeObserver(()=>send('height',{height:document.body.scrollHeight})).observe(document.body);
|
|
5598
5598
|
send('ready');
|
|
5599
5599
|
}catch{send('error',{message:'Could not open the plugin interface'});}
|
|
5600
|
-
<\/script></body></html>`}function DZ(e){let t=e?.cli;return Object.fromEntries((t?.subcommands||[]).filter(e=>Number.isInteger(e.timeout_ms)&&e.timeout_ms>=1&&e.timeout_ms<=6e5).map(e=>[e.name,e.timeout_ms]))}function OZ(e,t,n=new Set){if(!e||typeof e!=`object`)return!1;let r=e;return typeof r.requestId==`string`&&r.requestId.length<=64&&typeof r.subcommand==`string`&&t.has(r.subcommand)&&(r.stdin===void 0||n.has(r.subcommand)&&typeof r.stdin==`string`&&r.stdin.length>0&&new TextEncoder().encode(r.stdin).length<=65536)&&Array.isArray(r.args)&&r.args.length<=64&&r.args.every(e=>typeof e==`string`&&e.length<=8192)&&r.args.reduce((e,t)=>e+t.length,0)<=32768}function kZ(e){return e.manifest?.ui?.elements||e.ui?.elements||[]}function AZ({plugin:e,elementId:t,readOnly:n=!1}){let r=kZ(e).filter(e=>e.kind!==`settings`&&(!t||e.id===t)),[i,a]=(0,_.useState)(r[0]?.id||``),[o,s]=(0,_.useState)(``),c=(0,_.useRef)(null),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(240);return(0,_.useEffect)(()=>{let t=!1;s(``),u(``);let a=crypto.randomUUID(),o=e.manifest?.cli,l=new Set((o?.subcommands||[]).filter(e=>e.effect===`read`).map(e=>e.name)),d=new Set((e.cli?.subcommands||[]).filter(e=>!n||l.has(e.name)).map(e=>e.name)),p=new Set((o?.subcommands||[]).filter(e=>{let t=e.args?.filter(e=>e.secret===!0)||[];return t.length===1&&t[0].type===`string`&&t[0].flag===void 0}).map(e=>e.name)),m=r.find(e=>e.id===i)||r[0],h=[],g=n=>{let r=n.detail;!t&&m?.kind===`card`&&r?.pluginId===e.id&&h.some(e=>e.id===r.screen)&&c.current?.contentWindow?.postMessage({channel:a,type:`show-screen`,screen:r.screen},`*`)},_=0,v=async n=>{if(t||n.source!==c.current?.contentWindow||n.origin!==`null`||n.data?.channel!==a)return;let r=n.data;if(r.type===`screens`){m?.kind===`card`&&(h=TZ(r.screens),window.dispatchEvent(new CustomEvent(`plugin-screens`,{detail:{pluginId:e.id,screens:h}})));return}if(r.type===`screen-changed`){m?.kind===`card`&&h.some(e=>e.id===r.screen)&&window.dispatchEvent(new CustomEvent(`plugin-screen-changed`,{detail:{pluginId:e.id,screen:r.screen}}));return}if(r.type===`contextmenu`&&window.dispatchEvent(new CustomEvent(`plugin-context-menu`,{detail:{pluginId:e.id}})),r.type===`height`&&Number.isFinite(r.height)&&f(Math.max(128,Math.min(1e3,r.height))),r.type===`error`&&s(`Could not open the plugin interface`),r.type!==`run`)return;let i=n.source,o=(e,n)=>{t||i.postMessage({channel:a,type:`result`,requestId:r.requestId,result:e,error:n},`*`)};if(!OZ(r,d,p)||_>=4)o(void 0,`Operation is not available`);else{_++,window.dispatchEvent(new CustomEvent(`plugin-command-activity`,{detail:{pluginId:e.id,requestId:r.requestId,command:r.subcommand,running:!0}}));try{let t=r.stdin===void 0?await gi(e.id,r.subcommand,[...r.args,`--json`]):await gi(e.id,r.subcommand,[...r.args,`--json`],{stdin:r.stdin});if(!t.success){o(void 0,r.stdin===void 0?t.output||t.error||`Operation failed`:`Credential operation failed`);return}o(r.stdin===void 0?JSON.parse(t.output||`{}`):{ok:!0})}catch{o(void 0,`Operation failed`)}finally{_--,window.dispatchEvent(new CustomEvent(`plugin-command-activity`,{detail:{pluginId:e.id,requestId:r.requestId,command:r.subcommand,running:!1}}))}}};return window.addEventListener(`message`,v),window.addEventListener(`plugin-show-screen`,g),m&&(async()=>{let n=await L(`${I}/api/plugins/${encodeURIComponent(e.id)}/ui/${encodeURIComponent(m.id)}`);if(!n.ok)throw Error(`Could not open ${e.name} (${n.status})`);let r=await n.text();if(r.length>1048576)throw Error(`The plugin interface is too large`);if(t)return;let i=getComputedStyle(window.document.documentElement),o={};for(let e of[`--text-primary`,`--text-secondary`,`--text-tertiary`,`--bg-primary`,`--bg-secondary`,`--border`,`--accent`,`--font-sans`,`--color-text`,`--color-surface`,`--color-border`,`--spacing-md`,`--radius-md`])o[e]=i.getPropertyValue(e);u(EZ(r,m.tag,a,o,e.id,DZ(e.manifest),[...d]))})().catch(e=>{t||s(e.message)}),()=>{t=!0,window.removeEventListener(`message`,v),window.removeEventListener(`plugin-show-screen`,g),m?.kind===`card`&&window.dispatchEvent(new CustomEvent(`plugin-screens`,{detail:{pluginId:e.id,screens:[]}}))}},[e.id,i,e.sha256,t,n]),(0,R.jsxs)(`section`,{children:[r.length>1&&(0,R.jsx)(`nav`,{style:{display:`flex`,gap:8},children:r.map(e=>(0,R.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>a(e.id),"aria-pressed":i===e.id,children:e.description||e.id},e.id))}),o&&(0,R.jsx)(`div`,{role:`alert`,className:`alert alert-error`,children:o}),r.length===0&&(0,R.jsx)(`p`,{children:`This plugin has not supplied its interface yet.`}),l&&(0,R.jsx)(`iframe`,{ref:c,title:`${e.name} interface`,sandbox:`allow-scripts`,referrerPolicy:`no-referrer`,allow:`camera 'none'; microphone 'none'; geolocation 'none'; clipboard-read 'none'; clipboard-write 'none'`,srcDoc:l,style:{width:`100%`,height:d,border:0}})]})}function jZ({plugin:e}){let[t,n]=(0,_.useState)(new Set),[r,i]=(0,_.useState)({}),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)([]),[p,m]=(0,_.useState)({});(0,_.useEffect)(()=>{let t=!1;return i({}),c(``),u(``),L(`${I}/api/plugins/auth/secrets`).then(async e=>{if(!e.ok)return[];let r=await e.json();!t&&Array.isArray(r)&&n(new Set(r.map(e=>e.key)))}).catch(e=>{t||u(e.message)}),L(`${I}/api/plugins/${encodeURIComponent(e.id)}/configuration`).then(async e=>{if(!e.ok)throw Error(`Could not load plugin settings`);let n=await e.json();t||(f(n.fields),m(Object.fromEntries(n.fields.map(e=>[e.name,n.values[e.name]??e.default??(e.type!==`boolean`&&``)]))))}).catch(e=>{t||u(e.message)}),()=>{t=!0}},[e.id]);async function h(t){o(t),u(``),c(``);try{let a=await L(e.manifest?.runtime&&e.manifest.runtime.modules?.credentials?`${I}/api/plugins/${encodeURIComponent(e.id)}/credentials`:`${I}/api/plugins/auth/secrets`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({key:t,value:r[t],tags:[`plugin:${e.id}`]})});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(e.error||`Failed to save secret`)}i(e=>({...e,[t]:``})),n(e=>new Set([...e,t])),c(`Credential saved. Open the plugin to verify the connection.`)}catch(e){u(e.message)}finally{o(``)}}async function g(){o(`configuration`),u(``),c(``);try{let t=await L(`${I}/api/plugins/${encodeURIComponent(e.id)}/configuration`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({values:p})}),n=await t.json();if(!t.ok)throw Error(n.error||`Could not save settings`);m(n.values),c(`Settings saved.`)}catch(e){u(e.message)}finally{o(``)}}return(0,R.jsxs)(`section`,{style:{marginBottom:24},children:[(0,R.jsx)(`h3`,{children:`Configuration`}),d.length>0?(0,R.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),g()},children:[d.map(e=>(0,R.jsxs)(`label`,{style:{display:`block`,marginBottom:12},children:[e.label,e.options?(0,R.jsxs)(`select`,{className:`select`,value:String(p[e.name]??``),onChange:t=>m(n=>({...n,[e.name]:e.type===`number`?Number(t.target.value):t.target.value})),children:[(0,R.jsx)(`option`,{value:``,children:`Choose…`}),e.options.map(e=>(0,R.jsx)(`option`,{value:String(e),children:String(e)},String(e)))]}):(0,R.jsx)(`input`,{className:`input`,type:e.type===`boolean`?`checkbox`:e.type===`number`?`number`:`text`,required:e.required,checked:e.type===`boolean`?!!p[e.name]:void 0,value:e.type===`boolean`?void 0:String(p[e.name]??``),onChange:t=>m(n=>({...n,[e.name]:e.type===`boolean`?t.target.checked:e.type===`number`?Number(t.target.value):t.target.value}))})]},e.name)),(0,R.jsx)(`button`,{className:`btn btn-sm btn-primary`,disabled:!!a,children:a===`configuration`?`Saving…`:`Save settings`})]}):(0,R.jsx)(`p`,{children:`No settings declared.`}),(0,R.jsx)(`h3`,{children:`Credentials`}),l&&(0,R.jsx)(`div`,{role:`alert`,className:`alert alert-error`,children:l}),s&&(0,R.jsx)(`p`,{role:`status`,children:s}),(e.secrets||[]).length===0&&(0,R.jsx)(`p`,{children:`No credentials required.`}),(e.secrets||[]).map((e,n)=>{let o=`Credential ${n+1}${e.required?` (required)`:` (optional)`}`;return(0,R.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),h(e.key)},style:{marginBottom:16},children:[(0,R.jsxs)(`label`,{style:{display:`block`,marginBottom:6},children:[o,` · `,t.has(e.key)?`Saved`:`Not saved`,(0,R.jsx)(`input`,{className:`input`,type:`password`,autoComplete:`new-password`,value:r[e.key]||``,placeholder:t.has(e.key)?`Paste a replacement`:`Paste credential`,onChange:t=>i(n=>({...n,[e.key]:t.target.value}))})]}),(0,R.jsx)(`button`,{className:`btn btn-sm btn-primary`,disabled:!r[e.key]?.trim()||!!a,children:a===e.key?`Saving…`:`Save credential`})]},e.key)})]})}var MZ=[`system`,`inter`,`ibm-plex`,`space-grotesk`,`jetbrains-mono`,`dm-sans`,`outfit`,`fraunces`,`newsreader`,`chivo-mono`],NZ=/^#[0-9a-fA-F]{6}$/,PZ=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{};function FZ(e){let t=PZ(e);if(typeof t.name!=`string`||typeof t.label!=`string`)return null;let n=[`string`,`number`,`boolean`,`choice`].includes(t.type)?t.type:`string`;return{name:t.name,flag:typeof t.flag==`string`?t.flag:void 0,positional:t.positional===!0,label:t.label,type:n,options:Array.isArray(t.options)?t.options:void 0,required:t.required===!0,secret:t.secret===!0}}function IZ(e){let t=PZ(e.manifest),n=new Map;for(let r of e.cli?.subcommands||[]){let e=PZ(t.cli?.subcommands?.find(e=>e?.name===r.name));n.set(r.name,{name:r.name,description:r.description,args:(Array.isArray(e.args)?e.args:[]).map(FZ).filter(Boolean),effect:[`read`,`write`,`destructive`,`send`].includes(e.effect)?e.effect:`write`,output:e.output===`text`?`text`:`json`,timeoutMs:Number.isFinite(e.timeout_ms)?e.timeout_ms:void 0})}let r=PZ(t.branding),i={name:typeof r.name==`string`?r.name:e.name,color:NZ.test(r.color)?r.color:`#475569`,accent:NZ.test(r.accent)?r.accent:NZ.test(r.color)?r.color:`#0ea5e9`,font:MZ.includes(r.font)?r.font:`system`,density:[`compact`,`comfortable`,`spacious`].includes(r.density)?r.density:`comfortable`,radius:[`none`,`sm`,`md`,`lg`,`pill`].includes(r.radius)?r.radius:`md`,header:[`plain`,`ledger-rule`,`band`,`tab-strip`,`badge-left`].includes(r.header)?r.header:`plain`,badge:typeof r.badge==`string`?r.badge:void 0,logo:typeof r.logo==`string`?r.logo:void 0,provider:PZ(r.provider).name?{name:String(r.provider.name),url:typeof r.provider.url==`string`?r.provider.url:void 0}:void 0},a=PZ(t.status),o=typeof a.command==`string`&&n.has(a.command)?a.command:void 0,s=(Array.isArray(t.ui?.elements)?t.ui.elements:Array.isArray(e.ui?.elements)?e.ui.elements:[]).find(e=>e&&typeof e==`object`&&e.kind===`card`),c=s&&typeof s.id==`string`&&typeof s.tag==`string`&&typeof s.module==`string`?{id:s.id,tag:s.tag,module:s.module,description:typeof s.description==`string`?s.description:void 0}:void 0,l=PZ(t.workspace),u=l&&(l.component||Array.isArray(l.tabs))?{component:typeof l.component==`string`?l.component:void 0,tabs:Array.isArray(l.tabs)?l.tabs.filter(e=>typeof e==`string`):void 0,permissions:Array.isArray(l.permissions)?l.permissions.filter(e=>typeof e==`string`):void 0}:void 0;return{id:e.id,title:i.name,description:e.description,face:c,commands:n,branding:i,status:o?{command:o,refreshSeconds:Number.isInteger(a.refresh_seconds)?Math.min(86400,Math.max(5,a.refresh_seconds)):30}:void 0,distribution:PZ(t.distribution).tier?{tier:t.distribution.tier,license:t.distribution.license}:void 0,workspace:u}}var LZ=e=>e.args.filter(e=>!e.secret);function RZ(e,t){return LZ(e).filter(e=>e.required&&(t[e.name]===void 0||t[e.name]===``)).map(e=>e.label)}function zZ(e,t,n=[]){let r=[],i=[];for(let n of LZ(e)){let e=t[n.name];e!==void 0&&e!==``&&e!==!1&&(n.positional?r.push(String(e)):n.flag&&(n.type===`boolean`?i.push(n.flag):i.push(n.flag,String(e))))}return[...r,...i,...n,...e.output===`json`?[`--json`]:[]]}var BZ=e=>e.type===`boolean`?!1:e.type===`choice`&&e.options?.length&&e.required?e.options[0]:``,VZ=(0,_.createContext)(null),HZ=()=>{let e=(0,_.useContext)(VZ);if(!e)throw Error(`Card widgets must render inside a CardRunner`);return e};function UZ({card:e,children:t}){let[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(new Set),[o,s]=(0,_.useState)(null),c=(0,_.useRef)(e);(0,_.useEffect)(()=>{c.current=e},[e]);let l=(0,_.useCallback)(async(e,t={},n=[],i)=>{let s=c.current.commands.get(e);if(!s)return{ok:!1,text:``,error:`${e} is not a declared command`,ms:0};if(o&&!o.permissions[s.effect])return{ok:!1,text:``,error:`The ${s.effect} command permission is off`,ms:0};if(i!==void 0&&o&&(o.agent!==`direct`||o.node!==`local`))return{ok:!1,text:``,error:`Credential operations run directly on this node`,ms:0};let l=performance.now();a(t=>new Set(t).add(e));let u;try{let r=zZ(s,t,n),a=i===void 0?o?{execution:o}:void 0:{stdin:i},d=a?await gi(c.current.id,e,r,a):await gi(c.current.id,e,r),f=d.output||``,p;if(s.output===`json`&&f.trim())try{p=JSON.parse(f)}catch{}u={ok:!!d.success,data:p,text:f,error:d.success?void 0:d.timedOut?`The command timed out`:d.error||`The command failed`,ms:Math.round(performance.now()-l)}}catch(e){u={ok:!1,text:``,error:e instanceof Error?e.message:`The command failed`,ms:Math.round(performance.now()-l)}}return a(t=>{let n=new Set(t);return n.delete(e),n}),r(t=>[{at:new Date().toISOString(),command:e,effect:s.effect,ok:u.ok,ms:u.ms},...t].slice(0,100)),u},[o]),u=(0,_.useMemo)(()=>({card:e,run:l,activity:n,busy:i,execution:o,setExecution:s}),[e,l,n,i,o]);return(0,R.jsx)(VZ.Provider,{value:u,children:t})}function WZ(e,t,n){let r=[`total-recall`,n||e.id,t.name];for(let e of t.args){if(e.secret)continue;let t=e.positional?`<${e.name}>`:`${e.flag}${e.type===`boolean`?``:` <${e.name}>`}`;r.push(e.required?t:`[${t}]`)}return t.output===`json`&&r.push(`--json`),r.join(` `)}var GZ=({tone:e,children:t})=>(0,R.jsx)(`span`,{className:`card-pill card-pill-${e}`,children:t});function KZ({result:e}){return(0,R.jsx)(`p`,{role:`alert`,className:`card-error`,children:e.error||`No data`})}function qZ({command:e}){let{run:t,busy:n}=HZ(),r=LZ(e),[i,a]=(0,_.useState)(()=>Object.fromEntries(r.map(e=>[e.name,BZ(e)]))),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``),f=e.args.filter(e=>e.secret),p=f.length===1&&f[0].type===`string`&&!f[0].flag,m=e.effect!==`read`,h=RZ(e,i);return(0,R.jsxs)(`form`,{className:`card-form`,onSubmit:async n=>{if(n.preventDefault(),m&&!c)return;let r=p?u:void 0;d(``),s(await t(e.name,i,[],r)),l(!1)},children:[r.map(e=>(0,R.jsxs)(`label`,{children:[e.label,e.required?` *`:``,e.type===`choice`?(0,R.jsxs)(`select`,{value:String(i[e.name]??``),onChange:t=>a({...i,[e.name]:t.target.value}),children:[!e.required&&(0,R.jsx)(`option`,{value:``,children:`Any`}),e.options?.map(e=>(0,R.jsx)(`option`,{value:String(e),children:String(e)},String(e)))]}):e.type===`boolean`?(0,R.jsx)(`input`,{type:`checkbox`,checked:!!i[e.name],onChange:t=>a({...i,[e.name]:t.target.checked})}):(0,R.jsx)(`input`,{type:e.type===`number`?`number`:`text`,value:String(i[e.name]??``),onChange:t=>a({...i,[e.name]:e.type===`number`&&t.target.value!==``?Number(t.target.value):t.target.value})})]},e.name)),p&&(0,R.jsxs)(`label`,{children:[f[0].label,(0,R.jsx)(`input`,{type:`password`,autoComplete:`new-password`,value:u,maxLength:65536,onChange:e=>d(e.target.value)})]}),f.length>0&&!p&&(0,R.jsx)(`p`,{className:`card-muted`,children:`Use connection settings for this credential operation.`}),m&&(0,R.jsxs)(`label`,{children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:c,onChange:e=>l(e.target.checked)}),`Confirm `,e.name]}),(0,R.jsx)(`button`,{className:`card-button`,disabled:h.length>0||n.has(e.name)||m&&!c||f.length>0&&(!p||!u),children:n.has(e.name)?`Running…`:e.effect===`read`?`Look up`:`Run command`}),o&&(o.ok?(0,R.jsx)(`pre`,{className:`card-pre`,children:o.data?JSON.stringify(o.data,null,2):o.text}):(0,R.jsx)(KZ,{result:o}))]})}function JZ(){let{card:e}=HZ(),t=e.id,n=[...e.commands.keys()],[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(``);return(0,R.jsxs)(`ul`,{className:`card-commands`,children:[n.map(t=>e.commands.get(t)).filter(e=>!!e).map(n=>{let s=WZ(e,n,t);return(0,R.jsxs)(`li`,{children:[(0,R.jsxs)(`div`,{className:`card-row`,children:[(0,R.jsx)(`strong`,{children:n.name}),(0,R.jsx)(GZ,{tone:n.effect===`read`?`ok`:n.effect===`write`?`neutral`:`warn`,children:n.effect}),(0,R.jsx)(`button`,{type:`button`,className:`card-link`,onClick:()=>i(r===n.name?``:n.name),children:r===n.name?`Close`:`Try`})]}),n.description&&(0,R.jsx)(`p`,{className:`card-muted`,children:n.description}),(0,R.jsxs)(`div`,{className:`card-row`,children:[(0,R.jsx)(`code`,{className:`card-code`,children:s}),(0,R.jsx)(`button`,{type:`button`,className:`card-link`,onClick:async()=>{try{await navigator.clipboard.writeText(s),o(n.name)}catch{o(``)}},children:a===n.name?`Copied`:`Copy`})]}),r===n.name&&(0,R.jsx)(qZ,{command:n})]},n.name)}),n.length===0&&(0,R.jsx)(`li`,{className:`card-muted`,children:`No commands declared.`})]})}function YZ({plugin:e}){return(0,R.jsx)(jZ,{plugin:e})}function XZ(){let{activity:e}=HZ();return e.length===0?(0,R.jsx)(`p`,{className:`card-muted`,children:`No commands have run from this card in this session.`}):(0,R.jsx)(`ul`,{className:`card-list`,children:e.slice(0,20).map((e,t)=>(0,R.jsxs)(`li`,{children:[(0,R.jsx)(GZ,{tone:e.ok?`ok`:`error`,children:e.ok?`ok`:`failed`}),` `,e.command,` · `,e.ms,` ms · `,new Date(e.at).toLocaleTimeString()]},t))})}var ZZ={system:`system-ui, -apple-system, "Segoe UI", sans-serif`,inter:`Inter, system-ui, sans-serif`,"ibm-plex":`"IBM Plex Sans", system-ui, sans-serif`,"space-grotesk":`"Space Grotesk", system-ui, sans-serif`,"jetbrains-mono":`"JetBrains Mono", ui-monospace, monospace`,"dm-sans":`"DM Sans", system-ui, sans-serif`,outfit:`Outfit, system-ui, sans-serif`,fraunces:`Fraunces, Georgia, serif`,newsreader:`Newsreader, Georgia, serif`,"chivo-mono":`"Chivo Mono", ui-monospace, monospace`},QZ={none:`0px`,sm:`3px`,md:`8px`,lg:`14px`,pill:`22px`},$Z={compact:`8px`,comfortable:`14px`,spacious:`22px`};function eQ(e){let[t,n,r]=[1,3,5].map(t=>parseInt(e.slice(t,t+2),16)/255).map(e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4);return .2126*t+.7152*n+.0722*r}var tQ=(e,t)=>{let[n,r]=[eQ(e),eQ(t)].sort((e,t)=>t-e);return(n+.05)/(r+.05)},nQ=e=>tQ(e,`#ffffff`)>=tQ(e,`#111111`)?`#ffffff`:`#111111`;function rQ(e){return{"--card-color":e.color,"--card-accent":e.accent,"--card-on-color":nQ(e.color),"--card-on-accent":nQ(e.accent),"--card-font":ZZ[e.font]||ZZ.system,"--card-radius":QZ[e.radius],"--card-gap":$Z[e.density],fontFamily:`var(--card-font)`}}function iQ({plugin:e,card:t}){let n=t.workspace?.component,r=kZ(e).find(e=>e.id===n||e.tag===n);return r?t.workspace?.permissions?.length?(0,R.jsx)(`p`,{role:`status`,children:`This workspace requires device access that the host does not support yet.`}):(0,R.jsx)(AZ,{plugin:e,elementId:r.id}):(0,R.jsx)(`p`,{role:`status`,children:`This plugin has not supplied its workspace interface yet.`})}var aQ={agent:`direct`,node:`local`,permissions:{read:!0,write:!1,send:!1,destructive:!1}},oQ={read:`Read commands`,write:`Write commands`,send:`Send commands`,destructive:`Delete commands`},sQ;function cQ(){let{execution:e,setExecution:t,busy:n}=HZ(),r=e||aQ,[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(``),m=(0,_.useRef)(0),h=async e=>{let t=++m.current;d(!0),l([]),p(``);try{let n=await L(`${I}/api/plugins/execution-targets?node=${encodeURIComponent(e)}`),r=await n.json();if(!n.ok||!r.success)throw Error(r.error||`Could not inspect this node`);t===m.current&&l(r.agents||[])}catch(e){t===m.current&&p(e instanceof Error?e.message:`Could not inspect this node`)}finally{t===m.current&&d(!1)}},g=async()=>{if(a(!i),!i){d(!0),p(``);try{if(!sQ||Date.now()-sQ.at>6e4){let e=await L(`${I}/api/plugins/execution-targets`),t=await e.json();if(!e.ok||!t.success)throw Error(t.error||`CLI agents is unavailable`);sQ={at:Date.now(),data:t}}s(sQ.data.nodes||[]),await h(r.node)}catch(e){p(e instanceof Error?e.message:`CLI agents is unavailable`),d(!1)}}};return(0,R.jsxs)(`div`,{className:`card-execution`,children:[(0,R.jsx)(`button`,{type:`button`,className:`card-link`,onClick:()=>void g(),"aria-expanded":i,children:`Agent, node & permissions`}),i&&(0,R.jsxs)(`fieldset`,{className:`card-form`,disabled:u||n.size>0,children:[(0,R.jsx)(`legend`,{children:`Command execution`}),(0,R.jsxs)(`label`,{children:[`Mesh node`,(0,R.jsxs)(`select`,{value:r.node,onChange:e=>{let n=e.target.value;t({...r,node:n,agent:`direct`,cwd:void 0}),h(n)},children:[(0,R.jsx)(`option`,{value:`local`,children:`This node`}),o.filter(e=>!e.self).map(e=>(0,R.jsxs)(`option`,{value:e.id,disabled:!e.online||!e.accessConfigured,children:[e.name,e.online?e.accessConfigured?``:` · access needed`:` · offline`]},e.id))]})]}),(0,R.jsxs)(`label`,{children:[`CLI agent`,(0,R.jsxs)(`select`,{value:r.agent,onChange:e=>t({...r,agent:e.target.value,allowUnknownAuth:e.target.value!==`direct`}),children:[(0,R.jsx)(`option`,{value:`direct`,children:`Direct CLI`}),c.map(e=>(0,R.jsxs)(`option`,{value:e.id,disabled:!e.installed||!e.versionVerified||e.authenticated===!1,children:[e.name,e.installed?e.authenticated===!1?` · sign in needed`:e.authenticated===`unknown`?` · account unchecked`:``:` · not installed`]},e.id))]})]}),r.node!==`local`&&(0,R.jsxs)(`label`,{children:[`Workspace on selected node`,(0,R.jsx)(`input`,{value:r.cwd||``,placeholder:`/absolute/workspace`,onChange:e=>t({...r,cwd:e.target.value})})]}),(0,R.jsx)(`div`,{className:`card-permissions`,children:Object.keys(oQ).map(e=>(0,R.jsxs)(`label`,{children:[(0,R.jsx)(`input`,{type:`checkbox`,role:`switch`,checked:r.permissions[e],onChange:n=>t({...r,permissions:{...r.permissions,[e]:n.target.checked}})}),oQ[e]]},e))}),(0,R.jsx)(`button`,{type:`button`,className:`card-link`,onClick:()=>void h(r.node),children:`Refresh installed agents`})]}),u&&(0,R.jsx)(`p`,{role:`status`,className:`card-muted`,children:`Inspecting installed agents…`}),f&&(0,R.jsx)(`p`,{role:`alert`,className:`card-error`,children:f})]})}function lQ({plugin:e,children:t}){let{card:n,busy:r}=HZ(),[i,a]=(0,_.useState)(e.activation?.enabled!==!1);(0,_.useEffect)(()=>{a(e.activation?.enabled!==!1)},[e.id,e.activation?.enabled]);let[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)({}),[f,p]=(0,_.useState)(!1),[m,h]=(0,_.useState)([]),[g,v]=(0,_.useState)(``),y=(0,_.useRef)([]);(0,_.useEffect)(()=>{y.current=[],h([]),v(``),p(!1);let t=t=>{let n=t.detail;n?.pluginId===e.id&&d(e=>{let t={...e};return n.running?t[n.requestId]=n.command:delete t[n.requestId],t})},n=t=>{t.detail?.pluginId===e.id&&p(!0)},r=t=>{let n=t.detail;if(n?.pluginId!==e.id)return;let r=TZ(n.screens);y.current=r,h(r),v(e=>r.some(t=>t.id===e)?e:r[0]?.id||``)},i=t=>{let n=t.detail;n?.pluginId===e.id&&y.current.some(e=>e.id===n.screen)&&v(n.screen)};return window.addEventListener(`plugin-command-activity`,t),window.addEventListener(`plugin-context-menu`,n),window.addEventListener(`plugin-screens`,r),window.addEventListener(`plugin-screen-changed`,i),()=>{window.removeEventListener(`plugin-command-activity`,t),window.removeEventListener(`plugin-context-menu`,n),window.removeEventListener(`plugin-screens`,r),window.removeEventListener(`plugin-screen-changed`,i)}},[e.id]);let b=[...r,...Object.values(u)],x=t=>{m.some(e=>e.id===t)&&(p(!1),window.dispatchEvent(new CustomEvent(`plugin-show-screen`,{detail:{pluginId:e.id,screen:t}})))},S=e=>{if(m.length<2)return;let t=Math.max(0,m.findIndex(e=>e.id===g));x(m[(t+e+m.length)%m.length].id)},C=async()=>{s(!0),l(``);try{let t=await L(`${I}/api/plugins/${encodeURIComponent(e.id)}/activation`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({enabled:!i})}),n=await t.json();if(n.activation&&a(n.activation.enabled),!t.ok||!n.success)throw Error(n.compilation?.error||n.error||`Activation could not be changed`)}catch(e){l(e instanceof Error?e.message:`Activation could not be changed`)}finally{s(!1)}};return(0,R.jsxs)(`div`,{className:`card-scenes`,"data-state":i?`active`:`inactive`,"aria-busy":b.length>0||o,onContextMenu:e=>{e.preventDefault(),p(!0)},onKeyDown:e=>{e.key===`Escape`&&p(!1),e.key===`F10`&&e.shiftKey&&(e.preventDefault(),p(!0))},children:[(0,R.jsxs)(`div`,{className:`card-row card-scene-controls`,children:[(0,R.jsx)(`span`,{role:`status`,className:`card-pill`,children:b.length?`Running ${b.join(`, `)}`:i?`Active`:`Inactive`}),(0,R.jsx)(`button`,{type:`button`,className:`card-button`,role:`switch`,"aria-checked":i,"aria-label":`${n.title} on or off`,onClick:()=>void C(),disabled:o||b.length>0,children:o?`Updating…`:i?`Turn off`:`Turn on`}),(0,R.jsx)(`button`,{type:`button`,className:`card-link`,"aria-label":`Previous screen`,disabled:m.length<2,onClick:()=>S(-1),children:`←`}),(0,R.jsx)(`button`,{type:`button`,className:`card-link`,"aria-label":`Next screen`,disabled:m.length<2,onClick:()=>S(1),children:`→`}),m.length>0&&(0,R.jsx)(`span`,{className:`card-pill`,"aria-label":`Current screen`,children:m.find(e=>e.id===g)?.label}),m.length>0&&(0,R.jsx)(`button`,{type:`button`,className:`card-link`,"aria-haspopup":`menu`,"aria-expanded":f,onClick:()=>p(!f),children:`Screens`})]}),f&&m.length>0&&(0,R.jsx)(`div`,{role:`menu`,"aria-label":`${n.title} declared screens`,className:`card-context-menu`,children:m.map(e=>(0,R.jsx)(`button`,{role:`menuitem`,type:`button`,className:`card-link`,"aria-current":e.id===g?`page`:void 0,onClick:()=>x(e.id),children:e.label},e.id))}),c&&(0,R.jsx)(`p`,{role:`alert`,className:`card-error`,children:c}),(0,R.jsx)(cQ,{}),(0,R.jsx)(`div`,{className:`card-scene-track`,tabIndex:0,"aria-label":`${n.title} interface`,children:(0,R.jsx)(`section`,{className:`card-scene`,"aria-label":`Interface`,children:t})})]})}function uQ(e){let[t,n]=(0,_.useState)(``);return(0,_.useEffect)(()=>{if(!e.branding.logo)return;let t=``,r=!1;return L(`${I}/api/plugins/${encodeURIComponent(e.id)}/logo`).then(e=>e.ok?e.blob():Promise.reject(Error(`no logo`))).then(e=>{r||(t=URL.createObjectURL(e),n(t))}).catch(()=>{r||n(``)}),()=>{r=!0,t&&URL.revokeObjectURL(t)}},[e.id,e.branding.logo]),t}function dQ({card:e,onOpenDrawer:t}){let n=uQ(e),{branding:r,distribution:i}=e,a=!!e.workspace;return(0,R.jsxs)(`header`,{className:`card-header card-header-${r.header}`,children:[(0,R.jsxs)(`div`,{className:`card-brand`,children:[n?(0,R.jsx)(`img`,{className:`card-logo`,src:n,alt:`${r.provider?.name||r.name} logo`}):(0,R.jsx)(`span`,{className:`card-logo-missing`,"aria-hidden":`true`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{children:r.name}),r.badge&&(0,R.jsx)(`span`,{className:`card-badge`,children:r.badge}),i&&(0,R.jsxs)(`span`,{className:`card-badge card-badge-quiet`,children:[i.tier,` · `,i.license===`open`?`open source`:`service`]})]})]}),(0,R.jsx)(`button`,{type:`button`,className:`card-button card-button-quiet`,onClick:t,children:a?`Open workspace`:`Settings & usage`})]})}function fQ({plugin:e,card:t,onClose:n}){let r=!!t.workspace,[i,a]=(0,_.useState)(r?`workspace`:`settings`),o=(0,_.useRef)(null),s=(0,_.useRef)(n);(0,_.useEffect)(()=>{s.current=n},[n]),(0,_.useEffect)(()=>{let e=document.activeElement instanceof HTMLElement?document.activeElement:null,t=()=>Array.from(o.current?.querySelectorAll(`button:not(:disabled), a[href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex="0"]`)||[]);t()[0]?.focus();let n=e=>{if(e.key===`Escape`){e.preventDefault(),s.current();return}if(e.key!==`Tab`)return;let n=t(),r=n[0],i=n[n.length-1];r?!o.current?.contains(document.activeElement)||e.shiftKey&&document.activeElement===r?(e.preventDefault(),(e.shiftKey?i:r).focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r.focus()):(e.preventDefault(),o.current?.focus())};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n),e?.isConnected&&e.focus()}},[]);let c=r?[`workspace`,`settings`,`commands`,`usage`]:[`settings`,`commands`,`usage`];return(0,R.jsxs)(`aside`,{ref:o,tabIndex:-1,className:`card-drawer`,role:`dialog`,"aria-modal":`true`,"aria-label":`${t.title} settings`,children:[(0,R.jsxs)(`div`,{className:`card-drawer-head`,children:[(0,R.jsx)(`strong`,{children:t.title}),(0,R.jsx)(`button`,{type:`button`,className:`card-link`,onClick:n,"aria-label":`Close`,children:`Close`})]}),(0,R.jsx)(`nav`,{className:`card-tabs`,role:`tablist`,children:c.map(e=>(0,R.jsx)(`button`,{role:`tab`,type:`button`,"aria-selected":i===e,onClick:()=>a(e),children:e===`workspace`?`Workspace`:e===`settings`?`Settings`:e===`commands`?`Commands`:`Session activity`},e))}),(0,R.jsxs)(`div`,{className:`card-drawer-body`,children:[i===`workspace`&&(0,R.jsx)(iQ,{plugin:e,card:t}),i===`settings`&&(0,R.jsx)(YZ,{plugin:e}),i===`commands`&&(0,R.jsx)(JZ,{}),i===`usage`&&(0,R.jsx)(XZ,{})]})]})}function pQ({plugin:e}){let t=(0,_.useMemo)(()=>IZ(e),[e]),[n,r]=(0,_.useState)(!1);return(0,R.jsx)(UZ,{card:t,children:(0,R.jsxs)(`section`,{className:`card card-bespoke${t.face?` card-owned`:``}`,style:rQ(t.branding),"data-density":t.branding.density,"aria-label":`${t.title} card`,children:[(0,R.jsx)(dQ,{card:t,onOpenDrawer:()=>r(!0)}),t.description&&(0,R.jsx)(`p`,{className:`card-muted card-description`,children:t.description}),(0,R.jsx)(lQ,{plugin:e,children:t.face?(0,R.jsx)(AZ,{plugin:e,elementId:t.face.id,readOnly:!0}):(0,R.jsxs)(`p`,{className:`card-error`,role:`alert`,children:[e.name,` has not supplied its card face.`]})}),t.branding.provider&&(0,R.jsxs)(`footer`,{className:`card-footer`,children:[t.branding.provider.url?(0,R.jsx)(`a`,{href:t.branding.provider.url,target:`_blank`,rel:`noreferrer noopener`,children:t.branding.provider.name}):t.branding.provider.name,` is a trademark of its owner. This plugin connects to the service with your own account.`]}),n&&(0,R.jsx)(fQ,{plugin:e,card:t,onClose:()=>r(!1)})]})})}var mQ={ok:`online`,offline:`offline`,unreachable:`unreachable`,not_configured:`mesh sync not configured`,unsupported:`no plugin sharing (older version)`,error:`error`},hQ={fontFamily:`var(--font-mono)`,fontSize:`12px`},gQ={color:`var(--text-secondary)`,fontSize:`13px`,lineHeight:1.5},_Q=new Set([`auth`,`mesh`,`openwiki`,`composable-cli`,`cli-agents`,`code-quality`,`security`,`embeddings`,`git-sentinel`]),vQ=`You are my coding agent. Author a bespoke Total Recall plugin for [DOMAIN] following the Total Recall Plugin Recipe:
|
|
5600
|
+
<\/script></body></html>`}function DZ(e){let t=e?.cli;return Object.fromEntries((t?.subcommands||[]).filter(e=>Number.isInteger(e.timeout_ms)&&e.timeout_ms>=1&&e.timeout_ms<=6e5).map(e=>[e.name,e.timeout_ms]))}function OZ(e,t,n=new Set){if(!e||typeof e!=`object`)return!1;let r=e;return typeof r.requestId==`string`&&r.requestId.length<=64&&typeof r.subcommand==`string`&&t.has(r.subcommand)&&(r.stdin===void 0||n.has(r.subcommand)&&typeof r.stdin==`string`&&r.stdin.length>0&&new TextEncoder().encode(r.stdin).length<=65536)&&Array.isArray(r.args)&&r.args.length<=64&&r.args.every(e=>typeof e==`string`&&e.length<=8192)&&r.args.reduce((e,t)=>e+t.length,0)<=32768}function kZ(e){return e.manifest?.ui?.elements||e.ui?.elements||[]}function AZ({plugin:e,elementId:t,readOnly:n=!1}){let r=kZ(e).filter(e=>e.kind!==`settings`&&(!t||e.id===t)),i=r.find(e=>e.kind===`card`),[a,o]=(0,_.useState)(t||i?.id||r[0]?.id||``),[s,c]=(0,_.useState)(``),l=(0,_.useRef)(null),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(240);(0,_.useEffect)(()=>{let t=!1;c(``),d(``);let i=crypto.randomUUID(),o=e.manifest?.cli,s=new Set((o?.subcommands||[]).filter(e=>e.effect===`read`).map(e=>e.name)),u=new Set((e.cli?.subcommands||[]).filter(e=>!n||s.has(e.name)).map(e=>e.name)),f=new Set((o?.subcommands||[]).filter(e=>{let t=e.args?.filter(e=>e.secret===!0)||[];return t.length===1&&t[0].type===`string`&&t[0].flag===void 0}).map(e=>e.name)),m=r.find(e=>e.id===a)||r[0],h=[],g=n=>{let r=n.detail;!t&&m?.kind===`card`&&r?.pluginId===e.id&&h.some(e=>e.id===r.screen)&&l.current?.contentWindow?.postMessage({channel:i,type:`show-screen`,screen:r.screen},`*`)},_=0,v=async n=>{if(t||n.source!==l.current?.contentWindow||n.origin!==`null`||n.data?.channel!==i)return;let r=n.data;if(r.type===`screens`){m?.kind===`card`&&(h=TZ(r.screens),window.dispatchEvent(new CustomEvent(`plugin-screens`,{detail:{pluginId:e.id,screens:h}})));return}if(r.type===`screen-changed`){m?.kind===`card`&&h.some(e=>e.id===r.screen)&&window.dispatchEvent(new CustomEvent(`plugin-screen-changed`,{detail:{pluginId:e.id,screen:r.screen}}));return}if(r.type===`contextmenu`&&window.dispatchEvent(new CustomEvent(`plugin-context-menu`,{detail:{pluginId:e.id}})),r.type===`height`&&Number.isFinite(r.height)&&p(Math.max(128,Math.min(1e3,r.height))),r.type===`error`&&c(`Could not open the plugin interface`),r.type!==`run`)return;let a=n.source,o=(e,n)=>{t||a.postMessage({channel:i,type:`result`,requestId:r.requestId,result:e,error:n},`*`)};if(!OZ(r,u,f)||_>=12)o(void 0,`Operation is not available`);else{_++,window.dispatchEvent(new CustomEvent(`plugin-command-activity`,{detail:{pluginId:e.id,requestId:r.requestId,command:r.subcommand,running:!0}}));try{let t=r.stdin===void 0?await gi(e.id,r.subcommand,[...r.args,`--json`]):await gi(e.id,r.subcommand,[...r.args,`--json`],{stdin:r.stdin});if(!t.success){o(void 0,r.stdin===void 0?t.output||t.error||`Operation failed`:`Credential operation failed`);return}o(r.stdin===void 0?JSON.parse(t.output||`{}`):{ok:!0})}catch{o(void 0,`Operation failed`)}finally{_--,window.dispatchEvent(new CustomEvent(`plugin-command-activity`,{detail:{pluginId:e.id,requestId:r.requestId,command:r.subcommand,running:!1}}))}}};return window.addEventListener(`message`,v),window.addEventListener(`plugin-show-screen`,g),m&&(async()=>{let n=await L(`${I}/api/plugins/${encodeURIComponent(e.id)}/ui/${encodeURIComponent(m.id)}`);if(!n.ok)throw Error(`Could not open ${e.name} (${n.status})`);let r=await n.text();if(r.length>1048576)throw Error(`The plugin interface is too large`);if(t)return;let a=getComputedStyle(window.document.documentElement),o={};for(let e of[`--text-primary`,`--text-secondary`,`--text-tertiary`,`--bg-primary`,`--bg-secondary`,`--border`,`--accent`,`--font-sans`,`--color-text`,`--color-surface`,`--color-border`,`--spacing-md`,`--radius-md`])o[e]=a.getPropertyValue(e);d(EZ(r,m.tag,i,o,e.id,DZ(e.manifest),[...u]))})().catch(e=>{t||c(e.message)}),()=>{t=!0,window.removeEventListener(`message`,v),window.removeEventListener(`plugin-show-screen`,g),m?.kind===`card`&&window.dispatchEvent(new CustomEvent(`plugin-screens`,{detail:{pluginId:e.id,screens:[]}}))}},[e.id,a,e.sha256,t,n]);let m=r.find(e=>e.id===a)||r[0],h=r.length>1&&m?.kind!==`card`;return(0,R.jsxs)(`section`,{children:[h&&(0,R.jsx)(`nav`,{style:{display:`flex`,gap:8},children:r.map(e=>(0,R.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>o(e.id),"aria-pressed":a===e.id,children:e.description||e.id},e.id))}),s&&(0,R.jsx)(`div`,{role:`alert`,className:`alert alert-error`,children:s}),r.length===0&&(0,R.jsx)(`p`,{children:`This plugin has not supplied its interface yet.`}),u&&(0,R.jsx)(`iframe`,{ref:l,title:`${e.name} interface`,sandbox:`allow-scripts`,referrerPolicy:`no-referrer`,allow:`camera 'none'; microphone 'none'; geolocation 'none'; clipboard-read 'none'; clipboard-write 'none'`,srcDoc:u,style:{width:`100%`,height:f,border:0}})]})}function jZ({plugin:e}){let[t,n]=(0,_.useState)(new Set),[r,i]=(0,_.useState)({}),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)([]),[p,m]=(0,_.useState)({});(0,_.useEffect)(()=>{let t=!1;return i({}),c(``),u(``),L(`${I}/api/plugins/auth/secrets`).then(async e=>{if(!e.ok)return[];let r=await e.json();!t&&Array.isArray(r)&&n(new Set(r.map(e=>e.key)))}).catch(e=>{t||u(e.message)}),L(`${I}/api/plugins/${encodeURIComponent(e.id)}/configuration`).then(async e=>{if(!e.ok)throw Error(`Could not load plugin settings`);let n=await e.json();t||(f(n.fields),m(Object.fromEntries(n.fields.map(e=>[e.name,n.values[e.name]??e.default??(e.type!==`boolean`&&``)]))))}).catch(e=>{t||u(e.message)}),()=>{t=!0}},[e.id]);async function h(t){o(t),u(``),c(``);try{let a=await L(e.manifest?.runtime&&e.manifest.runtime.modules?.credentials?`${I}/api/plugins/${encodeURIComponent(e.id)}/credentials`:`${I}/api/plugins/auth/secrets`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({key:t,value:r[t],tags:[`plugin:${e.id}`]})});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(e.error||`Failed to save secret`)}i(e=>({...e,[t]:``})),n(e=>new Set([...e,t])),c(`Credential saved. Open the plugin to verify the connection.`)}catch(e){u(e.message)}finally{o(``)}}async function g(){o(`configuration`),u(``),c(``);try{let t=await L(`${I}/api/plugins/${encodeURIComponent(e.id)}/configuration`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({values:p})}),n=await t.json();if(!t.ok)throw Error(n.error||`Could not save settings`);m(n.values),c(`Settings saved.`)}catch(e){u(e.message)}finally{o(``)}}return(0,R.jsxs)(`section`,{style:{marginBottom:24},children:[(0,R.jsx)(`h3`,{children:`Configuration`}),d.length>0?(0,R.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),g()},children:[d.map(e=>(0,R.jsxs)(`label`,{style:{display:`block`,marginBottom:12},children:[e.label,e.options?(0,R.jsxs)(`select`,{className:`select`,value:String(p[e.name]??``),onChange:t=>m(n=>({...n,[e.name]:e.type===`number`?Number(t.target.value):t.target.value})),children:[(0,R.jsx)(`option`,{value:``,children:`Choose…`}),e.options.map(e=>(0,R.jsx)(`option`,{value:String(e),children:String(e)},String(e)))]}):(0,R.jsx)(`input`,{className:`input`,type:e.type===`boolean`?`checkbox`:e.type===`number`?`number`:`text`,required:e.required,checked:e.type===`boolean`?!!p[e.name]:void 0,value:e.type===`boolean`?void 0:String(p[e.name]??``),onChange:t=>m(n=>({...n,[e.name]:e.type===`boolean`?t.target.checked:e.type===`number`?Number(t.target.value):t.target.value}))})]},e.name)),(0,R.jsx)(`button`,{className:`btn btn-sm btn-primary`,disabled:!!a,children:a===`configuration`?`Saving…`:`Save settings`})]}):(0,R.jsx)(`p`,{children:`No settings declared.`}),(0,R.jsx)(`h3`,{children:`Credentials`}),l&&(0,R.jsx)(`div`,{role:`alert`,className:`alert alert-error`,children:l}),s&&(0,R.jsx)(`p`,{role:`status`,children:s}),(e.secrets||[]).length===0&&(0,R.jsx)(`p`,{children:`No credentials required.`}),(e.secrets||[]).map((e,n)=>{let o=`Credential ${n+1}${e.required?` (required)`:` (optional)`}`;return(0,R.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),h(e.key)},style:{marginBottom:16},children:[(0,R.jsxs)(`label`,{style:{display:`block`,marginBottom:6},children:[o,` · `,t.has(e.key)?`Saved`:`Not saved`,(0,R.jsx)(`input`,{className:`input`,type:`password`,autoComplete:`new-password`,value:r[e.key]||``,placeholder:t.has(e.key)?`Paste a replacement`:`Paste credential`,onChange:t=>i(n=>({...n,[e.key]:t.target.value}))})]}),(0,R.jsx)(`button`,{className:`btn btn-sm btn-primary`,disabled:!r[e.key]?.trim()||!!a,children:a===e.key?`Saving…`:`Save credential`})]},e.key)})]})}var MZ={ok:`online`,offline:`offline`,unreachable:`unreachable`,not_configured:`mesh sync not configured`,unsupported:`no plugin sharing (older version)`,error:`error`},NZ={fontFamily:`var(--font-mono)`,fontSize:`12px`},PZ={color:`var(--text-secondary)`,fontSize:`13px`,lineHeight:1.5},FZ=new Set([`auth`,`mesh`,`openwiki`,`composable-cli`,`cli-agents`,`code-quality`,`security`,`embeddings`,`git-sentinel`]),IZ=`You are my coding agent. Author a bespoke Total Recall plugin for [DOMAIN] following the Total Recall Plugin Recipe:
|
|
5601
5601
|
|
|
5602
5602
|
1. Scaffold:
|
|
5603
5603
|
total-recall scaffold-plugin <id> --title "<Name>" --description "<Description>"
|
|
@@ -5617,10 +5617,10 @@ try{
|
|
|
5617
5617
|
- Real interactive controls executing plugin subcommands via host.run(subcommand, args)
|
|
5618
5618
|
|
|
5619
5619
|
4. Distribution:
|
|
5620
|
-
- Private: keep in .agent/
|
|
5621
|
-
- Store: publish via total-recall deploy-store <id>`;function yQ(e){let t=e.branding||{};return{icon:t.icon||``,color:t.color||`#3b82f6`,badge:t.badge||`Plugin`}}function bQ(e){return e?`${e.slice(0,12)}…`:`—`}function xQ(e){return e==null?`—`:e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function SQ(e){switch(e.source.kind){case`peer`:return`from ${e.source.peer_hostname||`a peer`}`;case`bundled`:return`bundled`;case`git`:return`git`;case`public`:return`direct link`;case`link`:return`linked folder`;default:return`local folder`}}function CQ({useCases:e}){return e.length?(0,R.jsx)(`div`,{style:{display:`flex`,gap:`6px`,flexWrap:`wrap`},children:e.map(e=>(0,R.jsx)(`span`,{className:`badge`,style:{fontSize:`11px`},children:e},e))}):null}function wQ({label:e,children:t}){return(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`12px`,fontSize:`13px`,padding:`6px 0`,borderBottom:`1px solid var(--border)`},children:[(0,R.jsx)(`span`,{style:{width:`132px`,flexShrink:0,color:`var(--text-tertiary)`},children:e}),(0,R.jsx)(`span`,{style:{color:`var(--text-primary)`,minWidth:0,overflowWrap:`anywhere`},children:t})]})}function TQ({title:e,children:t}){return(0,R.jsxs)(`div`,{className:`card`,style:{textAlign:`center`,padding:`40px 24px`},children:[(0,R.jsx)(`div`,{style:{fontWeight:600,marginBottom:`6px`},children:e}),t&&(0,R.jsx)(`div`,{style:gQ,children:t})]})}function EQ({activeBrainId:e}){let[t,n]=Mn(),[r,i]=(0,_.useState)(`installed`),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)([]),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(!0),[h,g]=(0,_.useState)(``),[v,y]=(0,_.useState)(``),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)(!1),[E,D]=(0,_.useState)(``),[O,ee]=(0,_.useState)(!1),[k,te]=(0,_.useState)(!1),[A,j]=(0,_.useState)(null),[M,ne]=(0,_.useState)(`preview`),[N,re]=(0,_.useState)(``),[ie,ae]=(0,_.useState)(``),[oe,se]=(0,_.useState)(null),[ce,le]=(0,_.useState)(``),[ue,de]=(0,_.useState)(!1),[fe,pe]=(0,_.useState)(`workspace`),[me,he]=(0,_.useState)(()=>{try{let e=localStorage.getItem(`tr_workspace_plugins`);if(e)return new Set(JSON.parse(e))}catch{}return new Set}),[ge,_e]=(0,_.useState)(!1),[ve,ye]=(0,_.useState)(null),[be,xe]=(0,_.useState)(``),[Se,Ce]=(0,_.useState)(`#3b82f6`),[P,we]=(0,_.useState)(``),[Te,Ee]=(0,_.useState)(null),F=(0,_.useRef)(null),De=(e,t)=>{if(t.touches.length!==1)return;let n=t.touches[0],r=n.clientX,i=n.clientY;F.current=setTimeout(()=>{if(`vibrate`in navigator)try{navigator.vibrate(50)}catch{}Ee({plugin:e,x:r,y:i})},500)},Oe=()=>{F.current&&=(clearTimeout(F.current),null)},ke=(e,t)=>{t.preventDefault(),t.stopPropagation(),Ee({plugin:e,x:t.clientX,y:t.clientY})};(0,_.useEffect)(()=>{let e=()=>Ee(null);return window.addEventListener(`pointerdown`,e),()=>window.removeEventListener(`pointerdown`,e)},[]);let Ae=(0,_.useCallback)(async()=>{m(!0);try{let[e,t]=await Promise.all([ai(),si()]);o(e),c(t)}finally{m(!1)}},[]),je=(0,_.useCallback)(async()=>{f(!0);try{u(await ci())}finally{f(!1)}},[]);(0,_.useEffect)(()=>{Ae()},[Ae,e]),(0,_.useEffect)(()=>{r===`mesh`&&l===null&&!d&&je()},[r,l,d,je]);let Me=(0,_.useMemo)(()=>{let e=new Set;for(let t of a)t.use_cases.forEach(t=>e.add(t));for(let t of s)t.use_cases.forEach(t=>e.add(t));for(let t of l?.peers||[])t.plugins.forEach(t=>t.use_cases.forEach(t=>e.add(t)));return Array.from(e).sort()},[a,s,l]),Ne=(0,_.useCallback)(e=>{if(v&&!e.use_cases.includes(v))return!1;let t=h.trim().toLowerCase();return!t||[e.id,e.name,e.description,...e.use_cases].some(e=>e.toLowerCase().includes(t))},[h,v]),Pe=(0,_.useCallback)(e=>!!(e.scope===`project`||_Q.has(e.id)||me.has(e.id)),[me]),Fe=async e=>{x(e.id);try{let t=new Set(me);t.add(e.id),he(t);try{localStorage.setItem(`tr_workspace_plugins`,JSON.stringify([...t]))}catch{}await mi(e.id,!0),C({type:`success`,message:`Added ${e.name} to workspace dashboard`}),await Ae()}catch(t){C({type:`error`,message:t?.message||`Could not activate ${e.name}`})}finally{x(null)}},Ie=async e=>{x(e.id);try{let t=new Set(me);t.delete(e.id),he(t);try{localStorage.setItem(`tr_workspace_plugins`,JSON.stringify([...t]))}catch{}await mi(e.id,!1),C({type:`success`,message:`Moved ${e.name} from workspace to Plugin Store`}),await Ae()}catch(t){C({type:`error`,message:t?.message||`Could not deactivate ${e.name}`})}finally{x(null)}},Le=()=>{navigator.clipboard?.writeText(vQ),C({type:`success`,message:`Copied Agent Plugin Recipe prompt to clipboard`})},Re=async(e,t={})=>{x(e),C(null);let n=await li({source:e,...t});return x(null),n.success?(C({type:`success`,message:n.message||`Installed ${e}`}),await Ae(),l&&je(),!0):(C({type:`error`,message:n.error||`Could not install ${e}`}),!1)},ze=async e=>{if(!window.confirm(`Remove "${e.name}" (${e.scope})?`))return;x(e.id);let t=await ui(e.id,e.scope===`global`);x(null),C(t.success?{type:`success`,message:`Removed ${e.name}`}:{type:`error`,message:t.error||`Remove failed`}),t.success&&(A?.id===e.id&&Ke(),Ae())},Be=async(e,t)=>{x(e.id);let n=await di(e.id,t);x(null),n.success?(n.plugin&&A?.id===e.id&&j(n.plugin),C({type:`success`,message:t?`${e.name} is shared. Its public link is in the details.`:`${e.name} is no longer shared`}),Ae()):C({type:`error`,message:n.error||`Could not change sharing`})},Ve=async e=>{x(e.id);let t=!e.locked,n=await pi(e.id,t);x(null),n.success?(n.plugin&&A?.id===e.id&&j(n.plugin),C({type:`success`,message:t?`${e.name} is locked against further editing.`:`${e.name} is unlocked for editing.`}),Ae()):C({type:`error`,message:n.error||`Could not update lock status`})},He=async e=>{x(e.id);let t=await hi(e.id,!0);x(null),t.success?(t.plugin&&A?.id===e.id&&j(t.plugin),C({type:`success`,message:`${e.name} deployed to the plugin store and locked as complete.`}),Ae()):C({type:`error`,message:t.error||`Could not deploy plugin to store`})},Ue=e=>{let t=yQ(e);ye(e),xe(t.icon),Ce(t.color),we(t.badge),_e(!0)},We=async()=>{if(!ve)return;if(ve.locked){C({type:`error`,message:`Plugin is locked. Unlock it before editing branding.`}),_e(!1);return}x(ve.id);let e=await fi(ve.id,{icon:be.trim()||void 0,color:Se.trim()||void 0,badge:P.trim()||void 0});x(null),_e(!1),e.success?(C({type:`success`,message:`Updated branding for ${ve.name}`}),await Ae(),A?.id===ve.id&&e.plugin&&j(e.plugin)):C({type:`error`,message:e.error||`Could not save branding`})},Ge=async(e,t=`preview`)=>{j(await oi(e.id)||e),ne(t),re(e.cli?.subcommands?.[0]?.name||``),ae(``),se(null),le(``),le(await _i(e.id))},Ke=()=>{if(j(null),t.has(`id`)){let e=new URLSearchParams(t);e.delete(`id`),n(e)}};(0,_.useEffect)(()=>{let e=t.get(`id`);if(!e||A?.id===e)return;let n=a.find(t=>t.id===e);n&&Ge(n)},[t,a]),(0,_.useEffect)(()=>{if(!A)return;let e=a.find(e=>e.id===A.id);e&&e!==A&&j(e)},[a]);let qe=async()=>{if(!A)return;x(`run:${A.id}`);let e=await gi(A.id,N,ie.trim()?ie.trim().split(/\s+/):[]);x(null),e.error?se({text:e.error,ok:!1}):se({text:(e.output||``).trim()||`(no output)`,ok:e.success})},Je=a.filter(Ne),Ye=Je.filter(Pe),Xe=fe===`workspace`?Ye:Je,Ze=(0,_.useMemo)(()=>{let e=new Map;for(let t of s){let n=a.find(e=>e.id===t.id);e.set(t.id,{id:t.id,name:t.name,version:t.version,description:t.description,use_cases:t.use_cases||[],installed:t.installed||!!n,inWorkspace:n?Pe(n):!1,sourcePlugin:n,branding:t.branding||(n?n.branding:void 0),cli:t.cli||(n?n.cli:null),tasks:t.tasks||(n?n.tasks:[]),secrets:n?.secrets||[]})}for(let t of a)e.has(t.id)||e.set(t.id,{id:t.id,name:t.name,version:t.version,description:t.description,use_cases:t.use_cases||[],installed:!0,inWorkspace:Pe(t),sourcePlugin:t,branding:t.branding,cli:t.cli,tasks:t.tasks,secrets:t.secrets||[]});return Array.from(e.values())},[s,a,Pe]).filter(Ne),Qe=(e,t,n)=>(0,R.jsxs)(`button`,{role:`tab`,"aria-selected":r===e,className:`btn btn-sm ${r===e?`btn-primary`:`btn-ghost`}`,onClick:()=>i(e),children:[t,n!==void 0&&(0,R.jsx)(`span`,{style:{opacity:.75,fontWeight:500,marginLeft:`4px`},children:n})]},e);return(0,R.jsxs)(`div`,{className:`page`,style:{maxWidth:`100%`,padding:`0 20px`,margin:`0 auto`,width:`100%`},children:[(0,R.jsxs)(`div`,{className:`page-header`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,gap:`16px`,flexWrap:`wrap`},children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{children:`Plugins`}),(0,R.jsx)(`p`,{children:`Modular capability system for Total Recall and SSSS apps — memory categories, agent context, commands, and design-token UI. Customizable branding, locked release status, and direct store deployment are managed on each card.`})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`8px`},children:[(0,R.jsx)(`button`,{className:`btn btn-ghost`,onClick:()=>de(!0),children:`Agent Recipe`}),(0,R.jsx)(`button`,{className:`btn btn-primary`,onClick:()=>{T(!0),C(null)},children:`Install from source…`})]})]}),S&&(0,R.jsxs)(`div`,{className:`alert ${S.type===`success`?`alert-success`:`alert-error`}`,role:`status`,style:{display:`flex`,justifyContent:`space-between`,gap:`12px`,marginBottom:`20px`},children:[(0,R.jsx)(`span`,{children:S.message}),(0,R.jsx)(`button`,{onClick:()=>C(null),"aria-label":`Dismiss`,style:{background:`none`,border:`none`,color:`inherit`,cursor:`pointer`},children:`×`})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:`12px`,flexWrap:`wrap`,marginBottom:`20px`},children:[(0,R.jsxs)(`div`,{role:`tablist`,style:{display:`flex`,gap:`8px`},children:[Qe(`installed`,`My Cards`,Ye.length),Qe(`bundled`,`Plugin Store (Bundled)`,Ze.length),Qe(`mesh`,`On the mesh`)]}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,flexWrap:`wrap`},children:[(0,R.jsx)(`input`,{className:`input`,placeholder:`Search plugins`,value:h,onChange:e=>g(e.target.value),"aria-label":`Search plugins`,style:{width:`220px`}}),(0,R.jsxs)(`select`,{className:`select`,value:v,onChange:e=>y(e.target.value),"aria-label":`Filter by use case`,style:{paddingRight:`32px`},children:[(0,R.jsx)(`option`,{value:``,children:`All use cases`}),Me.map(e=>(0,R.jsx)(`option`,{value:e,children:e},e))]})]})]}),r===`installed`&&(p?(0,R.jsx)(`div`,{style:gQ,children:`Loading…`}):(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`16px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,flexWrap:`wrap`,gap:`12px`},children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{style:{fontWeight:600,fontSize:`15px`},children:fe===`workspace`?`Active Workspace Cards`:`All Installed Plugins`}),(0,R.jsx)(`div`,{style:gQ,children:fe===`workspace`?`Core runtime foundation and activated repository cards. Optional tools live in the Plugin Store.`:`All plugin packages installed on this host.`})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`6px`},children:[(0,R.jsxs)(`button`,{type:`button`,className:`btn btn-xs ${fe===`workspace`?`btn-primary`:`btn-ghost`}`,onClick:()=>pe(`workspace`),children:[`Workspace (`,Ye.length,`)`]}),(0,R.jsxs)(`button`,{type:`button`,className:`btn btn-xs ${fe===`all`?`btn-primary`:`btn-ghost`}`,onClick:()=>pe(`all`),children:[`All Installed (`,a.length,`)`]})]})]}),Xe.length===0?(0,R.jsx)(TQ,{title:fe===`workspace`?`No workspace cards active`:`No plugins installed`,children:fe===`workspace`?(0,R.jsxs)(R.Fragment,{children:[`Explore the `,(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>i(`bundled`),children:`Plugin Store`}),` to add capabilities or ask your agent to author one.`]}):(0,R.jsxs)(R.Fragment,{children:[`Start with a `,(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>i(`bundled`),children:`bundled plugin`}),` or see what your peers share.`]})}):(0,R.jsx)(`div`,{className:`card-grid`,style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(min(100%, 720px), 1fr))`,gap:`22px`},children:Xe.map(e=>(0,R.jsxs)(`div`,{onContextMenu:t=>ke(e,t),onTouchStart:t=>De(e,t),onTouchEnd:Oe,style:{display:`flex`,flexDirection:`column`,gap:`8px`,minWidth:0},children:[(0,R.jsx)(pQ,{plugin:e}),(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`0 4px`,fontSize:`11px`,color:`var(--text-tertiary)`,flexWrap:`wrap`,gap:`6px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`6px`,alignItems:`center`,flexWrap:`wrap`},children:[(0,R.jsx)(`span`,{className:`badge`,children:e.scope}),(0,R.jsx)(`span`,{className:`badge`,children:SQ(e)}),e.shared&&(0,R.jsx)(`span`,{className:`badge badge-accent`,children:`shared`}),!e.valid&&(0,R.jsx)(`span`,{className:`badge badge-error`,children:`invalid manifest`}),e.modified_since_install&&(0,R.jsx)(`span`,{className:`badge badge-warning`,children:`changed since install`})]}),!_Q.has(e.id)&&(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-xs`,onClick:()=>Ie(e),style:{fontSize:`11px`,color:`var(--text-secondary)`},title:`Move back to Plugin Store`,children:`Remove from Workspace`})]})]},`${e.scope}:${e.id}`))})]})),r===`bundled`&&(p?(0,R.jsx)(`div`,{style:gQ,children:`Loading…`}):(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`20px`},children:[(0,R.jsx)(`div`,{className:`card`,style:{background:`linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%)`,border:`1px solid rgba(99, 102, 241, 0.3)`,padding:`20px`,display:`flex`,flexDirection:`column`,gap:`14px`},children:(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,gap:`16px`,flexWrap:`wrap`},children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,marginBottom:`4px`},children:[(0,R.jsx)(`span`,{className:`badge`,style:{background:`rgba(99, 102, 241, 0.2)`,color:`#818cf8`,borderColor:`rgba(99, 102, 241, 0.4)`,fontSize:`11px`},children:`AGENT RECIPE ARCHITECTURE`}),(0,R.jsx)(`span`,{style:{fontSize:`11px`,color:`var(--text-tertiary)`},children:`Declarative Recipes · Private or Store`})]}),(0,R.jsx)(`h2`,{style:{fontSize:`18px`,fontWeight:700,margin:0,color:`#f8fafc`},children:`Build Bespoke Plugins with Your Coding Agent`}),(0,R.jsx)(`p`,{style:{...gQ,margin:`6px 0 0 0`,maxWidth:`640px`},children:`Total Recall plugins are not generated by closed system templates; your contextual coding agent (Antigravity, Claude, Codex, DSH) builds them from a declarative Recipe. Run them privately in your workspace or publish them to the Plugin Store.`})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,flexWrap:`wrap`},children:[(0,R.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:()=>de(!0),children:`View Agent Recipe`}),(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:Le,children:`Copy Agent Prompt`}),(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>{T(!0),C(null)},children:`Install from source…`})]})]})}),Ze.length===0?(0,R.jsx)(TQ,{title:`No plugins match in store`}):(0,R.jsx)(`div`,{className:`card-grid`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(min(100%, 340px), 1fr))`,gap:`16px`},children:Ze.map(e=>{let t=yQ(e);return(0,R.jsxs)(`div`,{className:`card`,style:{display:`flex`,flexDirection:`column`,gap:`10px`,borderTop:`3px solid ${t.color}`,background:`var(--bg-secondary)`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:`8px`,alignItems:`flex-start`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`10px`,alignItems:`center`},children:[(0,R.jsx)(`div`,{style:{width:`34px`,height:`34px`,borderRadius:`8px`,background:`${t.color}20`,border:`1px solid ${t.color}40`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontWeight:700,fontSize:`12px`,color:t.color},children:t.icon||e.name.slice(0,2).toUpperCase()}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{style:{fontWeight:600,fontSize:`14px`,lineHeight:1.2},children:e.name}),(0,R.jsxs)(`div`,{style:{...hQ,color:`var(--text-tertiary)`,fontSize:`11px`},children:[e.id,` · v`,e.version]})]})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`flex-end`,gap:`4px`},children:[(0,R.jsx)(`span`,{className:`badge`,style:{background:`${t.color}15`,color:t.color,borderColor:`${t.color}35`,fontSize:`10px`},children:t.badge}),e.inWorkspace&&(0,R.jsx)(`span`,{className:`badge badge-success`,style:{fontSize:`10px`},children:`✓ In Workspace`})]})]}),(0,R.jsx)(`div`,{style:{...gQ,fontSize:`12px`,minHeight:`36px`},children:e.description}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`4px`,flexWrap:`wrap`,fontSize:`10px`},children:[e.cli&&(0,R.jsxs)(`span`,{className:`badge`,style:{fontFamily:`var(--font-mono)`},children:[`CLI (`,e.cli.subcommands?.length||1,`)`]}),e.tasks&&e.tasks.length>0&&(0,R.jsxs)(`span`,{className:`badge`,style:{fontFamily:`var(--font-mono)`},children:[e.tasks.length,` `,e.tasks.length===1?`task`:`tasks`]}),e.secrets&&e.secrets.length>0&&(0,R.jsxs)(`span`,{className:`badge`,style:{fontFamily:`var(--font-mono)`},children:[e.secrets.length,` `,e.secrets.length===1?`secret`:`secrets`]}),_Q.has(e.id)&&(0,R.jsx)(`span`,{className:`badge`,style:{background:`rgba(59, 130, 246, 0.15)`,color:`#60a5fa`},children:`Core Bundle`})]}),(0,R.jsx)(CQ,{useCases:e.use_cases}),(0,R.jsxs)(`div`,{style:{marginTop:`auto`,display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:`8px`,paddingTop:`8px`,borderTop:`1px solid var(--border)`},children:[(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>{e.sourcePlugin?Ge(e.sourcePlugin,`preview`):Ge({id:e.id,name:e.name,version:e.version,description:e.description,author:null,license:null,homepage:null,use_cases:e.use_cases,valid:!0,errors:[],scope:`global`,linked:!1,dir:``,shared:!1,mesh_shared:!1,share_url:null,source:{kind:`bundled`,ref:e.id},installed_at:null,sha256:null,installed_sha256:null,modified_since_install:!1,file_count:null,size_bytes:null,categories:[],tasks:e.tasks||[],openwiki_hubs:[],cli:e.cli,has_generator:!1,branding:e.branding},`preview`)},children:`Preview`}),(0,R.jsx)(`div`,{style:{display:`flex`,gap:`6px`},children:e.installed?e.inWorkspace?(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:b===e.id,onClick:()=>Ie(e.sourcePlugin||e),style:{fontSize:`11px`},children:`Remove from Workspace`}):(0,R.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,disabled:b===e.id,onClick:()=>Fe(e.sourcePlugin||e),children:b===e.id?`Adding…`:`+ Add to Workspace`}):(0,R.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,disabled:b===e.id,onClick:()=>Re(e.id),children:b===e.id?`Installing…`:`Install`})})]})]},e.id)})})]})),r===`mesh`&&(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`16px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:`12px`,flexWrap:`wrap`},children:[(0,R.jsx)(`p`,{style:{...gQ,margin:0},children:`Asked live from each node. Only plugins their owner chose to share appear here; content is hash-checked on install.`}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:je,disabled:d,children:d?`Asking peers…`:`Refresh`})]}),d&&!l?(0,R.jsx)(`div`,{style:gQ,children:`Asking peers…`}):l===null?(0,R.jsx)(TQ,{title:`Could not ask the mesh`,children:`The brain server did not answer the peer query.`}):l.mesh.available?l.peers.length===0?(0,R.jsx)(TQ,{title:`No other nodes on the mesh`}):(0,R.jsxs)(R.Fragment,{children:[!l.mesh.configured&&(0,R.jsxs)(`div`,{className:`alert alert-warning`,children:[`This node has no `,(0,R.jsx)(`code`,{style:hQ,children:`TR_MESH_SYNC_TOKEN`}),`, so it cannot query peers. Set the same token on each node.`]}),l.peers.map(e=>{let t=e.plugins.filter(Ne);return(0,R.jsxs)(`div`,{className:`card`,children:[(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:`12px`,alignItems:`center`,marginBottom:e.plugins.length?`12px`:0,flexWrap:`wrap`},children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{style:{fontWeight:600},children:e.hostname}),` `,(0,R.jsx)(`span`,{style:{...hQ,color:`var(--text-tertiary)`},children:e.ip})]}),(0,R.jsxs)(`span`,{className:`badge ${e.status===`ok`?`badge-online`:e.status===`offline`?`badge-offline`:`badge-warning`}`,children:[mQ[e.status],e.status===`ok`?` · ${e.plugins.length} shared`:``]})]}),e.error&&e.status!==`ok`&&(0,R.jsx)(`div`,{style:{...gQ,fontSize:`12px`},children:e.error}),e.status===`ok`&&e.plugins.length===0&&(0,R.jsx)(`div`,{style:gQ,children:`Shares no plugins.`}),e.status===`ok`&&e.plugins.length>0&&t.length===0&&(0,R.jsx)(`div`,{style:gQ,children:`No shared plugins match the filter.`}),t.map(t=>{let n=`peer:${e.hostname}/${t.id}`;return(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:`16px`,padding:`12px 0`,borderTop:`1px solid var(--border)`,flexWrap:`wrap`},children:[(0,R.jsxs)(`div`,{style:{minWidth:0,flex:`1 1 320px`,display:`flex`,flexDirection:`column`,gap:`6px`},children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{style:{fontWeight:600},children:t.name}),` `,(0,R.jsxs)(`span`,{style:{...hQ,color:`var(--text-tertiary)`},children:[`v`,t.version]})]}),(0,R.jsx)(`div`,{style:gQ,children:t.description}),(0,R.jsx)(CQ,{useCases:t.use_cases}),(0,R.jsxs)(`div`,{style:{...hQ,color:`var(--text-tertiary)`},title:t.sha256,children:[`sha256 `,bQ(t.sha256),` · `,t.file_count,` files · `,xQ(t.size_bytes)]})]}),(0,R.jsx)(`div`,{style:{alignSelf:`center`},children:t.installed?(0,R.jsx)(`span`,{className:`badge ${t.same_as_installed?`badge-success`:`badge-warning`}`,children:t.same_as_installed?`installed (same content)`:`installed (different content)`}):(0,R.jsx)(`button`,{className:`btn btn-primary btn-sm`,disabled:b===n,onClick:()=>Re(n),children:b===n?`Installing…`:`Install`})})]},t.id)})]},e.hostname)})]}):(0,R.jsxs)(TQ,{title:`This node is not on a mesh`,children:[`Enroll it with `,(0,R.jsx)(`code`,{style:hQ,children:`npx total-recall mesh enroll`}),` to share plugins between your nodes.`]})]}),w&&(0,R.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Install plugin from source`,onClick:()=>T(!1),style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.6)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1e3,padding:`16px`},children:(0,R.jsxs)(`form`,{className:`card`,onClick:e=>e.stopPropagation(),style:{width:`100%`,maxWidth:`520px`,display:`flex`,flexDirection:`column`,gap:`14px`},onSubmit:async e=>{e.preventDefault(),E.trim()&&await Re(E.trim(),{link:O,global:k})&&(T(!1),D(``))},children:[(0,R.jsx)(`div`,{style:{fontWeight:600,fontSize:`16px`},children:`Install from source`}),(0,R.jsxs)(`div`,{style:gQ,children:[`A bundled plugin id, `,(0,R.jsx)(`code`,{style:hQ,children:`peer:<host>/<id>`}),`, a git URL, or a folder on this machine containing `,(0,R.jsx)(`code`,{style:hQ,children:`plugin.json`}),`.`]}),(0,R.jsx)(`input`,{className:`input`,autoFocus:!0,value:E,onChange:e=>D(e.target.value),placeholder:`https://github.com/you/my-plugin.git`,"aria-label":`Plugin source`}),(0,R.jsxs)(`label`,{style:{...gQ,display:`flex`,gap:`8px`,alignItems:`center`},children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:O,onChange:e=>ee(e.target.checked)}),`Link a local folder instead of copying it (for plugin development)`]}),(0,R.jsxs)(`label`,{style:{...gQ,display:`flex`,gap:`8px`,alignItems:`center`},children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:k,onChange:e=>te(e.target.checked)}),`Install for every project on this machine`]}),(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:`8px`},children:[(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>T(!1),children:`Cancel`}),(0,R.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,disabled:!E.trim()||b!==null,children:b?`Installing…`:`Install`})]})]})}),ge&&ve&&(0,R.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Customize Plugin Branding`,onClick:()=>_e(!1),style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.6)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1e3,padding:`16px`},children:(0,R.jsxs)(`div`,{className:`card`,onClick:e=>e.stopPropagation(),style:{width:`100%`,maxWidth:`480px`,display:`flex`,flexDirection:`column`,gap:`16px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,R.jsxs)(`div`,{style:{fontWeight:700,fontSize:`16px`},children:[`Customize Branding: `,ve.name]}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>_e(!1),children:`✕`})]}),ve.locked&&(0,R.jsx)(`div`,{className:`alert alert-warning`,style:{fontSize:`12px`},children:`[LOCKED] This plugin is marked complete and locked against editing. Unlock it to change branding.`}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`6px`},children:[(0,R.jsx)(`label`,{style:{fontSize:`12px`,color:`var(--text-secondary)`},children:`Wordmark Glyph / Tag`}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`8px`},children:[(0,R.jsx)(`input`,{className:`input`,value:be,onChange:e=>xe(e.target.value),style:{width:`90px`,textAlign:`center`,fontSize:`14px`,fontFamily:`var(--font-mono)`},disabled:ve.locked}),(0,R.jsx)(`div`,{style:{display:`flex`,gap:`4px`,flexWrap:`wrap`,alignItems:`center`},children:[`[TEL]`,`[DNS]`,`[SIGN]`,`[GATE]`,`[CLI]`,`[LAW]`,`[UI]`,`[SMS]`,`[FIND]`,`[GIT]`,`[OPS]`,`[WARN]`,`[CORE]`].map(e=>(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{padding:`4px 6px`,fontSize:`11px`,fontFamily:`var(--font-mono)`},disabled:ve.locked,onClick:()=>xe(e),children:e},e))})]})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`6px`},children:[(0,R.jsx)(`label`,{style:{fontSize:`12px`,color:`var(--text-secondary)`},children:`Theme Color (Hex)`}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,alignItems:`center`},children:[(0,R.jsx)(`input`,{type:`color`,value:Se,onChange:e=>Ce(e.target.value),style:{width:`42px`,height:`38px`,border:`none`,cursor:`pointer`,background:`none`},disabled:ve.locked}),(0,R.jsx)(`input`,{className:`input`,value:Se,onChange:e=>Ce(e.target.value),style:{flex:1,fontFamily:`var(--font-mono)`},disabled:ve.locked})]})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`6px`},children:[(0,R.jsx)(`label`,{style:{fontSize:`12px`,color:`var(--text-secondary)`},children:`Domain Badge Text`}),(0,R.jsx)(`input`,{className:`input`,value:P,onChange:e=>we(e.target.value),placeholder:`e.g. Telephony, Quality, DNS`,disabled:ve.locked})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:`8px`,marginTop:`8px`},children:[(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>_e(!1),children:`Cancel`}),(0,R.jsx)(`button`,{type:`button`,className:`btn btn-primary`,onClick:We,disabled:ve.locked||b!==null,children:`Save Branding`})]})]})}),ue&&(0,R.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Agent Plugin Recipe`,onClick:()=>de(!1),style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.65)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1e3,padding:`16px`},children:(0,R.jsxs)(`div`,{className:`card`,onClick:e=>e.stopPropagation(),style:{width:`100%`,maxWidth:`680px`,maxHeight:`90vh`,overflowY:`auto`,display:`flex`,flexDirection:`column`,gap:`16px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{style:{margin:0,fontSize:`17px`,fontWeight:700},children:`Agent Plugin Recipe`}),(0,R.jsx)(`div`,{style:{...gQ,fontSize:`12px`},children:`How your coding agent authors private or store plugins`})]}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>de(!1),children:`✕`})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`12px`,fontSize:`13px`},children:[(0,R.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,padding:`12px`,borderRadius:`8px`,border:`1px solid var(--border)`},children:[(0,R.jsx)(`div`,{style:{fontWeight:600,marginBottom:`4px`},children:`1. Command your agent`}),(0,R.jsx)(`div`,{style:gQ,children:`Copy and send this instruction to your coding agent (Antigravity, Claude, Codex, DSH):`}),(0,R.jsx)(`pre`,{style:{...hQ,background:`rgba(0,0,0,0.4)`,padding:`10px`,borderRadius:`6px`,marginTop:`8px`,whiteSpace:`pre-wrap`,overflowX:`auto`,fontSize:`11px`,color:`#a5b4fc`},children:vQ}),(0,R.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:`8px`},children:(0,R.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:()=>Le(),children:`Copy Agent Prompt`})})]}),(0,R.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:`12px`},children:[(0,R.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,padding:`12px`,borderRadius:`8px`,border:`1px solid var(--border)`},children:[(0,R.jsx)(`div`,{style:{fontWeight:600,color:`#38bdf8`,marginBottom:`4px`},children:`🔒 Private Plugins`}),(0,R.jsxs)(`div`,{style:{...gQ,fontSize:`12px`,lineHeight:1.4},children:[`Store directly inside `,(0,R.jsx)(`code`,{style:hQ,children:`.agent/skills/total-recall/plugins/<id>`}),` or link locally. Never shared outside this machine or project. Zero cloud exposure.`]})]}),(0,R.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,padding:`12px`,borderRadius:`8px`,border:`1px solid var(--border)`},children:[(0,R.jsx)(`div`,{style:{fontWeight:600,color:`#a855f7`,marginBottom:`4px`},children:`🌐 Plugin Store Distribution`}),(0,R.jsxs)(`div`,{style:{...gQ,fontSize:`12px`,lineHeight:1.4},children:[`Deploy to the store via `,(0,R.jsx)(`code`,{style:hQ,children:`total-recall deploy-store <id>`}),`. Cryptographically signed and distributed across the mesh for team consumption.`]})]})]}),(0,R.jsxs)(`div`,{style:{background:`rgba(16, 185, 129, 0.08)`,padding:`12px`,borderRadius:`8px`,border:`1px solid rgba(16, 185, 129, 0.2)`},children:[(0,R.jsx)(`div`,{style:{fontWeight:600,color:`#10b981`,marginBottom:`4px`},children:`Quality Invariants Enforced`}),(0,R.jsxs)(`ul`,{style:{margin:`4px 0 0 16px`,padding:0,fontSize:`12px`,color:`var(--text-secondary)`},children:[(0,R.jsx)(`li`,{children:`Guaranteed Title, Brand Glyph, Version, and Settings drawer trigger on every card`}),(0,R.jsx)(`li`,{children:`Authentic domain tools only — zero fake audio equalizers or fake skins`}),(0,R.jsx)(`li`,{children:`Touch-first ergonomics with minimum 44px tap targets`})]})]})]}),(0,R.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:`8px`},children:(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>de(!1),children:`Close`})})]})}),A&&(0,R.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":A.name,onClick:Ke,style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.6)`,display:`flex`,justifyContent:`flex-end`,zIndex:1e3},children:(0,R.jsx)(`div`,{onClick:e=>e.stopPropagation(),style:{width:`100%`,maxWidth:`680px`,height:`100%`,overflowY:`auto`,background:`var(--bg-secondary)`,borderLeft:`1px solid var(--border)`,padding:`24px`,display:`flex`,flexDirection:`column`,gap:`16px`},children:(()=>{let e=yQ(A),t=kZ(A).length>0;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:`12px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`12px`,alignItems:`center`},children:[(0,R.jsx)(`div`,{style:{width:`44px`,height:`44px`,borderRadius:`10px`,background:`${e.color}20`,border:`1px solid ${e.color}50`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:`22px`,flexShrink:0},children:e.icon}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{style:{fontSize:`18px`,fontWeight:700},children:A.name}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,alignItems:`center`,marginTop:`2px`},children:[(0,R.jsxs)(`span`,{style:{...hQ,color:`var(--text-tertiary)`},children:[A.id,` · v`,A.version]}),(0,R.jsx)(`span`,{className:`badge`,style:{background:`${e.color}15`,color:e.color,borderColor:`${e.color}40`,fontSize:`11px`},children:e.badge}),A.locked&&(0,R.jsx)(`span`,{className:`badge`,style:{background:`#2e1065`,color:`#c084fc`},children:`Locked`})]})]})]}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:Ke,"aria-label":`Close`,children:`Close`})]}),(0,R.jsx)(`div`,{style:gQ,children:A.description}),!A.valid&&(0,R.jsx)(`div`,{className:`alert alert-error`,children:A.errors.map(e=>(0,R.jsx)(`div`,{children:e},e))}),(0,R.jsxs)(`div`,{role:`tablist`,style:{display:`flex`,gap:`8px`,borderBottom:`1px solid var(--border)`,paddingBottom:`10px`},children:[t&&(0,R.jsxs)(`button`,{role:`tab`,"aria-selected":M===`preview`,className:`btn btn-sm ${M===`preview`?`btn-primary`:`btn-ghost`}`,onClick:()=>ne(`preview`),children:[`Open `,A.name]}),A.cli&&(0,R.jsx)(`button`,{role:`tab`,"aria-selected":M===`run`,className:`btn btn-sm ${M===`run`?`btn-primary`:`btn-ghost`}`,onClick:()=>ne(`run`),children:`Run CLI`}),(0,R.jsx)(`button`,{role:`tab`,"aria-selected":M===`details`,className:`btn btn-sm ${M===`details`?`btn-primary`:`btn-ghost`}`,onClick:()=>ne(`details`),children:`Settings`}),(0,R.jsx)(`button`,{role:`tab`,"aria-selected":M===`readme`,className:`btn btn-sm ${M===`readme`?`btn-primary`:`btn-ghost`}`,onClick:()=>ne(`readme`),children:`README`})]}),M===`preview`&&(0,R.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`12px`},children:(0,R.jsx)(AZ,{plugin:A})}),M===`run`&&A.cli&&(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`10px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,flexWrap:`wrap`},children:[(0,R.jsx)(`select`,{className:`select`,value:N,onChange:e=>re(e.target.value),"aria-label":`Subcommand`,style:{paddingRight:`32px`},children:(A.cli.subcommands.length?A.cli.subcommands:[{name:``}]).map(e=>(0,R.jsx)(`option`,{value:e.name,children:e.name||`(default)`},e.name))}),(0,R.jsx)(`input`,{className:`input`,value:ie,onChange:e=>ae(e.target.value),placeholder:`extra arguments`,"aria-label":`Arguments`,style:{flex:1,minWidth:`160px`}}),(0,R.jsx)(`button`,{className:`btn btn-primary`,onClick:qe,disabled:b===`run:${A.id}`||!A.valid,children:b===`run:${A.id}`?`Running…`:`Run`})]}),(0,R.jsxs)(`div`,{style:{...gQ,fontSize:`12px`},children:[A.cli.subcommands.find(e=>e.name===N)?.description,` `,`Same as `,(0,R.jsxs)(`code`,{style:hQ,children:[`npx total-recall `,A.cli.command,` `,N,` `,ie]}),`. Runs in a separate process.`]}),oe&&(0,R.jsx)(`pre`,{style:{...hQ,margin:0,padding:`14px`,borderRadius:`var(--radius-sm)`,background:`var(--bg-primary)`,border:`1px solid ${oe.ok?`var(--border)`:`var(--error)`}`,whiteSpace:`pre-wrap`,maxHeight:`420px`,overflow:`auto`},children:oe.text})]}),M===`details`&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(jZ,{plugin:A}),(0,R.jsxs)(wQ,{label:`Scope`,children:[A.scope,A.linked?` (linked folder)`:``]}),(0,R.jsxs)(wQ,{label:`Source`,children:[SQ(A),` — `,(0,R.jsx)(`span`,{style:hQ,children:A.source.ref})]}),(0,R.jsx)(wQ,{label:`Installed`,children:A.installed_at?new Date(A.installed_at).toLocaleString():`no install record`}),(0,R.jsx)(wQ,{label:`Content sha256`,children:(0,R.jsx)(`span`,{style:hQ,children:A.sha256||`—`})}),A.modified_since_install&&(0,R.jsx)(wQ,{label:`At install`,children:(0,R.jsx)(`span`,{style:hQ,children:A.installed_sha256})}),(0,R.jsxs)(wQ,{label:`Files`,children:[A.file_count??`—`,` · `,xQ(A.size_bytes)]}),(0,R.jsx)(wQ,{label:`Shared`,children:A.shared?`yes`:`no`}),(0,R.jsx)(wQ,{label:`Lock Status`,children:A.locked?`Locked (Completed)`:`Unlocked (Editable)`}),(0,R.jsx)(wQ,{label:`Store Status`,children:A.store_deployed?`Published in Plugin Store`:`Not yet deployed to store`}),A.shared&&(0,R.jsx)(wQ,{label:`Public link`,children:A.share_url?(0,R.jsx)(`input`,{className:`input`,"aria-label":`Public plugin share link`,readOnly:!0,value:A.share_url,onFocus:e=>e.currentTarget.select()}):`Set TR_PUBLIC_BASE_URL to your public HTTPS origin to create a link.`}),(0,R.jsx)(wQ,{label:`Use cases`,children:A.use_cases.join(`, `)||`—`}),A.author&&(0,R.jsx)(wQ,{label:`Author`,children:A.author}),A.license&&(0,R.jsx)(wQ,{label:`License`,children:A.license}),(0,R.jsx)(wQ,{label:`Location`,children:(0,R.jsx)(`span`,{style:hQ,children:A.dir})}),(0,R.jsx)(wQ,{label:`Agent context`,children:A.has_generator?`adds a block to compiled instructions`:`—`}),(0,R.jsx)(wQ,{label:`Memory categories`,children:A.categories.length?A.categories.map(e=>e.name).join(`, `):`—`}),(0,R.jsx)(wQ,{label:`Scheduled tasks`,children:A.tasks.length===0?`—`:(0,R.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`6px`},children:A.tasks.map(e=>(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{style:hQ,children:e.schedule}),` `,e.command,` — `,e.intent,(0,R.jsxs)(`div`,{style:{color:`var(--text-tertiary)`,fontSize:`12px`},children:[`last run: `,e.last_run||`not yet`]})]},e.command))})}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,marginTop:`16px`,flexWrap:`wrap`},children:[(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>Ue(A),disabled:A.locked,children:`Customize Branding`}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>Ve(A),disabled:b===A.id,children:A.locked?`Unlock Editing`:`Lock When Complete`}),(0,R.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:()=>He(A),disabled:b===A.id||!A.valid,children:A.store_deployed?`✓ Deployed to Store`:`Deploy to Plugin Store`}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,disabled:b===A.id||!A.valid&&!A.shared,onClick:()=>Be(A,!A.shared),children:A.shared?`Stop sharing`:`Share`}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,disabled:b===A.id,onClick:()=>ze(A),children:`Remove`})]})]}),M===`readme`&&(0,R.jsx)(`div`,{style:{fontSize:`14px`,lineHeight:1.6},children:ce?$X(ce):(0,R.jsx)(`span`,{style:gQ,children:`Loading…`})})]})})()})}),Te&&(0,R.jsxs)(`div`,{role:`menu`,"aria-label":`Plugin actions menu`,onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),style:{position:`fixed`,left:Math.max(12,Math.min(Te.x,window.innerWidth-264)),top:Math.max(12,Math.min(Te.y,window.innerHeight-380)),zIndex:2e3,width:`250px`,background:`var(--bg-secondary)`,border:`1px solid var(--border)`,borderRadius:`10px`,boxShadow:`0 12px 36px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.08)`,padding:`6px`,display:`flex`,flexDirection:`column`,gap:`2px`,backdropFilter:`blur(12px)`},children:[(0,R.jsxs)(`div`,{style:{padding:`8px 10px`,borderBottom:`1px solid var(--border)`,display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,R.jsx)(`div`,{style:{width:`8px`,height:`8px`,borderRadius:`50%`,background:yQ(Te.plugin).color}}),(0,R.jsxs)(`div`,{style:{minWidth:0},children:[(0,R.jsx)(`div`,{style:{fontWeight:600,fontSize:`13px`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:Te.plugin.name}),(0,R.jsxs)(`div`,{style:{...hQ,fontSize:`10px`,color:`var(--text-tertiary)`},children:[Te.plugin.id,` · v`,Te.plugin.version]})]})]}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,style:{justifyContent:`flex-start`,width:`100%`,padding:`8px 10px`,fontSize:`12px`,minHeight:`36px`},onClick:()=>{let e=Te.plugin;Ee(null),Ge(e,`preview`)},children:`Open UI Component`}),(0,R.jsxs)(`button`,{className:`btn btn-ghost btn-sm`,style:{justifyContent:`flex-start`,width:`100%`,padding:`8px 10px`,fontSize:`12px`,minHeight:`36px`},onClick:()=>{let e=Te.plugin;Ee(null),Ge(e,`run`)},children:[`Run CLI (`,Te.plugin.cli?.command||Te.plugin.id,`)`]}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,style:{justifyContent:`flex-start`,width:`100%`,padding:`8px 10px`,fontSize:`12px`,minHeight:`36px`},onClick:()=>{let e=Te.plugin;Ee(null),Ge(e,`details`)},children:`Configure & Settings`}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,style:{justifyContent:`flex-start`,width:`100%`,padding:`8px 10px`,fontSize:`12px`,minHeight:`36px`},onClick:()=>{let e=Te.plugin;Ee(null),Ge(e,`readme`)},children:`View Documentation`}),(0,R.jsx)(`div`,{style:{height:`1px`,background:`var(--border)`,margin:`4px 0`}}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,style:{justifyContent:`flex-start`,width:`100%`,padding:`8px 10px`,fontSize:`12px`,minHeight:`36px`},onClick:()=>{let e=Te.plugin;Ee(null),Be(e,!e.shared)},children:Te.plugin.shared?`Stop sharing on mesh`:`Share on mesh & link`}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,style:{justifyContent:`flex-start`,width:`100%`,padding:`8px 10px`,fontSize:`12px`,minHeight:`36px`},onClick:()=>{let e=Te.plugin;Ee(null),Ve(e)},children:Te.plugin.locked?`Unlock editing`:`Lock for release`}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,style:{justifyContent:`flex-start`,width:`100%`,padding:`8px 10px`,fontSize:`12px`,minHeight:`36px`},onClick:()=>{let e=Te.plugin;Ee(null),navigator.clipboard?.writeText(`npx total-recall ${e.cli?.command||e.id}`),C({type:`success`,message:`Copied "npx total-recall ${e.cli?.command||e.id}" to clipboard`})},children:`Copy CLI command`}),(0,R.jsx)(`div`,{style:{height:`1px`,background:`var(--border)`,margin:`4px 0`}}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,style:{justifyContent:`flex-start`,width:`100%`,padding:`8px 10px`,fontSize:`12px`,color:`var(--color-error, #f87171)`,minHeight:`36px`},onClick:()=>{let e=Te.plugin;Ee(null),ze(e)},children:`Uninstall plugin`})]})]})}function DQ(){return localStorage.getItem(`tr-onboarding-complete`)===`1`}var OQ=`tr-onboarding-v1`,kQ=[{id:`welcome`,title:`Welcome to Total Recall`,body:`Portable personal memory for any IDE. Your rules and facts live as Markdown files on disk — not a locked vendor database.`},{id:`import-env`,title:`Import your API keys`,body:`Scan the machine for keys already in .env files or the shell, or paste a .env block. Nothing is written until you choose what to import.`},{id:`remember`,title:`Save your first memory`,body:`Write a fact or preference into the vault. This is the core write path: remember → compile → IDEs see it.`},{id:`connect`,title:`Connect an IDE`,body:`Wire Claude Code, Cursor, Codex, Gemini, Aider, Obsidian, or any HTTP host. Injected blocks never overwrite your local rules outside TR markers.`},{id:`dream`,title:`Dream consolidates memory`,body:`Dream is sleep for your vault: ingest sessions, conflict-check, recompile surfaces, prune. Run it anytime; no always-on LLM required.`},{id:`done`,title:`You're set`,body:`Default loop: init → connect → remember/recall → dream. Optional: task queue, skill track any repo, daemon in the background.`}];function AQ(){try{return JSON.parse(localStorage.getItem(OQ)||`{}`)}catch{return{step:0}}}function jQ(e){localStorage.setItem(OQ,JSON.stringify(e)),e.complete&&localStorage.setItem(`tr-onboarding-complete`,`1`)}function MQ(e){let t={};for(let n of e.split(/\r?\n/)){let e=n.trim();if(!e||e.startsWith(`#`))continue;let r=e.startsWith(`export `)?e.slice(7).trim():e,i=r.indexOf(`=`);if(i<=0)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();o=o.startsWith(`"`)&&o.endsWith(`"`)||o.startsWith(`'`)&&o.endsWith(`'`)?o.slice(1,-1):o.replace(/\s+#.*$/,``).trim(),a&&o&&(t[a]=o)}return t}function NQ(){let e=ft(),t=AQ(),[n,r]=(0,_.useState)(t.step||0),[i,a]=(0,_.useState)(t.fact||``),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)([]),[m,h]=(0,_.useState)(new Set),[g,v]=(0,_.useState)(``),[y,b]=(0,_.useState)({}),[x,S]=(0,_.useState)(``),[C,w]=(0,_.useState)(!1),[T,E]=(0,_.useState)(`scan`),D=kQ[Math.min(n,kQ.length-1)];(0,_.useEffect)(()=>{or().then(e=>{let t=e||[],n=t.some(e=>e.slug===`user-profile`||e.slug===`onboarding-first-memory`||(e.tags||[]).includes(`onboarding`)),r=n||t.length>=5;d(n||r),r&&!DQ()&&localStorage.setItem(`tr-onboarding-complete`,`1`)}).catch(()=>{})},[]),(0,_.useEffect)(()=>{if(D.id!==`import-env`||T!==`scan`)return;let e=!1;return Promise.resolve().then(()=>{w(!0),S(``)}),kr().then(t=>{if(e)return;p(t.candidates||[]);let n=new Set((t.candidates||[]).filter(e=>!e.already_set).map(e=>e.key));h(n)}).catch(t=>{e||S(t instanceof Error?t.message:`Scan failed`)}).finally(()=>{e||w(!1)}),()=>{e=!0}},[D.id,T]);function O(){let e=Math.min(n+1,kQ.length-1);r(e),jQ({step:e,fact:i}),s(``)}function ee(){let e=Math.max(n-1,0);r(e),jQ({step:e,fact:i}),s(``)}function k(e){h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function te(){h(new Set(f.filter(e=>!e.already_set).map(e=>e.key)))}function A(){h(new Set)}async function j(){if(!g.trim())s(`Paste a .env block first.`);else{l(!0),S(``);try{let e=MQ(g);b(e);let t=await Ar(g);p(t.candidates||[]),h(new Set((t.candidates||[]).filter(e=>!e.already_set).map(e=>e.key))),s(t.count?`Found ${t.count} importable key(s) in paste.`:`No known API key names in paste.`)}catch(e){S(e instanceof Error?e.message:`Parse failed`)}finally{l(!1)}}}async function M(){let e=[...m];if(!e.length)s(`Select at least one key, or skip this step.`);else{l(!0),s(``);try{let t=T===`paste`&&Object.keys(y).length?await jr({keys:e,pairs:y,overwrite:!1}):await jr({keys:e,overwrite:!1});if(s(`Imported ${t.imported_count} secret(s)`+(t.skipped_count?`, skipped ${t.skipped_count} already set`:``)+`.`),T===`scan`){let e=await kr();p(e.candidates||[]),h(new Set)}else p(e=>e.map(e=>t.imported.some(t=>t.key===e.key)?{...e,already_set:!0}:e)),h(new Set)}catch(e){s(e instanceof Error?e.message:`Import failed`)}finally{l(!1)}}}async function ne(){if(!i.trim())s(`Write a short fact or preference first.`);else{l(!0),s(``);try{await ur({slug:`onboarding-first-memory`,category:`preferences`,title:`Onboarding first memory`,content:i.trim(),tags:[`onboarding`],importance:4});try{await Rr()}catch{}s(`Saved and queued surface compile.`),jQ({step:n,fact:i}),O()}catch(e){s(e instanceof Error?e.message:`Failed to save memory`)}finally{l(!1)}}}function N(){jQ({step:kQ.length-1,fact:i,complete:!0}),e(`/memory`)}let re=Math.round((n+1)/kQ.length*100);return(0,R.jsxs)(`div`,{className:`onboarding-shell`,children:[D.id===`welcome`&&(0,R.jsx)(`div`,{style:{marginBottom:28,borderRadius:16,padding:`16px 20px`,background:`linear-gradient(180deg, #f8fafc 0%, #e8eef9 100%)`,boxShadow:`0 1px 0 rgba(255,255,255,0.7) inset, 0 16px 40px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(148,163,184,0.2)`,display:`flex`,justifyContent:`center`},children:(0,R.jsx)(Fi,{variant:`lockup`,height:64,alt:`Total Recall`})}),(0,R.jsxs)(`div`,{style:{marginBottom:28},children:[(0,R.jsxs)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,marginBottom:10,letterSpacing:`0.08em`,textTransform:`uppercase`,fontWeight:600},children:[`Onboarding · `,n+1,`/`,kQ.length]}),(0,R.jsx)(`div`,{className:`onboarding-progress`,children:(0,R.jsx)(`div`,{style:{width:`${re}%`}})})]}),(0,R.jsx)(`h1`,{style:{fontSize:28,fontWeight:700,margin:`0 0 12px`,letterSpacing:`-0.03em`,background:`linear-gradient(135deg, #f8fafc 0%, #93c5fd 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:D.title}),(0,R.jsx)(`p`,{style:{fontSize:15.5,lineHeight:1.6,color:`var(--text-secondary)`,margin:`0 0 28px`},children:D.body}),D.id===`welcome`&&(0,R.jsxs)(`div`,{className:`loop-card`,style:{marginBottom:24},children:[`write\xA0\xA0→ remember / session ingest`,(0,R.jsx)(`br`,{}),`sleep\xA0\xA0→ dream (consolidate, conflict, compile)`,(0,R.jsx)(`br`,{}),`read\xA0\xA0\xA0→ recall + compiled surfaces`,(0,R.jsx)(`br`,{}),`async\xA0\xA0→ daemon tasks (any intent under policy)`]}),D.id===`import-env`&&(0,R.jsxs)(`div`,{style:{marginBottom:24},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:14},children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>E(`scan`),style:T===`scan`?zQ:BQ,children:`Scan machine`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>{E(`paste`),p([]),h(new Set)},style:T===`paste`?zQ:BQ,children:`Paste .env`})]}),T===`paste`&&(0,R.jsxs)(`div`,{style:{marginBottom:14},children:[(0,R.jsx)(`textarea`,{value:g,onChange:e=>v(e.target.value),placeholder:`OPENAI_API_KEY=sk-...
|
|
5620
|
+
- Private: keep in .agent/plugins/<id>
|
|
5621
|
+
- Mesh: share peer-to-peer via total-recall plugin share <id>`;function LZ(e){let t=e.branding||{};return{icon:t.icon||``,color:t.color||`#3b82f6`,badge:t.badge||`Plugin`}}function RZ(e){return e?`${e.slice(0,12)}…`:`—`}function zZ(e){return e==null?`—`:e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function BZ(e){switch(e.source.kind){case`peer`:return`from ${e.source.peer_hostname||`a peer`}`;case`bundled`:return`bundled`;case`git`:return`git`;case`public`:return`direct link`;case`link`:return`linked folder`;default:return`local folder`}}function VZ({useCases:e}){return e.length?(0,R.jsx)(`div`,{style:{display:`flex`,gap:`6px`,flexWrap:`wrap`},children:e.map(e=>(0,R.jsx)(`span`,{className:`badge`,style:{fontSize:`11px`},children:e},e))}):null}function HZ({label:e,children:t}){return(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`12px`,fontSize:`13px`,padding:`6px 0`,borderBottom:`1px solid var(--border)`},children:[(0,R.jsx)(`span`,{style:{width:`132px`,flexShrink:0,color:`var(--text-tertiary)`},children:e}),(0,R.jsx)(`span`,{style:{color:`var(--text-primary)`,minWidth:0,overflowWrap:`anywhere`},children:t})]})}function UZ({title:e,children:t}){return(0,R.jsxs)(`div`,{className:`card`,style:{textAlign:`center`,padding:`40px 24px`},children:[(0,R.jsx)(`div`,{style:{fontWeight:600,marginBottom:`6px`},children:e}),t&&(0,R.jsx)(`div`,{style:PZ,children:t})]})}function WZ({activeBrainId:e}){let[t,n]=Mn(),[r,i]=(0,_.useState)(`installed`),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)([]),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(!0),[h,g]=(0,_.useState)(``),[v,y]=(0,_.useState)(``),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)(!1),[E,D]=(0,_.useState)(``),[O,ee]=(0,_.useState)(!1),[k,te]=(0,_.useState)(!1),[A,j]=(0,_.useState)(null),[M,ne]=(0,_.useState)(`preview`),[N,re]=(0,_.useState)(``),[ie,ae]=(0,_.useState)(``),[oe,se]=(0,_.useState)(null),[ce,le]=(0,_.useState)(``),[ue,de]=(0,_.useState)(!1),[fe,pe]=(0,_.useState)(`workspace`),[me,he]=(0,_.useState)(()=>{try{let e=localStorage.getItem(`tr_workspace_plugins`);if(e)return new Set(JSON.parse(e))}catch{}return new Set}),[ge,_e]=(0,_.useState)(!1),[ve,ye]=(0,_.useState)(null),[be,xe]=(0,_.useState)(``),[Se,Ce]=(0,_.useState)(`#3b82f6`),[P,we]=(0,_.useState)(``),[Te,Ee]=(0,_.useState)(null),F=(0,_.useRef)(null),De=(e,t)=>{if(t.touches.length!==1)return;let n=t.touches[0],r=n.clientX,i=n.clientY;F.current=setTimeout(()=>{if(`vibrate`in navigator)try{navigator.vibrate(50)}catch{}Ee({plugin:e,x:r,y:i})},500)},Oe=()=>{F.current&&=(clearTimeout(F.current),null)},ke=(e,t)=>{t.preventDefault(),t.stopPropagation(),Ee({plugin:e,x:t.clientX,y:t.clientY})};(0,_.useEffect)(()=>{let e=()=>Ee(null);return window.addEventListener(`pointerdown`,e),()=>window.removeEventListener(`pointerdown`,e)},[]);let Ae=(0,_.useCallback)(async()=>{m(!0);try{let[e,t]=await Promise.all([ai(),si()]);o(e),c(t)}finally{m(!1)}},[]),je=(0,_.useCallback)(async()=>{f(!0);try{u(await ci())}finally{f(!1)}},[]);(0,_.useEffect)(()=>{Ae()},[Ae,e]),(0,_.useEffect)(()=>{r===`mesh`&&l===null&&!d&&je()},[r,l,d,je]);let Me=(0,_.useMemo)(()=>{let e=new Set;for(let t of a)t.use_cases.forEach(t=>e.add(t));for(let t of s)t.use_cases.forEach(t=>e.add(t));for(let t of l?.peers||[])t.plugins.forEach(t=>t.use_cases.forEach(t=>e.add(t)));return Array.from(e).sort()},[a,s,l]),Ne=(0,_.useCallback)(e=>{if(v&&!e.use_cases.includes(v))return!1;let t=h.trim().toLowerCase();return!t||[e.id,e.name,e.description,...e.use_cases].some(e=>e.toLowerCase().includes(t))},[h,v]),Pe=(0,_.useCallback)(e=>!!(e.scope===`project`||FZ.has(e.id)||me.has(e.id)),[me]),Fe=async e=>{x(e.id);try{let t=new Set(me);t.add(e.id),he(t);try{localStorage.setItem(`tr_workspace_plugins`,JSON.stringify([...t]))}catch{}await mi(e.id,!0),C({type:`success`,message:`Added ${e.name} to workspace dashboard`}),await Ae()}catch(t){C({type:`error`,message:t?.message||`Could not activate ${e.name}`})}finally{x(null)}},Ie=async e=>{x(e.id);try{let t=new Set(me);t.delete(e.id),he(t);try{localStorage.setItem(`tr_workspace_plugins`,JSON.stringify([...t]))}catch{}await mi(e.id,!1),C({type:`success`,message:`Deactivated card for ${e.name}`}),await Ae()}catch(t){C({type:`error`,message:t?.message||`Could not deactivate ${e.name}`})}finally{x(null)}},Le=()=>{navigator.clipboard?.writeText(IZ),C({type:`success`,message:`Copied Agent Plugin Recipe prompt to clipboard`})},Re=async(e,t={})=>{x(e),C(null);let n=await li({source:e,...t});return x(null),n.success?(C({type:`success`,message:n.message||`Installed ${e}`}),await Ae(),l&&je(),!0):(C({type:`error`,message:n.error||`Could not install ${e}`}),!1)},ze=async e=>{if(!window.confirm(`Remove "${e.name}" (${e.scope})?`))return;x(e.id);let t=await ui(e.id,e.scope===`global`);x(null),C(t.success?{type:`success`,message:`Removed ${e.name}`}:{type:`error`,message:t.error||`Remove failed`}),t.success&&(A?.id===e.id&&Ke(),Ae())},Be=async(e,t)=>{x(e.id);let n=await di(e.id,t);x(null),n.success?(n.plugin&&A?.id===e.id&&j(n.plugin),C({type:`success`,message:t?`${e.name} is shared. Its public link is in the details.`:`${e.name} is no longer shared`}),Ae()):C({type:`error`,message:n.error||`Could not change sharing`})},Ve=async e=>{x(e.id);let t=!e.locked,n=await pi(e.id,t);x(null),n.success?(n.plugin&&A?.id===e.id&&j(n.plugin),C({type:`success`,message:t?`${e.name} is locked against further editing.`:`${e.name} is unlocked for editing.`}),Ae()):C({type:`error`,message:n.error||`Could not update lock status`})},He=async e=>{x(e.id);let t=await hi(e.id,!0);x(null),t.success?(t.plugin&&A?.id===e.id&&j(t.plugin),C({type:`success`,message:`${e.name} deployed to the plugin store and locked as complete.`}),Ae()):C({type:`error`,message:t.error||`Could not deploy plugin to store`})},Ue=e=>{let t=LZ(e);ye(e),xe(t.icon),Ce(t.color),we(t.badge),_e(!0)},We=async()=>{if(!ve)return;if(ve.locked){C({type:`error`,message:`Plugin is locked. Unlock it before editing branding.`}),_e(!1);return}x(ve.id);let e=await fi(ve.id,{icon:be.trim()||void 0,color:Se.trim()||void 0,badge:P.trim()||void 0});x(null),_e(!1),e.success?(C({type:`success`,message:`Updated branding for ${ve.name}`}),await Ae(),A?.id===ve.id&&e.plugin&&j(e.plugin)):C({type:`error`,message:e.error||`Could not save branding`})},Ge=async(e,t=`preview`)=>{j(await oi(e.id)||e),ne(t),re(e.cli?.subcommands?.[0]?.name||``),ae(``),se(null),le(``),le(await _i(e.id))},Ke=()=>{if(j(null),t.has(`id`)){let e=new URLSearchParams(t);e.delete(`id`),n(e)}};(0,_.useEffect)(()=>{let e=t.get(`id`);if(!e||A?.id===e)return;let n=a.find(t=>t.id===e);n&&Ge(n)},[t,a]),(0,_.useEffect)(()=>{if(!A)return;let e=a.find(e=>e.id===A.id);e&&e!==A&&j(e)},[a]);let qe=async()=>{if(!A)return;x(`run:${A.id}`);let e=await gi(A.id,N,ie.trim()?ie.trim().split(/\s+/):[]);x(null),e.error?se({text:e.error,ok:!1}):se({text:(e.output||``).trim()||`(no output)`,ok:e.success})},Je=a.filter(Ne),Ye=Je.filter(Pe),Xe=fe===`workspace`?Ye:Je,Ze=(0,_.useMemo)(()=>{let e=new Map;for(let t of s){let n=a.find(e=>e.id===t.id);e.set(t.id,{id:t.id,name:t.name,version:t.version,description:t.description,use_cases:t.use_cases||[],installed:t.installed||!!n,inWorkspace:n?Pe(n):!1,sourcePlugin:n,branding:t.branding||(n?n.branding:void 0),cli:t.cli||(n?n.cli:null),tasks:t.tasks||(n?n.tasks:[]),secrets:n?.secrets||[]})}for(let t of a)e.has(t.id)||e.set(t.id,{id:t.id,name:t.name,version:t.version,description:t.description,use_cases:t.use_cases||[],installed:!0,inWorkspace:Pe(t),sourcePlugin:t,branding:t.branding,cli:t.cli,tasks:t.tasks,secrets:t.secrets||[]});return Array.from(e.values())},[s,a,Pe]).filter(Ne),Qe=(e,t,n)=>(0,R.jsxs)(`button`,{role:`tab`,"aria-selected":r===e,className:`btn btn-sm ${r===e?`btn-primary`:`btn-ghost`}`,onClick:()=>i(e),children:[t,n!==void 0&&(0,R.jsx)(`span`,{style:{opacity:.75,fontWeight:500,marginLeft:`4px`},children:n})]},e);return(0,R.jsxs)(`div`,{className:`page`,style:{maxWidth:`100%`,padding:`0 20px`,margin:`0 auto`,width:`100%`},children:[(0,R.jsxs)(`div`,{className:`page-header`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,gap:`16px`,flexWrap:`wrap`},children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{children:`Plugins`}),(0,R.jsx)(`p`,{children:`Modular capability system for Total Recall and SSSS apps — memory categories, agent context, commands, and design-token UI. Customizable branding, locked release status, and direct store deployment are managed on each card.`})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`8px`},children:[(0,R.jsx)(`button`,{className:`btn btn-ghost`,onClick:()=>de(!0),children:`Agent Recipe`}),(0,R.jsx)(`button`,{className:`btn btn-primary`,onClick:()=>{T(!0),C(null)},children:`Install from source…`})]})]}),S&&(0,R.jsxs)(`div`,{className:`alert ${S.type===`success`?`alert-success`:`alert-error`}`,role:`status`,style:{display:`flex`,justifyContent:`space-between`,gap:`12px`,marginBottom:`20px`},children:[(0,R.jsx)(`span`,{children:S.message}),(0,R.jsx)(`button`,{onClick:()=>C(null),"aria-label":`Dismiss`,style:{background:`none`,border:`none`,color:`inherit`,cursor:`pointer`},children:`×`})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:`12px`,flexWrap:`wrap`,marginBottom:`20px`},children:[(0,R.jsxs)(`div`,{role:`tablist`,style:{display:`flex`,gap:`8px`},children:[Qe(`installed`,`My Cards`,Ye.length),Qe(`bundled`,`Plugin Catalog`,Ze.length),Qe(`mesh`,`On the mesh`)]}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,flexWrap:`wrap`},children:[(0,R.jsx)(`input`,{className:`input`,placeholder:`Search plugins`,value:h,onChange:e=>g(e.target.value),"aria-label":`Search plugins`,style:{width:`220px`}}),(0,R.jsxs)(`select`,{className:`select`,value:v,onChange:e=>y(e.target.value),"aria-label":`Filter by use case`,style:{paddingRight:`32px`},children:[(0,R.jsx)(`option`,{value:``,children:`All use cases`}),Me.map(e=>(0,R.jsx)(`option`,{value:e,children:e},e))]})]})]}),r===`installed`&&(p?(0,R.jsx)(`div`,{style:PZ,children:`Loading…`}):(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`16px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,flexWrap:`wrap`,gap:`12px`},children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{style:{fontWeight:600,fontSize:`15px`},children:fe===`workspace`?`Active Workspace Cards`:`All Installed Plugins`}),(0,R.jsx)(`div`,{style:PZ,children:fe===`workspace`?`Core runtime foundation and activated repository cards. Standalone tools live in the Plugin Catalog.`:`All plugin packages installed on this host.`})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`6px`},children:[(0,R.jsxs)(`button`,{type:`button`,className:`btn btn-xs ${fe===`workspace`?`btn-primary`:`btn-ghost`}`,onClick:()=>pe(`workspace`),children:[`Workspace (`,Ye.length,`)`]}),(0,R.jsxs)(`button`,{type:`button`,className:`btn btn-xs ${fe===`all`?`btn-primary`:`btn-ghost`}`,onClick:()=>pe(`all`),children:[`All Installed (`,a.length,`)`]})]})]}),Xe.length===0?(0,R.jsx)(UZ,{title:fe===`workspace`?`No workspace cards active`:`No plugins installed`,children:fe===`workspace`?(0,R.jsxs)(R.Fragment,{children:[`Explore the `,(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>i(`bundled`),children:`Plugin Store`}),` to add capabilities or ask your agent to author one.`]}):(0,R.jsxs)(R.Fragment,{children:[`Start with a `,(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>i(`bundled`),children:`bundled plugin`}),` or see what your peers share.`]})}):(0,R.jsx)(`div`,{className:`card-grid`,style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(min(100%, 720px), 1fr))`,gap:`22px`},children:Xe.map(e=>(0,R.jsxs)(`div`,{onContextMenu:t=>ke(e,t),onTouchStart:t=>De(e,t),onTouchEnd:Oe,style:{display:`flex`,flexDirection:`column`,gap:`8px`,minWidth:0},children:[(0,R.jsx)(AZ,{plugin:e}),(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`0 4px`,fontSize:`11px`,color:`var(--text-tertiary)`,flexWrap:`wrap`,gap:`6px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`6px`,alignItems:`center`,flexWrap:`wrap`},children:[(0,R.jsx)(`span`,{className:`badge`,children:e.scope}),(0,R.jsx)(`span`,{className:`badge`,children:BZ(e)}),e.shared&&(0,R.jsx)(`span`,{className:`badge badge-accent`,children:`shared`}),!e.valid&&(0,R.jsx)(`span`,{className:`badge badge-error`,children:`invalid manifest`}),e.modified_since_install&&(0,R.jsx)(`span`,{className:`badge badge-warning`,children:`changed since install`})]}),(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-xs`,onClick:()=>Ge(e,`details`),style:{fontSize:`11px`,color:`var(--text-secondary)`},children:`Settings & usage`}),!FZ.has(e.id)&&(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-xs`,onClick:()=>Ie(e),style:{fontSize:`11px`,color:`var(--text-secondary)`},title:`Move back to Plugin Store`,children:`Remove from Workspace`})]})]},`${e.scope}:${e.id}`))})]})),r===`bundled`&&(p?(0,R.jsx)(`div`,{style:PZ,children:`Loading…`}):(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`20px`},children:[(0,R.jsx)(`div`,{className:`card`,style:{background:`linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%)`,border:`1px solid rgba(99, 102, 241, 0.3)`,padding:`20px`,display:`flex`,flexDirection:`column`,gap:`14px`},children:(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,gap:`16px`,flexWrap:`wrap`},children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,marginBottom:`4px`},children:[(0,R.jsx)(`span`,{className:`badge`,style:{background:`rgba(99, 102, 241, 0.2)`,color:`#818cf8`,borderColor:`rgba(99, 102, 241, 0.4)`,fontSize:`11px`},children:`AGENT RECIPE ARCHITECTURE`}),(0,R.jsx)(`span`,{style:{fontSize:`11px`,color:`var(--text-tertiary)`},children:`Declarative Recipes · Private or Store`})]}),(0,R.jsx)(`h2`,{style:{fontSize:`18px`,fontWeight:700,margin:0,color:`#f8fafc`},children:`Build Bespoke Plugins with Your Coding Agent`}),(0,R.jsx)(`p`,{style:{...PZ,margin:`6px 0 0 0`,maxWidth:`640px`},children:`Total Recall plugins are not generated by closed system templates; your contextual coding agent (Antigravity, Claude, Codex, DSH) builds them from a declarative Recipe. Run them privately in your workspace or publish them to the Plugin Store.`})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,flexWrap:`wrap`},children:[(0,R.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:()=>de(!0),children:`View Agent Recipe`}),(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:Le,children:`Copy Agent Prompt`}),(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>{T(!0),C(null)},children:`Install from source…`})]})]})}),Ze.length===0?(0,R.jsx)(UZ,{title:`No plugins match in store`}):(0,R.jsx)(`div`,{className:`card-grid`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(min(100%, 340px), 1fr))`,gap:`16px`},children:Ze.map(e=>{let t=LZ(e);return(0,R.jsxs)(`div`,{className:`card`,style:{display:`flex`,flexDirection:`column`,gap:`10px`,borderTop:`3px solid ${t.color}`,background:`var(--bg-secondary)`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:`8px`,alignItems:`flex-start`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`10px`,alignItems:`center`},children:[(0,R.jsx)(`div`,{style:{width:`34px`,height:`34px`,borderRadius:`8px`,background:`${t.color}20`,border:`1px solid ${t.color}40`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontWeight:700,fontSize:`12px`,color:t.color},children:t.icon||e.name.slice(0,2).toUpperCase()}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{style:{fontWeight:600,fontSize:`14px`,lineHeight:1.2},children:e.name}),(0,R.jsxs)(`div`,{style:{...NZ,color:`var(--text-tertiary)`,fontSize:`11px`},children:[e.id,` · v`,e.version]})]})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`flex-end`,gap:`4px`},children:[(0,R.jsx)(`span`,{className:`badge`,style:{background:`${t.color}15`,color:t.color,borderColor:`${t.color}35`,fontSize:`10px`},children:t.badge}),e.inWorkspace&&(0,R.jsx)(`span`,{className:`badge badge-success`,style:{fontSize:`10px`},children:`✓ In Workspace`})]})]}),(0,R.jsx)(`div`,{style:{...PZ,fontSize:`12px`,minHeight:`36px`},children:e.description}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`4px`,flexWrap:`wrap`,fontSize:`10px`},children:[e.cli&&(0,R.jsxs)(`span`,{className:`badge`,style:{fontFamily:`var(--font-mono)`},children:[`CLI (`,e.cli.subcommands?.length||1,`)`]}),e.tasks&&e.tasks.length>0&&(0,R.jsxs)(`span`,{className:`badge`,style:{fontFamily:`var(--font-mono)`},children:[e.tasks.length,` `,e.tasks.length===1?`task`:`tasks`]}),e.secrets&&e.secrets.length>0&&(0,R.jsxs)(`span`,{className:`badge`,style:{fontFamily:`var(--font-mono)`},children:[e.secrets.length,` `,e.secrets.length===1?`secret`:`secrets`]}),FZ.has(e.id)&&(0,R.jsx)(`span`,{className:`badge`,style:{background:`rgba(59, 130, 246, 0.15)`,color:`#60a5fa`},children:`Core Bundle`})]}),(0,R.jsx)(VZ,{useCases:e.use_cases}),(0,R.jsxs)(`div`,{style:{marginTop:`auto`,display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:`8px`,paddingTop:`8px`,borderTop:`1px solid var(--border)`},children:[(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>{e.sourcePlugin?Ge(e.sourcePlugin,`preview`):Ge({id:e.id,name:e.name,version:e.version,description:e.description,author:null,license:null,homepage:null,use_cases:e.use_cases,valid:!0,errors:[],scope:`global`,linked:!1,dir:``,shared:!1,mesh_shared:!1,share_url:null,source:{kind:`bundled`,ref:e.id},installed_at:null,sha256:null,installed_sha256:null,modified_since_install:!1,file_count:null,size_bytes:null,categories:[],tasks:e.tasks||[],openwiki_hubs:[],cli:e.cli,has_generator:!1,branding:e.branding},`preview`)},children:`Preview`}),(0,R.jsx)(`div`,{style:{display:`flex`,gap:`6px`},children:e.installed?e.inWorkspace?(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:b===e.id,onClick:()=>Ie(e.sourcePlugin||e),style:{fontSize:`11px`},children:`Remove from Workspace`}):(0,R.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,disabled:b===e.id,onClick:()=>Fe(e.sourcePlugin||e),children:b===e.id?`Adding…`:`+ Add to Workspace`}):(0,R.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,disabled:b===e.id,onClick:()=>Re(e.id),children:b===e.id?`Installing…`:`Install`})})]})]},e.id)})})]})),r===`mesh`&&(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`16px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:`12px`,flexWrap:`wrap`},children:[(0,R.jsx)(`p`,{style:{...PZ,margin:0},children:`Asked live from each node. Only plugins their owner chose to share appear here; content is hash-checked on install.`}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:je,disabled:d,children:d?`Asking peers…`:`Refresh`})]}),d&&!l?(0,R.jsx)(`div`,{style:PZ,children:`Asking peers…`}):l===null?(0,R.jsx)(UZ,{title:`Could not ask the mesh`,children:`The brain server did not answer the peer query.`}):l.mesh.available?l.peers.length===0?(0,R.jsx)(UZ,{title:`No other nodes on the mesh`}):(0,R.jsxs)(R.Fragment,{children:[!l.mesh.configured&&(0,R.jsxs)(`div`,{className:`alert alert-warning`,children:[`This node has no `,(0,R.jsx)(`code`,{style:NZ,children:`TR_MESH_SYNC_TOKEN`}),`, so it cannot query peers. Set the same token on each node.`]}),l.peers.map(e=>{let t=e.plugins.filter(Ne);return(0,R.jsxs)(`div`,{className:`card`,children:[(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:`12px`,alignItems:`center`,marginBottom:e.plugins.length?`12px`:0,flexWrap:`wrap`},children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{style:{fontWeight:600},children:e.hostname}),` `,(0,R.jsx)(`span`,{style:{...NZ,color:`var(--text-tertiary)`},children:e.ip})]}),(0,R.jsxs)(`span`,{className:`badge ${e.status===`ok`?`badge-online`:e.status===`offline`?`badge-offline`:`badge-warning`}`,children:[MZ[e.status],e.status===`ok`?` · ${e.plugins.length} shared`:``]})]}),e.error&&e.status!==`ok`&&(0,R.jsx)(`div`,{style:{...PZ,fontSize:`12px`},children:e.error}),e.status===`ok`&&e.plugins.length===0&&(0,R.jsx)(`div`,{style:PZ,children:`Shares no plugins.`}),e.status===`ok`&&e.plugins.length>0&&t.length===0&&(0,R.jsx)(`div`,{style:PZ,children:`No shared plugins match the filter.`}),t.map(t=>{let n=`peer:${e.hostname}/${t.id}`;return(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:`16px`,padding:`12px 0`,borderTop:`1px solid var(--border)`,flexWrap:`wrap`},children:[(0,R.jsxs)(`div`,{style:{minWidth:0,flex:`1 1 320px`,display:`flex`,flexDirection:`column`,gap:`6px`},children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{style:{fontWeight:600},children:t.name}),` `,(0,R.jsxs)(`span`,{style:{...NZ,color:`var(--text-tertiary)`},children:[`v`,t.version]})]}),(0,R.jsx)(`div`,{style:PZ,children:t.description}),(0,R.jsx)(VZ,{useCases:t.use_cases}),(0,R.jsxs)(`div`,{style:{...NZ,color:`var(--text-tertiary)`},title:t.sha256,children:[`sha256 `,RZ(t.sha256),` · `,t.file_count,` files · `,zZ(t.size_bytes)]})]}),(0,R.jsx)(`div`,{style:{alignSelf:`center`},children:t.installed?(0,R.jsx)(`span`,{className:`badge ${t.same_as_installed?`badge-success`:`badge-warning`}`,children:t.same_as_installed?`installed (same content)`:`installed (different content)`}):(0,R.jsx)(`button`,{className:`btn btn-primary btn-sm`,disabled:b===n,onClick:()=>Re(n),children:b===n?`Installing…`:`Install`})})]},t.id)})]},e.hostname)})]}):(0,R.jsxs)(UZ,{title:`This node is not on a mesh`,children:[`Enroll it with `,(0,R.jsx)(`code`,{style:NZ,children:`npx total-recall mesh enroll`}),` to share plugins between your nodes.`]})]}),w&&(0,R.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Install plugin from source`,onClick:()=>T(!1),style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.6)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1e3,padding:`16px`},children:(0,R.jsxs)(`form`,{className:`card`,onClick:e=>e.stopPropagation(),style:{width:`100%`,maxWidth:`520px`,display:`flex`,flexDirection:`column`,gap:`14px`},onSubmit:async e=>{e.preventDefault(),E.trim()&&await Re(E.trim(),{link:O,global:k})&&(T(!1),D(``))},children:[(0,R.jsx)(`div`,{style:{fontWeight:600,fontSize:`16px`},children:`Install from source`}),(0,R.jsxs)(`div`,{style:PZ,children:[`A bundled plugin id, `,(0,R.jsx)(`code`,{style:NZ,children:`peer:<host>/<id>`}),`, a git URL, or a folder on this machine containing `,(0,R.jsx)(`code`,{style:NZ,children:`plugin.json`}),`.`]}),(0,R.jsx)(`input`,{className:`input`,autoFocus:!0,value:E,onChange:e=>D(e.target.value),placeholder:`https://github.com/you/my-plugin.git`,"aria-label":`Plugin source`}),(0,R.jsxs)(`label`,{style:{...PZ,display:`flex`,gap:`8px`,alignItems:`center`},children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:O,onChange:e=>ee(e.target.checked)}),`Link a local folder instead of copying it (for plugin development)`]}),(0,R.jsxs)(`label`,{style:{...PZ,display:`flex`,gap:`8px`,alignItems:`center`},children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:k,onChange:e=>te(e.target.checked)}),`Install for every project on this machine`]}),(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:`8px`},children:[(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>T(!1),children:`Cancel`}),(0,R.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,disabled:!E.trim()||b!==null,children:b?`Installing…`:`Install`})]})]})}),ge&&ve&&(0,R.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Customize Plugin Branding`,onClick:()=>_e(!1),style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.6)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1e3,padding:`16px`},children:(0,R.jsxs)(`div`,{className:`card`,onClick:e=>e.stopPropagation(),style:{width:`100%`,maxWidth:`480px`,display:`flex`,flexDirection:`column`,gap:`16px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,R.jsxs)(`div`,{style:{fontWeight:700,fontSize:`16px`},children:[`Customize Branding: `,ve.name]}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>_e(!1),children:`✕`})]}),ve.locked&&(0,R.jsx)(`div`,{className:`alert alert-warning`,style:{fontSize:`12px`},children:`[LOCKED] This plugin is marked complete and locked against editing. Unlock it to change branding.`}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`6px`},children:[(0,R.jsx)(`label`,{style:{fontSize:`12px`,color:`var(--text-secondary)`},children:`Wordmark Glyph / Tag`}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`8px`},children:[(0,R.jsx)(`input`,{className:`input`,value:be,onChange:e=>xe(e.target.value),style:{width:`90px`,textAlign:`center`,fontSize:`14px`,fontFamily:`var(--font-mono)`},disabled:ve.locked}),(0,R.jsx)(`div`,{style:{display:`flex`,gap:`4px`,flexWrap:`wrap`,alignItems:`center`},children:[`[TEL]`,`[DNS]`,`[SIGN]`,`[GATE]`,`[CLI]`,`[LAW]`,`[UI]`,`[SMS]`,`[FIND]`,`[GIT]`,`[OPS]`,`[WARN]`,`[CORE]`].map(e=>(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{padding:`4px 6px`,fontSize:`11px`,fontFamily:`var(--font-mono)`},disabled:ve.locked,onClick:()=>xe(e),children:e},e))})]})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`6px`},children:[(0,R.jsx)(`label`,{style:{fontSize:`12px`,color:`var(--text-secondary)`},children:`Theme Color (Hex)`}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,alignItems:`center`},children:[(0,R.jsx)(`input`,{type:`color`,value:Se,onChange:e=>Ce(e.target.value),style:{width:`42px`,height:`38px`,border:`none`,cursor:`pointer`,background:`none`},disabled:ve.locked}),(0,R.jsx)(`input`,{className:`input`,value:Se,onChange:e=>Ce(e.target.value),style:{flex:1,fontFamily:`var(--font-mono)`},disabled:ve.locked})]})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`6px`},children:[(0,R.jsx)(`label`,{style:{fontSize:`12px`,color:`var(--text-secondary)`},children:`Domain Badge Text`}),(0,R.jsx)(`input`,{className:`input`,value:P,onChange:e=>we(e.target.value),placeholder:`e.g. Telephony, Quality, DNS`,disabled:ve.locked})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:`8px`,marginTop:`8px`},children:[(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>_e(!1),children:`Cancel`}),(0,R.jsx)(`button`,{type:`button`,className:`btn btn-primary`,onClick:We,disabled:ve.locked||b!==null,children:`Save Branding`})]})]})}),ue&&(0,R.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Agent Plugin Recipe`,onClick:()=>de(!1),style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.65)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1e3,padding:`16px`},children:(0,R.jsxs)(`div`,{className:`card`,onClick:e=>e.stopPropagation(),style:{width:`100%`,maxWidth:`680px`,maxHeight:`90vh`,overflowY:`auto`,display:`flex`,flexDirection:`column`,gap:`16px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{style:{margin:0,fontSize:`17px`,fontWeight:700},children:`Agent Plugin Recipe`}),(0,R.jsx)(`div`,{style:{...PZ,fontSize:`12px`},children:`How your coding agent authors private or store plugins`})]}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>de(!1),children:`✕`})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`12px`,fontSize:`13px`},children:[(0,R.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,padding:`12px`,borderRadius:`8px`,border:`1px solid var(--border)`},children:[(0,R.jsx)(`div`,{style:{fontWeight:600,marginBottom:`4px`},children:`1. Command your agent`}),(0,R.jsx)(`div`,{style:PZ,children:`Copy and send this instruction to your coding agent (Antigravity, Claude, Codex, DSH):`}),(0,R.jsx)(`pre`,{style:{...NZ,background:`rgba(0,0,0,0.4)`,padding:`10px`,borderRadius:`6px`,marginTop:`8px`,whiteSpace:`pre-wrap`,overflowX:`auto`,fontSize:`11px`,color:`#a5b4fc`},children:IZ}),(0,R.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:`8px`},children:(0,R.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:()=>Le(),children:`Copy Agent Prompt`})})]}),(0,R.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:`12px`},children:[(0,R.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,padding:`12px`,borderRadius:`8px`,border:`1px solid var(--border)`},children:[(0,R.jsx)(`div`,{style:{fontWeight:600,color:`#38bdf8`,marginBottom:`4px`},children:`🔒 Private Plugins`}),(0,R.jsxs)(`div`,{style:{...PZ,fontSize:`12px`,lineHeight:1.4},children:[`Store directly inside `,(0,R.jsx)(`code`,{style:NZ,children:`.agent/skills/total-recall/plugins/<id>`}),` or link locally. Never shared outside this machine or project. Zero cloud exposure.`]})]}),(0,R.jsxs)(`div`,{style:{background:`var(--bg-tertiary)`,padding:`12px`,borderRadius:`8px`,border:`1px solid var(--border)`},children:[(0,R.jsx)(`div`,{style:{fontWeight:600,color:`#a855f7`,marginBottom:`4px`},children:`🌐 Plugin Store Distribution`}),(0,R.jsxs)(`div`,{style:{...PZ,fontSize:`12px`,lineHeight:1.4},children:[`Deploy to the store via `,(0,R.jsx)(`code`,{style:NZ,children:`total-recall deploy-store <id>`}),`. Cryptographically signed and distributed across the mesh for team consumption.`]})]})]}),(0,R.jsxs)(`div`,{style:{background:`rgba(16, 185, 129, 0.08)`,padding:`12px`,borderRadius:`8px`,border:`1px solid rgba(16, 185, 129, 0.2)`},children:[(0,R.jsx)(`div`,{style:{fontWeight:600,color:`#10b981`,marginBottom:`4px`},children:`Quality Invariants Enforced`}),(0,R.jsxs)(`ul`,{style:{margin:`4px 0 0 16px`,padding:0,fontSize:`12px`,color:`var(--text-secondary)`},children:[(0,R.jsx)(`li`,{children:`Guaranteed Title, Brand Glyph, Version, and Settings drawer trigger on every card`}),(0,R.jsx)(`li`,{children:`Authentic domain tools only — zero fake audio equalizers or fake skins`}),(0,R.jsx)(`li`,{children:`Touch-first ergonomics with minimum 44px tap targets`})]})]})]}),(0,R.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:`8px`},children:(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>de(!1),children:`Close`})})]})}),A&&(0,R.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":A.name,onClick:Ke,style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.6)`,display:`flex`,justifyContent:`flex-end`,zIndex:1e3},children:(0,R.jsx)(`div`,{onClick:e=>e.stopPropagation(),style:{width:`100%`,maxWidth:`680px`,height:`100%`,overflowY:`auto`,background:`var(--bg-secondary)`,borderLeft:`1px solid var(--border)`,padding:`24px`,display:`flex`,flexDirection:`column`,gap:`16px`},children:(()=>{let e=LZ(A),t=kZ(A).length>0;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:`12px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`12px`,alignItems:`center`},children:[(0,R.jsx)(`div`,{style:{width:`44px`,height:`44px`,borderRadius:`10px`,background:`${e.color}20`,border:`1px solid ${e.color}50`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:`22px`,flexShrink:0},children:e.icon}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{style:{fontSize:`18px`,fontWeight:700},children:A.name}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,alignItems:`center`,marginTop:`2px`},children:[(0,R.jsxs)(`span`,{style:{...NZ,color:`var(--text-tertiary)`},children:[A.id,` · v`,A.version]}),(0,R.jsx)(`span`,{className:`badge`,style:{background:`${e.color}15`,color:e.color,borderColor:`${e.color}40`,fontSize:`11px`},children:e.badge}),A.locked&&(0,R.jsx)(`span`,{className:`badge`,style:{background:`#2e1065`,color:`#c084fc`},children:`Locked`})]})]})]}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:Ke,"aria-label":`Close`,children:`Close`})]}),(0,R.jsx)(`div`,{style:PZ,children:A.description}),!A.valid&&(0,R.jsx)(`div`,{className:`alert alert-error`,children:A.errors.map(e=>(0,R.jsx)(`div`,{children:e},e))}),(0,R.jsxs)(`div`,{role:`tablist`,style:{display:`flex`,gap:`8px`,borderBottom:`1px solid var(--border)`,paddingBottom:`10px`},children:[t&&(0,R.jsxs)(`button`,{role:`tab`,"aria-selected":M===`preview`,className:`btn btn-sm ${M===`preview`?`btn-primary`:`btn-ghost`}`,onClick:()=>ne(`preview`),children:[`Open `,A.name]}),A.cli&&(0,R.jsx)(`button`,{role:`tab`,"aria-selected":M===`run`,className:`btn btn-sm ${M===`run`?`btn-primary`:`btn-ghost`}`,onClick:()=>ne(`run`),children:`Run CLI`}),(0,R.jsx)(`button`,{role:`tab`,"aria-selected":M===`details`,className:`btn btn-sm ${M===`details`?`btn-primary`:`btn-ghost`}`,onClick:()=>ne(`details`),children:`Settings`}),(0,R.jsx)(`button`,{role:`tab`,"aria-selected":M===`readme`,className:`btn btn-sm ${M===`readme`?`btn-primary`:`btn-ghost`}`,onClick:()=>ne(`readme`),children:`README`})]}),M===`preview`&&(0,R.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`12px`},children:(0,R.jsx)(AZ,{plugin:A})}),M===`run`&&A.cli&&(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`10px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,flexWrap:`wrap`},children:[(0,R.jsx)(`select`,{className:`select`,value:N,onChange:e=>re(e.target.value),"aria-label":`Subcommand`,style:{paddingRight:`32px`},children:(A.cli.subcommands.length?A.cli.subcommands:[{name:``}]).map(e=>(0,R.jsx)(`option`,{value:e.name,children:e.name||`(default)`},e.name))}),(0,R.jsx)(`input`,{className:`input`,value:ie,onChange:e=>ae(e.target.value),placeholder:`extra arguments`,"aria-label":`Arguments`,style:{flex:1,minWidth:`160px`}}),(0,R.jsx)(`button`,{className:`btn btn-primary`,onClick:qe,disabled:b===`run:${A.id}`||!A.valid,children:b===`run:${A.id}`?`Running…`:`Run`})]}),(0,R.jsxs)(`div`,{style:{...PZ,fontSize:`12px`},children:[A.cli.subcommands.find(e=>e.name===N)?.description,` `,`Same as `,(0,R.jsxs)(`code`,{style:NZ,children:[`npx total-recall `,A.cli.command,` `,N,` `,ie]}),`. Runs in a separate process.`]}),oe&&(0,R.jsx)(`pre`,{style:{...NZ,margin:0,padding:`14px`,borderRadius:`var(--radius-sm)`,background:`var(--bg-primary)`,border:`1px solid ${oe.ok?`var(--border)`:`var(--error)`}`,whiteSpace:`pre-wrap`,maxHeight:`420px`,overflow:`auto`},children:oe.text})]}),M===`details`&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(jZ,{plugin:A}),(0,R.jsxs)(HZ,{label:`Scope`,children:[A.scope,A.linked?` (linked folder)`:``]}),(0,R.jsxs)(HZ,{label:`Source`,children:[BZ(A),` — `,(0,R.jsx)(`span`,{style:NZ,children:A.source.ref})]}),(0,R.jsx)(HZ,{label:`Installed`,children:A.installed_at?new Date(A.installed_at).toLocaleString():`no install record`}),(0,R.jsx)(HZ,{label:`Content sha256`,children:(0,R.jsx)(`span`,{style:NZ,children:A.sha256||`—`})}),A.modified_since_install&&(0,R.jsx)(HZ,{label:`At install`,children:(0,R.jsx)(`span`,{style:NZ,children:A.installed_sha256})}),(0,R.jsxs)(HZ,{label:`Files`,children:[A.file_count??`—`,` · `,zZ(A.size_bytes)]}),(0,R.jsx)(HZ,{label:`Shared`,children:A.shared?`yes`:`no`}),(0,R.jsx)(HZ,{label:`Lock Status`,children:A.locked?`Locked (Completed)`:`Unlocked (Editable)`}),(0,R.jsx)(HZ,{label:`Store Status`,children:A.store_deployed?`Published in Plugin Store`:`Not yet deployed to store`}),A.shared&&(0,R.jsx)(HZ,{label:`Public link`,children:A.share_url?(0,R.jsx)(`input`,{className:`input`,"aria-label":`Public plugin share link`,readOnly:!0,value:A.share_url,onFocus:e=>e.currentTarget.select()}):`Set TR_PUBLIC_BASE_URL to your public HTTPS origin to create a link.`}),(0,R.jsx)(HZ,{label:`Use cases`,children:A.use_cases.join(`, `)||`—`}),A.author&&(0,R.jsx)(HZ,{label:`Author`,children:A.author}),A.license&&(0,R.jsx)(HZ,{label:`License`,children:A.license}),(0,R.jsx)(HZ,{label:`Location`,children:(0,R.jsx)(`span`,{style:NZ,children:A.dir})}),(0,R.jsx)(HZ,{label:`Agent context`,children:A.has_generator?`adds a block to compiled instructions`:`—`}),(0,R.jsx)(HZ,{label:`Memory categories`,children:A.categories.length?A.categories.map(e=>e.name).join(`, `):`—`}),(0,R.jsx)(HZ,{label:`Scheduled tasks`,children:A.tasks.length===0?`—`:(0,R.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`6px`},children:A.tasks.map(e=>(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{style:NZ,children:e.schedule}),` `,e.command,` — `,e.intent,(0,R.jsxs)(`div`,{style:{color:`var(--text-tertiary)`,fontSize:`12px`},children:[`last run: `,e.last_run||`not yet`]})]},e.command))})}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,marginTop:`16px`,flexWrap:`wrap`},children:[(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>Ue(A),disabled:A.locked,children:`Customize Branding`}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>Ve(A),disabled:b===A.id,children:A.locked?`Unlock Editing`:`Lock When Complete`}),(0,R.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:()=>He(A),disabled:b===A.id||!A.valid,children:A.store_deployed?`✓ Deployed to Store`:`Deploy to Plugin Store`}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,disabled:b===A.id||!A.valid&&!A.shared,onClick:()=>Be(A,!A.shared),children:A.shared?`Stop sharing`:`Share`}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,disabled:b===A.id,onClick:()=>ze(A),children:`Remove`})]})]}),M===`readme`&&(0,R.jsx)(`div`,{style:{fontSize:`14px`,lineHeight:1.6},children:ce?$X(ce):(0,R.jsx)(`span`,{style:PZ,children:`Loading…`})})]})})()})}),Te&&(0,R.jsxs)(`div`,{role:`menu`,"aria-label":`Plugin actions menu`,onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),style:{position:`fixed`,left:Math.max(12,Math.min(Te.x,window.innerWidth-264)),top:Math.max(12,Math.min(Te.y,window.innerHeight-380)),zIndex:2e3,width:`250px`,background:`var(--bg-secondary)`,border:`1px solid var(--border)`,borderRadius:`10px`,boxShadow:`0 12px 36px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.08)`,padding:`6px`,display:`flex`,flexDirection:`column`,gap:`2px`,backdropFilter:`blur(12px)`},children:[(0,R.jsxs)(`div`,{style:{padding:`8px 10px`,borderBottom:`1px solid var(--border)`,display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,R.jsx)(`div`,{style:{width:`8px`,height:`8px`,borderRadius:`50%`,background:LZ(Te.plugin).color}}),(0,R.jsxs)(`div`,{style:{minWidth:0},children:[(0,R.jsx)(`div`,{style:{fontWeight:600,fontSize:`13px`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:Te.plugin.name}),(0,R.jsxs)(`div`,{style:{...NZ,fontSize:`10px`,color:`var(--text-tertiary)`},children:[Te.plugin.id,` · v`,Te.plugin.version]})]})]}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,style:{justifyContent:`flex-start`,width:`100%`,padding:`8px 10px`,fontSize:`12px`,minHeight:`36px`},onClick:()=>{let e=Te.plugin;Ee(null),Ge(e,`preview`)},children:`Open UI Component`}),(0,R.jsxs)(`button`,{className:`btn btn-ghost btn-sm`,style:{justifyContent:`flex-start`,width:`100%`,padding:`8px 10px`,fontSize:`12px`,minHeight:`36px`},onClick:()=>{let e=Te.plugin;Ee(null),Ge(e,`run`)},children:[`Run CLI (`,Te.plugin.cli?.command||Te.plugin.id,`)`]}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,style:{justifyContent:`flex-start`,width:`100%`,padding:`8px 10px`,fontSize:`12px`,minHeight:`36px`},onClick:()=>{let e=Te.plugin;Ee(null),Ge(e,`details`)},children:`Configure & Settings`}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,style:{justifyContent:`flex-start`,width:`100%`,padding:`8px 10px`,fontSize:`12px`,minHeight:`36px`},onClick:()=>{let e=Te.plugin;Ee(null),Ge(e,`readme`)},children:`View Documentation`}),(0,R.jsx)(`div`,{style:{height:`1px`,background:`var(--border)`,margin:`4px 0`}}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,style:{justifyContent:`flex-start`,width:`100%`,padding:`8px 10px`,fontSize:`12px`,minHeight:`36px`},onClick:()=>{let e=Te.plugin;Ee(null),Be(e,!e.shared)},children:Te.plugin.shared?`Stop sharing on mesh`:`Share on mesh & link`}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,style:{justifyContent:`flex-start`,width:`100%`,padding:`8px 10px`,fontSize:`12px`,minHeight:`36px`},onClick:()=>{let e=Te.plugin;Ee(null),Ve(e)},children:Te.plugin.locked?`Unlock editing`:`Lock for release`}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,style:{justifyContent:`flex-start`,width:`100%`,padding:`8px 10px`,fontSize:`12px`,minHeight:`36px`},onClick:()=>{let e=Te.plugin;Ee(null),navigator.clipboard?.writeText(`npx total-recall ${e.cli?.command||e.id}`),C({type:`success`,message:`Copied "npx total-recall ${e.cli?.command||e.id}" to clipboard`})},children:`Copy CLI command`}),(0,R.jsx)(`div`,{style:{height:`1px`,background:`var(--border)`,margin:`4px 0`}}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-sm`,style:{justifyContent:`flex-start`,width:`100%`,padding:`8px 10px`,fontSize:`12px`,color:`var(--color-error, #f87171)`,minHeight:`36px`},onClick:()=>{let e=Te.plugin;Ee(null),ze(e)},children:`Uninstall plugin`})]})]})}function GZ(){return localStorage.getItem(`tr-onboarding-complete`)===`1`}var KZ=`tr-onboarding-v1`,qZ=[{id:`welcome`,title:`Welcome to Total Recall`,body:`Portable personal memory for any IDE. Your rules and facts live as Markdown files on disk — not a locked vendor database.`},{id:`import-env`,title:`Import your API keys`,body:`Scan the machine for keys already in .env files or the shell, or paste a .env block. Nothing is written until you choose what to import.`},{id:`remember`,title:`Save your first memory`,body:`Write a fact or preference into the vault. This is the core write path: remember → compile → IDEs see it.`},{id:`connect`,title:`Connect an IDE`,body:`Wire Claude Code, Cursor, Codex, Gemini, Aider, Obsidian, or any HTTP host. Injected blocks never overwrite your local rules outside TR markers.`},{id:`dream`,title:`Dream consolidates memory`,body:`Dream is sleep for your vault: ingest sessions, conflict-check, recompile surfaces, prune. Run it anytime; no always-on LLM required.`},{id:`done`,title:`You're set`,body:`Default loop: init → connect → remember/recall → dream. Optional: task queue, skill track any repo, daemon in the background.`}];function JZ(){try{return JSON.parse(localStorage.getItem(KZ)||`{}`)}catch{return{step:0}}}function YZ(e){localStorage.setItem(KZ,JSON.stringify(e)),e.complete&&localStorage.setItem(`tr-onboarding-complete`,`1`)}function XZ(e){let t={};for(let n of e.split(/\r?\n/)){let e=n.trim();if(!e||e.startsWith(`#`))continue;let r=e.startsWith(`export `)?e.slice(7).trim():e,i=r.indexOf(`=`);if(i<=0)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();o=o.startsWith(`"`)&&o.endsWith(`"`)||o.startsWith(`'`)&&o.endsWith(`'`)?o.slice(1,-1):o.replace(/\s+#.*$/,``).trim(),a&&o&&(t[a]=o)}return t}function ZZ(){let e=ft(),t=JZ(),[n,r]=(0,_.useState)(t.step||0),[i,a]=(0,_.useState)(t.fact||``),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)([]),[m,h]=(0,_.useState)(new Set),[g,v]=(0,_.useState)(``),[y,b]=(0,_.useState)({}),[x,S]=(0,_.useState)(``),[C,w]=(0,_.useState)(!1),[T,E]=(0,_.useState)(`scan`),D=qZ[Math.min(n,qZ.length-1)];(0,_.useEffect)(()=>{or().then(e=>{let t=e||[],n=t.some(e=>e.slug===`user-profile`||e.slug===`onboarding-first-memory`||(e.tags||[]).includes(`onboarding`)),r=n||t.length>=5;d(n||r),r&&!GZ()&&localStorage.setItem(`tr-onboarding-complete`,`1`)}).catch(()=>{})},[]),(0,_.useEffect)(()=>{if(D.id!==`import-env`||T!==`scan`)return;let e=!1;return Promise.resolve().then(()=>{w(!0),S(``)}),kr().then(t=>{if(e)return;p(t.candidates||[]);let n=new Set((t.candidates||[]).filter(e=>!e.already_set).map(e=>e.key));h(n)}).catch(t=>{e||S(t instanceof Error?t.message:`Scan failed`)}).finally(()=>{e||w(!1)}),()=>{e=!0}},[D.id,T]);function O(){let e=Math.min(n+1,qZ.length-1);r(e),YZ({step:e,fact:i}),s(``)}function ee(){let e=Math.max(n-1,0);r(e),YZ({step:e,fact:i}),s(``)}function k(e){h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function te(){h(new Set(f.filter(e=>!e.already_set).map(e=>e.key)))}function A(){h(new Set)}async function j(){if(!g.trim())s(`Paste a .env block first.`);else{l(!0),S(``);try{let e=XZ(g);b(e);let t=await Ar(g);p(t.candidates||[]),h(new Set((t.candidates||[]).filter(e=>!e.already_set).map(e=>e.key))),s(t.count?`Found ${t.count} importable key(s) in paste.`:`No known API key names in paste.`)}catch(e){S(e instanceof Error?e.message:`Parse failed`)}finally{l(!1)}}}async function M(){let e=[...m];if(!e.length)s(`Select at least one key, or skip this step.`);else{l(!0),s(``);try{let t=T===`paste`&&Object.keys(y).length?await jr({keys:e,pairs:y,overwrite:!1}):await jr({keys:e,overwrite:!1});if(s(`Imported ${t.imported_count} secret(s)`+(t.skipped_count?`, skipped ${t.skipped_count} already set`:``)+`.`),T===`scan`){let e=await kr();p(e.candidates||[]),h(new Set)}else p(e=>e.map(e=>t.imported.some(t=>t.key===e.key)?{...e,already_set:!0}:e)),h(new Set)}catch(e){s(e instanceof Error?e.message:`Import failed`)}finally{l(!1)}}}async function ne(){if(!i.trim())s(`Write a short fact or preference first.`);else{l(!0),s(``);try{await ur({slug:`onboarding-first-memory`,category:`preferences`,title:`Onboarding first memory`,content:i.trim(),tags:[`onboarding`],importance:4});try{await Rr()}catch{}s(`Saved and queued surface compile.`),YZ({step:n,fact:i}),O()}catch(e){s(e instanceof Error?e.message:`Failed to save memory`)}finally{l(!1)}}}function N(){YZ({step:qZ.length-1,fact:i,complete:!0}),e(`/memory`)}let re=Math.round((n+1)/qZ.length*100);return(0,R.jsxs)(`div`,{className:`onboarding-shell`,children:[D.id===`welcome`&&(0,R.jsx)(`div`,{style:{marginBottom:28,borderRadius:16,padding:`16px 20px`,background:`linear-gradient(180deg, #f8fafc 0%, #e8eef9 100%)`,boxShadow:`0 1px 0 rgba(255,255,255,0.7) inset, 0 16px 40px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(148,163,184,0.2)`,display:`flex`,justifyContent:`center`},children:(0,R.jsx)(Fi,{variant:`lockup`,height:64,alt:`Total Recall`})}),(0,R.jsxs)(`div`,{style:{marginBottom:28},children:[(0,R.jsxs)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,marginBottom:10,letterSpacing:`0.08em`,textTransform:`uppercase`,fontWeight:600},children:[`Onboarding · `,n+1,`/`,qZ.length]}),(0,R.jsx)(`div`,{className:`onboarding-progress`,children:(0,R.jsx)(`div`,{style:{width:`${re}%`}})})]}),(0,R.jsx)(`h1`,{style:{fontSize:28,fontWeight:700,margin:`0 0 12px`,letterSpacing:`-0.03em`,background:`linear-gradient(135deg, #f8fafc 0%, #93c5fd 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:D.title}),(0,R.jsx)(`p`,{style:{fontSize:15.5,lineHeight:1.6,color:`var(--text-secondary)`,margin:`0 0 28px`},children:D.body}),D.id===`welcome`&&(0,R.jsxs)(`div`,{className:`loop-card`,style:{marginBottom:24},children:[`write\xA0\xA0→ remember / session ingest`,(0,R.jsx)(`br`,{}),`sleep\xA0\xA0→ dream (consolidate, conflict, compile)`,(0,R.jsx)(`br`,{}),`read\xA0\xA0\xA0→ recall + compiled surfaces`,(0,R.jsx)(`br`,{}),`async\xA0\xA0→ daemon tasks (any intent under policy)`]}),D.id===`import-env`&&(0,R.jsxs)(`div`,{style:{marginBottom:24},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:14},children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>E(`scan`),style:T===`scan`?rQ:iQ,children:`Scan machine`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>{E(`paste`),p([]),h(new Set)},style:T===`paste`?rQ:iQ,children:`Paste .env`})]}),T===`paste`&&(0,R.jsxs)(`div`,{style:{marginBottom:14},children:[(0,R.jsx)(`textarea`,{value:g,onChange:e=>v(e.target.value),placeholder:`OPENAI_API_KEY=sk-...
|
|
5622
5622
|
ANTHROPIC_API_KEY=sk-ant-...
|
|
5623
|
-
GOOGLE_API_KEY=...`,rows:6,style:{width:`100%`,boxSizing:`border-box`,background:`var(--bg-primary)`,border:`1px solid var(--border)`,borderRadius:10,padding:12,color:`var(--text-primary)`,fontSize:12,fontFamily:`ui-monospace, SFMono-Regular, Menlo, monospace`,resize:`vertical`}}),(0,R.jsx)(`button`,{type:`button`,disabled:c,onClick:j,style:{...IQ,marginTop:8},children:`Preview keys in paste`})]}),C&&(0,R.jsx)(`p`,{style:{fontSize:13,color:`var(--text-tertiary)`},children:`Scanning env sources…`}),x&&(0,R.jsx)(`p`,{style:{fontSize:13,color:`#f87171`,marginBottom:12},children:x}),!C&&f.length===0&&!x&&(0,R.jsx)(`div`,{style:{padding:14,borderRadius:10,border:`1px solid var(--border)`,background:`rgba(148,163,184,0.06)`,fontSize:13,color:`var(--text-secondary)`,marginBottom:12},children:T===`scan`?`No known API keys found in process.env or common .env paths (~/.agent/.env, project .env, …). Paste a .env or continue and set keys later with secret set.`:`Paste your .env and click Preview.`}),f.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:10,flexWrap:`wrap`},children:[(0,R.jsx)(`button`,{type:`button`,onClick:te,style:RQ,children:`Select new`}),(0,R.jsx)(`button`,{type:`button`,onClick:A,style:RQ,children:`Clear`}),(0,R.jsxs)(`span`,{style:{fontSize:12,color:`var(--text-tertiary)`,alignSelf:`center`},children:[m.size,` selected · values never shown raw`]})]}),(0,R.jsx)(`div`,{style:{maxHeight:280,overflowY:`auto`,border:`1px solid var(--border)`,borderRadius:12,marginBottom:12},children:f.map(e=>(0,R.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`10px 12px`,borderBottom:`1px solid var(--border)`,cursor:e.already_set?`default`:`pointer`,opacity:e.already_set?.55:1,background:m.has(e.key)?`rgba(59,130,246,0.08)`:`transparent`},children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:m.has(e.key),disabled:!!e.already_set,onChange:()=>k(e.key),style:{accentColor:`#3b82f6`}}),(0,R.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,R.jsxs)(`div`,{style:{fontSize:12,fontWeight:600,fontFamily:`ui-monospace, monospace`},children:[e.key,e.provider&&(0,R.jsx)(`span`,{style:{marginLeft:8,fontSize:10,color:`#93c5fd`,fontWeight:500},children:e.provider}),e.already_set&&(0,R.jsx)(`span`,{style:{marginLeft:8,fontSize:10,color:`#34d399`},children:`already set`})]}),(0,R.jsxs)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,marginTop:2},children:[e.masked,` · `,e.source_label]})]})]},e.key+e.source_label))}),(0,R.jsx)(`button`,{type:`button`,disabled:c||m.size===0,onClick:M,style:{...FQ,opacity:c||m.size===0?.5:1,cursor:c||m.size===0?`not-allowed`:`pointer`},children:c?`Importing…`:`Import ${m.size} secret(s)`})]}),(0,R.jsxs)(`p`,{style:{marginTop:14,fontSize:12,color:`var(--text-tertiary)`},children:[`CLI: `,(0,R.jsx)(`code`,{children:`npx total-recall secret import-env --all`}),` · `,(0,R.jsx)(En,{to:`/keys`,style:{color:`var(--accent)`},children:`Secrets page`})]})]}),D.id===`remember`&&(0,R.jsxs)(`div`,{style:{marginBottom:24},children:[(0,R.jsx)(`label`,{style:{fontSize:12,fontWeight:600,color:`var(--text-tertiary)`,display:`block`,marginBottom:8},children:`First memory (fact or preference)`}),(0,R.jsx)(`textarea`,{value:i,onChange:e=>a(e.target.value),placeholder:`e.g. "I prefer short answers and single quotes in JS."`,rows:4,style:{width:`100%`,boxSizing:`border-box`,background:`var(--bg-primary)`,border:`1px solid var(--border)`,borderRadius:10,padding:12,color:`var(--text-primary)`,fontSize:14,resize:`vertical`}}),(0,R.jsx)(`button`,{type:`button`,disabled:c,onClick:ne,style:{...FQ,marginTop:12},children:c?`Saving…`:`Save to vault & continue`})]}),D.id===`connect`&&(0,R.jsxs)(`div`,{style:{marginBottom:24,display:`flex`,flexDirection:`column`,gap:10},children:[(0,R.jsx)(`code`,{style:PQ,children:`npx total-recall connect claude-code`}),(0,R.jsx)(`code`,{style:PQ,children:`npx total-recall connect cursor`}),(0,R.jsx)(`code`,{style:PQ,children:`npx total-recall connect http-api --brain http://localhost:3000`}),(0,R.jsx)(En,{to:`/integrations`,style:{fontSize:13,color:`var(--accent)`},children:`Open Integrations page →`})]}),D.id===`dream`&&(0,R.jsxs)(`div`,{style:{marginBottom:24,display:`flex`,flexDirection:`column`,gap:10},children:[(0,R.jsx)(`code`,{style:PQ,children:`npx total-recall dream`}),(0,R.jsx)(`code`,{style:PQ,children:`npx total-recall daemon start # optional background worker`}),(0,R.jsx)(`code`,{style:PQ,children:`npx total-recall task add "Extract decisions from last session" --cap vault:write`}),(0,R.jsx)(En,{to:`/tasks`,style:{fontSize:13,color:`var(--accent)`},children:`Open Tasks page →`})]}),D.id===`done`&&(0,R.jsxs)(`div`,{style:{marginBottom:24,padding:16,borderRadius:12,background:`rgba(34,197,94,0.08)`,border:`1px solid rgba(34,197,94,0.25)`,fontSize:14,color:`var(--text-secondary)`},children:[u?`Vault already has onboarding profile data — you can jump to Memory anytime.`:`Optional: chat with the assistant to run the full preference interview (user-profile.md).`,(0,R.jsxs)(`div`,{style:{marginTop:12,display:`flex`,gap:12,flexWrap:`wrap`},children:[(0,R.jsx)(En,{to:`/`,style:LQ,children:`Open Chat`}),(0,R.jsx)(En,{to:`/memory`,style:LQ,children:`Open Vault`}),(0,R.jsx)(En,{to:`/integrations`,style:LQ,children:`Connect IDE`})]})]}),o&&(0,R.jsx)(`p`,{style:{fontSize:13,color:o.startsWith(`Saved`)||o.startsWith(`Imported`)||o.startsWith(`Found`)?`#22c55e`:`#f59e0b`,marginBottom:16},children:o}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:10,justifyContent:`space-between`},children:[(0,R.jsx)(`button`,{type:`button`,onClick:ee,disabled:n===0,style:IQ,children:`Back`}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[D.id!==`done`&&D.id!==`remember`&&(0,R.jsx)(`button`,{type:`button`,onClick:O,style:FQ,children:(D.id,`Continue`)}),D.id===`import-env`&&(0,R.jsx)(`button`,{type:`button`,onClick:O,style:IQ,children:`Skip for now`}),D.id===`remember`&&(0,R.jsx)(`button`,{type:`button`,onClick:O,style:IQ,children:`Skip for now`}),D.id===`done`&&(0,R.jsx)(`button`,{type:`button`,onClick:N,style:FQ,children:`Go to Memory`})]})]}),(0,R.jsxs)(`p`,{style:{marginTop:32,fontSize:12,color:`var(--text-tertiary)`},children:[`CLI-first: `,(0,R.jsx)(`code`,{children:`init → secret import-env --all → connect → remember → dream`})]}),n<kQ.length-1&&(0,R.jsx)(`button`,{type:`button`,onClick:N,style:{...IQ,marginTop:16,width:`100%`},children:`Skip onboarding → Memory`})]})}var PQ={display:`block`,background:`var(--bg-primary)`,border:`1px solid var(--border)`,borderRadius:8,padding:`10px 12px`,fontSize:12,color:`var(--text-secondary)`,fontFamily:`ui-monospace, SFMono-Regular, Menlo, monospace`,overflowX:`auto`},FQ={background:`linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%)`,color:`#fff`,border:`none`,borderRadius:12,padding:`11px 20px`,fontWeight:600,cursor:`pointer`,fontSize:14,boxShadow:`0 1px 0 rgba(255,255,255,0.15) inset, 0 8px 20px rgba(37, 99, 235, 0.28)`},IQ={background:`rgba(148, 163, 184, 0.06)`,color:`var(--text-secondary)`,border:`1px solid var(--border)`,borderRadius:12,padding:`11px 20px`,cursor:`pointer`,fontSize:14},LQ={...IQ,textDecoration:`none`,display:`inline-block`},RQ={...IQ,padding:`5px 10px`,fontSize:11},zQ={...FQ,padding:`8px 14px`,fontSize:12},BQ={...IQ,padding:`8px 14px`,fontSize:12};async function VQ(e,t){let n=await e.text(),r=null;if(n)try{r=JSON.parse(n)}catch{r=null}if(!e.ok){let n=r,i=n&&(n.error||n.message)||`${t} failed: ${e.status}`;throw Error(typeof i==`string`?i:`${t} failed: ${e.status}`)}return r}function HQ(e){if(Array.isArray(e))return e;if(e&&typeof e==`object`){let t=e;if(Array.isArray(t.rules))return t.rules;if(Array.isArray(t.history))return t.history;if(Array.isArray(t.entries))return t.entries}return[]}async function UQ(){return HQ(await VQ(await L(`${Rn()}/api/notifications/rules`),`GET /api/notifications/rules`))}async function WQ(e){return VQ(await L(`${Rn()}/api/notifications/rules`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),`POST /api/notifications/rules`)}async function GQ(e){await VQ(await L(`${Rn()}/api/notifications/rules/${encodeURIComponent(e)}`,{method:`DELETE`}),`DELETE /api/notifications/rules`)}async function KQ(){return HQ(await VQ(await L(`${Rn()}/api/notifications/history`),`GET /api/notifications/history`))}async function qQ(){await VQ(await L(`${Rn()}/api/notifications/test`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})}),`POST /api/notifications/test`)}var JQ=[{value:`node_offline`,label:`Node Offline`},{value:`leader_change`,label:`Leader Change`},{value:`webhook_failed`,label:`Webhook Failed`},{value:`secret_sync_failed`,label:`Secret Sync Failed`},{value:`daemon_error`,label:`Daemon Error`},{value:`research_complete`,label:`Research Complete`}],YQ=[`desktop`,`webhook`,`email`],XQ=[`critical`,`high`,`low`];function ZQ(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(`node_offline`),[m,h]=(0,_.useState)(`desktop`),[g,v]=(0,_.useState)(`high`),[y,b]=(0,_.useState)(!1);async function x(){l(!0),a(null);try{let[e,n]=await Promise.all([UQ(),KQ()]);t(e),r(n)}catch(e){a(e instanceof Error?e.message:`Failed to load notifications data`)}finally{l(!1)}}(0,_.useEffect)(()=>{setTimeout(()=>{x()},0);let e=setInterval(x,15e3);return()=>clearInterval(e)},[]);async function S(e){e.preventDefault();try{await WQ({event:f,channel:m,priority:g,enabled:!0,quietHours:y}),d(!1),p(JQ[0].value),h(`desktop`),v(`high`),b(!1),await x()}catch(e){a(e instanceof Error?e.message:`Failed to create notification rule`)}}async function C(e){if(confirm(`Delete this notification rule?`))try{await GQ(e),await x()}catch(e){a(e instanceof Error?e.message:`Failed to delete notification rule`)}}async function w(){try{await qQ(),s(`Test notification sent`),setTimeout(()=>s(null),3e3)}catch(e){a(e instanceof Error?e.message:`Failed to send test notification`)}}function T(e){let t=JQ.find(t=>t.value===e);return t?t.label:e}return(0,R.jsxs)(`div`,{className:`page-container notifications-page`,"data-testid":`notifications-page`,children:[(0,R.jsxs)(`div`,{className:`page-header`,children:[(0,R.jsx)(`h1`,{children:`Notifications`}),(0,R.jsx)(`button`,{onClick:()=>d(!0),className:`btn btn-primary`,"data-testid":`add-rule-btn`,children:`Add Rule`})]}),i&&(0,R.jsxs)(`div`,{className:`alert alert-error`,role:`alert`,"data-testid":`notifications-error`,style:{marginBottom:`24px`},children:[i,(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{marginLeft:12},onClick:()=>x(),children:`Retry`})]}),o&&(0,R.jsx)(`div`,{className:`alert alert-success`,style:{marginBottom:`24px`},children:o}),(0,R.jsxs)(`div`,{style:{marginBottom:`32px`},children:[(0,R.jsx)(`h2`,{style:{fontSize:`18px`,fontWeight:500,marginBottom:`16px`},children:`Notification Rules`}),(0,R.jsx)(`div`,{className:`card notif-rules-card`,children:(0,R.jsxs)(`table`,{className:`data-table`,children:[(0,R.jsx)(`thead`,{children:(0,R.jsxs)(`tr`,{children:[(0,R.jsx)(`th`,{children:`Event`}),(0,R.jsx)(`th`,{children:`Channel`}),(0,R.jsx)(`th`,{children:`Priority`}),(0,R.jsx)(`th`,{children:`Enabled`}),(0,R.jsx)(`th`,{children:`Quiet Hours`}),(0,R.jsx)(`th`,{children:`Actions`})]})}),(0,R.jsxs)(`tbody`,{children:[e.map(e=>(0,R.jsxs)(`tr`,{children:[(0,R.jsx)(`td`,{style:{fontWeight:500},children:T(e.event)}),(0,R.jsx)(`td`,{style:{textTransform:`capitalize`},children:e.channel}),(0,R.jsx)(`td`,{children:(0,R.jsx)(`span`,{className:`priority-badge ${e.priority}`,children:e.priority.toUpperCase()})}),(0,R.jsx)(`td`,{children:(0,R.jsx)(`span`,{className:`badge ${e.enabled?`badge-online`:`badge-offline`}`,children:e.enabled?`ON`:`OFF`})}),(0,R.jsx)(`td`,{children:(0,R.jsx)(`span`,{className:`badge ${e.quietHours?`badge-warning`:`badge-offline`}`,children:e.quietHours?`ACTIVE`:`OFF`})}),(0,R.jsx)(`td`,{children:(0,R.jsx)(`div`,{className:`notif-rules-actions`,children:(0,R.jsx)(`button`,{onClick:()=>C(e.id),className:`btn btn-ghost btn-sm`,style:{color:`var(--error)`},children:`Remove`})})})]},e.id)),e.length===0&&!c&&(0,R.jsx)(`tr`,{children:(0,R.jsx)(`td`,{colSpan:6,className:`notif-empty`,children:`No notification rules configured`})})]})]})})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`notif-history-header`,children:[(0,R.jsx)(`h2`,{children:`Recent Notifications`}),(0,R.jsx)(`button`,{onClick:w,className:`btn btn-ghost btn-sm`,children:`Send Test`})]}),(0,R.jsx)(`div`,{className:`card`,style:{padding:`16px`},children:n.length===0?(0,R.jsx)(`p`,{className:`notif-empty`,children:`No recent notifications`}):(0,R.jsx)(`div`,{className:`notif-history-list`,children:n.map(e=>(0,R.jsxs)(`div`,{className:`notif-history-entry`,children:[(0,R.jsxs)(`div`,{className:`notif-entry-content`,children:[(0,R.jsx)(`span`,{className:`notif-entry-title`,children:e.title}),(0,R.jsx)(`span`,{className:`notif-entry-message`,children:e.message})]}),(0,R.jsxs)(`div`,{className:`notif-entry-meta`,children:[(0,R.jsx)(`span`,{className:`notif-entry-time`,children:new Date(e.timestamp).toLocaleString()}),(0,R.jsx)(`span`,{className:`notif-status-badge ${e.status}`,children:e.status.toUpperCase()})]})]},e.id))})})]}),u&&(0,R.jsx)(`div`,{className:`modal-overlay`,onClick:()=>d(!1),children:(0,R.jsxs)(`div`,{className:`modal-content`,onClick:e=>e.stopPropagation(),children:[(0,R.jsx)(`div`,{className:`modal-title`,children:`Add Notification Rule`}),(0,R.jsxs)(`form`,{onSubmit:S,className:`modal-form`,children:[(0,R.jsxs)(`div`,{className:`form-group`,children:[(0,R.jsx)(`label`,{className:`form-label`,children:`Event`}),(0,R.jsx)(`select`,{value:f,onChange:e=>p(e.target.value),className:`select`,children:JQ.map(e=>(0,R.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),(0,R.jsxs)(`div`,{className:`form-group`,children:[(0,R.jsx)(`label`,{className:`form-label`,children:`Channel`}),(0,R.jsx)(`select`,{value:m,onChange:e=>h(e.target.value),className:`select`,children:YQ.map(e=>(0,R.jsx)(`option`,{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),(0,R.jsxs)(`div`,{className:`form-group`,children:[(0,R.jsx)(`label`,{className:`form-label`,children:`Priority`}),(0,R.jsx)(`select`,{value:g,onChange:e=>v(e.target.value),className:`select`,children:XQ.map(e=>(0,R.jsx)(`option`,{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),(0,R.jsx)(`div`,{className:`form-group`,children:(0,R.jsxs)(`div`,{className:`notif-quiet-hours-row`,children:[(0,R.jsx)(`div`,{className:`notif-toggle ${y?`active`:``}`,onClick:()=>b(!y),role:`switch`,"aria-checked":y,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),b(!y))}}),(0,R.jsx)(`span`,{className:`notif-quiet-hours-label`,children:`Enable Quiet Hours`})]})}),(0,R.jsxs)(`div`,{className:`modal-actions`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>d(!1),className:`btn btn-ghost`,children:`Cancel`}),(0,R.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,children:`Add Rule`})]})]})]})})]})}var QQ={"/":"### Chat Interface\nWelcome to the interactive chat interface. Here you can talk directly to your active agent. Use `/skills` to invoke specialized tools.","/memory":`### Memory Vault
|
|
5623
|
+
GOOGLE_API_KEY=...`,rows:6,style:{width:`100%`,boxSizing:`border-box`,background:`var(--bg-primary)`,border:`1px solid var(--border)`,borderRadius:10,padding:12,color:`var(--text-primary)`,fontSize:12,fontFamily:`ui-monospace, SFMono-Regular, Menlo, monospace`,resize:`vertical`}}),(0,R.jsx)(`button`,{type:`button`,disabled:c,onClick:j,style:{...eQ,marginTop:8},children:`Preview keys in paste`})]}),C&&(0,R.jsx)(`p`,{style:{fontSize:13,color:`var(--text-tertiary)`},children:`Scanning env sources…`}),x&&(0,R.jsx)(`p`,{style:{fontSize:13,color:`#f87171`,marginBottom:12},children:x}),!C&&f.length===0&&!x&&(0,R.jsx)(`div`,{style:{padding:14,borderRadius:10,border:`1px solid var(--border)`,background:`rgba(148,163,184,0.06)`,fontSize:13,color:`var(--text-secondary)`,marginBottom:12},children:T===`scan`?`No known API keys found in process.env or common .env paths (~/.agent/.env, project .env, …). Paste a .env or continue and set keys later with secret set.`:`Paste your .env and click Preview.`}),f.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:10,flexWrap:`wrap`},children:[(0,R.jsx)(`button`,{type:`button`,onClick:te,style:nQ,children:`Select new`}),(0,R.jsx)(`button`,{type:`button`,onClick:A,style:nQ,children:`Clear`}),(0,R.jsxs)(`span`,{style:{fontSize:12,color:`var(--text-tertiary)`,alignSelf:`center`},children:[m.size,` selected · values never shown raw`]})]}),(0,R.jsx)(`div`,{style:{maxHeight:280,overflowY:`auto`,border:`1px solid var(--border)`,borderRadius:12,marginBottom:12},children:f.map(e=>(0,R.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`10px 12px`,borderBottom:`1px solid var(--border)`,cursor:e.already_set?`default`:`pointer`,opacity:e.already_set?.55:1,background:m.has(e.key)?`rgba(59,130,246,0.08)`:`transparent`},children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:m.has(e.key),disabled:!!e.already_set,onChange:()=>k(e.key),style:{accentColor:`#3b82f6`}}),(0,R.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,R.jsxs)(`div`,{style:{fontSize:12,fontWeight:600,fontFamily:`ui-monospace, monospace`},children:[e.key,e.provider&&(0,R.jsx)(`span`,{style:{marginLeft:8,fontSize:10,color:`#93c5fd`,fontWeight:500},children:e.provider}),e.already_set&&(0,R.jsx)(`span`,{style:{marginLeft:8,fontSize:10,color:`#34d399`},children:`already set`})]}),(0,R.jsxs)(`div`,{style:{fontSize:11,color:`var(--text-tertiary)`,marginTop:2},children:[e.masked,` · `,e.source_label]})]})]},e.key+e.source_label))}),(0,R.jsx)(`button`,{type:`button`,disabled:c||m.size===0,onClick:M,style:{...$Z,opacity:c||m.size===0?.5:1,cursor:c||m.size===0?`not-allowed`:`pointer`},children:c?`Importing…`:`Import ${m.size} secret(s)`})]}),(0,R.jsxs)(`p`,{style:{marginTop:14,fontSize:12,color:`var(--text-tertiary)`},children:[`CLI: `,(0,R.jsx)(`code`,{children:`npx total-recall secret import-env --all`}),` · `,(0,R.jsx)(En,{to:`/keys`,style:{color:`var(--accent)`},children:`Secrets page`})]})]}),D.id===`remember`&&(0,R.jsxs)(`div`,{style:{marginBottom:24},children:[(0,R.jsx)(`label`,{style:{fontSize:12,fontWeight:600,color:`var(--text-tertiary)`,display:`block`,marginBottom:8},children:`First memory (fact or preference)`}),(0,R.jsx)(`textarea`,{value:i,onChange:e=>a(e.target.value),placeholder:`e.g. "I prefer short answers and single quotes in JS."`,rows:4,style:{width:`100%`,boxSizing:`border-box`,background:`var(--bg-primary)`,border:`1px solid var(--border)`,borderRadius:10,padding:12,color:`var(--text-primary)`,fontSize:14,resize:`vertical`}}),(0,R.jsx)(`button`,{type:`button`,disabled:c,onClick:ne,style:{...$Z,marginTop:12},children:c?`Saving…`:`Save to vault & continue`})]}),D.id===`connect`&&(0,R.jsxs)(`div`,{style:{marginBottom:24,display:`flex`,flexDirection:`column`,gap:10},children:[(0,R.jsx)(`code`,{style:QZ,children:`npx total-recall connect claude-code`}),(0,R.jsx)(`code`,{style:QZ,children:`npx total-recall connect cursor`}),(0,R.jsx)(`code`,{style:QZ,children:`npx total-recall connect http-api --brain http://localhost:3000`}),(0,R.jsx)(En,{to:`/integrations`,style:{fontSize:13,color:`var(--accent)`},children:`Open Integrations page →`})]}),D.id===`dream`&&(0,R.jsxs)(`div`,{style:{marginBottom:24,display:`flex`,flexDirection:`column`,gap:10},children:[(0,R.jsx)(`code`,{style:QZ,children:`npx total-recall dream`}),(0,R.jsx)(`code`,{style:QZ,children:`npx total-recall daemon start # optional background worker`}),(0,R.jsx)(`code`,{style:QZ,children:`npx total-recall task add "Extract decisions from last session" --cap vault:write`}),(0,R.jsx)(En,{to:`/tasks`,style:{fontSize:13,color:`var(--accent)`},children:`Open Tasks page →`})]}),D.id===`done`&&(0,R.jsxs)(`div`,{style:{marginBottom:24,padding:16,borderRadius:12,background:`rgba(34,197,94,0.08)`,border:`1px solid rgba(34,197,94,0.25)`,fontSize:14,color:`var(--text-secondary)`},children:[u?`Vault already has onboarding profile data — you can jump to Memory anytime.`:`Optional: chat with the assistant to run the full preference interview (user-profile.md).`,(0,R.jsxs)(`div`,{style:{marginTop:12,display:`flex`,gap:12,flexWrap:`wrap`},children:[(0,R.jsx)(En,{to:`/`,style:tQ,children:`Open Chat`}),(0,R.jsx)(En,{to:`/memory`,style:tQ,children:`Open Vault`}),(0,R.jsx)(En,{to:`/integrations`,style:tQ,children:`Connect IDE`})]})]}),o&&(0,R.jsx)(`p`,{style:{fontSize:13,color:o.startsWith(`Saved`)||o.startsWith(`Imported`)||o.startsWith(`Found`)?`#22c55e`:`#f59e0b`,marginBottom:16},children:o}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:10,justifyContent:`space-between`},children:[(0,R.jsx)(`button`,{type:`button`,onClick:ee,disabled:n===0,style:eQ,children:`Back`}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[D.id!==`done`&&D.id!==`remember`&&(0,R.jsx)(`button`,{type:`button`,onClick:O,style:$Z,children:(D.id,`Continue`)}),D.id===`import-env`&&(0,R.jsx)(`button`,{type:`button`,onClick:O,style:eQ,children:`Skip for now`}),D.id===`remember`&&(0,R.jsx)(`button`,{type:`button`,onClick:O,style:eQ,children:`Skip for now`}),D.id===`done`&&(0,R.jsx)(`button`,{type:`button`,onClick:N,style:$Z,children:`Go to Memory`})]})]}),(0,R.jsxs)(`p`,{style:{marginTop:32,fontSize:12,color:`var(--text-tertiary)`},children:[`CLI-first: `,(0,R.jsx)(`code`,{children:`init → secret import-env --all → connect → remember → dream`})]}),n<qZ.length-1&&(0,R.jsx)(`button`,{type:`button`,onClick:N,style:{...eQ,marginTop:16,width:`100%`},children:`Skip onboarding → Memory`})]})}var QZ={display:`block`,background:`var(--bg-primary)`,border:`1px solid var(--border)`,borderRadius:8,padding:`10px 12px`,fontSize:12,color:`var(--text-secondary)`,fontFamily:`ui-monospace, SFMono-Regular, Menlo, monospace`,overflowX:`auto`},$Z={background:`linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%)`,color:`#fff`,border:`none`,borderRadius:12,padding:`11px 20px`,fontWeight:600,cursor:`pointer`,fontSize:14,boxShadow:`0 1px 0 rgba(255,255,255,0.15) inset, 0 8px 20px rgba(37, 99, 235, 0.28)`},eQ={background:`rgba(148, 163, 184, 0.06)`,color:`var(--text-secondary)`,border:`1px solid var(--border)`,borderRadius:12,padding:`11px 20px`,cursor:`pointer`,fontSize:14},tQ={...eQ,textDecoration:`none`,display:`inline-block`},nQ={...eQ,padding:`5px 10px`,fontSize:11},rQ={...$Z,padding:`8px 14px`,fontSize:12},iQ={...eQ,padding:`8px 14px`,fontSize:12};async function aQ(e,t){let n=await e.text(),r=null;if(n)try{r=JSON.parse(n)}catch{r=null}if(!e.ok){let n=r,i=n&&(n.error||n.message)||`${t} failed: ${e.status}`;throw Error(typeof i==`string`?i:`${t} failed: ${e.status}`)}return r}function oQ(e){if(Array.isArray(e))return e;if(e&&typeof e==`object`){let t=e;if(Array.isArray(t.rules))return t.rules;if(Array.isArray(t.history))return t.history;if(Array.isArray(t.entries))return t.entries}return[]}async function sQ(){return oQ(await aQ(await L(`${Rn()}/api/notifications/rules`),`GET /api/notifications/rules`))}async function cQ(e){return aQ(await L(`${Rn()}/api/notifications/rules`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),`POST /api/notifications/rules`)}async function lQ(e){await aQ(await L(`${Rn()}/api/notifications/rules/${encodeURIComponent(e)}`,{method:`DELETE`}),`DELETE /api/notifications/rules`)}async function uQ(){return oQ(await aQ(await L(`${Rn()}/api/notifications/history`),`GET /api/notifications/history`))}async function dQ(){await aQ(await L(`${Rn()}/api/notifications/test`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})}),`POST /api/notifications/test`)}var fQ=[{value:`node_offline`,label:`Node Offline`},{value:`leader_change`,label:`Leader Change`},{value:`webhook_failed`,label:`Webhook Failed`},{value:`secret_sync_failed`,label:`Secret Sync Failed`},{value:`daemon_error`,label:`Daemon Error`},{value:`research_complete`,label:`Research Complete`}],pQ=[`desktop`,`webhook`,`email`],mQ=[`critical`,`high`,`low`];function hQ(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(`node_offline`),[m,h]=(0,_.useState)(`desktop`),[g,v]=(0,_.useState)(`high`),[y,b]=(0,_.useState)(!1);async function x(){l(!0),a(null);try{let[e,n]=await Promise.all([sQ(),uQ()]);t(e),r(n)}catch(e){a(e instanceof Error?e.message:`Failed to load notifications data`)}finally{l(!1)}}(0,_.useEffect)(()=>{setTimeout(()=>{x()},0);let e=setInterval(x,15e3);return()=>clearInterval(e)},[]);async function S(e){e.preventDefault();try{await cQ({event:f,channel:m,priority:g,enabled:!0,quietHours:y}),d(!1),p(fQ[0].value),h(`desktop`),v(`high`),b(!1),await x()}catch(e){a(e instanceof Error?e.message:`Failed to create notification rule`)}}async function C(e){if(confirm(`Delete this notification rule?`))try{await lQ(e),await x()}catch(e){a(e instanceof Error?e.message:`Failed to delete notification rule`)}}async function w(){try{await dQ(),s(`Test notification sent`),setTimeout(()=>s(null),3e3)}catch(e){a(e instanceof Error?e.message:`Failed to send test notification`)}}function T(e){let t=fQ.find(t=>t.value===e);return t?t.label:e}return(0,R.jsxs)(`div`,{className:`page-container notifications-page`,"data-testid":`notifications-page`,children:[(0,R.jsxs)(`div`,{className:`page-header`,children:[(0,R.jsx)(`h1`,{children:`Notifications`}),(0,R.jsx)(`button`,{onClick:()=>d(!0),className:`btn btn-primary`,"data-testid":`add-rule-btn`,children:`Add Rule`})]}),i&&(0,R.jsxs)(`div`,{className:`alert alert-error`,role:`alert`,"data-testid":`notifications-error`,style:{marginBottom:`24px`},children:[i,(0,R.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,style:{marginLeft:12},onClick:()=>x(),children:`Retry`})]}),o&&(0,R.jsx)(`div`,{className:`alert alert-success`,style:{marginBottom:`24px`},children:o}),(0,R.jsxs)(`div`,{style:{marginBottom:`32px`},children:[(0,R.jsx)(`h2`,{style:{fontSize:`18px`,fontWeight:500,marginBottom:`16px`},children:`Notification Rules`}),(0,R.jsx)(`div`,{className:`card notif-rules-card`,children:(0,R.jsxs)(`table`,{className:`data-table`,children:[(0,R.jsx)(`thead`,{children:(0,R.jsxs)(`tr`,{children:[(0,R.jsx)(`th`,{children:`Event`}),(0,R.jsx)(`th`,{children:`Channel`}),(0,R.jsx)(`th`,{children:`Priority`}),(0,R.jsx)(`th`,{children:`Enabled`}),(0,R.jsx)(`th`,{children:`Quiet Hours`}),(0,R.jsx)(`th`,{children:`Actions`})]})}),(0,R.jsxs)(`tbody`,{children:[e.map(e=>(0,R.jsxs)(`tr`,{children:[(0,R.jsx)(`td`,{style:{fontWeight:500},children:T(e.event)}),(0,R.jsx)(`td`,{style:{textTransform:`capitalize`},children:e.channel}),(0,R.jsx)(`td`,{children:(0,R.jsx)(`span`,{className:`priority-badge ${e.priority}`,children:e.priority.toUpperCase()})}),(0,R.jsx)(`td`,{children:(0,R.jsx)(`span`,{className:`badge ${e.enabled?`badge-online`:`badge-offline`}`,children:e.enabled?`ON`:`OFF`})}),(0,R.jsx)(`td`,{children:(0,R.jsx)(`span`,{className:`badge ${e.quietHours?`badge-warning`:`badge-offline`}`,children:e.quietHours?`ACTIVE`:`OFF`})}),(0,R.jsx)(`td`,{children:(0,R.jsx)(`div`,{className:`notif-rules-actions`,children:(0,R.jsx)(`button`,{onClick:()=>C(e.id),className:`btn btn-ghost btn-sm`,style:{color:`var(--error)`},children:`Remove`})})})]},e.id)),e.length===0&&!c&&(0,R.jsx)(`tr`,{children:(0,R.jsx)(`td`,{colSpan:6,className:`notif-empty`,children:`No notification rules configured`})})]})]})})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`notif-history-header`,children:[(0,R.jsx)(`h2`,{children:`Recent Notifications`}),(0,R.jsx)(`button`,{onClick:w,className:`btn btn-ghost btn-sm`,children:`Send Test`})]}),(0,R.jsx)(`div`,{className:`card`,style:{padding:`16px`},children:n.length===0?(0,R.jsx)(`p`,{className:`notif-empty`,children:`No recent notifications`}):(0,R.jsx)(`div`,{className:`notif-history-list`,children:n.map(e=>(0,R.jsxs)(`div`,{className:`notif-history-entry`,children:[(0,R.jsxs)(`div`,{className:`notif-entry-content`,children:[(0,R.jsx)(`span`,{className:`notif-entry-title`,children:e.title}),(0,R.jsx)(`span`,{className:`notif-entry-message`,children:e.message})]}),(0,R.jsxs)(`div`,{className:`notif-entry-meta`,children:[(0,R.jsx)(`span`,{className:`notif-entry-time`,children:new Date(e.timestamp).toLocaleString()}),(0,R.jsx)(`span`,{className:`notif-status-badge ${e.status}`,children:e.status.toUpperCase()})]})]},e.id))})})]}),u&&(0,R.jsx)(`div`,{className:`modal-overlay`,onClick:()=>d(!1),children:(0,R.jsxs)(`div`,{className:`modal-content`,onClick:e=>e.stopPropagation(),children:[(0,R.jsx)(`div`,{className:`modal-title`,children:`Add Notification Rule`}),(0,R.jsxs)(`form`,{onSubmit:S,className:`modal-form`,children:[(0,R.jsxs)(`div`,{className:`form-group`,children:[(0,R.jsx)(`label`,{className:`form-label`,children:`Event`}),(0,R.jsx)(`select`,{value:f,onChange:e=>p(e.target.value),className:`select`,children:fQ.map(e=>(0,R.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),(0,R.jsxs)(`div`,{className:`form-group`,children:[(0,R.jsx)(`label`,{className:`form-label`,children:`Channel`}),(0,R.jsx)(`select`,{value:m,onChange:e=>h(e.target.value),className:`select`,children:pQ.map(e=>(0,R.jsx)(`option`,{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),(0,R.jsxs)(`div`,{className:`form-group`,children:[(0,R.jsx)(`label`,{className:`form-label`,children:`Priority`}),(0,R.jsx)(`select`,{value:g,onChange:e=>v(e.target.value),className:`select`,children:mQ.map(e=>(0,R.jsx)(`option`,{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),(0,R.jsx)(`div`,{className:`form-group`,children:(0,R.jsxs)(`div`,{className:`notif-quiet-hours-row`,children:[(0,R.jsx)(`div`,{className:`notif-toggle ${y?`active`:``}`,onClick:()=>b(!y),role:`switch`,"aria-checked":y,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),b(!y))}}),(0,R.jsx)(`span`,{className:`notif-quiet-hours-label`,children:`Enable Quiet Hours`})]})}),(0,R.jsxs)(`div`,{className:`modal-actions`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>d(!1),className:`btn btn-ghost`,children:`Cancel`}),(0,R.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,children:`Add Rule`})]})]})]})})]})}var gQ={"/":"### Chat Interface\nWelcome to the interactive chat interface. Here you can talk directly to your active agent. Use `/skills` to invoke specialized tools.","/memory":`### Memory Vault
|
|
5624
5624
|
This page displays your active SSSS (Structured Semantic Syntax System) memory nodes. These nodes dynamically rebuild the prompt instructions injected into your IDEs.`,"/graph":`### Concept Graph
|
|
5625
5625
|
Visualize the semantic relationships between all of your nodes and architectural decisions across the entire workspace.`,"/tasks":`### Background Tasks
|
|
5626
5626
|
Manage and review long-running background tasks (like the Dream Cycle or asynchronous Research operations).`,"/integrations":"### IDE Integrations\nConfigure your IDE mappings. Any changes here will write the appropriate markdown files (e.g., `.cursorrules`, `CLAUDE.md`) directly into your repository.","/skills":`### Agent Skills
|
|
@@ -5628,4 +5628,4 @@ Review your currently active skills. Skills provide the underlying tooling capab
|
|
|
5628
5628
|
Explore auto-generated architectural diagrams and knowledge base documents inferred directly from your project codebase.`,"/keys":"### Keys & Usage\nConfigure your API keys (Anthropic, Google, OpenAI, etc.) and view your realtime USD token expenditures based on the `budget.yml` constraints.","/settings":`### Global Settings
|
|
5629
5629
|
Configure the daemon behavior, Sandbox enforcement, network bindings, and overarching agent execution priorities.`,"/help":`### Help Center
|
|
5630
5630
|
Detailed documentation regarding the CLI architecture, SSSS definitions, and internal mechanisms.`,"/onboarding":`### Setup Guide
|
|
5631
|
-
The primary deployment scaffolding tool. Select your target environment and initialize the memory database.`};function $Q(){let[e,t]=(0,_.useState)(!1),n=lt(),[r,i]=(0,_.useState)(``);return(0,_.useEffect)(()=>{let e=n.pathname;setTimeout(()=>{i(QQ[e]||`### ${e}\nNo specific documentation is available for this route yet.`)},0)},[n.pathname]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{onClick:()=>t(!0),style:{position:`fixed`,bottom:`24px`,right:`24px`,width:`48px`,height:`48px`,borderRadius:`24px`,backgroundColor:`var(--accent-primary, #6366f1)`,color:`#fff`,border:`none`,boxShadow:`0 4px 12px rgba(0,0,0,0.3)`,cursor:`pointer`,zIndex:9998,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:`24px`,fontWeight:`bold`},title:`Page Help`,children:`?`}),e&&(0,R.jsx)(`div`,{style:{position:`fixed`,top:0,left:0,right:0,bottom:0,backgroundColor:`rgba(0,0,0,0.5)`,zIndex:9999,display:`flex`,alignItems:`center`,justifyContent:`center`},onClick:()=>t(!1),children:(0,R.jsxs)(`div`,{style:{width:`500px`,maxWidth:`90vw`,maxHeight:`80vh`,backgroundColor:`var(--bg-primary, #1e1e1e)`,color:`var(--text-primary, #e5e5e5)`,padding:`2rem`,borderRadius:`12px`,overflowY:`auto`,boxShadow:`0 10px 25px rgba(0,0,0,0.5)`,lineHeight:1.6},onClick:e=>e.stopPropagation(),children:[(0,R.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`},children:(0,R.jsx)(`button`,{onClick:()=>t(!1),style:{background:`transparent`,border:`none`,color:`var(--text-secondary, #a3a3a3)`,cursor:`pointer`,fontSize:`18px`},children:`✕`})}),(0,R.jsx)(`div`,{style:{whiteSpace:`pre-wrap`},children:r})]})})]})}function e$({ok:e,label:t}){return(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:5,color:`var(--text-tertiary)`},children:[(0,R.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:e?`#22c55e`:`#ef4444`,boxShadow:e?`0 0 6px rgba(34,197,94,0.5)`:`0 0 6px rgba(239,68,68,0.5)`,display:`inline-block`,animation:e?void 0:`blink 1s ease-in-out infinite`}}),t]})}function t$(e){if(!e)return{color:`#94a3b8`,label:`Gate n/a`,title:`Fetch gate stats not available`};let t=e.total_errors||0,n=e.total_blocked||0,r=e.current_queue_depth||0,i=e.current_in_flight||0,a=`dispatched ${e.total_dispatched??0} · errors ${t} · blocked ${n} · in-flight ${i} · queue ${r}`;return t>0&&(e.total_completed||0)===0&&(e.total_dispatched||0)>0?{color:`#ef4444`,label:`Gate errors`,title:a}:t>5||r>10||n>20?{color:`#ef4444`,label:`Gate hot`,title:a}:t>0||r>0||n>0||i>(e.max_global_concurrency||6)*.75?{color:`#f59e0b`,label:`Gate busy`,title:a}:{color:`#22c55e`,label:`Gate ok`,title:a}}var n$=({isActive:e})=>`nav-link ${e?`active`:``}`;function r$({onLogout:e,health:t,activeBrainId:n,onBrainChange:r}){return(0,R.jsxs)(`aside`,{className:`sidebar`,children:[(0,R.jsxs)(`div`,{className:`sidebar-brand`,style:{display:`flex`,alignItems:`center`,gap:12,padding:`16px 14px`},children:[(0,R.jsx)(Fi,{animated:!0,height:44,alt:`Total Recall`}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,R.jsx)(`span`,{style:{fontSize:15,fontWeight:700,letterSpacing:`-0.02em`,color:`#f8fafc`},children:`Total Recall`}),(0,R.jsx)(`span`,{style:{fontSize:10,fontWeight:600,padding:`2px 5px`,borderRadius:4,background:`rgba(59,130,246,0.15)`,color:`#60a5fa`,border:`1px solid rgba(59,130,246,0.3)`},children:t?.version?`v${t.version}`:`Version unknown`})]}),(0,R.jsx)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`,letterSpacing:`0.01em`},children:`Portable memory · any IDE`})]})]}),(0,R.jsxs)(`nav`,{className:`sidebar-nav`,children:[(0,R.jsx)(`div`,{className:`nav-section-label`,children:`Memory`}),!DQ()&&(0,R.jsxs)(Dn,{to:`/onboarding`,className:n$,id:`nav-onboarding`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M12 2L2 7l10 5 10-5-10-5z`}),(0,R.jsx)(`path`,{d:`M2 17l10 5 10-5`}),(0,R.jsx)(`path`,{d:`M2 12l10 5 10-5`})]}),`Setup`]}),(0,R.jsxs)(Dn,{to:`/`,end:!0,className:n$,id:`nav-chat`,children:[(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,R.jsx)(`path`,{d:`M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z`})}),`Chat`]}),(0,R.jsxs)(Dn,{to:`/memory`,className:n$,id:`nav-memory`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,R.jsx)(`path`,{d:`M12 16v-4M12 8h.01`})]}),`Vault`]}),(0,R.jsxs)(Dn,{to:`/rules`,className:n$,id:`nav-rules`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V8l-6-6z`}),(0,R.jsx)(`path`,{d:`M14 3v5h5M16 13H8M16 17H8M10 9H8`})]}),`Rules`]}),(0,R.jsxs)(Dn,{to:`/graph`,className:n$,id:`nav-graph`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`circle`,{cx:`5`,cy:`6`,r:`2`}),(0,R.jsx)(`circle`,{cx:`19`,cy:`6`,r:`2`}),(0,R.jsx)(`circle`,{cx:`12`,cy:`18`,r:`2`}),(0,R.jsx)(`path`,{d:`M7 7l4 9M17 7l-4 9`})]}),`Graph`]}),(0,R.jsxs)(Dn,{to:`/tasks`,className:n$,id:`nav-tasks`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M9 11l3 3L22 4`}),(0,R.jsx)(`path`,{d:`M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11`})]}),`Tasks`]}),(0,R.jsx)(`div`,{className:`nav-section-label`,children:`Connect`}),(0,R.jsxs)(Dn,{to:`/integrations`,className:n$,id:`nav-integrations`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71`}),(0,R.jsx)(`path`,{d:`M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71`})]}),`IDEs`]}),(0,R.jsxs)(Dn,{to:`/skills`,className:n$,id:`nav-skills`,children:[(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,R.jsx)(`path`,{d:`M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5`})}),`Skills`]}),(0,R.jsxs)(Dn,{to:`/plugins`,className:n$,id:`nav-plugins`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{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`}),(0,R.jsx)(`polyline`,{points:`3.27 6.96 12 12.01 20.73 6.96`}),(0,R.jsx)(`line`,{x1:`12`,y1:`22.08`,x2:`12`,y2:`12`})]}),`Plugins`]}),(0,R.jsx)(`div`,{className:`nav-section-label`,children:`Account`}),(0,R.jsxs)(Dn,{to:`/network`,className:n$,id:`nav-network`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`8`,rx:`2`,ry:`2`}),(0,R.jsx)(`rect`,{x:`2`,y:`14`,width:`20`,height:`8`,rx:`2`,ry:`2`}),(0,R.jsx)(`line`,{x1:`6`,y1:`6`,x2:`6.01`,y2:`6`}),(0,R.jsx)(`line`,{x1:`6`,y1:`18`,x2:`6.01`,y2:`18`})]}),`Network`]}),(0,R.jsxs)(Dn,{to:`/mesh`,className:n$,id:`nav-mesh`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M12 2L2 7l10 5 10-5-10-5z`}),(0,R.jsx)(`path`,{d:`M2 17l10 5 10-5`}),(0,R.jsx)(`path`,{d:`M2 12l10 5 10-5`})]}),`Mesh`]}),(0,R.jsxs)(Dn,{to:`/webhooks`,className:n$,id:`nav-webhooks`,children:[(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,R.jsx)(`path`,{d:`M22 12h-4l-3 9L9 3l-3 9H2`})}),`Webhooks`]}),(0,R.jsxs)(Dn,{to:`/secrets`,className:n$,id:`nav-secrets`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`}),(0,R.jsx)(`path`,{d:`M7 11V7a5 5 0 0110 0v4`})]}),`Secrets & Keys`]}),(0,R.jsxs)(Dn,{to:`/notifications`,className:n$,id:`nav-notifications`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9`}),(0,R.jsx)(`path`,{d:`M13.73 21a2 2 0 01-3.46 0`})]}),`Notifications`]}),(0,R.jsxs)(Dn,{to:`/settings`,className:n$,id:`nav-settings`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,R.jsx)(`path`,{d:`M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z`})]}),`Settings`]}),(0,R.jsxs)(Dn,{to:`/help`,className:n$,id:`nav-help`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,R.jsx)(`path`,{d:`M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3`}),(0,R.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})]}),`Help`]}),DQ()&&(0,R.jsxs)(Dn,{to:`/onboarding`,className:n$,id:`nav-onboarding-replay`,style:{opacity:.75},children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M12 2L2 7l10 5 10-5-10-5z`}),(0,R.jsx)(`path`,{d:`M2 17l10 5 10-5`}),(0,R.jsx)(`path`,{d:`M2 12l10 5 10-5`})]}),`Setup guide`]})]}),(0,R.jsxs)(`div`,{className:`sidebar-footer`,style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,R.jsx)(hZ,{activeBrainId:n,onBrainChange:r}),(0,R.jsxs)(`select`,{value:Rn(),onChange:e=>zn(e.target.value),title:`API host`,style:{width:`100%`,background:`rgba(148, 163, 184, 0.06)`,color:`var(--text-tertiary)`,border:`1px solid var(--border)`,borderRadius:8,padding:`5px 8px`,fontSize:10,outline:`none`},children:[(0,R.jsx)(`option`,{value:``,children:`Local API`}),void 0]}),(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,R.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4,fontSize:11},children:(()=>{let e=t?.daemon===`running`,n=t&&t.status!==`unreachable`,r=e&&n,i=t$(t?.fetch_gate);return t?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`style`,{children:`@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0.3;} }`}),r?(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:5,color:`var(--text-tertiary)`},children:[(0,R.jsx)(`span`,{className:`pulse`}),` All Systems Go`]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(e$,{ok:!!n,label:n?`Server online`:`Server offline`}),(0,R.jsx)(e$,{ok:e,label:e?`Daemon`:`Daemon `+(t?.daemon??`unknown`)})]}),(0,R.jsxs)(`div`,{"data-testid":`network-gate-indicator`,title:i.title,style:{display:`flex`,alignItems:`center`,gap:5,color:`var(--text-tertiary)`},children:[(0,R.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:i.color,boxShadow:`0 0 6px ${i.color}80`,display:`inline-block`}}),(0,R.jsx)(Dn,{to:`/network`,style:{color:`inherit`,textDecoration:`none`,fontSize:11},title:i.title,children:i.label})]})]}):(0,R.jsx)(`div`,{style:{color:`var(--text-tertiary)`},children:`Checking…`})})()}),(0,R.jsxs)(`button`,{id:`btn-logout`,onClick:e,title:`Sign out`,style:{background:`none`,border:`1px solid var(--border)`,borderRadius:6,cursor:`pointer`,color:`var(--text-tertiary)`,display:`flex`,alignItems:`center`,gap:5,padding:`4px 8px`,fontSize:11,transition:`color 0.15s, border-color 0.15s`},onMouseEnter:e=>{e.currentTarget.style.color=`#ef4444`,e.currentTarget.style.borderColor=`#ef4444`},onMouseLeave:e=>{e.currentTarget.style.color=`var(--text-tertiary)`,e.currentTarget.style.borderColor=`var(--border)`},children:[(0,R.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4`}),(0,R.jsx)(`polyline`,{points:`16 17 21 12 16 7`}),(0,R.jsx)(`line`,{x1:`21`,y1:`12`,x2:`9`,y2:`12`})]}),`Sign out`]})]})]})]})}function i$(){let e=lt();return!DQ()&&e.pathname!==`/onboarding`?(0,R.jsx)(Ft,{to:`/onboarding`,replace:!0}):null}function a$({activeBrainId:e,onBrainChange:t}){let n=lt(),r=n.pathname===`/`||n.pathname===`/chat`,[i,a]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{let e=()=>a(e=>!e);return window.addEventListener(`toggle-floating-chat`,e),()=>window.removeEventListener(`toggle-floating-chat`,e)},[]),(0,R.jsxs)(`main`,{className:`main-content`,style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`,position:`relative`},children:[(0,R.jsx)(i$,{}),(0,R.jsxs)(`div`,{style:i?{display:`flex`,position:`fixed`,bottom:20,right:20,width:400,height:600,zIndex:9999,backgroundColor:`var(--bg-primary)`,border:`1px solid var(--border)`,borderRadius:12,boxShadow:`0 8px 32px rgba(0, 0, 0, 0.4)`,overflow:`hidden`,flexDirection:`column`}:{display:r||i?`flex`:`none`,flex:1,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:[i&&(0,R.jsxs)(`div`,{style:{padding:`8px`,background:`var(--bg-secondary)`,borderBottom:`1px solid var(--border)`,display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,R.jsxs)(`span`,{style:{fontSize:12,fontWeight:600,display:`flex`,alignItems:`center`,gap:8},children:[(0,R.jsx)(`img`,{src:`/brand/total-recall-icon.svg`,alt:``,width:18,height:18,style:{borderRadius:4}}),`Total Recall`]}),(0,R.jsx)(`button`,{onClick:()=>a(!1),style:{background:`none`,border:`none`,cursor:`pointer`,color:`var(--text-tertiary)`},children:`✖`})]}),(0,R.jsx)(eX,{activeBrainId:e,onBrainChange:t})]}),(!r||i)&&(0,R.jsx)(`div`,{style:{flex:1,overflow:`auto`},children:(0,R.jsxs)(Rt,{children:[(0,R.jsx)(It,{path:`/`,element:(0,R.jsx)(Ft,{to:DQ()?`/memory`:`/onboarding`,replace:!0})}),(0,R.jsx)(It,{path:`/chat`,element:(0,R.jsx)(eX,{activeBrainId:e})}),(0,R.jsx)(It,{path:`/onboarding`,element:(0,R.jsx)(NQ,{})}),(0,R.jsx)(It,{path:`/memory`,element:(0,R.jsx)(rX,{activeBrainId:e})}),(0,R.jsx)(It,{path:`/rules`,element:(0,R.jsx)(bZ,{activeBrainId:e})}),(0,R.jsx)(It,{path:`/graph`,element:(0,R.jsx)(CZ,{activeBrainId:e})}),(0,R.jsx)(It,{path:`/tasks`,element:(0,R.jsx)(nZ,{})}),(0,R.jsx)(It,{path:`/skills`,element:(0,R.jsx)(yZ,{activeBrainId:e})}),(0,R.jsx)(It,{path:`/openwiki`,element:(0,R.jsx)(Ft,{to:`/plugins?id=openwiki`,replace:!0})}),(0,R.jsx)(It,{path:`/plugins`,element:(0,R.jsx)(EQ,{activeBrainId:e})}),(0,R.jsx)(It,{path:`/integrations`,element:(0,R.jsx)(iZ,{activeBrainId:e})}),(0,R.jsx)(It,{path:`/keys`,element:(0,R.jsx)(Ft,{to:`/secrets`,replace:!0})}),(0,R.jsx)(It,{path:`/settings`,element:(0,R.jsx)(VX,{activeBrainId:e})}),(0,R.jsx)(It,{path:`/network`,element:(0,R.jsx)(YX,{})}),(0,R.jsx)(It,{path:`/mesh`,element:(0,R.jsx)(Ft,{to:`/plugins?id=mesh`,replace:!0})}),(0,R.jsx)(It,{path:`/webhooks`,element:(0,R.jsx)(fZ,{})}),(0,R.jsx)(It,{path:`/secrets`,element:(0,R.jsx)(Ft,{to:`/plugins?id=auth`,replace:!0})}),(0,R.jsx)(It,{path:`/notifications`,element:(0,R.jsx)(ZQ,{})}),(0,R.jsx)(It,{path:`/help`,element:(0,R.jsx)(SZ,{})}),(0,R.jsx)(It,{path:`/vault`,element:(0,R.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,R.jsx)(It,{path:`/inbox`,element:(0,R.jsx)(Ft,{to:`/tasks`,replace:!0})}),(0,R.jsx)(It,{path:`/automations`,element:(0,R.jsx)(Ft,{to:`/plugins?id=user-automations`,replace:!0})}),(0,R.jsx)(It,{path:`/files`,element:(0,R.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,R.jsx)(It,{path:`/sandbox`,element:(0,R.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,R.jsx)(It,{path:`/models`,element:(0,R.jsx)(Ft,{to:`/settings`,replace:!0})}),(0,R.jsx)(It,{path:`/health`,element:(0,R.jsx)(Ft,{to:`/settings`,replace:!0})}),(0,R.jsx)(It,{path:`/usage`,element:(0,R.jsx)(Ft,{to:`/settings`,replace:!0})}),(0,R.jsx)(It,{path:`/collab`,element:(0,R.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,R.jsx)(It,{path:`/instructions`,element:(0,R.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,R.jsx)(It,{path:`/design`,element:(0,R.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,R.jsx)(It,{path:`/okf`,element:(0,R.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,R.jsx)(It,{path:`*`,element:(0,R.jsx)(Ft,{to:`/memory`,replace:!0})})]})})]})}var o$=`total-recall-active-brain`;function s$(){let[e,t]=(0,_.useState)(`loading`),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(()=>localStorage.getItem(o$)||`global`);(0,_.useEffect)(()=>{localStorage.setItem(o$,i)},[i]),(0,_.useEffect)(()=>(Vn(()=>t(`unauthed`)),()=>{}),[]),(0,_.useEffect)(()=>{Gn().then(e=>t(e?`authed`:`unauthed`))},[]),(0,_.useEffect)(()=>{let e=!0,t=async()=>{try{let t=await Ir();e&&r(t)}catch{e&&r({status:`unreachable`,version:``,uptime_seconds:0,timestamp:``})}};t();let n=setInterval(t,1e4);return()=>{e=!1,clearInterval(n)}},[]);async function o(){await Xn(),t(`unauthed`)}function s(){t(`authed`)}return e===`loading`?(0,R.jsxs)(`div`,{style:{minHeight:`100vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`var(--bg-primary)`},children:[(0,R.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--text-tertiary)`,strokeWidth:`2.5`,strokeLinecap:`round`,style:{animation:`spin 0.8s linear infinite`},children:(0,R.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),(0,R.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})]}):e===`unauthed`?(0,R.jsx)(Ii,{onAuthenticated:s}):(0,R.jsxs)(Tn,{children:[(0,R.jsxs)(`div`,{className:`app-layout`,children:[(0,R.jsx)(r$,{onLogout:o,health:n,activeBrainId:i,onBrainChange:a}),(0,R.jsx)(a$,{activeBrainId:i,onBrainChange:a})]}),(0,R.jsx)($Q,{})]})}`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).then(e=>{console.log(`ServiceWorker registration successful with scope: `,e.scope)},e=>{console.log(`ServiceWorker registration failed: `,e)})}),(0,v.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(_.StrictMode,{children:(0,R.jsx)(s$,{})}));
|
|
5631
|
+
The primary deployment scaffolding tool. Select your target environment and initialize the memory database.`};function _Q(){let[e,t]=(0,_.useState)(!1),n=lt(),[r,i]=(0,_.useState)(``);return(0,_.useEffect)(()=>{let e=n.pathname;setTimeout(()=>{i(gQ[e]||`### ${e}\nNo specific documentation is available for this route yet.`)},0)},[n.pathname]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{onClick:()=>t(!0),style:{position:`fixed`,bottom:`24px`,right:`24px`,width:`48px`,height:`48px`,borderRadius:`24px`,backgroundColor:`var(--accent-primary, #6366f1)`,color:`#fff`,border:`none`,boxShadow:`0 4px 12px rgba(0,0,0,0.3)`,cursor:`pointer`,zIndex:9998,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:`24px`,fontWeight:`bold`},title:`Page Help`,children:`?`}),e&&(0,R.jsx)(`div`,{style:{position:`fixed`,top:0,left:0,right:0,bottom:0,backgroundColor:`rgba(0,0,0,0.5)`,zIndex:9999,display:`flex`,alignItems:`center`,justifyContent:`center`},onClick:()=>t(!1),children:(0,R.jsxs)(`div`,{style:{width:`500px`,maxWidth:`90vw`,maxHeight:`80vh`,backgroundColor:`var(--bg-primary, #1e1e1e)`,color:`var(--text-primary, #e5e5e5)`,padding:`2rem`,borderRadius:`12px`,overflowY:`auto`,boxShadow:`0 10px 25px rgba(0,0,0,0.5)`,lineHeight:1.6},onClick:e=>e.stopPropagation(),children:[(0,R.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`},children:(0,R.jsx)(`button`,{onClick:()=>t(!1),style:{background:`transparent`,border:`none`,color:`var(--text-secondary, #a3a3a3)`,cursor:`pointer`,fontSize:`18px`},children:`✕`})}),(0,R.jsx)(`div`,{style:{whiteSpace:`pre-wrap`},children:r})]})})]})}function vQ({ok:e,label:t}){return(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:5,color:`var(--text-tertiary)`},children:[(0,R.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:e?`#22c55e`:`#ef4444`,boxShadow:e?`0 0 6px rgba(34,197,94,0.5)`:`0 0 6px rgba(239,68,68,0.5)`,display:`inline-block`,animation:e?void 0:`blink 1s ease-in-out infinite`}}),t]})}function yQ(e){if(!e)return{color:`#94a3b8`,label:`Gate n/a`,title:`Fetch gate stats not available`};let t=e.total_errors||0,n=e.total_blocked||0,r=e.current_queue_depth||0,i=e.current_in_flight||0,a=`dispatched ${e.total_dispatched??0} · errors ${t} · blocked ${n} · in-flight ${i} · queue ${r}`;return t>0&&(e.total_completed||0)===0&&(e.total_dispatched||0)>0?{color:`#ef4444`,label:`Gate errors`,title:a}:t>5||r>10||n>20?{color:`#ef4444`,label:`Gate hot`,title:a}:t>0||r>0||n>0||i>(e.max_global_concurrency||6)*.75?{color:`#f59e0b`,label:`Gate busy`,title:a}:{color:`#22c55e`,label:`Gate ok`,title:a}}var bQ=({isActive:e})=>`nav-link ${e?`active`:``}`;function xQ({onLogout:e,health:t,activeBrainId:n,onBrainChange:r}){return(0,R.jsxs)(`aside`,{className:`sidebar`,children:[(0,R.jsxs)(`div`,{className:`sidebar-brand`,style:{display:`flex`,alignItems:`center`,gap:12,padding:`16px 14px`},children:[(0,R.jsx)(Fi,{animated:!0,height:44,alt:`Total Recall`}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,R.jsx)(`span`,{style:{fontSize:15,fontWeight:700,letterSpacing:`-0.02em`,color:`#f8fafc`},children:`Total Recall`}),(0,R.jsx)(`span`,{style:{fontSize:10,fontWeight:600,padding:`2px 5px`,borderRadius:4,background:`rgba(59,130,246,0.15)`,color:`#60a5fa`,border:`1px solid rgba(59,130,246,0.3)`},children:t?.version?`v${t.version}`:`Version unknown`})]}),(0,R.jsx)(`span`,{style:{fontSize:11,color:`var(--text-tertiary)`,letterSpacing:`0.01em`},children:`Portable memory · any IDE`})]})]}),(0,R.jsxs)(`nav`,{className:`sidebar-nav`,children:[(0,R.jsx)(`div`,{className:`nav-section-label`,children:`Memory`}),!GZ()&&(0,R.jsxs)(Dn,{to:`/onboarding`,className:bQ,id:`nav-onboarding`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M12 2L2 7l10 5 10-5-10-5z`}),(0,R.jsx)(`path`,{d:`M2 17l10 5 10-5`}),(0,R.jsx)(`path`,{d:`M2 12l10 5 10-5`})]}),`Setup`]}),(0,R.jsxs)(Dn,{to:`/`,end:!0,className:bQ,id:`nav-chat`,children:[(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,R.jsx)(`path`,{d:`M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z`})}),`Chat`]}),(0,R.jsxs)(Dn,{to:`/memory`,className:bQ,id:`nav-memory`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,R.jsx)(`path`,{d:`M12 16v-4M12 8h.01`})]}),`Vault`]}),(0,R.jsxs)(Dn,{to:`/rules`,className:bQ,id:`nav-rules`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V8l-6-6z`}),(0,R.jsx)(`path`,{d:`M14 3v5h5M16 13H8M16 17H8M10 9H8`})]}),`Rules`]}),(0,R.jsxs)(Dn,{to:`/graph`,className:bQ,id:`nav-graph`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`circle`,{cx:`5`,cy:`6`,r:`2`}),(0,R.jsx)(`circle`,{cx:`19`,cy:`6`,r:`2`}),(0,R.jsx)(`circle`,{cx:`12`,cy:`18`,r:`2`}),(0,R.jsx)(`path`,{d:`M7 7l4 9M17 7l-4 9`})]}),`Graph`]}),(0,R.jsxs)(Dn,{to:`/tasks`,className:bQ,id:`nav-tasks`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M9 11l3 3L22 4`}),(0,R.jsx)(`path`,{d:`M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11`})]}),`Tasks`]}),(0,R.jsx)(`div`,{className:`nav-section-label`,children:`Connect`}),(0,R.jsxs)(Dn,{to:`/integrations`,className:bQ,id:`nav-integrations`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71`}),(0,R.jsx)(`path`,{d:`M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71`})]}),`IDEs`]}),(0,R.jsxs)(Dn,{to:`/skills`,className:bQ,id:`nav-skills`,children:[(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,R.jsx)(`path`,{d:`M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5`})}),`Skills`]}),(0,R.jsxs)(Dn,{to:`/plugins`,className:bQ,id:`nav-plugins`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{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`}),(0,R.jsx)(`polyline`,{points:`3.27 6.96 12 12.01 20.73 6.96`}),(0,R.jsx)(`line`,{x1:`12`,y1:`22.08`,x2:`12`,y2:`12`})]}),`Plugins`]}),(0,R.jsx)(`div`,{className:`nav-section-label`,children:`Account`}),(0,R.jsxs)(Dn,{to:`/network`,className:bQ,id:`nav-network`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`8`,rx:`2`,ry:`2`}),(0,R.jsx)(`rect`,{x:`2`,y:`14`,width:`20`,height:`8`,rx:`2`,ry:`2`}),(0,R.jsx)(`line`,{x1:`6`,y1:`6`,x2:`6.01`,y2:`6`}),(0,R.jsx)(`line`,{x1:`6`,y1:`18`,x2:`6.01`,y2:`18`})]}),`Network`]}),(0,R.jsxs)(Dn,{to:`/mesh`,className:bQ,id:`nav-mesh`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M12 2L2 7l10 5 10-5-10-5z`}),(0,R.jsx)(`path`,{d:`M2 17l10 5 10-5`}),(0,R.jsx)(`path`,{d:`M2 12l10 5 10-5`})]}),`Mesh`]}),(0,R.jsxs)(Dn,{to:`/webhooks`,className:bQ,id:`nav-webhooks`,children:[(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,R.jsx)(`path`,{d:`M22 12h-4l-3 9L9 3l-3 9H2`})}),`Webhooks`]}),(0,R.jsxs)(Dn,{to:`/secrets`,className:bQ,id:`nav-secrets`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`}),(0,R.jsx)(`path`,{d:`M7 11V7a5 5 0 0110 0v4`})]}),`Secrets & Keys`]}),(0,R.jsxs)(Dn,{to:`/notifications`,className:bQ,id:`nav-notifications`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9`}),(0,R.jsx)(`path`,{d:`M13.73 21a2 2 0 01-3.46 0`})]}),`Notifications`]}),(0,R.jsxs)(Dn,{to:`/settings`,className:bQ,id:`nav-settings`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,R.jsx)(`path`,{d:`M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z`})]}),`Settings`]}),(0,R.jsxs)(Dn,{to:`/help`,className:bQ,id:`nav-help`,children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,R.jsx)(`path`,{d:`M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3`}),(0,R.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})]}),`Help`]}),GZ()&&(0,R.jsxs)(Dn,{to:`/onboarding`,className:bQ,id:`nav-onboarding-replay`,style:{opacity:.75},children:[(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M12 2L2 7l10 5 10-5-10-5z`}),(0,R.jsx)(`path`,{d:`M2 17l10 5 10-5`}),(0,R.jsx)(`path`,{d:`M2 12l10 5 10-5`})]}),`Setup guide`]})]}),(0,R.jsxs)(`div`,{className:`sidebar-footer`,style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,R.jsx)(hZ,{activeBrainId:n,onBrainChange:r}),(0,R.jsxs)(`select`,{value:Rn(),onChange:e=>zn(e.target.value),title:`API host`,style:{width:`100%`,background:`rgba(148, 163, 184, 0.06)`,color:`var(--text-tertiary)`,border:`1px solid var(--border)`,borderRadius:8,padding:`5px 8px`,fontSize:10,outline:`none`},children:[(0,R.jsx)(`option`,{value:``,children:`Local API`}),void 0]}),(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,R.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4,fontSize:11},children:(()=>{let e=t?.daemon===`running`,n=t&&t.status!==`unreachable`,r=e&&n,i=yQ(t?.fetch_gate);return t?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`style`,{children:`@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0.3;} }`}),r?(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:5,color:`var(--text-tertiary)`},children:[(0,R.jsx)(`span`,{className:`pulse`}),` All Systems Go`]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(vQ,{ok:!!n,label:n?`Server online`:`Server offline`}),(0,R.jsx)(vQ,{ok:e,label:e?`Daemon`:`Daemon `+(t?.daemon??`unknown`)})]}),(0,R.jsxs)(`div`,{"data-testid":`network-gate-indicator`,title:i.title,style:{display:`flex`,alignItems:`center`,gap:5,color:`var(--text-tertiary)`},children:[(0,R.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:i.color,boxShadow:`0 0 6px ${i.color}80`,display:`inline-block`}}),(0,R.jsx)(Dn,{to:`/network`,style:{color:`inherit`,textDecoration:`none`,fontSize:11},title:i.title,children:i.label})]})]}):(0,R.jsx)(`div`,{style:{color:`var(--text-tertiary)`},children:`Checking…`})})()}),(0,R.jsxs)(`button`,{id:`btn-logout`,onClick:e,title:`Sign out`,style:{background:`none`,border:`1px solid var(--border)`,borderRadius:6,cursor:`pointer`,color:`var(--text-tertiary)`,display:`flex`,alignItems:`center`,gap:5,padding:`4px 8px`,fontSize:11,transition:`color 0.15s, border-color 0.15s`},onMouseEnter:e=>{e.currentTarget.style.color=`#ef4444`,e.currentTarget.style.borderColor=`#ef4444`},onMouseLeave:e=>{e.currentTarget.style.color=`var(--text-tertiary)`,e.currentTarget.style.borderColor=`var(--border)`},children:[(0,R.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4`}),(0,R.jsx)(`polyline`,{points:`16 17 21 12 16 7`}),(0,R.jsx)(`line`,{x1:`21`,y1:`12`,x2:`9`,y2:`12`})]}),`Sign out`]})]})]})]})}function SQ(){let e=lt();return!GZ()&&e.pathname!==`/onboarding`?(0,R.jsx)(Ft,{to:`/onboarding`,replace:!0}):null}function CQ({activeBrainId:e,onBrainChange:t}){let n=lt(),r=n.pathname===`/`||n.pathname===`/chat`,[i,a]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{let e=()=>a(e=>!e);return window.addEventListener(`toggle-floating-chat`,e),()=>window.removeEventListener(`toggle-floating-chat`,e)},[]),(0,R.jsxs)(`main`,{className:`main-content`,style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`,position:`relative`},children:[(0,R.jsx)(SQ,{}),(0,R.jsxs)(`div`,{style:i?{display:`flex`,position:`fixed`,bottom:20,right:20,width:400,height:600,zIndex:9999,backgroundColor:`var(--bg-primary)`,border:`1px solid var(--border)`,borderRadius:12,boxShadow:`0 8px 32px rgba(0, 0, 0, 0.4)`,overflow:`hidden`,flexDirection:`column`}:{display:r||i?`flex`:`none`,flex:1,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:[i&&(0,R.jsxs)(`div`,{style:{padding:`8px`,background:`var(--bg-secondary)`,borderBottom:`1px solid var(--border)`,display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,R.jsxs)(`span`,{style:{fontSize:12,fontWeight:600,display:`flex`,alignItems:`center`,gap:8},children:[(0,R.jsx)(`img`,{src:`/brand/total-recall-icon.svg`,alt:``,width:18,height:18,style:{borderRadius:4}}),`Total Recall`]}),(0,R.jsx)(`button`,{onClick:()=>a(!1),style:{background:`none`,border:`none`,cursor:`pointer`,color:`var(--text-tertiary)`},children:`✖`})]}),(0,R.jsx)(eX,{activeBrainId:e,onBrainChange:t})]}),(!r||i)&&(0,R.jsx)(`div`,{style:{flex:1,overflow:`auto`},children:(0,R.jsxs)(Rt,{children:[(0,R.jsx)(It,{path:`/`,element:(0,R.jsx)(Ft,{to:GZ()?`/memory`:`/onboarding`,replace:!0})}),(0,R.jsx)(It,{path:`/chat`,element:(0,R.jsx)(eX,{activeBrainId:e})}),(0,R.jsx)(It,{path:`/onboarding`,element:(0,R.jsx)(ZZ,{})}),(0,R.jsx)(It,{path:`/memory`,element:(0,R.jsx)(rX,{activeBrainId:e})}),(0,R.jsx)(It,{path:`/rules`,element:(0,R.jsx)(bZ,{activeBrainId:e})}),(0,R.jsx)(It,{path:`/graph`,element:(0,R.jsx)(CZ,{activeBrainId:e})}),(0,R.jsx)(It,{path:`/tasks`,element:(0,R.jsx)(nZ,{})}),(0,R.jsx)(It,{path:`/skills`,element:(0,R.jsx)(yZ,{activeBrainId:e})}),(0,R.jsx)(It,{path:`/openwiki`,element:(0,R.jsx)(Ft,{to:`/plugins?id=openwiki`,replace:!0})}),(0,R.jsx)(It,{path:`/plugins`,element:(0,R.jsx)(WZ,{activeBrainId:e})}),(0,R.jsx)(It,{path:`/integrations`,element:(0,R.jsx)(iZ,{activeBrainId:e})}),(0,R.jsx)(It,{path:`/keys`,element:(0,R.jsx)(Ft,{to:`/secrets`,replace:!0})}),(0,R.jsx)(It,{path:`/settings`,element:(0,R.jsx)(VX,{activeBrainId:e})}),(0,R.jsx)(It,{path:`/network`,element:(0,R.jsx)(YX,{})}),(0,R.jsx)(It,{path:`/mesh`,element:(0,R.jsx)(Ft,{to:`/plugins?id=mesh`,replace:!0})}),(0,R.jsx)(It,{path:`/webhooks`,element:(0,R.jsx)(fZ,{})}),(0,R.jsx)(It,{path:`/secrets`,element:(0,R.jsx)(Ft,{to:`/plugins?id=auth`,replace:!0})}),(0,R.jsx)(It,{path:`/notifications`,element:(0,R.jsx)(hQ,{})}),(0,R.jsx)(It,{path:`/help`,element:(0,R.jsx)(SZ,{})}),(0,R.jsx)(It,{path:`/vault`,element:(0,R.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,R.jsx)(It,{path:`/inbox`,element:(0,R.jsx)(Ft,{to:`/tasks`,replace:!0})}),(0,R.jsx)(It,{path:`/automations`,element:(0,R.jsx)(Ft,{to:`/plugins?id=user-automations`,replace:!0})}),(0,R.jsx)(It,{path:`/files`,element:(0,R.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,R.jsx)(It,{path:`/sandbox`,element:(0,R.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,R.jsx)(It,{path:`/models`,element:(0,R.jsx)(Ft,{to:`/settings`,replace:!0})}),(0,R.jsx)(It,{path:`/health`,element:(0,R.jsx)(Ft,{to:`/settings`,replace:!0})}),(0,R.jsx)(It,{path:`/usage`,element:(0,R.jsx)(Ft,{to:`/settings`,replace:!0})}),(0,R.jsx)(It,{path:`/collab`,element:(0,R.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,R.jsx)(It,{path:`/instructions`,element:(0,R.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,R.jsx)(It,{path:`/design`,element:(0,R.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,R.jsx)(It,{path:`/okf`,element:(0,R.jsx)(Ft,{to:`/memory`,replace:!0})}),(0,R.jsx)(It,{path:`*`,element:(0,R.jsx)(Ft,{to:`/memory`,replace:!0})})]})})]})}var wQ=`total-recall-active-brain`;function TQ(){let[e,t]=(0,_.useState)(`loading`),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(()=>localStorage.getItem(wQ)||`global`);(0,_.useEffect)(()=>{localStorage.setItem(wQ,i)},[i]),(0,_.useEffect)(()=>(Vn(()=>t(`unauthed`)),()=>{}),[]),(0,_.useEffect)(()=>{Gn().then(e=>t(e?`authed`:`unauthed`))},[]),(0,_.useEffect)(()=>{let e=!0,t=async()=>{try{let t=await Ir();e&&r(t)}catch{e&&r({status:`unreachable`,version:``,uptime_seconds:0,timestamp:``})}};t();let n=setInterval(t,1e4);return()=>{e=!1,clearInterval(n)}},[]);async function o(){await Xn(),t(`unauthed`)}function s(){t(`authed`)}return e===`loading`?(0,R.jsxs)(`div`,{style:{minHeight:`100vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`var(--bg-primary)`},children:[(0,R.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--text-tertiary)`,strokeWidth:`2.5`,strokeLinecap:`round`,style:{animation:`spin 0.8s linear infinite`},children:(0,R.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),(0,R.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})]}):e===`unauthed`?(0,R.jsx)(Ii,{onAuthenticated:s}):(0,R.jsxs)(Tn,{children:[(0,R.jsxs)(`div`,{className:`app-layout`,children:[(0,R.jsx)(xQ,{onLogout:o,health:n,activeBrainId:i,onBrainChange:a}),(0,R.jsx)(CQ,{activeBrainId:i,onBrainChange:a})]}),(0,R.jsx)(_Q,{})]})}`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).then(e=>{console.log(`ServiceWorker registration successful with scope: `,e.scope)},e=>{console.log(`ServiceWorker registration failed: `,e)})}),(0,v.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(_.StrictMode,{children:(0,R.jsx)(TQ,{})}));
|