@pixelzx/genesis 2026.6.19 → 2026.6.20

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/.buildstamp +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-startup-metadata.json +1 -1
  5. package/dist/{command-registry-CLq4cavK.js → command-registry-ClBXx6rA.js} +2 -2
  6. package/dist/{command-registry-CKWxX9CM.js → command-registry-bijZPq36.js} +2 -2
  7. package/dist/{command-registry-core-Qb3SuoAU.js → command-registry-core-Bf_MZZiA.js} +2 -2
  8. package/dist/{completion-cli-Dl4z-FNu.js → completion-cli-DV02VPia.js} +2 -2
  9. package/dist/{config-cli-Bkxdbh9H.js → config-cli-DAOeCcCk.js} +1 -1
  10. package/dist/control-ui/assets/Geist-Variable-Bj2R_7yk.woff2 +0 -0
  11. package/dist/control-ui/assets/GeistMono-Variable-Dispecij.woff2 +0 -0
  12. package/dist/control-ui/assets/{agents-BQsvYsmp.js → agents-CdobtTOW.js} +3 -3
  13. package/dist/control-ui/assets/{canvas-D92UKk4C.js → canvas-Cy2AiGPQ.js} +2 -2
  14. package/dist/control-ui/assets/{channel-config-extras-CjJYUNaz.js → channel-config-extras-BmGwfDPL.js} +2 -2
  15. package/dist/control-ui/assets/{channels-B23D1XmP.js → channels-DdgVKbNz.js} +2 -2
  16. package/dist/control-ui/assets/{cron-CYzrBBv6.js → cron-CCNOjNyY.js} +2 -2
  17. package/dist/control-ui/assets/de-ChvNzaWx.js +2 -0
  18. package/dist/control-ui/assets/{debug-C8av-vpc.js → debug-B8lJz0xl.js} +2 -2
  19. package/dist/control-ui/assets/es-CrSDgcQ5.js +2 -0
  20. package/dist/control-ui/assets/{format-DK0XBCTY.js → format-BOO4MheD.js} +2 -2
  21. package/dist/control-ui/assets/fr-BRwXxDjE.js +2 -0
  22. package/dist/control-ui/assets/i18n-Dr_ijwId.js +3 -0
  23. package/dist/control-ui/assets/id-D6SwOJ8N.js +2 -0
  24. package/dist/control-ui/assets/{index-ChL66WCS.js → index-DTwo_TE_.js} +402 -393
  25. package/dist/control-ui/assets/index-u5Z0R_Xd.css +1 -0
  26. package/dist/control-ui/assets/{instances-qfDdYtE0.js → instances-DRlIDzRt.js} +2 -2
  27. package/dist/control-ui/assets/ja-JP-COtC4IfH.js +2 -0
  28. package/dist/control-ui/assets/ko-BzeSxEM4.js +2 -0
  29. package/dist/control-ui/assets/{logs-COvy4E7t.js → logs-BYrqUHTd.js} +2 -2
  30. package/dist/control-ui/assets/{mcp-CipBqkHK.js → mcp-C7ry874X.js} +2 -2
  31. package/dist/control-ui/assets/memory-Dk8DVFlc.js +37 -0
  32. package/dist/control-ui/assets/models-WJk_luH_.js +76 -0
  33. package/dist/control-ui/assets/{nodes-WP7e87Mm.js → nodes-SWmxABM8.js} +2 -2
  34. package/dist/control-ui/assets/pl-BFGaZC1a.js +2 -0
  35. package/dist/control-ui/assets/{plugins-BZGJKpWs.js → plugins-bulpMEFW.js} +2 -2
  36. package/dist/control-ui/assets/{preview-Bp96VQFU.js → preview-yS9kUAt_.js} +1 -1
  37. package/dist/control-ui/assets/pt-BR-B2QYSEq3.js +2 -0
  38. package/dist/control-ui/assets/{sessions-7NbJpVyg.js → sessions-bCilYtM1.js} +2 -2
  39. package/dist/control-ui/assets/{skills-hW_GTRp3.js → skills-C1LNGjhW.js} +2 -2
  40. package/dist/control-ui/assets/{skills-shared-B3ywFtkR.js → skills-shared-BHZ4ntcf.js} +2 -2
  41. package/dist/control-ui/assets/th-CB7L1SFv.js +2 -0
  42. package/dist/control-ui/assets/tr-jlhb5DaE.js +2 -0
  43. package/dist/control-ui/assets/uk-BrLj30-c.js +2 -0
  44. package/dist/control-ui/assets/{wallet-Bga18qp4.js → wallet-BwqvP_oc.js} +2 -2
  45. package/dist/control-ui/assets/zh-CN-BvMSlZSV.js +2 -0
  46. package/dist/control-ui/assets/zh-TW-DvNvr4gT.js +2 -0
  47. package/dist/control-ui/index.html +4 -4
  48. package/dist/entry.js +1 -1
  49. package/dist/{gateway-cli-CQ_df0H7.js → gateway-cli-BFiZ-zEO.js} +1 -1
  50. package/dist/index.js +1 -1
  51. package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
  52. package/dist/postinstall-inventory.json +53 -49
  53. package/dist/{program-iQ-gyjzf.js → program-BpFNiyL3.js} +1 -1
  54. package/dist/{register.subclis-Bj2qMOIk.js → register.subclis-CHijsAFO.js} +1 -1
  55. package/dist/{register.subclis-DPoEvXPT.js → register.subclis-CpLtsILI.js} +2 -2
  56. package/dist/{register.subclis-core-D5JZnDOv.js → register.subclis-core-DeVwcUrh.js} +1 -1
  57. package/dist/{run-main-jhAyrtsM.js → run-main-DYiUnyJr.js} +4 -4
  58. package/dist/{runtime-schema-BxS8Xkme.js → runtime-schema-DREgFqvJ.js} +1 -1
  59. package/dist/{server-CKr4I406.js → server-WzFFYZ9M.js} +1 -1
  60. package/dist/{server-plugin-bootstrap-CuFEDQoD.js → server-plugin-bootstrap-BKn4Ukfx.js} +1 -1
  61. package/dist/{server-plugin-bootstrap-CpGbii2u.js → server-plugin-bootstrap-Bkvb9v45.js} +1 -1
  62. package/dist/{server.impl-DEDRwq4W.js → server.impl-DJz2wbse.js} +2 -2
  63. package/package.json +1 -1
  64. package/dist/control-ui/assets/de-Bo2jYc5k.js +0 -2
  65. package/dist/control-ui/assets/es-DXjprjQY.js +0 -2
  66. package/dist/control-ui/assets/fr-D9aG4iN3.js +0 -2
  67. package/dist/control-ui/assets/i18n-DTYm2cFA.js +0 -3
  68. package/dist/control-ui/assets/id-tFGrcY4p.js +0 -2
  69. package/dist/control-ui/assets/index-Dq9zdUBj.css +0 -1
  70. package/dist/control-ui/assets/ja-JP-Co6gO61K.js +0 -2
  71. package/dist/control-ui/assets/ko-DX1JeTLk.js +0 -2
  72. package/dist/control-ui/assets/pl-C-85MNL2.js +0 -2
  73. package/dist/control-ui/assets/pt-BR-Ccy2PQNm.js +0 -2
  74. package/dist/control-ui/assets/th-DrR1o93u.js +0 -2
  75. package/dist/control-ui/assets/tr-_LwDKSIT.js +0 -2
  76. package/dist/control-ui/assets/uk-5QZxk_z2.js +0 -2
  77. package/dist/control-ui/assets/zh-CN-Cy9GknjN.js +0 -2
  78. package/dist/control-ui/assets/zh-TW-BsVU-Wb8.js +0 -2
@@ -1,15 +1,15 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./agents-BQsvYsmp.js","./i18n-DTYm2cFA.js","./format-DK0XBCTY.js","./string-coerce-LCfkQHEZ.js","./channel-config-extras-CjJYUNaz.js","./skills-shared-B3ywFtkR.js","./canvas-D92UKk4C.js","./channels-B23D1XmP.js","./cron-CYzrBBv6.js","./debug-C8av-vpc.js","./instances-qfDdYtE0.js","./logs-COvy4E7t.js","./mcp-CipBqkHK.js","./nodes-WP7e87Mm.js","./plugins-BZGJKpWs.js","./sessions-7NbJpVyg.js","./skills-hW_GTRp3.js","./wallet-Bga18qp4.js"])))=>i.map(i=>d[i]);
2
- import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"./i18n-DTYm2cFA.js";import{n as _,r as v,t as y}from"./string-coerce-LCfkQHEZ.js";import{a as b,c as x,d as S,f as ee,i as C,l as te,n as ne,o as w,s as re,u as T}from"./format-DK0XBCTY.js";var E=Object.create,ie=Object.defineProperty,D=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,k=Object.getPrototypeOf,ae=Object.prototype.hasOwnProperty,A=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),j=(e,t)=>{let n={};for(var r in e)ie(n,r,{get:e[r],enumerable:!0});return t||ie(n,Symbol.toStringTag,{value:`Module`}),n},oe=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=O(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ae.call(e,s)&&s!==n&&ie(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=D(t,s))||r.enumerable});return e},M=(e,t,n)=>(n=e==null?{}:E(k(e)),oe(t||!e||!e.__esModule?ie(n,`default`,{value:e,enumerable:!0}):n,e));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var N=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},se={attribute:!0,type:String,converter:a,reflect:!1,hasChanged:o},ce=(e=se,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function P(e){return(t,n)=>typeof n==`object`?ce(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function F(e){return P({...e,state:!0,attribute:!1})}function I(e){return e?/[\r\n]/.test(e)?null:e:null}function le(e){return I(v(e.hello?.auth?.deviceToken)??null)??I(v(e.settings?.token)??null)??I(v(e.password)??null)??null}function ue(e){let t=le(e);return t?`Bearer ${t}`:null}function de(e){let t=new Set,n=[];for(let r of[v(e.hello?.auth?.deviceToken),v(e.settings?.token),v(e.password)]){let e=I(r??null);e&&!t.has(e)&&(t.add(e),n.push(e))}return n}var L={AUTH_REQUIRED:`AUTH_REQUIRED`,AUTH_UNAUTHORIZED:`AUTH_UNAUTHORIZED`,AUTH_TOKEN_MISSING:`AUTH_TOKEN_MISSING`,AUTH_TOKEN_MISMATCH:`AUTH_TOKEN_MISMATCH`,AUTH_TOKEN_NOT_CONFIGURED:`AUTH_TOKEN_NOT_CONFIGURED`,AUTH_PASSWORD_MISSING:`AUTH_PASSWORD_MISSING`,AUTH_PASSWORD_MISMATCH:`AUTH_PASSWORD_MISMATCH`,AUTH_PASSWORD_NOT_CONFIGURED:`AUTH_PASSWORD_NOT_CONFIGURED`,AUTH_BOOTSTRAP_TOKEN_INVALID:`AUTH_BOOTSTRAP_TOKEN_INVALID`,AUTH_DEVICE_TOKEN_MISMATCH:`AUTH_DEVICE_TOKEN_MISMATCH`,AUTH_RATE_LIMITED:`AUTH_RATE_LIMITED`,AUTH_TAILSCALE_IDENTITY_MISSING:`AUTH_TAILSCALE_IDENTITY_MISSING`,AUTH_TAILSCALE_PROXY_MISSING:`AUTH_TAILSCALE_PROXY_MISSING`,AUTH_TAILSCALE_WHOIS_FAILED:`AUTH_TAILSCALE_WHOIS_FAILED`,AUTH_TAILSCALE_IDENTITY_MISMATCH:`AUTH_TAILSCALE_IDENTITY_MISMATCH`,CONTROL_UI_ORIGIN_NOT_ALLOWED:`CONTROL_UI_ORIGIN_NOT_ALLOWED`,CONTROL_UI_DEVICE_IDENTITY_REQUIRED:`CONTROL_UI_DEVICE_IDENTITY_REQUIRED`,DEVICE_IDENTITY_REQUIRED:`DEVICE_IDENTITY_REQUIRED`,DEVICE_AUTH_INVALID:`DEVICE_AUTH_INVALID`,DEVICE_AUTH_DEVICE_ID_MISMATCH:`DEVICE_AUTH_DEVICE_ID_MISMATCH`,DEVICE_AUTH_SIGNATURE_EXPIRED:`DEVICE_AUTH_SIGNATURE_EXPIRED`,DEVICE_AUTH_NONCE_REQUIRED:`DEVICE_AUTH_NONCE_REQUIRED`,DEVICE_AUTH_NONCE_MISMATCH:`DEVICE_AUTH_NONCE_MISMATCH`,DEVICE_AUTH_SIGNATURE_INVALID:`DEVICE_AUTH_SIGNATURE_INVALID`,DEVICE_AUTH_PUBLIC_KEY_INVALID:`DEVICE_AUTH_PUBLIC_KEY_INVALID`,PAIRING_REQUIRED:`PAIRING_REQUIRED`},fe={NOT_PAIRED:`not-paired`,ROLE_UPGRADE:`role-upgrade`,SCOPE_UPGRADE:`scope-upgrade`,METADATA_UPGRADE:`metadata-upgrade`},pe=new Set([`retry_with_device_token`,`update_auth_configuration`,`update_auth_credentials`,`wait_then_retry`,`review_auth_configuration`]),R=new Set([`not-paired`,`role-upgrade`,`scope-upgrade`,`metadata-upgrade`]),z=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,me={"not-paired":{requirement:`device is not approved yet`,remediationHint:`Approve this device from the pending pairing requests.`,recoveryTitle:`Gateway pairing approval required.`},"role-upgrade":{requirement:`device is asking for a higher role than currently approved`,remediationHint:`Review the requested role upgrade, then approve the pending request.`,recoveryTitle:`Gateway role upgrade approval required.`},"scope-upgrade":{requirement:`device is asking for more scopes than currently approved`,remediationHint:`Review the requested scopes, then approve the pending upgrade.`,recoveryTitle:`Gateway scope upgrade approval required.`},"metadata-upgrade":{requirement:`device identity changed and must be re-approved`,remediationHint:`Review the refreshed device details, then approve the pending request.`,recoveryTitle:`Gateway device refresh approval required.`}},he={"not-paired":`device pairing required`,"role-upgrade":`role upgrade pending approval`,"scope-upgrade":`scope upgrade pending approval`,"metadata-upgrade":`device metadata change pending approval`};function B(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.code;return typeof t==`string`&&t.trim().length>0?t:null}function ge(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=e,n=typeof t.canRetryWithDeviceToken==`boolean`?t.canRetryWithDeviceToken:void 0,r=v(t.recommendedNextStep)??``;return{canRetryWithDeviceToken:n,recommendedNextStep:pe.has(r)?r:void 0}}function _e(e){let t=v(e)??``;return R.has(t)?t:void 0}function V(e){let t=v(e);return t&&z.test(t)?t:void 0}function ve(e){if(!Array.isArray(e))return;let t=e.map(e=>v(e)).filter(e=>!!e);return t.length>0?t:[]}function H(e){return{code:L.PAIRING_REQUIRED,...e.reason?{reason:e.reason}:{},...e.requestId?{requestId:e.requestId}:{},...e.remediationHint?{remediationHint:e.remediationHint}:{},...e.deviceId?{deviceId:e.deviceId}:{},...e.requestedRole?{requestedRole:e.requestedRole}:{},...e.requestedScopes?{requestedScopes:e.requestedScopes}:{},...e.approvedRoles?{approvedRoles:e.approvedRoles}:{},...e.approvedScopes?{approvedScopes:e.approvedScopes}:{}}}function ye(e){return e?me[e].requirement:`device approval is required`}function be(e){return e?me[e].remediationHint:`Approve the pending device request before retrying.`}function xe(e){if(B(e)!==L.PAIRING_REQUIRED||!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=_e(t.reason);return H({reason:n,requestId:V(t.requestId),remediationHint:v(t.remediationHint)??be(n),deviceId:v(t.deviceId),requestedRole:v(t.requestedRole),requestedScopes:ve(t.requestedScopes),approvedRoles:ve(t.approvedRoles),approvedScopes:ve(t.approvedScopes)})}function Se(e){let t=v(e);if(!t)return null;let n=t.trim().toLowerCase(),r;for(let[e,t]of Object.entries(he))if(n.includes(t)){r=e;break}if(!r&&n.includes(`pairing required`)&&(r=fe.NOT_PAIRED),!r)return null;let i=V(t.match(/\(requestId:\s*([^\s)]+)\)/i)?.[1]);return{...i?{requestId:i}:{},reason:r}}function Ce(e){let t=xe(e),n=he[t?.reason??fe.NOT_PAIRED];return t?.requestId?`${n} (requestId: ${t.requestId})`:n}function we(e){return B(e.details)===L.PAIRING_REQUIRED?Ce(e.details):v(e.message)??`gateway request failed`}function Te(e){let t=e.scopes.join(`,`),n=e.token??``;return[`v2`,e.deviceId,e.clientId,e.clientMode,e.role,t,String(e.signedAtMs),n,e.nonce].join(`|`)}var U={WEBCHAT_UI:`webchat-ui`,CONTROL_UI:`genesis-control-ui`,TUI:`genesis-tui`,WEBCHAT:`webchat`,CLI:`cli`,GATEWAY_CLIENT:`gateway-client`,MACOS_APP:`genesis-macos`,IOS_APP:`genesis-ios`,ANDROID_APP:`genesis-android`,NODE_HOST:`node-host`,TEST:`test`,FINGERPRINT:`fingerprint`,PROBE:`genesis-probe`},Ee=U,De={WEBCHAT:`webchat`,CLI:`cli`,UI:`ui`,BACKEND:`backend`,NODE:`node`,PROBE:`probe`,TEST:`test`};new Set(Object.values(U)),new Set(Object.values(De));function Oe(e){return e.trim()}function ke(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}t.has(`operator.admin`)?(t.add(`operator.read`),t.add(`operator.write`)):t.has(`operator.write`)&&t.add(`operator.read`);let n=Array.from(t);return n.sort(),n}function Ae(e){let t=e.adapter.readStore();if(!t||t.deviceId!==e.deviceId)return null;let n=Oe(e.role),r=t.tokens[n];return!r||typeof r.token!=`string`?null:r}function je(e){let t=Oe(e.role),n=e.adapter.readStore(),r={version:1,deviceId:e.deviceId,tokens:n&&n.deviceId===e.deviceId&&n.tokens?{...n.tokens}:{}},i={token:e.token,role:t,scopes:ke(e.scopes),updatedAtMs:Date.now()};return r.tokens[t]=i,e.adapter.writeStore(r),i}function Me(e){let t=e.adapter.readStore();if(!t||t.deviceId!==e.deviceId)return;let n=Oe(e.role);if(!t.tokens[n])return;let r={version:1,deviceId:t.deviceId,tokens:{...t.tokens}};delete r.tokens[n],e.adapter.writeStore(r)}var Ne=`genesis.device.auth.v1`;function Pe(){try{let e=m()?.getItem(Ne);if(!e)return null;let t=JSON.parse(e);return!t||t.version!==1||!t.deviceId||typeof t.deviceId!=`string`||!t.tokens||typeof t.tokens!=`object`?null:t}catch{return null}}function Fe(e){try{m()?.setItem(Ne,JSON.stringify(e))}catch{}}function Ie(e){return Ae({adapter:{readStore:Pe,writeStore:Fe},deviceId:e.deviceId,role:e.role})}function Le(e){return je({adapter:{readStore:Pe,writeStore:Fe},deviceId:e.deviceId,role:e.role,token:e.token,scopes:e.scopes})}function Re(e){Me({adapter:{readStore:Pe,writeStore:Fe},deviceId:e.deviceId,role:e.role})}var ze=Object.freeze({p:57896044618658097711785492504343953926634992332820282019728792003956564819949n,n:7237005577332262213973186563042994240857116359379907606001950938285454250989n,h:8n,a:57896044618658097711785492504343953926634992332820282019728792003956564819948n,d:37095705934669439343138083508754565189542113879843219016388785533085940283555n,Gx:15112221349535400772501151409588531511454012693041857206046113283949847762202n,Gy:46316835694926478169428394003475163141307993866256225615783033603165251855960n}),{p:Be,n:Ve,Gx:He,Gy:Ue,a:We,d:Ge,h:Ke}=ze,qe=32,Je=(...e)=>{`captureStackTrace`in Error&&typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(...e)},Ye=(e=``)=>{let t=Error(e);throw Je(t,Ye),t},Xe=e=>typeof e==`bigint`,Ze=e=>typeof e==`string`,Qe=e=>e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1,$e=(e,t,n=``)=>{let r=Qe(e),i=e?.length,a=t!==void 0;if(!r||a&&i!==t){let o=n&&`"${n}" `,s=a?` of length ${t}`:``,c=r?`length=${i}`:`type=${typeof e}`,l=o+`expected Uint8Array`+s+`, got `+c;throw r?RangeError(l):TypeError(l)}return e},et=e=>new Uint8Array(e),tt=e=>Uint8Array.from(e),nt=(e,t)=>e.toString(16).padStart(t,`0`),rt=e=>Array.from($e(e)).map(e=>nt(e,2)).join(``),it={_0:48,_9:57,A:65,F:70,a:97,f:102},at=e=>{if(e>=it._0&&e<=it._9)return e-it._0;if(e>=it.A&&e<=it.F)return e-(it.A-10);if(e>=it.a&&e<=it.f)return e-(it.a-10)},ot=e=>{let t=`hex invalid`;if(!Ze(e))return Ye(t);let n=e.length,r=n/2;if(n%2)return Ye(t);let i=et(r);for(let n=0,a=0;n<r;n++,a+=2){let r=at(e.charCodeAt(a)),o=at(e.charCodeAt(a+1));if(r===void 0||o===void 0)return Ye(t);i[n]=r*16+o}return i},st=()=>globalThis?.crypto,ct=()=>st()?.subtle??Ye(`crypto.subtle must be defined, consider polyfill`),lt=(...e)=>{let t=0;for(let n of e)t+=$e(n).length;let n=et(t),r=0;return e.forEach(e=>{n.set(e,r),r+=e.length}),n},ut=(e=qe)=>st().getRandomValues(et(e)),dt=BigInt,ft=(e,t,n,r=`bad number: out of range`)=>{if(!Xe(e))throw TypeError(r);if(t<=e&&e<n)return e;throw RangeError(r)},pt=(e,t=Be)=>{let n=e%t;return n>=0n?n:t+n},mt=(1n<<255n)-1n,W=e=>{e<0n&&Ye(`negative coordinate`);let t=(e>>255n)*19n+(e&mt);return t=(t>>255n)*19n+(t&mt),t%Be},ht=e=>pt(e,Ve),gt=(e,t)=>{(e===0n||t<=0n)&&Ye(`no inverse n=`+e+` mod=`+t);let n=pt(e,t),r=t,i=0n,a=1n,o=1n,s=0n;for(;n!==0n;){let e=r/n,t=r%n,c=i-o*e,l=a-s*e;r=n,n=t,i=o,a=s,o=c,s=l}return r===1n?pt(i,t):Ye(`no inverse`)},_t=e=>{let t=Bt[e];return typeof t!=`function`&&Ye(`hashes.`+e+` not set`),t},vt=e=>$e(e,64,`digest`),yt=e=>e instanceof xt?e:Ye(`Point expected`),bt=2n**256n,xt=class e{static BASE;static ZERO;X;Y;Z;T;constructor(e,t,n,r){let i=bt;this.X=ft(e,0n,i),this.Y=ft(t,0n,i),this.Z=ft(n,1n,i),this.T=ft(r,0n,i),Object.freeze(this)}static CURVE(){return ze}static fromAffine(t){return new e(t.x,t.y,1n,W(t.x*t.y))}static fromBytes(t,n=!1){let r=Ge,i=tt($e(t,qe)),a=t[31];i[31]=a&-129;let o=Tt(i);ft(o,0n,n?bt:Be);let s=W(o*o),{isValid:c,value:l}=kt(pt(s-1n),W(r*s+1n));c||Ye(`bad point: y not sqrt`);let u=(l&1n)==1n,d=(a&128)!=0;return!n&&l===0n&&d&&Ye(`bad point: x==0, isLastByteOdd`),d!==u&&(l=pt(-l)),new e(l,o,1n,W(l*o))}static fromHex(t,n){return e.fromBytes(ot(t),n)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}assertValidity(){let e=We,t=Ge,n=this;if(n.is0())return Ye(`bad point: ZERO`);let{X:r,Y:i,Z:a,T:o}=n,s=W(r*r),c=W(i*i),l=W(a*a),u=W(l*l);return W(l*(W(s*e)+c))===pt(u+W(t*W(s*c)))?W(r*i)===W(a*o)?this:Ye(`bad point: equation left != right (2)`):Ye(`bad point: equation left != right (1)`)}equals(e){let{X:t,Y:n,Z:r}=this,{X:i,Y:a,Z:o}=yt(e),s=W(t*o),c=W(i*r),l=W(n*o),u=W(a*r);return s===c&&l===u}is0(){return this.equals(Ct)}negate(){return new e(pt(-this.X),this.Y,this.Z,pt(-this.T))}double(){let{X:t,Y:n,Z:r}=this,i=We,a=W(t*t),o=W(n*n),s=W(2n*r*r),c=W(i*a),l=pt(t+n),u=pt(W(l*l)-a-o),d=pt(c+o),f=pt(d-s),p=pt(c-o),m=W(u*f),h=W(d*p),g=W(u*p);return new e(m,h,W(f*d),g)}add(t){let{X:n,Y:r,Z:i,T:a}=this,{X:o,Y:s,Z:c,T:l}=yt(t),u=We,d=Ge,f=W(n*o),p=W(r*s),m=W(W(a*d)*l),h=W(i*c),g=pt(W(pt(n+r)*pt(o+s))-f-p),_=pt(h-m),v=pt(h+m),y=pt(p-W(u*f)),b=W(g*_),x=W(v*y),S=W(g*y);return new e(b,x,W(_*v),S)}subtract(e){return this.add(yt(e).negate())}multiply(e,t=!0){if(!t&&e===0n||(ft(e,1n,Ve),!t&&this.is0()))return Ct;if(e===1n)return this;if(this.equals(St))return Jt(e).p;let n=Ct,r=St;for(let i=this;e>0n;i=i.double(),e>>=1n)e&1n?n=n.add(i):t&&(r=r.add(i));return n}multiplyUnsafe(e){return this.multiply(e,!1)}toAffine(){let{X:e,Y:t,Z:n}=this;if(this.equals(Ct))return{x:0n,y:1n};let r=gt(n,Be);return W(n*r)!==1n&&Ye(`invalid inverse`),{x:W(e*r),y:W(t*r)}}toBytes(){let{x:e,y:t}=this.toAffine(),n=wt(t);return n[31]|=e&1n?128:0,n}toHex(){return rt(this.toBytes())}clearCofactor(){return this.multiply(dt(Ke),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let e=this.multiply(Ve/2n,!1).double();return Ve%2n&&(e=e.add(this)),e.is0()}},St=new xt(He,Ue,1n,pt(He*Ue)),Ct=new xt(0n,1n,1n,0n);xt.BASE=St,xt.ZERO=Ct;var wt=e=>ot(nt(ft(e,0n,bt),64)).reverse(),Tt=e=>dt(`0x`+rt(tt($e(e)).reverse())),Et=(e,t)=>{let n=e;for(;t-- >0n;)n=W(n*n);return n},Dt=e=>{let t=W(W(e*e)*e),n=W(Et(W(Et(t,2n)*t),1n)*e),r=W(Et(n,5n)*n),i=W(Et(r,10n)*r),a=W(Et(i,20n)*i),o=W(Et(a,40n)*a);return{pow_p_5_8:W(Et(W(Et(W(Et(W(Et(o,80n)*o),80n)*o),10n)*r),2n)*e),b2:t}},Ot=19681161376707505956807079304988542015446066515923890162744021073123829784752n,kt=(e,t)=>{let n=W(t*W(t*t)),r=Dt(W(e*W(W(n*n)*t))).pow_p_5_8,i=W(e*W(n*r)),a=W(t*W(i*i)),o=i,s=W(i*Ot),c=a===e,l=a===pt(-e),u=a===pt(-e*Ot);return c&&(i=o),(l||u)&&(i=s),(pt(i)&1n)==1n&&(i=pt(-i)),{isValid:c||l,value:i}},At=e=>ht(Tt(e)),jt=(...e)=>Promise.resolve(_t(`sha512Async`)(lt(...e))).then(vt),Mt=(...e)=>vt(_t(`sha512`)(lt(...e))),Nt=e=>{let t=tt(e),n=t.slice(0,32);n[0]&=248,n[31]&=127,n[31]|=64;let r=t.slice(32,64),i=At(n),a=St.multiply(i);return{head:n,prefix:r,scalar:i,point:a,pointBytes:a.toBytes()}},Pt=e=>jt($e(e,qe)).then(Nt),Ft=e=>Nt(Mt($e(e,qe))),It=e=>Pt(e).then(e=>e.pointBytes),Lt=e=>jt(e.hashable).then(e.finish),Rt=(e,t,n)=>{let{pointBytes:r,scalar:i}=e,a=At(t),o=St.multiply(a).toBytes();return{hashable:lt(o,r,n),finish:e=>$e(lt(o,wt(ht(a+At(e)*i))),64)}},zt=async(e,t)=>{let n=$e(e),r=await Pt(t);return Lt(Rt(r,await jt(r.prefix,n),n))},Bt={sha512Async:async e=>{let t=ct(),n=lt(e);return et(await t.digest(`SHA-512`,n.buffer))},sha512:void 0},Vt=Object.freeze({getExtendedPublicKeyAsync:Pt,getExtendedPublicKey:Ft,randomSecretKey:e=>(e=e===void 0?ut(qe):e,$e(e,qe))}),Ht=8,Ut=Math.ceil(256/Ht)+1,Wt=2**(Ht-1),Gt=()=>{let e=[],t=St,n=t;for(let r=0;r<Ut;r++){n=t,e.push(n);for(let r=1;r<Wt;r++)n=n.add(t),e.push(n);t=n.double()}return e},Kt=void 0,qt=(e,t)=>{let n=t.negate();return e?n:t},Jt=e=>{let t=Kt||=Gt(),n=Ct,r=St,i=2**Ht,a=i,o=dt(i-1),s=dt(Ht);for(let i=0;i<Ut;i++){let c=Number(e&o);e>>=s,c>Wt&&(c-=a,e+=1n);let l=i*Wt,u=l,d=l+Math.abs(c)-1,f=i%2!=0,p=c<0;c===0?r=r.add(qt(f,t[u])):n=n.add(qt(p,t[d]))}return e!==0n&&Ye(`invalid wnaf`),{p:n,f:r}},Yt=`genesis-device-identity-v1`;function Xt(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/g,``)}function Zt(e){let t=e.replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=t+`=`.repeat((4-t.length%4)%4),r=atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e+=1)i[e]=r.charCodeAt(e);return i}function Qt(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function $t(e){let t=await crypto.subtle.digest(`SHA-256`,e.slice().buffer);return Qt(new Uint8Array(t))}async function en(){let e=Vt.randomSecretKey(),t=await It(e);return{deviceId:await $t(t),publicKey:Xt(t),privateKey:Xt(e)}}async function tn(){let e=m();try{let t=e?.getItem(Yt);if(t){let n=JSON.parse(t);if(n?.version===1&&typeof n.deviceId==`string`&&typeof n.publicKey==`string`&&typeof n.privateKey==`string`){let t=await $t(Zt(n.publicKey));if(t!==n.deviceId){let r={...n,deviceId:t};return e?.setItem(Yt,JSON.stringify(r)),{deviceId:t,publicKey:n.publicKey,privateKey:n.privateKey}}return{deviceId:n.deviceId,publicKey:n.publicKey,privateKey:n.privateKey}}}}catch{}let t=await en(),n={version:1,deviceId:t.deviceId,publicKey:t.publicKey,privateKey:t.privateKey,createdAtMs:Date.now()};return e?.setItem(Yt,JSON.stringify(n)),t}async function nn(e,t){let n=Zt(e);return Xt(await zt(new TextEncoder().encode(t),n))}var rn=!1;function an(e){e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=``;for(let n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,`0`);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function on(){rn||(rn=!0,console.warn(`[uuid] crypto API missing; refusing insecure UUID generation`))}function sn(e=globalThis.crypto){if(e&&typeof e.randomUUID==`function`)return e.randomUUID();if(e&&typeof e.getRandomValues==`function`){let t=new Uint8Array(16);return e.getRandomValues(t),an(t)}throw on(),Error(`Web Crypto is required for UUID generation`)}var cn=class extends Error{constructor(e){super(we({message:e.message,details:e.details})),this.name=`GatewayRequestError`,this.gatewayCode=e.code,this.details=e.details,this.retryable=e.retryable===!0,this.retryAfterMs=e.retryAfterMs}};function ln(e){return B(e?.details)}function un(e){if(!e)return!1;let t=ln(e);return t===L.AUTH_TOKEN_MISSING||t===L.AUTH_BOOTSTRAP_TOKEN_INVALID||t===L.AUTH_PASSWORD_MISSING||t===L.AUTH_PASSWORD_MISMATCH||t===L.AUTH_RATE_LIMITED||t===L.PAIRING_REQUIRED||t===L.CONTROL_UI_DEVICE_IDENTITY_REQUIRED||t===L.DEVICE_IDENTITY_REQUIRED}function dn(e){try{let t=new URL(e,window.location.href),n=t.hostname.trim().toLowerCase(),r=n===`localhost`||n===`::1`||n===`[::1]`||n===`127.0.0.1`,i=n.startsWith(`127.`);if(r||i)return!0;let a=new URL(window.location.href);return t.host===a.host}catch{return!1}}var fn=`operator`,pn=[`operator.admin`,`operator.read`,`operator.write`,`operator.approvals`,`operator.pairing`],mn=4008,hn=1e4;function gn(e){let t=e.authToken;if(t||e.authPassword)return{token:t,deviceToken:e.authDeviceToken??e.resolvedDeviceToken,password:e.authPassword}}async function _n(e){let{deviceIdentity:t}=e;if(!t)return;let n=Date.now(),r=e.connectNonce??``,i=Te({deviceId:t.deviceId,clientId:e.client.id,clientMode:e.client.mode,role:e.role,scopes:e.scopes,signedAtMs:n,token:e.authToken??null,nonce:r}),a=await nn(t.privateKey,i);return{id:t.deviceId,publicKey:t.publicKey,signature:a,signedAt:n,nonce:r}}function vn(e){return!e.deviceTokenRetryBudgetUsed&&!e.authDeviceToken&&!!e.explicitGatewayToken&&!!e.deviceIdentity&&!!e.storedToken&&e.canRetryWithDeviceTokenHint&&dn(e.url)}var yn=class{constructor(e){this.opts=e,this.ws=null,this.pending=new Map,this.closed=!1,this.lastSeq=null,this.connectNonce=null,this.connectSent=!1,this.connectTimer=null,this.backoffMs=800,this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.eventListeners=new Set}start(){this.closed=!1,this.connect()}stop(){this.closed=!0,this.clearConnectTimer(),this.ws?.close(),this.ws=null,this.pendingConnectError=void 0,this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.flushPending(Error(`gateway client stopped`))}get connected(){return this.ws?.readyState===WebSocket.OPEN}connect(){this.closed||(this.ws=new WebSocket(this.opts.url),this.ws.addEventListener(`open`,()=>this.queueConnect()),this.ws.addEventListener(`message`,e=>this.handleMessage(String(e.data??``))),this.ws.addEventListener(`close`,e=>{let t=e.reason??``,n=this.pendingConnectError;this.pendingConnectError=void 0,this.ws=null,this.flushPending(Error(`gateway closed (${e.code}): ${t}`)),this.opts.onClose?.({code:e.code,reason:t,error:n}),!(ln(n)===L.AUTH_TOKEN_MISMATCH&&this.deviceTokenRetryBudgetUsed&&!this.pendingDeviceTokenRetry)&&(un(n)||this.scheduleReconnect())}),this.ws.addEventListener(`error`,()=>{}))}scheduleReconnect(){if(this.closed)return;let e=this.backoffMs;this.backoffMs=Math.min(this.backoffMs*1.7,15e3),this.clearConnectTimer(),this.connectTimer=window.setTimeout(()=>{this.connectTimer=null,this.connect()},e)}flushPending(e){for(let[,t]of this.pending)t.timeout!==null&&window.clearTimeout(t.timeout),t.reject(e);this.pending.clear()}buildConnectClient(){return{id:this.opts.clientName??Ee.CONTROL_UI,version:this.opts.clientVersion??`control-ui`,platform:this.opts.platform??navigator.platform??`web`,mode:this.opts.mode??De.WEBCHAT,instanceId:this.opts.instanceId}}buildConnectParams(e){return{minProtocol:4,maxProtocol:4,client:e.client,role:e.role,scopes:e.scopes,device:e.device,caps:[`tool-events`,`chat-incremental`],auth:e.auth,userAgent:navigator.userAgent,locale:navigator.language}}async buildConnectPlan(){let e=fn,t=[...pn],n=this.buildConnectClient(),r=this.opts.token?.trim()||void 0,i=this.opts.password?.trim()||void 0,a=typeof crypto<`u`&&!!crypto.subtle,o=null,s={authToken:r,authPassword:i,canFallbackToShared:!1};return a&&(o=await tn(),s=this.selectConnectAuth({role:e,deviceId:o.deviceId}),this.pendingDeviceTokenRetry&&s.authDeviceToken&&(this.pendingDeviceTokenRetry=!1)),{role:e,scopes:t,client:n,explicitGatewayToken:r,selectedAuth:s,auth:gn(s),deviceIdentity:o,device:await _n({deviceIdentity:o,client:n,role:e,scopes:t,authToken:s.authToken,connectNonce:this.connectNonce})}}handleConnectHello(e,t){this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,e?.auth?.deviceToken&&t.deviceIdentity&&Le({deviceId:t.deviceIdentity.deviceId,role:e.auth.role??t.role,token:e.auth.deviceToken,scopes:e.auth.scopes??[]}),this.backoffMs=800,this.opts.onHello?.(e)}handleConnectFailure(e,t){let n=e instanceof cn?ln(e):null,r=e instanceof cn?ge(e.details):{},i=r.recommendedNextStep===`retry_with_device_token`,a=r.canRetryWithDeviceToken===!0||i||n===L.AUTH_TOKEN_MISMATCH;vn({deviceTokenRetryBudgetUsed:this.deviceTokenRetryBudgetUsed,authDeviceToken:t.selectedAuth.authDeviceToken,explicitGatewayToken:t.explicitGatewayToken,deviceIdentity:t.deviceIdentity,storedToken:t.selectedAuth.storedToken,canRetryWithDeviceTokenHint:a,url:this.opts.url})&&(this.pendingDeviceTokenRetry=!0,this.deviceTokenRetryBudgetUsed=!0),e instanceof cn?this.pendingConnectError={code:e.gatewayCode,message:e.message,details:e.details,retryable:e.retryable,retryAfterMs:e.retryAfterMs}:this.pendingConnectError=void 0,t.selectedAuth.canFallbackToShared&&t.deviceIdentity&&n===L.AUTH_DEVICE_TOKEN_MISMATCH&&Re({deviceId:t.deviceIdentity.deviceId,role:t.role}),this.ws?.close(mn,`connect failed`)}async sendConnect(){if(this.connectSent)return;this.connectSent=!0,this.clearConnectTimer();let e=await this.buildConnectPlan();this.request(`connect`,this.buildConnectParams(e),{timeoutMs:hn}).then(t=>this.handleConnectHello(t,e)).catch(t=>this.handleConnectFailure(t,e))}handleMessage(e){let t;try{t=JSON.parse(e)}catch{return}let n=t;if(n.type===`event`){let e=t;if(e.event===`connect.challenge`){let t=e.payload,n=t&&typeof t.nonce==`string`?t.nonce:null;n&&(this.connectNonce=n,this.sendConnect());return}let n=typeof e.seq==`number`?e.seq:null;n!==null&&(this.lastSeq!==null&&n>this.lastSeq+1&&this.opts.onGap?.({expected:this.lastSeq+1,received:n}),this.lastSeq=n);try{this.opts.onEvent?.(e);for(let t of this.eventListeners)t(e)}catch(e){console.error(`[gateway] event handler error:`,e)}return}if(n.type===`res`){let e=t,n=this.pending.get(e.id);if(!n)return;this.pending.delete(e.id),n.timeout!==null&&window.clearTimeout(n.timeout),e.ok?n.resolve(e.payload):n.reject(new cn({code:e.error?.code??`UNAVAILABLE`,message:e.error?.message??`request failed`,details:e.error?.details,retryable:e.error?.retryable,retryAfterMs:e.error?.retryAfterMs}));return}}selectConnectAuth(e){let t=this.opts.token?.trim()||void 0,n=this.opts.password?.trim()||void 0,r=Ie({deviceId:e.deviceId,role:e.role}),i=r?.scopes??[],a=e.role!==`operator`||i.includes(`operator.read`)||i.includes(`operator.write`)||i.includes(`operator.admin`)?r?.token:void 0,o=this.pendingDeviceTokenRetry&&!!t&&!!a&&dn(this.opts.url),s=t||n?void 0:a??void 0;return{authToken:t??s,authDeviceToken:o?a??void 0:void 0,authPassword:n,resolvedDeviceToken:s,storedToken:a??void 0,canFallbackToShared:!!(a&&t)}}request(e,t,n){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)return Promise.reject(Error(`gateway not connected`));let r=sn(),i={type:`req`,id:r,method:e,params:t},a=new Promise((t,i)=>{let a=n?.timeoutMs===null?null:typeof n?.timeoutMs==`number`&&Number.isFinite(n.timeoutMs)?window.setTimeout(()=>{this.pending.delete(r),i(Error(`gateway request timeout for ${e}`))},Math.max(1,n.timeoutMs)):null;this.pending.set(r,{resolve:e=>t(e),reject:i,timeout:a})});return this.ws.send(JSON.stringify(i)),a}addEventListener(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e)}}queueConnect(){this.connectNonce=null,this.connectSent=!1,this.clearConnectTimer(),this.connectTimer=window.setTimeout(()=>{this.connectTimer=null,this.sendConnect()},750)}clearConnectTimer(){this.connectTimer!==null&&(window.clearTimeout(this.connectTimer),this.connectTimer=null)}};function bn(e){return e instanceof cn?ln(e)===L.AUTH_UNAUTHORIZED?!0:e.message.includes(`missing scope: operator.read`):!1}function xn(e){return`This connection is missing operator.read, so ${e} cannot be loaded yet.`}async function Sn(e,t){if(!(!e.client||!e.connected)&&!e.channelsLoading){e.channelsLoading=!0,e.channelsError=null;try{e.channelsSnapshot=await e.client.request(`channels.status`,{probe:t,timeoutMs:8e3}),e.channelsLastSuccess=Date.now()}catch(t){bn(t)?(e.channelsSnapshot=null,e.channelsError=xn(`channel status`)):e.channelsError=String(t)}finally{e.channelsLoading=!1}}}async function Cn(e,t){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{let n=await e.client.request(`web.login.start`,{force:t,timeoutMs:3e4});e.whatsappLoginMessage=n.message??null,e.whatsappLoginQrDataUrl=n.qrDataUrl??null,e.whatsappLoginConnected=typeof n.connected==`boolean`?n.connected:null}catch(t){e.whatsappLoginMessage=String(t),e.whatsappLoginQrDataUrl=null,e.whatsappLoginConnected=null}finally{e.whatsappBusy=!1}}}async function wn(e){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{let t=await e.client.request(`web.login.wait`,{timeoutMs:12e4,currentQrDataUrl:e.whatsappLoginQrDataUrl??void 0});e.whatsappLoginMessage=t.message??null,e.whatsappLoginConnected=t.connected??null,t.qrDataUrl?e.whatsappLoginQrDataUrl=t.qrDataUrl:t.connected&&(e.whatsappLoginQrDataUrl=null)}catch(t){e.whatsappLoginMessage=String(t),e.whatsappLoginConnected=null}finally{e.whatsappBusy=!1}}}async function Tn(e){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{await e.client.request(`channels.logout`,{channel:`whatsapp`}),e.whatsappLoginMessage=`Logged out.`,e.whatsappLoginQrDataUrl=null,e.whatsappLoginConnected=null}catch(t){e.whatsappLoginMessage=String(t)}finally{e.whatsappBusy=!1}}}var En=M(A(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.JSON5=r()})(e,(function(){function e(e,t){return t={exports:{}},e(t,t.exports),t.exports}var t=e(function(e){var t=e.exports=typeof window<`u`&&window.Math==Math?window:typeof self<`u`&&self.Math==Math?self:Function(`return this`)();typeof __g==`number`&&(__g=t)}),n=e(function(e){var t=e.exports={version:`2.6.5`};typeof __e==`number`&&(__e=t)});n.version;var r=function(e){return typeof e==`object`?e!==null:typeof e==`function`},i=function(e){if(!r(e))throw TypeError(e+` is not an object!`);return e},a=function(e){try{return!!e()}catch{return!0}},o=!a(function(){return Object.defineProperty({},`a`,{get:function(){return 7}}).a!=7}),s=t.document,c=r(s)&&r(s.createElement),l=function(e){return c?s.createElement(e):{}},u=!o&&!a(function(){return Object.defineProperty(l(`div`),`a`,{get:function(){return 7}}).a!=7}),d=function(e,t){if(!r(e))return e;var n,i;if(t&&typeof(n=e.toString)==`function`&&!r(i=n.call(e))||typeof(n=e.valueOf)==`function`&&!r(i=n.call(e))||!t&&typeof(n=e.toString)==`function`&&!r(i=n.call(e)))return i;throw TypeError(`Can't convert object to primitive value`)},f=Object.defineProperty,p={f:o?Object.defineProperty:function(e,t,n){if(i(e),t=d(t,!0),i(n),u)try{return f(e,t,n)}catch{}if(`get`in n||`set`in n)throw TypeError(`Accessors not supported!`);return`value`in n&&(e[t]=n.value),e}},m=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},h=o?function(e,t,n){return p.f(e,t,m(1,n))}:function(e,t,n){return e[t]=n,e},g={}.hasOwnProperty,_=function(e,t){return g.call(e,t)},v=0,y=Math.random(),b=function(e){return`Symbol(${e===void 0?``:e})_${(++v+y).toString(36)}`},x=!1,S=e(function(e){var r=`__core-js_shared__`,i=t[r]||(t[r]={});(e.exports=function(e,t){return i[e]||(i[e]=t===void 0?{}:t)})(`versions`,[]).push({version:n.version,mode:x?`pure`:`global`,copyright:`© 2019 Denis Pushkarev (zloirock.ru)`})})(`native-function-to-string`,Function.toString),ee=e(function(e){var r=b(`src`),i=`toString`,a=(``+S).split(i);n.inspectSource=function(e){return S.call(e)},(e.exports=function(e,n,i,o){var s=typeof i==`function`;s&&(_(i,`name`)||h(i,`name`,n)),e[n]!==i&&(s&&(_(i,r)||h(i,r,e[n]?``+e[n]:a.join(String(n)))),e===t?e[n]=i:o?e[n]?e[n]=i:h(e,n,i):(delete e[n],h(e,n,i)))})(Function.prototype,i,function(){return typeof this==`function`&&this[r]||S.call(this)})}),C=function(e){if(typeof e!=`function`)throw TypeError(e+` is not a function!`);return e},te=function(e,t,n){if(C(e),t===void 0)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},ne=`prototype`,w=function(e,r,i){var a=e&w.F,o=e&w.G,s=e&w.S,c=e&w.P,l=e&w.B,u=o?t:s?t[r]||(t[r]={}):(t[r]||{})[ne],d=o?n:n[r]||(n[r]={}),f=d[ne]||(d[ne]={}),p,m,g,_;for(p in o&&(i=r),i)m=!a&&u&&u[p]!==void 0,g=(m?u:i)[p],_=l&&m?te(g,t):c&&typeof g==`function`?te(Function.call,g):g,u&&ee(u,p,g,e&w.U),d[p]!=g&&h(d,p,_),c&&f[p]!=g&&(f[p]=g)};t.core=n,w.F=1,w.G=2,w.S=4,w.P=8,w.B=16,w.W=32,w.U=64,w.R=128;var re=w,T=Math.ceil,E=Math.floor,ie=function(e){return isNaN(e=+e)?0:(e>0?E:T)(e)},D=function(e){if(e==null)throw TypeError(`Can't call method on `+e);return e},O=function(e){return function(t,n){var r=String(D(t)),i=ie(n),a=r.length,o,s;return i<0||i>=a?e?``:void 0:(o=r.charCodeAt(i),o<55296||o>56319||i+1===a||(s=r.charCodeAt(i+1))<56320||s>57343?e?r.charAt(i):o:e?r.slice(i,i+2):(o-55296<<10)+(s-56320)+65536)}}(!1);re(re.P,`String`,{codePointAt:function(e){return O(this,e)}}),n.String.codePointAt;var k=Math.max,ae=Math.min,A=function(e,t){return e=ie(e),e<0?k(e+t,0):ae(e,t)},j=String.fromCharCode,oe=String.fromCodePoint;re(re.S+re.F*(!!oe&&oe.length!=1),`String`,{fromCodePoint:function(e){for(var t=arguments,n=[],r=arguments.length,i=0,a;r>i;){if(a=+t[i++],A(a,1114111)!==a)throw RangeError(a+` is not a valid code point`);n.push(a<65536?j(a):j(((a-=65536)>>10)+55296,a%1024+56320))}return n.join(``)}}),n.String.fromCodePoint;var M={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},N={isSpaceSeparator:function(e){return typeof e==`string`&&M.Space_Separator.test(e)},isIdStartChar:function(e){return typeof e==`string`&&(e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e===`$`||e===`_`||M.ID_Start.test(e))},isIdContinueChar:function(e){return typeof e==`string`&&(e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`$`||e===`_`||e===`‌`||e===`‍`||M.ID_Continue.test(e))},isDigit:function(e){return typeof e==`string`&&/[0-9]/.test(e)},isHexDigit:function(e){return typeof e==`string`&&/[0-9A-Fa-f]/.test(e)}},se,ce,P,F,I,le,ue,de,L,fe=function(e,t){se=String(e),ce=`start`,P=[],F=0,I=1,le=0,ue=void 0,de=void 0,L=void 0;do ue=ge(),Ce[ce]();while(ue.type!==`eof`);return typeof t==`function`?pe({"":L},``,t):L};function pe(e,t,n){var r=e[t];if(typeof r==`object`&&r)if(Array.isArray(r))for(var i=0;i<r.length;i++){var a=String(i),o=pe(r,a,n);o===void 0?delete r[a]:Object.defineProperty(r,a,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(var s in r){var c=pe(r,s,n);c===void 0?delete r[s]:Object.defineProperty(r,s,{value:c,writable:!0,enumerable:!0,configurable:!0})}return n.call(e,t,r)}var R,z,me,he,B;function ge(){for(R=`default`,z=``,me=!1,he=1;;){B=_e();var e=ve[R]();if(e)return e}}function _e(){if(se[F])return String.fromCodePoint(se.codePointAt(F))}function V(){var e=_e();return e===`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./agents-CdobtTOW.js","./i18n-Dr_ijwId.js","./format-BOO4MheD.js","./string-coerce-LCfkQHEZ.js","./channel-config-extras-BmGwfDPL.js","./skills-shared-BHZ4ntcf.js","./canvas-Cy2AiGPQ.js","./channels-DdgVKbNz.js","./cron-CCNOjNyY.js","./debug-B8lJz0xl.js","./instances-DRlIDzRt.js","./logs-BYrqUHTd.js","./mcp-C7ry874X.js","./models-WJk_luH_.js","./memory-Dk8DVFlc.js","./nodes-SWmxABM8.js","./plugins-bulpMEFW.js","./sessions-bCilYtM1.js","./skills-C1LNGjhW.js","./wallet-BwqvP_oc.js"])))=>i.map(i=>d[i]);
2
+ import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"./i18n-Dr_ijwId.js";import{n as _,r as v,t as y}from"./string-coerce-LCfkQHEZ.js";import{a as b,c as x,d as S,f as ee,i as C,l as te,n as ne,o as w,s as re,u as T}from"./format-BOO4MheD.js";var ie=Object.create,ae=Object.defineProperty,E=Object.getOwnPropertyDescriptor,D=Object.getOwnPropertyNames,O=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty,k=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),A=(e,t)=>{let n={};for(var r in e)ae(n,r,{get:e[r],enumerable:!0});return t||ae(n,Symbol.toStringTag,{value:`Module`}),n},se=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=D(t),a=0,o=i.length,s;a<o;a++)s=i[a],!oe.call(e,s)&&s!==n&&ae(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=E(t,s))||r.enumerable});return e},j=(e,t,n)=>(n=e==null?{}:ie(O(e)),se(t||!e||!e.__esModule?ae(n,`default`,{value:e,enumerable:!0}):n,e));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var M=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},N={attribute:!0,type:String,converter:a,reflect:!1,hasChanged:o},ce=(e=N,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function P(e){return(t,n)=>typeof n==`object`?ce(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function F(e){return P({...e,state:!0,attribute:!1})}function I(e){return e?/[\r\n]/.test(e)?null:e:null}function le(e){return I(v(e.hello?.auth?.deviceToken)??null)??I(v(e.settings?.token)??null)??I(v(e.password)??null)??null}function ue(e){let t=le(e);return t?`Bearer ${t}`:null}function de(e){let t=new Set,n=[];for(let r of[v(e.hello?.auth?.deviceToken),v(e.settings?.token),v(e.password)]){let e=I(r??null);e&&!t.has(e)&&(t.add(e),n.push(e))}return n}var L={AUTH_REQUIRED:`AUTH_REQUIRED`,AUTH_UNAUTHORIZED:`AUTH_UNAUTHORIZED`,AUTH_TOKEN_MISSING:`AUTH_TOKEN_MISSING`,AUTH_TOKEN_MISMATCH:`AUTH_TOKEN_MISMATCH`,AUTH_TOKEN_NOT_CONFIGURED:`AUTH_TOKEN_NOT_CONFIGURED`,AUTH_PASSWORD_MISSING:`AUTH_PASSWORD_MISSING`,AUTH_PASSWORD_MISMATCH:`AUTH_PASSWORD_MISMATCH`,AUTH_PASSWORD_NOT_CONFIGURED:`AUTH_PASSWORD_NOT_CONFIGURED`,AUTH_BOOTSTRAP_TOKEN_INVALID:`AUTH_BOOTSTRAP_TOKEN_INVALID`,AUTH_DEVICE_TOKEN_MISMATCH:`AUTH_DEVICE_TOKEN_MISMATCH`,AUTH_RATE_LIMITED:`AUTH_RATE_LIMITED`,AUTH_TAILSCALE_IDENTITY_MISSING:`AUTH_TAILSCALE_IDENTITY_MISSING`,AUTH_TAILSCALE_PROXY_MISSING:`AUTH_TAILSCALE_PROXY_MISSING`,AUTH_TAILSCALE_WHOIS_FAILED:`AUTH_TAILSCALE_WHOIS_FAILED`,AUTH_TAILSCALE_IDENTITY_MISMATCH:`AUTH_TAILSCALE_IDENTITY_MISMATCH`,CONTROL_UI_ORIGIN_NOT_ALLOWED:`CONTROL_UI_ORIGIN_NOT_ALLOWED`,CONTROL_UI_DEVICE_IDENTITY_REQUIRED:`CONTROL_UI_DEVICE_IDENTITY_REQUIRED`,DEVICE_IDENTITY_REQUIRED:`DEVICE_IDENTITY_REQUIRED`,DEVICE_AUTH_INVALID:`DEVICE_AUTH_INVALID`,DEVICE_AUTH_DEVICE_ID_MISMATCH:`DEVICE_AUTH_DEVICE_ID_MISMATCH`,DEVICE_AUTH_SIGNATURE_EXPIRED:`DEVICE_AUTH_SIGNATURE_EXPIRED`,DEVICE_AUTH_NONCE_REQUIRED:`DEVICE_AUTH_NONCE_REQUIRED`,DEVICE_AUTH_NONCE_MISMATCH:`DEVICE_AUTH_NONCE_MISMATCH`,DEVICE_AUTH_SIGNATURE_INVALID:`DEVICE_AUTH_SIGNATURE_INVALID`,DEVICE_AUTH_PUBLIC_KEY_INVALID:`DEVICE_AUTH_PUBLIC_KEY_INVALID`,PAIRING_REQUIRED:`PAIRING_REQUIRED`},fe={NOT_PAIRED:`not-paired`,ROLE_UPGRADE:`role-upgrade`,SCOPE_UPGRADE:`scope-upgrade`,METADATA_UPGRADE:`metadata-upgrade`},pe=new Set([`retry_with_device_token`,`update_auth_configuration`,`update_auth_credentials`,`wait_then_retry`,`review_auth_configuration`]),R=new Set([`not-paired`,`role-upgrade`,`scope-upgrade`,`metadata-upgrade`]),z=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,me={"not-paired":{requirement:`device is not approved yet`,remediationHint:`Approve this device from the pending pairing requests.`,recoveryTitle:`Gateway pairing approval required.`},"role-upgrade":{requirement:`device is asking for a higher role than currently approved`,remediationHint:`Review the requested role upgrade, then approve the pending request.`,recoveryTitle:`Gateway role upgrade approval required.`},"scope-upgrade":{requirement:`device is asking for more scopes than currently approved`,remediationHint:`Review the requested scopes, then approve the pending upgrade.`,recoveryTitle:`Gateway scope upgrade approval required.`},"metadata-upgrade":{requirement:`device identity changed and must be re-approved`,remediationHint:`Review the refreshed device details, then approve the pending request.`,recoveryTitle:`Gateway device refresh approval required.`}},he={"not-paired":`device pairing required`,"role-upgrade":`role upgrade pending approval`,"scope-upgrade":`scope upgrade pending approval`,"metadata-upgrade":`device metadata change pending approval`};function B(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.code;return typeof t==`string`&&t.trim().length>0?t:null}function ge(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=e,n=typeof t.canRetryWithDeviceToken==`boolean`?t.canRetryWithDeviceToken:void 0,r=v(t.recommendedNextStep)??``;return{canRetryWithDeviceToken:n,recommendedNextStep:pe.has(r)?r:void 0}}function _e(e){let t=v(e)??``;return R.has(t)?t:void 0}function V(e){let t=v(e);return t&&z.test(t)?t:void 0}function ve(e){if(!Array.isArray(e))return;let t=e.map(e=>v(e)).filter(e=>!!e);return t.length>0?t:[]}function H(e){return{code:L.PAIRING_REQUIRED,...e.reason?{reason:e.reason}:{},...e.requestId?{requestId:e.requestId}:{},...e.remediationHint?{remediationHint:e.remediationHint}:{},...e.deviceId?{deviceId:e.deviceId}:{},...e.requestedRole?{requestedRole:e.requestedRole}:{},...e.requestedScopes?{requestedScopes:e.requestedScopes}:{},...e.approvedRoles?{approvedRoles:e.approvedRoles}:{},...e.approvedScopes?{approvedScopes:e.approvedScopes}:{}}}function ye(e){return e?me[e].requirement:`device approval is required`}function be(e){return e?me[e].remediationHint:`Approve the pending device request before retrying.`}function xe(e){if(B(e)!==L.PAIRING_REQUIRED||!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=_e(t.reason);return H({reason:n,requestId:V(t.requestId),remediationHint:v(t.remediationHint)??be(n),deviceId:v(t.deviceId),requestedRole:v(t.requestedRole),requestedScopes:ve(t.requestedScopes),approvedRoles:ve(t.approvedRoles),approvedScopes:ve(t.approvedScopes)})}function Se(e){let t=v(e);if(!t)return null;let n=t.trim().toLowerCase(),r;for(let[e,t]of Object.entries(he))if(n.includes(t)){r=e;break}if(!r&&n.includes(`pairing required`)&&(r=fe.NOT_PAIRED),!r)return null;let i=V(t.match(/\(requestId:\s*([^\s)]+)\)/i)?.[1]);return{...i?{requestId:i}:{},reason:r}}function Ce(e){let t=xe(e),n=he[t?.reason??fe.NOT_PAIRED];return t?.requestId?`${n} (requestId: ${t.requestId})`:n}function we(e){return B(e.details)===L.PAIRING_REQUIRED?Ce(e.details):v(e.message)??`gateway request failed`}function Te(e){let t=e.scopes.join(`,`),n=e.token??``;return[`v2`,e.deviceId,e.clientId,e.clientMode,e.role,t,String(e.signedAtMs),n,e.nonce].join(`|`)}var U={WEBCHAT_UI:`webchat-ui`,CONTROL_UI:`genesis-control-ui`,TUI:`genesis-tui`,WEBCHAT:`webchat`,CLI:`cli`,GATEWAY_CLIENT:`gateway-client`,MACOS_APP:`genesis-macos`,IOS_APP:`genesis-ios`,ANDROID_APP:`genesis-android`,NODE_HOST:`node-host`,TEST:`test`,FINGERPRINT:`fingerprint`,PROBE:`genesis-probe`},Ee=U,De={WEBCHAT:`webchat`,CLI:`cli`,UI:`ui`,BACKEND:`backend`,NODE:`node`,PROBE:`probe`,TEST:`test`};new Set(Object.values(U)),new Set(Object.values(De));function Oe(e){return e.trim()}function ke(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}t.has(`operator.admin`)?(t.add(`operator.read`),t.add(`operator.write`)):t.has(`operator.write`)&&t.add(`operator.read`);let n=Array.from(t);return n.sort(),n}function Ae(e){let t=e.adapter.readStore();if(!t||t.deviceId!==e.deviceId)return null;let n=Oe(e.role),r=t.tokens[n];return!r||typeof r.token!=`string`?null:r}function je(e){let t=Oe(e.role),n=e.adapter.readStore(),r={version:1,deviceId:e.deviceId,tokens:n&&n.deviceId===e.deviceId&&n.tokens?{...n.tokens}:{}},i={token:e.token,role:t,scopes:ke(e.scopes),updatedAtMs:Date.now()};return r.tokens[t]=i,e.adapter.writeStore(r),i}function Me(e){let t=e.adapter.readStore();if(!t||t.deviceId!==e.deviceId)return;let n=Oe(e.role);if(!t.tokens[n])return;let r={version:1,deviceId:t.deviceId,tokens:{...t.tokens}};delete r.tokens[n],e.adapter.writeStore(r)}var Ne=`genesis.device.auth.v1`;function Pe(){try{let e=m()?.getItem(Ne);if(!e)return null;let t=JSON.parse(e);return!t||t.version!==1||!t.deviceId||typeof t.deviceId!=`string`||!t.tokens||typeof t.tokens!=`object`?null:t}catch{return null}}function Fe(e){try{m()?.setItem(Ne,JSON.stringify(e))}catch{}}function Ie(e){return Ae({adapter:{readStore:Pe,writeStore:Fe},deviceId:e.deviceId,role:e.role})}function Le(e){return je({adapter:{readStore:Pe,writeStore:Fe},deviceId:e.deviceId,role:e.role,token:e.token,scopes:e.scopes})}function Re(e){Me({adapter:{readStore:Pe,writeStore:Fe},deviceId:e.deviceId,role:e.role})}var ze=Object.freeze({p:57896044618658097711785492504343953926634992332820282019728792003956564819949n,n:7237005577332262213973186563042994240857116359379907606001950938285454250989n,h:8n,a:57896044618658097711785492504343953926634992332820282019728792003956564819948n,d:37095705934669439343138083508754565189542113879843219016388785533085940283555n,Gx:15112221349535400772501151409588531511454012693041857206046113283949847762202n,Gy:46316835694926478169428394003475163141307993866256225615783033603165251855960n}),{p:Be,n:Ve,Gx:He,Gy:Ue,a:We,d:Ge,h:Ke}=ze,qe=32,Je=(...e)=>{`captureStackTrace`in Error&&typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(...e)},Ye=(e=``)=>{let t=Error(e);throw Je(t,Ye),t},Xe=e=>typeof e==`bigint`,Ze=e=>typeof e==`string`,Qe=e=>e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1,$e=(e,t,n=``)=>{let r=Qe(e),i=e?.length,a=t!==void 0;if(!r||a&&i!==t){let o=n&&`"${n}" `,s=a?` of length ${t}`:``,c=r?`length=${i}`:`type=${typeof e}`,l=o+`expected Uint8Array`+s+`, got `+c;throw r?RangeError(l):TypeError(l)}return e},et=e=>new Uint8Array(e),tt=e=>Uint8Array.from(e),nt=(e,t)=>e.toString(16).padStart(t,`0`),rt=e=>Array.from($e(e)).map(e=>nt(e,2)).join(``),it={_0:48,_9:57,A:65,F:70,a:97,f:102},at=e=>{if(e>=it._0&&e<=it._9)return e-it._0;if(e>=it.A&&e<=it.F)return e-(it.A-10);if(e>=it.a&&e<=it.f)return e-(it.a-10)},ot=e=>{let t=`hex invalid`;if(!Ze(e))return Ye(t);let n=e.length,r=n/2;if(n%2)return Ye(t);let i=et(r);for(let n=0,a=0;n<r;n++,a+=2){let r=at(e.charCodeAt(a)),o=at(e.charCodeAt(a+1));if(r===void 0||o===void 0)return Ye(t);i[n]=r*16+o}return i},st=()=>globalThis?.crypto,ct=()=>st()?.subtle??Ye(`crypto.subtle must be defined, consider polyfill`),lt=(...e)=>{let t=0;for(let n of e)t+=$e(n).length;let n=et(t),r=0;return e.forEach(e=>{n.set(e,r),r+=e.length}),n},ut=(e=qe)=>st().getRandomValues(et(e)),dt=BigInt,ft=(e,t,n,r=`bad number: out of range`)=>{if(!Xe(e))throw TypeError(r);if(t<=e&&e<n)return e;throw RangeError(r)},pt=(e,t=Be)=>{let n=e%t;return n>=0n?n:t+n},mt=(1n<<255n)-1n,W=e=>{e<0n&&Ye(`negative coordinate`);let t=(e>>255n)*19n+(e&mt);return t=(t>>255n)*19n+(t&mt),t%Be},ht=e=>pt(e,Ve),gt=(e,t)=>{(e===0n||t<=0n)&&Ye(`no inverse n=`+e+` mod=`+t);let n=pt(e,t),r=t,i=0n,a=1n,o=1n,s=0n;for(;n!==0n;){let e=r/n,t=r%n,c=i-o*e,l=a-s*e;r=n,n=t,i=o,a=s,o=c,s=l}return r===1n?pt(i,t):Ye(`no inverse`)},_t=e=>{let t=Bt[e];return typeof t!=`function`&&Ye(`hashes.`+e+` not set`),t},vt=e=>$e(e,64,`digest`),yt=e=>e instanceof xt?e:Ye(`Point expected`),bt=2n**256n,xt=class e{static BASE;static ZERO;X;Y;Z;T;constructor(e,t,n,r){let i=bt;this.X=ft(e,0n,i),this.Y=ft(t,0n,i),this.Z=ft(n,1n,i),this.T=ft(r,0n,i),Object.freeze(this)}static CURVE(){return ze}static fromAffine(t){return new e(t.x,t.y,1n,W(t.x*t.y))}static fromBytes(t,n=!1){let r=Ge,i=tt($e(t,qe)),a=t[31];i[31]=a&-129;let o=Tt(i);ft(o,0n,n?bt:Be);let s=W(o*o),{isValid:c,value:l}=kt(pt(s-1n),W(r*s+1n));c||Ye(`bad point: y not sqrt`);let u=(l&1n)==1n,d=(a&128)!=0;return!n&&l===0n&&d&&Ye(`bad point: x==0, isLastByteOdd`),d!==u&&(l=pt(-l)),new e(l,o,1n,W(l*o))}static fromHex(t,n){return e.fromBytes(ot(t),n)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}assertValidity(){let e=We,t=Ge,n=this;if(n.is0())return Ye(`bad point: ZERO`);let{X:r,Y:i,Z:a,T:o}=n,s=W(r*r),c=W(i*i),l=W(a*a),u=W(l*l);return W(l*(W(s*e)+c))===pt(u+W(t*W(s*c)))?W(r*i)===W(a*o)?this:Ye(`bad point: equation left != right (2)`):Ye(`bad point: equation left != right (1)`)}equals(e){let{X:t,Y:n,Z:r}=this,{X:i,Y:a,Z:o}=yt(e),s=W(t*o),c=W(i*r),l=W(n*o),u=W(a*r);return s===c&&l===u}is0(){return this.equals(Ct)}negate(){return new e(pt(-this.X),this.Y,this.Z,pt(-this.T))}double(){let{X:t,Y:n,Z:r}=this,i=We,a=W(t*t),o=W(n*n),s=W(2n*r*r),c=W(i*a),l=pt(t+n),u=pt(W(l*l)-a-o),d=pt(c+o),f=pt(d-s),p=pt(c-o),m=W(u*f),h=W(d*p),g=W(u*p);return new e(m,h,W(f*d),g)}add(t){let{X:n,Y:r,Z:i,T:a}=this,{X:o,Y:s,Z:c,T:l}=yt(t),u=We,d=Ge,f=W(n*o),p=W(r*s),m=W(W(a*d)*l),h=W(i*c),g=pt(W(pt(n+r)*pt(o+s))-f-p),_=pt(h-m),v=pt(h+m),y=pt(p-W(u*f)),b=W(g*_),x=W(v*y),S=W(g*y);return new e(b,x,W(_*v),S)}subtract(e){return this.add(yt(e).negate())}multiply(e,t=!0){if(!t&&e===0n||(ft(e,1n,Ve),!t&&this.is0()))return Ct;if(e===1n)return this;if(this.equals(St))return Jt(e).p;let n=Ct,r=St;for(let i=this;e>0n;i=i.double(),e>>=1n)e&1n?n=n.add(i):t&&(r=r.add(i));return n}multiplyUnsafe(e){return this.multiply(e,!1)}toAffine(){let{X:e,Y:t,Z:n}=this;if(this.equals(Ct))return{x:0n,y:1n};let r=gt(n,Be);return W(n*r)!==1n&&Ye(`invalid inverse`),{x:W(e*r),y:W(t*r)}}toBytes(){let{x:e,y:t}=this.toAffine(),n=wt(t);return n[31]|=e&1n?128:0,n}toHex(){return rt(this.toBytes())}clearCofactor(){return this.multiply(dt(Ke),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let e=this.multiply(Ve/2n,!1).double();return Ve%2n&&(e=e.add(this)),e.is0()}},St=new xt(He,Ue,1n,pt(He*Ue)),Ct=new xt(0n,1n,1n,0n);xt.BASE=St,xt.ZERO=Ct;var wt=e=>ot(nt(ft(e,0n,bt),64)).reverse(),Tt=e=>dt(`0x`+rt(tt($e(e)).reverse())),Et=(e,t)=>{let n=e;for(;t-- >0n;)n=W(n*n);return n},Dt=e=>{let t=W(W(e*e)*e),n=W(Et(W(Et(t,2n)*t),1n)*e),r=W(Et(n,5n)*n),i=W(Et(r,10n)*r),a=W(Et(i,20n)*i),o=W(Et(a,40n)*a);return{pow_p_5_8:W(Et(W(Et(W(Et(W(Et(o,80n)*o),80n)*o),10n)*r),2n)*e),b2:t}},Ot=19681161376707505956807079304988542015446066515923890162744021073123829784752n,kt=(e,t)=>{let n=W(t*W(t*t)),r=Dt(W(e*W(W(n*n)*t))).pow_p_5_8,i=W(e*W(n*r)),a=W(t*W(i*i)),o=i,s=W(i*Ot),c=a===e,l=a===pt(-e),u=a===pt(-e*Ot);return c&&(i=o),(l||u)&&(i=s),(pt(i)&1n)==1n&&(i=pt(-i)),{isValid:c||l,value:i}},At=e=>ht(Tt(e)),jt=(...e)=>Promise.resolve(_t(`sha512Async`)(lt(...e))).then(vt),Mt=(...e)=>vt(_t(`sha512`)(lt(...e))),Nt=e=>{let t=tt(e),n=t.slice(0,32);n[0]&=248,n[31]&=127,n[31]|=64;let r=t.slice(32,64),i=At(n),a=St.multiply(i);return{head:n,prefix:r,scalar:i,point:a,pointBytes:a.toBytes()}},Pt=e=>jt($e(e,qe)).then(Nt),Ft=e=>Nt(Mt($e(e,qe))),It=e=>Pt(e).then(e=>e.pointBytes),Lt=e=>jt(e.hashable).then(e.finish),Rt=(e,t,n)=>{let{pointBytes:r,scalar:i}=e,a=At(t),o=St.multiply(a).toBytes();return{hashable:lt(o,r,n),finish:e=>$e(lt(o,wt(ht(a+At(e)*i))),64)}},zt=async(e,t)=>{let n=$e(e),r=await Pt(t);return Lt(Rt(r,await jt(r.prefix,n),n))},Bt={sha512Async:async e=>{let t=ct(),n=lt(e);return et(await t.digest(`SHA-512`,n.buffer))},sha512:void 0},Vt=Object.freeze({getExtendedPublicKeyAsync:Pt,getExtendedPublicKey:Ft,randomSecretKey:e=>(e=e===void 0?ut(qe):e,$e(e,qe))}),Ht=8,Ut=Math.ceil(256/Ht)+1,Wt=2**(Ht-1),Gt=()=>{let e=[],t=St,n=t;for(let r=0;r<Ut;r++){n=t,e.push(n);for(let r=1;r<Wt;r++)n=n.add(t),e.push(n);t=n.double()}return e},Kt=void 0,qt=(e,t)=>{let n=t.negate();return e?n:t},Jt=e=>{let t=Kt||=Gt(),n=Ct,r=St,i=2**Ht,a=i,o=dt(i-1),s=dt(Ht);for(let i=0;i<Ut;i++){let c=Number(e&o);e>>=s,c>Wt&&(c-=a,e+=1n);let l=i*Wt,u=l,d=l+Math.abs(c)-1,f=i%2!=0,p=c<0;c===0?r=r.add(qt(f,t[u])):n=n.add(qt(p,t[d]))}return e!==0n&&Ye(`invalid wnaf`),{p:n,f:r}},Yt=`genesis-device-identity-v1`;function Xt(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/g,``)}function Zt(e){let t=e.replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=t+`=`.repeat((4-t.length%4)%4),r=atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e+=1)i[e]=r.charCodeAt(e);return i}function Qt(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function $t(e){let t=await crypto.subtle.digest(`SHA-256`,e.slice().buffer);return Qt(new Uint8Array(t))}async function en(){let e=Vt.randomSecretKey(),t=await It(e);return{deviceId:await $t(t),publicKey:Xt(t),privateKey:Xt(e)}}async function tn(){let e=m();try{let t=e?.getItem(Yt);if(t){let n=JSON.parse(t);if(n?.version===1&&typeof n.deviceId==`string`&&typeof n.publicKey==`string`&&typeof n.privateKey==`string`){let t=await $t(Zt(n.publicKey));if(t!==n.deviceId){let r={...n,deviceId:t};return e?.setItem(Yt,JSON.stringify(r)),{deviceId:t,publicKey:n.publicKey,privateKey:n.privateKey}}return{deviceId:n.deviceId,publicKey:n.publicKey,privateKey:n.privateKey}}}}catch{}let t=await en(),n={version:1,deviceId:t.deviceId,publicKey:t.publicKey,privateKey:t.privateKey,createdAtMs:Date.now()};return e?.setItem(Yt,JSON.stringify(n)),t}async function nn(e,t){let n=Zt(e);return Xt(await zt(new TextEncoder().encode(t),n))}var rn=!1;function an(e){e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=``;for(let n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,`0`);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function on(){rn||(rn=!0,console.warn(`[uuid] crypto API missing; refusing insecure UUID generation`))}function sn(e=globalThis.crypto){if(e&&typeof e.randomUUID==`function`)return e.randomUUID();if(e&&typeof e.getRandomValues==`function`){let t=new Uint8Array(16);return e.getRandomValues(t),an(t)}throw on(),Error(`Web Crypto is required for UUID generation`)}var cn=class extends Error{constructor(e){super(we({message:e.message,details:e.details})),this.name=`GatewayRequestError`,this.gatewayCode=e.code,this.details=e.details,this.retryable=e.retryable===!0,this.retryAfterMs=e.retryAfterMs}};function ln(e){return B(e?.details)}function un(e){if(!e)return!1;let t=ln(e);return t===L.AUTH_TOKEN_MISSING||t===L.AUTH_BOOTSTRAP_TOKEN_INVALID||t===L.AUTH_PASSWORD_MISSING||t===L.AUTH_PASSWORD_MISMATCH||t===L.AUTH_RATE_LIMITED||t===L.PAIRING_REQUIRED||t===L.CONTROL_UI_DEVICE_IDENTITY_REQUIRED||t===L.DEVICE_IDENTITY_REQUIRED}function dn(e){try{let t=new URL(e,window.location.href),n=t.hostname.trim().toLowerCase(),r=n===`localhost`||n===`::1`||n===`[::1]`||n===`127.0.0.1`,i=n.startsWith(`127.`);if(r||i)return!0;let a=new URL(window.location.href);return t.host===a.host}catch{return!1}}var fn=`operator`,pn=[`operator.admin`,`operator.read`,`operator.write`,`operator.approvals`,`operator.pairing`],mn=4008,hn=1e4;function gn(e){let t=e.authToken;if(t||e.authPassword)return{token:t,deviceToken:e.authDeviceToken??e.resolvedDeviceToken,password:e.authPassword}}async function _n(e){let{deviceIdentity:t}=e;if(!t)return;let n=Date.now(),r=e.connectNonce??``,i=Te({deviceId:t.deviceId,clientId:e.client.id,clientMode:e.client.mode,role:e.role,scopes:e.scopes,signedAtMs:n,token:e.authToken??null,nonce:r}),a=await nn(t.privateKey,i);return{id:t.deviceId,publicKey:t.publicKey,signature:a,signedAt:n,nonce:r}}function vn(e){return!e.deviceTokenRetryBudgetUsed&&!e.authDeviceToken&&!!e.explicitGatewayToken&&!!e.deviceIdentity&&!!e.storedToken&&e.canRetryWithDeviceTokenHint&&dn(e.url)}var yn=class{constructor(e){this.opts=e,this.ws=null,this.pending=new Map,this.closed=!1,this.lastSeq=null,this.connectNonce=null,this.connectSent=!1,this.connectTimer=null,this.backoffMs=800,this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.eventListeners=new Set}start(){this.closed=!1,this.connect()}stop(){this.closed=!0,this.clearConnectTimer(),this.ws?.close(),this.ws=null,this.pendingConnectError=void 0,this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.flushPending(Error(`gateway client stopped`))}get connected(){return this.ws?.readyState===WebSocket.OPEN}connect(){this.closed||(this.ws=new WebSocket(this.opts.url),this.ws.addEventListener(`open`,()=>this.queueConnect()),this.ws.addEventListener(`message`,e=>this.handleMessage(String(e.data??``))),this.ws.addEventListener(`close`,e=>{let t=e.reason??``,n=this.pendingConnectError;this.pendingConnectError=void 0,this.ws=null,this.flushPending(Error(`gateway closed (${e.code}): ${t}`)),this.opts.onClose?.({code:e.code,reason:t,error:n}),!(ln(n)===L.AUTH_TOKEN_MISMATCH&&this.deviceTokenRetryBudgetUsed&&!this.pendingDeviceTokenRetry)&&(un(n)||this.scheduleReconnect())}),this.ws.addEventListener(`error`,()=>{}))}scheduleReconnect(){if(this.closed)return;let e=this.backoffMs;this.backoffMs=Math.min(this.backoffMs*1.7,15e3),this.clearConnectTimer(),this.connectTimer=window.setTimeout(()=>{this.connectTimer=null,this.connect()},e)}flushPending(e){for(let[,t]of this.pending)t.timeout!==null&&window.clearTimeout(t.timeout),t.reject(e);this.pending.clear()}buildConnectClient(){return{id:this.opts.clientName??Ee.CONTROL_UI,version:this.opts.clientVersion??`control-ui`,platform:this.opts.platform??navigator.platform??`web`,mode:this.opts.mode??De.WEBCHAT,instanceId:this.opts.instanceId}}buildConnectParams(e){return{minProtocol:4,maxProtocol:4,client:e.client,role:e.role,scopes:e.scopes,device:e.device,caps:[`tool-events`,`chat-incremental`],auth:e.auth,userAgent:navigator.userAgent,locale:navigator.language}}async buildConnectPlan(){let e=fn,t=[...pn],n=this.buildConnectClient(),r=this.opts.token?.trim()||void 0,i=this.opts.password?.trim()||void 0,a=typeof crypto<`u`&&!!crypto.subtle,o=null,s={authToken:r,authPassword:i,canFallbackToShared:!1};return a&&(o=await tn(),s=this.selectConnectAuth({role:e,deviceId:o.deviceId}),this.pendingDeviceTokenRetry&&s.authDeviceToken&&(this.pendingDeviceTokenRetry=!1)),{role:e,scopes:t,client:n,explicitGatewayToken:r,selectedAuth:s,auth:gn(s),deviceIdentity:o,device:await _n({deviceIdentity:o,client:n,role:e,scopes:t,authToken:s.authToken,connectNonce:this.connectNonce})}}handleConnectHello(e,t){this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,e?.auth?.deviceToken&&t.deviceIdentity&&Le({deviceId:t.deviceIdentity.deviceId,role:e.auth.role??t.role,token:e.auth.deviceToken,scopes:e.auth.scopes??[]}),this.backoffMs=800,this.opts.onHello?.(e)}handleConnectFailure(e,t){let n=e instanceof cn?ln(e):null,r=e instanceof cn?ge(e.details):{},i=r.recommendedNextStep===`retry_with_device_token`,a=r.canRetryWithDeviceToken===!0||i||n===L.AUTH_TOKEN_MISMATCH;vn({deviceTokenRetryBudgetUsed:this.deviceTokenRetryBudgetUsed,authDeviceToken:t.selectedAuth.authDeviceToken,explicitGatewayToken:t.explicitGatewayToken,deviceIdentity:t.deviceIdentity,storedToken:t.selectedAuth.storedToken,canRetryWithDeviceTokenHint:a,url:this.opts.url})&&(this.pendingDeviceTokenRetry=!0,this.deviceTokenRetryBudgetUsed=!0),e instanceof cn?this.pendingConnectError={code:e.gatewayCode,message:e.message,details:e.details,retryable:e.retryable,retryAfterMs:e.retryAfterMs}:this.pendingConnectError=void 0,t.selectedAuth.canFallbackToShared&&t.deviceIdentity&&n===L.AUTH_DEVICE_TOKEN_MISMATCH&&Re({deviceId:t.deviceIdentity.deviceId,role:t.role}),this.ws?.close(mn,`connect failed`)}async sendConnect(){if(this.connectSent)return;this.connectSent=!0,this.clearConnectTimer();let e=await this.buildConnectPlan();this.request(`connect`,this.buildConnectParams(e),{timeoutMs:hn}).then(t=>this.handleConnectHello(t,e)).catch(t=>this.handleConnectFailure(t,e))}handleMessage(e){let t;try{t=JSON.parse(e)}catch{return}let n=t;if(n.type===`event`){let e=t;if(e.event===`connect.challenge`){let t=e.payload,n=t&&typeof t.nonce==`string`?t.nonce:null;n&&(this.connectNonce=n,this.sendConnect());return}let n=typeof e.seq==`number`?e.seq:null;n!==null&&(this.lastSeq!==null&&n>this.lastSeq+1&&this.opts.onGap?.({expected:this.lastSeq+1,received:n}),this.lastSeq=n);try{this.opts.onEvent?.(e);for(let t of this.eventListeners)t(e)}catch(e){console.error(`[gateway] event handler error:`,e)}return}if(n.type===`res`){let e=t,n=this.pending.get(e.id);if(!n)return;this.pending.delete(e.id),n.timeout!==null&&window.clearTimeout(n.timeout),e.ok?n.resolve(e.payload):n.reject(new cn({code:e.error?.code??`UNAVAILABLE`,message:e.error?.message??`request failed`,details:e.error?.details,retryable:e.error?.retryable,retryAfterMs:e.error?.retryAfterMs}));return}}selectConnectAuth(e){let t=this.opts.token?.trim()||void 0,n=this.opts.password?.trim()||void 0,r=Ie({deviceId:e.deviceId,role:e.role}),i=r?.scopes??[],a=e.role!==`operator`||i.includes(`operator.read`)||i.includes(`operator.write`)||i.includes(`operator.admin`)?r?.token:void 0,o=this.pendingDeviceTokenRetry&&!!t&&!!a&&dn(this.opts.url),s=t||n?void 0:a??void 0;return{authToken:t??s,authDeviceToken:o?a??void 0:void 0,authPassword:n,resolvedDeviceToken:s,storedToken:a??void 0,canFallbackToShared:!!(a&&t)}}request(e,t,n){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)return Promise.reject(Error(`gateway not connected`));let r=sn(),i={type:`req`,id:r,method:e,params:t},a=new Promise((t,i)=>{let a=n?.timeoutMs===null?null:typeof n?.timeoutMs==`number`&&Number.isFinite(n.timeoutMs)?window.setTimeout(()=>{this.pending.delete(r),i(Error(`gateway request timeout for ${e}`))},Math.max(1,n.timeoutMs)):null;this.pending.set(r,{resolve:e=>t(e),reject:i,timeout:a})});return this.ws.send(JSON.stringify(i)),a}addEventListener(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e)}}queueConnect(){this.connectNonce=null,this.connectSent=!1,this.clearConnectTimer(),this.connectTimer=window.setTimeout(()=>{this.connectTimer=null,this.sendConnect()},750)}clearConnectTimer(){this.connectTimer!==null&&(window.clearTimeout(this.connectTimer),this.connectTimer=null)}};function bn(e){return e instanceof cn?ln(e)===L.AUTH_UNAUTHORIZED?!0:e.message.includes(`missing scope: operator.read`):!1}function xn(e){return`This connection is missing operator.read, so ${e} cannot be loaded yet.`}async function Sn(e,t){if(!(!e.client||!e.connected)&&!e.channelsLoading){e.channelsLoading=!0,e.channelsError=null;try{e.channelsSnapshot=await e.client.request(`channels.status`,{probe:t,timeoutMs:8e3}),e.channelsLastSuccess=Date.now()}catch(t){bn(t)?(e.channelsSnapshot=null,e.channelsError=xn(`channel status`)):e.channelsError=String(t)}finally{e.channelsLoading=!1}}}async function Cn(e,t){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{let n=await e.client.request(`web.login.start`,{force:t,timeoutMs:3e4});e.whatsappLoginMessage=n.message??null,e.whatsappLoginQrDataUrl=n.qrDataUrl??null,e.whatsappLoginConnected=typeof n.connected==`boolean`?n.connected:null}catch(t){e.whatsappLoginMessage=String(t),e.whatsappLoginQrDataUrl=null,e.whatsappLoginConnected=null}finally{e.whatsappBusy=!1}}}async function wn(e){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{let t=await e.client.request(`web.login.wait`,{timeoutMs:12e4,currentQrDataUrl:e.whatsappLoginQrDataUrl??void 0});e.whatsappLoginMessage=t.message??null,e.whatsappLoginConnected=t.connected??null,t.qrDataUrl?e.whatsappLoginQrDataUrl=t.qrDataUrl:t.connected&&(e.whatsappLoginQrDataUrl=null)}catch(t){e.whatsappLoginMessage=String(t),e.whatsappLoginConnected=null}finally{e.whatsappBusy=!1}}}async function Tn(e){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{await e.client.request(`channels.logout`,{channel:`whatsapp`}),e.whatsappLoginMessage=`Logged out.`,e.whatsappLoginQrDataUrl=null,e.whatsappLoginConnected=null}catch(t){e.whatsappLoginMessage=String(t)}finally{e.whatsappBusy=!1}}}var En=j(k(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.JSON5=r()})(e,(function(){function e(e,t){return t={exports:{}},e(t,t.exports),t.exports}var t=e(function(e){var t=e.exports=typeof window<`u`&&window.Math==Math?window:typeof self<`u`&&self.Math==Math?self:Function(`return this`)();typeof __g==`number`&&(__g=t)}),n=e(function(e){var t=e.exports={version:`2.6.5`};typeof __e==`number`&&(__e=t)});n.version;var r=function(e){return typeof e==`object`?e!==null:typeof e==`function`},i=function(e){if(!r(e))throw TypeError(e+` is not an object!`);return e},a=function(e){try{return!!e()}catch{return!0}},o=!a(function(){return Object.defineProperty({},`a`,{get:function(){return 7}}).a!=7}),s=t.document,c=r(s)&&r(s.createElement),l=function(e){return c?s.createElement(e):{}},u=!o&&!a(function(){return Object.defineProperty(l(`div`),`a`,{get:function(){return 7}}).a!=7}),d=function(e,t){if(!r(e))return e;var n,i;if(t&&typeof(n=e.toString)==`function`&&!r(i=n.call(e))||typeof(n=e.valueOf)==`function`&&!r(i=n.call(e))||!t&&typeof(n=e.toString)==`function`&&!r(i=n.call(e)))return i;throw TypeError(`Can't convert object to primitive value`)},f=Object.defineProperty,p={f:o?Object.defineProperty:function(e,t,n){if(i(e),t=d(t,!0),i(n),u)try{return f(e,t,n)}catch{}if(`get`in n||`set`in n)throw TypeError(`Accessors not supported!`);return`value`in n&&(e[t]=n.value),e}},m=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},h=o?function(e,t,n){return p.f(e,t,m(1,n))}:function(e,t,n){return e[t]=n,e},g={}.hasOwnProperty,_=function(e,t){return g.call(e,t)},v=0,y=Math.random(),b=function(e){return`Symbol(${e===void 0?``:e})_${(++v+y).toString(36)}`},x=!1,S=e(function(e){var r=`__core-js_shared__`,i=t[r]||(t[r]={});(e.exports=function(e,t){return i[e]||(i[e]=t===void 0?{}:t)})(`versions`,[]).push({version:n.version,mode:x?`pure`:`global`,copyright:`© 2019 Denis Pushkarev (zloirock.ru)`})})(`native-function-to-string`,Function.toString),ee=e(function(e){var r=b(`src`),i=`toString`,a=(``+S).split(i);n.inspectSource=function(e){return S.call(e)},(e.exports=function(e,n,i,o){var s=typeof i==`function`;s&&(_(i,`name`)||h(i,`name`,n)),e[n]!==i&&(s&&(_(i,r)||h(i,r,e[n]?``+e[n]:a.join(String(n)))),e===t?e[n]=i:o?e[n]?e[n]=i:h(e,n,i):(delete e[n],h(e,n,i)))})(Function.prototype,i,function(){return typeof this==`function`&&this[r]||S.call(this)})}),C=function(e){if(typeof e!=`function`)throw TypeError(e+` is not a function!`);return e},te=function(e,t,n){if(C(e),t===void 0)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},ne=`prototype`,w=function(e,r,i){var a=e&w.F,o=e&w.G,s=e&w.S,c=e&w.P,l=e&w.B,u=o?t:s?t[r]||(t[r]={}):(t[r]||{})[ne],d=o?n:n[r]||(n[r]={}),f=d[ne]||(d[ne]={}),p,m,g,_;for(p in o&&(i=r),i)m=!a&&u&&u[p]!==void 0,g=(m?u:i)[p],_=l&&m?te(g,t):c&&typeof g==`function`?te(Function.call,g):g,u&&ee(u,p,g,e&w.U),d[p]!=g&&h(d,p,_),c&&f[p]!=g&&(f[p]=g)};t.core=n,w.F=1,w.G=2,w.S=4,w.P=8,w.B=16,w.W=32,w.U=64,w.R=128;var re=w,T=Math.ceil,ie=Math.floor,ae=function(e){return isNaN(e=+e)?0:(e>0?ie:T)(e)},E=function(e){if(e==null)throw TypeError(`Can't call method on `+e);return e},D=function(e){return function(t,n){var r=String(E(t)),i=ae(n),a=r.length,o,s;return i<0||i>=a?e?``:void 0:(o=r.charCodeAt(i),o<55296||o>56319||i+1===a||(s=r.charCodeAt(i+1))<56320||s>57343?e?r.charAt(i):o:e?r.slice(i,i+2):(o-55296<<10)+(s-56320)+65536)}}(!1);re(re.P,`String`,{codePointAt:function(e){return D(this,e)}}),n.String.codePointAt;var O=Math.max,oe=Math.min,k=function(e,t){return e=ae(e),e<0?O(e+t,0):oe(e,t)},A=String.fromCharCode,se=String.fromCodePoint;re(re.S+re.F*(!!se&&se.length!=1),`String`,{fromCodePoint:function(e){for(var t=arguments,n=[],r=arguments.length,i=0,a;r>i;){if(a=+t[i++],k(a,1114111)!==a)throw RangeError(a+` is not a valid code point`);n.push(a<65536?A(a):A(((a-=65536)>>10)+55296,a%1024+56320))}return n.join(``)}}),n.String.fromCodePoint;var j={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},M={isSpaceSeparator:function(e){return typeof e==`string`&&j.Space_Separator.test(e)},isIdStartChar:function(e){return typeof e==`string`&&(e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e===`$`||e===`_`||j.ID_Start.test(e))},isIdContinueChar:function(e){return typeof e==`string`&&(e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`$`||e===`_`||e===`‌`||e===`‍`||j.ID_Continue.test(e))},isDigit:function(e){return typeof e==`string`&&/[0-9]/.test(e)},isHexDigit:function(e){return typeof e==`string`&&/[0-9A-Fa-f]/.test(e)}},N,ce,P,F,I,le,ue,de,L,fe=function(e,t){N=String(e),ce=`start`,P=[],F=0,I=1,le=0,ue=void 0,de=void 0,L=void 0;do ue=ge(),Ce[ce]();while(ue.type!==`eof`);return typeof t==`function`?pe({"":L},``,t):L};function pe(e,t,n){var r=e[t];if(typeof r==`object`&&r)if(Array.isArray(r))for(var i=0;i<r.length;i++){var a=String(i),o=pe(r,a,n);o===void 0?delete r[a]:Object.defineProperty(r,a,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(var s in r){var c=pe(r,s,n);c===void 0?delete r[s]:Object.defineProperty(r,s,{value:c,writable:!0,enumerable:!0,configurable:!0})}return n.call(e,t,r)}var R,z,me,he,B;function ge(){for(R=`default`,z=``,me=!1,he=1;;){B=_e();var e=ve[R]();if(e)return e}}function _e(){if(N[F])return String.fromCodePoint(N.codePointAt(F))}function V(){var e=_e();return e===`
3
3
  `?(I++,le=0):e?le+=e.length:le++,e&&(F+=e.length),e}var ve={default:function(){switch(B){case` `:case`\v`:case`\f`:case` `:case`\xA0`:case``:case`
4
- `:case`\r`:case`\u2028`:case`\u2029`:V();return;case`/`:V(),R=`comment`;return;case void 0:return V(),H(`eof`)}if(N.isSpaceSeparator(B)){V();return}return ve[ce]()},comment:function(){switch(B){case`*`:V(),R=`multiLineComment`;return;case`/`:V(),R=`singleLineComment`;return}throw U(V())},multiLineComment:function(){switch(B){case`*`:V(),R=`multiLineCommentAsterisk`;return;case void 0:throw U(V())}V()},multiLineCommentAsterisk:function(){switch(B){case`*`:V();return;case`/`:V(),R=`default`;return;case void 0:throw U(V())}V(),R=`multiLineComment`},singleLineComment:function(){switch(B){case`
5
- `:case`\r`:case`\u2028`:case`\u2029`:V(),R=`default`;return;case void 0:return V(),H(`eof`)}V()},value:function(){switch(B){case`{`:case`[`:return H(`punctuator`,V());case`n`:return V(),ye(`ull`),H(`null`,null);case`t`:return V(),ye(`rue`),H(`boolean`,!0);case`f`:return V(),ye(`alse`),H(`boolean`,!1);case`-`:case`+`:V()===`-`&&(he=-1),R=`sign`;return;case`.`:z=V(),R=`decimalPointLeading`;return;case`0`:z=V(),R=`zero`;return;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:z=V(),R=`decimalInteger`;return;case`I`:return V(),ye(`nfinity`),H(`numeric`,1/0);case`N`:return V(),ye(`aN`),H(`numeric`,NaN);case`"`:case`'`:me=V()===`"`,z=``,R=`string`;return}throw U(V())},identifierNameStartEscape:function(){if(B!==`u`)throw U(V());V();var e=Se();switch(e){case`$`:case`_`:break;default:if(!N.isIdStartChar(e))throw De();break}z+=e,R=`identifierName`},identifierName:function(){switch(B){case`$`:case`_`:case`‌`:case`‍`:z+=V();return;case`\\`:V(),R=`identifierNameEscape`;return}if(N.isIdContinueChar(B)){z+=V();return}return H(`identifier`,z)},identifierNameEscape:function(){if(B!==`u`)throw U(V());V();var e=Se();switch(e){case`$`:case`_`:case`‌`:case`‍`:break;default:if(!N.isIdContinueChar(e))throw De();break}z+=e,R=`identifierName`},sign:function(){switch(B){case`.`:z=V(),R=`decimalPointLeading`;return;case`0`:z=V(),R=`zero`;return;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:z=V(),R=`decimalInteger`;return;case`I`:return V(),ye(`nfinity`),H(`numeric`,he*(1/0));case`N`:return V(),ye(`aN`),H(`numeric`,NaN)}throw U(V())},zero:function(){switch(B){case`.`:z+=V(),R=`decimalPoint`;return;case`e`:case`E`:z+=V(),R=`decimalExponent`;return;case`x`:case`X`:z+=V(),R=`hexadecimal`;return}return H(`numeric`,he*0)},decimalInteger:function(){switch(B){case`.`:z+=V(),R=`decimalPoint`;return;case`e`:case`E`:z+=V(),R=`decimalExponent`;return}if(N.isDigit(B)){z+=V();return}return H(`numeric`,he*Number(z))},decimalPointLeading:function(){if(N.isDigit(B)){z+=V(),R=`decimalFraction`;return}throw U(V())},decimalPoint:function(){switch(B){case`e`:case`E`:z+=V(),R=`decimalExponent`;return}if(N.isDigit(B)){z+=V(),R=`decimalFraction`;return}return H(`numeric`,he*Number(z))},decimalFraction:function(){switch(B){case`e`:case`E`:z+=V(),R=`decimalExponent`;return}if(N.isDigit(B)){z+=V();return}return H(`numeric`,he*Number(z))},decimalExponent:function(){switch(B){case`+`:case`-`:z+=V(),R=`decimalExponentSign`;return}if(N.isDigit(B)){z+=V(),R=`decimalExponentInteger`;return}throw U(V())},decimalExponentSign:function(){if(N.isDigit(B)){z+=V(),R=`decimalExponentInteger`;return}throw U(V())},decimalExponentInteger:function(){if(N.isDigit(B)){z+=V();return}return H(`numeric`,he*Number(z))},hexadecimal:function(){if(N.isHexDigit(B)){z+=V(),R=`hexadecimalInteger`;return}throw U(V())},hexadecimalInteger:function(){if(N.isHexDigit(B)){z+=V();return}return H(`numeric`,he*Number(z))},string:function(){switch(B){case`\\`:V(),z+=be();return;case`"`:if(me)return V(),H(`string`,z);z+=V();return;case`'`:if(!me)return V(),H(`string`,z);z+=V();return;case`
6
- `:case`\r`:throw U(V());case`\u2028`:case`\u2029`:Oe(B);break;case void 0:throw U(V())}z+=V()},start:function(){switch(B){case`{`:case`[`:return H(`punctuator`,V())}R=`value`},beforePropertyName:function(){switch(B){case`$`:case`_`:z=V(),R=`identifierName`;return;case`\\`:V(),R=`identifierNameStartEscape`;return;case`}`:return H(`punctuator`,V());case`"`:case`'`:me=V()===`"`,R=`string`;return}if(N.isIdStartChar(B)){z+=V(),R=`identifierName`;return}throw U(V())},afterPropertyName:function(){if(B===`:`)return H(`punctuator`,V());throw U(V())},beforePropertyValue:function(){R=`value`},afterPropertyValue:function(){switch(B){case`,`:case`}`:return H(`punctuator`,V())}throw U(V())},beforeArrayValue:function(){if(B===`]`)return H(`punctuator`,V());R=`value`},afterArrayValue:function(){switch(B){case`,`:case`]`:return H(`punctuator`,V())}throw U(V())},end:function(){throw U(V())}};function H(e,t){return{type:e,value:t,line:I,column:le}}function ye(e){for(var t=0,n=e;t<n.length;t+=1){var r=n[t];if(_e()!==r)throw U(V());V()}}function be(){switch(_e()){case`b`:return V(),`\b`;case`f`:return V(),`\f`;case`n`:return V(),`
7
- `;case`r`:return V(),`\r`;case`t`:return V(),` `;case`v`:return V(),`\v`;case`0`:if(V(),N.isDigit(_e()))throw U(V());return`\0`;case`x`:return V(),xe();case`u`:return V(),Se();case`
4
+ `:case`\r`:case`\u2028`:case`\u2029`:V();return;case`/`:V(),R=`comment`;return;case void 0:return V(),H(`eof`)}if(M.isSpaceSeparator(B)){V();return}return ve[ce]()},comment:function(){switch(B){case`*`:V(),R=`multiLineComment`;return;case`/`:V(),R=`singleLineComment`;return}throw U(V())},multiLineComment:function(){switch(B){case`*`:V(),R=`multiLineCommentAsterisk`;return;case void 0:throw U(V())}V()},multiLineCommentAsterisk:function(){switch(B){case`*`:V();return;case`/`:V(),R=`default`;return;case void 0:throw U(V())}V(),R=`multiLineComment`},singleLineComment:function(){switch(B){case`
5
+ `:case`\r`:case`\u2028`:case`\u2029`:V(),R=`default`;return;case void 0:return V(),H(`eof`)}V()},value:function(){switch(B){case`{`:case`[`:return H(`punctuator`,V());case`n`:return V(),ye(`ull`),H(`null`,null);case`t`:return V(),ye(`rue`),H(`boolean`,!0);case`f`:return V(),ye(`alse`),H(`boolean`,!1);case`-`:case`+`:V()===`-`&&(he=-1),R=`sign`;return;case`.`:z=V(),R=`decimalPointLeading`;return;case`0`:z=V(),R=`zero`;return;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:z=V(),R=`decimalInteger`;return;case`I`:return V(),ye(`nfinity`),H(`numeric`,1/0);case`N`:return V(),ye(`aN`),H(`numeric`,NaN);case`"`:case`'`:me=V()===`"`,z=``,R=`string`;return}throw U(V())},identifierNameStartEscape:function(){if(B!==`u`)throw U(V());V();var e=Se();switch(e){case`$`:case`_`:break;default:if(!M.isIdStartChar(e))throw De();break}z+=e,R=`identifierName`},identifierName:function(){switch(B){case`$`:case`_`:case`‌`:case`‍`:z+=V();return;case`\\`:V(),R=`identifierNameEscape`;return}if(M.isIdContinueChar(B)){z+=V();return}return H(`identifier`,z)},identifierNameEscape:function(){if(B!==`u`)throw U(V());V();var e=Se();switch(e){case`$`:case`_`:case`‌`:case`‍`:break;default:if(!M.isIdContinueChar(e))throw De();break}z+=e,R=`identifierName`},sign:function(){switch(B){case`.`:z=V(),R=`decimalPointLeading`;return;case`0`:z=V(),R=`zero`;return;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:z=V(),R=`decimalInteger`;return;case`I`:return V(),ye(`nfinity`),H(`numeric`,he*(1/0));case`N`:return V(),ye(`aN`),H(`numeric`,NaN)}throw U(V())},zero:function(){switch(B){case`.`:z+=V(),R=`decimalPoint`;return;case`e`:case`E`:z+=V(),R=`decimalExponent`;return;case`x`:case`X`:z+=V(),R=`hexadecimal`;return}return H(`numeric`,he*0)},decimalInteger:function(){switch(B){case`.`:z+=V(),R=`decimalPoint`;return;case`e`:case`E`:z+=V(),R=`decimalExponent`;return}if(M.isDigit(B)){z+=V();return}return H(`numeric`,he*Number(z))},decimalPointLeading:function(){if(M.isDigit(B)){z+=V(),R=`decimalFraction`;return}throw U(V())},decimalPoint:function(){switch(B){case`e`:case`E`:z+=V(),R=`decimalExponent`;return}if(M.isDigit(B)){z+=V(),R=`decimalFraction`;return}return H(`numeric`,he*Number(z))},decimalFraction:function(){switch(B){case`e`:case`E`:z+=V(),R=`decimalExponent`;return}if(M.isDigit(B)){z+=V();return}return H(`numeric`,he*Number(z))},decimalExponent:function(){switch(B){case`+`:case`-`:z+=V(),R=`decimalExponentSign`;return}if(M.isDigit(B)){z+=V(),R=`decimalExponentInteger`;return}throw U(V())},decimalExponentSign:function(){if(M.isDigit(B)){z+=V(),R=`decimalExponentInteger`;return}throw U(V())},decimalExponentInteger:function(){if(M.isDigit(B)){z+=V();return}return H(`numeric`,he*Number(z))},hexadecimal:function(){if(M.isHexDigit(B)){z+=V(),R=`hexadecimalInteger`;return}throw U(V())},hexadecimalInteger:function(){if(M.isHexDigit(B)){z+=V();return}return H(`numeric`,he*Number(z))},string:function(){switch(B){case`\\`:V(),z+=be();return;case`"`:if(me)return V(),H(`string`,z);z+=V();return;case`'`:if(!me)return V(),H(`string`,z);z+=V();return;case`
6
+ `:case`\r`:throw U(V());case`\u2028`:case`\u2029`:Oe(B);break;case void 0:throw U(V())}z+=V()},start:function(){switch(B){case`{`:case`[`:return H(`punctuator`,V())}R=`value`},beforePropertyName:function(){switch(B){case`$`:case`_`:z=V(),R=`identifierName`;return;case`\\`:V(),R=`identifierNameStartEscape`;return;case`}`:return H(`punctuator`,V());case`"`:case`'`:me=V()===`"`,R=`string`;return}if(M.isIdStartChar(B)){z+=V(),R=`identifierName`;return}throw U(V())},afterPropertyName:function(){if(B===`:`)return H(`punctuator`,V());throw U(V())},beforePropertyValue:function(){R=`value`},afterPropertyValue:function(){switch(B){case`,`:case`}`:return H(`punctuator`,V())}throw U(V())},beforeArrayValue:function(){if(B===`]`)return H(`punctuator`,V());R=`value`},afterArrayValue:function(){switch(B){case`,`:case`]`:return H(`punctuator`,V())}throw U(V())},end:function(){throw U(V())}};function H(e,t){return{type:e,value:t,line:I,column:le}}function ye(e){for(var t=0,n=e;t<n.length;t+=1){var r=n[t];if(_e()!==r)throw U(V());V()}}function be(){switch(_e()){case`b`:return V(),`\b`;case`f`:return V(),`\f`;case`n`:return V(),`
7
+ `;case`r`:return V(),`\r`;case`t`:return V(),` `;case`v`:return V(),`\v`;case`0`:if(V(),M.isDigit(_e()))throw U(V());return`\0`;case`x`:return V(),xe();case`u`:return V(),Se();case`
8
8
  `:case`\u2028`:case`\u2029`:return V(),``;case`\r`:return V(),_e()===`
9
- `&&V(),``;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:throw U(V());case void 0:throw U(V())}return V()}function xe(){var e=``,t=_e();if(!N.isHexDigit(t)||(e+=V(),t=_e(),!N.isHexDigit(t)))throw U(V());return e+=V(),String.fromCodePoint(parseInt(e,16))}function Se(){for(var e=``,t=4;t-- >0;){var n=_e();if(!N.isHexDigit(n))throw U(V());e+=V()}return String.fromCodePoint(parseInt(e,16))}var Ce={start:function(){if(ue.type===`eof`)throw Ee();we()},beforePropertyName:function(){switch(ue.type){case`identifier`:case`string`:de=ue.value,ce=`afterPropertyName`;return;case`punctuator`:Te();return;case`eof`:throw Ee()}},afterPropertyName:function(){if(ue.type===`eof`)throw Ee();ce=`beforePropertyValue`},beforePropertyValue:function(){if(ue.type===`eof`)throw Ee();we()},beforeArrayValue:function(){if(ue.type===`eof`)throw Ee();if(ue.type===`punctuator`&&ue.value===`]`){Te();return}we()},afterPropertyValue:function(){if(ue.type===`eof`)throw Ee();switch(ue.value){case`,`:ce=`beforePropertyName`;return;case`}`:Te()}},afterArrayValue:function(){if(ue.type===`eof`)throw Ee();switch(ue.value){case`,`:ce=`beforeArrayValue`;return;case`]`:Te()}},end:function(){}};function we(){var e;switch(ue.type){case`punctuator`:switch(ue.value){case`{`:e={};break;case`[`:e=[];break}break;case`null`:case`boolean`:case`numeric`:case`string`:e=ue.value;break}if(L===void 0)L=e;else{var t=P[P.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,de,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(typeof e==`object`&&e)P.push(e),ce=Array.isArray(e)?`beforeArrayValue`:`beforePropertyName`;else{var n=P[P.length-1];ce=n==null?`end`:Array.isArray(n)?`afterArrayValue`:`afterPropertyValue`}}function Te(){P.pop();var e=P[P.length-1];ce=e==null?`end`:Array.isArray(e)?`afterArrayValue`:`afterPropertyValue`}function U(e){return Ae(e===void 0?`JSON5: invalid end of input at `+I+`:`+le:`JSON5: invalid character '`+ke(e)+`' at `+I+`:`+le)}function Ee(){return Ae(`JSON5: invalid end of input at `+I+`:`+le)}function De(){return le-=5,Ae(`JSON5: invalid identifier character at `+I+`:`+le)}function Oe(e){console.warn(`JSON5: '`+ke(e)+`' in strings is not valid ECMAScript; consider escaping`)}function ke(e){var t={"'":`\\'`,'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`,"\v":`\\v`,"\0":`\\0`,"\u2028":`\\u2028`,"\u2029":`\\u2029`};if(t[e])return t[e];if(e<` `){var n=e.charCodeAt(0).toString(16);return`\\x`+(`00`+n).substring(n.length)}return e}function Ae(e){var t=SyntaxError(e);return t.lineNumber=I,t.columnNumber=le,t}return{parse:fe,stringify:function(e,t,n){var r=[],i=``,a,o,s=``,c;if(typeof t==`object`&&t&&!Array.isArray(t)&&(n=t.space,c=t.quote,t=t.replacer),typeof t==`function`)o=t;else if(Array.isArray(t)){a=[];for(var l=0,u=t;l<u.length;l+=1){var d=u[l],f=void 0;typeof d==`string`?f=d:(typeof d==`number`||d instanceof String||d instanceof Number)&&(f=String(d)),f!==void 0&&a.indexOf(f)<0&&a.push(f)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n==`number`?n>0&&(n=Math.min(10,Math.floor(n)),s=` `.substr(0,n)):typeof n==`string`&&(s=n.substr(0,10)),p(``,{"":e});function p(e,t){var n=t[e];switch(n!=null&&(typeof n.toJSON5==`function`?n=n.toJSON5(e):typeof n.toJSON==`function`&&(n=n.toJSON(e))),o&&(n=o.call(t,e,n)),n instanceof Number?n=Number(n):n instanceof String?n=String(n):n instanceof Boolean&&(n=n.valueOf()),n){case null:return`null`;case!0:return`true`;case!1:return`false`}if(typeof n==`string`)return m(n,!1);if(typeof n==`number`)return String(n);if(typeof n==`object`)return Array.isArray(n)?_(n):h(n)}function m(e){for(var t={"'":.1,'"':.2},n={"'":`\\'`,'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`,"\v":`\\v`,"\0":`\\0`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},r=``,i=0;i<e.length;i++){var a=e[i];switch(a){case`'`:case`"`:t[a]++,r+=a;continue;case`\0`:if(N.isDigit(e[i+1])){r+=`\\x00`;continue}}if(n[a]){r+=n[a];continue}if(a<` `){var o=a.charCodeAt(0).toString(16);r+=`\\x`+(`00`+o).substring(o.length);continue}r+=a}var s=c||Object.keys(t).reduce(function(e,n){return t[e]<t[n]?e:n});return r=r.replace(new RegExp(s,`g`),n[s]),s+r+s}function h(e){if(r.indexOf(e)>=0)throw TypeError(`Converting circular structure to JSON5`);r.push(e);var t=i;i+=s;for(var n=a||Object.keys(e),o=[],c=0,l=n;c<l.length;c+=1){var u=l[c],d=p(u,e);if(d!==void 0){var f=g(u)+`:`;s!==``&&(f+=` `),f+=d,o.push(f)}}var m;if(o.length===0)m=`{}`;else{var h;if(s===``)h=o.join(`,`),m=`{`+h+`}`;else{var _=`,
9
+ `&&V(),``;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:throw U(V());case void 0:throw U(V())}return V()}function xe(){var e=``,t=_e();if(!M.isHexDigit(t)||(e+=V(),t=_e(),!M.isHexDigit(t)))throw U(V());return e+=V(),String.fromCodePoint(parseInt(e,16))}function Se(){for(var e=``,t=4;t-- >0;){var n=_e();if(!M.isHexDigit(n))throw U(V());e+=V()}return String.fromCodePoint(parseInt(e,16))}var Ce={start:function(){if(ue.type===`eof`)throw Ee();we()},beforePropertyName:function(){switch(ue.type){case`identifier`:case`string`:de=ue.value,ce=`afterPropertyName`;return;case`punctuator`:Te();return;case`eof`:throw Ee()}},afterPropertyName:function(){if(ue.type===`eof`)throw Ee();ce=`beforePropertyValue`},beforePropertyValue:function(){if(ue.type===`eof`)throw Ee();we()},beforeArrayValue:function(){if(ue.type===`eof`)throw Ee();if(ue.type===`punctuator`&&ue.value===`]`){Te();return}we()},afterPropertyValue:function(){if(ue.type===`eof`)throw Ee();switch(ue.value){case`,`:ce=`beforePropertyName`;return;case`}`:Te()}},afterArrayValue:function(){if(ue.type===`eof`)throw Ee();switch(ue.value){case`,`:ce=`beforeArrayValue`;return;case`]`:Te()}},end:function(){}};function we(){var e;switch(ue.type){case`punctuator`:switch(ue.value){case`{`:e={};break;case`[`:e=[];break}break;case`null`:case`boolean`:case`numeric`:case`string`:e=ue.value;break}if(L===void 0)L=e;else{var t=P[P.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,de,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(typeof e==`object`&&e)P.push(e),ce=Array.isArray(e)?`beforeArrayValue`:`beforePropertyName`;else{var n=P[P.length-1];ce=n==null?`end`:Array.isArray(n)?`afterArrayValue`:`afterPropertyValue`}}function Te(){P.pop();var e=P[P.length-1];ce=e==null?`end`:Array.isArray(e)?`afterArrayValue`:`afterPropertyValue`}function U(e){return Ae(e===void 0?`JSON5: invalid end of input at `+I+`:`+le:`JSON5: invalid character '`+ke(e)+`' at `+I+`:`+le)}function Ee(){return Ae(`JSON5: invalid end of input at `+I+`:`+le)}function De(){return le-=5,Ae(`JSON5: invalid identifier character at `+I+`:`+le)}function Oe(e){console.warn(`JSON5: '`+ke(e)+`' in strings is not valid ECMAScript; consider escaping`)}function ke(e){var t={"'":`\\'`,'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`,"\v":`\\v`,"\0":`\\0`,"\u2028":`\\u2028`,"\u2029":`\\u2029`};if(t[e])return t[e];if(e<` `){var n=e.charCodeAt(0).toString(16);return`\\x`+(`00`+n).substring(n.length)}return e}function Ae(e){var t=SyntaxError(e);return t.lineNumber=I,t.columnNumber=le,t}return{parse:fe,stringify:function(e,t,n){var r=[],i=``,a,o,s=``,c;if(typeof t==`object`&&t&&!Array.isArray(t)&&(n=t.space,c=t.quote,t=t.replacer),typeof t==`function`)o=t;else if(Array.isArray(t)){a=[];for(var l=0,u=t;l<u.length;l+=1){var d=u[l],f=void 0;typeof d==`string`?f=d:(typeof d==`number`||d instanceof String||d instanceof Number)&&(f=String(d)),f!==void 0&&a.indexOf(f)<0&&a.push(f)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n==`number`?n>0&&(n=Math.min(10,Math.floor(n)),s=` `.substr(0,n)):typeof n==`string`&&(s=n.substr(0,10)),p(``,{"":e});function p(e,t){var n=t[e];switch(n!=null&&(typeof n.toJSON5==`function`?n=n.toJSON5(e):typeof n.toJSON==`function`&&(n=n.toJSON(e))),o&&(n=o.call(t,e,n)),n instanceof Number?n=Number(n):n instanceof String?n=String(n):n instanceof Boolean&&(n=n.valueOf()),n){case null:return`null`;case!0:return`true`;case!1:return`false`}if(typeof n==`string`)return m(n,!1);if(typeof n==`number`)return String(n);if(typeof n==`object`)return Array.isArray(n)?_(n):h(n)}function m(e){for(var t={"'":.1,'"':.2},n={"'":`\\'`,'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`,"\v":`\\v`,"\0":`\\0`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},r=``,i=0;i<e.length;i++){var a=e[i];switch(a){case`'`:case`"`:t[a]++,r+=a;continue;case`\0`:if(M.isDigit(e[i+1])){r+=`\\x00`;continue}}if(n[a]){r+=n[a];continue}if(a<` `){var o=a.charCodeAt(0).toString(16);r+=`\\x`+(`00`+o).substring(o.length);continue}r+=a}var s=c||Object.keys(t).reduce(function(e,n){return t[e]<t[n]?e:n});return r=r.replace(new RegExp(s,`g`),n[s]),s+r+s}function h(e){if(r.indexOf(e)>=0)throw TypeError(`Converting circular structure to JSON5`);r.push(e);var t=i;i+=s;for(var n=a||Object.keys(e),o=[],c=0,l=n;c<l.length;c+=1){var u=l[c],d=p(u,e);if(d!==void 0){var f=g(u)+`:`;s!==``&&(f+=` `),f+=d,o.push(f)}}var m;if(o.length===0)m=`{}`;else{var h;if(s===``)h=o.join(`,`),m=`{`+h+`}`;else{var _=`,
10
10
  `+i;h=o.join(_),m=`{
11
11
  `+i+h+`,
12
- `+t+`}`}}return r.pop(),i=t,m}function g(e){if(e.length===0)return m(e,!0);var t=String.fromCodePoint(e.codePointAt(0));if(!N.isIdStartChar(t))return m(e,!0);for(var n=t.length;n<e.length;n++)if(!N.isIdContinueChar(String.fromCodePoint(e.codePointAt(n))))return m(e,!0);return e}function _(e){if(r.indexOf(e)>=0)throw TypeError(`Converting circular structure to JSON5`);r.push(e);var t=i;i+=s;for(var n=[],a=0;a<e.length;a++){var o=p(String(a),e);n.push(o===void 0?`null`:o)}var c;if(n.length===0)c=`[]`;else if(s===``)c=`[`+n.join(`,`)+`]`;else{var l=`,
12
+ `+t+`}`}}return r.pop(),i=t,m}function g(e){if(e.length===0)return m(e,!0);var t=String.fromCodePoint(e.codePointAt(0));if(!M.isIdStartChar(t))return m(e,!0);for(var n=t.length;n<e.length;n++)if(!M.isIdContinueChar(String.fromCodePoint(e.codePointAt(n))))return m(e,!0);return e}function _(e){if(r.indexOf(e)>=0)throw TypeError(`Converting circular structure to JSON5`);r.push(e);var t=i;i+=s;for(var n=[],a=0;a<e.length;a++){var o=p(String(a),e);n.push(o===void 0?`null`:o)}var c;if(n.length===0)c=`[]`;else if(s===``)c=`[`+n.join(`,`)+`]`;else{var l=`,
13
13
  `+i,u=n.join(l);c=`[
14
14
  `+i+u+`,
15
15
  `+t+`]`}return r.pop(),i=t,c}}}}))}))(),1);function Dn(e){if(e)return Array.isArray(e.type)?e.type.find(e=>e!==`null`)??e.type[0]:e.type}function On(e){if(!e)return``;if(e.default!==void 0)return e.default;switch(Dn(e)){case`object`:return{};case`array`:return[];case`boolean`:return!1;case`number`:case`integer`:return 0;case`string`:return``;default:return``}}function kn(e){return e.filter(e=>typeof e==`string`).join(`.`)}function An(e,t){let n=kn(e),r=t[n];if(r)return r;let i=n.split(`.`);for(let[e,n]of Object.entries(t)){if(!e.includes(`*`))continue;let t=e.split(`.`);if(t.length!==i.length)continue;let r=!0;for(let e=0;e<i.length;e+=1)if(t[e]!==`*`&&t[e]!==i[e]){r=!1;break}if(r)return n}}function jn(e){return e.replace(/_/g,` `).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/\s+/g,` `).replace(/^./,e=>e.toUpperCase())}var Mn=[`maxtokens`,`maxoutputtokens`,`maxinputtokens`,`maxcompletiontokens`,`contexttokens`,`totaltokens`,`tokencount`,`tokenlimit`,`tokenbudget`,`passwordfile`],Nn=[/token$/i,/password/i,/secret/i,/api.?key/i,/serviceaccount(?:ref)?$/i],Pn=/^\$\{[^}]*\}$/,Fn=`[redacted - click reveal to view]`;function In(e){return Pn.test(e.trim())}function Ln(e){let t=y(e);return!Mn.some(e=>t.endsWith(e))&&Nn.some(t=>t.test(e))}function Rn(e){return typeof e==`string`?e.trim().length>0&&!In(e):e!=null}function zn(e){return e?.sensitive??!1}function Bn(e,t,n){let r=kn(t);return(zn(An(t,n))||Ln(r))&&Rn(e)?!0:Array.isArray(e)?e.some((e,r)=>Bn(e,[...t,r],n)):e&&typeof e==`object`?Object.entries(e).some(([e,r])=>Bn(r,[...t,e],n)):!1}function Vn(e,t,n){if(e==null)return 0;let r=kn(t);return(zn(An(t,n))||Ln(r))&&Rn(e)?1:Array.isArray(e)?e.reduce((e,r,i)=>e+Vn(r,[...t,i],n),0):e&&typeof e==`object`?Object.entries(e).reduce((e,[r,i])=>e+Vn(i,[...t,r],n),0):0}function Hn(e,t){let n=e.trim();if(n===``)return;let r=Number(n);return!Number.isFinite(r)||t&&!Number.isInteger(r)?e:r}function Un(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:e}function Wn(e,t){if(e==null)return e;if(t.allOf&&t.allOf.length>0){let n=e;for(let e of t.allOf)n=Wn(n,e);return n}let n=Dn(t);if(t.anyOf||t.oneOf){let n=(t.anyOf??t.oneOf??[]).filter(e=>!(e.type===`null`||Array.isArray(e.type)&&e.type.includes(`null`)));if(n.length===1)return Wn(e,n[0]);if(typeof e==`string`)for(let t of n){let n=Dn(t);if(n===`number`||n===`integer`){let t=Hn(e,n===`integer`);if(t===void 0||typeof t==`number`)return t}if(n===`boolean`){let t=Un(e);if(typeof t==`boolean`)return t}}for(let t of n){let n=Dn(t);if(n===`object`&&typeof e==`object`&&!Array.isArray(e)||n===`array`&&Array.isArray(e))return Wn(e,t)}return e}if(n===`number`||n===`integer`){if(typeof e==`string`){let t=Hn(e,n===`integer`);if(t===void 0||typeof t==`number`)return t}return e}if(n===`boolean`){if(typeof e==`string`){let t=Un(e);if(typeof t==`boolean`)return t}return e}if(n===`object`){if(typeof e!=`object`||Array.isArray(e))return e;let n=e,r=t.properties??{},i=t.additionalProperties&&typeof t.additionalProperties==`object`?t.additionalProperties:null,a={};for(let[e,t]of Object.entries(n)){let n=r[e]??i,o=n?Wn(t,n):t;o!==void 0&&(a[e]=o)}return a}if(n===`array`){if(!Array.isArray(e))return e;if(Array.isArray(t.items)){let n=t.items;return e.map((e,t)=>{let r=t<n.length?n[t]:void 0;return r?Wn(e,r):e})}let n=t.items;return n?e.map(e=>Wn(e,n)).filter(e=>e!==void 0):e}return e}function Gn(e){return structuredClone(e)}function Kn(e){return`${JSON.stringify(e,null,2).trimEnd()}\n`}var qn=new Set([`__proto__`,`prototype`,`constructor`]);function Jn(e){return typeof e==`string`&&qn.has(e)}function Yn(e,t,n){if(t.length===0||t.some(Jn))return null;let r=e;for(let e=0;e<t.length-1;e+=1){let i=t[e],a=t[e+1];if(typeof i==`number`){if(!Array.isArray(r))return null;if(r[i]==null){if(!n)return null;r[i]=typeof a==`number`?[]:{}}r=r[i];continue}if(typeof r!=`object`||!r)return null;let o=r;if(o[i]==null){if(!n)return null;o[i]=typeof a==`number`?[]:{}}r=o[i]}return{current:r,lastKey:t[t.length-1]}}function Xn(e,t,n){let r=Yn(e,t,!0);if(r){if(typeof r.lastKey==`number`){Array.isArray(r.current)&&(r.current[r.lastKey]=n);return}typeof r.current==`object`&&r.current!=null&&(r.current[r.lastKey]=n)}}function Zn(e,t){let n=Yn(e,t,!1);if(n){if(typeof n.lastKey==`number`){Array.isArray(n.current)&&n.current.splice(n.lastKey,1);return}typeof n.current==`object`&&n.current!=null&&delete n.current[n.lastKey]}}async function Qn(e){if(!(!e.client||!e.connected)){e.configLoading=!0,e.lastError=null;try{tr(e,await e.client.request(`config.get`,{}))}catch(t){e.lastError=String(t)}finally{e.configLoading=!1}}}async function $n(e){if(!(!e.client||!e.connected)&&!e.configSchemaLoading){e.configSchemaLoading=!0;try{er(e,await e.client.request(`config.schema`,{}))}catch(t){e.lastError=String(t)}finally{e.configSchemaLoading=!1}}}function er(e,t){e.configSchema=t.schema??null,e.configUiHints=t.uiHints??{},e.configSchemaVersion=t.version??null}function tr(e,t){e.configSnapshot=t,typeof t.raw!=`string`&&e.configFormMode===`raw`&&(e.configFormMode=`form`);let n=typeof t.raw==`string`?t.raw:t.config&&typeof t.config==`object`?Kn(t.config):e.configRaw;!e.configFormDirty||e.configFormMode===`raw`?e.configRaw=n:e.configForm?e.configRaw=Kn(e.configForm):e.configRaw=n,e.configValid=typeof t.valid==`boolean`?t.valid:null,e.configIssues=Array.isArray(t.issues)?t.issues:[],e.configFormDirty||(e.configForm=Gn(t.config??{}),e.configFormOriginal=Gn(t.config??{}),e.configRawOriginal=n)}function nr(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function rr(e){if(e.configFormMode===`raw`&&typeof e.configSnapshot?.raw!=`string`)throw Error(`Raw config editing is unavailable for this snapshot. Switch to Form mode.`);if(e.configFormMode!==`form`||!e.configForm)return e.configRaw;let t=nr(e.configSchema);return Kn(t?Wn(e.configForm,t):e.configForm)}function ir(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ar(e,t,n=``){if(e===t)return[];if(ir(e)&&ir(t)){let r=new Set([...Object.keys(e),...Object.keys(t)]),i=[];for(let a of r){let r=n?`${n}.${a}`:a;i.push(...ar(e[a],t[a],r))}return i}return Array.isArray(e)&&Array.isArray(t)&&JSON.stringify(e)===JSON.stringify(t)?[]:[n||`<root>`]}function or(e,t){return e===t||e.startsWith(`${t}.`)}function sr(e){return[`gateway.remote`,`gateway.reload`,`gateway.channelHealthCheckMinutes`,`gateway.channelStaleEventThresholdMinutes`,`gateway.channelMaxRestartsPerHour`].some(t=>or(e,t))}function cr(e){return e===`<root>`?!0:or(e,`gateway`)?!sr(e):!!(or(e,`plugins`)||or(e,`discovery`)||or(e,`canvasHost`))}function lr(e){if(e.configFormMode===`raw`)try{let t=En.default.parse(e.configRaw);return ir(t)?t:null}catch{return null}if(e.configFormMode!==`form`||!e.configForm)return null;let t=nr(e.configSchema);return t?Wn(e.configForm,t):e.configForm}function ur(e){let t=e.configFormOriginal??e.configSnapshot?.config??null,n=lr(e);return!t||!n?[]:ar(t,n).filter(cr)}function dr(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return!!(typeof t.hash==`string`&&t.hash.trim()&&(ir(t.config)||typeof t.raw==`string`))}async function fr(e,t,n,r={}){if(!(!e.client||!e.connected)){e[n]=!0,e.lastError=null;try{let n=rr(e),i=e.configSnapshot?.hash;if(!i){e.lastError=`Config hash missing; reload and retry.`;return}let a=await e.client.request(t,{raw:n,baseHash:i,...r});if(e.configFormDirty=!1,dr(a)){tr(e,a);return}await Qn(e)}catch(t){e.lastError=String(t)}finally{e[n]=!1}}}async function pr(e){await fr(e,`config.set`,`configSaving`)}async function mr(e){await fr(e,`config.apply`,`configApplying`,{sessionKey:e.applySessionKey})}async function hr(e){let t=ur(e);if(t.length>0){e.configRestartPrompt={paths:t};return}await mr(e)}async function gr(e){e.configRestartPrompt=null,await mr(e)}async function _r(e){e.configRestartPrompt=null,await pr(e)}function vr(e){e.configRestartPrompt=null,Sr(e)}async function yr(e){if(!(!e.client||!e.connected)){e.updateRunning=!0,e.lastError=null;try{let t=await e.client.request(`update.run`,{sessionKey:e.applySessionKey});t&&t.ok===!1&&(e.lastError=`Update ${t.result?.status??`error`}: ${t.result?.reason??`Update failed.`}`)}catch(t){e.lastError=String(t)}finally{e.updateRunning=!1}}}function br(e,t){let n=Gn(e.configForm??e.configSnapshot?.config??{});t(n),e.configForm=n,e.configFormDirty=!0,e.configFormMode===`form`&&(e.configRaw=Kn(n))}function xr(e,t,n){br(e,e=>Xn(e,t,n))}function Sr(e){e.configForm=Gn(e.configFormOriginal??e.configSnapshot?.config??{}),e.configRaw=e.configRawOriginal??Kn(e.configFormOriginal??e.configSnapshot?.config??{}),e.configFormDirty=!1}function Cr(e,t){br(e,e=>Zn(e,t))}function wr(e,t){let n=t.trim();if(!n)return-1;let r=e?.agents?.list;return Array.isArray(r)?r.findIndex(e=>e&&typeof e==`object`&&`id`in e&&e.id===n):-1}function Tr(e,t){let n=t.trim();if(!n)return-1;let r=e.configForm??e.configSnapshot?.config,i=wr(r,n);if(i>=0)return i;let a=r?.agents?.list,o=Array.isArray(a)?a.length:0;return xr(e,[`agents`,`list`,o,`id`],n),o}async function Er(e){if(!(!e.client||!e.connected))try{await e.client.request(`config.openFile`,{})}catch{let t=e.configSnapshot?.path;if(t)try{await navigator.clipboard.writeText(t)}catch{}}}function Dr(e){let{values:t,original:n}=e;return t.name!==n.name||t.displayName!==n.displayName||t.about!==n.about||t.picture!==n.picture||t.banner!==n.banner||t.website!==n.website||t.nip05!==n.nip05||t.lud16!==n.lud16}function Or(e){let{state:t,callbacks:n,accountId:r}=e,a=Dr(t),o=(e,r,a={})=>{let{type:o=`text`,placeholder:s,maxLength:c,help:l}=a,u=t.values[e]??``,d=t.fieldErrors[e],f=`nostr-profile-${e}`;return o===`textarea`?i`
@@ -172,7 +172,7 @@ Action:
172
172
  `)}return typeof t.text==`string`?t.text:null}function lc(e){let t=e.trim();if(!t)return``;let n=t.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(e=>`_${e}_`);return n.length?[`_Reasoning:_`,...n].join(`
173
173
  `):``}function uc(e){return typeof e==`string`?e:e instanceof Error&&typeof e.message==`string`?e.message:`unknown error`}function dc(e){let t=uc(e.message),n=y(t),r=xe(e.details),i=Se(t),a=r?.reason??i?.reason;if(n.startsWith(`pairing required:`)&&a)return`gateway pairing required: ${ye(a)}`;if(i&&n!==`pairing required`)return t;let o=r?.approvedRoles?.join(`, `)??`none`,s=r?.requestedRole??`none`,c=r?.approvedScopes?.join(`, `)??`none`,l=r?.requestedScopes?.join(`, `)??`none`;switch(r?.reason){case`scope-upgrade`:return r.approvedScopes||r.requestedScopes?`device scope upgrade requires approval (approved: ${c}; requested: ${l})`:Ce(e.details);case`role-upgrade`:return r.approvedRoles||r.requestedRole?`device role upgrade requires approval (approved: ${o}; requested: ${s})`:Ce(e.details);case`metadata-upgrade`:return`device reconnect details changed and require approval`;default:return`gateway pairing required`}}function fc(e){let t=uc(e.message);switch(ln(e)){case L.AUTH_TOKEN_MISMATCH:return`gateway token mismatch`;case L.AUTH_UNAUTHORIZED:return`gateway auth failed`;case L.AUTH_RATE_LIMITED:return`too many failed authentication attempts`;case L.PAIRING_REQUIRED:return dc(e);case L.CONTROL_UI_DEVICE_IDENTITY_REQUIRED:return`device identity required (use HTTPS/localhost or allow insecure auth explicitly)`;case L.CONTROL_UI_ORIGIN_NOT_ALLOWED:return`origin not allowed (open the Control UI from the gateway host or allow it in gateway.controlUi.allowedOrigins)`;case L.AUTH_TOKEN_MISSING:return`gateway token missing`;default:break}let n=y(t);return n===`fetch failed`||n===`failed to fetch`||n===`connect failed`?`gateway connect failed`:t}function pc(e){return e&&typeof e==`object`?fc(e):uc(e)}var mc=/^\s*NO_REPLY\s*$/,hc=`HEARTBEAT_OK`,gc=300,_c=`[genesis] missing tool result in session history; inserted synthetic error result for transcript repair.`,vc=6e4,yc=500,bc=5e3,xc=new WeakMap,Sc=new WeakMap,Cc=256;function wc(e){let t=e,n=(xc.get(t)??0)+1;return xc.set(t,n),n}function Tc(e,t){return xc.get(e)===t}function Ec(e,t,n){return Tc(e,t)&&e.sessionKey===n}function Dc(e){return mc.test(e)}function Oc(e){return e===`final`||e===`aborted`||e===`error`}function kc(e){if(!Oc(e.state))return null;let t=typeof e.runId==`string`?e.runId.trim():``,n=typeof e.sessionKey==`string`?e.sessionKey.trim():``;return t&&n?`${n}\u0000${t}`:null}function Ac(e,t){let n=kc(t);return n?Sc.get(e)?.has(n)??!1:!1}function jc(e,t){let n=kc(t);if(!n)return;let r=e,i=Sc.get(r);for(i||(i=new Map,Sc.set(r,i)),i.set(n,Date.now());i.size>Cc;){let e=i.keys().next().value;if(typeof e!=`string`)break;i.delete(e)}}var Mc=null,Nc=null;function Pc(){if(Nc){let{state:e,text:t}=Nc;Nc=null,e.chatStream=t}}function Fc(){Mc!==null&&(cancelAnimationFrame(Mc),Mc=null),Pc()}function Ic(e,t){Nc={state:e,text:t},Mc===null&&(Mc=requestAnimationFrame(()=>{Mc=null,Pc()}))}function Lc(e){return Nc&&Nc.state===e?Nc.text:e.chatStream??``}function Rc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function zc(e,t=gc){let n=e.trim();if(!n)return{shouldSkip:!0};let r=n.replace(/<[^>]*>/g,` `).replace(/&nbsp;/gi,` `).replace(/^[*`~_]+/,``).replace(/[*`~_]+$/,``);if(!n.includes(hc)&&!r.includes(hc))return{shouldSkip:!1};let i=RegExp(`${Rc(hc)}[^\\w]{0,4}$`),a=!0,o=!1;for(n=r.trim();a;){a=!1;let e=n.trim();if(e.startsWith(hc)){n=e.slice(12).trimStart(),o=!0,a=!0;continue}if(i.test(e)){let t=e.lastIndexOf(hc),r=e.slice(0,t).trimEnd(),i=e.slice(t+12).trimStart();n=r?`${r}${i}`.trimEnd():``,o=!0,a=!0}}return o?{shouldSkip:!n||n.length<=t}:{shouldSkip:!1}}function Bc(e){if(e.role!==`assistant`)return!1;let{text:t,hasNonTextContent:n}=Vc(e.content);return n?!1:zc(t).shouldSkip}function Vc(e){if(typeof e==`string`)return{text:e,hasNonTextContent:!1};if(!Array.isArray(e))return{text:``,hasNonTextContent:e!=null};let t=!1;return{text:e.filter(e=>!e||typeof e!=`object`||!(`type`in e)||e.type!==`text`||typeof e.text!=`string`?(t=!0,!1):!0).map(e=>e.text).join(``),hasNonTextContent:t}}function Hc(e){if(!e||typeof e!=`object`)return!1;let t=e;if(y(t.role)!==`assistant`)return!1;if(typeof t.text==`string`)return Dc(t.text);let n=ic(e);return typeof n==`string`&&Dc(n)}function Uc(e){if(!e||typeof e!=`object`||y(e.role)!==`toolresult`)return!1;let t=ic(e);return typeof t==`string`&&t.trim()===_c}function Wc(e){if(typeof e==`string`)return!0;if(!Array.isArray(e))return!1;if(e.length===0)return!0;let t=!1;for(let n of e){if(!n||typeof n!=`object`)return!1;let e=n;if(e.type!==`text`||(t=!0,typeof e.text!=`string`))return!1}return t}function Gc(e){if(!e||typeof e!=`object`)return!1;let t=e;return y(t.role)!==`user`||!Wc(t.content??t.text)?!1:(ic(e)?.trim()??``)===``}function Kc(e){if(!e||typeof e!=`object`)return!1;let t=e,n=y(t.role);return n===`assistant`?Bc({role:n,content:t.content??t.text}):!1}function qc(e){return Hc(e)||Kc(e)||Uc(e)||Gc(e)}function Jc(e){return!!(e&&typeof e==`object`&&e.__genesis&&typeof e.__genesis==`object`)}function Yc(e){if(!e||typeof e!=`object`||Jc(e))return!1;let t=y(e.role);return t===`user`||t===`assistant`}function Xc(e){if(!e||typeof e!=`object`)return null;let t=y(e.role);if(!t)return null;let n=ic(e)?.trim();if(n)return`${t}:text:${n}`;try{return`${t}:content:${JSON.stringify(e.content??null)}`}catch{return null}}function Zc(e){if(!e||typeof e!=`object`)return null;let t=e.__genesis;return t&&typeof t==`object`&&!Array.isArray(t)?t:null}function Qc(e){let t=Zc(e),n=t?.id;if(typeof n==`string`&&n.trim())return`id:${n.trim()}`;let r=t?.seq;return typeof r==`number`&&Number.isFinite(r)?`seq:${r}`:null}function $c(e,t){let n=Qc(t);if(n){let t=e.findIndex(e=>Qc(e)===n);if(t>=0)return t}let r=Xc(t);if(!r)return-1;for(let t=e.length-1;t>=0;--t){let n=e[t];if(Yc(n)&&Xc(n)===r)return t}return-1}function el(e,t,n){if(t===void 0||qc(t))return t!==void 0;let r=$c(e.chatMessages,t);return r>=0?(e.chatMessages[r]===t||(e.chatMessages=e.chatMessages.map((e,n)=>n===r?t:e)),!0):n?.appendIfMissing===!1?!1:(e.chatMessages=[...e.chatMessages,t],!0)}function tl(e,t){if(e.length===0||t.length===0)return e;let n=new Set(e.map(e=>Xc(e)).filter(e=>!!e)),r=-1;for(let e=t.length-1;e>=0;e--){let i=Xc(t[e]);if(i&&n.has(i)){r=e;break}}if(r<0)return e;let i=[];for(let a of t.slice(r+1)){if(!Yc(a)||qc(a))return e;let t=Xc(a);if(!t||n.has(t))return e;i.push(a)}return i.length>0?[...e,...i]:e}function nl(e,t){if(!(e instanceof cn)||e.gatewayCode!==`UNAVAILABLE`||!e.retryable)return!1;let n=e.details;if(!n||typeof n!=`object`)return!0;let r=n.method;return typeof r!=`string`||r===t}function rl(e){let t=typeof e.retryAfterMs==`number`?e.retryAfterMs:yc;return Math.min(Math.max(t,100),bc)}function il(e){return new Promise(t=>setTimeout(t,e))}function al(e){let t=e;t.toolStreamById instanceof Map&&Array.isArray(t.toolStreamOrder)&&Array.isArray(t.chatToolMessages)&&Array.isArray(t.chatStreamSegments)&&Ai(t)}async function ol(e){if(!e.client||!e.connected)return;let t=e.sessionKey,n=wc(e),r=Date.now(),i=e.chatMessages;e.chatLoading=!0,e.lastError=null;try{let a;for(;;)try{a=await e.client.request(`chat.history`,{sessionKey:t,limit:200});break}catch(i){if(!Ec(e,n,t))return;if(Date.now()-r<vc&&nl(i,`chat.history`)){if(await il(rl(i)),!e.client||!e.connected)return;continue}throw i}if(!Ec(e,n,t))return;e.chatMessages=tl((Array.isArray(a.messages)?a.messages:[]).filter(e=>!qc(e)),i),e.chatThinkingLevel=a.thinkingLevel??null,al(e),e.chatStream=null,e.chatStreamStartedAt=null}catch(r){if(!Ec(e,n,t))return;bn(r)?(e.chatMessages=[],e.chatThinkingLevel=null,e.lastError=xn(`existing chat history`)):e.lastError=String(r)}finally{Tc(e,n)&&(e.chatLoading=!1)}}function sl(e){let t=/^data:([^;]+);base64,(.+)$/.exec(e);return t?{mimeType:t[1],content:t[2]}:null}function cl(e){return e&&e.length>0?e.map(e=>{let t=sl(e.dataUrl);return t?{type:`image`,mimeType:t.mimeType,content:t.content}:null}).filter(e=>e!==null):void 0}async function ll(e,t){await e.client.request(`chat.send`,{sessionKey:e.sessionKey,message:t.message,deliver:!1,idempotencyKey:t.runId,attachments:cl(t.attachments)})}function ul(e,t){if(!e||typeof e!=`object`)return null;let n=e,r=n.role;if(typeof r==`string`){if((t.roleCaseSensitive?r:y(r))!==`assistant`)return null}else if(t.roleRequirement===`required`)return null;return t.requireContentArray?Array.isArray(n.content)?n:null:!(`content`in n)&&!(t.allowTextField&&`text`in n)?null:n}function dl(e){return ul(e,{roleRequirement:`required`,roleCaseSensitive:!0,requireContentArray:!0})}function fl(e){return ul(e,{roleRequirement:`optional`,allowTextField:!0})}async function pl(e,t,n){if(!e.client||!e.connected)return null;let r=t.trim(),i=n&&n.length>0;if(!r&&!i)return null;let a=Date.now(),o=[];if(r&&o.push({type:`text`,text:r}),i)for(let e of n)o.push({type:`image`,source:{type:`base64`,media_type:e.mimeType,data:e.dataUrl}});e.chatMessages=[...e.chatMessages,{role:`user`,content:o,timestamp:a}],e.chatSending=!0,e.lastError=null;let s=sn();e.chatRunId=s,e.chatStream=``,e.chatStreamStartedAt=a;try{return await ll(e,{message:r,attachments:n,runId:s}),s}catch(t){let n=pc(t);return e.chatRunId=null,e.chatStream=null,e.chatStreamStartedAt=null,e.lastError=n,e.chatMessages=[...e.chatMessages,{role:`assistant`,content:[{type:`text`,text:`Error: `+n}],timestamp:Date.now()}],null}finally{e.chatSending=!1}}async function ml(e,t,n){if(!e.client||!e.connected)return null;let r=t.trim(),i=n&&n.length>0;if(!r&&!i)return null;e.lastError=null;let a=sn();try{return await ll(e,{message:r,attachments:n,runId:a}),a}catch(t){return e.lastError=pc(t),null}}async function hl(e,t,n){if(!e.client||!e.connected)return null;let r=t.trim(),i=n&&n.length>0;if(!r&&!i)return null;e.lastError=null;let a=sn();try{return await ll(e,{message:r,attachments:n,runId:a}),a}catch(t){return e.lastError=pc(t),null}}async function gl(e){if(!e.client||!e.connected)return!1;let t=e.chatRunId;try{return await e.client.request(`chat.abort`,t?{sessionKey:e.sessionKey,runId:t}:{sessionKey:e.sessionKey}),!0}catch(t){return e.lastError=pc(t),!1}}function _l(e,t){if(!t||t.sessionKey!==e.sessionKey||Ac(e,t))return null;if(jc(e,t),t.runId&&e.chatRunId&&t.runId!==e.chatRunId){if(t.state===`final`){let n=fl(t.message);return n&&!Hc(n)?(e.chatMessages=[...e.chatMessages,n],null):`final`}return null}if(t.state===`delta`)if(typeof t.appendText==`string`){let n=(t.reset?``:Lc(e))+t.appendText;Dc(n)||Ic(e,n)}else{let n=ic(t.message);typeof n==`string`&&!Dc(n)&&Ic(e,n)}else if(t.state===`final`){Fc();let n=fl(t.message);n&&!Hc(n)?e.chatMessages=[...e.chatMessages,n]:e.chatStream?.trim()&&!Dc(e.chatStream)&&(e.chatMessages=[...e.chatMessages,{role:`assistant`,content:[{type:`text`,text:e.chatStream}],timestamp:Date.now()}]),e.chatStream=null,e.chatRunId=null,e.chatStreamStartedAt=null}else if(t.state===`aborted`){Fc();let n=dl(t.message);if(n&&!Hc(n))e.chatMessages=[...e.chatMessages,n];else{let t=e.chatStream??``;t.trim()&&!Dc(t)&&(e.chatMessages=[...e.chatMessages,{role:`assistant`,content:[{type:`text`,text:t}],timestamp:Date.now()}])}e.chatStream=null,e.chatRunId=null,e.chatStreamStartedAt=null}else t.state===`error`&&(Fc(),e.chatStream=null,e.chatRunId=null,e.chatStreamStartedAt=null,e.lastError=t.errorMessage??`chat error`);return t.state}async function vl(e){try{return(await e.request(`models.list`,{}))?.models??[]}catch{return[]}}var yl=new WeakMap,bl=`abortedLastRun.childSessions.compactionCheckpointCount.contextTokens.displayName.endedAt.elevatedLevel.fastMode.inputTokens.kind.label.latestCompactionCheckpoint.model.modelProvider.outputTokens.reasoningLevel.runtimeMs.sessionId.spawnedBy.startedAt.status.subject.surface.systemSent.thinkingDefault.thinkingLevel.thinkingOptions.totalTokens.totalTokensFresh.updatedAt.verboseLevel`.split(`.`);function xl(e){let t=e,n=yl.get(t);return n||(n={loading:!1,ownsStateLoading:!1,pending:null},yl.set(t,n)),n}function Sl(e){let t=e.pending;return e.pending=null,t}function Cl(e){return!!(e&&typeof e==`object`)}function wl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Tl(e){return e===`direct`||e===`group`||e===`global`||e===`unknown`?e:void 0}function El(e){return`${e?.compactionCheckpointCount??0}:${e?.latestCompactionCheckpoint?.checkpointId??``}:${e?.latestCompactionCheckpoint?.createdAt??0}`}function Dl(e,t){if(!(t in e.sessionsCheckpointItemsByKey)&&!(t in e.sessionsCheckpointErrorByKey))return;let n={...e.sessionsCheckpointItemsByKey},r={...e.sessionsCheckpointErrorByKey};delete n[t],delete r[t],e.sessionsCheckpointItemsByKey=n,e.sessionsCheckpointErrorByKey=r}async function Ol(e,t){e.sessionsCheckpointLoadingKey=t,e.sessionsCheckpointErrorByKey={...e.sessionsCheckpointErrorByKey,[t]:``};try{let n=await e.client?.request(`sessions.compaction.list`,{key:t});n&&(e.sessionsCheckpointItemsByKey={...e.sessionsCheckpointItemsByKey,[t]:n.checkpoints??[]})}catch(n){e.sessionsCheckpointErrorByKey={...e.sessionsCheckpointErrorByKey,[t]:String(n)}}finally{e.sessionsCheckpointLoadingKey===t&&(e.sessionsCheckpointLoadingKey=null)}}async function kl(e,t){if(e.sessionsLoading)return!1;let n=xl(e);e.sessionsLoading=!0,e.sessionsError=null;let r=!1;try{await t()}finally{e.sessionsLoading=!1;let t=Sl(n);t&&e.client&&e.connected&&(await Nl(e,t.overrides),r=!0)}return r}async function Al(e,t,n,r,i){if(!e.client||!e.connected||!window.confirm(i))return null;let a=e.client;e.sessionsCheckpointBusyKey=n;try{let i=await a.request(r,{key:t,checkpointId:n});return await Nl(e),i}catch(t){return e.sessionsError=String(t),null}finally{e.sessionsCheckpointBusyKey===n&&(e.sessionsCheckpointBusyKey=null)}}function jl(e,t){if(!Cl(t)||!e.sessionsResult)return!1;let n=(Cl(t.session)?t.session:null)??t,r=typeof n.key==`string`&&n.key.trim()||typeof t.sessionKey==`string`&&t.sessionKey.trim()||typeof t.key==`string`&&t.key.trim()||``;if(!r)return!1;let i=e.sessionsResult.sessions,a=i.findIndex(e=>e.key===r),o=a>=0?i[a]:void 0,s=El(o),c=Tl(n.kind)??o?.kind??`unknown`,l={...o??{key:r,kind:c,updatedAt:null},key:r,kind:c},u=l;for(let e of bl){if(!wl(n,e))continue;let t=n[e];t===void 0?delete u[e]:u[e]=t}l.totalTokensFresh===!1&&!wl(n,`totalTokens`)&&delete l.totalTokens;let d=a>=0?i.map((e,t)=>t===a?l:e):[l,...i],f=typeof t.ts==`number`&&Number.isFinite(t.ts)?t.ts:null;return e.sessionsResult={...e.sessionsResult,ts:f==null?e.sessionsResult.ts:Math.max(e.sessionsResult.ts,f),count:a>=0?e.sessionsResult.count:e.sessionsResult.count+1,sessions:d},s!==El(l)&&Dl(e,r),!0}async function Ml(e){if(!(!e.client||!e.connected))try{await e.client.request(`sessions.subscribe`,{})}catch(t){e.sessionsError=String(t)}}async function Nl(e,t){if(!e.client||!e.connected)return;let n=xl(e);if(n.loading){n.pending={overrides:t};return}if(e.sessionsLoading){n.pending={overrides:t};return}let r=e.client;n.loading=!0,n.ownsStateLoading=!0,e.sessionsLoading=!0,e.sessionsError=null;let i=t;try{for(;;){n.pending=null,await Pl(e,r,i);let t=Sl(n);if(!t||!e.client||!e.connected)break;i=t.overrides}}finally{n.loading=!1,n.pending=null,n.ownsStateLoading&&=(e.sessionsLoading=!1,!1)}}async function Pl(e,t,n){await(async()=>{let r=new Map((e.sessionsResult?.sessions??[]).map(e=>[e.key,e])),i=n?.includeGlobal??e.sessionsIncludeGlobal,a=n?.includeUnknown??e.sessionsIncludeUnknown,o=n?.activeMinutes??x(e.sessionsFilterActive,0),s=n?.limit??x(e.sessionsFilterLimit,0),c={includeGlobal:i,includeUnknown:a,includeTranscriptUsage:n?.includeTranscriptUsage??!1};o>0&&(c.activeMinutes=o),s>0&&(c.limit=s);let l=n?.search===void 0?``:n.search.trim();l&&(c.search=l);let u=await t.request(`sessions.list`,c);if(u){e.sessionsResult=u;let t=new Set(u.sessions.map(e=>e.key));for(let n of Object.keys(e.sessionsCheckpointItemsByKey))t.has(n)||Dl(e,n);let n=!1;for(let t of u.sessions)El(r.get(t.key))!==El(t)&&(Dl(e,t.key),e.sessionsExpandedCheckpointKey===t.key&&(n=!0));let i=e.sessionsExpandedCheckpointKey;i&&t.has(i)&&(n||!e.sessionsCheckpointItemsByKey[i])&&await Ol(e,i)}})().catch(t=>{if(!bn(t)){e.sessionsError=String(t);return}e.sessionsResult=null,e.sessionsError=xn(`sessions`)})}async function Fl(e,t,n){if(!e.client||!e.connected)return;let r={key:t};for(let e of[`label`,`thinkingLevel`,`fastMode`,`verboseLevel`,`reasoningLevel`])e in n&&(r[e]=n[e]);try{await e.client.request(`sessions.patch`,r),await Nl(e)}catch(t){e.sessionsError=String(t)}}async function Il(e,t){if(!e.client||!e.connected||t.length===0)return[];let n=e.client;if(e.sessionsLoading||!window.confirm(`Delete ${t.length} ${t.length===1?`session`:`sessions`}?\n\nThis will delete the session entries and archive their transcripts.`))return[];let r=[],i=[],a=await kl(e,async()=>{for(let e of t)try{await n.request(`sessions.delete`,{key:e,deleteTranscript:!0}),r.push(e)}catch(e){i.push(String(e))}});return r.length>0&&!a&&await Nl(e),i.length>0&&(e.sessionsError=i.join(`; `)),r}async function Ll(e,t){let n=t.trim();if(n){if(e.sessionsExpandedCheckpointKey===n){e.sessionsExpandedCheckpointKey=null;return}e.sessionsExpandedCheckpointKey=n,!e.sessionsCheckpointItemsByKey[n]&&await Ol(e,n)}}async function Rl(e,t,n){return(await Al(e,t,n,`sessions.compaction.branch`,`Create a new child session from this pre-compaction checkpoint?`))?.key??null}async function zl(e,t,n){await Al(e,t,n,`sessions.compaction.restore`,`Restore this session to the selected pre-compaction checkpoint?
174
174
 
175
- This replaces the current active transcript for the session key.`)}var Bl=[{label:`chat`,tabs:[`chat`]},{label:`control`,tabs:[`overview`,`canvas`,`channels`,`instances`,`sessions`,`usage`,`wallet`,`cron`]},{label:`agent`,tabs:[`agents`,`skills`,`mcp`,`plugins`,`nodes`,`dreams`]},{label:`settings`,tabs:[`config`,`communications`,`appearance`,`automation`,`infrastructure`,`aiAgents`,`debug`,`logs`]}],Vl={agents:`/agents`,overview:`/overview`,canvas:`/canvas`,channels:`/channels`,instances:`/instances`,sessions:`/sessions`,usage:`/usage`,wallet:`/wallet`,cron:`/cron`,skills:`/skills`,mcp:`/mcp`,plugins:`/plugins`,nodes:`/nodes`,chat:`/chat`,config:`/config`,communications:`/communications`,appearance:`/appearance`,automation:`/automation`,infrastructure:`/infrastructure`,aiAgents:`/ai-agents`,debug:`/debug`,logs:`/logs`,dreams:`/dreaming`},Hl={"/dreams":`dreams`},Ul=new Map([...Object.entries(Vl).map(([e,t])=>[t,e]),...Object.entries(Hl)]);function Wl(e){if(!e)return``;let t=e.trim();return t.startsWith(`/`)||(t=`/${t}`),t===`/`?``:(t.endsWith(`/`)&&(t=t.slice(0,-1)),t)}function Gl(e){if(!e)return`/`;let t=e.trim();return t.startsWith(`/`)||(t=`/${t}`),t.length>1&&t.endsWith(`/`)&&(t=t.slice(0,-1)),t}function Kl(e,t=``){let n=Wl(t),r=Vl[e];return n?`${n}${r}`:r}function ql(e,t=``){let n=Wl(t),r=e||`/`;n&&(r===n?r=`/`:r.startsWith(`${n}/`)&&(r=r.slice(n.length)));let i=y(Gl(r));return i.endsWith(`/index.html`)&&(i=`/`),i===`/`?`chat`:Ul.get(i)??null}function Jl(e){let t=Gl(e);if(t.endsWith(`/index.html`)&&(t=Gl(t.slice(0,-11))),t===`/`)return``;let n=t.split(`/`).filter(Boolean);if(n.length===0)return``;for(let e=0;e<n.length;e++){let t=y(`/${n.slice(e).join(`/`)}`);if(Ul.has(t)){let t=n.slice(0,e);return t.length?`/${t.join(`/`)}`:``}}return`/${n.join(`/`)}`}function Yl(e){switch(e){case`agents`:return`folder`;case`chat`:return`messageSquare`;case`overview`:return`barChart`;case`canvas`:return`image`;case`channels`:return`link`;case`instances`:return`radio`;case`sessions`:return`fileText`;case`usage`:return`barChart`;case`wallet`:return`wallet`;case`cron`:return`loader`;case`skills`:return`zap`;case`mcp`:return`plug`;case`plugins`:return`wrench`;case`nodes`:return`monitor`;case`config`:return`settings`;case`communications`:return`send`;case`appearance`:return`spark`;case`automation`:return`terminal`;case`infrastructure`:return`globe`;case`aiAgents`:return`brain`;case`debug`:return`bug`;case`logs`:return`scrollText`;case`dreams`:return`moon`;default:return`folder`}}function Xl(e){return p(`tabs.${e}`)}function Zl(e){return p(`subtitles.${e}`)}var Ql=[{id:`read`,label:`read`,description:`Read file contents`,sectionId:`fs`,profiles:[`coding`]},{id:`write`,label:`write`,description:`Create or overwrite files`,sectionId:`fs`,profiles:[`coding`]},{id:`edit`,label:`edit`,description:`Make precise edits`,sectionId:`fs`,profiles:[`coding`]},{id:`apply_patch`,label:`apply_patch`,description:`Patch files`,sectionId:`fs`,profiles:[`coding`]},{id:`exec`,label:`exec`,description:`Run shell commands that start now.`,sectionId:`runtime`,profiles:[`coding`]},{id:`process`,label:`process`,description:`Inspect and control running exec sessions.`,sectionId:`runtime`,profiles:[`coding`]},{id:`code_execution`,label:`code_execution`,description:`Run sandboxed remote analysis`,sectionId:`runtime`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`web_search`,label:`web_search`,description:`Search the web`,sectionId:`web`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`web_fetch`,label:`web_fetch`,description:`Fetch web content`,sectionId:`web`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`x_search`,label:`x_search`,description:`Search X posts`,sectionId:`web`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`memory_search`,label:`memory_search`,description:`Semantic search`,sectionId:`memory`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`memory_get`,label:`memory_get`,description:`Read memory files`,sectionId:`memory`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`sessions_list`,label:`sessions_list`,description:`List visible sessions with mailbox filters and optional previews.`,sectionId:`sessions`,profiles:[`coding`,`messaging`],includeInGenesisGroup:!0},{id:`sessions_history`,label:`sessions_history`,description:`Read sanitized message history for a visible session.`,sectionId:`sessions`,profiles:[`coding`,`messaging`],includeInGenesisGroup:!0},{id:`sessions_send`,label:`sessions_send`,description:`Send a message to another visible session.`,sectionId:`sessions`,profiles:[`coding`,`messaging`],includeInGenesisGroup:!0},{id:`sessions_spawn`,label:`sessions_spawn`,description:`Spawn sub-agent or ACP sessions.`,sectionId:`sessions`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`sessions_yield`,label:`sessions_yield`,description:`End turn to receive sub-agent results`,sectionId:`sessions`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`subagents`,label:`subagents`,description:`Manage sub-agents`,sectionId:`sessions`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`session_status`,label:`session_status`,description:`Show session status, usage, and model state.`,sectionId:`sessions`,profiles:[`minimal`,`coding`,`messaging`],includeInGenesisGroup:!0},{id:`browser`,label:`browser`,description:`Control web browser`,sectionId:`ui`,profiles:[],includeInGenesisGroup:!0},{id:`canvas`,label:`canvas`,description:`Control canvases`,sectionId:`ui`,profiles:[],includeInGenesisGroup:!0},{id:`message`,label:`message`,description:`Send messages`,sectionId:`messaging`,profiles:[`messaging`],includeInGenesisGroup:!0},{id:`cron`,label:`cron`,description:`Schedule cron jobs, reminders, and wake events.`,sectionId:`automation`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`gateway`,label:`gateway`,description:`Gateway control`,sectionId:`automation`,profiles:[],includeInGenesisGroup:!0},{id:`nodes`,label:`nodes`,description:`Nodes + devices`,sectionId:`nodes`,profiles:[],includeInGenesisGroup:!0},{id:`agents_list`,label:`agents_list`,description:`List agents`,sectionId:`agents`,profiles:[],includeInGenesisGroup:!0},{id:`update_plan`,label:`update_plan`,description:`Track a short structured work plan.`,sectionId:`agents`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`image`,label:`image`,description:`Image understanding`,sectionId:`media`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`image_generate`,label:`image_generate`,description:`Image generation`,sectionId:`media`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`music_generate`,label:`music_generate`,description:`Music generation`,sectionId:`media`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`video_generate`,label:`video_generate`,description:`Video generation`,sectionId:`media`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`tts`,label:`tts`,description:`Text-to-speech conversion`,sectionId:`media`,profiles:[],includeInGenesisGroup:!0}];new Map(Ql.map(e=>[e.id,e]));function $l(e){return Ql.filter(t=>t.profiles.includes(e)).map(e=>e.id)}var eu={minimal:{allow:$l(`minimal`)},coding:{allow:[...$l(`coding`),`bundle-mcp`]},messaging:{allow:[...$l(`messaging`),`bundle-mcp`]},full:{}};function tu(){let e=new Map;for(let t of Ql){let n=`group:${t.sectionId}`,r=e.get(n)??[];r.push(t.id),e.set(n,r)}return{"group:genesis":Ql.filter(e=>e.includeInGenesisGroup).map(e=>e.id),...Object.fromEntries(e.entries())}}var nu=tu();function ru(e){if(!e)return;let t=eu[e];if(t&&!(!t.allow&&!t.deny))return{allow:t.allow?[...t.allow]:void 0,deny:t.deny?[...t.deny]:void 0}}var iu={bash:`exec`,"apply-patch":`apply_patch`},au={...nu};function ou(e){let t=y(e);return iu[t]??t}function su(e){return e?e.map(ou).filter(Boolean):[]}function cu(e){let t=su(e),n=[];for(let e of t){let t=au[e];if(t){n.push(...t);continue}n.push(e)}return Array.from(new Set(n))}function lu(e){return ru(e)}var uu=[{id:`fs`,label:`Files`,tools:[{id:`read`,label:`read`,description:`Read file contents`},{id:`write`,label:`write`,description:`Create or overwrite files`},{id:`edit`,label:`edit`,description:`Make precise edits`},{id:`apply_patch`,label:`apply_patch`,description:`Patch files (OpenAI)`}]},{id:`runtime`,label:`Runtime`,tools:[{id:`exec`,label:`exec`,description:`Run shell commands`},{id:`process`,label:`process`,description:`Manage background processes`}]},{id:`web`,label:`Web`,tools:[{id:`web_search`,label:`web_search`,description:`Search the web`},{id:`web_fetch`,label:`web_fetch`,description:`Fetch web content`}]},{id:`memory`,label:`Memory`,tools:[{id:`memory_search`,label:`memory_search`,description:`Semantic search`},{id:`memory_get`,label:`memory_get`,description:`Read memory files`}]},{id:`sessions`,label:`Sessions`,tools:[{id:`sessions_list`,label:`sessions_list`,description:`List sessions`},{id:`sessions_history`,label:`sessions_history`,description:`Session history`},{id:`sessions_send`,label:`sessions_send`,description:`Send to session`},{id:`sessions_spawn`,label:`sessions_spawn`,description:`Spawn sub-agent`},{id:`session_status`,label:`session_status`,description:`Session status`}]},{id:`ui`,label:`UI`,tools:[{id:`browser`,label:`browser`,description:`Control web browser`},{id:`canvas`,label:`canvas`,description:`Control canvases`}]},{id:`messaging`,label:`Messaging`,tools:[{id:`message`,label:`message`,description:`Send messages`}]},{id:`automation`,label:`Automation`,tools:[{id:`cron`,label:`cron`,description:`Schedule tasks`},{id:`gateway`,label:`gateway`,description:`Gateway control`}]},{id:`nodes`,label:`Nodes`,tools:[{id:`nodes`,label:`nodes`,description:`Nodes + devices`}]},{id:`agents`,label:`Agents`,tools:[{id:`agents_list`,label:`agents_list`,description:`List agents`}]},{id:`media`,label:`Media`,tools:[{id:`image`,label:`image`,description:`Image understanding`}]}],du=[{id:`minimal`,label:`Minimal`},{id:`coding`,label:`Coding`},{id:`messaging`,label:`Messaging`},{id:`full`,label:`Full`}];function fu(e){return e?.groups?.length?e.groups.map(e=>({id:e.id,label:e.label,source:e.source,pluginId:e.pluginId,tools:e.tools.map(e=>({id:e.id,label:e.label,description:e.description,source:e.source,pluginId:e.pluginId,optional:e.optional,defaultProfiles:[...e.defaultProfiles]}))})):uu}function pu(e){return e?.profiles?.length?e.profiles:du}function mu(e){return v(e.name)??v(e.identity?.name)??e.id}var hu=/^(data:image\/|\/(?!\/))/i;function gu(e){return hu.test(e)}function _u(e,t){let n=[v(t?.avatar),v(e.identity?.avatarUrl),v(e.identity?.avatar)];for(let e of n)if(e&&gu(e))return e;return null}function vu(e,t,n){let r=v(e);return r?.startsWith(`blob:`)?r:_u(t,n)}function yu(e){let t=v(e)?.replace(/\/$/,``)??``;return t?`${t}/favicon.svg`:`favicon.svg`}function bu(e,t){return t&&e===t?`default`:null}function xu(e,t){let n=e;return{entry:(n?.agents?.list??[]).find(e=>e?.id===t),defaults:n?.agents?.defaults,globalTools:n?.tools}}function Su(e,t,n,r,i){let a=xu(t,e.id),o=(n&&n.agentId===e.id?n.workspace:null)||a.entry?.workspace||a.defaults?.workspace||e.workspace||`default`,s=a.entry?.model?Cu(a.entry?.model):a.defaults?.model?Cu(a.defaults?.model):Cu(e.model),c=v(i?.name)||v(e.identity?.name)||v(e.name)||a.entry?.name||e.id,l=_u(e,i)?`custom`:`—`,u=Array.isArray(a.entry?.skills)?a.entry?.skills:null,d=u?.length??null;return{workspace:o,model:s,identityName:c,identityAvatar:l,skillsLabel:u?`${d} selected`:`all skills`,isDefault:!!(r&&e.id===r)}}function Cu(e){if(!e)return`-`;if(typeof e==`string`)return v(e)||`-`;if(typeof e==`object`&&e){let t=e,n=v(t.primary);if(n){let e=Array.isArray(t.fallbacks)?t.fallbacks.length:0;return e>0?`${n} (+${e} fallback)`:n}}return`-`}function wu(e){let t=e.match(/^(.+) \(\+\d+ fallback\)$/);return t?t[1]:e}function Tu(e){if(!e)return null;if(typeof e==`string`)return v(e)||null;if(typeof e==`object`&&e){let t=e;return v(typeof t.primary==`string`?t.primary:typeof t.model==`string`?t.model:typeof t.id==`string`?t.id:typeof t.value==`string`?t.value:null)||null}return null}function Eu(e){if(!e||typeof e==`string`)return null;if(typeof e==`object`&&e){let t=e,n=Array.isArray(t.fallbacks)?t.fallbacks:Array.isArray(t.fallback)?t.fallback:null;return n?n.filter(e=>typeof e==`string`):null}return null}function Du(e,t){return Eu(e)??Eu(t)}function Ou(e,t){if(typeof t!=`string`)return;let n=t.trim();n&&e.add(n)}function ku(e,t){if(!t)return;if(typeof t==`string`){Ou(e,t);return}if(typeof t!=`object`)return;let n=t;Ou(e,n.primary),Ou(e,n.model),Ou(e,n.id),Ou(e,n.value);let r=Array.isArray(n.fallbacks)?n.fallbacks:Array.isArray(n.fallback)?n.fallback:[];for(let t of r)Ou(e,t)}function Au(e){let t=Array.from(e),n=Array.from({length:t.length},()=>``),r=(e,r,i)=>{let a=e,o=r,s=e;for(;a<r&&o<i;)n[s++]=t[a].localeCompare(t[o])<=0?t[a++]:t[o++];for(;a<r;)n[s++]=t[a++];for(;o<i;)n[s++]=t[o++];for(let r=e;r<i;r+=1)t[r]=n[r]},i=(e,t)=>{if(t-e<=1)return;let n=e+t>>>1;i(e,n),i(n,t),r(e,n,t)};return i(0,t.length),t}function ju(e){if(!e||typeof e!=`object`)return[];let t=e.agents;if(!t||typeof t!=`object`)return[];let n=new Set,r=t.defaults;if(r&&typeof r==`object`){let e=r;ku(n,e.model);let t=e.models;if(t&&typeof t==`object`)for(let e of Object.keys(t))Ou(n,e)}let i=t.list;if(i&&typeof i==`object`)for(let e of Object.values(i))!e||typeof e!=`object`||ku(n,e.model);return Au(n)}function Mu(e){return e.split(`,`).map(e=>e.trim()).filter(Boolean)}function Nu(e){let t=e?.agents?.defaults?.models;if(!t||typeof t!=`object`)return[];let n=[];for(let[e,r]of Object.entries(t)){let t=e.trim();if(!t)continue;let i=r&&typeof r==`object`&&`alias`in r&&typeof r.alias==`string`?r.alias?.trim():void 0,a=i&&i!==t?`${i} (${t})`:t;n.push({value:t,label:a})}return n}function Pu(e,t,n){let r=new Set,a=[],o=(e,t)=>{let n=y(e);r.has(n)||(r.add(n),a.push({value:e,label:t}))};for(let t of Nu(e))o(t.value,t.label);if(n)for(let e of n){let t=e.provider?.trim();o(t?`${t}/${e.id}`:e.id,t?`${e.id} · ${t}`:e.id)}return t&&!r.has(y(t))&&a.unshift({value:t,label:`Current (${t})`}),a.length===0?g:a.map(e=>i`<option value=${e.value}>${e.label}</option>`)}function Fu(e){let t=ou(e);if(!t)return{kind:`exact`,value:``};if(t===`*`)return{kind:`all`};if(!t.includes(`*`))return{kind:`exact`,value:t};let n=t.replace(/[.*+?^${}()|[\\]\\]/g,`\\$&`);return{kind:`regex`,value:RegExp(`^${n.replaceAll(`\\*`,`.*`)}$`)}}function Iu(e){return Array.isArray(e)?cu(e).map(Fu).filter(e=>e.kind!==`exact`||e.value.length>0):[]}function Lu(e,t){for(let n of t)if(n.kind===`all`||n.kind===`exact`&&e===n.value||n.kind===`regex`&&n.value.test(e))return!0;return!1}function Ru(e,t){if(!t)return!0;let n=ou(e);if(Lu(n,Iu(t.deny)))return!1;let r=Iu(t.allow);return!!(r.length===0||Lu(n,r)||n===`apply_patch`&&Lu(`exec`,r))}function zu(e,t){if(!Array.isArray(t)||t.length===0)return!1;let n=ou(e),r=Iu(t);return!!(Lu(n,r)||n===`apply_patch`&&Lu(`exec`,r))}function Bu(e){return lu(e)??void 0}function Vu(e){return e.chatSending||!!e.chatRunId}function Hu(e){let t=e.trim();if(!t)return!1;let n=y(t);return n===`/stop`?!0:n===`stop`||n===`esc`||n===`abort`||n===`wait`||n===`exit`}function Uu(e){let t=e.trim();if(!t)return!1;let n=y(t);return n===`/new`||n===`/reset`?!0:n.startsWith(`/new `)||n.startsWith(`/reset `)}function Wu(e){return/^\/btw(?::|\s|$)/i.test(e.trim())}async function Gu(e){if(!e.connected&&e.chatRunId){e.chatMessage=``,e.pendingAbort={runId:e.chatRunId,sessionKey:e.sessionKey};return}e.connected&&(e.chatMessage=``,await gl(e))}function Ku(e,t,n,r,i){let a=t.trim(),o=!!(n&&n.length>0);!a&&!o||(e.chatQueue=[...e.chatQueue,{id:sn(),text:a,createdAt:Date.now(),attachments:o?n?.map(e=>({...e})):void 0,refreshSessions:r,localCommandArgs:i?.args,localCommandName:i?.name}])}function qu(e,t,n,r){let i=t.trim(),a=!!(r&&r.length>0);!i&&!a||(e.chatQueue=[...e.chatQueue,{id:sn(),text:i,createdAt:Date.now(),kind:`steered`,attachments:a?r?.map(e=>({...e})):void 0,pendingRunId:n}])}async function Ju(e,t,n){Ai(e),ai(e);let r=await pl(e,t,n?.attachments),i=!!r;return!i&&n?.previousDraft!=null&&(e.chatMessage=n.previousDraft),!i&&n?.previousAttachments&&(e.chatAttachments=n.previousAttachments),i&&Qr(e,e.sessionKey),i&&n?.restoreDraft&&n.previousDraft?.trim()&&(e.chatMessage=n.previousDraft),i&&n?.restoreAttachments&&n.previousAttachments?.length&&(e.chatAttachments=n.previousAttachments),ti(e,!0),i&&!e.chatRunId&&Zu(e),i&&n?.refreshSessions&&r&&e.refreshSessionsAfterChat.add(r),i}async function Yu(e,t,n){let r=!!await ml(e,t,n?.attachments);return!r&&n?.previousDraft!=null&&(e.chatMessage=n.previousDraft),!r&&n?.previousAttachments&&(e.chatAttachments=n.previousAttachments),r&&Qr(e,e.sessionKey),r}async function Xu(e,t){if(!e.connected||!e.chatRunId)return;let n=e.chatRunId,r=e.chatQueue.find(e=>e.id===t&&!e.pendingRunId&&!e.localCommandName);if(!r)return;let i=r.text.trim(),a=r.attachments??[],o=a.length>0;if(!(!i&&!o)){if(e.chatQueue=e.chatQueue.map(e=>e.id===t?{...e,kind:`steered`,pendingRunId:n}:e),!await hl(e,i,o?a:void 0)){e.chatQueue=e.chatQueue.map(e=>e.id===t?r:e);return}Qr(e,e.sessionKey),ti(e)}}async function Zu(e){if(!e.connected||Vu(e))return;let t=e.chatQueue.findIndex(e=>!e.pendingRunId);if(t<0)return;let n=e.chatQueue[t];e.chatQueue=e.chatQueue.filter((e,n)=>n!==t);let r=!1;try{n.localCommandName?(await nd(e,n.localCommandName,n.localCommandArgs??``),r=!0):r=await Ju(e,n.text,{attachments:n.attachments,refreshSessions:n.refreshSessions})}catch(t){e.lastError=String(t)}r?e.chatQueue.length>0&&Zu(e):e.chatQueue=[n,...e.chatQueue]}function Qu(e,t){e.chatQueue=e.chatQueue.filter(e=>e.id!==t)}function $u(e,t){t&&(e.chatQueue=e.chatQueue.filter(e=>e.pendingRunId!==t))}async function ed(e,t,n){if(!e.connected)return;let r=e.chatMessage,i=(t??e.chatMessage).trim(),a=e.chatAttachments??[],o=t==null?a:[],s=o.length>0;if(!i&&!s)return;if(Hu(i)){await Gu(e);return}if(Wu(i)){t??(e.chatMessage=``,e.chatAttachments=[]),await Yu(e,i,{previousDraft:t==null?r:void 0,attachments:s?o:void 0,previousAttachments:t==null?a:void 0});return}let c=Uo(i);if(c?.command.executeLocal){if(Vu(e)&&td(c.command.key)){t??(e.chatMessage=``,e.chatAttachments=[]),Ku(e,i,void 0,Uu(i),{args:c.args,name:c.command.key});return}let a=t==null?r:void 0;t??(e.chatMessage=``,e.chatAttachments=[]),await nd(e,c.command.key,c.args,{previousDraft:a,restoreDraft:!!(t&&n?.restoreDraft)});return}let l=Uu(i);if(t??(e.chatMessage=``,e.chatAttachments=[]),Vu(e)){Ku(e,i,o,l);return}await Ju(e,i,{previousDraft:t==null?r:void 0,restoreDraft:!!(t&&n?.restoreDraft),attachments:s?o:void 0,previousAttachments:t==null?a:void 0,restoreAttachments:!!(t&&n?.restoreDraft),refreshSessions:l})}function td(e){return![`stop`,`focus`,`export-session`,`steer`,`redirect`].includes(e)}async function nd(e,t,n,r){switch(t){case`stop`:await Gu(e);return;case`new`:await Ju(e,`/new`,{refreshSessions:!0,previousDraft:r?.previousDraft,restoreDraft:r?.restoreDraft});return;case`reset`:await Ju(e,`/reset`,{refreshSessions:!0,previousDraft:r?.previousDraft,restoreDraft:r?.restoreDraft});return;case`clear`:await rd(e);return;case`focus`:e.onSlashAction?.(`toggle-focus`);return;case`export-session`:e.onSlashAction?.(`export`);return}if(!e.client)return;let i=e.sessionKey,a=await Go(e.client,i,t,n,{chatModelCatalog:e.chatModelCatalog,sessionsResult:e.sessionsResult});a.content&&id(e,a.content),a.trackRunId&&(e.chatRunId=a.trackRunId,e.chatStream=``,e.chatSending=!1),a.pendingCurrentRun&&e.chatRunId&&qu(e,`/${t} ${n}`.trim(),e.chatRunId),a.sessionPatch&&`modelOverride`in a.sessionPatch&&(e.chatModelOverrides={...e.chatModelOverrides,[i]:a.sessionPatch.modelOverride??null},e.onSlashAction?.(`refresh-tools-effective`)),a.action===`refresh`&&await ad(e),ti(e)}async function rd(e){if(!(!e.client||!e.connected)){try{await e.client.request(`sessions.reset`,{key:e.sessionKey}),e.chatMessages=[],e.chatSideResult=null,e.chatSideResultTerminalRuns?.clear(),e.chatStream=null,e.chatRunId=null,await ol(e)}catch(t){e.lastError=String(t)}ti(e)}}function id(e,t){e.chatMessages=[...e.chatMessages,{role:`system`,content:t,timestamp:Date.now()}]}async function ad(e,t){await Promise.all([ol(e),Nl(e,{activeMinutes:0,limit:0,includeGlobal:!0,includeUnknown:!0}),yd(e),od(e),sd(e)]),t?.scheduleScroll!==!1&&ti(e)}async function od(e){if(!e.client||!e.connected){e.chatModelsLoading=!1,e.chatModelCatalog=[];return}e.chatModelsLoading=!0;try{e.chatModelCatalog=await vl(e.client)}finally{e.chatModelsLoading=!1}}async function sd(e){await Lo({client:e.client,agentId:pd(e)})}var cd=Zu,ld=new WeakMap,ud=new WeakMap;function dd(e){let t=e,n=(ld.get(t)??0)+1;return ld.set(t,n),n}function fd(e,t,n){return ld.get(e)===t&&e.sessionKey===n}function pd(e){let t=la(e.sessionKey);return t?.agentId?t.agentId:(e.hello?.snapshot)?.sessionDefaults?.defaultAgentId?.trim()||`main`}function md(e,t){let n=Wl(e),r=encodeURIComponent(t);return n?`${n}/avatar/${r}?meta=1`:`/avatar/${r}?meta=1`}function hd(e){let t=e,n=ud.get(t);n&&(URL.revokeObjectURL(n),ud.delete(t)),e.chatAvatarUrl=null}function gd(e,t){let n=e,r=ud.get(n);r&&r!==t&&(URL.revokeObjectURL(r),ud.delete(n)),t?.startsWith(`blob:`)&&ud.set(n,t),e.chatAvatarUrl=t}function _d(e){return e?{Authorization:e}:void 0}function vd(e){return e.startsWith(`/`)}async function yd(e){if(!e.connected){hd(e);return}let t=e.sessionKey,n=dd(e),r=pd(e);if(!r){fd(e,n,t)&&hd(e);return}hd(e);let i=ue(e),a=_d(i),o=md(e.basePath,r);try{let r=await fetch(o,{method:`GET`,...a?{headers:a}:{}});if(!fd(e,n,t))return;if(!r.ok){hd(e);return}let s=await r.json();if(!fd(e,n,t))return;let c=typeof s.avatarUrl==`string`?s.avatarUrl.trim():``;if(!c||!gu(c)){hd(e);return}if(!i||!vd(c)){gd(e,c);return}let l=await fetch(c,{method:`GET`,headers:{Authorization:i}});if(!l.ok){fd(e,n,t)&&hd(e);return}let u=URL.createObjectURL(await l.blob());if(!fd(e,n,t)){URL.revokeObjectURL(u);return}gd(e,u)}catch{fd(e,n,t)&&hd(e)}}var bd={trace:!0,debug:!0,info:!0,warn:!0,error:!0,fatal:!0},xd={name:``,description:``,agentId:``,sessionKey:``,clearAgent:!1,enabled:!0,deleteAfterRun:!0,scheduleKind:`every`,scheduleAt:``,everyAmount:`30`,everyUnit:`minutes`,cronExpr:`0 7 * * *`,cronTz:``,scheduleExact:!1,staggerAmount:``,staggerUnit:`seconds`,sessionTarget:`isolated`,wakeMode:`now`,payloadKind:`agentTurn`,payloadText:``,payloadModel:``,payloadThinking:``,payloadLightContext:!1,deliveryMode:`announce`,deliveryChannel:`last`,deliveryTo:``,deliveryAccountId:``,deliveryBestEffort:!1,failureAlertMode:`inherit`,failureAlertAfter:`2`,failureAlertCooldownSeconds:`3600`,failureAlertChannel:`last`,failureAlertTo:``,failureAlertDeliveryMode:`announce`,failureAlertAccountId:``,timeoutSeconds:``},Sd=`operator`,Cd=`operator.admin`,wd=`operator.read`,Td=`operator.write`,Ed=`operator.`;function Dd(e){let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function Od(e,t){return e.startsWith(Ed)?t.has(Cd)?!0:e===wd?t.has(wd)||t.has(Td):e===Td?t.has(Td):t.has(e):!1}function kd(e){let t=Dd(e.requestedScopes);if(t.length===0)return!0;let n=Dd(e.allowedScopes);if(n.length===0)return!1;let r=new Set(n);if(e.role.trim()!==Sd){let n=`${e.role.trim()}.`;return t.every(e=>e.startsWith(n)&&r.has(e))}return t.every(e=>Od(e,r))}async function Ad(e){if(!(!e.client||!e.connected)&&!e.debugLoading){e.debugLoading=!0;try{let[t,n,r,i]=await Promise.all([e.client.request(`status`,{}),e.client.request(`health`,{}),e.client.request(`models.list`,{}),e.client.request(`last-heartbeat`,{})]);e.debugStatus=t,e.debugHealth=n;let a=r;e.debugModels=Array.isArray(a?.models)?a?.models:[],e.debugHeartbeat=i}catch(t){e.debugCallError=String(t)}finally{e.debugLoading=!1}}}async function jd(e){if(!(!e.client||!e.connected)){e.debugCallError=null,e.debugCallResult=null;try{let t=e.debugCallParams.trim()?JSON.parse(e.debugCallParams):{},n=await e.client.request(e.debugCallMethod.trim(),t);e.debugCallResult=JSON.stringify(n,null,2)}catch(t){e.debugCallError=String(t)}}}var Md=2e3,Nd=new Set([`trace`,`debug`,`info`,`warn`,`error`,`fatal`]);function Pd(e){if(typeof e!=`string`)return null;let t=e.trim();if(!t.startsWith(`{`)||!t.endsWith(`}`))return null;try{let e=JSON.parse(t);return e&&typeof e==`object`?e:null}catch{return null}}function Fd(e){if(typeof e!=`string`)return null;let t=y(e);return Nd.has(t)?t:null}function Id(e){if(!e.trim())return{raw:e,message:e};try{let t=JSON.parse(e),n=t&&typeof t._meta==`object`&&t._meta!==null?t._meta:null,r=typeof t.time==`string`?t.time:typeof n?.date==`string`?n?.date:null,i=Fd(n?.logLevelName??n?.level),a=typeof t[0]==`string`?t[0]:typeof n?.name==`string`?n?.name:null,o=Pd(a),s=typeof o?.subsystem==`string`?o.subsystem:typeof o?.module==`string`?o.module:null;!s&&a&&a.length<120&&(s=a);let c=typeof t[1]==`string`?t[1]:typeof t[2]==`string`?t[2]:!o&&typeof t[0]==`string`?t[0]:typeof t.message==`string`?t.message:e;return{raw:e,time:r,level:i,subsystem:s,message:c,meta:n??void 0}}catch{return{raw:e,message:e}}}async function Ld(e,t){let n=t?.quiet===!0;if(!(!e.client||!e.connected||e.logsLoading&&!n)){n||(e.logsLoading=!0),e.logsError=null;try{let n=await e.client.request(`logs.tail`,{cursor:t?.reset?void 0:e.logsCursor??void 0,limit:e.logsLimit,maxBytes:e.logsMaxBytes}),r=(Array.isArray(n.lines)?n.lines.filter(e=>typeof e==`string`):[]).map(Id);e.logsEntries=t?.reset||n.reset||e.logsCursor==null?r:[...e.logsEntries,...r].slice(-Md),e.logsCursor=typeof n.cursor==`number`?n.cursor:e.logsCursor,e.logsFile=typeof n.file==`string`?n.file:e.logsFile,e.logsTruncated=!!n.truncated,e.logsLastFetchAt=Date.now()}catch(t){bn(t)?(e.logsEntries=[],e.logsError=xn(`logs`)):e.logsError=String(t)}finally{n||(e.logsLoading=!1)}}}function Rd(e){return typeof e==`string`&&e.trim()?e.trim():null}function zd(e){return Rd(e.nodeId)}function Bd(e){return Rd(e.displayName)??zd(e)??``}function Vd(e){let t=Array.isArray(e?.commands)?e.commands:[];return Array.from(new Set(t.map(e=>Rd(e)).filter(e=>!!e))).toSorted((e,t)=>e.localeCompare(t))}function Hd(e,t){let n=Rd(t);return n?e.find(e=>zd(e)===n)??null:null}function Ud(e){return Vd(e).find(e=>e!==`system.execApprovals.get`&&e!==`system.execApprovals.set`&&e!==`system.run.prepare`)??``}function Wd(e){let t=Hd(e.nodes,e.nodeManagementSelectedId);if(t){let n=Vd(t);(!e.nodeManagementCommand||!n.includes(e.nodeManagementCommand))&&(e.nodeManagementCommand=Ud(t),e.nodeManagementParams=Yd(e.nodeManagementCommand)),e.nodeManagementRename.trim()||(e.nodeManagementRename=Bd(t));return}let n=e.nodes.find(e=>zd(e));if(!n){e.nodeManagementSelectedId=null,e.nodeManagementRename=``,e.nodeManagementCommand=``;return}Qd(e,zd(n)??``)}function Gd(e){let t=e.trim();return t?JSON.parse(t):{}}function Kd(e,t){let n=Number.parseInt(e.trim(),10);return!Number.isFinite(n)||n<=0?t:n}function qd(e){return`${e}:${globalThis.crypto?.randomUUID?.()??`${Date.now()}:${Math.random().toString(36).slice(2)}`}`}function Jd(e,t){return(Rd(e?.platform)?.toLowerCase()??``).startsWith(`win`)?[`cmd.exe`,`/d`,`/s`,`/c`,t]:[`sh`,`-lc`,t]}function Yd(e){return e===`system.which`?`{
175
+ This replaces the current active transcript for the session key.`)}var Bl=[{label:`control`,tabs:[`overview`,`agents`,`chat`,`canvas`,`channels`,`sessions`,`models`,`instances`,`usage`,`cron`]},{label:`tools`,tabs:[`skills`,`plugins`,`mcp`,`wallet`,`memory`,`nodes`,`dreams`]},{label:`settings`,tabs:[`config`,`communications`,`appearance`,`automation`,`infrastructure`,`aiAgents`,`debug`,`logs`]}],Vl={agents:`/agents`,overview:`/overview`,canvas:`/canvas`,channels:`/channels`,instances:`/instances`,sessions:`/sessions`,usage:`/usage`,wallet:`/wallet`,cron:`/cron`,skills:`/skills`,mcp:`/mcp`,plugins:`/plugins`,models:`/models`,memory:`/memory`,nodes:`/nodes`,chat:`/chat`,config:`/config`,communications:`/communications`,appearance:`/appearance`,automation:`/automation`,infrastructure:`/infrastructure`,aiAgents:`/ai-agents`,debug:`/debug`,logs:`/logs`,dreams:`/dreaming`},Hl={"/dreams":`dreams`},Ul=new Map([...Object.entries(Vl).map(([e,t])=>[t,e]),...Object.entries(Hl)]);function Wl(e){if(!e)return``;let t=e.trim();return t.startsWith(`/`)||(t=`/${t}`),t===`/`?``:(t.endsWith(`/`)&&(t=t.slice(0,-1)),t)}function Gl(e){if(!e)return`/`;let t=e.trim();return t.startsWith(`/`)||(t=`/${t}`),t.length>1&&t.endsWith(`/`)&&(t=t.slice(0,-1)),t}function Kl(e,t=``){let n=Wl(t),r=Vl[e];return n?`${n}${r}`:r}function ql(e,t=``){let n=Wl(t),r=e||`/`;n&&(r===n?r=`/`:r.startsWith(`${n}/`)&&(r=r.slice(n.length)));let i=y(Gl(r));return i.endsWith(`/index.html`)&&(i=`/`),i===`/`?`chat`:Ul.get(i)??null}function Jl(e){let t=Gl(e);if(t.endsWith(`/index.html`)&&(t=Gl(t.slice(0,-11))),t===`/`)return``;let n=t.split(`/`).filter(Boolean);if(n.length===0)return``;for(let e=0;e<n.length;e++){let t=y(`/${n.slice(e).join(`/`)}`);if(Ul.has(t)){let t=n.slice(0,e);return t.length?`/${t.join(`/`)}`:``}}return`/${n.join(`/`)}`}function Yl(e){switch(e){case`agents`:return`folder`;case`chat`:return`messageSquare`;case`overview`:return`barChart`;case`canvas`:return`image`;case`channels`:return`link`;case`instances`:return`radio`;case`sessions`:return`fileText`;case`usage`:return`barChart`;case`wallet`:return`wallet`;case`cron`:return`loader`;case`skills`:return`zap`;case`mcp`:return`plug`;case`plugins`:return`wrench`;case`models`:return`cpu`;case`memory`:return`brain`;case`nodes`:return`monitor`;case`config`:return`settings`;case`communications`:return`send`;case`appearance`:return`spark`;case`automation`:return`terminal`;case`infrastructure`:return`globe`;case`aiAgents`:return`brain`;case`debug`:return`bug`;case`logs`:return`scrollText`;case`dreams`:return`moon`;default:return`folder`}}function Xl(e){return p(`tabs.${e}`)}function Zl(e){return p(`subtitles.${e}`)}var Ql=[{id:`read`,label:`read`,description:`Read file contents`,sectionId:`fs`,profiles:[`coding`]},{id:`write`,label:`write`,description:`Create or overwrite files`,sectionId:`fs`,profiles:[`coding`]},{id:`edit`,label:`edit`,description:`Make precise edits`,sectionId:`fs`,profiles:[`coding`]},{id:`apply_patch`,label:`apply_patch`,description:`Patch files`,sectionId:`fs`,profiles:[`coding`]},{id:`exec`,label:`exec`,description:`Run shell commands that start now.`,sectionId:`runtime`,profiles:[`coding`]},{id:`process`,label:`process`,description:`Inspect and control running exec sessions.`,sectionId:`runtime`,profiles:[`coding`]},{id:`code_execution`,label:`code_execution`,description:`Run sandboxed remote analysis`,sectionId:`runtime`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`web_search`,label:`web_search`,description:`Search the web`,sectionId:`web`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`web_fetch`,label:`web_fetch`,description:`Fetch web content`,sectionId:`web`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`x_search`,label:`x_search`,description:`Search X posts`,sectionId:`web`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`memory_search`,label:`memory_search`,description:`Semantic search`,sectionId:`memory`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`memory_get`,label:`memory_get`,description:`Read memory files`,sectionId:`memory`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`sessions_list`,label:`sessions_list`,description:`List visible sessions with mailbox filters and optional previews.`,sectionId:`sessions`,profiles:[`coding`,`messaging`],includeInGenesisGroup:!0},{id:`sessions_history`,label:`sessions_history`,description:`Read sanitized message history for a visible session.`,sectionId:`sessions`,profiles:[`coding`,`messaging`],includeInGenesisGroup:!0},{id:`sessions_send`,label:`sessions_send`,description:`Send a message to another visible session.`,sectionId:`sessions`,profiles:[`coding`,`messaging`],includeInGenesisGroup:!0},{id:`sessions_spawn`,label:`sessions_spawn`,description:`Spawn sub-agent or ACP sessions.`,sectionId:`sessions`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`sessions_yield`,label:`sessions_yield`,description:`End turn to receive sub-agent results`,sectionId:`sessions`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`subagents`,label:`subagents`,description:`Manage sub-agents`,sectionId:`sessions`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`session_status`,label:`session_status`,description:`Show session status, usage, and model state.`,sectionId:`sessions`,profiles:[`minimal`,`coding`,`messaging`],includeInGenesisGroup:!0},{id:`browser`,label:`browser`,description:`Control web browser`,sectionId:`ui`,profiles:[],includeInGenesisGroup:!0},{id:`canvas`,label:`canvas`,description:`Control canvases`,sectionId:`ui`,profiles:[],includeInGenesisGroup:!0},{id:`message`,label:`message`,description:`Send messages`,sectionId:`messaging`,profiles:[`messaging`],includeInGenesisGroup:!0},{id:`cron`,label:`cron`,description:`Schedule cron jobs, reminders, and wake events.`,sectionId:`automation`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`gateway`,label:`gateway`,description:`Gateway control`,sectionId:`automation`,profiles:[],includeInGenesisGroup:!0},{id:`nodes`,label:`nodes`,description:`Nodes + devices`,sectionId:`nodes`,profiles:[],includeInGenesisGroup:!0},{id:`agents_list`,label:`agents_list`,description:`List agents`,sectionId:`agents`,profiles:[],includeInGenesisGroup:!0},{id:`update_plan`,label:`update_plan`,description:`Track a short structured work plan.`,sectionId:`agents`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`image`,label:`image`,description:`Image understanding`,sectionId:`media`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`image_generate`,label:`image_generate`,description:`Image generation`,sectionId:`media`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`music_generate`,label:`music_generate`,description:`Music generation`,sectionId:`media`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`video_generate`,label:`video_generate`,description:`Video generation`,sectionId:`media`,profiles:[`coding`],includeInGenesisGroup:!0},{id:`tts`,label:`tts`,description:`Text-to-speech conversion`,sectionId:`media`,profiles:[],includeInGenesisGroup:!0}];new Map(Ql.map(e=>[e.id,e]));function $l(e){return Ql.filter(t=>t.profiles.includes(e)).map(e=>e.id)}var eu={minimal:{allow:$l(`minimal`)},coding:{allow:[...$l(`coding`),`bundle-mcp`]},messaging:{allow:[...$l(`messaging`),`bundle-mcp`]},full:{}};function tu(){let e=new Map;for(let t of Ql){let n=`group:${t.sectionId}`,r=e.get(n)??[];r.push(t.id),e.set(n,r)}return{"group:genesis":Ql.filter(e=>e.includeInGenesisGroup).map(e=>e.id),...Object.fromEntries(e.entries())}}var nu=tu();function ru(e){if(!e)return;let t=eu[e];if(t&&!(!t.allow&&!t.deny))return{allow:t.allow?[...t.allow]:void 0,deny:t.deny?[...t.deny]:void 0}}var iu={bash:`exec`,"apply-patch":`apply_patch`},au={...nu};function ou(e){let t=y(e);return iu[t]??t}function su(e){return e?e.map(ou).filter(Boolean):[]}function cu(e){let t=su(e),n=[];for(let e of t){let t=au[e];if(t){n.push(...t);continue}n.push(e)}return Array.from(new Set(n))}function lu(e){return ru(e)}var uu=[{id:`fs`,label:`Files`,tools:[{id:`read`,label:`read`,description:`Read file contents`},{id:`write`,label:`write`,description:`Create or overwrite files`},{id:`edit`,label:`edit`,description:`Make precise edits`},{id:`apply_patch`,label:`apply_patch`,description:`Patch files (OpenAI)`}]},{id:`runtime`,label:`Runtime`,tools:[{id:`exec`,label:`exec`,description:`Run shell commands`},{id:`process`,label:`process`,description:`Manage background processes`}]},{id:`web`,label:`Web`,tools:[{id:`web_search`,label:`web_search`,description:`Search the web`},{id:`web_fetch`,label:`web_fetch`,description:`Fetch web content`}]},{id:`memory`,label:`Memory`,tools:[{id:`memory_search`,label:`memory_search`,description:`Semantic search`},{id:`memory_get`,label:`memory_get`,description:`Read memory files`}]},{id:`sessions`,label:`Sessions`,tools:[{id:`sessions_list`,label:`sessions_list`,description:`List sessions`},{id:`sessions_history`,label:`sessions_history`,description:`Session history`},{id:`sessions_send`,label:`sessions_send`,description:`Send to session`},{id:`sessions_spawn`,label:`sessions_spawn`,description:`Spawn sub-agent`},{id:`session_status`,label:`session_status`,description:`Session status`}]},{id:`ui`,label:`UI`,tools:[{id:`browser`,label:`browser`,description:`Control web browser`},{id:`canvas`,label:`canvas`,description:`Control canvases`}]},{id:`messaging`,label:`Messaging`,tools:[{id:`message`,label:`message`,description:`Send messages`}]},{id:`automation`,label:`Automation`,tools:[{id:`cron`,label:`cron`,description:`Schedule tasks`},{id:`gateway`,label:`gateway`,description:`Gateway control`}]},{id:`nodes`,label:`Nodes`,tools:[{id:`nodes`,label:`nodes`,description:`Nodes + devices`}]},{id:`agents`,label:`Agents`,tools:[{id:`agents_list`,label:`agents_list`,description:`List agents`}]},{id:`media`,label:`Media`,tools:[{id:`image`,label:`image`,description:`Image understanding`}]}],du=[{id:`minimal`,label:`Minimal`},{id:`coding`,label:`Coding`},{id:`messaging`,label:`Messaging`},{id:`full`,label:`Full`}];function fu(e){return e?.groups?.length?e.groups.map(e=>({id:e.id,label:e.label,source:e.source,pluginId:e.pluginId,tools:e.tools.map(e=>({id:e.id,label:e.label,description:e.description,source:e.source,pluginId:e.pluginId,optional:e.optional,defaultProfiles:[...e.defaultProfiles]}))})):uu}function pu(e){return e?.profiles?.length?e.profiles:du}function mu(e){return v(e.name)??v(e.identity?.name)??e.id}var hu=/^(data:image\/|\/(?!\/))/i;function gu(e){return hu.test(e)}function _u(e,t){let n=[v(t?.avatar),v(e.identity?.avatarUrl),v(e.identity?.avatar)];for(let e of n)if(e&&gu(e))return e;return null}function vu(e,t,n){let r=v(e);return r?.startsWith(`blob:`)?r:_u(t,n)}function yu(e){let t=v(e)?.replace(/\/$/,``)??``;return t?`${t}/favicon.svg`:`favicon.svg`}function bu(e,t){return t&&e===t?`default`:null}function xu(e,t){let n=e;return{entry:(n?.agents?.list??[]).find(e=>e?.id===t),defaults:n?.agents?.defaults,globalTools:n?.tools}}function Su(e,t,n,r,i){let a=xu(t,e.id),o=(n&&n.agentId===e.id?n.workspace:null)||a.entry?.workspace||a.defaults?.workspace||e.workspace||`default`,s=a.entry?.model?Cu(a.entry?.model):a.defaults?.model?Cu(a.defaults?.model):Cu(e.model),c=v(i?.name)||v(e.identity?.name)||v(e.name)||a.entry?.name||e.id,l=_u(e,i)?`custom`:`—`,u=Array.isArray(a.entry?.skills)?a.entry?.skills:null,d=u?.length??null;return{workspace:o,model:s,identityName:c,identityAvatar:l,skillsLabel:u?`${d} selected`:`all skills`,isDefault:!!(r&&e.id===r)}}function Cu(e){if(!e)return`-`;if(typeof e==`string`)return v(e)||`-`;if(typeof e==`object`&&e){let t=e,n=v(t.primary);if(n){let e=Array.isArray(t.fallbacks)?t.fallbacks.length:0;return e>0?`${n} (+${e} fallback)`:n}}return`-`}function wu(e){let t=e.match(/^(.+) \(\+\d+ fallback\)$/);return t?t[1]:e}function Tu(e){if(!e)return null;if(typeof e==`string`)return v(e)||null;if(typeof e==`object`&&e){let t=e;return v(typeof t.primary==`string`?t.primary:typeof t.model==`string`?t.model:typeof t.id==`string`?t.id:typeof t.value==`string`?t.value:null)||null}return null}function Eu(e){if(!e||typeof e==`string`)return null;if(typeof e==`object`&&e){let t=e,n=Array.isArray(t.fallbacks)?t.fallbacks:Array.isArray(t.fallback)?t.fallback:null;return n?n.filter(e=>typeof e==`string`):null}return null}function Du(e,t){return Eu(e)??Eu(t)}function Ou(e,t){if(typeof t!=`string`)return;let n=t.trim();n&&e.add(n)}function ku(e,t){if(!t)return;if(typeof t==`string`){Ou(e,t);return}if(typeof t!=`object`)return;let n=t;Ou(e,n.primary),Ou(e,n.model),Ou(e,n.id),Ou(e,n.value);let r=Array.isArray(n.fallbacks)?n.fallbacks:Array.isArray(n.fallback)?n.fallback:[];for(let t of r)Ou(e,t)}function Au(e){let t=Array.from(e),n=Array.from({length:t.length},()=>``),r=(e,r,i)=>{let a=e,o=r,s=e;for(;a<r&&o<i;)n[s++]=t[a].localeCompare(t[o])<=0?t[a++]:t[o++];for(;a<r;)n[s++]=t[a++];for(;o<i;)n[s++]=t[o++];for(let r=e;r<i;r+=1)t[r]=n[r]},i=(e,t)=>{if(t-e<=1)return;let n=e+t>>>1;i(e,n),i(n,t),r(e,n,t)};return i(0,t.length),t}function ju(e){if(!e||typeof e!=`object`)return[];let t=e.agents;if(!t||typeof t!=`object`)return[];let n=new Set,r=t.defaults;if(r&&typeof r==`object`){let e=r;ku(n,e.model);let t=e.models;if(t&&typeof t==`object`)for(let e of Object.keys(t))Ou(n,e)}let i=t.list;if(i&&typeof i==`object`)for(let e of Object.values(i))!e||typeof e!=`object`||ku(n,e.model);return Au(n)}function Mu(e){return e.split(`,`).map(e=>e.trim()).filter(Boolean)}function Nu(e){let t=e?.agents?.defaults?.models;if(!t||typeof t!=`object`)return[];let n=[];for(let[e,r]of Object.entries(t)){let t=e.trim();if(!t)continue;let i=r&&typeof r==`object`&&`alias`in r&&typeof r.alias==`string`?r.alias?.trim():void 0,a=i&&i!==t?`${i} (${t})`:t;n.push({value:t,label:a})}return n}function Pu(e,t,n){let r=new Set,a=[],o=(e,t)=>{let n=y(e);r.has(n)||(r.add(n),a.push({value:e,label:t}))};for(let t of Nu(e))o(t.value,t.label);if(n)for(let e of n){let t=e.provider?.trim();o(t?`${t}/${e.id}`:e.id,t?`${e.id} · ${t}`:e.id)}return t&&!r.has(y(t))&&a.unshift({value:t,label:`Current (${t})`}),a.length===0?g:a.map(e=>i`<option value=${e.value}>${e.label}</option>`)}function Fu(e){let t=ou(e);if(!t)return{kind:`exact`,value:``};if(t===`*`)return{kind:`all`};if(!t.includes(`*`))return{kind:`exact`,value:t};let n=t.replace(/[.*+?^${}()|[\\]\\]/g,`\\$&`);return{kind:`regex`,value:RegExp(`^${n.replaceAll(`\\*`,`.*`)}$`)}}function Iu(e){return Array.isArray(e)?cu(e).map(Fu).filter(e=>e.kind!==`exact`||e.value.length>0):[]}function Lu(e,t){for(let n of t)if(n.kind===`all`||n.kind===`exact`&&e===n.value||n.kind===`regex`&&n.value.test(e))return!0;return!1}function Ru(e,t){if(!t)return!0;let n=ou(e);if(Lu(n,Iu(t.deny)))return!1;let r=Iu(t.allow);return!!(r.length===0||Lu(n,r)||n===`apply_patch`&&Lu(`exec`,r))}function zu(e,t){if(!Array.isArray(t)||t.length===0)return!1;let n=ou(e),r=Iu(t);return!!(Lu(n,r)||n===`apply_patch`&&Lu(`exec`,r))}function Bu(e){return lu(e)??void 0}function Vu(e){return e.chatSending||!!e.chatRunId}function Hu(e){let t=e.trim();if(!t)return!1;let n=y(t);return n===`/stop`?!0:n===`stop`||n===`esc`||n===`abort`||n===`wait`||n===`exit`}function Uu(e){let t=e.trim();if(!t)return!1;let n=y(t);return n===`/new`||n===`/reset`?!0:n.startsWith(`/new `)||n.startsWith(`/reset `)}function Wu(e){return/^\/btw(?::|\s|$)/i.test(e.trim())}async function Gu(e){if(!e.connected&&e.chatRunId){e.chatMessage=``,e.pendingAbort={runId:e.chatRunId,sessionKey:e.sessionKey};return}e.connected&&(e.chatMessage=``,await gl(e))}function Ku(e,t,n,r,i){let a=t.trim(),o=!!(n&&n.length>0);!a&&!o||(e.chatQueue=[...e.chatQueue,{id:sn(),text:a,createdAt:Date.now(),attachments:o?n?.map(e=>({...e})):void 0,refreshSessions:r,localCommandArgs:i?.args,localCommandName:i?.name}])}function qu(e,t,n,r){let i=t.trim(),a=!!(r&&r.length>0);!i&&!a||(e.chatQueue=[...e.chatQueue,{id:sn(),text:i,createdAt:Date.now(),kind:`steered`,attachments:a?r?.map(e=>({...e})):void 0,pendingRunId:n}])}async function Ju(e,t,n){Ai(e),ai(e);let r=await pl(e,t,n?.attachments),i=!!r;return!i&&n?.previousDraft!=null&&(e.chatMessage=n.previousDraft),!i&&n?.previousAttachments&&(e.chatAttachments=n.previousAttachments),i&&Qr(e,e.sessionKey),i&&n?.restoreDraft&&n.previousDraft?.trim()&&(e.chatMessage=n.previousDraft),i&&n?.restoreAttachments&&n.previousAttachments?.length&&(e.chatAttachments=n.previousAttachments),ti(e,!0),i&&!e.chatRunId&&Zu(e),i&&n?.refreshSessions&&r&&e.refreshSessionsAfterChat.add(r),i}async function Yu(e,t,n){let r=!!await ml(e,t,n?.attachments);return!r&&n?.previousDraft!=null&&(e.chatMessage=n.previousDraft),!r&&n?.previousAttachments&&(e.chatAttachments=n.previousAttachments),r&&Qr(e,e.sessionKey),r}async function Xu(e,t){if(!e.connected||!e.chatRunId)return;let n=e.chatRunId,r=e.chatQueue.find(e=>e.id===t&&!e.pendingRunId&&!e.localCommandName);if(!r)return;let i=r.text.trim(),a=r.attachments??[],o=a.length>0;if(!(!i&&!o)){if(e.chatQueue=e.chatQueue.map(e=>e.id===t?{...e,kind:`steered`,pendingRunId:n}:e),!await hl(e,i,o?a:void 0)){e.chatQueue=e.chatQueue.map(e=>e.id===t?r:e);return}Qr(e,e.sessionKey),ti(e)}}async function Zu(e){if(!e.connected||Vu(e))return;let t=e.chatQueue.findIndex(e=>!e.pendingRunId);if(t<0)return;let n=e.chatQueue[t];e.chatQueue=e.chatQueue.filter((e,n)=>n!==t);let r=!1;try{n.localCommandName?(await nd(e,n.localCommandName,n.localCommandArgs??``),r=!0):r=await Ju(e,n.text,{attachments:n.attachments,refreshSessions:n.refreshSessions})}catch(t){e.lastError=String(t)}r?e.chatQueue.length>0&&Zu(e):e.chatQueue=[n,...e.chatQueue]}function Qu(e,t){e.chatQueue=e.chatQueue.filter(e=>e.id!==t)}function $u(e,t){t&&(e.chatQueue=e.chatQueue.filter(e=>e.pendingRunId!==t))}async function ed(e,t,n){if(!e.connected)return;let r=e.chatMessage,i=(t??e.chatMessage).trim(),a=e.chatAttachments??[],o=t==null?a:[],s=o.length>0;if(!i&&!s)return;if(Hu(i)){await Gu(e);return}if(Wu(i)){t??(e.chatMessage=``,e.chatAttachments=[]),await Yu(e,i,{previousDraft:t==null?r:void 0,attachments:s?o:void 0,previousAttachments:t==null?a:void 0});return}let c=Uo(i);if(c?.command.executeLocal){if(Vu(e)&&td(c.command.key)){t??(e.chatMessage=``,e.chatAttachments=[]),Ku(e,i,void 0,Uu(i),{args:c.args,name:c.command.key});return}let a=t==null?r:void 0;t??(e.chatMessage=``,e.chatAttachments=[]),await nd(e,c.command.key,c.args,{previousDraft:a,restoreDraft:!!(t&&n?.restoreDraft)});return}let l=Uu(i);if(t??(e.chatMessage=``,e.chatAttachments=[]),Vu(e)){Ku(e,i,o,l);return}await Ju(e,i,{previousDraft:t==null?r:void 0,restoreDraft:!!(t&&n?.restoreDraft),attachments:s?o:void 0,previousAttachments:t==null?a:void 0,restoreAttachments:!!(t&&n?.restoreDraft),refreshSessions:l})}function td(e){return![`stop`,`focus`,`export-session`,`steer`,`redirect`].includes(e)}async function nd(e,t,n,r){switch(t){case`stop`:await Gu(e);return;case`new`:await Ju(e,`/new`,{refreshSessions:!0,previousDraft:r?.previousDraft,restoreDraft:r?.restoreDraft});return;case`reset`:await Ju(e,`/reset`,{refreshSessions:!0,previousDraft:r?.previousDraft,restoreDraft:r?.restoreDraft});return;case`clear`:await rd(e);return;case`focus`:e.onSlashAction?.(`toggle-focus`);return;case`export-session`:e.onSlashAction?.(`export`);return}if(!e.client)return;let i=e.sessionKey,a=await Go(e.client,i,t,n,{chatModelCatalog:e.chatModelCatalog,sessionsResult:e.sessionsResult});a.content&&id(e,a.content),a.trackRunId&&(e.chatRunId=a.trackRunId,e.chatStream=``,e.chatSending=!1),a.pendingCurrentRun&&e.chatRunId&&qu(e,`/${t} ${n}`.trim(),e.chatRunId),a.sessionPatch&&`modelOverride`in a.sessionPatch&&(e.chatModelOverrides={...e.chatModelOverrides,[i]:a.sessionPatch.modelOverride??null},e.onSlashAction?.(`refresh-tools-effective`)),a.action===`refresh`&&await ad(e),ti(e)}async function rd(e){if(!(!e.client||!e.connected)){try{await e.client.request(`sessions.reset`,{key:e.sessionKey}),e.chatMessages=[],e.chatSideResult=null,e.chatSideResultTerminalRuns?.clear(),e.chatStream=null,e.chatRunId=null,await ol(e)}catch(t){e.lastError=String(t)}ti(e)}}function id(e,t){e.chatMessages=[...e.chatMessages,{role:`system`,content:t,timestamp:Date.now()}]}async function ad(e,t){await Promise.all([ol(e),Nl(e,{activeMinutes:0,limit:0,includeGlobal:!0,includeUnknown:!0}),yd(e),od(e),sd(e)]),t?.scheduleScroll!==!1&&ti(e)}async function od(e){if(!e.client||!e.connected){e.chatModelsLoading=!1,e.chatModelCatalog=[];return}e.chatModelsLoading=!0;try{e.chatModelCatalog=await vl(e.client)}finally{e.chatModelsLoading=!1}}async function sd(e){await Lo({client:e.client,agentId:pd(e)})}var cd=Zu,ld=new WeakMap,ud=new WeakMap;function dd(e){let t=e,n=(ld.get(t)??0)+1;return ld.set(t,n),n}function fd(e,t,n){return ld.get(e)===t&&e.sessionKey===n}function pd(e){let t=la(e.sessionKey);return t?.agentId?t.agentId:(e.hello?.snapshot)?.sessionDefaults?.defaultAgentId?.trim()||`main`}function md(e,t){let n=Wl(e),r=encodeURIComponent(t);return n?`${n}/avatar/${r}?meta=1`:`/avatar/${r}?meta=1`}function hd(e){let t=e,n=ud.get(t);n&&(URL.revokeObjectURL(n),ud.delete(t)),e.chatAvatarUrl=null}function gd(e,t){let n=e,r=ud.get(n);r&&r!==t&&(URL.revokeObjectURL(r),ud.delete(n)),t?.startsWith(`blob:`)&&ud.set(n,t),e.chatAvatarUrl=t}function _d(e){return e?{Authorization:e}:void 0}function vd(e){return e.startsWith(`/`)}async function yd(e){if(!e.connected){hd(e);return}let t=e.sessionKey,n=dd(e),r=pd(e);if(!r){fd(e,n,t)&&hd(e);return}hd(e);let i=ue(e),a=_d(i),o=md(e.basePath,r);try{let r=await fetch(o,{method:`GET`,...a?{headers:a}:{}});if(!fd(e,n,t))return;if(!r.ok){hd(e);return}let s=await r.json();if(!fd(e,n,t))return;let c=typeof s.avatarUrl==`string`?s.avatarUrl.trim():``;if(!c||!gu(c)){hd(e);return}if(!i||!vd(c)){gd(e,c);return}let l=await fetch(c,{method:`GET`,headers:{Authorization:i}});if(!l.ok){fd(e,n,t)&&hd(e);return}let u=URL.createObjectURL(await l.blob());if(!fd(e,n,t)){URL.revokeObjectURL(u);return}gd(e,u)}catch{fd(e,n,t)&&hd(e)}}var bd={trace:!0,debug:!0,info:!0,warn:!0,error:!0,fatal:!0},xd={name:``,description:``,agentId:``,sessionKey:``,clearAgent:!1,enabled:!0,deleteAfterRun:!0,scheduleKind:`every`,scheduleAt:``,everyAmount:`30`,everyUnit:`minutes`,cronExpr:`0 7 * * *`,cronTz:``,scheduleExact:!1,staggerAmount:``,staggerUnit:`seconds`,sessionTarget:`isolated`,wakeMode:`now`,payloadKind:`agentTurn`,payloadText:``,payloadModel:``,payloadThinking:``,payloadLightContext:!1,deliveryMode:`announce`,deliveryChannel:`last`,deliveryTo:``,deliveryAccountId:``,deliveryBestEffort:!1,failureAlertMode:`inherit`,failureAlertAfter:`2`,failureAlertCooldownSeconds:`3600`,failureAlertChannel:`last`,failureAlertTo:``,failureAlertDeliveryMode:`announce`,failureAlertAccountId:``,timeoutSeconds:``},Sd=`operator`,Cd=`operator.admin`,wd=`operator.read`,Td=`operator.write`,Ed=`operator.`;function Dd(e){let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function Od(e,t){return e.startsWith(Ed)?t.has(Cd)?!0:e===wd?t.has(wd)||t.has(Td):e===Td?t.has(Td):t.has(e):!1}function kd(e){let t=Dd(e.requestedScopes);if(t.length===0)return!0;let n=Dd(e.allowedScopes);if(n.length===0)return!1;let r=new Set(n);if(e.role.trim()!==Sd){let n=`${e.role.trim()}.`;return t.every(e=>e.startsWith(n)&&r.has(e))}return t.every(e=>Od(e,r))}async function Ad(e){if(!(!e.client||!e.connected)&&!e.debugLoading){e.debugLoading=!0;try{let[t,n,r,i]=await Promise.all([e.client.request(`status`,{}),e.client.request(`health`,{}),e.client.request(`models.list`,{}),e.client.request(`last-heartbeat`,{})]);e.debugStatus=t,e.debugHealth=n;let a=r;e.debugModels=Array.isArray(a?.models)?a?.models:[],e.debugHeartbeat=i}catch(t){e.debugCallError=String(t)}finally{e.debugLoading=!1}}}async function jd(e){if(!(!e.client||!e.connected)){e.debugCallError=null,e.debugCallResult=null;try{let t=e.debugCallParams.trim()?JSON.parse(e.debugCallParams):{},n=await e.client.request(e.debugCallMethod.trim(),t);e.debugCallResult=JSON.stringify(n,null,2)}catch(t){e.debugCallError=String(t)}}}var Md=2e3,Nd=new Set([`trace`,`debug`,`info`,`warn`,`error`,`fatal`]);function Pd(e){if(typeof e!=`string`)return null;let t=e.trim();if(!t.startsWith(`{`)||!t.endsWith(`}`))return null;try{let e=JSON.parse(t);return e&&typeof e==`object`?e:null}catch{return null}}function Fd(e){if(typeof e!=`string`)return null;let t=y(e);return Nd.has(t)?t:null}function Id(e){if(!e.trim())return{raw:e,message:e};try{let t=JSON.parse(e),n=t&&typeof t._meta==`object`&&t._meta!==null?t._meta:null,r=typeof t.time==`string`?t.time:typeof n?.date==`string`?n?.date:null,i=Fd(n?.logLevelName??n?.level),a=typeof t[0]==`string`?t[0]:typeof n?.name==`string`?n?.name:null,o=Pd(a),s=typeof o?.subsystem==`string`?o.subsystem:typeof o?.module==`string`?o.module:null;!s&&a&&a.length<120&&(s=a);let c=typeof t[1]==`string`?t[1]:typeof t[2]==`string`?t[2]:!o&&typeof t[0]==`string`?t[0]:typeof t.message==`string`?t.message:e;return{raw:e,time:r,level:i,subsystem:s,message:c,meta:n??void 0}}catch{return{raw:e,message:e}}}async function Ld(e,t){let n=t?.quiet===!0;if(!(!e.client||!e.connected||e.logsLoading&&!n)){n||(e.logsLoading=!0),e.logsError=null;try{let n=await e.client.request(`logs.tail`,{cursor:t?.reset?void 0:e.logsCursor??void 0,limit:e.logsLimit,maxBytes:e.logsMaxBytes}),r=(Array.isArray(n.lines)?n.lines.filter(e=>typeof e==`string`):[]).map(Id);e.logsEntries=t?.reset||n.reset||e.logsCursor==null?r:[...e.logsEntries,...r].slice(-Md),e.logsCursor=typeof n.cursor==`number`?n.cursor:e.logsCursor,e.logsFile=typeof n.file==`string`?n.file:e.logsFile,e.logsTruncated=!!n.truncated,e.logsLastFetchAt=Date.now()}catch(t){bn(t)?(e.logsEntries=[],e.logsError=xn(`logs`)):e.logsError=String(t)}finally{n||(e.logsLoading=!1)}}}function Rd(e){return typeof e==`string`&&e.trim()?e.trim():null}function zd(e){return Rd(e.nodeId)}function Bd(e){return Rd(e.displayName)??zd(e)??``}function Vd(e){let t=Array.isArray(e?.commands)?e.commands:[];return Array.from(new Set(t.map(e=>Rd(e)).filter(e=>!!e))).toSorted((e,t)=>e.localeCompare(t))}function Hd(e,t){let n=Rd(t);return n?e.find(e=>zd(e)===n)??null:null}function Ud(e){return Vd(e).find(e=>e!==`system.execApprovals.get`&&e!==`system.execApprovals.set`&&e!==`system.run.prepare`)??``}function Wd(e){let t=Hd(e.nodes,e.nodeManagementSelectedId);if(t){let n=Vd(t);(!e.nodeManagementCommand||!n.includes(e.nodeManagementCommand))&&(e.nodeManagementCommand=Ud(t),e.nodeManagementParams=Yd(e.nodeManagementCommand)),e.nodeManagementRename.trim()||(e.nodeManagementRename=Bd(t));return}let n=e.nodes.find(e=>zd(e));if(!n){e.nodeManagementSelectedId=null,e.nodeManagementRename=``,e.nodeManagementCommand=``;return}Qd(e,zd(n)??``)}function Gd(e){let t=e.trim();return t?JSON.parse(t):{}}function Kd(e,t){let n=Number.parseInt(e.trim(),10);return!Number.isFinite(n)||n<=0?t:n}function qd(e){return`${e}:${globalThis.crypto?.randomUUID?.()??`${Date.now()}:${Math.random().toString(36).slice(2)}`}`}function Jd(e,t){return(Rd(e?.platform)?.toLowerCase()??``).startsWith(`win`)?[`cmd.exe`,`/d`,`/s`,`/c`,t]:[`sh`,`-lc`,t]}function Yd(e){return e===`system.which`?`{
176
176
  "bins": ["genesis", "node", "pnpm"]
177
177
  }`:e===`system.run`?`{
178
178
  "command": ["genesis", "--version"]
@@ -332,6 +332,12 @@ This replaces the current active transcript for the session key.`)}var Bl=[{labe
332
332
  <path d="M6 18a4 4 0 0 1-1.967-.516" />
333
333
  <path d="M19.967 17.484A4 4 0 0 1 18 18" />
334
334
  </svg>
335
+ `,cpu:i`
336
+ <svg viewBox="0 0 24 24">
337
+ <rect width="16" height="16" x="4" y="4" rx="2" />
338
+ <rect width="6" height="6" x="9" y="9" rx="1" />
339
+ <path d="M15 2v2M15 20v2M2 15h2M2 9h2M20 15h2M20 9h2M9 2v2M9 20v2" />
340
+ </svg>
335
341
  `,book:i`
336
342
  <svg viewBox="0 0 24 24">
337
343
  <path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20" />
@@ -731,9 +737,9 @@ ${e}
731
737
  `:g}
732
738
  </div>
733
739
  `}function Ly(e){return e>=1e6?`${(e/1e6).toFixed(1).replace(/\.0$/,``)}M`:e>=1e3?`${(e/1e3).toFixed(1).replace(/\.0$/,``)}k`:String(e)}var Ry=`genesis:deleted:`,zy=class{constructor(e){this._keys=new Set,this.key=Ry+e,this.load()}has(e){return this._keys.has(e)}delete(e){this._keys.add(e),this.save()}restore(e){this._keys.delete(e),this.save()}clear(){this._keys.clear(),this.save()}load(){try{let e=m()?.getItem(this.key);if(!e)return;let t=JSON.parse(e);Array.isArray(t)&&(this._keys=new Set(t.filter(e=>typeof e==`string`)))}catch{}}save(){try{m()?.setItem(this.key,JSON.stringify([...this._keys]))}catch{}}};function By(e,t){let n=Vy(e,t);if(!n)return;let r=new Blob([n],{type:`text/markdown`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`chat-${t}-${Date.now()}.md`,a.click(),URL.revokeObjectURL(i)}function Vy(e,t){let n=Array.isArray(e)?e:[];if(n.length===0)return null;let r=[`# Chat with ${t}`,``];for(let e of n){let n=e,i=n.role===`user`?`You`:n.role===`assistant`?t:`Tool`,a=ac(e)??``,o=typeof n.timestamp==`number`?new Date(n.timestamp).toISOString():``;r.push(`## ${i}${o?` (${o})`:``}`,``,a,``)}return r.join(`
734
- `)}var Hy=class extends Ag{constructor(e){if(super(e),this.it=g,e.type!==Og.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(e){if(e===g||e==null)return this._t=void 0,this.it=e;if(e===r)return e;if(typeof e!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Hy.directiveName=`unsafeHTML`,Hy.resultType=1;var Uy=kg(Hy),Wy=class{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}},Gy=class{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(e=>this.Z=e)}resume(){this.Z?.(),this.Y=this.Z=void 0}},Ky=e=>!yg(e)&&typeof e.then==`function`,qy=1073741823,Jy=kg(class extends Lg{constructor(){super(...arguments),this._$Cwt=qy,this._$Cbt=[],this._$CK=new Wy(this),this._$CX=new Gy}render(...e){return e.find(e=>!Ky(e))??r}update(e,t){let n=this._$Cbt,i=n.length;this._$Cbt=t;let a=this._$CK,o=this._$CX;this.isConnected||this.disconnected();for(let e=0;e<t.length&&!(e>this._$Cwt);e++){let r=t[e];if(!Ky(r))return this._$Cwt=e,r;e<i&&r===n[e]||(this._$Cwt=qy,i=0,Promise.resolve(r).then(async e=>{for(;o.get();)await o.get();let t=a.deref();if(t!==void 0){let n=t._$Cbt.indexOf(r);n>-1&&n<t._$Cwt&&(t._$Cwt=n,t.setValue(e))}}))}return r}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}}),Yy=50,Xy=200;function Zy(e){let t=Ih(e?.name,Yy)??`Assistant`,n=Ih(e?.avatar??void 0,Xy)??null;return{agentId:typeof e?.agentId==`string`&&e.agentId.trim()?e.agentId.trim():null,name:t,avatar:n}}var{entries:Qy,setPrototypeOf:$y,isFrozen:eb,getPrototypeOf:tb,getOwnPropertyDescriptor:nb}=Object,{freeze:rb,seal:ib,create:ab}=Object,{apply:ob,construct:sb}=typeof Reflect<`u`&&Reflect;rb||=function(e){return e},ib||=function(e){return e},ob||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},sb||=function(e){return new e(...[...arguments].slice(1))};var cb=Ob(Array.prototype.forEach),lb=Ob(Array.prototype.lastIndexOf),ub=Ob(Array.prototype.pop),db=Ob(Array.prototype.push),fb=Ob(Array.prototype.splice),pb=Array.isArray,mb=Ob(String.prototype.toLowerCase),hb=Ob(String.prototype.toString),gb=Ob(String.prototype.match),_b=Ob(String.prototype.replace),vb=Ob(String.prototype.indexOf),yb=Ob(String.prototype.trim),bb=Ob(Number.prototype.toString),xb=Ob(Boolean.prototype.toString),Sb=typeof BigInt>`u`?null:Ob(BigInt.prototype.toString),Cb=typeof Symbol>`u`?null:Ob(Symbol.prototype.toString),wb=Ob(Object.prototype.hasOwnProperty),Tb=Ob(Object.prototype.toString),Eb=Ob(RegExp.prototype.test),Db=kb(TypeError);function Ob(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ob(e,t,n)}}function kb(e){return function(){return sb(e,[...arguments])}}function Y(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mb;if($y&&$y(e,null),!pb(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(eb(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Ab(e){for(let t=0;t<e.length;t++)wb(e,t)||(e[t]=null);return e}function jb(e){let t=ab(null);for(let[n,r]of Qy(e))wb(e,n)&&(pb(r)?t[n]=Ab(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=jb(r):t[n]=r);return t}function Mb(e){switch(typeof e){case`string`:return e;case`number`:return bb(e);case`boolean`:return xb(e);case`bigint`:return Sb?Sb(e):`0`;case`symbol`:return Cb?Cb(e):`Symbol()`;case`undefined`:return Tb(e);case`function`:case`object`:{if(e===null)return Tb(e);let t=e,n=Nb(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Tb(e)}return Tb(e)}default:return Tb(e)}}function Nb(e,t){for(;e!==null;){let n=nb(e,t);if(n){if(n.get)return Ob(n.get);if(typeof n.value==`function`)return Ob(n.value)}e=tb(e)}function n(){return null}return n}function Pb(e){try{return Eb(e,``),!0}catch{return!1}}var Fb=rb(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Ib=rb(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Lb=rb([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Rb=rb([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),zb=rb(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Bb=rb([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Vb=rb([`#text`]),Hb=rb(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Ub=rb(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Wb=rb(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Gb=rb([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Kb=ib(/\{\{[\w\W]*|[\w\W]*\}\}/gm),qb=ib(/<%[\w\W]*|[\w\W]*%>/gm),Jb=ib(/\$\{[\w\W]*/gm),Yb=ib(/^data-[\-\w.\u00B7-\uFFFF]+$/),Xb=ib(/^aria-[\-\w]+$/),Zb=ib(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Qb=ib(/^(?:\w+script|data):/i),$b=ib(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ex=ib(/^html$/i),tx=ib(/^[a-z][.\w]*(-[.\w]+)+$/i),nx=Object.freeze({__proto__:null,ARIA_ATTR:Xb,ATTR_WHITESPACE:$b,CUSTOM_ELEMENT:tx,DATA_ATTR:Yb,DOCTYPE_NAME:ex,ERB_EXPR:qb,IS_ALLOWED_URI:Zb,IS_SCRIPT_OR_DATA:Qb,MUSTACHE_EXPR:Kb,TMPLIT_EXPR:Jb}),rx={element:1,text:3,progressingInstruction:7,comment:8,document:9},ix=function(){return typeof window>`u`?null:window},ax=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},ox=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function sx(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ix(),t=e=>sx(e);if(t.version=`3.4.1`,t.removed=[],!e||!e.document||e.document.nodeType!==rx.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=Nb(m,`cloneNode`),g=Nb(m,`remove`),_=Nb(m,`nextSibling`),v=Nb(m,`childNodes`),y=Nb(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let b,x=``,{implementation:S,createNodeIterator:ee,createDocumentFragment:C,getElementsByTagName:te}=n,{importNode:ne}=r,w=ox();t.isSupported=typeof Qy==`function`&&typeof y==`function`&&S&&S.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:re,ERB_EXPR:T,TMPLIT_EXPR:E,DATA_ATTR:ie,ARIA_ATTR:D,IS_SCRIPT_OR_DATA:O,ATTR_WHITESPACE:k,CUSTOM_ELEMENT:ae}=nx,{IS_ALLOWED_URI:A}=nx,j=null,oe=Y({},[...Fb,...Ib,...Lb,...zb,...Vb]),M=null,N=Y({},[...Hb,...Ub,...Wb,...Gb]),se=Object.seal(ab(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ce=null,P=null,F=Object.seal(ab(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),I=!0,le=!0,ue=!1,de=!0,L=!1,fe=!0,pe=!1,R=!1,z=!1,me=!1,he=!1,B=!1,ge=!0,_e=!1,V=`user-content-`,ve=!0,H=!1,ye={},be=null,xe=Y({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),Se=null,Ce=Y({},[`audio`,`video`,`img`,`source`,`image`,`track`]),we=null,Te=Y({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),U=`http://www.w3.org/1998/Math/MathML`,Ee=`http://www.w3.org/2000/svg`,De=`http://www.w3.org/1999/xhtml`,Oe=De,ke=!1,Ae=null,je=Y({},[U,Ee,De],hb),Me=Y({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ne=Y({},[`annotation-xml`]),Pe=Y({},[`title`,`style`,`font`,`a`,`script`]),Fe=null,Ie=[`application/xhtml+xml`,`text/html`],Le=null,Re=null,ze=n.createElement(`form`),Be=function(e){return e instanceof RegExp||e instanceof Function},Ve=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Re&&Re===e)return;(!e||typeof e!=`object`)&&(e={}),e=jb(e),Fe=Ie.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Le=Fe===`application/xhtml+xml`?hb:mb,j=wb(e,`ALLOWED_TAGS`)&&pb(e.ALLOWED_TAGS)?Y({},e.ALLOWED_TAGS,Le):oe,M=wb(e,`ALLOWED_ATTR`)&&pb(e.ALLOWED_ATTR)?Y({},e.ALLOWED_ATTR,Le):N,Ae=wb(e,`ALLOWED_NAMESPACES`)&&pb(e.ALLOWED_NAMESPACES)?Y({},e.ALLOWED_NAMESPACES,hb):je,we=wb(e,`ADD_URI_SAFE_ATTR`)&&pb(e.ADD_URI_SAFE_ATTR)?Y(jb(Te),e.ADD_URI_SAFE_ATTR,Le):Te,Se=wb(e,`ADD_DATA_URI_TAGS`)&&pb(e.ADD_DATA_URI_TAGS)?Y(jb(Ce),e.ADD_DATA_URI_TAGS,Le):Ce,be=wb(e,`FORBID_CONTENTS`)&&pb(e.FORBID_CONTENTS)?Y({},e.FORBID_CONTENTS,Le):xe,ce=wb(e,`FORBID_TAGS`)&&pb(e.FORBID_TAGS)?Y({},e.FORBID_TAGS,Le):jb({}),P=wb(e,`FORBID_ATTR`)&&pb(e.FORBID_ATTR)?Y({},e.FORBID_ATTR,Le):jb({}),ye=wb(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?jb(e.USE_PROFILES):e.USE_PROFILES:!1,I=e.ALLOW_ARIA_ATTR!==!1,le=e.ALLOW_DATA_ATTR!==!1,ue=e.ALLOW_UNKNOWN_PROTOCOLS||!1,de=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,L=e.SAFE_FOR_TEMPLATES||!1,fe=e.SAFE_FOR_XML!==!1,pe=e.WHOLE_DOCUMENT||!1,me=e.RETURN_DOM||!1,he=e.RETURN_DOM_FRAGMENT||!1,B=e.RETURN_TRUSTED_TYPE||!1,z=e.FORCE_BODY||!1,ge=e.SANITIZE_DOM!==!1,_e=e.SANITIZE_NAMED_PROPS||!1,ve=e.KEEP_CONTENT!==!1,H=e.IN_PLACE||!1,A=Pb(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Zb,Oe=typeof e.NAMESPACE==`string`?e.NAMESPACE:De,Me=wb(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?jb(e.MATHML_TEXT_INTEGRATION_POINTS):Y({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ne=wb(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?jb(e.HTML_INTEGRATION_POINTS):Y({},[`annotation-xml`]);let t=wb(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?jb(e.CUSTOM_ELEMENT_HANDLING):ab(null);if(se=ab(null),wb(t,`tagNameCheck`)&&Be(t.tagNameCheck)&&(se.tagNameCheck=t.tagNameCheck),wb(t,`attributeNameCheck`)&&Be(t.attributeNameCheck)&&(se.attributeNameCheck=t.attributeNameCheck),wb(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(se.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),L&&(le=!1),he&&(me=!0),ye&&(j=Y({},Vb),M=ab(null),ye.html===!0&&(Y(j,Fb),Y(M,Hb)),ye.svg===!0&&(Y(j,Ib),Y(M,Ub),Y(M,Gb)),ye.svgFilters===!0&&(Y(j,Lb),Y(M,Ub),Y(M,Gb)),ye.mathMl===!0&&(Y(j,zb),Y(M,Wb),Y(M,Gb))),F.tagCheck=null,F.attributeCheck=null,wb(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?F.tagCheck=e.ADD_TAGS:pb(e.ADD_TAGS)&&(j===oe&&(j=jb(j)),Y(j,e.ADD_TAGS,Le))),wb(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?F.attributeCheck=e.ADD_ATTR:pb(e.ADD_ATTR)&&(M===N&&(M=jb(M)),Y(M,e.ADD_ATTR,Le))),wb(e,`ADD_URI_SAFE_ATTR`)&&pb(e.ADD_URI_SAFE_ATTR)&&Y(we,e.ADD_URI_SAFE_ATTR,Le),wb(e,`FORBID_CONTENTS`)&&pb(e.FORBID_CONTENTS)&&(be===xe&&(be=jb(be)),Y(be,e.FORBID_CONTENTS,Le)),wb(e,`ADD_FORBID_CONTENTS`)&&pb(e.ADD_FORBID_CONTENTS)&&(be===xe&&(be=jb(be)),Y(be,e.ADD_FORBID_CONTENTS,Le)),ve&&(j[`#text`]=!0),pe&&Y(j,[`html`,`head`,`body`]),j.table&&(Y(j,[`tbody`]),delete ce.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Db(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Db(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);b=e.TRUSTED_TYPES_POLICY,x=b.createHTML(``)}else b===void 0&&(b=ax(p,i)),b!==null&&typeof x==`string`&&(x=b.createHTML(``));rb&&rb(e),Re=e},He=Y({},[...Ib,...Lb,...Rb]),Ue=Y({},[...zb,...Bb]),We=function(e){let t=y(e);(!t||!t.tagName)&&(t={namespaceURI:Oe,tagName:`template`});let n=mb(e.tagName),r=mb(t.tagName);return Ae[e.namespaceURI]?e.namespaceURI===Ee?t.namespaceURI===De?n===`svg`:t.namespaceURI===U?n===`svg`&&(r===`annotation-xml`||Me[r]):!!He[n]:e.namespaceURI===U?t.namespaceURI===De?n===`math`:t.namespaceURI===Ee?n===`math`&&Ne[r]:!!Ue[n]:e.namespaceURI===De?t.namespaceURI===Ee&&!Ne[r]||t.namespaceURI===U&&!Me[r]?!1:!Ue[n]&&(Pe[n]||!He[n]):!!(Fe===`application/xhtml+xml`&&Ae[e.namespaceURI]):!1},Ge=function(e){db(t.removed,{element:e});try{y(e).removeChild(e)}catch{g(e)}},Ke=function(e,n){try{db(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{db(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(me||he)try{Ge(n)}catch{}else try{n.setAttribute(e,``)}catch{}},qe=function(e){let t=null,r=null;if(z)e=`<remove></remove>`+e;else{let t=gb(e,/^[\r\n\t ]+/);r=t&&t[0]}Fe===`application/xhtml+xml`&&Oe===De&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=b?b.createHTML(e):e;if(Oe===De)try{t=new f().parseFromString(i,Fe)}catch{}if(!t||!t.documentElement){t=S.createDocument(Oe,`template`,null);try{t.documentElement.innerHTML=ke?x:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Oe===De?te.call(t,pe?`html`:`body`)[0]:pe?t.documentElement:a},Je=function(e){return ee.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Ye=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},Xe=function(e){return typeof s==`function`&&e instanceof s};function Ze(e,n,r){cb(e,e=>{e.call(t,n,r,Re)})}let Qe=function(e){let n=null;if(Ze(w.beforeSanitizeElements,e,null),Ye(e))return Ge(e),!0;let r=Le(e.nodeName);if(Ze(w.uponSanitizeElement,e,{tagName:r,allowedTags:j}),fe&&e.hasChildNodes()&&!Xe(e.firstElementChild)&&Eb(/<[/\w!]/g,e.innerHTML)&&Eb(/<[/\w!]/g,e.textContent)||fe&&e.namespaceURI===De&&r===`style`&&Xe(e.firstElementChild)||e.nodeType===rx.progressingInstruction||fe&&e.nodeType===rx.comment&&Eb(/<[/\w]/g,e.data))return Ge(e),!0;if(ce[r]||!(F.tagCheck instanceof Function&&F.tagCheck(r))&&!j[r]){if(!ce[r]&&tt(r)&&(se.tagNameCheck instanceof RegExp&&Eb(se.tagNameCheck,r)||se.tagNameCheck instanceof Function&&se.tagNameCheck(r)))return!1;if(ve&&!be[r]){let t=y(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=h(n[i],!0);t.insertBefore(r,_(e))}}}return Ge(e),!0}return e instanceof c&&!We(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Eb(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ge(e),!0):(L&&e.nodeType===rx.text&&(n=e.textContent,cb([re,T,E],e=>{n=_b(n,e,` `)}),e.textContent!==n&&(db(t.removed,{element:e.cloneNode()}),e.textContent=n)),Ze(w.afterSanitizeElements,e,null),!1)},$e=function(e,t,r){if(P[t]||ge&&(t===`id`||t===`name`)&&(r in n||r in ze))return!1;if(!(le&&!P[t]&&Eb(ie,t))&&!(I&&Eb(D,t))&&!(F.attributeCheck instanceof Function&&F.attributeCheck(t,e))){if(!M[t]||P[t]){if(!(tt(e)&&(se.tagNameCheck instanceof RegExp&&Eb(se.tagNameCheck,e)||se.tagNameCheck instanceof Function&&se.tagNameCheck(e))&&(se.attributeNameCheck instanceof RegExp&&Eb(se.attributeNameCheck,t)||se.attributeNameCheck instanceof Function&&se.attributeNameCheck(t,e))||t===`is`&&se.allowCustomizedBuiltInElements&&(se.tagNameCheck instanceof RegExp&&Eb(se.tagNameCheck,r)||se.tagNameCheck instanceof Function&&se.tagNameCheck(r))))return!1}else if(!we[t]&&!Eb(A,_b(r,k,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&vb(r,`data:`)===0&&Se[e])&&!(ue&&!Eb(O,_b(r,k,``)))&&r)return!1}return!0},et=Y({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),tt=function(e){return!et[mb(e)]&&Eb(ae,e)},nt=function(e){Ze(w.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||Ye(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=Le(a),l=s,u=a===`value`?l:yb(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,Ze(w.uponSanitizeAttribute,e,r),u=r.attrValue,_e&&(c===`id`||c===`name`)&&vb(u,V)!==0&&(Ke(a,e),u=V+u),fe&&Eb(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){Ke(a,e);continue}if(c===`attributename`&&gb(u,`href`)){Ke(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Ke(a,e);continue}if(!de&&Eb(/\/>/i,u)){Ke(a,e);continue}L&&cb([re,T,E],e=>{u=_b(u,e,` `)});let d=Le(e.nodeName);if(!$e(d,c,u)){Ke(a,e);continue}if(b&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=b.createHTML(u);break;case`TrustedScriptURL`:u=b.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),Ye(e)?Ge(e):ub(t.removed)}catch{Ke(a,e)}}Ze(w.afterSanitizeAttributes,e,null)},rt=function(e){let t=null,n=Je(e);for(Ze(w.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)Ze(w.uponSanitizeShadowNode,t,null),Qe(t),nt(t),t.content instanceof a&&rt(t.content);Ze(w.afterSanitizeShadowDOM,e,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(ke=!e,ke&&(e=`<!-->`),typeof e!=`string`&&!Xe(e)&&(e=Mb(e),typeof e!=`string`))throw Db(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(R||Ve(n),t.removed=[],typeof e==`string`&&(H=!1),H){let t=e.nodeName;if(typeof t==`string`){let e=Le(t);if(!j[e]||ce[e])throw Db(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=qe(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===rx.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!me&&!L&&!pe&&e.indexOf(`<`)===-1)return b&&B?b.createHTML(e):e;if(i=qe(e),!i)return me?null:B?x:``}i&&z&&Ge(i.firstChild);let u=Je(H?e:i);for(;c=u.nextNode();)Qe(c),nt(c),c.content instanceof a&&rt(c.content);if(H)return e;if(me){if(L){i.normalize();let e=i.innerHTML;cb([re,T,E],t=>{e=_b(e,t,` `)}),i.innerHTML=e}if(he)for(l=C.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(M.shadowroot||M.shadowrootmode)&&(l=ne.call(r,l,!0)),l}let d=pe?i.outerHTML:i.innerHTML;return pe&&j[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Eb(ex,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
735
- `+d),L&&cb([re,T,E],e=>{d=_b(d,e,` `)}),b&&B?b.createHTML(d):d},t.setConfig=function(){Ve(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),R=!0},t.clearConfig=function(){Re=null,R=!1},t.isValidAttribute=function(e,t,n){return Re||Ve({}),$e(Le(e),Le(t),n)},t.addHook=function(e,t){typeof t==`function`&&db(w[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=lb(w[e],t);return n===-1?void 0:fb(w[e],n,1)[0]}return ub(w[e])},t.removeHooks=function(e){w[e]=[]},t.removeAllHooks=function(){w=ox()},t}var cx=sx(),lx={};function ux(e){let t=lx[e];if(t)return t;t=lx[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function dx(e,t){typeof t!=`string`&&(t=dx.defaultChars);let n=ux(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128){t+=n[a];continue}if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;e<128?t+=`��`:t+=String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;e<2048||e>=55296&&e<=57343?t+=`���`:t+=String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}return t})}dx.defaultChars=`;/?:@&=+$,#`,dx.componentChars=``;var fx={};function px(e){let t=fx[e];if(t)return t;t=fx[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function mx(e,t,n){typeof t!=`string`&&(n=t,t=mx.defaultChars),n===void 0&&(n=!0);let r=px(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue}if(o<128){i+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`;continue}i+=encodeURIComponent(e[t])}return i}mx.defaultChars=`;/?:@&=+$,-_.!~*'()#`,mx.componentChars=`-_.!~*'()`;function hx(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function gx(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var _x=/^([a-z0-9.+-]+:)/i,vx=/:[0-9]*$/,yx=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,bx=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
736
- `,` `],xx=[`/`,`?`,`#`],Sx=255,Cx=/^[+a-z0-9A-Z_-]{0,63}$/,wx=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Tx={javascript:!0,"javascript:":!0},Ex={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Dx(e,t){if(e&&e instanceof gx)return e;let n=new gx;return n.parse(e,t),n}gx.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=yx.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=_x.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&Tx[o])&&(a=a.substr(2),this.slashes=!0)),!Tx[o]&&(i||o&&!Ex[o])){let e=-1;for(let t=0;t<xx.length;t++)r=a.indexOf(xx[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<bx.length;t++)r=a.indexOf(bx[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(Cx)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(Cx)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(wx);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>Sx&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),Ex[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},gx.prototype.parseHost=function(e){let t=vx.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var Ox=j({decode:()=>dx,encode:()=>mx,format:()=>hx,parse:()=>Dx}),kx=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ax=/[\0-\x1F\x7F-\x9F]/,jx=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Mx=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Nx=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Px=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Fx=j({Any:()=>kx,Cc:()=>Ax,Cf:()=>jx,P:()=>Mx,S:()=>Nx,Z:()=>Px}),Ix=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),Lx=new Uint16Array(`Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢`.split(``).map(e=>e.charCodeAt(0))),Rx=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),zx=String.fromCodePoint??function(e){let t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function Bx(e){return e>=55296&&e<=57343||e>1114111?65533:Rx.get(e)??e}var Vx;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(Vx||={});var Hx=32,Ux;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(Ux||={});function Wx(e){return e>=Vx.ZERO&&e<=Vx.NINE}function Gx(e){return e>=Vx.UPPER_A&&e<=Vx.UPPER_F||e>=Vx.LOWER_A&&e<=Vx.LOWER_F}function Kx(e){return e>=Vx.UPPER_A&&e<=Vx.UPPER_Z||e>=Vx.LOWER_A&&e<=Vx.LOWER_Z||Wx(e)}function qx(e){return e===Vx.EQUALS||Kx(e)}var Jx;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(Jx||={});var Yx;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Yx||={});var Xx=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Jx.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Yx.Strict}startEntity(e){this.decodeMode=e,this.state=Jx.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Jx.EntityStart:return e.charCodeAt(t)===Vx.NUM?(this.state=Jx.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Jx.NamedEntity,this.stateNamedEntity(e,t));case Jx.NumericStart:return this.stateNumericStart(e,t);case Jx.NumericDecimal:return this.stateNumericDecimal(e,t);case Jx.NumericHex:return this.stateNumericHex(e,t);case Jx.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Hx)===Vx.LOWER_X?(this.state=Jx.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Jx.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(Wx(r)||Gx(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(Wx(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Vx.SEMI)this.consumed+=1;else if(this.decodeMode===Yx.Strict)return 0;return this.emitCodePoint(Bx(this.result),this.consumed),this.errors&&(e!==Vx.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&Ux.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=Qx(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===Yx.Attribute&&(i===0||qx(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&Ux.VALUE_LENGTH)>>14,i!==0){if(a===Vx.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Yx.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&Ux.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~Ux.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case Jx.NamedEntity:return this.result!==0&&(this.decodeMode!==Yx.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Jx.NumericDecimal:return this.emitNumericEntity(0,2);case Jx.NumericHex:return this.emitNumericEntity(0,3);case Jx.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Jx.EntityStart:return 0}}};function Zx(e){let t=``,n=new Xx(e,e=>t+=zx(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function Qx(e,t,n,r){let i=(t&Ux.BRANCH_LENGTH)>>7,a=t&Ux.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var $x=Zx(Ix);Zx(Lx);function eS(e,t=Yx.Legacy){return $x(e,t)}var tS=j({arrayReplaceAt:()=>sS,assign:()=>oS,escapeHtml:()=>bS,escapeRE:()=>SS,fromCodePoint:()=>lS,has:()=>aS,isMdAsciiPunct:()=>ES,isPunctChar:()=>TS,isSpace:()=>CS,isString:()=>rS,isValidEntityCode:()=>cS,isWhiteSpace:()=>wS,lib:()=>OS,normalizeReference:()=>DS,unescapeAll:()=>hS,unescapeMd:()=>mS});function nS(e){return Object.prototype.toString.call(e)}function rS(e){return nS(e)===`[object String]`}var iS=Object.prototype.hasOwnProperty;function aS(e,t){return iS.call(e,t)}function oS(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!=`object`)throw TypeError(t+`must be object`);Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function sS(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function cS(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function lS(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var uS=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,dS=RegExp(uS.source+`|&([a-z#][a-z0-9]{1,31});`,`gi`),fS=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function pS(e,t){if(t.charCodeAt(0)===35&&fS.test(t)){let n=t[1].toLowerCase()===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return cS(n)?lS(n):e}let n=eS(e);return n===e?e:n}function mS(e){return e.indexOf(`\\`)<0?e:e.replace(uS,`$1`)}function hS(e){return e.indexOf(`\\`)<0&&e.indexOf(`&`)<0?e:e.replace(dS,function(e,t,n){return t||pS(e,n)})}var gS=/[&<>"]/,_S=/[&<>"]/g,vS={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`};function yS(e){return vS[e]}function bS(e){return gS.test(e)?e.replace(_S,yS):e}var xS=/[.?*+^$[\]\\(){}|-]/g;function SS(e){return e.replace(xS,`\\$&`)}function CS(e){switch(e){case 9:case 32:return!0}return!1}function wS(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function TS(e){return Mx.test(e)||Nx.test(e)}function ES(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function DS(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}var OS={mdurl:Ox,ucmicro:Fx};function kS(e,t,n){let r,i,a,o,s=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<s;){if(a=e.src.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}}let l=-1;return i&&(l=e.pos),e.pos=c,l}function AS(e,t,n){let r,i=t,a={ok:!1,pos:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=hS(e.slice(t+1,i)),a.ok=!0,a;if(r===92&&i+1<n){i+=2;continue}i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0?a:(a.str=hS(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function jS(e,t,n,r){let i,a=t,o={ok:!1,can_continue:!1,pos:0,str:``,marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(a>=n)return o;let r=e.charCodeAt(a);if(r!==34&&r!==39&&r!==40)return o;t++,a++,r===40&&(r=41),o.marker=r}for(;a<n;){if(i=e.charCodeAt(a),i===o.marker)return o.pos=a+1,o.str+=hS(e.slice(t,a)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=hS(e.slice(t,a)),o}var MS=j({parseLinkDestination:()=>AS,parseLinkLabel:()=>kS,parseLinkTitle:()=>jS}),NS={};NS.code_inline=function(e,t,n,r,i){let a=e[t];return`<code`+i.renderAttrs(a)+`>`+bS(a.content)+`</code>`},NS.code_block=function(e,t,n,r,i){let a=e[t];return`<pre`+i.renderAttrs(a)+`><code>`+bS(e[t].content)+`</code></pre>
740
+ `)}var Hy=class extends Ag{constructor(e){if(super(e),this.it=g,e.type!==Og.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(e){if(e===g||e==null)return this._t=void 0,this.it=e;if(e===r)return e;if(typeof e!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Hy.directiveName=`unsafeHTML`,Hy.resultType=1;var Uy=kg(Hy),Wy=class{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}},Gy=class{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(e=>this.Z=e)}resume(){this.Z?.(),this.Y=this.Z=void 0}},Ky=e=>!yg(e)&&typeof e.then==`function`,qy=1073741823,Jy=kg(class extends Lg{constructor(){super(...arguments),this._$Cwt=qy,this._$Cbt=[],this._$CK=new Wy(this),this._$CX=new Gy}render(...e){return e.find(e=>!Ky(e))??r}update(e,t){let n=this._$Cbt,i=n.length;this._$Cbt=t;let a=this._$CK,o=this._$CX;this.isConnected||this.disconnected();for(let e=0;e<t.length&&!(e>this._$Cwt);e++){let r=t[e];if(!Ky(r))return this._$Cwt=e,r;e<i&&r===n[e]||(this._$Cwt=qy,i=0,Promise.resolve(r).then(async e=>{for(;o.get();)await o.get();let t=a.deref();if(t!==void 0){let n=t._$Cbt.indexOf(r);n>-1&&n<t._$Cwt&&(t._$Cwt=n,t.setValue(e))}}))}return r}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}}),Yy=50,Xy=200;function Zy(e){let t=Ih(e?.name,Yy)??`Assistant`,n=Ih(e?.avatar??void 0,Xy)??null;return{agentId:typeof e?.agentId==`string`&&e.agentId.trim()?e.agentId.trim():null,name:t,avatar:n}}var{entries:Qy,setPrototypeOf:$y,isFrozen:eb,getPrototypeOf:tb,getOwnPropertyDescriptor:nb}=Object,{freeze:rb,seal:ib,create:ab}=Object,{apply:ob,construct:sb}=typeof Reflect<`u`&&Reflect;rb||=function(e){return e},ib||=function(e){return e},ob||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},sb||=function(e){return new e(...[...arguments].slice(1))};var cb=Ob(Array.prototype.forEach),lb=Ob(Array.prototype.lastIndexOf),ub=Ob(Array.prototype.pop),db=Ob(Array.prototype.push),fb=Ob(Array.prototype.splice),pb=Array.isArray,mb=Ob(String.prototype.toLowerCase),hb=Ob(String.prototype.toString),gb=Ob(String.prototype.match),_b=Ob(String.prototype.replace),vb=Ob(String.prototype.indexOf),yb=Ob(String.prototype.trim),bb=Ob(Number.prototype.toString),xb=Ob(Boolean.prototype.toString),Sb=typeof BigInt>`u`?null:Ob(BigInt.prototype.toString),Cb=typeof Symbol>`u`?null:Ob(Symbol.prototype.toString),wb=Ob(Object.prototype.hasOwnProperty),Tb=Ob(Object.prototype.toString),Eb=Ob(RegExp.prototype.test),Db=kb(TypeError);function Ob(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ob(e,t,n)}}function kb(e){return function(){return sb(e,[...arguments])}}function Y(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mb;if($y&&$y(e,null),!pb(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(eb(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Ab(e){for(let t=0;t<e.length;t++)wb(e,t)||(e[t]=null);return e}function jb(e){let t=ab(null);for(let[n,r]of Qy(e))wb(e,n)&&(pb(r)?t[n]=Ab(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=jb(r):t[n]=r);return t}function Mb(e){switch(typeof e){case`string`:return e;case`number`:return bb(e);case`boolean`:return xb(e);case`bigint`:return Sb?Sb(e):`0`;case`symbol`:return Cb?Cb(e):`Symbol()`;case`undefined`:return Tb(e);case`function`:case`object`:{if(e===null)return Tb(e);let t=e,n=Nb(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Tb(e)}return Tb(e)}default:return Tb(e)}}function Nb(e,t){for(;e!==null;){let n=nb(e,t);if(n){if(n.get)return Ob(n.get);if(typeof n.value==`function`)return Ob(n.value)}e=tb(e)}function n(){return null}return n}function Pb(e){try{return Eb(e,``),!0}catch{return!1}}var Fb=rb(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Ib=rb(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Lb=rb([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Rb=rb([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),zb=rb(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Bb=rb([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Vb=rb([`#text`]),Hb=rb(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Ub=rb(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Wb=rb(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Gb=rb([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Kb=ib(/\{\{[\w\W]*|[\w\W]*\}\}/gm),qb=ib(/<%[\w\W]*|[\w\W]*%>/gm),Jb=ib(/\$\{[\w\W]*/gm),Yb=ib(/^data-[\-\w.\u00B7-\uFFFF]+$/),Xb=ib(/^aria-[\-\w]+$/),Zb=ib(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Qb=ib(/^(?:\w+script|data):/i),$b=ib(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ex=ib(/^html$/i),tx=ib(/^[a-z][.\w]*(-[.\w]+)+$/i),nx=Object.freeze({__proto__:null,ARIA_ATTR:Xb,ATTR_WHITESPACE:$b,CUSTOM_ELEMENT:tx,DATA_ATTR:Yb,DOCTYPE_NAME:ex,ERB_EXPR:qb,IS_ALLOWED_URI:Zb,IS_SCRIPT_OR_DATA:Qb,MUSTACHE_EXPR:Kb,TMPLIT_EXPR:Jb}),rx={element:1,text:3,progressingInstruction:7,comment:8,document:9},ix=function(){return typeof window>`u`?null:window},ax=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},ox=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function sx(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ix(),t=e=>sx(e);if(t.version=`3.4.1`,t.removed=[],!e||!e.document||e.document.nodeType!==rx.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=Nb(m,`cloneNode`),g=Nb(m,`remove`),_=Nb(m,`nextSibling`),v=Nb(m,`childNodes`),y=Nb(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let b,x=``,{implementation:S,createNodeIterator:ee,createDocumentFragment:C,getElementsByTagName:te}=n,{importNode:ne}=r,w=ox();t.isSupported=typeof Qy==`function`&&typeof y==`function`&&S&&S.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:re,ERB_EXPR:T,TMPLIT_EXPR:ie,DATA_ATTR:ae,ARIA_ATTR:E,IS_SCRIPT_OR_DATA:D,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:oe}=nx,{IS_ALLOWED_URI:k}=nx,A=null,se=Y({},[...Fb,...Ib,...Lb,...zb,...Vb]),j=null,M=Y({},[...Hb,...Ub,...Wb,...Gb]),N=Object.seal(ab(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ce=null,P=null,F=Object.seal(ab(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),I=!0,le=!0,ue=!1,de=!0,L=!1,fe=!0,pe=!1,R=!1,z=!1,me=!1,he=!1,B=!1,ge=!0,_e=!1,V=`user-content-`,ve=!0,H=!1,ye={},be=null,xe=Y({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),Se=null,Ce=Y({},[`audio`,`video`,`img`,`source`,`image`,`track`]),we=null,Te=Y({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),U=`http://www.w3.org/1998/Math/MathML`,Ee=`http://www.w3.org/2000/svg`,De=`http://www.w3.org/1999/xhtml`,Oe=De,ke=!1,Ae=null,je=Y({},[U,Ee,De],hb),Me=Y({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ne=Y({},[`annotation-xml`]),Pe=Y({},[`title`,`style`,`font`,`a`,`script`]),Fe=null,Ie=[`application/xhtml+xml`,`text/html`],Le=null,Re=null,ze=n.createElement(`form`),Be=function(e){return e instanceof RegExp||e instanceof Function},Ve=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Re&&Re===e)return;(!e||typeof e!=`object`)&&(e={}),e=jb(e),Fe=Ie.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Le=Fe===`application/xhtml+xml`?hb:mb,A=wb(e,`ALLOWED_TAGS`)&&pb(e.ALLOWED_TAGS)?Y({},e.ALLOWED_TAGS,Le):se,j=wb(e,`ALLOWED_ATTR`)&&pb(e.ALLOWED_ATTR)?Y({},e.ALLOWED_ATTR,Le):M,Ae=wb(e,`ALLOWED_NAMESPACES`)&&pb(e.ALLOWED_NAMESPACES)?Y({},e.ALLOWED_NAMESPACES,hb):je,we=wb(e,`ADD_URI_SAFE_ATTR`)&&pb(e.ADD_URI_SAFE_ATTR)?Y(jb(Te),e.ADD_URI_SAFE_ATTR,Le):Te,Se=wb(e,`ADD_DATA_URI_TAGS`)&&pb(e.ADD_DATA_URI_TAGS)?Y(jb(Ce),e.ADD_DATA_URI_TAGS,Le):Ce,be=wb(e,`FORBID_CONTENTS`)&&pb(e.FORBID_CONTENTS)?Y({},e.FORBID_CONTENTS,Le):xe,ce=wb(e,`FORBID_TAGS`)&&pb(e.FORBID_TAGS)?Y({},e.FORBID_TAGS,Le):jb({}),P=wb(e,`FORBID_ATTR`)&&pb(e.FORBID_ATTR)?Y({},e.FORBID_ATTR,Le):jb({}),ye=wb(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?jb(e.USE_PROFILES):e.USE_PROFILES:!1,I=e.ALLOW_ARIA_ATTR!==!1,le=e.ALLOW_DATA_ATTR!==!1,ue=e.ALLOW_UNKNOWN_PROTOCOLS||!1,de=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,L=e.SAFE_FOR_TEMPLATES||!1,fe=e.SAFE_FOR_XML!==!1,pe=e.WHOLE_DOCUMENT||!1,me=e.RETURN_DOM||!1,he=e.RETURN_DOM_FRAGMENT||!1,B=e.RETURN_TRUSTED_TYPE||!1,z=e.FORCE_BODY||!1,ge=e.SANITIZE_DOM!==!1,_e=e.SANITIZE_NAMED_PROPS||!1,ve=e.KEEP_CONTENT!==!1,H=e.IN_PLACE||!1,k=Pb(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Zb,Oe=typeof e.NAMESPACE==`string`?e.NAMESPACE:De,Me=wb(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?jb(e.MATHML_TEXT_INTEGRATION_POINTS):Y({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ne=wb(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?jb(e.HTML_INTEGRATION_POINTS):Y({},[`annotation-xml`]);let t=wb(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?jb(e.CUSTOM_ELEMENT_HANDLING):ab(null);if(N=ab(null),wb(t,`tagNameCheck`)&&Be(t.tagNameCheck)&&(N.tagNameCheck=t.tagNameCheck),wb(t,`attributeNameCheck`)&&Be(t.attributeNameCheck)&&(N.attributeNameCheck=t.attributeNameCheck),wb(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(N.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),L&&(le=!1),he&&(me=!0),ye&&(A=Y({},Vb),j=ab(null),ye.html===!0&&(Y(A,Fb),Y(j,Hb)),ye.svg===!0&&(Y(A,Ib),Y(j,Ub),Y(j,Gb)),ye.svgFilters===!0&&(Y(A,Lb),Y(j,Ub),Y(j,Gb)),ye.mathMl===!0&&(Y(A,zb),Y(j,Wb),Y(j,Gb))),F.tagCheck=null,F.attributeCheck=null,wb(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?F.tagCheck=e.ADD_TAGS:pb(e.ADD_TAGS)&&(A===se&&(A=jb(A)),Y(A,e.ADD_TAGS,Le))),wb(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?F.attributeCheck=e.ADD_ATTR:pb(e.ADD_ATTR)&&(j===M&&(j=jb(j)),Y(j,e.ADD_ATTR,Le))),wb(e,`ADD_URI_SAFE_ATTR`)&&pb(e.ADD_URI_SAFE_ATTR)&&Y(we,e.ADD_URI_SAFE_ATTR,Le),wb(e,`FORBID_CONTENTS`)&&pb(e.FORBID_CONTENTS)&&(be===xe&&(be=jb(be)),Y(be,e.FORBID_CONTENTS,Le)),wb(e,`ADD_FORBID_CONTENTS`)&&pb(e.ADD_FORBID_CONTENTS)&&(be===xe&&(be=jb(be)),Y(be,e.ADD_FORBID_CONTENTS,Le)),ve&&(A[`#text`]=!0),pe&&Y(A,[`html`,`head`,`body`]),A.table&&(Y(A,[`tbody`]),delete ce.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Db(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Db(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);b=e.TRUSTED_TYPES_POLICY,x=b.createHTML(``)}else b===void 0&&(b=ax(p,i)),b!==null&&typeof x==`string`&&(x=b.createHTML(``));rb&&rb(e),Re=e},He=Y({},[...Ib,...Lb,...Rb]),Ue=Y({},[...zb,...Bb]),We=function(e){let t=y(e);(!t||!t.tagName)&&(t={namespaceURI:Oe,tagName:`template`});let n=mb(e.tagName),r=mb(t.tagName);return Ae[e.namespaceURI]?e.namespaceURI===Ee?t.namespaceURI===De?n===`svg`:t.namespaceURI===U?n===`svg`&&(r===`annotation-xml`||Me[r]):!!He[n]:e.namespaceURI===U?t.namespaceURI===De?n===`math`:t.namespaceURI===Ee?n===`math`&&Ne[r]:!!Ue[n]:e.namespaceURI===De?t.namespaceURI===Ee&&!Ne[r]||t.namespaceURI===U&&!Me[r]?!1:!Ue[n]&&(Pe[n]||!He[n]):!!(Fe===`application/xhtml+xml`&&Ae[e.namespaceURI]):!1},Ge=function(e){db(t.removed,{element:e});try{y(e).removeChild(e)}catch{g(e)}},Ke=function(e,n){try{db(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{db(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(me||he)try{Ge(n)}catch{}else try{n.setAttribute(e,``)}catch{}},qe=function(e){let t=null,r=null;if(z)e=`<remove></remove>`+e;else{let t=gb(e,/^[\r\n\t ]+/);r=t&&t[0]}Fe===`application/xhtml+xml`&&Oe===De&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=b?b.createHTML(e):e;if(Oe===De)try{t=new f().parseFromString(i,Fe)}catch{}if(!t||!t.documentElement){t=S.createDocument(Oe,`template`,null);try{t.documentElement.innerHTML=ke?x:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Oe===De?te.call(t,pe?`html`:`body`)[0]:pe?t.documentElement:a},Je=function(e){return ee.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Ye=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},Xe=function(e){return typeof s==`function`&&e instanceof s};function Ze(e,n,r){cb(e,e=>{e.call(t,n,r,Re)})}let Qe=function(e){let n=null;if(Ze(w.beforeSanitizeElements,e,null),Ye(e))return Ge(e),!0;let r=Le(e.nodeName);if(Ze(w.uponSanitizeElement,e,{tagName:r,allowedTags:A}),fe&&e.hasChildNodes()&&!Xe(e.firstElementChild)&&Eb(/<[/\w!]/g,e.innerHTML)&&Eb(/<[/\w!]/g,e.textContent)||fe&&e.namespaceURI===De&&r===`style`&&Xe(e.firstElementChild)||e.nodeType===rx.progressingInstruction||fe&&e.nodeType===rx.comment&&Eb(/<[/\w]/g,e.data))return Ge(e),!0;if(ce[r]||!(F.tagCheck instanceof Function&&F.tagCheck(r))&&!A[r]){if(!ce[r]&&tt(r)&&(N.tagNameCheck instanceof RegExp&&Eb(N.tagNameCheck,r)||N.tagNameCheck instanceof Function&&N.tagNameCheck(r)))return!1;if(ve&&!be[r]){let t=y(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=h(n[i],!0);t.insertBefore(r,_(e))}}}return Ge(e),!0}return e instanceof c&&!We(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Eb(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ge(e),!0):(L&&e.nodeType===rx.text&&(n=e.textContent,cb([re,T,ie],e=>{n=_b(n,e,` `)}),e.textContent!==n&&(db(t.removed,{element:e.cloneNode()}),e.textContent=n)),Ze(w.afterSanitizeElements,e,null),!1)},$e=function(e,t,r){if(P[t]||ge&&(t===`id`||t===`name`)&&(r in n||r in ze))return!1;if(!(le&&!P[t]&&Eb(ae,t))&&!(I&&Eb(E,t))&&!(F.attributeCheck instanceof Function&&F.attributeCheck(t,e))){if(!j[t]||P[t]){if(!(tt(e)&&(N.tagNameCheck instanceof RegExp&&Eb(N.tagNameCheck,e)||N.tagNameCheck instanceof Function&&N.tagNameCheck(e))&&(N.attributeNameCheck instanceof RegExp&&Eb(N.attributeNameCheck,t)||N.attributeNameCheck instanceof Function&&N.attributeNameCheck(t,e))||t===`is`&&N.allowCustomizedBuiltInElements&&(N.tagNameCheck instanceof RegExp&&Eb(N.tagNameCheck,r)||N.tagNameCheck instanceof Function&&N.tagNameCheck(r))))return!1}else if(!we[t]&&!Eb(k,_b(r,O,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&vb(r,`data:`)===0&&Se[e])&&!(ue&&!Eb(D,_b(r,O,``)))&&r)return!1}return!0},et=Y({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),tt=function(e){return!et[mb(e)]&&Eb(oe,e)},nt=function(e){Ze(w.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||Ye(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=Le(a),l=s,u=a===`value`?l:yb(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,Ze(w.uponSanitizeAttribute,e,r),u=r.attrValue,_e&&(c===`id`||c===`name`)&&vb(u,V)!==0&&(Ke(a,e),u=V+u),fe&&Eb(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){Ke(a,e);continue}if(c===`attributename`&&gb(u,`href`)){Ke(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Ke(a,e);continue}if(!de&&Eb(/\/>/i,u)){Ke(a,e);continue}L&&cb([re,T,ie],e=>{u=_b(u,e,` `)});let d=Le(e.nodeName);if(!$e(d,c,u)){Ke(a,e);continue}if(b&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=b.createHTML(u);break;case`TrustedScriptURL`:u=b.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),Ye(e)?Ge(e):ub(t.removed)}catch{Ke(a,e)}}Ze(w.afterSanitizeAttributes,e,null)},rt=function(e){let t=null,n=Je(e);for(Ze(w.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)Ze(w.uponSanitizeShadowNode,t,null),Qe(t),nt(t),t.content instanceof a&&rt(t.content);Ze(w.afterSanitizeShadowDOM,e,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(ke=!e,ke&&(e=`<!-->`),typeof e!=`string`&&!Xe(e)&&(e=Mb(e),typeof e!=`string`))throw Db(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(R||Ve(n),t.removed=[],typeof e==`string`&&(H=!1),H){let t=e.nodeName;if(typeof t==`string`){let e=Le(t);if(!A[e]||ce[e])throw Db(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=qe(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===rx.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!me&&!L&&!pe&&e.indexOf(`<`)===-1)return b&&B?b.createHTML(e):e;if(i=qe(e),!i)return me?null:B?x:``}i&&z&&Ge(i.firstChild);let u=Je(H?e:i);for(;c=u.nextNode();)Qe(c),nt(c),c.content instanceof a&&rt(c.content);if(H)return e;if(me){if(L){i.normalize();let e=i.innerHTML;cb([re,T,ie],t=>{e=_b(e,t,` `)}),i.innerHTML=e}if(he)for(l=C.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(j.shadowroot||j.shadowrootmode)&&(l=ne.call(r,l,!0)),l}let d=pe?i.outerHTML:i.innerHTML;return pe&&A[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Eb(ex,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
741
+ `+d),L&&cb([re,T,ie],e=>{d=_b(d,e,` `)}),b&&B?b.createHTML(d):d},t.setConfig=function(){Ve(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),R=!0},t.clearConfig=function(){Re=null,R=!1},t.isValidAttribute=function(e,t,n){return Re||Ve({}),$e(Le(e),Le(t),n)},t.addHook=function(e,t){typeof t==`function`&&db(w[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=lb(w[e],t);return n===-1?void 0:fb(w[e],n,1)[0]}return ub(w[e])},t.removeHooks=function(e){w[e]=[]},t.removeAllHooks=function(){w=ox()},t}var cx=sx(),lx={};function ux(e){let t=lx[e];if(t)return t;t=lx[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function dx(e,t){typeof t!=`string`&&(t=dx.defaultChars);let n=ux(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128){t+=n[a];continue}if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;e<128?t+=`��`:t+=String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;e<2048||e>=55296&&e<=57343?t+=`���`:t+=String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}return t})}dx.defaultChars=`;/?:@&=+$,#`,dx.componentChars=``;var fx={};function px(e){let t=fx[e];if(t)return t;t=fx[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function mx(e,t,n){typeof t!=`string`&&(n=t,t=mx.defaultChars),n===void 0&&(n=!0);let r=px(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue}if(o<128){i+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`;continue}i+=encodeURIComponent(e[t])}return i}mx.defaultChars=`;/?:@&=+$,-_.!~*'()#`,mx.componentChars=`-_.!~*'()`;function hx(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function gx(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var _x=/^([a-z0-9.+-]+:)/i,vx=/:[0-9]*$/,yx=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,bx=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
742
+ `,` `],xx=[`/`,`?`,`#`],Sx=255,Cx=/^[+a-z0-9A-Z_-]{0,63}$/,wx=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Tx={javascript:!0,"javascript:":!0},Ex={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Dx(e,t){if(e&&e instanceof gx)return e;let n=new gx;return n.parse(e,t),n}gx.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=yx.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=_x.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&Tx[o])&&(a=a.substr(2),this.slashes=!0)),!Tx[o]&&(i||o&&!Ex[o])){let e=-1;for(let t=0;t<xx.length;t++)r=a.indexOf(xx[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<bx.length;t++)r=a.indexOf(bx[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(Cx)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(Cx)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(wx);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>Sx&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),Ex[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},gx.prototype.parseHost=function(e){let t=vx.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var Ox=A({decode:()=>dx,encode:()=>mx,format:()=>hx,parse:()=>Dx}),kx=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ax=/[\0-\x1F\x7F-\x9F]/,jx=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Mx=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Nx=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Px=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Fx=A({Any:()=>kx,Cc:()=>Ax,Cf:()=>jx,P:()=>Mx,S:()=>Nx,Z:()=>Px}),Ix=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),Lx=new Uint16Array(`Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢`.split(``).map(e=>e.charCodeAt(0))),Rx=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),zx=String.fromCodePoint??function(e){let t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function Bx(e){return e>=55296&&e<=57343||e>1114111?65533:Rx.get(e)??e}var Vx;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(Vx||={});var Hx=32,Ux;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(Ux||={});function Wx(e){return e>=Vx.ZERO&&e<=Vx.NINE}function Gx(e){return e>=Vx.UPPER_A&&e<=Vx.UPPER_F||e>=Vx.LOWER_A&&e<=Vx.LOWER_F}function Kx(e){return e>=Vx.UPPER_A&&e<=Vx.UPPER_Z||e>=Vx.LOWER_A&&e<=Vx.LOWER_Z||Wx(e)}function qx(e){return e===Vx.EQUALS||Kx(e)}var Jx;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(Jx||={});var Yx;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Yx||={});var Xx=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Jx.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Yx.Strict}startEntity(e){this.decodeMode=e,this.state=Jx.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Jx.EntityStart:return e.charCodeAt(t)===Vx.NUM?(this.state=Jx.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Jx.NamedEntity,this.stateNamedEntity(e,t));case Jx.NumericStart:return this.stateNumericStart(e,t);case Jx.NumericDecimal:return this.stateNumericDecimal(e,t);case Jx.NumericHex:return this.stateNumericHex(e,t);case Jx.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Hx)===Vx.LOWER_X?(this.state=Jx.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Jx.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(Wx(r)||Gx(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(Wx(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Vx.SEMI)this.consumed+=1;else if(this.decodeMode===Yx.Strict)return 0;return this.emitCodePoint(Bx(this.result),this.consumed),this.errors&&(e!==Vx.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&Ux.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=Qx(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===Yx.Attribute&&(i===0||qx(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&Ux.VALUE_LENGTH)>>14,i!==0){if(a===Vx.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Yx.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&Ux.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~Ux.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case Jx.NamedEntity:return this.result!==0&&(this.decodeMode!==Yx.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Jx.NumericDecimal:return this.emitNumericEntity(0,2);case Jx.NumericHex:return this.emitNumericEntity(0,3);case Jx.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Jx.EntityStart:return 0}}};function Zx(e){let t=``,n=new Xx(e,e=>t+=zx(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function Qx(e,t,n,r){let i=(t&Ux.BRANCH_LENGTH)>>7,a=t&Ux.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var $x=Zx(Ix);Zx(Lx);function eS(e,t=Yx.Legacy){return $x(e,t)}var tS=A({arrayReplaceAt:()=>sS,assign:()=>oS,escapeHtml:()=>bS,escapeRE:()=>SS,fromCodePoint:()=>lS,has:()=>aS,isMdAsciiPunct:()=>ES,isPunctChar:()=>TS,isSpace:()=>CS,isString:()=>rS,isValidEntityCode:()=>cS,isWhiteSpace:()=>wS,lib:()=>OS,normalizeReference:()=>DS,unescapeAll:()=>hS,unescapeMd:()=>mS});function nS(e){return Object.prototype.toString.call(e)}function rS(e){return nS(e)===`[object String]`}var iS=Object.prototype.hasOwnProperty;function aS(e,t){return iS.call(e,t)}function oS(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!=`object`)throw TypeError(t+`must be object`);Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function sS(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function cS(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function lS(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var uS=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,dS=RegExp(uS.source+`|&([a-z#][a-z0-9]{1,31});`,`gi`),fS=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function pS(e,t){if(t.charCodeAt(0)===35&&fS.test(t)){let n=t[1].toLowerCase()===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return cS(n)?lS(n):e}let n=eS(e);return n===e?e:n}function mS(e){return e.indexOf(`\\`)<0?e:e.replace(uS,`$1`)}function hS(e){return e.indexOf(`\\`)<0&&e.indexOf(`&`)<0?e:e.replace(dS,function(e,t,n){return t||pS(e,n)})}var gS=/[&<>"]/,_S=/[&<>"]/g,vS={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`};function yS(e){return vS[e]}function bS(e){return gS.test(e)?e.replace(_S,yS):e}var xS=/[.?*+^$[\]\\(){}|-]/g;function SS(e){return e.replace(xS,`\\$&`)}function CS(e){switch(e){case 9:case 32:return!0}return!1}function wS(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function TS(e){return Mx.test(e)||Nx.test(e)}function ES(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function DS(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}var OS={mdurl:Ox,ucmicro:Fx};function kS(e,t,n){let r,i,a,o,s=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<s;){if(a=e.src.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}}let l=-1;return i&&(l=e.pos),e.pos=c,l}function AS(e,t,n){let r,i=t,a={ok:!1,pos:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=hS(e.slice(t+1,i)),a.ok=!0,a;if(r===92&&i+1<n){i+=2;continue}i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0?a:(a.str=hS(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function jS(e,t,n,r){let i,a=t,o={ok:!1,can_continue:!1,pos:0,str:``,marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(a>=n)return o;let r=e.charCodeAt(a);if(r!==34&&r!==39&&r!==40)return o;t++,a++,r===40&&(r=41),o.marker=r}for(;a<n;){if(i=e.charCodeAt(a),i===o.marker)return o.pos=a+1,o.str+=hS(e.slice(t,a)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=hS(e.slice(t,a)),o}var MS=A({parseLinkDestination:()=>AS,parseLinkLabel:()=>kS,parseLinkTitle:()=>jS}),NS={};NS.code_inline=function(e,t,n,r,i){let a=e[t];return`<code`+i.renderAttrs(a)+`>`+bS(a.content)+`</code>`},NS.code_block=function(e,t,n,r,i){let a=e[t];return`<pre`+i.renderAttrs(a)+`><code>`+bS(e[t].content)+`</code></pre>
737
743
  `},NS.fence=function(e,t,n,r,i){let a=e[t],o=a.info?hS(a.info).trim():``,s=``,c=``;if(o){let e=o.split(/(\s+)/g);s=e[0],c=e.slice(2).join(``)}let l;if(l=n.highlight&&n.highlight(a.content,s,c)||bS(a.content),l.indexOf(`<pre`)===0)return l+`
738
744
  `;if(o){let e=a.attrIndex(`class`),t=a.attrs?a.attrs.slice():[];e<0?t.push([`class`,n.langPrefix+s]):(t[e]=t[e].slice(),t[e][1]+=` `+n.langPrefix+s);let r={attrs:t};return`<pre><code${i.renderAttrs(r)}>${l}</code></pre>\n`}return`<pre><code${i.renderAttrs(a)}>${l}</code></pre>\n`},NS.image=function(e,t,n,r,i){let a=e[t];return a.attrs[a.attrIndex(`alt`)][1]=i.renderInlineAsText(a.children,n,r),i.renderToken(e,t,n)},NS.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
739
745
  `:`<br>
@@ -745,7 +751,7 @@ ${e}
745
751
  `:`>`,i},PS.prototype.renderInline=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;i[o]===void 0?r+=this.renderToken(e,a,t):r+=i[o](e,a,t,n,this)}return r},PS.prototype.renderInlineAsText=function(e,t,n){let r=``;for(let i=0,a=e.length;i<a;i++)switch(e[i].type){case`text`:r+=e[i].content;break;case`image`:r+=this.renderInlineAsText(e[i].children,t,n);break;case`html_inline`:case`html_block`:r+=e[i].content;break;case`softbreak`:case`hardbreak`:r+=`
746
752
  `;break;default:}return r},PS.prototype.render=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;o===`inline`?r+=this.renderInline(e[a].children,t,n):i[o]===void 0?r+=this.renderToken(e,a,t,n):r+=i[o](e,a,t,n,this)}return r};function FS(){this.__rules__=[],this.__cache__=null}FS.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},FS.prototype.__compile__=function(){let e=this,t=[``];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},FS.prototype.at=function(e,t,n){let r=this.__find__(e),i=n||{};if(r===-1)throw Error(`Parser rule not found: `+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},FS.prototype.before=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},FS.prototype.after=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},FS.prototype.push=function(e,t,n){let r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},FS.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!0,n.push(e)},this),this.__cache__=null,n},FS.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},FS.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!1,n.push(e)},this),this.__cache__=null,n},FS.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function IS(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content=``,this.markup=``,this.info=``,this.meta=null,this.block=!1,this.hidden=!1}IS.prototype.attrIndex=function(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1},IS.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},IS.prototype.attrSet=function(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},IS.prototype.attrGet=function(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},IS.prototype.attrJoin=function(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+` `+t};function LS(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}LS.prototype.Token=IS;var RS=/\r\n?|\n/g,zS=/\0/g;function BS(e){let t;t=e.src.replace(RS,`
747
753
  `),t=t.replace(zS,`�`),e.src=t}function VS(e){let t;e.inlineMode?(t=new e.Token(`inline`,``,0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function HS(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];r.type===`inline`&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function US(e){return/^<a[>\s]/i.test(e)}function WS(e){return/^<\/a\s*>/i.test(e)}function GS(e){let t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!==`inline`||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,i=0;for(let a=r.length-1;a>=0;a--){let o=r[a];if(o.type===`link_close`){for(a--;r[a].level!==o.level&&r[a].type!==`link_open`;)a--;continue}if(o.type===`html_inline`&&(US(o.content)&&i>0&&i--,WS(o.content)&&i++),!(i>0)&&o.type===`text`&&e.md.linkify.test(o.content)){let i=o.content,s=e.md.linkify.match(i),c=[],l=o.level,u=0;s.length>0&&s[0].index===0&&a>0&&r[a-1].type===`text_special`&&(s=s.slice(1));for(let t=0;t<s.length;t++){let n=s[t].url,r=e.md.normalizeLink(n);if(!e.md.validateLink(r))continue;let a=s[t].text;a=s[t].schema?s[t].schema===`mailto:`&&!/^mailto:/i.test(a)?e.md.normalizeLinkText(`mailto:`+a).replace(/^mailto:/,``):e.md.normalizeLinkText(a):e.md.normalizeLinkText(`http://`+a).replace(/^http:\/\//,``);let o=s[t].index;if(o>u){let t=new e.Token(`text`,``,0);t.content=i.slice(u,o),t.level=l,c.push(t)}let d=new e.Token(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=l++,d.markup=`linkify`,d.info=`auto`,c.push(d);let f=new e.Token(`text`,``,0);f.content=a,f.level=l,c.push(f);let p=new e.Token(`link_close`,`a`,-1);p.level=--l,p.markup=`linkify`,p.info=`auto`,c.push(p),u=s[t].lastIndex}if(u<i.length){let t=new e.Token(`text`,``,0);t.content=i.slice(u),t.level=l,c.push(t)}t[n].children=r=sS(r,a,c)}}}}var KS=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,qS=/\((c|tm|r)\)/i,JS=/\((c|tm|r)\)/gi,YS={c:`©`,r:`®`,tm:`™`};function XS(e,t){return YS[t.toLowerCase()]}function ZS(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(JS,XS)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function QS(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&KS.test(r.content)&&(r.content=r.content.replace(/\+-/g,`±`).replace(/\.{2,}/g,`…`).replace(/([?!])…/g,`$1..`).replace(/([?!]){4,}/g,`$1$1$1`).replace(/,{2,}/g,`,`).replace(/(^|[^-])---(?=[^-]|$)/gm,`$1—`).replace(/(^|\s)--(?=\s|$)/gm,`$1–`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1–`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function $S(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(qS.test(e.tokens[t].content)&&ZS(e.tokens[t].children),KS.test(e.tokens[t].content)&&QS(e.tokens[t].children))}var eC=/['"]/,tC=/['"]/g,nC=`’`;function rC(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function iC(e,t){let n,r=[];for(let i=0;i<e.length;i++){let a=e[i],o=e[i].level;for(n=r.length-1;n>=0&&!(r[n].level<=o);n--);if(r.length=n+1,a.type!==`text`)continue;let s=a.content,c=0,l=s.length;OUTER:for(;c<l;){tC.lastIndex=c;let u=tC.exec(s);if(!u)break;let d=!0,f=!0;c=u.index+1;let p=u[0]===`'`,m=32;if(u.index-1>=0)m=s.charCodeAt(u.index-1);else for(n=i-1;n>=0&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(c<l)h=s.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=ES(m)||TS(String.fromCharCode(m)),_=ES(h)||TS(String.fromCharCode(h)),v=wS(m),y=wS(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&u[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f){p&&(a.content=rC(a.content,u.index,nC));continue}if(f)for(n=r.length-1;n>=0;n--){let d=r[n];if(r[n].level<o)break;if(d.single===p&&r[n].level===o){d=r[n];let o,f;p?(o=t.md.options.quotes[2],f=t.md.options.quotes[3]):(o=t.md.options.quotes[0],f=t.md.options.quotes[1]),a.content=rC(a.content,u.index,f),e[d.token].content=rC(e[d.token].content,d.pos,o),c+=f.length-1,d.token===i&&(c+=o.length-1),s=a.content,l=s.length,r.length=n;continue OUTER}}d?r.push({token:i,pos:u.index,single:p,level:o}):f&&p&&(a.content=rC(a.content,u.index,nC))}}}function aC(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!==`inline`||!eC.test(e.tokens[t].content)||iC(e.tokens[t].children,e)}function oC(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if(r[e].type!==`inline`)continue;let i=r[e].children,a=i.length;for(t=0;t<a;t++)i[t].type===`text_special`&&(i[t].type=`text`);for(t=n=0;t<a;t++)i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var sC=[[`normalize`,BS],[`block`,VS],[`inline`,HS],[`linkify`,GS],[`replacements`,$S],[`smartquotes`,aC],[`text_join`,oC]];function cC(){this.ruler=new FS;for(let e=0;e<sC.length;e++)this.ruler.push(sC[e][0],sC[e][1])}cC.prototype.process=function(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)},cC.prototype.State=LS;function lC(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType=`root`,this.level=0;let i=this.src;for(let e=0,t=0,n=0,r=0,a=i.length,o=!1;t<a;t++){let s=i.charCodeAt(t);if(!o)if(CS(s)){n++,s===9?r+=4-r%4:r++;continue}else o=!0;(s===10||t===a-1)&&(s!==10&&t++,this.bMarks.push(e),this.eMarks.push(t),this.tShift.push(n),this.sCount.push(r),this.bsCount.push(0),o=!1,n=0,r=0,e=t+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}lC.prototype.push=function(e,t,n){let r=new IS(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},lC.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},lC.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},lC.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&CS(this.src.charCodeAt(e));e++);return e},lC.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!CS(this.src.charCodeAt(--e)))return e+1;return e},lC.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},lC.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},lC.prototype.getLines=function(e,t,n,r){if(e>=t)return``;let i=Array(t-e);for(let a=0,o=e;o<t;o++,a++){let e=0,s=this.bMarks[o],c=s,l;for(l=o+1<t||r?this.eMarks[o]+1:this.eMarks[o];c<l&&e<n;){let t=this.src.charCodeAt(c);if(CS(t))t===9?e+=4-(e+this.bsCount[o])%4:e++;else if(c-s<this.tShift[o])e++;else break;c++}e>n?i[a]=Array(e-n+1).join(` `)+this.src.slice(c,l):i[a]=this.src.slice(c,l)}return i.join(``)},lC.prototype.Token=IS;var uC=65536;function dC(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function fC(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function pC(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!CS(s)||o===45&&CS(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!CS(t))return!1;a++}let c=dC(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=dC(e,t).trim(),c.indexOf(`|`)===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=fC(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRules(`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v,y=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=dC(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=fC(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>uC))break;if(i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}function mC(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=e.getLines(t,i,4+e.blkIndent,!1)+`
748
- `,a.map=[t,e.line],!0}function hC(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}function gC(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;let s=[],c=[],l=[],u=[],d=e.md.block.ruler.getRules(`blockquote`),f=e.parentType;e.parentType=`blockquote`;let p=!1,m;for(m=t;m<n;m++){let t=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!t){let t=e.sCount[m]+1,n,r;e.src.charCodeAt(i)===32?(i++,t++,r=!1,n=!0):e.src.charCodeAt(i)===9?(n=!0,(e.bsCount[m]+t)%4==3?(i++,t++,r=!1):r=!0):n=!1;let o=t;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let t=e.src.charCodeAt(i);if(CS(t))t===9?o+=4-(o+e.bsCount[m]+ +!!r)%4:o++;else break;i++}p=i>=a,c.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+ +!!n,l.push(e.sCount[m]),e.sCount[m]=o-t,u.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let r=!1;for(let t=0,i=d.length;t<i;t++)if(d[t](e,m,n,!0)){r=!0;break}if(r){e.lineMax=m,e.blkIndent!==0&&(s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]=-1}let h=e.blkIndent;e.blkIndent=0;let g=e.push(`blockquote_open`,`blockquote`,1);g.markup=`>`;let _=[t,0];g.map=_,e.md.block.tokenize(e,t,m);let v=e.push(`blockquote_close`,`blockquote`,-1);v.markup=`>`,e.lineMax=o,e.parentType=f,_[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=s[n],e.tShift[n+t]=u[n],e.sCount[n+t]=l[n],e.bsCount[n+t]=c[n];return e.blkIndent=h,!0}function _C(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!CS(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=Array(s+1).join(String.fromCharCode(o)),!0}function vC(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!CS(e.src.charCodeAt(r))?-1:r}function yC(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=r)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return i<r&&(a=e.src.charCodeAt(i),!CS(a))?-1:i}function bC(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type===`paragraph_open`&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function xC(e,t,n,r){let i,a,o,s,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let u=!1;r&&e.parentType===`paragraph`&&e.sCount[c]>=e.blkIndent&&(u=!0);let d,f,p;if((p=yC(e,c))>=0){if(d=!0,o=e.bMarks[c]+e.tShift[c],f=Number(e.src.slice(o,p-1)),u&&f!==1)return!1}else if((p=vC(e,c))>=0)d=!1;else return!1;if(u&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(r)return!0;let m=e.src.charCodeAt(p-1),h=e.tokens.length;d?(s=e.push(`ordered_list_open`,`ol`,1),f!==1&&(s.attrs=[[`start`,f]])):s=e.push(`bullet_list_open`,`ul`,1);let g=[c,0];s.map=g,s.markup=String.fromCharCode(m);let _=!1,v=e.md.block.ruler.getRules(`list`),y=e.parentType;for(e.parentType=`list`;c<n;){a=p,i=e.eMarks[c];let t=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]),r=t;for(;a<i;){let t=e.src.charCodeAt(a);if(t===9)r+=4-(r+e.bsCount[c])%4;else if(t===32)r++;else break;a++}let u=a,f;f=u>=i?1:r-t,f>4&&(f=1);let h=t+f;s=e.push(`list_item_open`,`li`,1),s.markup=String.fromCharCode(m);let g=[c,0];s.map=g,d&&(s.info=e.src.slice(o,p-1));let y=e.tight,b=e.tShift[c],x=e.sCount[c],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=h,e.tight=!0,e.tShift[c]=u-e.bMarks[c],e.sCount[c]=r,u>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||_)&&(l=!1),_=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[c]=b,e.sCount[c]=x,e.tight=y,s=e.push(`list_item_close`,`li`,-1),s.markup=String.fromCharCode(m),c=e.line,g[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let ee=!1;for(let t=0,r=v.length;t<r;t++)if(v[t](e,c,n,!0)){ee=!0;break}if(ee)break;if(d){if(p=yC(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=vC(e,c),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return s=d?e.push(`ordered_list_close`,`ol`,-1):e.push(`bullet_list_close`,`ul`,-1),s.markup=String.fromCharCode(m),g[1]=c,e.line=c,e.parentType=y,l&&bC(e,h),!0}function SC(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function s(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules(`reference`),i=e.parentType;e.parentType=`reference`;let a=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let c=e.src.slice(i,a+1);a=c.length;let l=-1;for(i=1;i<a;i++){let e=c.charCodeAt(i);if(e===91)return!1;if(e===93){l=i;break}else if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(e===92&&(i++,i<a&&c.charCodeAt(i)===10)){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}}if(l<0||c.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!CS(e))break}let u=e.md.helpers.parseLinkDestination(c,i,a);if(!u.ok)return!1;let d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;let f=i,p=o,m=i;for(;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!CS(e))break}let h=e.md.helpers.parseLinkTitle(c,i,a);for(;h.can_continue;){let t=s(o);if(t===null)break;c+=t,i=a,a=c.length,o++,h=e.md.helpers.parseLinkTitle(c,i,a,h)}let g;for(i<a&&m!==i&&h.ok?(g=h.str,i=h.pos):(g=``,i=f,o=p);i<a&&CS(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&CS(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10)return!1;let _=DS(c.slice(1,l));return _?r?!0:(e.env.references===void 0&&(e.env.references={}),e.env.references[_]===void 0&&(e.env.references[_]={title:g,href:d}),e.line=o,!0):!1}var CC=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),wC=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,TC=RegExp(`^(?:`+wC+`|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),EC=RegExp(`^(?:`+wC+`|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>)`),DC=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(`+CC.join(`|`)+`)(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(EC.source+`\\s*$`),/^$/,!1]];function OC(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<DC.length&&!DC[s][0].test(o);s++);if(s===DC.length)return!1;if(r)return DC[s][2];let c=t+1;if(!DC[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent);c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),DC[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let l=e.push(`html_block`,``,0);return l.map=[t,c],l.content=e.getLines(t,c,e.blkIndent,!0),!0}function kC(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=a)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i<a&&s<=6;)s++,o=e.src.charCodeAt(++i);if(s>6||i<a&&!CS(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&CS(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;let l=e.push(`heading_open`,`h`+String(s),1);l.markup=`########`.slice(0,s),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=e.src.slice(i,a).trim(),u.map=[t,e.line],u.children=[];let d=e.push(`heading_close`,`h`+String(s),-1);return d.markup=`########`.slice(0,s),!0}function AC(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`);if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType=`paragraph`;let a=0,o,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let t=e.bMarks[s]+e.tShift[s],n=e.eMarks[s];if(t<n&&(o=e.src.charCodeAt(t),(o===45||o===61)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){a=o===61?1:2;break}}if(e.sCount[s]<0)continue;let t=!1;for(let i=0,a=r.length;i<a;i++)if(r[i](e,s,n,!0)){t=!0;break}if(t)break}if(!a)return!1;let c=e.getLines(t,s,e.blkIndent,!1).trim();e.line=s+1;let l=e.push(`heading_open`,`h`+String(a),1);l.markup=String.fromCharCode(o),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=c,u.map=[t,e.line-1],u.children=[];let d=e.push(`heading_close`,`h`+String(a),-1);return d.markup=String.fromCharCode(o),e.parentType=i,!0}function jC(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`),i=e.parentType,a=t+1;for(e.parentType=`paragraph`;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}let o=e.getLines(t,a,e.blkIndent,!1).trim();e.line=a;let s=e.push(`paragraph_open`,`p`,1);s.map=[t,e.line];let c=e.push(`inline`,``,0);return c.content=o,c.map=[t,e.line],c.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}var MC=[[`table`,pC,[`paragraph`,`reference`]],[`code`,mC],[`fence`,hC,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,gC,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,_C,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,xC,[`paragraph`,`reference`,`blockquote`]],[`reference`,SC],[`html_block`,OC,[`paragraph`,`reference`,`blockquote`]],[`heading`,kC,[`paragraph`,`reference`,`blockquote`]],[`lheading`,AC],[`paragraph`,jC]];function NC(){this.ruler=new FS;for(let e=0;e<MC.length;e++)this.ruler.push(MC[e][0],MC[e][1],{alt:(MC[e][2]||[]).slice()})}NC.prototype.tokenize=function(e,t,n){let r=this.ruler.getRules(``),i=r.length,a=e.md.options.maxNesting,o=t,s=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=a){e.line=n;break}let t=e.line,c=!1;for(let a=0;a<i;a++)if(c=r[a](e,o,n,!1),c){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!c)throw Error(`none of the block rules matched`);e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),o=e.line,o<n&&e.isEmpty(o)&&(s=!0,o++,e.line=o)}},NC.prototype.parse=function(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)},NC.prototype.State=lC;function PC(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending=``,this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}PC.prototype.pushPending=function(){let e=new IS(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e},PC.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new IS(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},PC.prototype.scanDelims=function(e,t){let n=this.posMax,r=this.src.charCodeAt(e),i=e>0?this.src.charCodeAt(e-1):32,a=e;for(;a<n&&this.src.charCodeAt(a)===r;)a++;let o=a-e,s=a<n?this.src.charCodeAt(a):32,c=ES(i)||TS(String.fromCharCode(i)),l=ES(s)||TS(String.fromCharCode(s)),u=wS(i),d=wS(s),f=!d&&(!l||u||c),p=!u&&(!c||d||l);return{can_open:f&&(t||!p||c),can_close:p&&(t||!f||l),length:o}},PC.prototype.Token=IS;function FC(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function IC(e,t){let n=e.pos;for(;n<e.posMax&&!FC(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var LC=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function RC(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=e.pending.match(LC);if(!i)return!1;let a=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let s=o.url;if(s.length<=a.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-a.length,!0}function zC(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.push(`hardbreak`,`br`,0)}else e.pending=e.pending.slice(0,-1),e.push(`softbreak`,`br`,0);else e.push(`softbreak`,`br`,0);for(n++;n<i&&CS(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var BC=[];for(let e=0;e<256;e++)BC.push(0);`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``).forEach(function(e){BC[e.charCodeAt(0)]=1});function VC(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(i=e.src.charCodeAt(n),CS(i));)n++;return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(a+=e.src[n+1],n++)}let o=`\\`+a;if(!t){let t=e.push(`text_special`,``,0);i<256&&BC[i]!==0?t.content=a:t.content=o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function HC(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;let r=n;n++;let i=e.posMax;for(;n<i&&e.src.charCodeAt(n)===96;)n++;let a=e.src.slice(r,n),o=a.length;if(e.backticksScanned&&(e.backticks[o]||0)<=r)return t||(e.pending+=a),e.pos+=o,!0;let s=n,c;for(;(c=e.src.indexOf("`",s))!==-1;){for(s=c+1;s<i&&e.src.charCodeAt(s)===96;)s++;let r=s-c;if(r===o){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=a,t.content=e.src.slice(n,c).replace(/\n/g,` `).replace(/^ (.+) $/,`$1`)}return e.pos=s,!0}e.backticks[r]=c}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=o,!0}function UC(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function WC(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function GC(e){let t=e.tokens_meta,n=e.tokens_meta.length;WC(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&WC(e,t[r].delimiters)}var KC={tokenize:UC,postProcess:GC};function qC(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let i=e.scanDelims(e.pos,r===42);for(let t=0;t<i.length;t++){let t=e.push(`text`,``,0);t.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function JC(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let i=t[n.end],a=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),s=e.tokens[n.token];s.type=a?`strong_open`:`em_open`,s.tag=a?`strong`:`em`,s.nesting=1,s.markup=a?o+o:o,s.content=``;let c=e.tokens[i.token];c.type=a?`strong_close`:`em_close`,c.tag=a?`strong`:`em`,c.nesting=-1,c.markup=a?o+o:o,c.content=``,a&&(e.tokens[t[r-1].token].content=``,e.tokens[t[n.end+1].token].content=``,r--)}}function YC(e){let t=e.tokens_meta,n=e.tokens_meta.length;JC(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&JC(e,t[r].delimiters)}var XC={tokenize:qC,postProcess:YC};function ZC(e,t){let n,r,i,a,o=``,s=``,c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let u=e.pos,d=e.posMax,f=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<d&&e.src.charCodeAt(m)===40){for(l=!1,m++;m<d&&(n=e.src.charCodeAt(m),!(!CS(n)&&n!==10));m++);if(m>=d)return!1;if(c=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?m=i.pos:o=``,c=m;m<d&&(n=e.src.charCodeAt(m),!(!CS(n)&&n!==10));m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<d&&c!==m&&i.ok)for(s=i.str,m=i.pos;m<d&&(n=e.src.charCodeAt(m),!(!CS(n)&&n!==10));m++);}(m>=d||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(e.env.references===void 0)return!1;if(m<d&&e.src.charCodeAt(m)===91?(c=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?r=e.src.slice(c,m++):m=p+1):m=p+1,r||=e.src.slice(f,p),a=e.env.references[DS(r)],!a)return e.pos=u,!1;o=a.href,s=a.title}if(!t){e.pos=f,e.posMax=p;let t=e.push(`link_open`,`a`,1),n=[[`href`,o]];t.attrs=n,s&&n.push([`title`,s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=m,e.posMax=d,!0}function QC(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),!(!CS(n)&&n!==10));a++);if(a>=f)return!1;for(l=a,s=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),s.ok&&(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``),l=a;a<f&&(n=e.src.charCodeAt(a),!(!CS(n)&&n!==10));a++);if(s=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),!(!CS(n)&&n!==10));a++);else c=``;if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[DS(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0),i=[[`src`,u],[`alt`,``]];n.attrs=i,n.children=t,n.content=r,c&&i.push([`title`,c])}return e.pos=a,e.posMax=f,!0}var $C=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,ew=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function tw(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(t===60)return!1;if(t===62)break}let a=e.src.slice(r+1,n);if(ew.test(a)){let n=e.md.normalizeLink(a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}if($C.test(a)){let n=e.md.normalizeLink(`mailto:`+a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}return!1}function nw(e){return/^<a[>\s]/i.test(e)}function rw(e){return/^<\/a\s*>/i.test(e)}function iw(e){let t=e|32;return t>=97&&t<=122}function aw(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!iw(i))return!1;let a=e.src.slice(r).match(TC);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],nw(t.content)&&e.linkLevel++,rw(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}var ow=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,sw=/^&([a-z][a-z0-9]{1,31});/i;function cw(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let r=e.src.slice(n).match(ow);if(r){if(!t){let t=r[1][0].toLowerCase()===`x`?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push(`text_special`,``,0);n.content=cS(t)?lS(t):lS(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(sw);if(r){let n=eS(r[0]);if(n!==r[0]){if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=r[0],t.info=`entity`}return e.pos+=r[0].length,!0}}}return!1}function lw(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function uw(e){let t=e.tokens_meta,n=e.tokens_meta.length;lw(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&lw(t[e].delimiters)}function dw(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}var fw=[[`text`,IC],[`linkify`,RC],[`newline`,zC],[`escape`,VC],[`backticks`,HC],[`strikethrough`,KC.tokenize],[`emphasis`,XC.tokenize],[`link`,ZC],[`image`,QC],[`autolink`,tw],[`html_inline`,aw],[`entity`,cw]],pw=[[`balance_pairs`,uw],[`strikethrough`,KC.postProcess],[`emphasis`,XC.postProcess],[`fragments_join`,dw]];function mw(){this.ruler=new FS;for(let e=0;e<fw.length;e++)this.ruler.push(fw[e][0],fw[e][1]);this.ruler2=new FS;for(let e=0;e<pw.length;e++)this.ruler2.push(pw[e][0],pw[e][1])}mw.prototype.skipToken=function(e){let t=e.pos,n=this.ruler.getRules(``),r=n.length,i=e.md.options.maxNesting,a=e.cache;if(a[t]!==void 0){e.pos=a[t];return}let o=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,o=n[i](e,!0),e.level--,o){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;o||e.pos++,a[t]=e.pos},mw.prototype.tokenize=function(e){let t=this.ruler.getRules(``),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1),o){if(a>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(o){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},mw.prototype.parse=function(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.ruler2.getRules(``),o=a.length;for(let e=0;e<o;e++)a[e](i)},mw.prototype.State=PC;function hw(e){let t={};e||={},t.src_Any=kx.source,t.src_Cc=Ax.source,t.src_Z=Px.source,t.src_P=Mx.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`);let n=`[><|]`;return t.src_pseudo_letter=`(?:(?!`+n+`|`+t.src_ZPCc+`)`+t.src_Any+`)`,t.src_ip4=`(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`,t.src_auth=`(?:(?:(?!`+t.src_ZCc+`|[@/\\[\\]()]).)+@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|`+n+`|`+t.src_ZPCc+`)(?!`+(e[`---`]?`-(?!--)|`:`-|`)+`_|:\\d|\\.-|\\.(?!$|`+t.src_ZPCc+`))`,t.src_path=`(?:[/?#](?:(?!`+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+`|\\]).)*\\]|\\((?:(?!`+t.src_ZCc+`|[)]).)*\\)|\\{(?:(?!`+t.src_ZCc+`|[}]).)*\\}|\\"(?:(?!`+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+`|[']).)+\\'|\\'(?=`+t.src_pseudo_letter+`|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!`+t.src_ZCc+`|[.]|$)|`+(e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!`+t.src_ZCc+`|$)|;(?!`+t.src_ZCc+`|$)|\\!+(?!`+t.src_ZCc+`|[!]|$)|\\?(?!`+t.src_ZCc+`|[?]|$))+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|`+t.src_pseudo_letter+`{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:`+t.src_pseudo_letter+`)|(?:`+t.src_pseudo_letter+`(?:-|`+t.src_pseudo_letter+`){0,61}`+t.src_pseudo_letter+`))`,t.src_host=`(?:(?:(?:(?:`+t.src_domain+`)\\.)*`+t.src_domain+`))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:`+t.src_domain+`)\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:`+t.src_domain+`)\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:`+t.src_ZPCc+`|>|$))`,t.tpl_email_fuzzy=`(^|`+n+`|"|\\(|`+t.src_ZCc+`)(`+t.src_email_name+`@`+t.tpl_host_fuzzy_strict+`)`,t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+`)`,t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+`)`,t}function gw(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function _w(e){return Object.prototype.toString.call(e)}function vw(e){return _w(e)===`[object String]`}function yw(e){return _w(e)===`[object Object]`}function bw(e){return _w(e)===`[object RegExp]`}function xw(e){return _w(e)===`[object Function]`}function Sw(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var Cw={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function ww(e){return Object.keys(e||{}).reduce(function(e,t){return e||Cw.hasOwnProperty(t)},!1)}var Tw={"http:":{validate:function(e,t,n){let r=e.slice(t);return n.re.http||(n.re.http=RegExp(`^\\/\\/`+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,`i`)),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":`http:`,"ftp:":`http:`,"//":{validate:function(e,t,n){let r=e.slice(t);return n.re.no_http||(n.re.no_http=RegExp(`^`+n.re.src_auth+`(?:localhost|(?:(?:`+n.re.src_domain+`)\\.)+`+n.re.src_domain_root+`)`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,`i`)),n.re.no_http.test(r)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return n.re.mailto||(n.re.mailto=RegExp(`^`+n.re.src_email_name+`@`+n.re.src_host_strict,`i`)),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},Ew=`a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]`,Dw=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function Ow(e){e.__index__=-1,e.__text_cache__=``}function kw(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function Aw(){return function(e,t){t.normalize(e)}}function jw(e){let t=e.re=hw(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(Ew),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);let i=[];e.__compiled__={};function a(e,t){throw Error(`(LinkifyIt) Invalid schema "`+e+`": `+t)}Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(n===null)return;let r={validate:null,link:null};if(e.__compiled__[t]=r,yw(n)){bw(n.validate)?r.validate=kw(n.validate):xw(n.validate)?r.validate=n.validate:a(t,n),xw(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=Aw();return}if(vw(n)){i.push(t);return}a(t,n)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:Aw()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(Sw).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|`+t.src_ZPCc+`))(`+o+`)`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|`+t.src_ZPCc+`))(`+o+`)`,`ig`),e.re.schema_at_start=RegExp(`^`+e.re.schema_search.source,`i`),e.re.pretest=RegExp(`(`+e.re.schema_test.source+`)|(`+e.re.host_fuzzy_test.source+`)|@`,`i`),Ow(e)}function Mw(e,t){let n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function Nw(e,t){let n=new Mw(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Pw(e,t){if(!(this instanceof Pw))return new Pw(e,t);t||ww(e)&&(t=e,e={}),this.__opts__=gw({},Cw,t),this.__index__=-1,this.__last_index__=-1,this.__schema__=``,this.__text_cache__=``,this.__schemas__=gw({},Tw,e),this.__compiled__={},this.__tlds__=Dw,this.__tlds_replaced__=!1,this.re={},jw(this)}Pw.prototype.add=function(e,t){return this.__schemas__[e]=t,jw(this),this},Pw.prototype.set=function(e){return this.__opts__=gw(this.__opts__,e),this},Pw.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,n,r,i,a,o,s,c,l;if(this.re.schema_test.test(e)){for(s=this.re.schema_search,s.lastIndex=0;(t=s.exec(e))!==null;)if(i=this.testSchemaAt(e,t[2],s.lastIndex),i){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&(c=e.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(a=n.index+n[1].length,(this.__index__<0||a<this.__index__)&&(this.__schema__=``,this.__index__=a,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&(l=e.indexOf(`@`),l>=0&&(r=e.match(this.re.email_fuzzy))!==null&&(a=r.index+r[1].length,o=r.index+r[0].length,(this.__index__<0||a<this.__index__||a===this.__index__&&o>this.__last_index__)&&(this.__schema__=`mailto:`,this.__index__=a,this.__last_index__=o))),this.__index__>=0},Pw.prototype.pretest=function(e){return this.re.pretest.test(e)},Pw.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},Pw.prototype.match=function(e){let t=[],n=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(Nw(this,n)),n=this.__last_index__);let r=n?e.slice(n):e;for(;this.test(r);)t.push(Nw(this,n)),r=r.slice(this.__last_index__),n+=this.__last_index__;return t.length?t:null},Pw.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);return n?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n,Nw(this,0)):null},Pw.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),jw(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,jw(this),this)},Pw.prototype.normalize=function(e){e.schema||(e.url=`http://`+e.url),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:`+e.url)},Pw.prototype.onCompile=function(){};var Fw=2147483647,Iw=36,Lw=1,Rw=26,zw=38,Bw=700,Vw=72,Hw=128,Uw=`-`,Ww=/^xn--/,Gw=/[^\0-\x7F]/,Kw=/[\x2E\u3002\uFF0E\uFF61]/g,qw={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},Jw=Iw-Lw,Yw=Math.floor,Xw=String.fromCharCode;function Zw(e){throw RangeError(qw[e])}function Qw(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function $w(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(Kw,`.`);let i=Qw(e.split(`.`),t).join(`.`);return r+i}function eT(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}var tT=e=>String.fromCodePoint(...e),nT=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Iw},rT=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},iT=function(e,t,n){let r=0;for(e=n?Yw(e/Bw):e>>1,e+=Yw(e/t);e>Jw*Rw>>1;r+=Iw)e=Yw(e/Jw);return Yw(r+(Jw+1)*e/(e+zw))},aT=function(e){let t=[],n=e.length,r=0,i=Hw,a=Vw,o=e.lastIndexOf(Uw);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&Zw(`not-basic`),t.push(e.charCodeAt(n));for(let s=o>0?o+1:0;s<n;){let o=r;for(let t=1,i=Iw;;i+=Iw){s>=n&&Zw(`invalid-input`);let o=nT(e.charCodeAt(s++));o>=Iw&&Zw(`invalid-input`),o>Yw((Fw-r)/t)&&Zw(`overflow`),r+=o*t;let c=i<=a?Lw:i>=a+Rw?Rw:i-a;if(o<c)break;let l=Iw-c;t>Yw(Fw/l)&&Zw(`overflow`),t*=l}let c=t.length+1;a=iT(r-o,c,o==0),Yw(r/c)>Fw-i&&Zw(`overflow`),i+=Yw(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},oT=function(e){let t=[];e=eT(e);let n=e.length,r=Hw,i=0,a=Vw;for(let n of e)n<128&&t.push(Xw(n));let o=t.length,s=o;for(o&&t.push(Uw);s<n;){let n=Fw;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>Yw((Fw-i)/c)&&Zw(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>Fw&&Zw(`overflow`),n===r){let e=i;for(let n=Iw;;n+=Iw){let r=n<=a?Lw:n>=a+Rw?Rw:n-a;if(e<r)break;let i=e-r,o=Iw-r;t.push(Xw(rT(r+i%o,0))),e=Yw(i/o)}t.push(Xw(rT(e,0))),a=iT(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},sT={version:`2.3.1`,ucs2:{decode:eT,encode:tT},decode:aT,encode:oT,toASCII:function(e){return $w(e,function(e){return Gw.test(e)?`xn--`+oT(e):e})},toUnicode:function(e){return $w(e,function(e){return Ww.test(e)?aT(e.slice(4).toLowerCase()):e})}},cT={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`],rules2:[`balance_pairs`,`fragments_join`]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`],rules2:[`balance_pairs`,`emphasis`,`fragments_join`]}}}},lT=/^(vbscript|javascript|file|data):/,uT=/^data:image\/(gif|png|jpeg|webp);/;function dT(e){let t=e.trim().toLowerCase();return lT.test(t)?uT.test(t):!0}var fT=[`http:`,`https:`,`mailto:`];function pT(e){let t=Dx(e,!0);if(t.hostname&&(!t.protocol||fT.indexOf(t.protocol)>=0))try{t.hostname=sT.toASCII(t.hostname)}catch{}return mx(hx(t))}function mT(e){let t=Dx(e,!0);if(t.hostname&&(!t.protocol||fT.indexOf(t.protocol)>=0))try{t.hostname=sT.toUnicode(t.hostname)}catch{}return dx(hx(t),dx.defaultChars+`%`)}function hT(e,t){if(!(this instanceof hT))return new hT(e,t);t||rS(e)||(t=e||{},e=`default`),this.inline=new mw,this.block=new NC,this.core=new cC,this.renderer=new PS,this.linkify=new Pw,this.validateLink=dT,this.normalizeLink=pT,this.normalizeLinkText=mT,this.utils=tS,this.helpers=oS({},MS),this.options={},this.configure(e),t&&this.set(t)}hT.prototype.set=function(e){return oS(this.options,e),this},hT.prototype.configure=function(e){let t=this;if(rS(e)){let t=e;if(e=cT[t],!e)throw Error('Wrong `markdown-it` preset "'+t+`", check name`)}if(!e)throw Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},hT.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to enable unknown rule(s): `+r);return this},hT.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to disable unknown rule(s): `+r);return this},hT.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},hT.prototype.parse=function(e,t){if(typeof e!=`string`)throw Error(`Input data should be a String`);let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},hT.prototype.render=function(e,t){return t||={},this.renderer.render(this.parse(e,t),this.options,t)},hT.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},hT.prototype.renderInline=function(e,t){return t||={},this.renderer.render(this.parseInline(e,t),this.options,t)};var gT=M(A(((e,t)=>{var n=!0,r=!1,i=!1;t.exports=function(e,t){t&&(n=!t.enabled,r=!!t.label,i=!!t.labelAfter),e.core.ruler.after(`inline`,`github-task-lists`,function(e){for(var t=e.tokens,r=2;r<t.length;r++)s(t,r)&&(c(t[r],e.Token),a(t[r-2],`class`,`task-list-item`+(n?``:` enabled`)),a(t[o(t,r-2)],`class`,`contains-task-list`))})};function a(e,t,n){var r=e.attrIndex(t),i=[t,n];r<0?e.attrPush(i):e.attrs[r]=i}function o(e,t){for(var n=e[t].level-1,r=t-1;r>=0;r--)if(e[r].level===n)return r;return-1}function s(e,t){return p(e[t])&&m(e[t-1])&&h(e[t-2])&&g(e[t])}function c(e,t){if(e.children.unshift(l(e,t)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),r)if(i){e.children.pop();var n=`task-item-`+Math.ceil(1e4*1e3*Math.random()-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+` id="`+n+`">`,e.children.push(f(e.content,n,t))}else e.children.unshift(u(t)),e.children.push(d(t))}function l(e,t){var r=new t(`html_inline`,``,0),i=n?` disabled="" `:``;return e.content.indexOf(`[ ] `)===0?r.content=`<input class="task-list-item-checkbox"`+i+`type="checkbox">`:(e.content.indexOf(`[x] `)===0||e.content.indexOf(`[X] `)===0)&&(r.content=`<input class="task-list-item-checkbox" checked=""`+i+`type="checkbox">`),r}function u(e){var t=new e(`html_inline`,``,0);return t.content=`<label>`,t}function d(e){var t=new e(`html_inline`,``,0);return t.content=`</label>`,t}function f(e,t,n){var r=new n(`html_inline`,``,0);return r.content=`<label class="task-list-item-label" for="`+t+`">`+e+`</label>`,r.attrs=[{for:t}],r}function p(e){return e.type===`inline`}function m(e){return e.type===`paragraph_open`}function h(e){return e.type===`list_item_open`}function g(e){return e.content.indexOf(`[ ] `)===0||e.content.indexOf(`[x] `)===0||e.content.indexOf(`[X] `)===0}}))(),1),_T={ALLOWED_TAGS:`a.b.blockquote.br.button.code.del.details.div.em.h1.h2.h3.h4.hr.i.input.li.ol.p.pre.s.span.strong.summary.table.tbody.td.th.thead.tr.ul.img`.split(`.`),ALLOWED_ATTR:[`checked`,`class`,`disabled`,`href`,`rel`,`target`,`title`,`start`,`src`,`alt`,`data-code`,`type`,`aria-label`],ADD_DATA_URI_TAGS:[`img`]},vT=!1,yT=14e4,bT=4e4,xT=200,ST=5e4,CT=/^data:image\/[a-z0-9.+-]+;base64,/i,wT=new Map,TT=`chat-link-tail-blur`,ET=/[\u2E80-\u2FFF\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFF01-\uFF60]/;function DT(e){let t=wT.get(e);return t===void 0?null:(wT.delete(e),wT.set(e,t),t)}function OT(e,t){if(wT.set(e,t),wT.size<=xT)return;let n=wT.keys().next().value;n&&wT.delete(n)}function kT(){vT||(vT=!0,cx.addHook(`afterSanitizeAttributes`,e=>{if(!(e instanceof HTMLAnchorElement))return;let t=e.getAttribute(`href`);if(t){try{let n=new URL(t,window.location.href);if(n.protocol!==`http:`&&n.protocol!==`https:`&&n.protocol!==`mailto:`){e.removeAttribute(`href`);return}}catch{}e.setAttribute(`rel`,`noreferrer noopener`),e.setAttribute(`target`,`_blank`),y(t).includes(`tail`)&&e.classList.add(TT)}}))}function AT(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function jT(e){return e?.trim()||`image`}var MT=new hT({html:!0,breaks:!0,linkify:!0});MT.enable(`strikethrough`),MT.linkify.set({fuzzyLink:!1}),MT.linkify.add(`www`,{validate(e,t){let n=e.slice(t),r=n.match(/^\.(?:[a-zA-Z0-9-]+\.?)+[^\s<\u2E80-\u2FFF\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFF01-\uFF60]*/);if(!r)return 0;let i=r[0].length,a={")":`(`,"]":`[`,"}":`{`,'"':`"`,"'":`'`},o={};for(let[e,t]of Object.entries(a)){o[e]=0;for(let r=0;r<i;r++){let i=n[r];t===e?i===t&&(o[e]=+(o[e]===0)):i===t?o[e]++:i===e&&o[e]--}}for(;i>0;){let e=n[i-1];if(/[?!.,:*_~]/.test(e)){i--;continue}if(e===`;`){let e=i-2;for(;e>=0&&/[a-zA-Z0-9]/.test(n[e]);)e--;if(e>=0&&n[e]===`&`&&e<i-2){i=e;continue}break}let t=a[e];if(t!==void 0){if(t===e){if(o[e]!==0){o[e]=0,i--;continue}}else if(o[e]<0){o[e]++,i--;continue}}break}return i},normalize(e){e.url=`http://`+e.url}}),MT.validateLink=()=>!0,MT.core.ruler.after(`linkify`,`linkify-cjk-trim`,e=>{for(let t of e.tokens){if(t.type!==`inline`||!t.children)continue;let n=t.children;for(let t=n.length-1;t>=0;t--){let r=n[t];if(r.type!==`link_open`||r.markup!==`linkify`)continue;let i=n[t+1];if(!i||i.type!==`text`)continue;let a=i.content,o=a.length;for(;o>0&&ET.test(a[o-1]);)o--;if(o<=0||o===a.length)continue;let s=a.slice(0,o),c=a.slice(o),l=r.attrGet(`href`)??``,u=l.indexOf(a),d=u>0?l.slice(0,u):``;r.attrSet(`href`,d+s),i.content=s;for(let r=t+1;r<n.length;r++)if(n[r].type===`link_close`){let t=new e.Token(`text`,``,0);t.content=c,n.splice(r+1,0,t);break}}}}),MT.use(gT.default,{enabled:!1,label:!1}),MT.core.ruler.after(`github-task-lists`,`task-list-allowlist`,e=>{let t=e.tokens;for(let e=2;e<t.length;e++)if(!(t[e].type!==`inline`||!t[e].children)&&t[e-1].type===`paragraph_open`&&t[e-2].type===`list_item_open`&&(t[e-2].attrGet(`class`)??``).includes(`task-list-item`)){for(let n of t[e].children)if(n.type===`html_inline`&&/^<input\s/i.test(n.content)){n.meta={taskListPlugin:!0};break}}}),MT.renderer.rules.html_block=(e,t)=>AT(e[t].content)+`
754
+ `,a.map=[t,e.line],!0}function hC(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}function gC(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;let s=[],c=[],l=[],u=[],d=e.md.block.ruler.getRules(`blockquote`),f=e.parentType;e.parentType=`blockquote`;let p=!1,m;for(m=t;m<n;m++){let t=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!t){let t=e.sCount[m]+1,n,r;e.src.charCodeAt(i)===32?(i++,t++,r=!1,n=!0):e.src.charCodeAt(i)===9?(n=!0,(e.bsCount[m]+t)%4==3?(i++,t++,r=!1):r=!0):n=!1;let o=t;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let t=e.src.charCodeAt(i);if(CS(t))t===9?o+=4-(o+e.bsCount[m]+ +!!r)%4:o++;else break;i++}p=i>=a,c.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+ +!!n,l.push(e.sCount[m]),e.sCount[m]=o-t,u.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let r=!1;for(let t=0,i=d.length;t<i;t++)if(d[t](e,m,n,!0)){r=!0;break}if(r){e.lineMax=m,e.blkIndent!==0&&(s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]=-1}let h=e.blkIndent;e.blkIndent=0;let g=e.push(`blockquote_open`,`blockquote`,1);g.markup=`>`;let _=[t,0];g.map=_,e.md.block.tokenize(e,t,m);let v=e.push(`blockquote_close`,`blockquote`,-1);v.markup=`>`,e.lineMax=o,e.parentType=f,_[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=s[n],e.tShift[n+t]=u[n],e.sCount[n+t]=l[n],e.bsCount[n+t]=c[n];return e.blkIndent=h,!0}function _C(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!CS(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=Array(s+1).join(String.fromCharCode(o)),!0}function vC(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!CS(e.src.charCodeAt(r))?-1:r}function yC(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=r)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return i<r&&(a=e.src.charCodeAt(i),!CS(a))?-1:i}function bC(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type===`paragraph_open`&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function xC(e,t,n,r){let i,a,o,s,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let u=!1;r&&e.parentType===`paragraph`&&e.sCount[c]>=e.blkIndent&&(u=!0);let d,f,p;if((p=yC(e,c))>=0){if(d=!0,o=e.bMarks[c]+e.tShift[c],f=Number(e.src.slice(o,p-1)),u&&f!==1)return!1}else if((p=vC(e,c))>=0)d=!1;else return!1;if(u&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(r)return!0;let m=e.src.charCodeAt(p-1),h=e.tokens.length;d?(s=e.push(`ordered_list_open`,`ol`,1),f!==1&&(s.attrs=[[`start`,f]])):s=e.push(`bullet_list_open`,`ul`,1);let g=[c,0];s.map=g,s.markup=String.fromCharCode(m);let _=!1,v=e.md.block.ruler.getRules(`list`),y=e.parentType;for(e.parentType=`list`;c<n;){a=p,i=e.eMarks[c];let t=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]),r=t;for(;a<i;){let t=e.src.charCodeAt(a);if(t===9)r+=4-(r+e.bsCount[c])%4;else if(t===32)r++;else break;a++}let u=a,f;f=u>=i?1:r-t,f>4&&(f=1);let h=t+f;s=e.push(`list_item_open`,`li`,1),s.markup=String.fromCharCode(m);let g=[c,0];s.map=g,d&&(s.info=e.src.slice(o,p-1));let y=e.tight,b=e.tShift[c],x=e.sCount[c],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=h,e.tight=!0,e.tShift[c]=u-e.bMarks[c],e.sCount[c]=r,u>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||_)&&(l=!1),_=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[c]=b,e.sCount[c]=x,e.tight=y,s=e.push(`list_item_close`,`li`,-1),s.markup=String.fromCharCode(m),c=e.line,g[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let ee=!1;for(let t=0,r=v.length;t<r;t++)if(v[t](e,c,n,!0)){ee=!0;break}if(ee)break;if(d){if(p=yC(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=vC(e,c),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return s=d?e.push(`ordered_list_close`,`ol`,-1):e.push(`bullet_list_close`,`ul`,-1),s.markup=String.fromCharCode(m),g[1]=c,e.line=c,e.parentType=y,l&&bC(e,h),!0}function SC(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function s(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules(`reference`),i=e.parentType;e.parentType=`reference`;let a=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let c=e.src.slice(i,a+1);a=c.length;let l=-1;for(i=1;i<a;i++){let e=c.charCodeAt(i);if(e===91)return!1;if(e===93){l=i;break}else if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(e===92&&(i++,i<a&&c.charCodeAt(i)===10)){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}}if(l<0||c.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!CS(e))break}let u=e.md.helpers.parseLinkDestination(c,i,a);if(!u.ok)return!1;let d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;let f=i,p=o,m=i;for(;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!CS(e))break}let h=e.md.helpers.parseLinkTitle(c,i,a);for(;h.can_continue;){let t=s(o);if(t===null)break;c+=t,i=a,a=c.length,o++,h=e.md.helpers.parseLinkTitle(c,i,a,h)}let g;for(i<a&&m!==i&&h.ok?(g=h.str,i=h.pos):(g=``,i=f,o=p);i<a&&CS(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&CS(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10)return!1;let _=DS(c.slice(1,l));return _?r?!0:(e.env.references===void 0&&(e.env.references={}),e.env.references[_]===void 0&&(e.env.references[_]={title:g,href:d}),e.line=o,!0):!1}var CC=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),wC=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,TC=RegExp(`^(?:`+wC+`|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),EC=RegExp(`^(?:`+wC+`|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>)`),DC=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(`+CC.join(`|`)+`)(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(EC.source+`\\s*$`),/^$/,!1]];function OC(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<DC.length&&!DC[s][0].test(o);s++);if(s===DC.length)return!1;if(r)return DC[s][2];let c=t+1;if(!DC[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent);c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),DC[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let l=e.push(`html_block`,``,0);return l.map=[t,c],l.content=e.getLines(t,c,e.blkIndent,!0),!0}function kC(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=a)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i<a&&s<=6;)s++,o=e.src.charCodeAt(++i);if(s>6||i<a&&!CS(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&CS(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;let l=e.push(`heading_open`,`h`+String(s),1);l.markup=`########`.slice(0,s),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=e.src.slice(i,a).trim(),u.map=[t,e.line],u.children=[];let d=e.push(`heading_close`,`h`+String(s),-1);return d.markup=`########`.slice(0,s),!0}function AC(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`);if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType=`paragraph`;let a=0,o,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let t=e.bMarks[s]+e.tShift[s],n=e.eMarks[s];if(t<n&&(o=e.src.charCodeAt(t),(o===45||o===61)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){a=o===61?1:2;break}}if(e.sCount[s]<0)continue;let t=!1;for(let i=0,a=r.length;i<a;i++)if(r[i](e,s,n,!0)){t=!0;break}if(t)break}if(!a)return!1;let c=e.getLines(t,s,e.blkIndent,!1).trim();e.line=s+1;let l=e.push(`heading_open`,`h`+String(a),1);l.markup=String.fromCharCode(o),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=c,u.map=[t,e.line-1],u.children=[];let d=e.push(`heading_close`,`h`+String(a),-1);return d.markup=String.fromCharCode(o),e.parentType=i,!0}function jC(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`),i=e.parentType,a=t+1;for(e.parentType=`paragraph`;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}let o=e.getLines(t,a,e.blkIndent,!1).trim();e.line=a;let s=e.push(`paragraph_open`,`p`,1);s.map=[t,e.line];let c=e.push(`inline`,``,0);return c.content=o,c.map=[t,e.line],c.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}var MC=[[`table`,pC,[`paragraph`,`reference`]],[`code`,mC],[`fence`,hC,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,gC,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,_C,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,xC,[`paragraph`,`reference`,`blockquote`]],[`reference`,SC],[`html_block`,OC,[`paragraph`,`reference`,`blockquote`]],[`heading`,kC,[`paragraph`,`reference`,`blockquote`]],[`lheading`,AC],[`paragraph`,jC]];function NC(){this.ruler=new FS;for(let e=0;e<MC.length;e++)this.ruler.push(MC[e][0],MC[e][1],{alt:(MC[e][2]||[]).slice()})}NC.prototype.tokenize=function(e,t,n){let r=this.ruler.getRules(``),i=r.length,a=e.md.options.maxNesting,o=t,s=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=a){e.line=n;break}let t=e.line,c=!1;for(let a=0;a<i;a++)if(c=r[a](e,o,n,!1),c){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!c)throw Error(`none of the block rules matched`);e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),o=e.line,o<n&&e.isEmpty(o)&&(s=!0,o++,e.line=o)}},NC.prototype.parse=function(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)},NC.prototype.State=lC;function PC(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending=``,this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}PC.prototype.pushPending=function(){let e=new IS(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e},PC.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new IS(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},PC.prototype.scanDelims=function(e,t){let n=this.posMax,r=this.src.charCodeAt(e),i=e>0?this.src.charCodeAt(e-1):32,a=e;for(;a<n&&this.src.charCodeAt(a)===r;)a++;let o=a-e,s=a<n?this.src.charCodeAt(a):32,c=ES(i)||TS(String.fromCharCode(i)),l=ES(s)||TS(String.fromCharCode(s)),u=wS(i),d=wS(s),f=!d&&(!l||u||c),p=!u&&(!c||d||l);return{can_open:f&&(t||!p||c),can_close:p&&(t||!f||l),length:o}},PC.prototype.Token=IS;function FC(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function IC(e,t){let n=e.pos;for(;n<e.posMax&&!FC(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var LC=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function RC(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=e.pending.match(LC);if(!i)return!1;let a=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let s=o.url;if(s.length<=a.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-a.length,!0}function zC(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.push(`hardbreak`,`br`,0)}else e.pending=e.pending.slice(0,-1),e.push(`softbreak`,`br`,0);else e.push(`softbreak`,`br`,0);for(n++;n<i&&CS(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var BC=[];for(let e=0;e<256;e++)BC.push(0);`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``).forEach(function(e){BC[e.charCodeAt(0)]=1});function VC(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(i=e.src.charCodeAt(n),CS(i));)n++;return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(a+=e.src[n+1],n++)}let o=`\\`+a;if(!t){let t=e.push(`text_special`,``,0);i<256&&BC[i]!==0?t.content=a:t.content=o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function HC(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;let r=n;n++;let i=e.posMax;for(;n<i&&e.src.charCodeAt(n)===96;)n++;let a=e.src.slice(r,n),o=a.length;if(e.backticksScanned&&(e.backticks[o]||0)<=r)return t||(e.pending+=a),e.pos+=o,!0;let s=n,c;for(;(c=e.src.indexOf("`",s))!==-1;){for(s=c+1;s<i&&e.src.charCodeAt(s)===96;)s++;let r=s-c;if(r===o){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=a,t.content=e.src.slice(n,c).replace(/\n/g,` `).replace(/^ (.+) $/,`$1`)}return e.pos=s,!0}e.backticks[r]=c}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=o,!0}function UC(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function WC(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function GC(e){let t=e.tokens_meta,n=e.tokens_meta.length;WC(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&WC(e,t[r].delimiters)}var KC={tokenize:UC,postProcess:GC};function qC(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let i=e.scanDelims(e.pos,r===42);for(let t=0;t<i.length;t++){let t=e.push(`text`,``,0);t.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function JC(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let i=t[n.end],a=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),s=e.tokens[n.token];s.type=a?`strong_open`:`em_open`,s.tag=a?`strong`:`em`,s.nesting=1,s.markup=a?o+o:o,s.content=``;let c=e.tokens[i.token];c.type=a?`strong_close`:`em_close`,c.tag=a?`strong`:`em`,c.nesting=-1,c.markup=a?o+o:o,c.content=``,a&&(e.tokens[t[r-1].token].content=``,e.tokens[t[n.end+1].token].content=``,r--)}}function YC(e){let t=e.tokens_meta,n=e.tokens_meta.length;JC(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&JC(e,t[r].delimiters)}var XC={tokenize:qC,postProcess:YC};function ZC(e,t){let n,r,i,a,o=``,s=``,c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let u=e.pos,d=e.posMax,f=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<d&&e.src.charCodeAt(m)===40){for(l=!1,m++;m<d&&(n=e.src.charCodeAt(m),!(!CS(n)&&n!==10));m++);if(m>=d)return!1;if(c=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?m=i.pos:o=``,c=m;m<d&&(n=e.src.charCodeAt(m),!(!CS(n)&&n!==10));m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<d&&c!==m&&i.ok)for(s=i.str,m=i.pos;m<d&&(n=e.src.charCodeAt(m),!(!CS(n)&&n!==10));m++);}(m>=d||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(e.env.references===void 0)return!1;if(m<d&&e.src.charCodeAt(m)===91?(c=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?r=e.src.slice(c,m++):m=p+1):m=p+1,r||=e.src.slice(f,p),a=e.env.references[DS(r)],!a)return e.pos=u,!1;o=a.href,s=a.title}if(!t){e.pos=f,e.posMax=p;let t=e.push(`link_open`,`a`,1),n=[[`href`,o]];t.attrs=n,s&&n.push([`title`,s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=m,e.posMax=d,!0}function QC(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),!(!CS(n)&&n!==10));a++);if(a>=f)return!1;for(l=a,s=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),s.ok&&(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``),l=a;a<f&&(n=e.src.charCodeAt(a),!(!CS(n)&&n!==10));a++);if(s=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),!(!CS(n)&&n!==10));a++);else c=``;if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[DS(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0),i=[[`src`,u],[`alt`,``]];n.attrs=i,n.children=t,n.content=r,c&&i.push([`title`,c])}return e.pos=a,e.posMax=f,!0}var $C=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,ew=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function tw(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(t===60)return!1;if(t===62)break}let a=e.src.slice(r+1,n);if(ew.test(a)){let n=e.md.normalizeLink(a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}if($C.test(a)){let n=e.md.normalizeLink(`mailto:`+a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}return!1}function nw(e){return/^<a[>\s]/i.test(e)}function rw(e){return/^<\/a\s*>/i.test(e)}function iw(e){let t=e|32;return t>=97&&t<=122}function aw(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!iw(i))return!1;let a=e.src.slice(r).match(TC);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],nw(t.content)&&e.linkLevel++,rw(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}var ow=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,sw=/^&([a-z][a-z0-9]{1,31});/i;function cw(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let r=e.src.slice(n).match(ow);if(r){if(!t){let t=r[1][0].toLowerCase()===`x`?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push(`text_special`,``,0);n.content=cS(t)?lS(t):lS(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(sw);if(r){let n=eS(r[0]);if(n!==r[0]){if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=r[0],t.info=`entity`}return e.pos+=r[0].length,!0}}}return!1}function lw(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function uw(e){let t=e.tokens_meta,n=e.tokens_meta.length;lw(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&lw(t[e].delimiters)}function dw(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}var fw=[[`text`,IC],[`linkify`,RC],[`newline`,zC],[`escape`,VC],[`backticks`,HC],[`strikethrough`,KC.tokenize],[`emphasis`,XC.tokenize],[`link`,ZC],[`image`,QC],[`autolink`,tw],[`html_inline`,aw],[`entity`,cw]],pw=[[`balance_pairs`,uw],[`strikethrough`,KC.postProcess],[`emphasis`,XC.postProcess],[`fragments_join`,dw]];function mw(){this.ruler=new FS;for(let e=0;e<fw.length;e++)this.ruler.push(fw[e][0],fw[e][1]);this.ruler2=new FS;for(let e=0;e<pw.length;e++)this.ruler2.push(pw[e][0],pw[e][1])}mw.prototype.skipToken=function(e){let t=e.pos,n=this.ruler.getRules(``),r=n.length,i=e.md.options.maxNesting,a=e.cache;if(a[t]!==void 0){e.pos=a[t];return}let o=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,o=n[i](e,!0),e.level--,o){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;o||e.pos++,a[t]=e.pos},mw.prototype.tokenize=function(e){let t=this.ruler.getRules(``),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1),o){if(a>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(o){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},mw.prototype.parse=function(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.ruler2.getRules(``),o=a.length;for(let e=0;e<o;e++)a[e](i)},mw.prototype.State=PC;function hw(e){let t={};e||={},t.src_Any=kx.source,t.src_Cc=Ax.source,t.src_Z=Px.source,t.src_P=Mx.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`);let n=`[><|]`;return t.src_pseudo_letter=`(?:(?!`+n+`|`+t.src_ZPCc+`)`+t.src_Any+`)`,t.src_ip4=`(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`,t.src_auth=`(?:(?:(?!`+t.src_ZCc+`|[@/\\[\\]()]).)+@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|`+n+`|`+t.src_ZPCc+`)(?!`+(e[`---`]?`-(?!--)|`:`-|`)+`_|:\\d|\\.-|\\.(?!$|`+t.src_ZPCc+`))`,t.src_path=`(?:[/?#](?:(?!`+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+`|\\]).)*\\]|\\((?:(?!`+t.src_ZCc+`|[)]).)*\\)|\\{(?:(?!`+t.src_ZCc+`|[}]).)*\\}|\\"(?:(?!`+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+`|[']).)+\\'|\\'(?=`+t.src_pseudo_letter+`|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!`+t.src_ZCc+`|[.]|$)|`+(e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!`+t.src_ZCc+`|$)|;(?!`+t.src_ZCc+`|$)|\\!+(?!`+t.src_ZCc+`|[!]|$)|\\?(?!`+t.src_ZCc+`|[?]|$))+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|`+t.src_pseudo_letter+`{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:`+t.src_pseudo_letter+`)|(?:`+t.src_pseudo_letter+`(?:-|`+t.src_pseudo_letter+`){0,61}`+t.src_pseudo_letter+`))`,t.src_host=`(?:(?:(?:(?:`+t.src_domain+`)\\.)*`+t.src_domain+`))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:`+t.src_domain+`)\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:`+t.src_domain+`)\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:`+t.src_ZPCc+`|>|$))`,t.tpl_email_fuzzy=`(^|`+n+`|"|\\(|`+t.src_ZCc+`)(`+t.src_email_name+`@`+t.tpl_host_fuzzy_strict+`)`,t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+`)`,t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+`)`,t}function gw(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function _w(e){return Object.prototype.toString.call(e)}function vw(e){return _w(e)===`[object String]`}function yw(e){return _w(e)===`[object Object]`}function bw(e){return _w(e)===`[object RegExp]`}function xw(e){return _w(e)===`[object Function]`}function Sw(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var Cw={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function ww(e){return Object.keys(e||{}).reduce(function(e,t){return e||Cw.hasOwnProperty(t)},!1)}var Tw={"http:":{validate:function(e,t,n){let r=e.slice(t);return n.re.http||(n.re.http=RegExp(`^\\/\\/`+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,`i`)),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":`http:`,"ftp:":`http:`,"//":{validate:function(e,t,n){let r=e.slice(t);return n.re.no_http||(n.re.no_http=RegExp(`^`+n.re.src_auth+`(?:localhost|(?:(?:`+n.re.src_domain+`)\\.)+`+n.re.src_domain_root+`)`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,`i`)),n.re.no_http.test(r)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return n.re.mailto||(n.re.mailto=RegExp(`^`+n.re.src_email_name+`@`+n.re.src_host_strict,`i`)),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},Ew=`a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]`,Dw=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function Ow(e){e.__index__=-1,e.__text_cache__=``}function kw(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function Aw(){return function(e,t){t.normalize(e)}}function jw(e){let t=e.re=hw(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(Ew),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);let i=[];e.__compiled__={};function a(e,t){throw Error(`(LinkifyIt) Invalid schema "`+e+`": `+t)}Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(n===null)return;let r={validate:null,link:null};if(e.__compiled__[t]=r,yw(n)){bw(n.validate)?r.validate=kw(n.validate):xw(n.validate)?r.validate=n.validate:a(t,n),xw(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=Aw();return}if(vw(n)){i.push(t);return}a(t,n)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:Aw()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(Sw).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|`+t.src_ZPCc+`))(`+o+`)`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|`+t.src_ZPCc+`))(`+o+`)`,`ig`),e.re.schema_at_start=RegExp(`^`+e.re.schema_search.source,`i`),e.re.pretest=RegExp(`(`+e.re.schema_test.source+`)|(`+e.re.host_fuzzy_test.source+`)|@`,`i`),Ow(e)}function Mw(e,t){let n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function Nw(e,t){let n=new Mw(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Pw(e,t){if(!(this instanceof Pw))return new Pw(e,t);t||ww(e)&&(t=e,e={}),this.__opts__=gw({},Cw,t),this.__index__=-1,this.__last_index__=-1,this.__schema__=``,this.__text_cache__=``,this.__schemas__=gw({},Tw,e),this.__compiled__={},this.__tlds__=Dw,this.__tlds_replaced__=!1,this.re={},jw(this)}Pw.prototype.add=function(e,t){return this.__schemas__[e]=t,jw(this),this},Pw.prototype.set=function(e){return this.__opts__=gw(this.__opts__,e),this},Pw.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,n,r,i,a,o,s,c,l;if(this.re.schema_test.test(e)){for(s=this.re.schema_search,s.lastIndex=0;(t=s.exec(e))!==null;)if(i=this.testSchemaAt(e,t[2],s.lastIndex),i){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&(c=e.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(a=n.index+n[1].length,(this.__index__<0||a<this.__index__)&&(this.__schema__=``,this.__index__=a,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&(l=e.indexOf(`@`),l>=0&&(r=e.match(this.re.email_fuzzy))!==null&&(a=r.index+r[1].length,o=r.index+r[0].length,(this.__index__<0||a<this.__index__||a===this.__index__&&o>this.__last_index__)&&(this.__schema__=`mailto:`,this.__index__=a,this.__last_index__=o))),this.__index__>=0},Pw.prototype.pretest=function(e){return this.re.pretest.test(e)},Pw.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},Pw.prototype.match=function(e){let t=[],n=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(Nw(this,n)),n=this.__last_index__);let r=n?e.slice(n):e;for(;this.test(r);)t.push(Nw(this,n)),r=r.slice(this.__last_index__),n+=this.__last_index__;return t.length?t:null},Pw.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);return n?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n,Nw(this,0)):null},Pw.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),jw(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,jw(this),this)},Pw.prototype.normalize=function(e){e.schema||(e.url=`http://`+e.url),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:`+e.url)},Pw.prototype.onCompile=function(){};var Fw=2147483647,Iw=36,Lw=1,Rw=26,zw=38,Bw=700,Vw=72,Hw=128,Uw=`-`,Ww=/^xn--/,Gw=/[^\0-\x7F]/,Kw=/[\x2E\u3002\uFF0E\uFF61]/g,qw={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},Jw=Iw-Lw,Yw=Math.floor,Xw=String.fromCharCode;function Zw(e){throw RangeError(qw[e])}function Qw(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function $w(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(Kw,`.`);let i=Qw(e.split(`.`),t).join(`.`);return r+i}function eT(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}var tT=e=>String.fromCodePoint(...e),nT=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Iw},rT=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},iT=function(e,t,n){let r=0;for(e=n?Yw(e/Bw):e>>1,e+=Yw(e/t);e>Jw*Rw>>1;r+=Iw)e=Yw(e/Jw);return Yw(r+(Jw+1)*e/(e+zw))},aT=function(e){let t=[],n=e.length,r=0,i=Hw,a=Vw,o=e.lastIndexOf(Uw);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&Zw(`not-basic`),t.push(e.charCodeAt(n));for(let s=o>0?o+1:0;s<n;){let o=r;for(let t=1,i=Iw;;i+=Iw){s>=n&&Zw(`invalid-input`);let o=nT(e.charCodeAt(s++));o>=Iw&&Zw(`invalid-input`),o>Yw((Fw-r)/t)&&Zw(`overflow`),r+=o*t;let c=i<=a?Lw:i>=a+Rw?Rw:i-a;if(o<c)break;let l=Iw-c;t>Yw(Fw/l)&&Zw(`overflow`),t*=l}let c=t.length+1;a=iT(r-o,c,o==0),Yw(r/c)>Fw-i&&Zw(`overflow`),i+=Yw(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},oT=function(e){let t=[];e=eT(e);let n=e.length,r=Hw,i=0,a=Vw;for(let n of e)n<128&&t.push(Xw(n));let o=t.length,s=o;for(o&&t.push(Uw);s<n;){let n=Fw;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>Yw((Fw-i)/c)&&Zw(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>Fw&&Zw(`overflow`),n===r){let e=i;for(let n=Iw;;n+=Iw){let r=n<=a?Lw:n>=a+Rw?Rw:n-a;if(e<r)break;let i=e-r,o=Iw-r;t.push(Xw(rT(r+i%o,0))),e=Yw(i/o)}t.push(Xw(rT(e,0))),a=iT(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},sT={version:`2.3.1`,ucs2:{decode:eT,encode:tT},decode:aT,encode:oT,toASCII:function(e){return $w(e,function(e){return Gw.test(e)?`xn--`+oT(e):e})},toUnicode:function(e){return $w(e,function(e){return Ww.test(e)?aT(e.slice(4).toLowerCase()):e})}},cT={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`],rules2:[`balance_pairs`,`fragments_join`]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`],rules2:[`balance_pairs`,`emphasis`,`fragments_join`]}}}},lT=/^(vbscript|javascript|file|data):/,uT=/^data:image\/(gif|png|jpeg|webp);/;function dT(e){let t=e.trim().toLowerCase();return lT.test(t)?uT.test(t):!0}var fT=[`http:`,`https:`,`mailto:`];function pT(e){let t=Dx(e,!0);if(t.hostname&&(!t.protocol||fT.indexOf(t.protocol)>=0))try{t.hostname=sT.toASCII(t.hostname)}catch{}return mx(hx(t))}function mT(e){let t=Dx(e,!0);if(t.hostname&&(!t.protocol||fT.indexOf(t.protocol)>=0))try{t.hostname=sT.toUnicode(t.hostname)}catch{}return dx(hx(t),dx.defaultChars+`%`)}function hT(e,t){if(!(this instanceof hT))return new hT(e,t);t||rS(e)||(t=e||{},e=`default`),this.inline=new mw,this.block=new NC,this.core=new cC,this.renderer=new PS,this.linkify=new Pw,this.validateLink=dT,this.normalizeLink=pT,this.normalizeLinkText=mT,this.utils=tS,this.helpers=oS({},MS),this.options={},this.configure(e),t&&this.set(t)}hT.prototype.set=function(e){return oS(this.options,e),this},hT.prototype.configure=function(e){let t=this;if(rS(e)){let t=e;if(e=cT[t],!e)throw Error('Wrong `markdown-it` preset "'+t+`", check name`)}if(!e)throw Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},hT.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to enable unknown rule(s): `+r);return this},hT.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to disable unknown rule(s): `+r);return this},hT.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},hT.prototype.parse=function(e,t){if(typeof e!=`string`)throw Error(`Input data should be a String`);let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},hT.prototype.render=function(e,t){return t||={},this.renderer.render(this.parse(e,t),this.options,t)},hT.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},hT.prototype.renderInline=function(e,t){return t||={},this.renderer.render(this.parseInline(e,t),this.options,t)};var gT=j(k(((e,t)=>{var n=!0,r=!1,i=!1;t.exports=function(e,t){t&&(n=!t.enabled,r=!!t.label,i=!!t.labelAfter),e.core.ruler.after(`inline`,`github-task-lists`,function(e){for(var t=e.tokens,r=2;r<t.length;r++)s(t,r)&&(c(t[r],e.Token),a(t[r-2],`class`,`task-list-item`+(n?``:` enabled`)),a(t[o(t,r-2)],`class`,`contains-task-list`))})};function a(e,t,n){var r=e.attrIndex(t),i=[t,n];r<0?e.attrPush(i):e.attrs[r]=i}function o(e,t){for(var n=e[t].level-1,r=t-1;r>=0;r--)if(e[r].level===n)return r;return-1}function s(e,t){return p(e[t])&&m(e[t-1])&&h(e[t-2])&&g(e[t])}function c(e,t){if(e.children.unshift(l(e,t)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),r)if(i){e.children.pop();var n=`task-item-`+Math.ceil(1e4*1e3*Math.random()-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+` id="`+n+`">`,e.children.push(f(e.content,n,t))}else e.children.unshift(u(t)),e.children.push(d(t))}function l(e,t){var r=new t(`html_inline`,``,0),i=n?` disabled="" `:``;return e.content.indexOf(`[ ] `)===0?r.content=`<input class="task-list-item-checkbox"`+i+`type="checkbox">`:(e.content.indexOf(`[x] `)===0||e.content.indexOf(`[X] `)===0)&&(r.content=`<input class="task-list-item-checkbox" checked=""`+i+`type="checkbox">`),r}function u(e){var t=new e(`html_inline`,``,0);return t.content=`<label>`,t}function d(e){var t=new e(`html_inline`,``,0);return t.content=`</label>`,t}function f(e,t,n){var r=new n(`html_inline`,``,0);return r.content=`<label class="task-list-item-label" for="`+t+`">`+e+`</label>`,r.attrs=[{for:t}],r}function p(e){return e.type===`inline`}function m(e){return e.type===`paragraph_open`}function h(e){return e.type===`list_item_open`}function g(e){return e.content.indexOf(`[ ] `)===0||e.content.indexOf(`[x] `)===0||e.content.indexOf(`[X] `)===0}}))(),1),_T={ALLOWED_TAGS:`a.b.blockquote.br.button.code.del.details.div.em.h1.h2.h3.h4.hr.i.input.li.ol.p.pre.s.span.strong.summary.table.tbody.td.th.thead.tr.ul.img`.split(`.`),ALLOWED_ATTR:[`checked`,`class`,`disabled`,`href`,`rel`,`target`,`title`,`start`,`src`,`alt`,`data-code`,`type`,`aria-label`],ADD_DATA_URI_TAGS:[`img`]},vT=!1,yT=14e4,bT=4e4,xT=200,ST=5e4,CT=/^data:image\/[a-z0-9.+-]+;base64,/i,wT=new Map,TT=`chat-link-tail-blur`,ET=/[\u2E80-\u2FFF\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFF01-\uFF60]/;function DT(e){let t=wT.get(e);return t===void 0?null:(wT.delete(e),wT.set(e,t),t)}function OT(e,t){if(wT.set(e,t),wT.size<=xT)return;let n=wT.keys().next().value;n&&wT.delete(n)}function kT(){vT||(vT=!0,cx.addHook(`afterSanitizeAttributes`,e=>{if(!(e instanceof HTMLAnchorElement))return;let t=e.getAttribute(`href`);if(t){try{let n=new URL(t,window.location.href);if(n.protocol!==`http:`&&n.protocol!==`https:`&&n.protocol!==`mailto:`){e.removeAttribute(`href`);return}}catch{}e.setAttribute(`rel`,`noreferrer noopener`),e.setAttribute(`target`,`_blank`),y(t).includes(`tail`)&&e.classList.add(TT)}}))}function AT(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function jT(e){return e?.trim()||`image`}var MT=new hT({html:!0,breaks:!0,linkify:!0});MT.enable(`strikethrough`),MT.linkify.set({fuzzyLink:!1}),MT.linkify.add(`www`,{validate(e,t){let n=e.slice(t),r=n.match(/^\.(?:[a-zA-Z0-9-]+\.?)+[^\s<\u2E80-\u2FFF\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFF01-\uFF60]*/);if(!r)return 0;let i=r[0].length,a={")":`(`,"]":`[`,"}":`{`,'"':`"`,"'":`'`},o={};for(let[e,t]of Object.entries(a)){o[e]=0;for(let r=0;r<i;r++){let i=n[r];t===e?i===t&&(o[e]=+(o[e]===0)):i===t?o[e]++:i===e&&o[e]--}}for(;i>0;){let e=n[i-1];if(/[?!.,:*_~]/.test(e)){i--;continue}if(e===`;`){let e=i-2;for(;e>=0&&/[a-zA-Z0-9]/.test(n[e]);)e--;if(e>=0&&n[e]===`&`&&e<i-2){i=e;continue}break}let t=a[e];if(t!==void 0){if(t===e){if(o[e]!==0){o[e]=0,i--;continue}}else if(o[e]<0){o[e]++,i--;continue}}break}return i},normalize(e){e.url=`http://`+e.url}}),MT.validateLink=()=>!0,MT.core.ruler.after(`linkify`,`linkify-cjk-trim`,e=>{for(let t of e.tokens){if(t.type!==`inline`||!t.children)continue;let n=t.children;for(let t=n.length-1;t>=0;t--){let r=n[t];if(r.type!==`link_open`||r.markup!==`linkify`)continue;let i=n[t+1];if(!i||i.type!==`text`)continue;let a=i.content,o=a.length;for(;o>0&&ET.test(a[o-1]);)o--;if(o<=0||o===a.length)continue;let s=a.slice(0,o),c=a.slice(o),l=r.attrGet(`href`)??``,u=l.indexOf(a),d=u>0?l.slice(0,u):``;r.attrSet(`href`,d+s),i.content=s;for(let r=t+1;r<n.length;r++)if(n[r].type===`link_close`){let t=new e.Token(`text`,``,0);t.content=c,n.splice(r+1,0,t);break}}}}),MT.use(gT.default,{enabled:!1,label:!1}),MT.core.ruler.after(`github-task-lists`,`task-list-allowlist`,e=>{let t=e.tokens;for(let e=2;e<t.length;e++)if(!(t[e].type!==`inline`||!t[e].children)&&t[e-1].type===`paragraph_open`&&t[e-2].type===`list_item_open`&&(t[e-2].attrGet(`class`)??``).includes(`task-list-item`)){for(let n of t[e].children)if(n.type===`html_inline`&&/^<input\s/i.test(n.content)){n.meta={taskListPlugin:!0};break}}}),MT.renderer.rules.html_block=(e,t)=>AT(e[t].content)+`
749
755
  `,MT.renderer.rules.html_inline=(e,t)=>{let n=e[t];return n.meta?.taskListPlugin===!0?n.content:AT(n.content)},MT.renderer.rules.image=(e,t)=>{let n=e[t],r=n.attrGet(`src`)?.trim()??``,i=jT(n.content);return CT.test(r)?`<img class="markdown-inline-image" src="${AT(r)}" alt="${AT(i)}">`:AT(i)},MT.renderer.rules.fence=(e,t)=>{let n=e[t],r=n.info.trim().split(/\s+/)[0]||``,i=n.content,a=`<pre><code${r?` class="language-${AT(r)}"`:``}>${AT(i)}</code></pre>`,o=`<div class="code-block-header">${r?`<span class="code-block-lang">${AT(r)}</span>`:``}${`<button type="button" class="code-block-copy" data-code="${AT(i)}" aria-label="Copy code"><span class="code-block-copy__idle">Copy</span><span class="code-block-copy__done">Copied!</span></button>`}</div>`,s=i.trim();if(r===`json`||!r&&(s.startsWith(`{`)&&s.endsWith(`}`)||s.startsWith(`[`)&&s.endsWith(`]`))){let e=i.split(`
750
756
  `).length;return`<details class="json-collapse"><summary>${e>1?`JSON &middot; ${e} lines`:`JSON`}</summary><div class="code-block-wrapper">${o}${a}</div></details>`}return`<div class="code-block-wrapper">${o}${a}</div>`},MT.renderer.rules.code_block=(e,t)=>{let n=e[t].content,r=`<pre><code>${AT(n)}</code></pre>`,i=`<div class="code-block-header">${`<button type="button" class="code-block-copy" data-code="${AT(n)}" aria-label="Copy code"><span class="code-block-copy__idle">Copy</span><span class="code-block-copy__done">Copied!</span></button>`}</div>`,a=n.trim();if(a.startsWith(`{`)&&a.endsWith(`}`)||a.startsWith(`[`)&&a.endsWith(`]`)){let e=n.split(`
751
757
  `).length;return`<details class="json-collapse"><summary>${e>1?`JSON &middot; ${e} lines`:`JSON`}</summary><div class="code-block-wrapper">${i}${r}</div></details>`}return`<div class="code-block-wrapper">${i}${r}</div>`};function NT(e){let t=e.trim();if(!t)return``;if(kT(),t.length<=ST){let e=DT(t);if(e!==null)return e}let n=te(t,yT),r=n.truncated?`\n\n… truncated (${n.total} chars, showing first ${n.text.length}).`:``;if(n.text.length>bT){let e=PT(`${n.text}${r}`),i=cx.sanitize(e,_T);return t.length<=ST&&OT(t,i),i}let i;try{i=MT.render(`${n.text}${r}`)}catch(e){console.warn(`[markdown] md.render failed, falling back to plain text:`,e),i=`<pre class="code-block">${AT(`${n.text}${r}`)}</pre>`}let a=cx.sanitize(i,_T);return t.length<=ST&&OT(t,a),a}function PT(e){return`<div class="markdown-plain-text-fallback">${AT(e.replace(/\r\n?/g,`
@@ -998,28 +1004,28 @@ ${e}
998
1004
  ${RE(f,d)}
999
1005
  ${$E(_,n.localMediaPreviewRoots??[],n.basePath,n.assistantAttachmentAuthToken,n.onRequestUpdate)}
1000
1006
  </div>
1001
- `;let w=[`chat-bubble`,ne?`chat-bubble--tool-shell`:``,n.isStreaming?`streaming`:``,`fade-in`].filter(Boolean).join(` `),re=u&&(n.showToolCalls??!0);if(!S&&!re&&!p&&_.length===0&&v.length===0&&!m.replyTarget)return g;let T=`toolmsg:${t}`,E=p||_.length>0,ie=n.isToolMessageExpanded?.(T)??!0,D=[...new Set(l.map(e=>e.name))],O=D.length<=3?D.join(`, `):`${D.slice(0,2).join(`, `)} +${D.length-2} more`,k=S&&!O?S.trim().replace(/\s+/g,` `).slice(0,120):``,ae=l.length===1?l[0]:null,A=ae&&!S&&!E?ae.outputText?.trim()?`Tool output`:`Tool call`:`Tool output`,j=ee||C;return i`
1007
+ `;let w=[`chat-bubble`,ne?`chat-bubble--tool-shell`:``,n.isStreaming?`streaming`:``,`fade-in`].filter(Boolean).join(` `),re=u&&(n.showToolCalls??!0);if(!S&&!re&&!p&&_.length===0&&v.length===0&&!m.replyTarget)return g;let T=`toolmsg:${t}`,ie=p||_.length>0,ae=n.isToolMessageExpanded?.(T)??!0,E=[...new Set(l.map(e=>e.name))],D=E.length<=3?E.join(`, `):`${E.slice(0,2).join(`, `)} +${E.length-2} more`,O=S&&!D?S.trim().replace(/\s+/g,` `).slice(0,120):``,oe=l.length===1?l[0]:null,k=oe&&!S&&!ie?oe.outputText?.trim()?`Tool output`:`Tool call`:`Tool output`,A=ee||C;return i`
1002
1008
  <div class="${w}">
1003
1009
  ${zE(m.replyTarget)}
1004
- ${j?i`<div class="chat-bubble-actions">
1010
+ ${A?i`<div class="chat-bubble-actions">
1005
1011
  ${C?iD(S,r):g}
1006
1012
  ${ee?$T(S):g}
1007
1013
  </div>`:g}
1008
1014
  ${ne?i`
1009
1015
  <div
1010
- class="chat-tool-msg-collapse chat-tool-msg-collapse--manual ${ie?`is-open`:``}"
1016
+ class="chat-tool-msg-collapse chat-tool-msg-collapse--manual ${ae?`is-open`:``}"
1011
1017
  >
1012
1018
  <button
1013
1019
  class="chat-tool-msg-summary"
1014
1020
  type="button"
1015
- aria-expanded=${String(ie)}
1021
+ aria-expanded=${String(ae)}
1016
1022
  @click=${()=>n.onToggleToolMessageExpanded?.(T)}
1017
1023
  >
1018
1024
  <span class="chat-tool-msg-summary__icon">${J.zap}</span>
1019
- <span class="chat-tool-msg-summary__label">${A}</span>
1020
- ${O?i`<span class="chat-tool-msg-summary__names">${O}</span>`:k?i`<span class="chat-tool-msg-summary__preview">${k}</span>`:g}
1025
+ <span class="chat-tool-msg-summary__label">${k}</span>
1026
+ ${D?i`<span class="chat-tool-msg-summary__names">${D}</span>`:O?i`<span class="chat-tool-msg-summary__preview">${O}</span>`:g}
1021
1027
  </button>
1022
- ${ie?i`
1028
+ ${ae?i`
1023
1029
  <div class="chat-tool-msg-body">
1024
1030
  ${RE(f,d)}
1025
1031
  ${$E(_,n.localMediaPreviewRoots??[],n.basePath,n.assistantAttachmentAuthToken,n.onRequestUpdate)}
@@ -1040,7 +1046,7 @@ ${e}
1040
1046
  </details>`:S?i`<div class="chat-text" dir="${UT(S)}">
1041
1047
  ${Uy(NT(S))}
1042
1048
  </div>`:g}
1043
- ${u?ae&&!S&&!p?vy(ae,r,n.canvasHostUrl,n.embedSandboxMode??`scripts`,n.allowExternalEmbedUrls??!1):eD(l,{messageKey:t,onOpenSidebar:r,isToolExpanded:n.isToolExpanded,onToggleToolExpanded:n.onToggleToolExpanded,canvasHostUrl:n.canvasHostUrl,embedSandboxMode:n.embedSandboxMode??`scripts`,allowExternalEmbedUrls:n.allowExternalEmbedUrls??!1}):g}
1049
+ ${u?oe&&!S&&!p?vy(oe,r,n.canvasHostUrl,n.embedSandboxMode??`scripts`,n.allowExternalEmbedUrls??!1):eD(l,{messageKey:t,onOpenSidebar:r,isToolExpanded:n.isToolExpanded,onToggleToolExpanded:n.onToggleToolExpanded,canvasHostUrl:n.canvasHostUrl,embedSandboxMode:n.embedSandboxMode??`scripts`,allowExternalEmbedUrls:n.allowExternalEmbedUrls??!1}):g}
1044
1050
  </div>
1045
1051
  `:g}
1046
1052
  </div>
@@ -1595,7 +1601,7 @@ ${e}
1595
1601
  </div>
1596
1602
  </div>
1597
1603
  </section>
1598
- `}function aO(e,t){let n={...t,lastActiveSessionKey:v(t.lastActiveSessionKey)??v(t.sessionKey)??`main`};e.settings=n,dg(n),(t.theme!==e.theme||t.themeMode!==e.themeMode)&&(e.theme=t.theme,e.themeMode=t.themeMode,xO(e,Fh(t.theme,t.themeMode))),bO(t.borderRadius),e.applySessionKey=e.settings.lastActiveSessionKey}function oO(e,t){let n=Vh({name:e.userName,avatar:e.userAvatar,...t});e.userName=n.name,e.userAvatar=n.avatar,pg(n)}function sO(e,t){e.sessionKey=t,aO(e,{...e.settings,sessionKey:t,lastActiveSessionKey:t})}var cO=!1;function lO(e){if(!window.location.search&&!window.location.hash)return;let t=new URL(window.location.href),n=new URLSearchParams(t.search),r=new URLSearchParams(t.hash.startsWith(`#`)?t.hash.slice(1):t.hash),i=n.get(`gatewayUrl`)??r.get(`gatewayUrl`),a=v(i)??``,o=!!(a&&a!==e.settings.gatewayUrl),s=n.get(`token`),c=r.get(`token`),l=c!=null||s!=null,u=v(c??s),d=v(n.get(`session`)??r.get(`session`)),f=!!(u&&!d&&!o),p=!1;if(n.has(`token`)&&(n.delete(`token`),p=!0),l&&(s!=null&&(cO=!0,console.warn(`[genesis] Auth token passed as query parameter (?token=). Use URL fragment instead: #token=<token>. Query parameters may appear in server logs.`)),u&&o?e.pendingGatewayToken=u:u&&u!==e.settings.token&&aO(e,{...e.settings,token:u}),r.delete(`token`),p=!0),f&&(e.sessionKey=`main`,aO(e,{...e.settings,sessionKey:`main`,lastActiveSessionKey:`main`})),(n.has(`password`)||r.has(`password`))&&(n.delete(`password`),r.delete(`password`),p=!0),d&&sO(e,d),i!=null&&(e.pendingGatewayUrl=o?a:null,e.pendingGatewayToken=o?u??null:null,n.delete(`gatewayUrl`),r.delete(`gatewayUrl`),p=!0),!p)return;t.search=n.toString();let m=r.toString();t.hash=m?`#${m}`:``,EO(t,!0)}function uO(e,t){DO(e,t,{refreshPolicy:`always`,syncUrl:!0})}function dO(e,t,n,r){gg({nextTheme:t,applyTheme:n,context:r,currentTheme:e.themeResolved}),SO(e)}function fO(e,t,n){dO(e,Fh(t,e.themeMode),()=>aO(e,{...e.settings,theme:t}),n)}function pO(e,t,n){dO(e,Fh(e.theme,t),()=>aO(e,{...e.settings,themeMode:t}),n)}async function mO(e,t){await bf(t),await Qn(t);let n=e.agentsList?.agents?.map(e=>e.id)??[];n.length>0&&gf(t,n);let r=e.agentsSelectedId??e.agentsList?.defaultId??e.agentsList?.agents?.[0]?.id;if(r)switch(hf(t,r),e.agentsPanel){case`files`:ff(t,r);return;case`skills`:_f(t,r);return;case`channels`:Sn(t,!1);return;case`cron`:IO(e);return;case`overview`:case`tools`:case void 0:return}}async function hO(e){let t=e;switch(e.tab){case`config`:case`communications`:case`appearance`:case`automation`:case`infrastructure`:case`aiAgents`:await $n(t),await Qn(t);return;case`overview`:await AO(e);return;case`canvas`:return;case`channels`:await FO(e);return;case`instances`:await Wm(t);return;case`usage`:await xh(t);return;case`sessions`:await Nl(t,{search:t.sessionsSearchQuery});return;case`cron`:await IO(e);return;case`wallet`:await Eh(t,{includeBalances:!0});return;case`skills`:await Ym(t);return;case`mcp`:await ym(t),await wm(t);return;case`plugins`:await Fm(t);return;case`agents`:await mO(e,t);return;case`nodes`:await Zd(t),await sp(t),await Qn(t),await pm(t);return;case`dreams`:await Qn(t),await Promise.all([Kp(t),qp(t),Jp(t),Yp(t)]);return;case`chat`:await ad(e),ti(e,!e.chatHasAutoScrolled);return;case`debug`:await Ad(t),e.eventLog=e.eventLogBuffer;return;case`logs`:e.logsAtBottom=!0,await Ld(t,{reset:!0}),ni(e,!0);return}}function gO(){if(typeof window>`u`)return``;let e=window.__GENESIS_CONTROL_UI_BASE_PATH__,t=v(e);return t?Wl(t):Jl(window.location.pathname)}function _O(e){e.theme=`mono`,e.themeMode=e.settings.themeMode??`system`,xO(e,Fh(e.theme,e.themeMode)),bO(e.settings.borderRadius??50),SO(e)}function vO(e){e.systemThemeCleanup?.(),e.systemThemeCleanup=null}var yO={sm:6,md:10,lg:14,xl:20,full:9999,default:10};function bO(e){if(typeof document>`u`)return;let t=document.documentElement,n=e/50;t.style.setProperty(`--radius-sm`,`${Math.round(yO.sm*n)}px`),t.style.setProperty(`--radius-md`,`${Math.round(yO.md*n)}px`),t.style.setProperty(`--radius-lg`,`${Math.round(yO.lg*n)}px`),t.style.setProperty(`--radius-xl`,`${Math.round(yO.xl*n)}px`),t.style.setProperty(`--radius-full`,`${Math.round(yO.full*n)}px`),t.style.setProperty(`--radius`,`${Math.round(yO.default*n)}px`)}function xO(e,t){if(e.themeResolved=t,typeof document>`u`)return;let n=document.documentElement,r=t.endsWith(`light`)?`light`:`dark`;n.dataset.theme=t,n.dataset.themeMode=r,n.style.colorScheme=r}function SO(e){if(e.themeMode!==`system`){e.systemThemeCleanup?.(),e.systemThemeCleanup=null;return}if(e.systemThemeCleanup||typeof globalThis.matchMedia!=`function`)return;let t=globalThis.matchMedia(`(prefers-color-scheme: light)`),n=()=>{e.themeMode===`system`&&xO(e,Fh(e.theme,`system`))};if(typeof t.addEventListener==`function`){t.addEventListener(`change`,n),e.systemThemeCleanup=()=>t.removeEventListener(`change`,n);return}typeof t.addListener==`function`&&(t.addListener(n),e.systemThemeCleanup=()=>t.removeListener(n))}function CO(e,t){if(typeof window>`u`)return;let n=ql(window.location.pathname,e.basePath)??`chat`;TO(e,n),OO(e,n,t)}function wO(e){if(typeof window>`u`)return;let t=ql(window.location.pathname,e.basePath);if(!t)return;let n=v(new URL(window.location.href).searchParams.get(`session`));n&&sO(e,n),TO(e,t)}function TO(e,t){DO(e,t,{refreshPolicy:`connected`})}function EO(e,t){return t?window.history.replaceState({},``,e.toString()):window.history.pushState({},``,e.toString())}function DO(e,t,n){let r=e.tab;e.tab=t,r===`chat`&&t!==`chat`&&LD(),t===`chat`&&(e.chatHasAutoScrolled=!1),(t===`logs`?sf:cf)(e),(t===`debug`?lf:uf)(e),(n.refreshPolicy===`always`||e.connected)&&hO(e),n.syncUrl&&OO(e,t,!1)}function OO(e,t,n){if(typeof window>`u`)return;let r=Gl(Kl(t,e.basePath)),i=Gl(window.location.pathname),a=new URL(window.location.href);t===`chat`&&e.sessionKey?a.searchParams.set(`session`,e.sessionKey):a.searchParams.delete(`session`),i!==r&&(a.pathname=r),EO(a,n)}function kO(e,t,n){if(typeof window>`u`)return;let r=new URL(window.location.href);r.searchParams.set(`session`,t),EO(r,n)}async function AO(e,t){let n=e;await Promise.allSettled([Sn(n,!1),Wm(n),Nl(n),Nf(n),If(n),Ad(n),Ym(n),xh(n),NO(n),Eh(n),jm(n,{refresh:t?.refresh})]),PO(n)}function jO(e){return e?.scopes?kd({role:e.role??`operator`,requestedScopes:[`operator.read`],allowedScopes:e.scopes}):!1}function MO(e){return e?Object.values(e).some(e=>Array.isArray(e)&&e.length>0):!1}async function NO(e){if(!(!e.client||!e.connected))try{let t=await e.client.request(`logs.tail`,{cursor:e.overviewLogCursor||void 0,limit:100,maxBytes:5e4}),n=Array.isArray(t.lines)?t.lines.filter(e=>typeof e==`string`):[];e.overviewLogLines=[...e.overviewLogLines,...n].slice(-500),typeof t.cursor==`number`&&(e.overviewLogCursor=t.cursor)}catch{}}function PO(e){let t=[];e.lastError&&t.push({severity:`error`,icon:`x`,title:`Gateway Error`,description:e.lastError});let n=e.hello?.auth??null;n?.scopes&&!jO(n)&&t.push({severity:`warning`,icon:`key`,title:`Missing operator.read scope`,description:`This connection does not have the operator.read scope. Some features may be unavailable.`,href:`https://genesis.pixelzx.com/docs/web/dashboard`,external:!0});let r=e.skillsReport?.skills??[],i=r.filter(e=>!e.disabled&&MO(e.missing));if(i.length>0){let e=i.slice(0,3).map(e=>e.name),n=i.length>3?` +${i.length-3} more`:``;t.push({severity:`warning`,icon:`zap`,title:`Skills with missing dependencies`,description:`${e.join(`, `)}${n}`})}let a=r.filter(e=>e.blockedByAllowlist);a.length>0&&t.push({severity:`warning`,icon:`shield`,title:`${a.length} skill${a.length>1?`s`:``} blocked`,description:a.map(e=>e.name).join(`, `)});let o=e.cronJobs??[],s=o.filter(e=>e.state?.lastStatus===`error`);s.length>0&&t.push({severity:`error`,icon:`clock`,title:`${s.length} cron job${s.length>1?`s`:``} failed`,description:s.map(e=>e.name).join(`, `)});let c=Date.now(),l=o.filter(e=>e.enabled&&e.state?.nextRunAtMs!=null&&c-e.state.nextRunAtMs>3e5);l.length>0&&t.push({severity:`warning`,icon:`clock`,title:`${l.length} overdue job${l.length>1?`s`:``}`,description:l.map(e=>e.name).join(`, `)});let u=e.modelAuthStatusResult;if(u){let e=u.providers.filter(Oh),n=e.filter(e=>e.status===`expired`||e.status===`missing`);n.length>0&&t.push({severity:`error`,icon:`key`,title:p(`overview.cards.modelAuthAttentionExpiredTitle`),description:p(`overview.cards.modelAuthAttentionExpiredDesc`,{providers:n.map(e=>e.displayName).join(`, `)})});let r=e.filter(e=>e.status===`expiring`);r.length>0&&t.push({severity:`warning`,icon:`key`,title:p(`overview.cards.modelAuthAttentionExpiringTitle`),description:r.map(e=>p(`overview.cards.modelAuthAttentionExpiringEntry`,{provider:e.displayName,when:e.expiry?.label??`soon`})).join(`, `)})}e.attentionItems=t}async function FO(e){let t=e;await Promise.all([Sn(t,!0),$n(t),Qn(t)])}async function IO(e){let t=e,n=t.cronRunsScope===`job`?t.cronRunsJobId:null;await Promise.all([Sn(t,!1),Nf(t),If(t),ep(t,n)])}function LO(e){if(!e||e.state!==`final`)return!1;let t=e.message;if(!t||typeof t!=`object`)return!0;let n=t.role;return typeof n!=`string`||n.trim().toLowerCase()!==`assistant`}function RO(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.kind!==`btw`)return null;let n=v(t.runId),r=v(t.sessionKey),i=v(t.question),a=v(t.text);return n&&r&&i&&a?{kind:`btw`,runId:n,sessionKey:r,question:i,text:a,isError:t.isError===!0,ts:typeof t.ts==`number`&&Number.isFinite(t.ts)?t.ts:Date.now()}:null}async function zO(e,t){if(!e.client||!e.connected)return;let n=t?.sessionKey?.trim()||e.sessionKey.trim(),r=n?{sessionKey:n}:{};try{let t=await e.client.request(`agent.identity.get`,r);if(!t)return;let n=Zy(t);e.assistantName=n.name,e.assistantAvatar=n.avatar,e.assistantAgentId=n.agentId??null}catch{}}var BO=`/__genesis/control-ui-config.json`;async function VO(e){if(typeof window>`u`||typeof fetch!=`function`)return;let t=Wl(e.basePath??``),n=t?`${t}${BO}`:BO;try{let t=new URL(n,window.location.origin).origin===window.location.origin?de(e):[],r=t.length>0?t:[``],i=null;for(let e of r){let t={Accept:`application/json`};if(e&&(t.Authorization=`Bearer ${e}`),i=await fetch(n,{method:`GET`,headers:t,credentials:`same-origin`}),i.ok)break;if(i.status!==401&&i.status!==403)return}if(!i||!i.ok)return;let a=await i.json(),o=Zy({agentId:a.assistantAgentId??null,name:a.assistantName,avatar:a.assistantAvatar??null});e.assistantName=o.name,e.assistantAvatar=o.avatar,e.assistantAgentId=o.agentId??null,e.serverVersion=a.serverVersion??null,e.localMediaPreviewRoots=Array.isArray(a.localMediaPreviewRoots)?a.localMediaPreviewRoots.filter(e=>typeof e==`string`):[],e.embedSandboxMode=a.embedSandbox===`trusted`?`trusted`:a.embedSandbox===`strict`?`strict`:`scripts`,e.allowExternalEmbedUrls=a.allowExternalEmbedUrls===!0}catch{}}function HO(e){return typeof e==`object`&&!!e}function UO(e){if(!HO(e))return null;let t=v(e.id)??``,n=e.request;if(!t||!HO(n))return null;let r=v(n.command)??``;if(!r)return null;let i=typeof e.createdAtMs==`number`?e.createdAtMs:0,a=typeof e.expiresAtMs==`number`?e.expiresAtMs:0;return!i||!a?null:{id:t,kind:`exec`,request:{command:r,cwd:typeof n.cwd==`string`?n.cwd:null,host:typeof n.host==`string`?n.host:null,security:typeof n.security==`string`?n.security:null,ask:typeof n.ask==`string`?n.ask:null,agentId:typeof n.agentId==`string`?n.agentId:null,resolvedPath:typeof n.resolvedPath==`string`?n.resolvedPath:null,sessionKey:typeof n.sessionKey==`string`?n.sessionKey:null},createdAtMs:i,expiresAtMs:a}}function WO(e){if(!HO(e))return null;let t=v(e.id)??``;return t?{id:t,decision:typeof e.decision==`string`?e.decision:null,resolvedBy:typeof e.resolvedBy==`string`?e.resolvedBy:null,ts:typeof e.ts==`number`?e.ts:null}:null}function GO(e){if(!HO(e))return null;let t=v(e.id)??``;if(!t)return null;let n=typeof e.createdAtMs==`number`?e.createdAtMs:0,r=typeof e.expiresAtMs==`number`?e.expiresAtMs:0;if(!n||!r)return null;let i=HO(e.request)?e.request:{},a=v(i.title)??``;if(!a)return null;let o=typeof i.description==`string`?i.description:null,s=typeof i.severity==`string`?i.severity:null,c=typeof i.pluginId==`string`?i.pluginId:null;return{id:t,kind:`plugin`,request:{command:a,agentId:typeof i.agentId==`string`?i.agentId:null,sessionKey:typeof i.sessionKey==`string`?i.sessionKey:null},pluginTitle:a,pluginDescription:o,pluginSeverity:s,pluginId:c,createdAtMs:n,expiresAtMs:r}}function KO(e){let t=Date.now();return e.filter(e=>e.expiresAtMs>t)}function qO(e,t){let n=KO(e).filter(e=>e.id!==t.id);return n.unshift(t),n}function JO(e,t){return KO(e).filter(e=>e.id!==t)}var YO={ok:!1,ts:0,durationMs:0,heartbeatSeconds:0,defaultAgentId:``,agents:[],sessions:{path:``,count:0,recent:[]}};async function XO(e){try{return await e.request(`health`,{})??YO}catch{return YO}}async function ZO(e){if(!(!e.client||!e.connected)&&!e.healthLoading){e.healthLoading=!0,e.healthError=null;try{e.healthResult=await XO(e.client)}catch(t){e.healthError=String(t)}finally{e.healthLoading=!1}}}function QO(e){return/^(?:typeerror:\s*)?(?:fetch failed|failed to fetch)$/i.test(e.trim())}function $O(e,t){if(!t)return;e.execApprovalQueue=qO(e.execApprovalQueue,t),e.execApprovalError=null;let n=Math.max(0,t.expiresAtMs-Date.now()+500);window.setTimeout(()=>{e.execApprovalQueue=JO(e.execApprovalQueue,t.id)},n)}function ek(e,t){let n=WO(t);n&&(e.execApprovalQueue=JO(e.execApprovalQueue,n.id))}function tk(e){return e===`final`||e===`aborted`||e===`error`}function nk(e){return!!(e&&typeof e==`object`)}function rk(e){if(!nk(e))return!1;let t=e.role;return typeof t==`string`&&t.trim().toLowerCase()===`user`}var ik=[`session`,`updatedAt`,`sessionId`,`kind`,`label`,`displayName`,`status`,`childSessions`,`totalTokens`,`totalTokensFresh`,`contextTokens`,`modelProvider`,`model`,`compactionCheckpointCount`,`latestCompactionCheckpoint`];function ak(e){return nk(e)?ik.some(t=>t in e):!1}function ok(e,t,n){let r=e.tab===`sessions`?e.sessionsSearchQuery?.trim():``;return r?{search:r}:!n||!ak(t)?{}:null}function sk(e){let t=e.serverVersion?.trim();if(!t)return;let n=e.pageUrl??(typeof window>`u`?void 0:window.location.href);if(n)try{let r=new URL(n),i=new URL(e.gatewayUrl,r);return!new Set([`ws:`,`wss:`,`http:`,`https:`]).has(i.protocol)||i.host!==r.host?void 0:t}catch{return}}function ck(e,t){let n=(e??``).trim(),r=t.mainSessionKey?.trim();if(!r)return n;if(!n)return r;let i=t.mainKey?.trim()||`main`,a=t.defaultAgentId?.trim();return n===`main`||n===i||a&&(n===`agent:${a}:main`||n===`agent:${a}:${i}`)?r:n}function lk(e,t){if(!t?.mainSessionKey)return;if(ck(e.sessionKey,t)===e.sessionKey){let n=ck(e.settings.lastActiveSessionKey,t);n!==e.settings.lastActiveSessionKey&&aO(e,{...e.settings,lastActiveSessionKey:n});return}let n=ck(e.sessionKey,t),r=ck(e.settings.sessionKey,t),i=ck(e.settings.lastActiveSessionKey,t),a=n||r||e.sessionKey,o={...e.settings,sessionKey:r||a,lastActiveSessionKey:i||a},s=o.sessionKey!==e.settings.sessionKey||o.lastActiveSessionKey!==e.settings.lastActiveSessionKey;a!==e.sessionKey&&(e.sessionKey=a),s&&aO(e,o)}function uk(e,t){let n=e,r=t?.reason??`initial`;n.pendingShutdownMessage=null,n.resumeChatQueueAfterReconnect=!1,e.lastError=null,e.lastErrorCode=null,e.hello=null,e.connected=!1,r===`seq-gap`?(e.execApprovalQueue=KO(e.execApprovalQueue),$u(e,e.chatRunId??void 0),n.resumeChatQueueAfterReconnect=!0):e.execApprovalQueue=KO(e.execApprovalQueue),e.execApprovalError=null;let i=e.client,a=sk({gatewayUrl:e.settings.gatewayUrl,serverVersion:e.serverVersion}),o=new yn({url:e.settings.gatewayUrl,token:e.settings.token.trim()?e.settings.token:void 0,password:e.password.trim()?e.password:void 0,clientName:`genesis-control-ui`,clientVersion:a,mode:`webchat`,instanceId:e.clientInstanceId,onHello:t=>{if(e.client===o){if(n.pendingShutdownMessage=null,e.connected=!0,e.lastError=null,e.lastErrorCode=null,e.hello=t,gk(e,t),VO(e),e.pendingAbort){let t=e.pendingAbort;e.pendingAbort=null,e.client.request(`chat.abort`,{sessionKey:t.sessionKey,runId:t.runId}).catch(e=>{console.warn(`[genesis] pending abort failed:`,e)})}e.chatRunId=null,e.chatStream=null,e.chatStreamStartedAt=null,e.chatSideResultTerminalRuns?.clear(),Ai(e),n.resumeChatQueueAfterReconnect&&(n.resumeChatQueueAfterReconnect=!1,cd(e)),Ml(e),zO(e),bf(e),ZO(e),Zd(e,{quiet:!0}),sp(e,{quiet:!0}),hO(e)}},onClose:({code:t,reason:r,error:i})=>{if(e.client===o)if(e.connected=!1,e.lastErrorCode=ln(i)??(typeof i?.code==`string`?i.code:null),t!==1012){if(i?.message){e.lastError=e.lastErrorCode&&(e.lastErrorCode===L.PAIRING_REQUIRED||QO(i.message))?pc({message:i.message,details:i.details,code:i.code}):i.message;return}e.lastError=n.pendingShutdownMessage??`disconnected (${t}): ${r||`no reason`}`}else e.lastError=n.pendingShutdownMessage??null,e.lastErrorCode=null},onEvent:t=>{e.client===o&&dk(e,t)},onGap:({expected:t,received:n})=>{e.client===o&&(e.lastError=`event gap detected (expected seq ${t}, got ${n}); reconnecting`,e.lastErrorCode=null,uk(e,{reason:`seq-gap`}))}});e.client=o,i?.stop(),o.start()}function dk(e,t){try{hk(e,t)}catch(e){console.error(`[gateway] handleGatewayEvent error:`,t.event,e)}}function fk(e,t,n){if(n!==`final`&&n!==`error`&&n!==`aborted`)return!1;let r=e,i=r.toolStreamOrder.length>0,a=()=>void cd(e);$u(e,t?.runId);let o=t?.runId;if(o&&e.refreshSessionsAfterChat.has(o)&&(e.refreshSessionsAfterChat.delete(o),n===`final`&&Nl(e,{activeMinutes:120})),i&&n===`final`){let t=o??null;return ol(e).finally(()=>{t&&e.chatRunId&&e.chatRunId!==t||(Ai(r),a())}),!0}return Ai(r),a(),!1}function pk(e,t){t?.sessionKey&&Qr(e,t.sessionKey);let n=e;if(tk(t?.state)&&typeof t?.runId==`string`&&n.chatSideResultTerminalRuns?.has(t.runId)===!0&&t?.runId){n.chatSideResultTerminalRuns?.delete(t.runId);return}let r=_l(e,t),i=fk(e,t,r),a=e,o=a.pendingSessionMessageReloadSessionKey?.trim(),s=t?.sessionKey?.trim(),c=!!(o&&s&&o===s&&tk(r)&&s===e.sessionKey&&!e.chatRunId);if(o&&s&&o===s&&(a.pendingSessionMessageReloadSessionKey=null),r===`final`&&!i&&LO(t)){ol(e);return}c&&!i&&ol(e)}function mk(e,t){jl(e,t);let n=e,r=t?.sessionKey?.trim();if(!(!r||r!==e.sessionKey)){if(e.chatRunId){if(rk(t?.message)&&el(e,t?.message,{appendIfMissing:!1}))return;n.pendingSessionMessageReloadSessionKey=r;return}n.pendingSessionMessageReloadSessionKey=null,!el(e,t?.message,{appendIfMissing:!0})&&ol(e)}}function hk(e,t){if(e.eventLogBuffer=[{ts:Date.now(),event:t.event,payload:t.payload},...e.eventLogBuffer].slice(0,250),(e.tab===`debug`||e.tab===`overview`)&&(e.eventLog=e.eventLogBuffer),t.event===`agent`){if(e.onboarding)return;Bi(e,t.payload);return}if(t.event===`chat`){pk(e,t.payload);return}if(t.event===`chat.side_result`){let n=RO(t.payload);if(!n||n.sessionKey!==e.sessionKey)return;let r=e;r.chatSideResult=n,r.chatSideResultTerminalRuns?.add(n.runId);return}if(t.event===`session.message`){mk(e,t.payload);return}if(t.event===`presence`){let n=t.payload;n?.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence,e.presenceError=null,e.presenceStatus=null);return}if(t.event===`shutdown`){let n=t.payload,r=n&&typeof n.reason==`string`&&n.reason.trim()?n.reason.trim():`gateway stopping`,i=typeof n?.restartExpectedMs==`number`?`Restarting: ${r}`:`Disconnected: ${r}`;e.pendingShutdownMessage=i,e.lastError=i,e.lastErrorCode=null;return}if(t.event===`sessions.changed`){let n=jl(e,t.payload),r=ok(e,t.payload,n);r&&Nl(e,r);return}if(t.event===`cron`&&e.tab===`cron`&&IO(e),(t.event===`device.pair.requested`||t.event===`device.pair.resolved`)&&sp(e,{quiet:!0}),t.event===`exec.approval.requested`){$O(e,UO(t.payload));return}if(t.event===`exec.approval.resolved`){ek(e,t.payload);return}if(t.event===`plugin.approval.requested`){$O(e,GO(t.payload));return}if(t.event===`plugin.approval.resolved`){ek(e,t.payload);return}t.event===`update.available`&&(e.updateAvailable=t.payload?.updateAvailable??null)}function gk(e,t){let n=t.snapshot;n?.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence),n?.health&&(e.debugHealth=n.health,e.healthResult=n.health),n?.sessionDefaults&&lk(e,n.sessionDefaults),e.updateAvailable=n?.updateAvailable??null}function _k(e){let t=++e.connectGeneration;e.basePath=gO(),lO(e);let n=VO(e);CO(e,!0),_O(e),window.addEventListener(`popstate`,e.popStateHandler),n.finally(()=>{e.connectGeneration===t&&uk(e)}),af(e),e.tab===`logs`&&sf(e),e.tab===`debug`&&lf(e)}function vk(e){si(e)}function yk(e){e.connectGeneration+=1,window.removeEventListener(`popstate`,e.popStateHandler),of(e),cf(e),uf(e),e.realtimeTalkSession?.stop(),e.realtimeTalkSession=null,e.realtimeTalkActive=!1,e.realtimeTalkStatus=`idle`,e.realtimeTalkDetail=null,e.realtimeTalkTranscript=null,e.client?.stop(),e.client=null,e.connected=!1,vO(e),e.topbarObserver?.disconnect(),e.topbarObserver=null}function bk(e,t){if(!(e.tab===`chat`&&e.chatManualRefreshInFlight)){if(e.tab===`chat`&&(t.has(`chatMessages`)||t.has(`chatToolMessages`)||t.has(`chatStream`)||t.has(`chatLoading`)||t.has(`tab`))){let n=t.has(`tab`),r=t.has(`chatLoading`)&&t.get(`chatLoading`)===!0&&!e.chatLoading,i=t.get(`chatStream`),a=t.has(`chatStream`)&&i==null&&typeof e.chatStream==`string`;ti(e,n||r||a||!e.chatHasAutoScrolled)}e.tab===`logs`&&(t.has(`logsEntries`)||t.has(`logsAutoFollow`)||t.has(`tab`))&&e.logsAutoFollow&&e.logsAtBottom&&ni(e,t.has(`tab`)||t.has(`logsAutoFollow`))}}function xk(e){return e.initialValue===void 0?e.type===`select`?e.options?.[0]?.value??``:e.type===`multiselect`?[]:e.type===`confirm`?!!e.initialValue:e.type===`text`?``:!0:e.initialValue}async function Sk(e){await Qn(e),e.client&&e.connected&&(e.chatModelCatalog=await vl(e.client)),await jm(e,{refresh:!0})}async function Ck(e,t,n){if(t.step&&!t.done){e.modelProviderWizardSessionId=t.sessionId??n??e.modelProviderWizardSessionId,e.modelProviderWizardStep=t.step,e.modelProviderWizardInput=xk(t.step),e.modelProviderWizardMessage=null,e.modelProviderWizardError=null;return}if(e.modelProviderWizardSessionId=null,e.modelProviderWizardStep=null,e.modelProviderWizardInput=null,t.status===`error`){e.modelProviderWizardError=t.error??`Model provider setup failed.`,e.modelProviderWizardMessage=null;return}if(t.status===`cancelled`){e.modelProviderWizardError=null,e.modelProviderWizardMessage=`Model provider setup cancelled.`;return}e.modelProviderWizardError=null,e.modelProviderWizardMessage=`Model provider connected.`,await Sk(e)}async function wk(e){if(!(!e.client||!e.connected||e.modelProviderWizardBusy)){e.modelProviderWizardBusy=!0,e.modelProviderWizardError=null,e.modelProviderWizardMessage=null;try{let t=await e.client.request(`wizard.start`,{target:`models`});await Ck(e,t,t.sessionId??null)}catch(t){e.modelProviderWizardError=String(t),e.modelProviderWizardMessage=null}finally{e.modelProviderWizardBusy=!1}}}function Tk(e,t){e.modelProviderWizardInput=t}async function Ek(e){if(!e.client||!e.connected||e.modelProviderWizardBusy)return;let t=e.modelProviderWizardSessionId,n=e.modelProviderWizardStep;if(!(!t||!n)){e.modelProviderWizardBusy=!0,e.modelProviderWizardError=null;try{await Ck(e,await e.client.request(`wizard.next`,{sessionId:t,answer:{stepId:n.id,value:e.modelProviderWizardInput}}),t)}catch(t){e.modelProviderWizardError=String(t)}finally{e.modelProviderWizardBusy=!1}}}async function Dk(e){let t=e.modelProviderWizardSessionId;if(e.modelProviderWizardSessionId=null,e.modelProviderWizardStep=null,e.modelProviderWizardInput=null,e.modelProviderWizardError=null,e.modelProviderWizardMessage=null,!(!t||!e.client||!e.connected))try{await e.client.request(`wizard.cancel`,{sessionId:t})}catch{}}function Ok(e){e.modelProviderWizardError=null,e.modelProviderWizardMessage=null}var kk=new Set([`agent`,`channel`,`chat`,`provider`,`model`,`tool`,`label`,`key`,`session`,`id`,`has`,`mintokens`,`maxtokens`,`mincost`,`maxcost`,`minmessages`,`maxmessages`]),Ak=e=>y(e),jk=e=>{let t=e.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*/g,`.*`).replace(/\?/g,`.`);return RegExp(`^${t}$`,`i`)},Mk=e=>{let t=y(e);if(!t)return null;t.startsWith(`$`)&&(t=t.slice(1));let n=1;t.endsWith(`k`)?(n=1e3,t=t.slice(0,-1)):t.endsWith(`m`)&&(n=1e6,t=t.slice(0,-1));let r=Number(t);return Number.isFinite(r)?r*n:null},Nk=e=>(e.match(/"[^"]+"|\S+/g)??[]).map(e=>{let t=e.replace(/^"|"$/g,``),n=t.indexOf(`:`);return n>0?{key:t.slice(0,n),value:t.slice(n+1),raw:t}:{value:t,raw:t}}),Pk=e=>[e.label,e.key,e.sessionId].filter(e=>!!e).map(e=>y(e)),Fk=e=>{let t=new Set;e.modelProvider&&t.add(y(e.modelProvider)),e.providerOverride&&t.add(y(e.providerOverride)),e.origin?.provider&&t.add(y(e.origin.provider));for(let n of e.usage?.modelUsage??[])n.provider&&t.add(y(n.provider));return Array.from(t)},Ik=e=>{let t=new Set;e.model&&t.add(y(e.model));for(let n of e.usage?.modelUsage??[])n.model&&t.add(y(n.model));return Array.from(t)},Lk=e=>(e.usage?.toolUsage?.tools??[]).map(e=>y(e.name)),Rk=(e,t)=>{let n=Ak(t.value??``);if(!n)return!0;if(!t.key)return Pk(e).some(e=>e.includes(n));switch(Ak(t.key)){case`agent`:return y(e.agentId).includes(n);case`channel`:return y(e.channel).includes(n);case`chat`:return y(e.chatType).includes(n);case`provider`:return Fk(e).some(e=>e.includes(n));case`model`:return Ik(e).some(e=>e.includes(n));case`tool`:return Lk(e).some(e=>e.includes(n));case`label`:return y(e.label).includes(n);case`key`:case`session`:case`id`:if(n.includes(`*`)||n.includes(`?`)){let t=jk(n);return t.test(e.key)||(e.sessionId?t.test(e.sessionId):!1)}return y(e.key).includes(n)||y(e.sessionId).includes(n);case`has`:switch(n){case`tools`:return(e.usage?.toolUsage?.totalCalls??0)>0;case`errors`:return(e.usage?.messageCounts?.errors??0)>0;case`context`:return!!e.contextWeight;case`usage`:return!!e.usage;case`model`:return Ik(e).length>0;case`provider`:return Fk(e).length>0;default:return!0}case`mintokens`:{let t=Mk(n);return t===null?!0:(e.usage?.totalTokens??0)>=t}case`maxtokens`:{let t=Mk(n);return t===null?!0:(e.usage?.totalTokens??0)<=t}case`mincost`:{let t=Mk(n);return t===null?!0:(e.usage?.totalCost??0)>=t}case`maxcost`:{let t=Mk(n);return t===null?!0:(e.usage?.totalCost??0)<=t}case`minmessages`:{let t=Mk(n);return t===null?!0:(e.usage?.messageCounts?.total??0)>=t}case`maxmessages`:{let t=Mk(n);return t===null?!0:(e.usage?.messageCounts?.total??0)<=t}default:return!0}},zk=(e,t)=>{let n=Nk(t);if(n.length===0)return{sessions:e,warnings:[]};let r=[];for(let e of n){if(!e.key)continue;let t=Ak(e.key);if(!kk.has(t)){r.push(`Unknown filter: ${e.key}`);continue}if(e.value===``&&r.push(`Missing value for ${e.key}`),t===`has`){let t=new Set([`tools`,`errors`,`context`,`usage`,`model`,`provider`]);e.value&&!t.has(Ak(e.value))&&r.push(`Unknown has:${e.value}`)}[`mintokens`,`maxtokens`,`mincost`,`maxcost`,`minmessages`,`maxmessages`].includes(t)&&e.value&&Mk(e.value)===null&&r.push(`Invalid number for ${e.key}`)}return{sessions:e.filter(e=>n.every(t=>Rk(e,t))),warnings:r}};function Bk(e){let t=e.split(`
1604
+ `}function aO(e,t){let n={...t,lastActiveSessionKey:v(t.lastActiveSessionKey)??v(t.sessionKey)??`main`};e.settings=n,dg(n),(t.theme!==e.theme||t.themeMode!==e.themeMode)&&(e.theme=t.theme,e.themeMode=t.themeMode,xO(e,Fh(t.theme,t.themeMode))),bO(t.borderRadius),e.applySessionKey=e.settings.lastActiveSessionKey}function oO(e,t){let n=Vh({name:e.userName,avatar:e.userAvatar,...t});e.userName=n.name,e.userAvatar=n.avatar,pg(n)}function sO(e,t){e.sessionKey=t,aO(e,{...e.settings,sessionKey:t,lastActiveSessionKey:t})}var cO=!1;function lO(e){if(!window.location.search&&!window.location.hash)return;let t=new URL(window.location.href),n=new URLSearchParams(t.search),r=new URLSearchParams(t.hash.startsWith(`#`)?t.hash.slice(1):t.hash),i=n.get(`gatewayUrl`)??r.get(`gatewayUrl`),a=v(i)??``,o=!!(a&&a!==e.settings.gatewayUrl),s=n.get(`token`),c=r.get(`token`),l=c!=null||s!=null,u=v(c??s),d=v(n.get(`session`)??r.get(`session`)),f=!!(u&&!d&&!o),p=!1;if(n.has(`token`)&&(n.delete(`token`),p=!0),l&&(s!=null&&(cO=!0,console.warn(`[genesis] Auth token passed as query parameter (?token=). Use URL fragment instead: #token=<token>. Query parameters may appear in server logs.`)),u&&o?e.pendingGatewayToken=u:u&&u!==e.settings.token&&aO(e,{...e.settings,token:u}),r.delete(`token`),p=!0),f&&(e.sessionKey=`main`,aO(e,{...e.settings,sessionKey:`main`,lastActiveSessionKey:`main`})),(n.has(`password`)||r.has(`password`))&&(n.delete(`password`),r.delete(`password`),p=!0),d&&sO(e,d),i!=null&&(e.pendingGatewayUrl=o?a:null,e.pendingGatewayToken=o?u??null:null,n.delete(`gatewayUrl`),r.delete(`gatewayUrl`),p=!0),!p)return;t.search=n.toString();let m=r.toString();t.hash=m?`#${m}`:``,EO(t,!0)}function uO(e,t){DO(e,t,{refreshPolicy:`always`,syncUrl:!0})}function dO(e,t,n,r){gg({nextTheme:t,applyTheme:n,context:r,currentTheme:e.themeResolved}),SO(e)}function fO(e,t,n){dO(e,Fh(t,e.themeMode),()=>aO(e,{...e.settings,theme:t}),n)}function pO(e,t,n){dO(e,Fh(e.theme,t),()=>aO(e,{...e.settings,themeMode:t}),n)}async function mO(e,t){await bf(t),await Qn(t);let n=e.agentsList?.agents?.map(e=>e.id)??[];n.length>0&&gf(t,n);let r=e.agentsSelectedId??e.agentsList?.defaultId??e.agentsList?.agents?.[0]?.id;if(r)switch(hf(t,r),e.agentsPanel){case`files`:ff(t,r);return;case`skills`:_f(t,r);return;case`channels`:Sn(t,!1);return;case`cron`:IO(e);return;case`overview`:case`tools`:case void 0:return}}async function hO(e){let t=e;switch(e.tab){case`config`:case`communications`:case`appearance`:case`automation`:case`infrastructure`:case`aiAgents`:await $n(t),await Qn(t);return;case`overview`:await AO(e);return;case`canvas`:return;case`channels`:await FO(e);return;case`instances`:await Wm(t);return;case`usage`:await xh(t);return;case`sessions`:await Nl(t,{search:t.sessionsSearchQuery});return;case`cron`:await IO(e);return;case`wallet`:await Eh(t,{includeBalances:!0});return;case`skills`:await Ym(t);return;case`mcp`:await ym(t),await wm(t);return;case`plugins`:await Fm(t);return;case`models`:case`memory`:return;case`agents`:await mO(e,t);return;case`nodes`:await Zd(t),await sp(t),await Qn(t),await pm(t);return;case`dreams`:await Qn(t),await Promise.all([Kp(t),qp(t),Jp(t),Yp(t)]);return;case`chat`:await ad(e),ti(e,!e.chatHasAutoScrolled);return;case`debug`:await Ad(t),e.eventLog=e.eventLogBuffer;return;case`logs`:e.logsAtBottom=!0,await Ld(t,{reset:!0}),ni(e,!0);return}}function gO(){if(typeof window>`u`)return``;let e=window.__GENESIS_CONTROL_UI_BASE_PATH__,t=v(e);return t?Wl(t):Jl(window.location.pathname)}function _O(e){e.theme=`mono`,e.themeMode=e.settings.themeMode??`system`,xO(e,Fh(e.theme,e.themeMode)),bO(e.settings.borderRadius??50),SO(e)}function vO(e){e.systemThemeCleanup?.(),e.systemThemeCleanup=null}var yO={sm:6,md:10,lg:14,xl:20,full:9999,default:10};function bO(e){if(typeof document>`u`)return;let t=document.documentElement,n=e/50;t.style.setProperty(`--radius-sm`,`${Math.round(yO.sm*n)}px`),t.style.setProperty(`--radius-md`,`${Math.round(yO.md*n)}px`),t.style.setProperty(`--radius-lg`,`${Math.round(yO.lg*n)}px`),t.style.setProperty(`--radius-xl`,`${Math.round(yO.xl*n)}px`),t.style.setProperty(`--radius-full`,`${Math.round(yO.full*n)}px`),t.style.setProperty(`--radius`,`${Math.round(yO.default*n)}px`)}function xO(e,t){if(e.themeResolved=t,typeof document>`u`)return;let n=document.documentElement,r=t.endsWith(`light`)?`light`:`dark`;n.dataset.theme=t,n.dataset.themeMode=r,n.style.colorScheme=r}function SO(e){if(e.themeMode!==`system`){e.systemThemeCleanup?.(),e.systemThemeCleanup=null;return}if(e.systemThemeCleanup||typeof globalThis.matchMedia!=`function`)return;let t=globalThis.matchMedia(`(prefers-color-scheme: light)`),n=()=>{e.themeMode===`system`&&xO(e,Fh(e.theme,`system`))};if(typeof t.addEventListener==`function`){t.addEventListener(`change`,n),e.systemThemeCleanup=()=>t.removeEventListener(`change`,n);return}typeof t.addListener==`function`&&(t.addListener(n),e.systemThemeCleanup=()=>t.removeListener(n))}function CO(e,t){if(typeof window>`u`)return;let n=ql(window.location.pathname,e.basePath)??`chat`;TO(e,n),OO(e,n,t)}function wO(e){if(typeof window>`u`)return;let t=ql(window.location.pathname,e.basePath);if(!t)return;let n=v(new URL(window.location.href).searchParams.get(`session`));n&&sO(e,n),TO(e,t)}function TO(e,t){DO(e,t,{refreshPolicy:`connected`})}function EO(e,t){return t?window.history.replaceState({},``,e.toString()):window.history.pushState({},``,e.toString())}function DO(e,t,n){let r=e.tab;e.tab=t,r===`chat`&&t!==`chat`&&LD(),t===`chat`&&(e.chatHasAutoScrolled=!1),(t===`logs`?sf:cf)(e),(t===`debug`?lf:uf)(e),(n.refreshPolicy===`always`||e.connected)&&hO(e),n.syncUrl&&OO(e,t,!1)}function OO(e,t,n){if(typeof window>`u`)return;let r=Gl(Kl(t,e.basePath)),i=Gl(window.location.pathname),a=new URL(window.location.href);t===`chat`&&e.sessionKey?a.searchParams.set(`session`,e.sessionKey):a.searchParams.delete(`session`),i!==r&&(a.pathname=r),EO(a,n)}function kO(e,t,n){if(typeof window>`u`)return;let r=new URL(window.location.href);r.searchParams.set(`session`,t),EO(r,n)}async function AO(e,t){let n=e;await Promise.allSettled([Sn(n,!1),Wm(n),Nl(n),Nf(n),If(n),Ad(n),Ym(n),xh(n),NO(n),Eh(n),jm(n,{refresh:t?.refresh})]),PO(n)}function jO(e){return e?.scopes?kd({role:e.role??`operator`,requestedScopes:[`operator.read`],allowedScopes:e.scopes}):!1}function MO(e){return e?Object.values(e).some(e=>Array.isArray(e)&&e.length>0):!1}async function NO(e){if(!(!e.client||!e.connected))try{let t=await e.client.request(`logs.tail`,{cursor:e.overviewLogCursor||void 0,limit:100,maxBytes:5e4}),n=Array.isArray(t.lines)?t.lines.filter(e=>typeof e==`string`):[];e.overviewLogLines=[...e.overviewLogLines,...n].slice(-500),typeof t.cursor==`number`&&(e.overviewLogCursor=t.cursor)}catch{}}function PO(e){let t=[];e.lastError&&t.push({severity:`error`,icon:`x`,title:`Gateway Error`,description:e.lastError});let n=e.hello?.auth??null;n?.scopes&&!jO(n)&&t.push({severity:`warning`,icon:`key`,title:`Missing operator.read scope`,description:`This connection does not have the operator.read scope. Some features may be unavailable.`,href:`https://genesis.pixelzx.com/docs/web/dashboard`,external:!0});let r=e.skillsReport?.skills??[],i=r.filter(e=>!e.disabled&&MO(e.missing));if(i.length>0){let e=i.slice(0,3).map(e=>e.name),n=i.length>3?` +${i.length-3} more`:``;t.push({severity:`warning`,icon:`zap`,title:`Skills with missing dependencies`,description:`${e.join(`, `)}${n}`})}let a=r.filter(e=>e.blockedByAllowlist);a.length>0&&t.push({severity:`warning`,icon:`shield`,title:`${a.length} skill${a.length>1?`s`:``} blocked`,description:a.map(e=>e.name).join(`, `)});let o=e.cronJobs??[],s=o.filter(e=>e.state?.lastStatus===`error`);s.length>0&&t.push({severity:`error`,icon:`clock`,title:`${s.length} cron job${s.length>1?`s`:``} failed`,description:s.map(e=>e.name).join(`, `)});let c=Date.now(),l=o.filter(e=>e.enabled&&e.state?.nextRunAtMs!=null&&c-e.state.nextRunAtMs>3e5);l.length>0&&t.push({severity:`warning`,icon:`clock`,title:`${l.length} overdue job${l.length>1?`s`:``}`,description:l.map(e=>e.name).join(`, `)});let u=e.modelAuthStatusResult;if(u){let e=u.providers.filter(Oh),n=e.filter(e=>e.status===`expired`||e.status===`missing`);n.length>0&&t.push({severity:`error`,icon:`key`,title:p(`overview.cards.modelAuthAttentionExpiredTitle`),description:p(`overview.cards.modelAuthAttentionExpiredDesc`,{providers:n.map(e=>e.displayName).join(`, `)})});let r=e.filter(e=>e.status===`expiring`);r.length>0&&t.push({severity:`warning`,icon:`key`,title:p(`overview.cards.modelAuthAttentionExpiringTitle`),description:r.map(e=>p(`overview.cards.modelAuthAttentionExpiringEntry`,{provider:e.displayName,when:e.expiry?.label??`soon`})).join(`, `)})}e.attentionItems=t}async function FO(e){let t=e;await Promise.all([Sn(t,!0),$n(t),Qn(t)])}async function IO(e){let t=e,n=t.cronRunsScope===`job`?t.cronRunsJobId:null;await Promise.all([Sn(t,!1),Nf(t),If(t),ep(t,n)])}function LO(e){if(!e||e.state!==`final`)return!1;let t=e.message;if(!t||typeof t!=`object`)return!0;let n=t.role;return typeof n!=`string`||n.trim().toLowerCase()!==`assistant`}function RO(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.kind!==`btw`)return null;let n=v(t.runId),r=v(t.sessionKey),i=v(t.question),a=v(t.text);return n&&r&&i&&a?{kind:`btw`,runId:n,sessionKey:r,question:i,text:a,isError:t.isError===!0,ts:typeof t.ts==`number`&&Number.isFinite(t.ts)?t.ts:Date.now()}:null}async function zO(e,t){if(!e.client||!e.connected)return;let n=t?.sessionKey?.trim()||e.sessionKey.trim(),r=n?{sessionKey:n}:{};try{let t=await e.client.request(`agent.identity.get`,r);if(!t)return;let n=Zy(t);e.assistantName=n.name,e.assistantAvatar=n.avatar,e.assistantAgentId=n.agentId??null}catch{}}var BO=`/__genesis/control-ui-config.json`;async function VO(e){if(typeof window>`u`||typeof fetch!=`function`)return;let t=Wl(e.basePath??``),n=t?`${t}${BO}`:BO;try{let t=new URL(n,window.location.origin).origin===window.location.origin?de(e):[],r=t.length>0?t:[``],i=null;for(let e of r){let t={Accept:`application/json`};if(e&&(t.Authorization=`Bearer ${e}`),i=await fetch(n,{method:`GET`,headers:t,credentials:`same-origin`}),i.ok)break;if(i.status!==401&&i.status!==403)return}if(!i||!i.ok)return;let a=await i.json(),o=Zy({agentId:a.assistantAgentId??null,name:a.assistantName,avatar:a.assistantAvatar??null});e.assistantName=o.name,e.assistantAvatar=o.avatar,e.assistantAgentId=o.agentId??null,e.serverVersion=a.serverVersion??null,e.localMediaPreviewRoots=Array.isArray(a.localMediaPreviewRoots)?a.localMediaPreviewRoots.filter(e=>typeof e==`string`):[],e.embedSandboxMode=a.embedSandbox===`trusted`?`trusted`:a.embedSandbox===`strict`?`strict`:`scripts`,e.allowExternalEmbedUrls=a.allowExternalEmbedUrls===!0}catch{}}function HO(e){return typeof e==`object`&&!!e}function UO(e){if(!HO(e))return null;let t=v(e.id)??``,n=e.request;if(!t||!HO(n))return null;let r=v(n.command)??``;if(!r)return null;let i=typeof e.createdAtMs==`number`?e.createdAtMs:0,a=typeof e.expiresAtMs==`number`?e.expiresAtMs:0;return!i||!a?null:{id:t,kind:`exec`,request:{command:r,cwd:typeof n.cwd==`string`?n.cwd:null,host:typeof n.host==`string`?n.host:null,security:typeof n.security==`string`?n.security:null,ask:typeof n.ask==`string`?n.ask:null,agentId:typeof n.agentId==`string`?n.agentId:null,resolvedPath:typeof n.resolvedPath==`string`?n.resolvedPath:null,sessionKey:typeof n.sessionKey==`string`?n.sessionKey:null},createdAtMs:i,expiresAtMs:a}}function WO(e){if(!HO(e))return null;let t=v(e.id)??``;return t?{id:t,decision:typeof e.decision==`string`?e.decision:null,resolvedBy:typeof e.resolvedBy==`string`?e.resolvedBy:null,ts:typeof e.ts==`number`?e.ts:null}:null}function GO(e){if(!HO(e))return null;let t=v(e.id)??``;if(!t)return null;let n=typeof e.createdAtMs==`number`?e.createdAtMs:0,r=typeof e.expiresAtMs==`number`?e.expiresAtMs:0;if(!n||!r)return null;let i=HO(e.request)?e.request:{},a=v(i.title)??``;if(!a)return null;let o=typeof i.description==`string`?i.description:null,s=typeof i.severity==`string`?i.severity:null,c=typeof i.pluginId==`string`?i.pluginId:null;return{id:t,kind:`plugin`,request:{command:a,agentId:typeof i.agentId==`string`?i.agentId:null,sessionKey:typeof i.sessionKey==`string`?i.sessionKey:null},pluginTitle:a,pluginDescription:o,pluginSeverity:s,pluginId:c,createdAtMs:n,expiresAtMs:r}}function KO(e){let t=Date.now();return e.filter(e=>e.expiresAtMs>t)}function qO(e,t){let n=KO(e).filter(e=>e.id!==t.id);return n.unshift(t),n}function JO(e,t){return KO(e).filter(e=>e.id!==t)}var YO={ok:!1,ts:0,durationMs:0,heartbeatSeconds:0,defaultAgentId:``,agents:[],sessions:{path:``,count:0,recent:[]}};async function XO(e){try{return await e.request(`health`,{})??YO}catch{return YO}}async function ZO(e){if(!(!e.client||!e.connected)&&!e.healthLoading){e.healthLoading=!0,e.healthError=null;try{e.healthResult=await XO(e.client)}catch(t){e.healthError=String(t)}finally{e.healthLoading=!1}}}function QO(e){return/^(?:typeerror:\s*)?(?:fetch failed|failed to fetch)$/i.test(e.trim())}function $O(e,t){if(!t)return;e.execApprovalQueue=qO(e.execApprovalQueue,t),e.execApprovalError=null;let n=Math.max(0,t.expiresAtMs-Date.now()+500);window.setTimeout(()=>{e.execApprovalQueue=JO(e.execApprovalQueue,t.id)},n)}function ek(e,t){let n=WO(t);n&&(e.execApprovalQueue=JO(e.execApprovalQueue,n.id))}function tk(e){return e===`final`||e===`aborted`||e===`error`}function nk(e){return!!(e&&typeof e==`object`)}function rk(e){if(!nk(e))return!1;let t=e.role;return typeof t==`string`&&t.trim().toLowerCase()===`user`}var ik=[`session`,`updatedAt`,`sessionId`,`kind`,`label`,`displayName`,`status`,`childSessions`,`totalTokens`,`totalTokensFresh`,`contextTokens`,`modelProvider`,`model`,`compactionCheckpointCount`,`latestCompactionCheckpoint`];function ak(e){return nk(e)?ik.some(t=>t in e):!1}function ok(e,t,n){let r=e.tab===`sessions`?e.sessionsSearchQuery?.trim():``;return r?{search:r}:!n||!ak(t)?{}:null}function sk(e){let t=e.serverVersion?.trim();if(!t)return;let n=e.pageUrl??(typeof window>`u`?void 0:window.location.href);if(n)try{let r=new URL(n),i=new URL(e.gatewayUrl,r);return!new Set([`ws:`,`wss:`,`http:`,`https:`]).has(i.protocol)||i.host!==r.host?void 0:t}catch{return}}function ck(e,t){let n=(e??``).trim(),r=t.mainSessionKey?.trim();if(!r)return n;if(!n)return r;let i=t.mainKey?.trim()||`main`,a=t.defaultAgentId?.trim();return n===`main`||n===i||a&&(n===`agent:${a}:main`||n===`agent:${a}:${i}`)?r:n}function lk(e,t){if(!t?.mainSessionKey)return;if(ck(e.sessionKey,t)===e.sessionKey){let n=ck(e.settings.lastActiveSessionKey,t);n!==e.settings.lastActiveSessionKey&&aO(e,{...e.settings,lastActiveSessionKey:n});return}let n=ck(e.sessionKey,t),r=ck(e.settings.sessionKey,t),i=ck(e.settings.lastActiveSessionKey,t),a=n||r||e.sessionKey,o={...e.settings,sessionKey:r||a,lastActiveSessionKey:i||a},s=o.sessionKey!==e.settings.sessionKey||o.lastActiveSessionKey!==e.settings.lastActiveSessionKey;a!==e.sessionKey&&(e.sessionKey=a),s&&aO(e,o)}function uk(e,t){let n=e,r=t?.reason??`initial`;n.pendingShutdownMessage=null,n.resumeChatQueueAfterReconnect=!1,e.lastError=null,e.lastErrorCode=null,e.hello=null,e.connected=!1,r===`seq-gap`?(e.execApprovalQueue=KO(e.execApprovalQueue),$u(e,e.chatRunId??void 0),n.resumeChatQueueAfterReconnect=!0):e.execApprovalQueue=KO(e.execApprovalQueue),e.execApprovalError=null;let i=e.client,a=sk({gatewayUrl:e.settings.gatewayUrl,serverVersion:e.serverVersion}),o=new yn({url:e.settings.gatewayUrl,token:e.settings.token.trim()?e.settings.token:void 0,password:e.password.trim()?e.password:void 0,clientName:`genesis-control-ui`,clientVersion:a,mode:`webchat`,instanceId:e.clientInstanceId,onHello:t=>{if(e.client===o){if(n.pendingShutdownMessage=null,e.connected=!0,e.lastError=null,e.lastErrorCode=null,e.hello=t,gk(e,t),VO(e),e.pendingAbort){let t=e.pendingAbort;e.pendingAbort=null,e.client.request(`chat.abort`,{sessionKey:t.sessionKey,runId:t.runId}).catch(e=>{console.warn(`[genesis] pending abort failed:`,e)})}e.chatRunId=null,e.chatStream=null,e.chatStreamStartedAt=null,e.chatSideResultTerminalRuns?.clear(),Ai(e),n.resumeChatQueueAfterReconnect&&(n.resumeChatQueueAfterReconnect=!1,cd(e)),Ml(e),zO(e),bf(e),ZO(e),Zd(e,{quiet:!0}),sp(e,{quiet:!0}),hO(e)}},onClose:({code:t,reason:r,error:i})=>{if(e.client===o)if(e.connected=!1,e.lastErrorCode=ln(i)??(typeof i?.code==`string`?i.code:null),t!==1012){if(i?.message){e.lastError=e.lastErrorCode&&(e.lastErrorCode===L.PAIRING_REQUIRED||QO(i.message))?pc({message:i.message,details:i.details,code:i.code}):i.message;return}e.lastError=n.pendingShutdownMessage??`disconnected (${t}): ${r||`no reason`}`}else e.lastError=n.pendingShutdownMessage??null,e.lastErrorCode=null},onEvent:t=>{e.client===o&&dk(e,t)},onGap:({expected:t,received:n})=>{e.client===o&&(e.lastError=`event gap detected (expected seq ${t}, got ${n}); reconnecting`,e.lastErrorCode=null,uk(e,{reason:`seq-gap`}))}});e.client=o,i?.stop(),o.start()}function dk(e,t){try{hk(e,t)}catch(e){console.error(`[gateway] handleGatewayEvent error:`,t.event,e)}}function fk(e,t,n){if(n!==`final`&&n!==`error`&&n!==`aborted`)return!1;let r=e,i=r.toolStreamOrder.length>0,a=()=>void cd(e);$u(e,t?.runId);let o=t?.runId;if(o&&e.refreshSessionsAfterChat.has(o)&&(e.refreshSessionsAfterChat.delete(o),n===`final`&&Nl(e,{activeMinutes:120})),i&&n===`final`){let t=o??null;return ol(e).finally(()=>{t&&e.chatRunId&&e.chatRunId!==t||(Ai(r),a())}),!0}return Ai(r),a(),!1}function pk(e,t){t?.sessionKey&&Qr(e,t.sessionKey);let n=e;if(tk(t?.state)&&typeof t?.runId==`string`&&n.chatSideResultTerminalRuns?.has(t.runId)===!0&&t?.runId){n.chatSideResultTerminalRuns?.delete(t.runId);return}let r=_l(e,t),i=fk(e,t,r),a=e,o=a.pendingSessionMessageReloadSessionKey?.trim(),s=t?.sessionKey?.trim(),c=!!(o&&s&&o===s&&tk(r)&&s===e.sessionKey&&!e.chatRunId);if(o&&s&&o===s&&(a.pendingSessionMessageReloadSessionKey=null),r===`final`&&!i&&LO(t)){ol(e);return}c&&!i&&ol(e)}function mk(e,t){jl(e,t);let n=e,r=t?.sessionKey?.trim();if(!(!r||r!==e.sessionKey)){if(e.chatRunId){if(rk(t?.message)&&el(e,t?.message,{appendIfMissing:!1}))return;n.pendingSessionMessageReloadSessionKey=r;return}n.pendingSessionMessageReloadSessionKey=null,!el(e,t?.message,{appendIfMissing:!0})&&ol(e)}}function hk(e,t){if(e.eventLogBuffer=[{ts:Date.now(),event:t.event,payload:t.payload},...e.eventLogBuffer].slice(0,250),(e.tab===`debug`||e.tab===`overview`)&&(e.eventLog=e.eventLogBuffer),t.event===`agent`){if(e.onboarding)return;Bi(e,t.payload);return}if(t.event===`chat`){pk(e,t.payload);return}if(t.event===`chat.side_result`){let n=RO(t.payload);if(!n||n.sessionKey!==e.sessionKey)return;let r=e;r.chatSideResult=n,r.chatSideResultTerminalRuns?.add(n.runId);return}if(t.event===`session.message`){mk(e,t.payload);return}if(t.event===`presence`){let n=t.payload;n?.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence,e.presenceError=null,e.presenceStatus=null);return}if(t.event===`shutdown`){let n=t.payload,r=n&&typeof n.reason==`string`&&n.reason.trim()?n.reason.trim():`gateway stopping`,i=typeof n?.restartExpectedMs==`number`?`Restarting: ${r}`:`Disconnected: ${r}`;e.pendingShutdownMessage=i,e.lastError=i,e.lastErrorCode=null;return}if(t.event===`sessions.changed`){let n=jl(e,t.payload),r=ok(e,t.payload,n);r&&Nl(e,r);return}if(t.event===`cron`&&e.tab===`cron`&&IO(e),(t.event===`device.pair.requested`||t.event===`device.pair.resolved`)&&sp(e,{quiet:!0}),t.event===`exec.approval.requested`){$O(e,UO(t.payload));return}if(t.event===`exec.approval.resolved`){ek(e,t.payload);return}if(t.event===`plugin.approval.requested`){$O(e,GO(t.payload));return}if(t.event===`plugin.approval.resolved`){ek(e,t.payload);return}t.event===`update.available`&&(e.updateAvailable=t.payload?.updateAvailable??null)}function gk(e,t){let n=t.snapshot;n?.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence),n?.health&&(e.debugHealth=n.health,e.healthResult=n.health),n?.sessionDefaults&&lk(e,n.sessionDefaults),e.updateAvailable=n?.updateAvailable??null}function _k(e){let t=++e.connectGeneration;e.basePath=gO(),lO(e);let n=VO(e);CO(e,!0),_O(e),window.addEventListener(`popstate`,e.popStateHandler),n.finally(()=>{e.connectGeneration===t&&uk(e)}),af(e),e.tab===`logs`&&sf(e),e.tab===`debug`&&lf(e)}function vk(e){si(e)}function yk(e){e.connectGeneration+=1,window.removeEventListener(`popstate`,e.popStateHandler),of(e),cf(e),uf(e),e.realtimeTalkSession?.stop(),e.realtimeTalkSession=null,e.realtimeTalkActive=!1,e.realtimeTalkStatus=`idle`,e.realtimeTalkDetail=null,e.realtimeTalkTranscript=null,e.client?.stop(),e.client=null,e.connected=!1,vO(e),e.topbarObserver?.disconnect(),e.topbarObserver=null}function bk(e,t){if(!(e.tab===`chat`&&e.chatManualRefreshInFlight)){if(e.tab===`chat`&&(t.has(`chatMessages`)||t.has(`chatToolMessages`)||t.has(`chatStream`)||t.has(`chatLoading`)||t.has(`tab`))){let n=t.has(`tab`),r=t.has(`chatLoading`)&&t.get(`chatLoading`)===!0&&!e.chatLoading,i=t.get(`chatStream`),a=t.has(`chatStream`)&&i==null&&typeof e.chatStream==`string`;ti(e,n||r||a||!e.chatHasAutoScrolled)}e.tab===`logs`&&(t.has(`logsEntries`)||t.has(`logsAutoFollow`)||t.has(`tab`))&&e.logsAutoFollow&&e.logsAtBottom&&ni(e,t.has(`tab`)||t.has(`logsAutoFollow`))}}function xk(e){return e.initialValue===void 0?e.type===`select`?e.options?.[0]?.value??``:e.type===`multiselect`?[]:e.type===`confirm`?!!e.initialValue:e.type===`text`?``:!0:e.initialValue}async function Sk(e){await Qn(e),e.client&&e.connected&&(e.chatModelCatalog=await vl(e.client)),await jm(e,{refresh:!0})}async function Ck(e,t,n){if(t.step&&!t.done){e.modelProviderWizardSessionId=t.sessionId??n??e.modelProviderWizardSessionId,e.modelProviderWizardStep=t.step,e.modelProviderWizardInput=xk(t.step),e.modelProviderWizardMessage=null,e.modelProviderWizardError=null;return}if(e.modelProviderWizardSessionId=null,e.modelProviderWizardStep=null,e.modelProviderWizardInput=null,t.status===`error`){e.modelProviderWizardError=t.error??`Model provider setup failed.`,e.modelProviderWizardMessage=null;return}if(t.status===`cancelled`){e.modelProviderWizardError=null,e.modelProviderWizardMessage=`Model provider setup cancelled.`;return}e.modelProviderWizardError=null,e.modelProviderWizardMessage=`Model provider connected.`,await Sk(e)}async function wk(e){if(!(!e.client||!e.connected||e.modelProviderWizardBusy)){e.modelProviderWizardBusy=!0,e.modelProviderWizardError=null,e.modelProviderWizardMessage=null;try{let t=await e.client.request(`wizard.start`,{target:`models`});await Ck(e,t,t.sessionId??null)}catch(t){e.modelProviderWizardError=String(t),e.modelProviderWizardMessage=null}finally{e.modelProviderWizardBusy=!1}}}function Tk(e,t){e.modelProviderWizardInput=t}async function Ek(e){if(!e.client||!e.connected||e.modelProviderWizardBusy)return;let t=e.modelProviderWizardSessionId,n=e.modelProviderWizardStep;if(!(!t||!n)){e.modelProviderWizardBusy=!0,e.modelProviderWizardError=null;try{await Ck(e,await e.client.request(`wizard.next`,{sessionId:t,answer:{stepId:n.id,value:e.modelProviderWizardInput}}),t)}catch(t){e.modelProviderWizardError=String(t)}finally{e.modelProviderWizardBusy=!1}}}async function Dk(e){let t=e.modelProviderWizardSessionId;if(e.modelProviderWizardSessionId=null,e.modelProviderWizardStep=null,e.modelProviderWizardInput=null,e.modelProviderWizardError=null,e.modelProviderWizardMessage=null,!(!t||!e.client||!e.connected))try{await e.client.request(`wizard.cancel`,{sessionId:t})}catch{}}function Ok(e){e.modelProviderWizardError=null,e.modelProviderWizardMessage=null}var kk=new Set([`agent`,`channel`,`chat`,`provider`,`model`,`tool`,`label`,`key`,`session`,`id`,`has`,`mintokens`,`maxtokens`,`mincost`,`maxcost`,`minmessages`,`maxmessages`]),Ak=e=>y(e),jk=e=>{let t=e.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*/g,`.*`).replace(/\?/g,`.`);return RegExp(`^${t}$`,`i`)},Mk=e=>{let t=y(e);if(!t)return null;t.startsWith(`$`)&&(t=t.slice(1));let n=1;t.endsWith(`k`)?(n=1e3,t=t.slice(0,-1)):t.endsWith(`m`)&&(n=1e6,t=t.slice(0,-1));let r=Number(t);return Number.isFinite(r)?r*n:null},Nk=e=>(e.match(/"[^"]+"|\S+/g)??[]).map(e=>{let t=e.replace(/^"|"$/g,``),n=t.indexOf(`:`);return n>0?{key:t.slice(0,n),value:t.slice(n+1),raw:t}:{value:t,raw:t}}),Pk=e=>[e.label,e.key,e.sessionId].filter(e=>!!e).map(e=>y(e)),Fk=e=>{let t=new Set;e.modelProvider&&t.add(y(e.modelProvider)),e.providerOverride&&t.add(y(e.providerOverride)),e.origin?.provider&&t.add(y(e.origin.provider));for(let n of e.usage?.modelUsage??[])n.provider&&t.add(y(n.provider));return Array.from(t)},Ik=e=>{let t=new Set;e.model&&t.add(y(e.model));for(let n of e.usage?.modelUsage??[])n.model&&t.add(y(n.model));return Array.from(t)},Lk=e=>(e.usage?.toolUsage?.tools??[]).map(e=>y(e.name)),Rk=(e,t)=>{let n=Ak(t.value??``);if(!n)return!0;if(!t.key)return Pk(e).some(e=>e.includes(n));switch(Ak(t.key)){case`agent`:return y(e.agentId).includes(n);case`channel`:return y(e.channel).includes(n);case`chat`:return y(e.chatType).includes(n);case`provider`:return Fk(e).some(e=>e.includes(n));case`model`:return Ik(e).some(e=>e.includes(n));case`tool`:return Lk(e).some(e=>e.includes(n));case`label`:return y(e.label).includes(n);case`key`:case`session`:case`id`:if(n.includes(`*`)||n.includes(`?`)){let t=jk(n);return t.test(e.key)||(e.sessionId?t.test(e.sessionId):!1)}return y(e.key).includes(n)||y(e.sessionId).includes(n);case`has`:switch(n){case`tools`:return(e.usage?.toolUsage?.totalCalls??0)>0;case`errors`:return(e.usage?.messageCounts?.errors??0)>0;case`context`:return!!e.contextWeight;case`usage`:return!!e.usage;case`model`:return Ik(e).length>0;case`provider`:return Fk(e).length>0;default:return!0}case`mintokens`:{let t=Mk(n);return t===null?!0:(e.usage?.totalTokens??0)>=t}case`maxtokens`:{let t=Mk(n);return t===null?!0:(e.usage?.totalTokens??0)<=t}case`mincost`:{let t=Mk(n);return t===null?!0:(e.usage?.totalCost??0)>=t}case`maxcost`:{let t=Mk(n);return t===null?!0:(e.usage?.totalCost??0)<=t}case`minmessages`:{let t=Mk(n);return t===null?!0:(e.usage?.messageCounts?.total??0)>=t}case`maxmessages`:{let t=Mk(n);return t===null?!0:(e.usage?.messageCounts?.total??0)<=t}default:return!0}},zk=(e,t)=>{let n=Nk(t);if(n.length===0)return{sessions:e,warnings:[]};let r=[];for(let e of n){if(!e.key)continue;let t=Ak(e.key);if(!kk.has(t)){r.push(`Unknown filter: ${e.key}`);continue}if(e.value===``&&r.push(`Missing value for ${e.key}`),t===`has`){let t=new Set([`tools`,`errors`,`context`,`usage`,`model`,`provider`]);e.value&&!t.has(Ak(e.value))&&r.push(`Unknown has:${e.value}`)}[`mintokens`,`maxtokens`,`mincost`,`maxcost`,`minmessages`,`maxmessages`].includes(t)&&e.value&&Mk(e.value)===null&&r.push(`Invalid number for ${e.key}`)}return{sessions:e.filter(e=>n.every(t=>Rk(e,t))),warnings:r}};function Bk(e){let t=e.split(`
1599
1605
  `),n=new Map,r=[];for(let e of t){let t=/^\[Tool:\s*([^\]]+)\]/.exec(e.trim());if(t){let e=t[1];n.set(e,(n.get(e)??0)+1);continue}e.trim().startsWith(`[Tool Result]`)||r.push(e)}let i=Xa(n.entries(),(e,t)=>t[1]-e[1]),a=i.reduce((e,[,t])=>e+t,0);return{tools:i,summary:i.length>0?`Tools: ${i.map(([e,t])=>`${e}×${t}`).join(`, `)} (${a} calls)`:``,cleanContent:r.join(`
1600
1606
  `).trim()}}function Vk(e,t){!t||t.count<=0||(e.count+=t.count,e.sum+=t.avgMs*t.count,e.min=Math.min(e.min,t.minMs),e.max=Math.max(e.max,t.maxMs),e.p95Max=Math.max(e.p95Max,t.p95Ms))}function Hk(e,t){for(let n of t??[]){let t=e.get(n.date)??{date:n.date,count:0,sum:0,min:1/0,max:0,p95Max:0};t.count+=n.count,t.sum+=n.avgMs*n.count,t.min=Math.min(t.min,n.minMs),t.max=Math.max(t.max,n.maxMs),t.p95Max=Math.max(t.p95Max,n.p95Ms),e.set(n.date,t)}}function Uk(e){return{byChannel:Array.from(e.byChannelMap.entries()).map(([e,t])=>({channel:e,totals:t})).toSorted((e,t)=>t.totals.totalCost-e.totals.totalCost),latency:e.latencyTotals.count>0?{count:e.latencyTotals.count,avgMs:e.latencyTotals.sum/e.latencyTotals.count,minMs:e.latencyTotals.min===1/0?0:e.latencyTotals.min,maxMs:e.latencyTotals.max,p95Ms:e.latencyTotals.p95Max}:void 0,dailyLatency:Array.from(e.dailyLatencyMap.values()).map(e=>({date:e.date,count:e.count,avgMs:e.count?e.sum/e.count:0,minMs:e.min===1/0?0:e.min,maxMs:e.max,p95Ms:e.p95Max})).toSorted((e,t)=>e.date.localeCompare(t.date)),modelDaily:Array.from(e.modelDailyMap.values()).toSorted((e,t)=>e.date.localeCompare(t.date)||t.cost-e.cost),daily:Array.from(e.dailyMap.values()).toSorted((e,t)=>e.date.localeCompare(t.date))}}var Wk=4;function Gk(e){return Math.round(e/Wk)}function Q(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Kk(e){let t=new Date;return t.setHours(e,0,0,0),t.toLocaleTimeString(void 0,{hour:`numeric`})}function qk(e,t,n){let r=e.usage;if(!r)return!1;let i=r.firstActivity??e.updatedAt,a=r.lastActivity??e.updatedAt;if(!i||!a)return!1;let o=Math.min(i,a),s=Math.max(i,a),c=Math.max(s-o,1)/6e4,l=o;for(;l<s;){let e=new Date(l),i=Zk(e,t),a=Math.min(i.getTime(),s),o=Math.max((a-l)/6e4,0);n({usage:r,hour:Yk(e,t),weekday:Xk(e,t),share:o/c}),l=a+1}return!0}function Jk(e,t){let n=Array.from({length:24},()=>0),r=Array.from({length:24},()=>0);for(let i of e){let e=i.usage?.messageCounts;!e||e.total===0||qk(i,t,({hour:t,share:i})=>{n[t]+=e.errors*i,r[t]+=e.total*i})}return Xa(r.map((e,t)=>{let r=n[t];return{hour:t,rate:e>0?r/e:0,errors:r,msgs:e}}).filter(e=>e.msgs>0&&e.errors>0),(e,t)=>t.rate-e.rate).slice(0,5).map(e=>({label:Kk(e.hour),value:`${(e.rate*100).toFixed(2)}%`,sub:`${Math.round(e.errors)} ${y(p(`usage.overview.errors`))} · ${Math.round(e.msgs)} ${p(`usage.overview.messagesAbbrev`)}`}))}function Yk(e,t){return t===`utc`?e.getUTCHours():e.getHours()}function Xk(e,t){return t===`utc`?e.getUTCDay():e.getDay()}function Zk(e,t){let n=new Date(e);return t===`utc`?n.setUTCMinutes(59,59,999):n.setMinutes(59,59,999),n}function Qk(e,t){let n=Array.from({length:24},()=>0),r=Array.from({length:7},()=>0),i=0,a=!1;for(let o of e){let e=o.usage;!e||!e.totalTokens||e.totalTokens<=0||(i+=e.totalTokens,qk(o,t,({usage:e,hour:t,weekday:i,share:a})=>{n[t]+=e.totalTokens*a,r[i]+=e.totalTokens*a})&&(a=!0))}let o=[p(`usage.mosaic.sun`),p(`usage.mosaic.mon`),p(`usage.mosaic.tue`),p(`usage.mosaic.wed`),p(`usage.mosaic.thu`),p(`usage.mosaic.fri`),p(`usage.mosaic.sat`)].map((e,t)=>({label:e,tokens:r[t]}));return{hasData:a,totalTokens:i,hourTotals:n,weekdayTotals:o}}function $k(e,t,n,r){let a=Qk(e,t);if(!a.hasData)return i`
1601
1607
  <div class="card usage-mosaic">
@@ -1868,7 +1874,7 @@ ${e}
1868
1874
  <div class=${n}>${e.value}</div>
1869
1875
  <div class="usage-summary-sub">${e.sub}</div>
1870
1876
  </div>
1871
- `}function OA(e,t,n,r,a,o,s){if(!e)return g;let c=t.messages.total?Math.round(e.totalTokens/t.messages.total):0,l=t.messages.total?e.totalCost/t.messages.total:0,u=e.input+e.cacheRead,d=u>0?e.cacheRead/u:0,f=u>0?`${(d*100).toFixed(1)}%`:p(`usage.common.emptyValue`),m=n.errorRate*100,h=n.throughputTokensPerMin===void 0?p(`usage.common.emptyValue`):`${Q(Math.round(n.throughputTokensPerMin))} ${p(`usage.overview.tokensPerMinute`)}`,_=n.throughputCostPerMin===void 0?p(`usage.common.emptyValue`):`${eA(n.throughputCostPerMin,4)} ${p(`usage.overview.perMinute`)}`,v=n.durationCount>0?S(n.avgDurationMs,{spaced:!0})??p(`usage.common.emptyValue`):p(`usage.common.emptyValue`),b=p(`usage.overview.cacheHint`),x=p(`usage.overview.errorHint`),ee=p(`usage.overview.throughputHint`),C=p(`usage.overview.avgTokensHint`),te=p(r?`usage.overview.avgCostHintMissing`:`usage.overview.avgCostHint`),ne=Xa(t.daily.filter(e=>e.messages>0&&e.errors>0).map(e=>{let t=e.errors/e.messages;return{label:rA(e.date),value:`${(t*100).toFixed(2)}%`,sub:`${e.errors} ${y(p(`usage.overview.errors`))} · ${e.messages} ${p(`usage.overview.messagesAbbrev`)} · ${Q(e.tokens)}`,rate:t}}),(e,t)=>t.rate-e.rate).slice(0,5).map(({rate:e,...t})=>t),w=t.byModel.slice(0,5).map(e=>({label:e.model??p(`usage.common.unknown`),value:eA(e.totals.totalCost),sub:`${Q(e.totals.totalTokens)} · ${e.count} ${p(`usage.overview.messagesAbbrev`)}`})),re=t.byProvider.slice(0,5).map(e=>({label:e.provider??p(`usage.common.unknown`),value:eA(e.totals.totalCost),sub:`${Q(e.totals.totalTokens)} · ${e.count} ${p(`usage.overview.messagesAbbrev`)}`})),T=t.tools.tools.slice(0,6).map(e=>({label:e.name,value:`${e.count}`,sub:p(`usage.overview.calls`)})),E=t.byAgent.slice(0,5).map(e=>({label:e.agentId,value:eA(e.totals.totalCost),sub:Q(e.totals.totalTokens)})),ie=t.byChannel.slice(0,5).map(e=>({label:e.channel,value:eA(e.totals.totalCost),sub:Q(e.totals.totalTokens)}));return i`
1877
+ `}function OA(e,t,n,r,a,o,s){if(!e)return g;let c=t.messages.total?Math.round(e.totalTokens/t.messages.total):0,l=t.messages.total?e.totalCost/t.messages.total:0,u=e.input+e.cacheRead,d=u>0?e.cacheRead/u:0,f=u>0?`${(d*100).toFixed(1)}%`:p(`usage.common.emptyValue`),m=n.errorRate*100,h=n.throughputTokensPerMin===void 0?p(`usage.common.emptyValue`):`${Q(Math.round(n.throughputTokensPerMin))} ${p(`usage.overview.tokensPerMinute`)}`,_=n.throughputCostPerMin===void 0?p(`usage.common.emptyValue`):`${eA(n.throughputCostPerMin,4)} ${p(`usage.overview.perMinute`)}`,v=n.durationCount>0?S(n.avgDurationMs,{spaced:!0})??p(`usage.common.emptyValue`):p(`usage.common.emptyValue`),b=p(`usage.overview.cacheHint`),x=p(`usage.overview.errorHint`),ee=p(`usage.overview.throughputHint`),C=p(`usage.overview.avgTokensHint`),te=p(r?`usage.overview.avgCostHintMissing`:`usage.overview.avgCostHint`),ne=Xa(t.daily.filter(e=>e.messages>0&&e.errors>0).map(e=>{let t=e.errors/e.messages;return{label:rA(e.date),value:`${(t*100).toFixed(2)}%`,sub:`${e.errors} ${y(p(`usage.overview.errors`))} · ${e.messages} ${p(`usage.overview.messagesAbbrev`)} · ${Q(e.tokens)}`,rate:t}}),(e,t)=>t.rate-e.rate).slice(0,5).map(({rate:e,...t})=>t),w=t.byModel.slice(0,5).map(e=>({label:e.model??p(`usage.common.unknown`),value:eA(e.totals.totalCost),sub:`${Q(e.totals.totalTokens)} · ${e.count} ${p(`usage.overview.messagesAbbrev`)}`})),re=t.byProvider.slice(0,5).map(e=>({label:e.provider??p(`usage.common.unknown`),value:eA(e.totals.totalCost),sub:`${Q(e.totals.totalTokens)} · ${e.count} ${p(`usage.overview.messagesAbbrev`)}`})),T=t.tools.tools.slice(0,6).map(e=>({label:e.name,value:`${e.count}`,sub:p(`usage.overview.calls`)})),ie=t.byAgent.slice(0,5).map(e=>({label:e.agentId,value:eA(e.totals.totalCost),sub:Q(e.totals.totalTokens)})),ae=t.byChannel.slice(0,5).map(e=>({label:e.channel,value:eA(e.totals.totalCost),sub:Q(e.totals.totalTokens)}));return i`
1872
1878
  <section class="card usage-overview-card">
1873
1879
  <div class="card-title">${p(`usage.overview.title`)}</div>
1874
1880
  <div class="usage-overview-layout">
@@ -1887,14 +1893,14 @@ ${e}
1887
1893
  ${TA(p(`usage.overview.topModels`),w,p(`usage.overview.noModelData`))}
1888
1894
  ${TA(p(`usage.overview.topProviders`),re,p(`usage.overview.noProviderData`))}
1889
1895
  ${TA(p(`usage.overview.topTools`),T,p(`usage.overview.noToolCalls`))}
1890
- ${TA(p(`usage.overview.topAgents`),E,p(`usage.overview.noAgentData`))}
1891
- ${TA(p(`usage.overview.topChannels`),ie,p(`usage.overview.noChannelData`))}
1896
+ ${TA(p(`usage.overview.topAgents`),ie,p(`usage.overview.noAgentData`))}
1897
+ ${TA(p(`usage.overview.topChannels`),ae,p(`usage.overview.noChannelData`))}
1892
1898
  ${EA(p(`usage.overview.peakErrorDays`),ne,p(`usage.overview.noErrorData`))}
1893
1899
  ${EA(p(`usage.overview.peakErrorHours`),a,p(`usage.overview.noErrorData`),{className:`usage-insight-card--wide`,listClassName:`usage-error-list--hours`})}
1894
1900
  </div>
1895
1901
  </div>
1896
1902
  </section>
1897
- `}function kA(e,t,n,r,a,o,s,c,l,u,d,f,m,h,_){let v=e=>m.includes(e),b=e=>{let t=e.label||e.key;return t.startsWith(`agent:`)&&t.includes(`?token=`)?t.slice(0,t.indexOf(`?token=`)):t},x=async e=>{let t=b(e);try{await navigator.clipboard.writeText(t)}catch{}},ee=e=>{let t=[];return v(`channel`)&&e.channel&&t.push(`channel:${e.channel}`),v(`agent`)&&e.agentId&&t.push(`agent:${e.agentId}`),v(`provider`)&&(e.modelProvider||e.providerOverride)&&t.push(`provider:${e.modelProvider??e.providerOverride}`),v(`model`)&&e.model&&t.push(`model:${e.model}`),v(`messages`)&&e.usage?.messageCounts&&t.push(`msgs:${e.usage.messageCounts.total}`),v(`tools`)&&e.usage?.toolUsage&&t.push(`tools:${e.usage.toolUsage.totalCalls}`),v(`errors`)&&e.usage?.messageCounts&&t.push(`errors:${e.usage.messageCounts.errors}`),v(`duration`)&&e.usage?.durationMs&&t.push(`dur:${S(e.usage.durationMs,{spaced:!0})??`—`}`),t},C=e=>{let t=e.usage;if(!t)return 0;if(n.length>0&&t.dailyBreakdown&&t.dailyBreakdown.length>0){let e=t.dailyBreakdown.filter(e=>n.includes(e.date));return r?e.reduce((e,t)=>e+t.tokens,0):e.reduce((e,t)=>e+t.cost,0)}return r?t.totalTokens??0:t.totalCost??0},te=Xa(e,(e,t)=>{switch(a){case`recent`:return(t.updatedAt??0)-(e.updatedAt??0);case`messages`:return(t.usage?.messageCounts?.total??0)-(e.usage?.messageCounts?.total??0);case`errors`:return(t.usage?.messageCounts?.errors??0)-(e.usage?.messageCounts?.errors??0);case`cost`:return C(t)-C(e);default:return C(t)-C(e)}}),ne=o===`asc`?Za(te):te,w=ne.reduce((e,t)=>e+C(t),0),re=ne.length?w/ne.length:0,T=ne.reduce((e,t)=>e+(t.usage?.messageCounts?.errors??0),0),E=(e,t)=>{let n=C(e),a=b(e),o=ee(e);return i`
1903
+ `}function kA(e,t,n,r,a,o,s,c,l,u,d,f,m,h,_){let v=e=>m.includes(e),b=e=>{let t=e.label||e.key;return t.startsWith(`agent:`)&&t.includes(`?token=`)?t.slice(0,t.indexOf(`?token=`)):t},x=async e=>{let t=b(e);try{await navigator.clipboard.writeText(t)}catch{}},ee=e=>{let t=[];return v(`channel`)&&e.channel&&t.push(`channel:${e.channel}`),v(`agent`)&&e.agentId&&t.push(`agent:${e.agentId}`),v(`provider`)&&(e.modelProvider||e.providerOverride)&&t.push(`provider:${e.modelProvider??e.providerOverride}`),v(`model`)&&e.model&&t.push(`model:${e.model}`),v(`messages`)&&e.usage?.messageCounts&&t.push(`msgs:${e.usage.messageCounts.total}`),v(`tools`)&&e.usage?.toolUsage&&t.push(`tools:${e.usage.toolUsage.totalCalls}`),v(`errors`)&&e.usage?.messageCounts&&t.push(`errors:${e.usage.messageCounts.errors}`),v(`duration`)&&e.usage?.durationMs&&t.push(`dur:${S(e.usage.durationMs,{spaced:!0})??`—`}`),t},C=e=>{let t=e.usage;if(!t)return 0;if(n.length>0&&t.dailyBreakdown&&t.dailyBreakdown.length>0){let e=t.dailyBreakdown.filter(e=>n.includes(e.date));return r?e.reduce((e,t)=>e+t.tokens,0):e.reduce((e,t)=>e+t.cost,0)}return r?t.totalTokens??0:t.totalCost??0},te=Xa(e,(e,t)=>{switch(a){case`recent`:return(t.updatedAt??0)-(e.updatedAt??0);case`messages`:return(t.usage?.messageCounts?.total??0)-(e.usage?.messageCounts?.total??0);case`errors`:return(t.usage?.messageCounts?.errors??0)-(e.usage?.messageCounts?.errors??0);case`cost`:return C(t)-C(e);default:return C(t)-C(e)}}),ne=o===`asc`?Za(te):te,w=ne.reduce((e,t)=>e+C(t),0),re=ne.length?w/ne.length:0,T=ne.reduce((e,t)=>e+(t.usage?.messageCounts?.errors??0),0),ie=(e,t)=>{let n=C(e),a=b(e),o=ee(e);return i`
1898
1904
  <div
1899
1905
  class="session-bar-row ${t?`selected`:``}"
1900
1906
  @click=${t=>l(e.key,t.shiftKey)}
@@ -1917,7 +1923,7 @@ ${e}
1917
1923
  </div>
1918
1924
  </div>
1919
1925
  </div>
1920
- `},ie=new Set(t),D=ne.filter(e=>ie.has(e.key)),O=D.length,k=new Map(ne.map(e=>[e.key,e])),ae=s.map(e=>k.get(e)).filter(e=>!!e);return i`
1926
+ `},ae=new Set(t),E=ne.filter(e=>ae.has(e.key)),D=E.length,O=new Map(ne.map(e=>[e.key,e])),oe=s.map(e=>O.get(e)).filter(e=>!!e);return i`
1921
1927
  <div class="card sessions-card">
1922
1928
  <div class="sessions-card-header">
1923
1929
  <div class="card-title">${p(`usage.sessions.title`)}</div>
@@ -1977,19 +1983,19 @@ ${e}
1977
1983
  >
1978
1984
  ${o===`desc`?`↓`:`↑`}
1979
1985
  </button>
1980
- ${O>0?i`
1986
+ ${D>0?i`
1981
1987
  <button class="btn btn--sm" @click=${_}>
1982
1988
  ${p(`usage.sessions.clearSelection`)}
1983
1989
  </button>
1984
1990
  `:g}
1985
1991
  </div>
1986
- ${c===`recent`?ae.length===0?i` <div class="usage-empty-block">${p(`usage.sessions.noRecent`)}</div> `:i`
1992
+ ${c===`recent`?oe.length===0?i` <div class="usage-empty-block">${p(`usage.sessions.noRecent`)}</div> `:i`
1987
1993
  <div class="session-bars session-bars--recent">
1988
- ${ae.map(e=>E(e,ie.has(e.key)))}
1994
+ ${oe.map(e=>ie(e,ae.has(e.key)))}
1989
1995
  </div>
1990
1996
  `:e.length===0?i` <div class="usage-empty-block">${p(`usage.sessions.noneInRange`)}</div> `:i`
1991
1997
  <div class="session-bars">
1992
- ${ne.slice(0,50).map(e=>E(e,ie.has(e.key)))}
1998
+ ${ne.slice(0,50).map(e=>ie(e,ae.has(e.key)))}
1993
1999
  ${e.length>50?i`
1994
2000
  <div class="usage-more-sessions">
1995
2001
  ${p(`usage.sessions.more`,{count:String(e.length-50)})}
@@ -1997,13 +2003,13 @@ ${e}
1997
2003
  `:g}
1998
2004
  </div>
1999
2005
  `}
2000
- ${O>1?i`
2006
+ ${D>1?i`
2001
2007
  <div class="sessions-selected-group">
2002
2008
  <div class="sessions-card-count">
2003
- ${p(`usage.sessions.selected`,{count:String(O)})}
2009
+ ${p(`usage.sessions.selected`,{count:String(D)})}
2004
2010
  </div>
2005
2011
  <div class="session-bars session-bars--selected">
2006
- ${D.map(e=>E(e,!0))}
2012
+ ${E.map(e=>ie(e,!0))}
2007
2013
  </div>
2008
2014
  </div>
2009
2015
  `:g}
@@ -2049,22 +2055,22 @@ ${e}
2049
2055
  ${TA(p(`usage.overview.topTools`),u,p(`usage.overview.noToolCalls`))}
2050
2056
  ${TA(p(`usage.details.modelMix`),d,p(`usage.overview.noModelData`))}
2051
2057
  </div>
2052
- `}function zA(e,t,n,r){let i=Math.min(n,r),a=Math.max(n,r),o=t.filter(e=>e.timestamp>=i&&e.timestamp<=a);if(o.length===0)return;let s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0;for(let e of o)s+=e.totalTokens||0,c+=e.cost||0,d+=e.input||0,f+=e.output||0,p+=e.cacheRead||0,m+=e.cacheWrite||0,e.output>0&&u++,e.input>0&&l++;return{...e,totalTokens:s,totalCost:c,input:d,output:f,cacheRead:p,cacheWrite:m,durationMs:o[o.length-1].timestamp-o[0].timestamp,firstActivity:o[0].timestamp,lastActivity:o[o.length-1].timestamp,messageCounts:{total:o.length,user:l,assistant:u,toolCalls:0,toolResults:0,errors:0}}}function BA(e,t,n,r,a,o,s,c,l,u,d,f,m,h,_,v,b,x,S,ee,C,te,ne,w,re,T){let E=e.label||e.key,ie=E.length>50?E.slice(0,50)+`…`:E,D=e.usage,O=c!==null&&l!==null,k=c!==null&&l!==null&&t?.points&&D?zA(D,t.points,c,l):void 0,ae=k?{totalTokens:k.totalTokens,totalCost:k.totalCost}:{totalTokens:D?.totalTokens??0,totalCost:D?.totalCost??0},A=k?p(`usage.details.filtered`):``;return i`
2058
+ `}function zA(e,t,n,r){let i=Math.min(n,r),a=Math.max(n,r),o=t.filter(e=>e.timestamp>=i&&e.timestamp<=a);if(o.length===0)return;let s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0;for(let e of o)s+=e.totalTokens||0,c+=e.cost||0,d+=e.input||0,f+=e.output||0,p+=e.cacheRead||0,m+=e.cacheWrite||0,e.output>0&&u++,e.input>0&&l++;return{...e,totalTokens:s,totalCost:c,input:d,output:f,cacheRead:p,cacheWrite:m,durationMs:o[o.length-1].timestamp-o[0].timestamp,firstActivity:o[0].timestamp,lastActivity:o[o.length-1].timestamp,messageCounts:{total:o.length,user:l,assistant:u,toolCalls:0,toolResults:0,errors:0}}}function BA(e,t,n,r,a,o,s,c,l,u,d,f,m,h,_,v,b,x,S,ee,C,te,ne,w,re,T){let ie=e.label||e.key,ae=ie.length>50?ie.slice(0,50)+`…`:ie,E=e.usage,D=c!==null&&l!==null,O=c!==null&&l!==null&&t?.points&&E?zA(E,t.points,c,l):void 0,oe=O?{totalTokens:O.totalTokens,totalCost:O.totalCost}:{totalTokens:E?.totalTokens??0,totalCost:E?.totalCost??0},k=O?p(`usage.details.filtered`):``;return i`
2053
2059
  <div class="card session-detail-panel">
2054
2060
  <div class="session-detail-header">
2055
2061
  <div class="session-detail-header-left">
2056
2062
  <div class="session-detail-title">
2057
- ${ie}
2058
- ${A?i`<span class="session-detail-indicator">${A}</span>`:g}
2063
+ ${ae}
2064
+ ${k?i`<span class="session-detail-indicator">${k}</span>`:g}
2059
2065
  </div>
2060
2066
  </div>
2061
2067
  <div class="session-detail-stats">
2062
- ${D?i`
2068
+ ${E?i`
2063
2069
  <span
2064
- ><strong>${Q(ae.totalTokens)}</strong>
2065
- ${y(p(`usage.metrics.tokens`))}${A}</span
2070
+ ><strong>${Q(oe.totalTokens)}</strong>
2071
+ ${y(p(`usage.metrics.tokens`))}${k}</span
2066
2072
  >
2067
- <span><strong>${eA(ae.totalCost)}</strong>${A}</span>
2073
+ <span><strong>${eA(oe.totalCost)}</strong>${k}</span>
2068
2074
  `:g}
2069
2075
  </div>
2070
2076
  <button
@@ -2077,13 +2083,13 @@ ${e}
2077
2083
  </button>
2078
2084
  </div>
2079
2085
  <div class="session-detail-content">
2080
- ${RA(e,k,c!=null&&l!=null&&h?LA(h,c,l):void 0)}
2086
+ ${RA(e,O,c!=null&&l!=null&&h?LA(h,c,l):void 0)}
2081
2087
  <div class="session-detail-row">
2082
2088
  ${VA(t,n,r,a,o,s,d,f,m,c,l,u)}
2083
2089
  </div>
2084
2090
  <div class="session-detail-bottom">
2085
- ${UA(h,_,v,b,x,S,ee,C,te,ne,O?c:null,O?l:null)}
2086
- ${HA(e.contextWeight,D,w,re)}
2091
+ ${UA(h,_,v,b,x,S,ee,C,te,ne,D?c:null,D?l:null)}
2092
+ ${HA(e.contextWeight,E,w,re)}
2087
2093
  </div>
2088
2094
  </div>
2089
2095
  </div>
@@ -2099,7 +2105,7 @@ ${e}
2099
2105
  <div class="session-timeseries-compact">
2100
2106
  <div class="usage-empty-block">${p(`usage.details.noDataInRange`)}</div>
2101
2107
  </div>
2102
- `;let _=0,v=0,b=0,x=0,S=0,ee=0;h=h.map(e=>(_+=e.totalTokens,v+=e.cost,b+=e.output,x+=e.input,S+=e.cacheRead,ee+=e.cacheWrite,{...e,cumulativeTokens:_,cumulativeCost:v}));let C=d!=null&&f!=null,te=C?Math.min(d,f):0,ne=C?Math.max(d,f):1/0,w=0,re=h.length;if(C){w=h.findIndex(e=>e.timestamp>=te),w===-1&&(w=h.length);let e=h.findIndex(e=>e.timestamp>ne);re=e===-1?h.length:e}let T=C?h.slice(w,re):h,E=0,ie=0,D=0,O=0;for(let e of T)E+=e.output,ie+=e.input,D+=e.cacheRead,O+=e.cacheWrite;let k={top:8,right:4,bottom:14,left:30},ae=400-k.left-k.right,A=100-k.top-k.bottom,j=n===`cumulative`,oe=n===`per-turn`&&a===`by-type`,M=E+ie+D+O,N=h.map(e=>j?e.cumulativeTokens:oe?e.input+e.output+e.cacheRead+e.cacheWrite:e.totalTokens),se=Math.max(...N,1),ce=ae/h.length,P=Math.min(8,Math.max(1,ce*AA)),F=ce-P,I=k.left+w*(P+F),le=re>=h.length?k.left+(h.length-1)*(P+F)+P:k.left+(re-1)*(P+F)+P;return i`
2108
+ `;let _=0,v=0,b=0,x=0,S=0,ee=0;h=h.map(e=>(_+=e.totalTokens,v+=e.cost,b+=e.output,x+=e.input,S+=e.cacheRead,ee+=e.cacheWrite,{...e,cumulativeTokens:_,cumulativeCost:v}));let C=d!=null&&f!=null,te=C?Math.min(d,f):0,ne=C?Math.max(d,f):1/0,w=0,re=h.length;if(C){w=h.findIndex(e=>e.timestamp>=te),w===-1&&(w=h.length);let e=h.findIndex(e=>e.timestamp>ne);re=e===-1?h.length:e}let T=C?h.slice(w,re):h,ie=0,ae=0,E=0,D=0;for(let e of T)ie+=e.output,ae+=e.input,E+=e.cacheRead,D+=e.cacheWrite;let O={top:8,right:4,bottom:14,left:30},oe=400-O.left-O.right,k=100-O.top-O.bottom,A=n===`cumulative`,se=n===`per-turn`&&a===`by-type`,j=ie+ae+E+D,M=h.map(e=>A?e.cumulativeTokens:se?e.input+e.output+e.cacheRead+e.cacheWrite:e.totalTokens),N=Math.max(...M,1),ce=oe/h.length,P=Math.min(8,Math.max(1,ce*AA)),F=ce-P,I=O.left+w*(P+F),le=re>=h.length?O.left+(h.length-1)*(P+F)+P:O.left+(re-1)*(P+F)+P;return i`
2103
2109
  <div class="session-timeseries-compact">
2104
2110
  <div class="timeseries-header-row">
2105
2111
  <div class="card-title usage-section-title">${p(`usage.details.usageOverTime`)}</div>
@@ -2116,19 +2122,19 @@ ${e}
2116
2122
  `:g}
2117
2123
  <div class="chart-toggle small">
2118
2124
  <button
2119
- class="btn btn--sm toggle-btn ${j?``:`active`}"
2125
+ class="btn btn--sm toggle-btn ${A?``:`active`}"
2120
2126
  @click=${()=>r(`per-turn`)}
2121
2127
  >
2122
2128
  ${p(`usage.details.perTurn`)}
2123
2129
  </button>
2124
2130
  <button
2125
- class="btn btn--sm toggle-btn ${j?`active`:``}"
2131
+ class="btn btn--sm toggle-btn ${A?`active`:``}"
2126
2132
  @click=${()=>r(`cumulative`)}
2127
2133
  >
2128
2134
  ${p(`usage.details.cumulative`)}
2129
2135
  </button>
2130
2136
  </div>
2131
- ${j?g:i`
2137
+ ${A?g:i`
2132
2138
  <div class="chart-toggle small">
2133
2139
  <button
2134
2140
  class="btn btn--sm toggle-btn ${a===`total`?`active`:``}"
@@ -2150,32 +2156,32 @@ ${e}
2150
2156
  <svg viewBox="0 0 ${400} ${118}" class="timeseries-svg">
2151
2157
  <!-- Y axis -->
2152
2158
  <line
2153
- x1="${k.left}"
2154
- y1="${k.top}"
2155
- x2="${k.left}"
2156
- y2="${k.top+A}"
2159
+ x1="${O.left}"
2160
+ y1="${O.top}"
2161
+ x2="${O.left}"
2162
+ y2="${O.top+k}"
2157
2163
  stroke="var(--border)"
2158
2164
  />
2159
2165
  <!-- X axis -->
2160
2166
  <line
2161
- x1="${k.left}"
2162
- y1="${k.top+A}"
2163
- x2="${400-k.right}"
2164
- y2="${k.top+A}"
2167
+ x1="${O.left}"
2168
+ y1="${O.top+k}"
2169
+ x2="${400-O.right}"
2170
+ y2="${O.top+k}"
2165
2171
  stroke="var(--border)"
2166
2172
  />
2167
2173
  <!-- Y axis labels -->
2168
2174
  <text
2169
- x="${k.left-4}"
2170
- y="${k.top+5}"
2175
+ x="${O.left-4}"
2176
+ y="${O.top+5}"
2171
2177
  text-anchor="end"
2172
2178
  class="ts-axis-label"
2173
2179
  >
2174
- ${Q(se)}
2180
+ ${Q(N)}
2175
2181
  </text>
2176
2182
  <text
2177
- x="${k.left-4}"
2178
- y="${k.top+A}"
2183
+ x="${O.left-4}"
2184
+ y="${O.top+k}"
2179
2185
  text-anchor="end"
2180
2186
  class="ts-axis-label"
2181
2187
  >
@@ -2183,20 +2189,20 @@ ${e}
2183
2189
  </text>
2184
2190
  <!-- X axis labels (first and last) -->
2185
2191
  ${h.length>0?l`
2186
- <text x="${k.left}" y="${k.top+A+10}" text-anchor="start" class="ts-axis-label">${new Date(h[0].timestamp).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`})}</text>
2187
- <text x="${400-k.right}" y="${k.top+A+10}" text-anchor="end" class="ts-axis-label">${new Date(h[h.length-1].timestamp).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`})}</text>
2192
+ <text x="${O.left}" y="${O.top+k+10}" text-anchor="start" class="ts-axis-label">${new Date(h[0].timestamp).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`})}</text>
2193
+ <text x="${400-O.right}" y="${O.top+k+10}" text-anchor="end" class="ts-axis-label">${new Date(h[h.length-1].timestamp).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`})}</text>
2188
2194
  `:g}
2189
2195
  <!-- Bars -->
2190
- ${h.map((e,t)=>{let n=N[t],r=k.left+t*(P+F),i=n/se*A,a=k.top+A-i,o=[new Date(e.timestamp).toLocaleDateString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}),`${Q(n)} ${y(p(`usage.metrics.tokens`))}`];oe&&(o.push(`Out ${Q(e.output)}`),o.push(`In ${Q(e.input)}`),o.push(`CW ${Q(e.cacheWrite)}`),o.push(`CR ${Q(e.cacheRead)}`));let s=o.join(` · `),c=C&&(t<w||t>=re);if(!oe)return l`<rect x="${r}" y="${a}" width="${P}" height="${i}" class="ts-bar${c?` dimmed`:``}" rx="1"><title>${s}</title></rect>`;let u=[{value:e.output,cls:`output`},{value:e.input,cls:`input`},{value:e.cacheWrite,cls:`cache-write`},{value:e.cacheRead,cls:`cache-read`}],d=k.top+A,f=c?` dimmed`:``;return l`
2196
+ ${h.map((e,t)=>{let n=M[t],r=O.left+t*(P+F),i=n/N*k,a=O.top+k-i,o=[new Date(e.timestamp).toLocaleDateString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}),`${Q(n)} ${y(p(`usage.metrics.tokens`))}`];se&&(o.push(`Out ${Q(e.output)}`),o.push(`In ${Q(e.input)}`),o.push(`CW ${Q(e.cacheWrite)}`),o.push(`CR ${Q(e.cacheRead)}`));let s=o.join(` · `),c=C&&(t<w||t>=re);if(!se)return l`<rect x="${r}" y="${a}" width="${P}" height="${i}" class="ts-bar${c?` dimmed`:``}" rx="1"><title>${s}</title></rect>`;let u=[{value:e.output,cls:`output`},{value:e.input,cls:`input`},{value:e.cacheWrite,cls:`cache-write`},{value:e.cacheRead,cls:`cache-read`}],d=O.top+k,f=c?` dimmed`:``;return l`
2191
2197
  ${u.map(e=>{if(e.value<=0||n<=0)return g;let t=i*(e.value/n);return d-=t,l`<rect x="${r}" y="${d}" width="${P}" height="${t}" class="ts-bar ${e.cls}${f}" rx="1"><title>${s}</title></rect>`})}
2192
2198
  `})}
2193
2199
  <!-- Selection highlight overlay (always visible between handles) -->
2194
2200
  ${l`
2195
2201
  <rect
2196
2202
  x="${I}"
2197
- y="${k.top}"
2203
+ y="${O.top}"
2198
2204
  width="${Math.max(1,le-I)}"
2199
- height="${A}"
2205
+ height="${k}"
2200
2206
  fill="var(--accent)"
2201
2207
  opacity="${jA}"
2202
2208
  pointer-events="none"
@@ -2204,21 +2210,21 @@ ${e}
2204
2210
  `}
2205
2211
  <!-- Left cursor line + handle -->
2206
2212
  ${l`
2207
- <line x1="${I}" y1="${k.top}" x2="${I}" y2="${k.top+A}" stroke="var(--accent)" stroke-width="0.8" opacity="0.7" />
2208
- <rect x="${I-MA/2}" y="${k.top+A/2-NA/2}" width="${MA}" height="${NA}" rx="1.5" fill="var(--accent)" class="cursor-handle" />
2209
- <line x1="${I-PA}" y1="${k.top+A/2-NA/5}" x2="${I-PA}" y2="${k.top+A/2+NA/5}" stroke="var(--bg)" stroke-width="0.4" pointer-events="none" />
2210
- <line x1="${I+PA}" y1="${k.top+A/2-NA/5}" x2="${I+PA}" y2="${k.top+A/2+NA/5}" stroke="var(--bg)" stroke-width="0.4" pointer-events="none" />
2213
+ <line x1="${I}" y1="${O.top}" x2="${I}" y2="${O.top+k}" stroke="var(--accent)" stroke-width="0.8" opacity="0.7" />
2214
+ <rect x="${I-MA/2}" y="${O.top+k/2-NA/2}" width="${MA}" height="${NA}" rx="1.5" fill="var(--accent)" class="cursor-handle" />
2215
+ <line x1="${I-PA}" y1="${O.top+k/2-NA/5}" x2="${I-PA}" y2="${O.top+k/2+NA/5}" stroke="var(--bg)" stroke-width="0.4" pointer-events="none" />
2216
+ <line x1="${I+PA}" y1="${O.top+k/2-NA/5}" x2="${I+PA}" y2="${O.top+k/2+NA/5}" stroke="var(--bg)" stroke-width="0.4" pointer-events="none" />
2211
2217
  `}
2212
2218
  <!-- Right cursor line + handle -->
2213
2219
  ${l`
2214
- <line x1="${le}" y1="${k.top}" x2="${le}" y2="${k.top+A}" stroke="var(--accent)" stroke-width="0.8" opacity="0.7" />
2215
- <rect x="${le-MA/2}" y="${k.top+A/2-NA/2}" width="${MA}" height="${NA}" rx="1.5" fill="var(--accent)" class="cursor-handle" />
2216
- <line x1="${le-PA}" y1="${k.top+A/2-NA/5}" x2="${le-PA}" y2="${k.top+A/2+NA/5}" stroke="var(--bg)" stroke-width="0.4" pointer-events="none" />
2217
- <line x1="${le+PA}" y1="${k.top+A/2-NA/5}" x2="${le+PA}" y2="${k.top+A/2+NA/5}" stroke="var(--bg)" stroke-width="0.4" pointer-events="none" />
2220
+ <line x1="${le}" y1="${O.top}" x2="${le}" y2="${O.top+k}" stroke="var(--accent)" stroke-width="0.8" opacity="0.7" />
2221
+ <rect x="${le-MA/2}" y="${O.top+k/2-NA/2}" width="${MA}" height="${NA}" rx="1.5" fill="var(--accent)" class="cursor-handle" />
2222
+ <line x1="${le-PA}" y1="${O.top+k/2-NA/5}" x2="${le-PA}" y2="${O.top+k/2+NA/5}" stroke="var(--bg)" stroke-width="0.4" pointer-events="none" />
2223
+ <line x1="${le+PA}" y1="${O.top+k/2-NA/5}" x2="${le+PA}" y2="${O.top+k/2+NA/5}" stroke="var(--bg)" stroke-width="0.4" pointer-events="none" />
2218
2224
  `}
2219
2225
  </svg>
2220
2226
  <!-- Handle drag zones (only on handles, not full chart) -->
2221
- ${(()=>{let e=`${(I/400*100).toFixed(1)}%`,t=`${(le/400*100).toFixed(1)}%`,n=e=>t=>{if(!m)return;t.preventDefault(),t.stopPropagation();let n=t.currentTarget.closest(`.timeseries-chart-wrapper`)?.querySelector(`svg`);if(!n)return;let r=n.getBoundingClientRect(),i=r.width,a=k.left/400*i,o=(400-k.right)/400*i-a,s=e=>{let t=Math.max(0,Math.min(1,(e-r.left-a)/o));return Math.min(Math.floor(t*h.length),h.length-1)},c=e===`left`?I:le,l=r.left+c/400*i,u=t.clientX-l;document.body.style.cursor=`col-resize`;let p=t=>{let n=s(t.clientX-u),r=h[n];if(r)if(e===`left`){let e=f??h[h.length-1].timestamp;m(Math.min(r.timestamp,e),e)}else{let e=d??h[0].timestamp;m(e,Math.max(r.timestamp,e))}},g=()=>{document.body.style.cursor=``,document.removeEventListener(`mousemove`,p),document.removeEventListener(`mouseup`,g)};document.addEventListener(`mousemove`,p),document.addEventListener(`mouseup`,g)};return i`
2227
+ ${(()=>{let e=`${(I/400*100).toFixed(1)}%`,t=`${(le/400*100).toFixed(1)}%`,n=e=>t=>{if(!m)return;t.preventDefault(),t.stopPropagation();let n=t.currentTarget.closest(`.timeseries-chart-wrapper`)?.querySelector(`svg`);if(!n)return;let r=n.getBoundingClientRect(),i=r.width,a=O.left/400*i,o=(400-O.right)/400*i-a,s=e=>{let t=Math.max(0,Math.min(1,(e-r.left-a)/o));return Math.min(Math.floor(t*h.length),h.length-1)},c=e===`left`?I:le,l=r.left+c/400*i,u=t.clientX-l;document.body.style.cursor=`col-resize`;let p=t=>{let n=s(t.clientX-u),r=h[n];if(r)if(e===`left`){let e=f??h[h.length-1].timestamp;m(Math.min(r.timestamp,e),e)}else{let e=d??h[0].timestamp;m(e,Math.max(r.timestamp,e))}},g=()=>{document.body.style.cursor=``,document.removeEventListener(`mousemove`,p),document.removeEventListener(`mouseup`,g)};document.addEventListener(`mousemove`,p),document.addEventListener(`mouseup`,g)};return i`
2222
2228
  <div
2223
2229
  class="chart-handle-zone chart-handle-left"
2224
2230
  style="left: ${e};"
@@ -2239,52 +2245,52 @@ ${e}
2239
2245
  ·
2240
2246
  ${new Date(te).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`})}–${new Date(ne).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`})}
2241
2247
  ·
2242
- ${Q(E+ie+D+O)}
2248
+ ${Q(ie+ae+E+D)}
2243
2249
  · ${eA(T.reduce((e,t)=>e+(t.cost||0),0))}
2244
2250
  `:i`${h.length} ${p(`usage.overview.messagesAbbrev`)} · ${Q(_)}
2245
2251
  · ${eA(v)}`}
2246
2252
  </div>
2247
- ${oe?i`
2253
+ ${se?i`
2248
2254
  <div class="timeseries-breakdown">
2249
2255
  <div class="card-title usage-section-title">${p(`usage.breakdown.tokensByType`)}</div>
2250
2256
  <div class="cost-breakdown-bar cost-breakdown-bar--compact">
2251
2257
  <div
2252
2258
  class="cost-segment output"
2253
- style="width: ${FA(E,M).toFixed(1)}%"
2259
+ style="width: ${FA(ie,j).toFixed(1)}%"
2254
2260
  ></div>
2255
2261
  <div
2256
2262
  class="cost-segment input"
2257
- style="width: ${FA(ie,M).toFixed(1)}%"
2263
+ style="width: ${FA(ae,j).toFixed(1)}%"
2258
2264
  ></div>
2259
2265
  <div
2260
2266
  class="cost-segment cache-write"
2261
- style="width: ${FA(O,M).toFixed(1)}%"
2267
+ style="width: ${FA(D,j).toFixed(1)}%"
2262
2268
  ></div>
2263
2269
  <div
2264
2270
  class="cost-segment cache-read"
2265
- style="width: ${FA(D,M).toFixed(1)}%"
2271
+ style="width: ${FA(E,j).toFixed(1)}%"
2266
2272
  ></div>
2267
2273
  </div>
2268
2274
  <div class="cost-breakdown-legend">
2269
2275
  <div class="legend-item" title=${p(`usage.details.assistantOutputTokens`)}>
2270
2276
  <span class="legend-dot output"></span>${p(`usage.breakdown.output`)}
2271
- ${Q(E)}
2277
+ ${Q(ie)}
2272
2278
  </div>
2273
2279
  <div class="legend-item" title=${p(`usage.details.userToolInputTokens`)}>
2274
2280
  <span class="legend-dot input"></span>${p(`usage.breakdown.input`)}
2275
- ${Q(ie)}
2281
+ ${Q(ae)}
2276
2282
  </div>
2277
2283
  <div class="legend-item" title=${p(`usage.details.tokensWrittenToCache`)}>
2278
2284
  <span class="legend-dot cache-write"></span>${p(`usage.breakdown.cacheWrite`)}
2279
- ${Q(O)}
2285
+ ${Q(D)}
2280
2286
  </div>
2281
2287
  <div class="legend-item" title=${p(`usage.details.tokensReadFromCache`)}>
2282
2288
  <span class="legend-dot cache-read"></span>${p(`usage.breakdown.cacheRead`)}
2283
- ${Q(D)}
2289
+ ${Q(E)}
2284
2290
  </div>
2285
2291
  </div>
2286
2292
  <div class="cost-breakdown-total">
2287
- ${p(`usage.breakdown.total`)}: ${Q(M)}
2293
+ ${p(`usage.breakdown.total`)}: ${Q(j)}
2288
2294
  </div>
2289
2295
  </div>
2290
2296
  `:g}
@@ -2547,7 +2553,7 @@ ${e}
2547
2553
  <button class="btn primary" @click=${e}>${p(`common.refresh`)}</button>
2548
2554
  </div>
2549
2555
  </section>
2550
- `}function JA(e){let{data:t,filters:n,display:r,detail:a,callbacks:o}=e,s=o.filters,c=o.display,l=o.details;if(t.loading&&!t.totals)return i`<div class="usage-page">${KA(n)}</div>`;let u=r.chartMode===`tokens`,d=n.query.trim().length>0,f=n.queryDraft.trim().length>0,m=Xa(t.sessions,(e,t)=>{let n=u?e.usage?.totalTokens??0:e.usage?.totalCost??0;return(u?t.usage?.totalTokens??0:t.usage?.totalCost??0)-n}),h=n.selectedDays.length>0?m.filter(e=>{if(e.usage?.activityDates?.length)return e.usage.activityDates.some(e=>n.selectedDays.includes(e));if(!e.updatedAt)return!1;let t=new Date(e.updatedAt),r=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`;return n.selectedDays.includes(r)}):m,_=(e,t)=>{if(t.length===0)return!0;let r=e.usage,i=r?.firstActivity??e.updatedAt,a=r?.lastActivity??e.updatedAt;if(!i||!a)return!1;let o=Math.min(i,a),s=Math.max(i,a),c=o;for(;c<=s;){let e=new Date(c),r=Yk(e,n.timeZone);if(t.includes(r))return!0;let i=Zk(e,n.timeZone);c=Math.min(i.getTime(),s)+1}return!1},v=zk(n.selectedHours.length>0?h.filter(e=>_(e,n.selectedHours)):h,n.query),y=v.sessions,b=v.warnings,x=mA(n.queryDraft,m,t.aggregates),S=Nk(n.query),ee=e=>{let t=gA(e);return S.filter(e=>gA(e.key??``)===t).map(e=>e.value).filter(Boolean)},C=e=>{let t=new Set;for(let n of e)n&&t.add(n);return Array.from(t)},te=C(m.map(e=>e.agentId)).slice(0,12),ne=C(m.map(e=>e.channel)).slice(0,12),w=C([...m.map(e=>e.modelProvider),...m.map(e=>e.providerOverride),...t.aggregates?.byProvider.map(e=>e.provider)??[]]).slice(0,12),re=C([...m.map(e=>e.model),...t.aggregates?.byModel.map(e=>e.model)??[]]).slice(0,12),T=C(t.aggregates?.tools.tools.map(e=>e.name)??[]).slice(0,12),E=n.selectedSessions.length===1?t.sessions.find(e=>e.key===n.selectedSessions[0])??y.find(e=>e.key===n.selectedSessions[0]):null,ie=e=>e.reduce((e,t)=>t.usage?GA(e,t.usage):e,WA()),D=e=>t.costDaily.filter(t=>e.includes(t.date)).reduce((e,t)=>GA(e,t),WA()),O,k,ae=m.length;if(n.selectedSessions.length>0){let e=y.filter(e=>n.selectedSessions.includes(e.key));O=ie(e),k=e.length}else n.selectedDays.length>0&&n.selectedHours.length===0?(O=D(n.selectedDays),k=y.length):n.selectedHours.length>0||d?(O=ie(y),k=y.length):(O=t.totals,k=ae);let A=n.selectedSessions.length>0?y.filter(e=>n.selectedSessions.includes(e.key)):d||n.selectedHours.length>0?y:n.selectedDays.length>0?h:m,j=sA(A,t.aggregates),oe=n.selectedSessions.length>0?(()=>{let e=y.filter(e=>n.selectedSessions.includes(e.key)),r=new Set;for(let t of e)for(let e of t.usage?.activityDates??[])r.add(e);return r.size>0?t.costDaily.filter(e=>r.has(e.date)):t.costDaily})():t.costDaily,M=cA(A,O,j),N=!t.loading&&!t.totals&&t.sessions.length===0,se=(O?.missingCostEntries??0)>0||(O?O.totalTokens>0&&O.totalCost===0&&O.input+O.output+O.cacheRead+O.cacheWrite>0:!1),ce=[{label:p(`usage.presets.today`),days:1},{label:p(`usage.presets.last7d`),days:7},{label:p(`usage.presets.last30d`),days:30}],P=e=>{let t=new Date,n=new Date;n.setDate(n.getDate()-(e-1)),s.onStartDateChange(tA(n)),s.onEndDateChange(tA(t))},F=(e,t,r)=>{if(r.length===0)return g;let a=ee(e),o=new Set(a.map(e=>gA(e))),c=r.length>0&&r.every(e=>o.has(gA(e))),l=a.length;return i`
2556
+ `}function JA(e){let{data:t,filters:n,display:r,detail:a,callbacks:o}=e,s=o.filters,c=o.display,l=o.details;if(t.loading&&!t.totals)return i`<div class="usage-page">${KA(n)}</div>`;let u=r.chartMode===`tokens`,d=n.query.trim().length>0,f=n.queryDraft.trim().length>0,m=Xa(t.sessions,(e,t)=>{let n=u?e.usage?.totalTokens??0:e.usage?.totalCost??0;return(u?t.usage?.totalTokens??0:t.usage?.totalCost??0)-n}),h=n.selectedDays.length>0?m.filter(e=>{if(e.usage?.activityDates?.length)return e.usage.activityDates.some(e=>n.selectedDays.includes(e));if(!e.updatedAt)return!1;let t=new Date(e.updatedAt),r=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`;return n.selectedDays.includes(r)}):m,_=(e,t)=>{if(t.length===0)return!0;let r=e.usage,i=r?.firstActivity??e.updatedAt,a=r?.lastActivity??e.updatedAt;if(!i||!a)return!1;let o=Math.min(i,a),s=Math.max(i,a),c=o;for(;c<=s;){let e=new Date(c),r=Yk(e,n.timeZone);if(t.includes(r))return!0;let i=Zk(e,n.timeZone);c=Math.min(i.getTime(),s)+1}return!1},v=zk(n.selectedHours.length>0?h.filter(e=>_(e,n.selectedHours)):h,n.query),y=v.sessions,b=v.warnings,x=mA(n.queryDraft,m,t.aggregates),S=Nk(n.query),ee=e=>{let t=gA(e);return S.filter(e=>gA(e.key??``)===t).map(e=>e.value).filter(Boolean)},C=e=>{let t=new Set;for(let n of e)n&&t.add(n);return Array.from(t)},te=C(m.map(e=>e.agentId)).slice(0,12),ne=C(m.map(e=>e.channel)).slice(0,12),w=C([...m.map(e=>e.modelProvider),...m.map(e=>e.providerOverride),...t.aggregates?.byProvider.map(e=>e.provider)??[]]).slice(0,12),re=C([...m.map(e=>e.model),...t.aggregates?.byModel.map(e=>e.model)??[]]).slice(0,12),T=C(t.aggregates?.tools.tools.map(e=>e.name)??[]).slice(0,12),ie=n.selectedSessions.length===1?t.sessions.find(e=>e.key===n.selectedSessions[0])??y.find(e=>e.key===n.selectedSessions[0]):null,ae=e=>e.reduce((e,t)=>t.usage?GA(e,t.usage):e,WA()),E=e=>t.costDaily.filter(t=>e.includes(t.date)).reduce((e,t)=>GA(e,t),WA()),D,O,oe=m.length;if(n.selectedSessions.length>0){let e=y.filter(e=>n.selectedSessions.includes(e.key));D=ae(e),O=e.length}else n.selectedDays.length>0&&n.selectedHours.length===0?(D=E(n.selectedDays),O=y.length):n.selectedHours.length>0||d?(D=ae(y),O=y.length):(D=t.totals,O=oe);let k=n.selectedSessions.length>0?y.filter(e=>n.selectedSessions.includes(e.key)):d||n.selectedHours.length>0?y:n.selectedDays.length>0?h:m,A=sA(k,t.aggregates),se=n.selectedSessions.length>0?(()=>{let e=y.filter(e=>n.selectedSessions.includes(e.key)),r=new Set;for(let t of e)for(let e of t.usage?.activityDates??[])r.add(e);return r.size>0?t.costDaily.filter(e=>r.has(e.date)):t.costDaily})():t.costDaily,j=cA(k,D,A),M=!t.loading&&!t.totals&&t.sessions.length===0,N=(D?.missingCostEntries??0)>0||(D?D.totalTokens>0&&D.totalCost===0&&D.input+D.output+D.cacheRead+D.cacheWrite>0:!1),ce=[{label:p(`usage.presets.today`),days:1},{label:p(`usage.presets.last7d`),days:7},{label:p(`usage.presets.last30d`),days:30}],P=e=>{let t=new Date,n=new Date;n.setDate(n.getDate()-(e-1)),s.onStartDateChange(tA(n)),s.onEndDateChange(tA(t))},F=(e,t,r)=>{if(r.length===0)return g;let a=ee(e),o=new Set(a.map(e=>gA(e))),c=r.length>0&&r.every(e=>o.has(gA(e))),l=a.length;return i`
2551
2557
  <details
2552
2558
  class="usage-filter-select"
2553
2559
  @toggle=${e=>{let t=e.currentTarget;if(!t.open)return;let n=e=>{e.composedPath().includes(t)||(t.open=!1,window.removeEventListener(`click`,n,!0))};window.addEventListener(`click`,n,!0)}}
@@ -2599,21 +2605,21 @@ ${e}
2599
2605
  <div class="usage-header-title">
2600
2606
  <div class="card-title usage-section-title">${p(`usage.filters.title`)}</div>
2601
2607
  ${t.loading?i`<span class="usage-refresh-indicator">${p(`usage.loading.badge`)}</span>`:g}
2602
- ${N?i`<span class="usage-query-hint">${p(`usage.empty.hint`)}</span>`:g}
2608
+ ${M?i`<span class="usage-query-hint">${p(`usage.empty.hint`)}</span>`:g}
2603
2609
  </div>
2604
2610
  <div class="usage-header-metrics">
2605
- ${O?i`
2611
+ ${D?i`
2606
2612
  <span class="usage-metric-badge">
2607
- <strong>${Q(O.totalTokens)}</strong>
2613
+ <strong>${Q(D.totalTokens)}</strong>
2608
2614
  ${p(`usage.metrics.tokens`)}
2609
2615
  </span>
2610
2616
  <span class="usage-metric-badge">
2611
- <strong>${eA(O.totalCost)}</strong>
2617
+ <strong>${eA(D.totalCost)}</strong>
2612
2618
  ${p(`usage.metrics.cost`)}
2613
2619
  </span>
2614
2620
  <span class="usage-metric-badge">
2615
- <strong>${k}</strong>
2616
- ${p(k===1?`usage.metrics.session`:`usage.metrics.sessions`)}
2621
+ <strong>${O}</strong>
2622
+ ${p(O===1?`usage.metrics.session`:`usage.metrics.sessions`)}
2617
2623
  </span>
2618
2624
  `:g}
2619
2625
  <button
@@ -2639,15 +2645,15 @@ ${e}
2639
2645
  </button>
2640
2646
  <button
2641
2647
  class="usage-export-item"
2642
- @click=${()=>lA(`genesis-usage-daily-${I}.csv`,pA(oe),`text/csv`)}
2643
- ?disabled=${oe.length===0}
2648
+ @click=${()=>lA(`genesis-usage-daily-${I}.csv`,pA(se),`text/csv`)}
2649
+ ?disabled=${se.length===0}
2644
2650
  >
2645
2651
  ${p(`usage.export.dailyCsv`)}
2646
2652
  </button>
2647
2653
  <button
2648
2654
  class="usage-export-item"
2649
- @click=${()=>lA(`genesis-usage-${I}.json`,JSON.stringify({totals:O,sessions:y,daily:oe,aggregates:j},null,2),`application/json`)}
2650
- ?disabled=${y.length===0&&oe.length===0}
2655
+ @click=${()=>lA(`genesis-usage-${I}.json`,JSON.stringify({totals:D,sessions:y,daily:se,aggregates:A},null,2),`application/json`)}
2656
+ ?disabled=${y.length===0&&se.length===0}
2651
2657
  >
2652
2658
  ${p(`usage.export.json`)}
2653
2659
  </button>
@@ -2744,7 +2750,7 @@ ${e}
2744
2750
  </button>
2745
2751
  `:g}
2746
2752
  <span class="usage-query-hint">
2747
- ${d?p(`usage.query.matching`,{shown:String(y.length),total:String(ae)}):p(`usage.query.inRange`,{total:String(ae)})}
2753
+ ${d?p(`usage.query.matching`,{shown:String(y.length),total:String(oe)}):p(`usage.query.inRange`,{total:String(oe)})}
2748
2754
  </span>
2749
2755
  </div>
2750
2756
  </div>
@@ -2796,20 +2802,20 @@ ${e}
2796
2802
  `:g}
2797
2803
  </section>
2798
2804
 
2799
- ${N?qA(s.onRefresh):i`
2800
- ${OA(O,j,M,se,Jk(A,n.timeZone),k,ae)}
2801
- ${$k(A,n.timeZone,n.selectedHours,s.onSelectHour)}
2805
+ ${M?qA(s.onRefresh):i`
2806
+ ${OA(D,A,j,N,Jk(k,n.timeZone),O,oe)}
2807
+ ${$k(k,n.timeZone,n.selectedHours,s.onSelectHour)}
2802
2808
 
2803
2809
  <div class="usage-grid">
2804
2810
  <div class="usage-grid-column">
2805
2811
  <div class="card usage-left-card">
2806
- ${CA(oe,n.selectedDays,r.chartMode,r.dailyChartMode,c.onDailyChartModeChange,s.onSelectDay)}
2807
- ${O?wA(O,r.chartMode):g}
2812
+ ${CA(se,n.selectedDays,r.chartMode,r.dailyChartMode,c.onDailyChartModeChange,s.onSelectDay)}
2813
+ ${D?wA(D,r.chartMode):g}
2808
2814
  </div>
2809
- ${kA(y,n.selectedSessions,n.selectedDays,u,r.sessionSort,r.sessionSortDir,r.recentSessions,r.sessionsTab,l.onSelectSession,c.onSessionSortChange,c.onSessionSortDirChange,c.onSessionsTabChange,r.visibleColumns,ae,s.onClearSessions)}
2815
+ ${kA(y,n.selectedSessions,n.selectedDays,u,r.sessionSort,r.sessionSortDir,r.recentSessions,r.sessionsTab,l.onSelectSession,c.onSessionSortChange,c.onSessionSortDirChange,c.onSessionsTabChange,r.visibleColumns,oe,s.onClearSessions)}
2810
2816
  </div>
2811
- ${E?i`<div class="usage-grid-column">
2812
- ${BA(E,a.timeSeries,a.timeSeriesLoading,a.timeSeriesMode,l.onTimeSeriesModeChange,a.timeSeriesBreakdownMode,l.onTimeSeriesBreakdownChange,a.timeSeriesCursorStart,a.timeSeriesCursorEnd,l.onTimeSeriesCursorRangeChange,n.startDate,n.endDate,n.selectedDays,a.sessionLogs,a.sessionLogsLoading,a.sessionLogsExpanded,l.onToggleSessionLogsExpanded,a.logFilters,l.onLogFilterRolesChange,l.onLogFilterToolsChange,l.onLogFilterHasToolsChange,l.onLogFilterQueryChange,l.onLogFilterClear,r.contextExpanded,l.onToggleContextExpanded,s.onClearSessions)}
2817
+ ${ie?i`<div class="usage-grid-column">
2818
+ ${BA(ie,a.timeSeries,a.timeSeriesLoading,a.timeSeriesMode,l.onTimeSeriesModeChange,a.timeSeriesBreakdownMode,l.onTimeSeriesBreakdownChange,a.timeSeriesCursorStart,a.timeSeriesCursorEnd,l.onTimeSeriesCursorRangeChange,n.startDate,n.endDate,n.selectedDays,a.sessionLogs,a.sessionLogsLoading,a.sessionLogsExpanded,l.onToggleSessionLogsExpanded,a.logFilters,l.onLogFilterRolesChange,l.onLogFilterToolsChange,l.onLogFilterHasToolsChange,l.onLogFilterQueryChange,l.onLogFilterClear,r.contextExpanded,l.onToggleContextExpanded,s.onClearSessions)}
2813
2819
  </div>`:g}
2814
2820
  </div>
2815
2821
  `}
@@ -3078,7 +3084,8 @@ ${e}
3078
3084
  aria-label="Gateway status: ${t}"
3079
3085
  title="Gateway status: ${t}"
3080
3086
  ></span>
3081
- `}var Rj=[`noopener`,`noreferrer`],zj=`_blank`;function Bj(e){let t=[],n=new Set(Rj);for(let r of(e??``).split(/\s+/)){let e=_(r);!e||n.has(e)||(n.add(e),t.push(e))}return[...Rj,...t].join(` `)}var Vj=class extends c{constructor(...e){super(...e),this.tab=`overview`}createRenderRoot(){return this}render(){return i`
3087
+ `}var Rj=/^\s*[-*]\s*\[([^\]]+)\]\(([^)]+)\)\s*(?:[—–-]\s*(.*))?$/;function zj(e){let t=[];for(let n of e.split(`
3088
+ `)){let e=Rj.exec(n);if(!e)continue;let[,r,i,a]=e;t.push({name:r.trim(),file:i.trim(),description:(a??``).trim()})}return t}async function Bj(e,t){try{return zj((await e.request(`agents.files.get`,{agentId:t,name:`MEMORY.md`}))?.file?.content??``)}catch{return[]}}var Vj=[`noopener`,`noreferrer`],Hj=`_blank`;function Uj(e){let t=[],n=new Set(Vj);for(let r of(e??``).split(/\s+/)){let e=_(r);!e||n.has(e)||(n.add(e),t.push(e))}return[...Vj,...t].join(` `)}var Wj=class extends c{constructor(...e){super(...e),this.tab=`overview`}createRenderRoot(){return this}render(){return i`
3082
3089
  <div class="dashboard-header">
3083
3090
  <div class="dashboard-header__breadcrumb">
3084
3091
  <span
@@ -3094,18 +3101,18 @@ ${e}
3094
3101
  <slot></slot>
3095
3102
  </div>
3096
3103
  </div>
3097
- `}};X([P()],Vj.prototype,`tab`,void 0),customElements.get(`dashboard-header`)||customElements.define(`dashboard-header`,Vj);function Hj(){return Fo.map(e=>({id:`slash:${e.name}`,label:`/${e.name}`,icon:e.icon??`terminal`,category:`search`,action:`/${e.name}`,description:e.description}))}function Uj(){return[{id:`nav-overview`,label:`Overview`,icon:`barChart`,category:`navigation`,action:`nav:overview`},{id:`nav-sessions`,label:`Sessions`,icon:`fileText`,category:`navigation`,action:`nav:sessions`},{id:`nav-cron`,label:`Scheduled`,icon:`scrollText`,category:`navigation`,action:`nav:cron`},{id:`nav-wallet`,label:`Wallet`,icon:`wallet`,category:`navigation`,action:`nav:wallet`},{id:`nav-skills`,label:`Skills`,icon:`zap`,category:`navigation`,action:`nav:skills`},{id:`nav-plugins`,label:`Plugins`,icon:`wrench`,category:`navigation`,action:`nav:plugins`},{id:`nav-config`,label:`Settings`,icon:`settings`,category:`navigation`,action:`nav:config`},{id:`nav-agents`,label:`Agents`,icon:`folder`,category:`navigation`,action:`nav:agents`},{id:`skill-shell`,label:`Shell Command`,icon:`monitor`,category:`skills`,action:`/skill shell`,description:`Run shell`},{id:`skill-debug`,label:`Debug Mode`,icon:`bug`,category:`skills`,action:`/verbose full`,description:`Toggle debug`}]}function Wj(){return[...Hj(),...Uj()]}function Gj(e){let t=Wj();if(!e)return t;let n=y(e);return t.filter(e=>y(e.label).includes(n)||y(e.description).includes(n))}function Kj(e){let t=new Map;for(let n of e){let e=t.get(n.category)??[];e.push(n),t.set(n.category,e)}return[...t.entries()]}var qj=null;function Jj(){qj=document.activeElement}function Yj(){qj&&qj instanceof HTMLElement&&requestAnimationFrame(()=>qj&&qj.focus()),qj=null}function Xj(e,t){e.action.startsWith(`nav:`)?t.onNavigate(e.action.slice(4)):t.onSlashCommand(e.action),t.onToggle(),Yj()}function Zj(){requestAnimationFrame(()=>{document.querySelector(`.cmd-palette__item--active`)?.scrollIntoView({block:`nearest`})})}function Qj(e,t){let n=Gj(t.query);if(!(n.length===0&&(e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`Enter`)))switch(e.key){case`ArrowDown`:e.preventDefault(),t.onActiveIndexChange((t.activeIndex+1)%n.length),Zj();break;case`ArrowUp`:e.preventDefault(),t.onActiveIndexChange((t.activeIndex-1+n.length)%n.length),Zj();break;case`Enter`:e.preventDefault(),n[t.activeIndex]&&Xj(n[t.activeIndex],t);break;case`Escape`:e.preventDefault(),t.onToggle(),Yj();break}}var $j={search:`Search`,navigation:`Navigation`,skills:`Skills`};function eM(e){e&&(Jj(),requestAnimationFrame(()=>e.focus()))}function tM(e){if(!e.open)return g;let t=Gj(e.query),n=Kj(t);return i`
3104
+ `}};X([P()],Wj.prototype,`tab`,void 0),customElements.get(`dashboard-header`)||customElements.define(`dashboard-header`,Wj);function Gj(){return Fo.map(e=>({id:`slash:${e.name}`,label:`/${e.name}`,icon:e.icon??`terminal`,category:`search`,action:`/${e.name}`,description:e.description}))}function Kj(){return[{id:`nav-overview`,label:`Overview`,icon:`barChart`,category:`navigation`,action:`nav:overview`},{id:`nav-sessions`,label:`Sessions`,icon:`fileText`,category:`navigation`,action:`nav:sessions`},{id:`nav-cron`,label:`Scheduled`,icon:`scrollText`,category:`navigation`,action:`nav:cron`},{id:`nav-wallet`,label:`Wallet`,icon:`wallet`,category:`navigation`,action:`nav:wallet`},{id:`nav-skills`,label:`Skills`,icon:`zap`,category:`navigation`,action:`nav:skills`},{id:`nav-plugins`,label:`Plugins`,icon:`wrench`,category:`navigation`,action:`nav:plugins`},{id:`nav-config`,label:`Settings`,icon:`settings`,category:`navigation`,action:`nav:config`},{id:`nav-agents`,label:`Agents`,icon:`folder`,category:`navigation`,action:`nav:agents`},{id:`skill-shell`,label:`Shell Command`,icon:`monitor`,category:`skills`,action:`/skill shell`,description:`Run shell`},{id:`skill-debug`,label:`Debug Mode`,icon:`bug`,category:`skills`,action:`/verbose full`,description:`Toggle debug`}]}function qj(){return[...Gj(),...Kj()]}function Jj(e){let t=qj();if(!e)return t;let n=y(e);return t.filter(e=>y(e.label).includes(n)||y(e.description).includes(n))}function Yj(e){let t=new Map;for(let n of e){let e=t.get(n.category)??[];e.push(n),t.set(n.category,e)}return[...t.entries()]}var Xj=null;function Zj(){Xj=document.activeElement}function Qj(){Xj&&Xj instanceof HTMLElement&&requestAnimationFrame(()=>Xj&&Xj.focus()),Xj=null}function $j(e,t){e.action.startsWith(`nav:`)?t.onNavigate(e.action.slice(4)):t.onSlashCommand(e.action),t.onToggle(),Qj()}function eM(){requestAnimationFrame(()=>{document.querySelector(`.cmd-palette__item--active`)?.scrollIntoView({block:`nearest`})})}function tM(e,t){let n=Jj(t.query);if(!(n.length===0&&(e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`Enter`)))switch(e.key){case`ArrowDown`:e.preventDefault(),t.onActiveIndexChange((t.activeIndex+1)%n.length),eM();break;case`ArrowUp`:e.preventDefault(),t.onActiveIndexChange((t.activeIndex-1+n.length)%n.length),eM();break;case`Enter`:e.preventDefault(),n[t.activeIndex]&&$j(n[t.activeIndex],t);break;case`Escape`:e.preventDefault(),t.onToggle(),Qj();break}}var nM={search:`Search`,navigation:`Navigation`,skills:`Skills`};function rM(e){e&&(Zj(),requestAnimationFrame(()=>e.focus()))}function iM(e){if(!e.open)return g;let t=Jj(e.query),n=Yj(t);return i`
3098
3105
  <div
3099
3106
  class="cmd-palette-overlay"
3100
- @click=${()=>{e.onToggle(),Yj()}}
3107
+ @click=${()=>{e.onToggle(),Qj()}}
3101
3108
  >
3102
3109
  <div
3103
3110
  class="cmd-palette"
3104
3111
  @click=${e=>e.stopPropagation()}
3105
- @keydown=${t=>Qj(t,e)}
3112
+ @keydown=${t=>tM(t,e)}
3106
3113
  >
3107
3114
  <input
3108
- ${zg(eM)}
3115
+ ${zg(rM)}
3109
3116
  class="cmd-palette__input"
3110
3117
  placeholder="${p(`overview.palette.placeholder`)}"
3111
3118
  .value=${e.query}
@@ -3119,12 +3126,12 @@ ${e}
3119
3126
  <span>${p(`overview.palette.noResults`)}</span>
3120
3127
  </div>`:n.map(([n,r])=>i`
3121
3128
  <div class="cmd-palette__group-label">
3122
- ${$j[n]??n}
3129
+ ${nM[n]??n}
3123
3130
  </div>
3124
3131
  ${r.map(n=>{let r=t.indexOf(n);return i`
3125
3132
  <div
3126
3133
  class="cmd-palette__item ${r===e.activeIndex?`cmd-palette__item--active`:``}"
3127
- @click=${t=>{t.stopPropagation(),Xj(n,e)}}
3134
+ @click=${t=>{t.stopPropagation(),$j(n,e)}}
3128
3135
  @mouseenter=${()=>e.onActiveIndexChange(r)}
3129
3136
  >
3130
3137
  <span class="nav-item__icon">${J[n.icon]}</span>
@@ -3143,18 +3150,18 @@ ${e}
3143
3150
  </div>
3144
3151
  </div>
3145
3152
  </div>
3146
- `}var nM=[{id:`personal`,label:`Personal Assistant`,description:`Balanced context and cost. Best for daily use.`,icon:`✨`,patch:{agents:{defaults:{bootstrapMaxChars:2e4,bootstrapTotalMaxChars:15e4,contextInjection:`always`}}}},{id:`codeAgent`,label:`Code Agent`,description:`Higher context for coding tasks. More tokens per turn.`,icon:`🛠️`,patch:{agents:{defaults:{bootstrapMaxChars:5e4,bootstrapTotalMaxChars:3e5,contextInjection:`always`}}}},{id:`teamBot`,label:`Team Bot`,description:`Multi-channel, group-aware. Leaner per-turn context.`,icon:`👥`,patch:{agents:{defaults:{bootstrapMaxChars:1e4,bootstrapTotalMaxChars:8e4,contextInjection:`continuation-skip`}}}},{id:`minimal`,label:`Minimal`,description:`Lowest cost per turn. Fast and lean.`,icon:`⚡`,patch:{agents:{defaults:{bootstrapMaxChars:5e3,bootstrapTotalMaxChars:3e4,contextInjection:`continuation-skip`}}}}];function rM(e){return nM.find(t=>t.id===e)}function iM(e){let t=e.agents?.defaults;if(!t)return`personal`;let n=t.bootstrapMaxChars,r=t.bootstrapTotalMaxChars;for(let e of nM){let t=e.patch.agents?.defaults;if(t&&n===t.bootstrapMaxChars&&r===t.bootstrapTotalMaxChars)return e.id}return null}var aM=[{value:0,label:`None`},{value:25,label:`Slight`},{value:50,label:`Soft`},{value:75,label:`Round`},{value:100,label:`Full`}],oM=[`off`,`low`,`medium`,`high`],sM=15e5;function cM(){return i`
3153
+ `}var aM=[{id:`personal`,label:`Personal Assistant`,description:`Balanced context and cost. Best for daily use.`,icon:`✨`,patch:{agents:{defaults:{bootstrapMaxChars:2e4,bootstrapTotalMaxChars:15e4,contextInjection:`always`}}}},{id:`codeAgent`,label:`Code Agent`,description:`Higher context for coding tasks. More tokens per turn.`,icon:`🛠️`,patch:{agents:{defaults:{bootstrapMaxChars:5e4,bootstrapTotalMaxChars:3e5,contextInjection:`always`}}}},{id:`teamBot`,label:`Team Bot`,description:`Multi-channel, group-aware. Leaner per-turn context.`,icon:`👥`,patch:{agents:{defaults:{bootstrapMaxChars:1e4,bootstrapTotalMaxChars:8e4,contextInjection:`continuation-skip`}}}},{id:`minimal`,label:`Minimal`,description:`Lowest cost per turn. Fast and lean.`,icon:`⚡`,patch:{agents:{defaults:{bootstrapMaxChars:5e3,bootstrapTotalMaxChars:3e4,contextInjection:`continuation-skip`}}}}];function oM(e){return aM.find(t=>t.id===e)}function sM(e){let t=e.agents?.defaults;if(!t)return`personal`;let n=t.bootstrapMaxChars,r=t.bootstrapTotalMaxChars;for(let e of aM){let t=e.patch.agents?.defaults;if(t&&n===t.bootstrapMaxChars&&r===t.bootstrapTotalMaxChars)return e.id}return null}var cM=[{value:0,label:`None`},{value:25,label:`Slight`},{value:50,label:`Soft`},{value:75,label:`Round`},{value:100,label:`Full`}],lM=[`off`,`low`,`medium`,`high`],uM=15e5;function dM(){return i`
3147
3154
  <svg viewBox="0 0 24 24" fill="currentColor" width="18" height="18">
3148
3155
  <circle cx="12" cy="8" r="4" />
3149
3156
  <path d="M20 21a8 8 0 1 0-16 0" />
3150
3157
  </svg>
3151
- `}function lM(e,t){let n=Vh({name:e,avatar:t}),r=Uh(n),a=Wh(n),o=Gh(n);return a?i`<img class="qs-user-avatar" src=${a} alt=${r} />`:o?i`<div class="qs-user-avatar qs-user-avatar--text" aria-label=${r}>
3158
+ `}function fM(e,t){let n=Vh({name:e,avatar:t}),r=Uh(n),a=Wh(n),o=Gh(n);return a?i`<img class="qs-user-avatar" src=${a} alt=${r} />`:o?i`<div class="qs-user-avatar qs-user-avatar--text" aria-label=${r}>
3152
3159
  ${o}
3153
3160
  </div>`:i`
3154
3161
  <div class="qs-user-avatar qs-user-avatar--default" aria-label=${r}>
3155
- ${cM()}
3162
+ ${dM()}
3156
3163
  </div>
3157
- `}function uM(e,t){let n=e.target,r=n.files?.[0],i=t.onUserAvatarChange;if(!r||!i){n.value=``;return}if(!r.type.startsWith(`image/`)){n.value=``;return}if(r.size>sM){n.value=``;return}let a=new FileReader;a.addEventListener(`load`,()=>{i(typeof a.result==`string`?a.result:null)}),a.readAsDataURL(r),n.value=``}function dM(e,t,n){return i`
3164
+ `}function pM(e,t){let n=e.target,r=n.files?.[0],i=t.onUserAvatarChange;if(!r||!i){n.value=``;return}if(!r.type.startsWith(`image/`)){n.value=``;return}if(r.size>uM){n.value=``;return}let a=new FileReader;a.addEventListener(`load`,()=>{i(typeof a.result==`string`?a.result:null)}),a.readAsDataURL(r),n.value=``}function mM(e,t,n){return i`
3158
3165
  <div class="qs-card__header">
3159
3166
  <div class="qs-card__header-left">
3160
3167
  <span class="qs-card__icon">${e}</span>
@@ -3162,9 +3169,9 @@ ${e}
3162
3169
  </div>
3163
3170
  ${n||g}
3164
3171
  </div>
3165
- `}function fM(e){return i`
3172
+ `}function hM(e){return i`
3166
3173
  <div class="qs-card">
3167
- ${dM(J.brain,`Model & Thinking`)}
3174
+ ${mM(J.brain,`Model & Thinking`)}
3168
3175
  <div class="qs-card__body">
3169
3176
  <div class="qs-row">
3170
3177
  <span class="qs-row__label">Model</span>
@@ -3176,7 +3183,7 @@ ${e}
3176
3183
  <div class="qs-row">
3177
3184
  <span class="qs-row__label">Thinking</span>
3178
3185
  <div class="qs-segmented">
3179
- ${oM.map(t=>i`
3186
+ ${lM.map(t=>i`
3180
3187
  <button
3181
3188
  class="qs-segmented__btn ${t===e.thinkingLevel?`qs-segmented__btn--active`:``}"
3182
3189
  @click=${()=>e.onThinkingChange?.(t)}
@@ -3198,9 +3205,9 @@ ${e}
3198
3205
  </div>
3199
3206
  </div>
3200
3207
  </div>
3201
- `}function pM(e){let t=e.channels.filter(e=>e.connected).length,n=t>0?i`<span class="qs-badge qs-badge--ok">${t} connected</span>`:void 0;return i`
3208
+ `}function gM(e){let t=e.channels.filter(e=>e.connected).length,n=t>0?i`<span class="qs-badge qs-badge--ok">${t} connected</span>`:void 0;return i`
3202
3209
  <div class="qs-card">
3203
- ${dM(J.send,`Channels`,n)}
3210
+ ${mM(J.send,`Channels`,n)}
3204
3211
  <div class="qs-card__body">
3205
3212
  ${e.channels.length===0?i`<div class="qs-empty muted">No channels configured</div>`:e.channels.map(t=>i`
3206
3213
  <div class="qs-row">
@@ -3220,9 +3227,9 @@ ${e}
3220
3227
  `)}
3221
3228
  </div>
3222
3229
  </div>
3223
- `}function mM(e){let t=e.apiKeys.reduce((e,t)=>e+(t.profiles&&t.profiles.length>0?t.profiles.length:+!!t.isSet),0),n=t>1?i`<span class="qs-badge">${t} profiles</span>`:void 0;return i`
3230
+ `}function _M(e){let t=e.apiKeys.reduce((e,t)=>e+(t.profiles&&t.profiles.length>0?t.profiles.length:+!!t.isSet),0),n=t>1?i`<span class="qs-badge">${t} profiles</span>`:void 0;return i`
3224
3231
  <div class="qs-card">
3225
- ${dM(J.plug,`API Keys`,n)}
3232
+ ${mM(J.plug,`API Keys`,n)}
3226
3233
  <div class="qs-card__body">
3227
3234
  ${e.apiKeys.length===0?i`<div class="qs-empty muted">No API keys configured</div>`:e.apiKeys.map(t=>t.profiles&&t.profiles.length>0?i`
3228
3235
  <div class="qs-row qs-row--stack">
@@ -3272,9 +3279,9 @@ ${e}
3272
3279
  `)}
3273
3280
  </div>
3274
3281
  </div>
3275
- `}function hM(e){let{cronJobCount:t,skillCount:n,mcpServerCount:r}=e.automation;return i`
3282
+ `}function vM(e){let{cronJobCount:t,skillCount:n,mcpServerCount:r}=e.automation;return i`
3276
3283
  <div class="qs-card">
3277
- ${dM(J.zap,`Automations`)}
3284
+ ${mM(J.zap,`Automations`)}
3278
3285
  <div class="qs-card__body">
3279
3286
  <div class="qs-row">
3280
3287
  <span class="qs-row__label">
@@ -3296,9 +3303,9 @@ ${e}
3296
3303
  </div>
3297
3304
  </div>
3298
3305
  </div>
3299
- `}function gM(e){let{gatewayAuth:t,execPolicy:n,deviceAuth:r}=e.security;return i`
3306
+ `}function yM(e){let{gatewayAuth:t,execPolicy:n,deviceAuth:r}=e.security;return i`
3300
3307
  <div class="qs-card">
3301
- ${dM(J.eye,`Security`,i`<button class="qs-link-btn" @click=${e.onSecurityConfigure}>Configure →</button>`)}
3308
+ ${mM(J.eye,`Security`,i`<button class="qs-link-btn" @click=${e.onSecurityConfigure}>Configure →</button>`)}
3302
3309
  <div class="qs-card__body">
3303
3310
  <div class="qs-row">
3304
3311
  <span class="qs-row__label">Gateway auth</span>
@@ -3322,9 +3329,9 @@ ${e}
3322
3329
  </div>
3323
3330
  </div>
3324
3331
  </div>
3325
- `}function _M(e){return i`
3332
+ `}function bM(e){return i`
3326
3333
  <div class="qs-card">
3327
- ${dM(J.spark,`Appearance`)}
3334
+ ${mM(J.spark,`Appearance`)}
3328
3335
  <div class="qs-card__body">
3329
3336
  <div class="qs-row">
3330
3337
  <span class="qs-row__label">Mode</span>
@@ -3342,7 +3349,7 @@ ${e}
3342
3349
  <div class="qs-row">
3343
3350
  <span class="qs-row__label">Roundness</span>
3344
3351
  <div class="qs-segmented">
3345
- ${aM.map(t=>i`
3352
+ ${cM.map(t=>i`
3346
3353
  <button
3347
3354
  class="qs-segmented__btn qs-segmented__btn--compact ${t.value===e.borderRadius?`qs-segmented__btn--active`:``}"
3348
3355
  @click=${()=>e.setBorderRadius(t.value)}
@@ -3354,12 +3361,12 @@ ${e}
3354
3361
  </div>
3355
3362
  </div>
3356
3363
  </div>
3357
- `}function vM(e){let t=Vh({name:e.userName??null,avatar:e.userAvatar??null}),n=Gh(t)??``,r=Uh(t);return i`
3364
+ `}function xM(e){let t=Vh({name:e.userName??null,avatar:e.userAvatar??null}),n=Gh(t)??``,r=Uh(t);return i`
3358
3365
  <div class="qs-card">
3359
- ${dM(J.image,`Personal`)}
3366
+ ${mM(J.image,`Personal`)}
3360
3367
  <div class="qs-card__body">
3361
3368
  <div class="qs-personal-preview">
3362
- ${lM(e.userName,e.userAvatar)}
3369
+ ${fM(e.userName,e.userAvatar)}
3363
3370
  <div class="qs-personal-preview__copy">
3364
3371
  <div class="qs-personal-preview__title">${r}</div>
3365
3372
  <div class="muted">This browser only</div>
@@ -3398,7 +3405,7 @@ ${e}
3398
3405
  type="file"
3399
3406
  accept="image/*"
3400
3407
  hidden
3401
- @change=${t=>uM(t,e)}
3408
+ @change=${t=>pM(t,e)}
3402
3409
  />
3403
3410
  </label>
3404
3411
  <button
@@ -3412,11 +3419,11 @@ ${e}
3412
3419
  </div>
3413
3420
  </div>
3414
3421
  </div>
3415
- `}function yM(e){let t=e.configObject?iM(e.configObject):`personal`;return i`
3422
+ `}function SM(e){let t=e.configObject?sM(e.configObject):`personal`;return i`
3416
3423
  <div class="qs-card qs-card--span-all">
3417
- ${dM(J.zap,`Profile`)}
3424
+ ${mM(J.zap,`Profile`)}
3418
3425
  <div class="qs-card__body qs-presets-grid">
3419
- ${nM.map(n=>i`
3426
+ ${aM.map(n=>i`
3420
3427
  <button
3421
3428
  class="qs-preset ${n.id===t?`qs-preset--active`:``}"
3422
3429
  @click=${()=>e.onApplyPreset?.(n.id)}
@@ -3428,7 +3435,7 @@ ${e}
3428
3435
  `)}
3429
3436
  </div>
3430
3437
  </div>
3431
- `}function bM(e){return i`
3438
+ `}function CM(e){return i`
3432
3439
  <div class="qs-footer">
3433
3440
  <div class="qs-footer__row">
3434
3441
  <span class="qs-status-dot ${e.connected?`qs-status-dot--ok`:``}"></span>
@@ -3437,7 +3444,7 @@ ${e}
3437
3444
  ${e.version?i`<span class="muted">· v${e.version}</span>`:g}
3438
3445
  </div>
3439
3446
  </div>
3440
- `}function xM(...e){return i`<div class="qs-stack">${e}</div>`}function SM(e){return i`
3447
+ `}function wM(...e){return i`<div class="qs-stack">${e}</div>`}function TM(e){return i`
3441
3448
  <div class="qs-container">
3442
3449
  <div class="qs-header">
3443
3450
  <h2 class="qs-header__title">${J.settings} Settings</h2>
@@ -3447,15 +3454,15 @@ ${e}
3447
3454
  </div>
3448
3455
 
3449
3456
  <div class="qs-grid">
3450
- ${xM(fM(e),gM(e))}
3451
- ${xM(pM(e),hM(e))}
3452
- ${xM(mM(e),_M(e))}
3453
- ${xM(vM(e))} ${yM(e)}
3457
+ ${wM(hM(e),yM(e))}
3458
+ ${wM(gM(e),vM(e))}
3459
+ ${wM(_M(e),bM(e))}
3460
+ ${wM(xM(e))} ${SM(e)}
3454
3461
  </div>
3455
3462
 
3456
- ${bM(e)}
3463
+ ${CM(e)}
3457
3464
  </div>
3458
- `}var CM=new Set([`title`,`description`,`default`,`nullable`,`tags`,`x-tags`]);function wM(e){return Object.keys(e??{}).filter(e=>!CM.has(e)).length===0}function TM(e){if(e===void 0)return``;try{return JSON.stringify(e,null,2)??``}catch{return``}}function EM(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`?String(e):null}function DM(e,t){if(Object.is(e,t))return!0;let n=EM(e),r=EM(t);return n!==null&&n===r}var OM={chevronDown:i`
3465
+ `}var EM=new Set([`title`,`description`,`default`,`nullable`,`tags`,`x-tags`]);function DM(e){return Object.keys(e??{}).filter(e=>!EM.has(e)).length===0}function OM(e){if(e===void 0)return``;try{return JSON.stringify(e,null,2)??``}catch{return``}}function kM(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`?String(e):null}function AM(e,t){if(Object.is(e,t))return!0;let n=kM(e),r=kM(t);return n!==null&&n===r}var jM={chevronDown:i`
3459
3466
  <svg
3460
3467
  viewBox="0 0 24 24"
3461
3468
  fill="none"
@@ -3515,7 +3522,7 @@ ${e}
3515
3522
  <path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path>
3516
3523
  <path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path>
3517
3524
  </svg>
3518
- `};function kM(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return typeof t.source!=`string`||typeof t.id!=`string`?!1:t.provider===void 0||typeof t.provider==`string`}function AM(e){let t=Bn(e.value,e.path,e.hints),n=t&&(e.revealSensitive||(e.isSensitivePathRevealed?.(e.path)??!1));return{isSensitive:t,isRedacted:t&&!n,isRevealed:n,canReveal:t}}function jM(e){let{state:t}=e;return!t.isSensitive||!e.onToggleSensitivePath?g:i`
3525
+ `};function MM(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return typeof t.source!=`string`||typeof t.id!=`string`?!1:t.provider===void 0||typeof t.provider==`string`}function NM(e){let t=Bn(e.value,e.path,e.hints),n=t&&(e.revealSensitive||(e.isSensitivePathRevealed?.(e.path)??!1));return{isSensitive:t,isRedacted:t&&!n,isRevealed:n,canReveal:t}}function PM(e){let{state:t}=e;return!t.isSensitive||!e.onToggleSensitivePath?g:i`
3519
3526
  <button
3520
3527
  type="button"
3521
3528
  class="btn btn--icon ${t.isRevealed?`active`:``}"
@@ -3528,20 +3535,20 @@ ${e}
3528
3535
  >
3529
3536
  ${t.isRevealed?J.eye:J.eyeOff}
3530
3537
  </button>
3531
- `}function MM(e){return!!(e&&(e.text.length>0||e.tags.length>0))}function NM(e){let t=[],n=new Set;return{text:y(e.trim().replace(/(^|\s)tag:([^\s]+)/gi,(e,r,i)=>{let a=y(i);return a&&!n.has(a)&&(n.add(a),t.push(a)),r})),tags:t}}function PM(e){if(!Array.isArray(e))return[];let t=new Set,n=[];for(let r of e){if(typeof r!=`string`)continue;let e=r.trim();if(!e)continue;let i=y(e);t.has(i)||(t.add(i),n.push(e))}return n}function FM(e,t,n){let r=An(e,n),i=r?.label??t.title??jn(String(e.at(-1))),a=r?.help??t.description,o=PM(t[`x-tags`]??t.tags),s=PM(r?.tags);return{label:i,help:a,tags:s.length>0?s:o}}function IM(e,t){if(!e)return!0;for(let n of t)if(_(n)?.includes(e))return!0;return!1}function LM(e,t){if(e.length===0)return!0;let n=new Set(t.map(e=>y(e)));return e.every(e=>n.has(e))}function RM(e){let{schema:t,path:n,hints:r,criteria:i}=e;if(!MM(i))return!0;let{label:a,help:o,tags:s}=FM(n,t,r);if(!LM(i.tags,s))return!1;if(!i.text)return!0;let c=n.filter(e=>typeof e==`string`).join(`.`),l=t.enum&&t.enum.length>0?t.enum.map(e=>String(e)).join(` `):``;return IM(i.text,[a,o,t.title,t.description,c,l])}function zM(e){let{schema:t,value:n,path:r,hints:i,criteria:a}=e;if(!MM(a)||RM({schema:t,path:r,hints:i,criteria:a}))return!0;let o=Dn(t);if(o===`object`){let e=n??t.default,o=e&&typeof e==`object`&&!Array.isArray(e)?e:{},s=t.properties??{};for(let[e,t]of Object.entries(s))if(zM({schema:t,value:o[e],path:[...r,e],hints:i,criteria:a}))return!0;let c=t.additionalProperties;if(c&&typeof c==`object`){let e=new Set(Object.keys(s));for(let[t,n]of Object.entries(o))if(!e.has(t)&&zM({schema:c,value:n,path:[...r,t],hints:i,criteria:a}))return!0}return!1}if(o===`array`){let e=Array.isArray(t.items)?t.items[0]:t.items;if(!e)return!1;let o=Array.isArray(n)?n:Array.isArray(t.default)?t.default:[];if(o.length===0)return!1;for(let t=0;t<o.length;t+=1)if(zM({schema:e,value:o[t],path:[...r,t],hints:i,criteria:a}))return!0}return!1}function BM(e){return e.length===0?g:i`
3538
+ `}function FM(e){return!!(e&&(e.text.length>0||e.tags.length>0))}function IM(e){let t=[],n=new Set;return{text:y(e.trim().replace(/(^|\s)tag:([^\s]+)/gi,(e,r,i)=>{let a=y(i);return a&&!n.has(a)&&(n.add(a),t.push(a)),r})),tags:t}}function LM(e){if(!Array.isArray(e))return[];let t=new Set,n=[];for(let r of e){if(typeof r!=`string`)continue;let e=r.trim();if(!e)continue;let i=y(e);t.has(i)||(t.add(i),n.push(e))}return n}function RM(e,t,n){let r=An(e,n),i=r?.label??t.title??jn(String(e.at(-1))),a=r?.help??t.description,o=LM(t[`x-tags`]??t.tags),s=LM(r?.tags);return{label:i,help:a,tags:s.length>0?s:o}}function zM(e,t){if(!e)return!0;for(let n of t)if(_(n)?.includes(e))return!0;return!1}function BM(e,t){if(e.length===0)return!0;let n=new Set(t.map(e=>y(e)));return e.every(e=>n.has(e))}function VM(e){let{schema:t,path:n,hints:r,criteria:i}=e;if(!FM(i))return!0;let{label:a,help:o,tags:s}=RM(n,t,r);if(!BM(i.tags,s))return!1;if(!i.text)return!0;let c=n.filter(e=>typeof e==`string`).join(`.`),l=t.enum&&t.enum.length>0?t.enum.map(e=>String(e)).join(` `):``;return zM(i.text,[a,o,t.title,t.description,c,l])}function HM(e){let{schema:t,value:n,path:r,hints:i,criteria:a}=e;if(!FM(a)||VM({schema:t,path:r,hints:i,criteria:a}))return!0;let o=Dn(t);if(o===`object`){let e=n??t.default,o=e&&typeof e==`object`&&!Array.isArray(e)?e:{},s=t.properties??{};for(let[e,t]of Object.entries(s))if(HM({schema:t,value:o[e],path:[...r,e],hints:i,criteria:a}))return!0;let c=t.additionalProperties;if(c&&typeof c==`object`){let e=new Set(Object.keys(s));for(let[t,n]of Object.entries(o))if(!e.has(t)&&HM({schema:c,value:n,path:[...r,t],hints:i,criteria:a}))return!0}return!1}if(o===`array`){let e=Array.isArray(t.items)?t.items[0]:t.items;if(!e)return!1;let o=Array.isArray(n)?n:Array.isArray(t.default)?t.default:[];if(o.length===0)return!1;for(let t=0;t<o.length;t+=1)if(HM({schema:e,value:o[t],path:[...r,t],hints:i,criteria:a}))return!0}return!1}function UM(e){return e.length===0?g:i`
3532
3539
  <div class="cfg-tags">${e.map(e=>i`<span class="cfg-tag">${e}</span>`)}</div>
3533
- `}function VM(e){let{schema:t,value:n,path:r,hints:a,unsupported:o,disabled:s,onPatch:c}=e,l=e.showLabel??!0,u=Dn(t),{label:d,help:f,tags:p}=FM(r,t,a),m=kn(r),h=e.searchCriteria;if(o.has(m))return i`<div class="cfg-field cfg-field--error">
3540
+ `}function WM(e){let{schema:t,value:n,path:r,hints:a,unsupported:o,disabled:s,onPatch:c}=e,l=e.showLabel??!0,u=Dn(t),{label:d,help:f,tags:p}=RM(r,t,a),m=kn(r),h=e.searchCriteria;if(o.has(m))return i`<div class="cfg-field cfg-field--error">
3534
3541
  <div class="cfg-field__label">${d}</div>
3535
3542
  <div class="cfg-field__error">Unsupported schema node. Use Raw mode.</div>
3536
- </div>`;if(h&&MM(h)&&!zM({schema:t,value:n,path:r,hints:a,criteria:h}))return g;if(t.anyOf||t.oneOf){let o=(t.anyOf??t.oneOf??[]).filter(e=>!(e.type===`null`||Array.isArray(e.type)&&e.type.includes(`null`)));if(o.length===1)return VM({...e,schema:o[0]});let u=o.map(e=>{if(e.const!==void 0)return e.const;if(e.enum&&e.enum.length===1)return e.enum[0]}),m=u.every(e=>e!==void 0);if(m&&u.length>0&&u.length<=5){let e=n??t.default;return i`
3543
+ </div>`;if(h&&FM(h)&&!HM({schema:t,value:n,path:r,hints:a,criteria:h}))return g;if(t.anyOf||t.oneOf){let o=(t.anyOf??t.oneOf??[]).filter(e=>!(e.type===`null`||Array.isArray(e.type)&&e.type.includes(`null`)));if(o.length===1)return WM({...e,schema:o[0]});let u=o.map(e=>{if(e.const!==void 0)return e.const;if(e.enum&&e.enum.length===1)return e.enum[0]}),m=u.every(e=>e!==void 0);if(m&&u.length>0&&u.length<=5){let e=n??t.default;return i`
3537
3544
  <div class="cfg-field">
3538
3545
  ${l?i`<label class="cfg-field__label">${d}</label>`:g}
3539
- ${f?i`<div class="cfg-field__help">${f}</div>`:g} ${BM(p)}
3546
+ ${f?i`<div class="cfg-field__help">${f}</div>`:g} ${UM(p)}
3540
3547
  <div class="cfg-segmented">
3541
3548
  ${u.map(t=>i`
3542
3549
  <button
3543
3550
  type="button"
3544
- class="cfg-segmented__btn ${DM(t,e)?`active`:``}"
3551
+ class="cfg-segmented__btn ${AM(t,e)?`active`:``}"
3545
3552
  ?disabled=${s}
3546
3553
  @click=${()=>c(r,t)}
3547
3554
  >
@@ -3550,15 +3557,15 @@ ${e}
3550
3557
  `)}
3551
3558
  </div>
3552
3559
  </div>
3553
- `}if(m&&u.length>5)return WM({...e,options:u,value:n??t.default});let h=new Set(o.map(e=>Dn(e)).filter(Boolean)),_=new Set([...h].map(e=>e===`integer`?`number`:e));if([..._].every(e=>[`string`,`number`,`boolean`].includes(e))){let n=_.has(`string`),r=_.has(`number`);if(_.has(`boolean`)&&_.size===1)return VM({...e,schema:{...t,type:`boolean`,anyOf:void 0,oneOf:void 0}});if(n||r)return HM({...e,inputType:r&&!n?`number`:`text`})}return GM({schema:t,value:n,path:r,hints:a,disabled:s,showLabel:l,revealSensitive:e.revealSensitive??!1,isSensitivePathRevealed:e.isSensitivePathRevealed,onToggleSensitivePath:e.onToggleSensitivePath,onPatch:c})}if(t.enum){let a=t.enum;if(a.length<=5){let e=n??t.default;return i`
3560
+ `}if(m&&u.length>5)return qM({...e,options:u,value:n??t.default});let h=new Set(o.map(e=>Dn(e)).filter(Boolean)),_=new Set([...h].map(e=>e===`integer`?`number`:e));if([..._].every(e=>[`string`,`number`,`boolean`].includes(e))){let n=_.has(`string`),r=_.has(`number`);if(_.has(`boolean`)&&_.size===1)return WM({...e,schema:{...t,type:`boolean`,anyOf:void 0,oneOf:void 0}});if(n||r)return GM({...e,inputType:r&&!n?`number`:`text`})}return JM({schema:t,value:n,path:r,hints:a,disabled:s,showLabel:l,revealSensitive:e.revealSensitive??!1,isSensitivePathRevealed:e.isSensitivePathRevealed,onToggleSensitivePath:e.onToggleSensitivePath,onPatch:c})}if(t.enum){let a=t.enum;if(a.length<=5){let e=n??t.default;return i`
3554
3561
  <div class="cfg-field">
3555
3562
  ${l?i`<label class="cfg-field__label">${d}</label>`:g}
3556
- ${f?i`<div class="cfg-field__help">${f}</div>`:g} ${BM(p)}
3563
+ ${f?i`<div class="cfg-field__help">${f}</div>`:g} ${UM(p)}
3557
3564
  <div class="cfg-segmented">
3558
3565
  ${a.map(t=>i`
3559
3566
  <button
3560
3567
  type="button"
3561
- class="cfg-segmented__btn ${DM(t,e)?`active`:``}"
3568
+ class="cfg-segmented__btn ${AM(t,e)?`active`:``}"
3562
3569
  ?disabled=${s}
3563
3570
  @click=${()=>c(r,t)}
3564
3571
  >
@@ -3567,12 +3574,12 @@ ${e}
3567
3574
  `)}
3568
3575
  </div>
3569
3576
  </div>
3570
- `}return WM({...e,options:a,value:n??t.default})}if(u===`object`)return KM(e);if(u===`array`)return qM(e);if(u===`boolean`){let e=typeof n==`boolean`?n:typeof t.default==`boolean`?t.default:!1;return i`
3577
+ `}return qM({...e,options:a,value:n??t.default})}if(u===`object`)return YM(e);if(u===`array`)return XM(e);if(u===`boolean`){let e=typeof n==`boolean`?n:typeof t.default==`boolean`?t.default:!1;return i`
3571
3578
  <label class="cfg-toggle-row ${s?`disabled`:``}">
3572
3579
  <div class="cfg-toggle-row__content">
3573
3580
  <span class="cfg-toggle-row__label">${d}</span>
3574
3581
  ${f?i`<span class="cfg-toggle-row__help">${f}</span>`:g}
3575
- ${BM(p)}
3582
+ ${UM(p)}
3576
3583
  </div>
3577
3584
  <div class="cfg-toggle">
3578
3585
  <input
@@ -3584,15 +3591,15 @@ ${e}
3584
3591
  <span class="cfg-toggle__track"></span>
3585
3592
  </div>
3586
3593
  </label>
3587
- `}return u===`number`||u===`integer`?UM(e):u===`string`?HM({...e,inputType:`text`}):i`
3594
+ `}return u===`number`||u===`integer`?KM(e):u===`string`?GM({...e,inputType:`text`}):i`
3588
3595
  <div class="cfg-field cfg-field--error">
3589
3596
  <div class="cfg-field__label">${d}</div>
3590
3597
  <div class="cfg-field__error">Unsupported type: ${u}. Use Raw mode.</div>
3591
3598
  </div>
3592
- `}function HM(e){let{schema:t,value:n,path:r,hints:a,disabled:o,onPatch:s,inputType:c}=e,l=e.showLabel??!0,u=An(r,a),{label:d,help:f,tags:p}=FM(r,t,a),m=AM({path:r,value:n,hints:a,revealSensitive:e.revealSensitive??!1,isSensitivePathRevealed:e.isSensitivePathRevealed}),h=typeof n==`object`&&!!n&&!Array.isArray(n),_=kM(n),v=e.rawAvailable??!0,y=m.isRedacted||_,b=y?_?v?`Structured value (SecretRef) - use Raw mode to edit`:`Structured value (SecretRef) - edit the config file directly`:Fn:u?.placeholder??(t.default===void 0?``:`Default: ${w(t.default)}`),x=y?``:h?TM(n):n??``,S=m.isSensitive&&!y?`text`:c;return i`
3599
+ `}function GM(e){let{schema:t,value:n,path:r,hints:a,disabled:o,onPatch:s,inputType:c}=e,l=e.showLabel??!0,u=An(r,a),{label:d,help:f,tags:p}=RM(r,t,a),m=NM({path:r,value:n,hints:a,revealSensitive:e.revealSensitive??!1,isSensitivePathRevealed:e.isSensitivePathRevealed}),h=typeof n==`object`&&!!n&&!Array.isArray(n),_=MM(n),v=e.rawAvailable??!0,y=m.isRedacted||_,b=y?_?v?`Structured value (SecretRef) - use Raw mode to edit`:`Structured value (SecretRef) - edit the config file directly`:Fn:u?.placeholder??(t.default===void 0?``:`Default: ${w(t.default)}`),x=y?``:h?OM(n):n??``,S=m.isSensitive&&!y?`text`:c;return i`
3593
3600
  <div class="cfg-field">
3594
3601
  ${l?i`<label class="cfg-field__label">${d}</label>`:g}
3595
- ${f?i`<div class="cfg-field__help">${f}</div>`:g} ${BM(p)}
3602
+ ${f?i`<div class="cfg-field__help">${f}</div>`:g} ${UM(p)}
3596
3603
  <div class="cfg-input-wrap">
3597
3604
  <input
3598
3605
  type=${S}
@@ -3605,7 +3612,7 @@ ${e}
3605
3612
  @input=${e=>{if(y)return;let t=e.target.value;if(c===`number`){if(t.trim()===``){s(r,void 0);return}let e=Number(t);s(r,Number.isNaN(e)?t:e);return}s(r,t)}}
3606
3613
  @change=${e=>{if(c===`number`||y)return;let t=e.target.value;s(r,t.trim())}}
3607
3614
  />
3608
- ${_?g:jM({path:r,state:m,disabled:o,onToggleSensitivePath:e.onToggleSensitivePath})}
3615
+ ${_?g:PM({path:r,state:m,disabled:o,onToggleSensitivePath:e.onToggleSensitivePath})}
3609
3616
  ${t.default===void 0?g:i`
3610
3617
  <button
3611
3618
  type="button"
@@ -3619,10 +3626,10 @@ ${e}
3619
3626
  `}
3620
3627
  </div>
3621
3628
  </div>
3622
- `}function UM(e){let{schema:t,value:n,path:r,hints:a,disabled:o,onPatch:s}=e,c=e.showLabel??!0,{label:l,help:u,tags:d}=FM(r,t,a),f=n??t.default??``,p=typeof f==`number`?f:0;return i`
3629
+ `}function KM(e){let{schema:t,value:n,path:r,hints:a,disabled:o,onPatch:s}=e,c=e.showLabel??!0,{label:l,help:u,tags:d}=RM(r,t,a),f=n??t.default??``,p=typeof f==`number`?f:0;return i`
3623
3630
  <div class="cfg-field">
3624
3631
  ${c?i`<label class="cfg-field__label">${l}</label>`:g}
3625
- ${u?i`<div class="cfg-field__help">${u}</div>`:g} ${BM(d)}
3632
+ ${u?i`<div class="cfg-field__help">${u}</div>`:g} ${UM(d)}
3626
3633
  <div class="cfg-number">
3627
3634
  <button
3628
3635
  type="button"
@@ -3649,10 +3656,10 @@ ${e}
3649
3656
  </button>
3650
3657
  </div>
3651
3658
  </div>
3652
- `}function WM(e){let{schema:t,value:n,path:r,hints:a,disabled:o,options:s,onPatch:c}=e,l=e.showLabel??!0,{label:u,help:d,tags:f}=FM(r,t,a),p=n??t.default,m=s.findIndex(e=>e===p||String(e)===String(p)),h=`__unset__`;return i`
3659
+ `}function qM(e){let{schema:t,value:n,path:r,hints:a,disabled:o,options:s,onPatch:c}=e,l=e.showLabel??!0,{label:u,help:d,tags:f}=RM(r,t,a),p=n??t.default,m=s.findIndex(e=>e===p||String(e)===String(p)),h=`__unset__`;return i`
3653
3660
  <div class="cfg-field">
3654
3661
  ${l?i`<label class="cfg-field__label">${u}</label>`:g}
3655
- ${d?i`<div class="cfg-field__help">${d}</div>`:g} ${BM(f)}
3662
+ ${d?i`<div class="cfg-field__help">${d}</div>`:g} ${UM(f)}
3656
3663
  <select
3657
3664
  class="cfg-select"
3658
3665
  ?disabled=${o}
@@ -3663,10 +3670,10 @@ ${e}
3663
3670
  ${s.map((e,t)=>i` <option value=${String(t)}>${String(e)}</option> `)}
3664
3671
  </select>
3665
3672
  </div>
3666
- `}function GM(e){let{schema:t,value:n,path:r,hints:a,disabled:o,onPatch:s}=e,c=e.showLabel??!0,{label:l,help:u,tags:d}=FM(r,t,a),f=TM(n),p=AM({path:r,value:n,hints:a,revealSensitive:e.revealSensitive??!1,isSensitivePathRevealed:e.isSensitivePathRevealed}),m=p.isRedacted?``:f;return i`
3673
+ `}function JM(e){let{schema:t,value:n,path:r,hints:a,disabled:o,onPatch:s}=e,c=e.showLabel??!0,{label:l,help:u,tags:d}=RM(r,t,a),f=OM(n),p=NM({path:r,value:n,hints:a,revealSensitive:e.revealSensitive??!1,isSensitivePathRevealed:e.isSensitivePathRevealed}),m=p.isRedacted?``:f;return i`
3667
3674
  <div class="cfg-field">
3668
3675
  ${c?i`<label class="cfg-field__label">${l}</label>`:g}
3669
- ${u?i`<div class="cfg-field__help">${u}</div>`:g} ${BM(d)}
3676
+ ${u?i`<div class="cfg-field__help">${u}</div>`:g} ${UM(d)}
3670
3677
  <div class="cfg-input-wrap">
3671
3678
  <textarea
3672
3679
  class="cfg-textarea${p.isRedacted?` cfg-textarea--redacted`:``}"
@@ -3678,25 +3685,25 @@ ${e}
3678
3685
  @click=${()=>{p.isRedacted&&e.onToggleSensitivePath&&e.onToggleSensitivePath(r)}}
3679
3686
  @change=${e=>{if(p.isRedacted)return;let t=e.target,n=t.value.trim();if(!n){s(r,void 0);return}try{s(r,JSON.parse(n))}catch{t.value=f}}}
3680
3687
  ></textarea>
3681
- ${jM({path:r,state:p,disabled:o,onToggleSensitivePath:e.onToggleSensitivePath})}
3688
+ ${PM({path:r,state:p,disabled:o,onToggleSensitivePath:e.onToggleSensitivePath})}
3682
3689
  </div>
3683
3690
  </div>
3684
- `}function KM(e){let{schema:t,value:n,path:r,hints:a,unsupported:o,disabled:s,onPatch:c,searchCriteria:l,rawAvailable:u,revealSensitive:d,isSensitivePathRevealed:f,onToggleSensitivePath:p}=e,m=e.showLabel??!0,{label:h,help:_,tags:v}=FM(r,t,a),y=l&&MM(l)&&RM({schema:t,path:r,hints:a,criteria:l})?void 0:l,b=n??t.default,x=b&&typeof b==`object`&&!Array.isArray(b)?b:{},S=t.properties??{},ee=Xa(Object.entries(S),(e,t)=>{let n=An([...r,e[0]],a)?.order??0,i=An([...r,t[0]],a)?.order??0;return n===i?e[0].localeCompare(t[0]):n-i}),C=new Set(Object.keys(S)),te=t.additionalProperties,ne=!!te&&typeof te==`object`,w=i`
3685
- ${ee.map(([e,t])=>VM({schema:t,value:x[e],path:[...r,e],hints:a,rawAvailable:u,unsupported:o,disabled:s,searchCriteria:y,revealSensitive:d,isSensitivePathRevealed:f,onToggleSensitivePath:p,onPatch:c}))}
3686
- ${ne?JM({schema:te,value:x,path:r,hints:a,rawAvailable:u,unsupported:o,disabled:s,reservedKeys:C,searchCriteria:y,revealSensitive:d,isSensitivePathRevealed:f,onToggleSensitivePath:p,onPatch:c}):g}
3691
+ `}function YM(e){let{schema:t,value:n,path:r,hints:a,unsupported:o,disabled:s,onPatch:c,searchCriteria:l,rawAvailable:u,revealSensitive:d,isSensitivePathRevealed:f,onToggleSensitivePath:p}=e,m=e.showLabel??!0,{label:h,help:_,tags:v}=RM(r,t,a),y=l&&FM(l)&&VM({schema:t,path:r,hints:a,criteria:l})?void 0:l,b=n??t.default,x=b&&typeof b==`object`&&!Array.isArray(b)?b:{},S=t.properties??{},ee=Xa(Object.entries(S),(e,t)=>{let n=An([...r,e[0]],a)?.order??0,i=An([...r,t[0]],a)?.order??0;return n===i?e[0].localeCompare(t[0]):n-i}),C=new Set(Object.keys(S)),te=t.additionalProperties,ne=!!te&&typeof te==`object`,w=i`
3692
+ ${ee.map(([e,t])=>WM({schema:t,value:x[e],path:[...r,e],hints:a,rawAvailable:u,unsupported:o,disabled:s,searchCriteria:y,revealSensitive:d,isSensitivePathRevealed:f,onToggleSensitivePath:p,onPatch:c}))}
3693
+ ${ne?ZM({schema:te,value:x,path:r,hints:a,rawAvailable:u,unsupported:o,disabled:s,reservedKeys:C,searchCriteria:y,revealSensitive:d,isSensitivePathRevealed:f,onToggleSensitivePath:p,onPatch:c}):g}
3687
3694
  `;return r.length===1?i` <div class="cfg-fields">${w}</div> `:m?i`
3688
3695
  <details class="cfg-object" ?open=${r.length<=2}>
3689
3696
  <summary class="cfg-object__header">
3690
3697
  <span class="cfg-object__title-wrap">
3691
3698
  <span class="cfg-object__title">${h}</span>
3692
- ${BM(v)}
3699
+ ${UM(v)}
3693
3700
  </span>
3694
- <span class="cfg-object__chevron">${OM.chevronDown}</span>
3701
+ <span class="cfg-object__chevron">${jM.chevronDown}</span>
3695
3702
  </summary>
3696
3703
  ${_?i`<div class="cfg-object__help">${_}</div>`:g}
3697
3704
  <div class="cfg-object__content">${w}</div>
3698
3705
  </details>
3699
- `:i` <div class="cfg-fields cfg-fields--inline">${w}</div> `}function qM(e){let{schema:t,value:n,path:r,hints:a,unsupported:o,disabled:s,onPatch:c,searchCriteria:l,rawAvailable:u,revealSensitive:d,isSensitivePathRevealed:f,onToggleSensitivePath:p}=e,m=e.showLabel??!0,{label:h,help:_,tags:v}=FM(r,t,a),y=l&&MM(l)&&RM({schema:t,path:r,hints:a,criteria:l})?void 0:l,b=Array.isArray(t.items)?t.items[0]:t.items;if(!b)return i`
3706
+ `:i` <div class="cfg-fields cfg-fields--inline">${w}</div> `}function XM(e){let{schema:t,value:n,path:r,hints:a,unsupported:o,disabled:s,onPatch:c,searchCriteria:l,rawAvailable:u,revealSensitive:d,isSensitivePathRevealed:f,onToggleSensitivePath:p}=e,m=e.showLabel??!0,{label:h,help:_,tags:v}=RM(r,t,a),y=l&&FM(l)&&VM({schema:t,path:r,hints:a,criteria:l})?void 0:l,b=Array.isArray(t.items)?t.items[0]:t.items;if(!b)return i`
3700
3707
  <div class="cfg-field cfg-field--error">
3701
3708
  <div class="cfg-field__label">${h}</div>
3702
3709
  <div class="cfg-field__error">Unsupported array schema. Use Raw mode.</div>
@@ -3706,7 +3713,7 @@ ${e}
3706
3713
  <div class="cfg-array__header">
3707
3714
  <div class="cfg-array__title">
3708
3715
  ${m?i`<span class="cfg-array__label">${h}</span>`:g}
3709
- ${BM(v)}
3716
+ ${UM(v)}
3710
3717
  </div>
3711
3718
  <span class="cfg-array__count">${x.length} item${x.length===1?``:`s`}</span>
3712
3719
  <button
@@ -3715,7 +3722,7 @@ ${e}
3715
3722
  ?disabled=${s}
3716
3723
  @click=${()=>{c(r,[...x,On(b)])}}
3717
3724
  >
3718
- <span class="cfg-array__add-icon">${OM.plus}</span>
3725
+ <span class="cfg-array__add-icon">${jM.plus}</span>
3719
3726
  Add
3720
3727
  </button>
3721
3728
  </div>
@@ -3733,18 +3740,18 @@ ${e}
3733
3740
  ?disabled=${s}
3734
3741
  @click=${()=>{let e=[...x];e.splice(t,1),c(r,e)}}
3735
3742
  >
3736
- ${OM.trash}
3743
+ ${jM.trash}
3737
3744
  </button>
3738
3745
  </div>
3739
3746
  <div class="cfg-array__item-content">
3740
- ${VM({schema:b,value:e,path:[...r,t],hints:a,rawAvailable:u,unsupported:o,disabled:s,searchCriteria:y,showLabel:!1,revealSensitive:d,isSensitivePathRevealed:f,onToggleSensitivePath:p,onPatch:c})}
3747
+ ${WM({schema:b,value:e,path:[...r,t],hints:a,rawAvailable:u,unsupported:o,disabled:s,searchCriteria:y,showLabel:!1,revealSensitive:d,isSensitivePathRevealed:f,onToggleSensitivePath:p,onPatch:c})}
3741
3748
  </div>
3742
3749
  </div>
3743
3750
  `)}
3744
3751
  </div>
3745
3752
  `}
3746
3753
  </div>
3747
- `}function JM(e){let{schema:t,value:n,path:r,hints:a,rawAvailable:o,unsupported:s,disabled:c,reservedKeys:l,onPatch:u,searchCriteria:d,revealSensitive:f,isSensitivePathRevealed:p,onToggleSensitivePath:m}=e,h=wM(t),g=Object.entries(n??{}).filter(([e])=>!l.has(e)),_=d&&MM(d)?g.filter(([e,n])=>zM({schema:t,value:n,path:[...r,e],hints:a,criteria:d})):g;return i`
3754
+ `}function ZM(e){let{schema:t,value:n,path:r,hints:a,rawAvailable:o,unsupported:s,disabled:c,reservedKeys:l,onPatch:u,searchCriteria:d,revealSensitive:f,isSensitivePathRevealed:p,onToggleSensitivePath:m}=e,h=DM(t),g=Object.entries(n??{}).filter(([e])=>!l.has(e)),_=d&&FM(d)?g.filter(([e,n])=>HM({schema:t,value:n,path:[...r,e],hints:a,criteria:d})):g;return i`
3748
3755
  <div class="cfg-map">
3749
3756
  <div class="cfg-map__header">
3750
3757
  <span class="cfg-map__label">Custom entries</span>
@@ -3754,14 +3761,14 @@ ${e}
3754
3761
  ?disabled=${c}
3755
3762
  @click=${()=>{let e={...n},i=1,a=`custom-${i}`;for(;a in e;)i+=1,a=`custom-${i}`;e[a]=h?{}:On(t),u(r,e)}}
3756
3763
  >
3757
- <span class="cfg-map__add-icon">${OM.plus}</span>
3764
+ <span class="cfg-map__add-icon">${jM.plus}</span>
3758
3765
  Add Entry
3759
3766
  </button>
3760
3767
  </div>
3761
3768
 
3762
3769
  ${_.length===0?i` <div class="cfg-map__empty">No custom entries.</div> `:i`
3763
3770
  <div class="cfg-map__items">
3764
- ${_.map(([e,l])=>{let g=[...r,e],_=TM(l),v=AM({path:g,value:l,hints:a,revealSensitive:f??!1,isSensitivePathRevealed:p});return i`
3771
+ ${_.map(([e,l])=>{let g=[...r,e],_=OM(l),v=NM({path:g,value:l,hints:a,revealSensitive:f??!1,isSensitivePathRevealed:p});return i`
3765
3772
  <div class="cfg-map__item">
3766
3773
  <div class="cfg-map__item-header">
3767
3774
  <div class="cfg-map__item-key">
@@ -3781,7 +3788,7 @@ ${e}
3781
3788
  ?disabled=${c}
3782
3789
  @click=${()=>{let t={...n};delete t[e],u(r,t)}}
3783
3790
  >
3784
- ${OM.trash}
3791
+ ${jM.trash}
3785
3792
  </button>
3786
3793
  </div>
3787
3794
  <div class="cfg-map__item-value">
@@ -3797,16 +3804,16 @@ ${e}
3797
3804
  @click=${()=>{v.isRedacted&&m&&m(g)}}
3798
3805
  @change=${e=>{if(v.isRedacted)return;let t=e.target,n=t.value.trim();if(!n){u(g,void 0);return}try{u(g,JSON.parse(n))}catch{t.value=_}}}
3799
3806
  ></textarea>
3800
- ${jM({path:g,state:v,disabled:c,onToggleSensitivePath:m})}
3807
+ ${PM({path:g,state:v,disabled:c,onToggleSensitivePath:m})}
3801
3808
  </div>
3802
- `:VM({schema:t,value:l,path:g,hints:a,rawAvailable:o,unsupported:s,disabled:c,searchCriteria:d,showLabel:!1,revealSensitive:f,isSensitivePathRevealed:p,onToggleSensitivePath:m,onPatch:u})}
3809
+ `:WM({schema:t,value:l,path:g,hints:a,rawAvailable:o,unsupported:s,disabled:c,searchCriteria:d,showLabel:!1,revealSensitive:f,isSensitivePathRevealed:p,onToggleSensitivePath:m,onPatch:u})}
3803
3810
  </div>
3804
3811
  </div>
3805
3812
  `})}
3806
3813
  </div>
3807
3814
  `}
3808
3815
  </div>
3809
- `}var YM={env:i`
3816
+ `}var QM={env:i`
3810
3817
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
3811
3818
  <circle cx="12" cy="12" r="3"></circle>
3812
3819
  <path
@@ -4022,7 +4029,7 @@ ${e}
4022
4029
  <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
4023
4030
  <polyline points="14 2 14 8 20 8"></polyline>
4024
4031
  </svg>
4025
- `},XM={env:{label:`Environment Variables`,description:`Environment variables passed to the gateway process`},update:{label:`Updates`,description:`Auto-update settings and release channel`},agents:{label:`Agents`,description:`Agent configurations, models, and identities`},auth:{label:`Authentication`,description:`API keys and authentication profiles`},channels:{label:`Channels`,description:`Messaging channels (Telegram, Discord, Slack, etc.)`},messages:{label:`Messages`,description:`Message handling and routing settings`},commands:{label:`Commands`,description:`Custom slash commands`},hooks:{label:`Hooks`,description:`Webhooks and event hooks`},skills:{label:`Skills`,description:`Skill packs and capabilities`},tools:{label:`Tools`,description:`Tool configurations (browser, search, etc.)`},gateway:{label:`Gateway`,description:`Gateway server settings (port, auth, binding)`},wizard:{label:`Setup Wizard`,description:`Setup wizard state and history`},meta:{label:`Metadata`,description:`Gateway metadata and version information`},logging:{label:`Logging`,description:`Log levels and output configuration`},browser:{label:`Browser`,description:`Browser automation settings`},ui:{label:`UI`,description:`User interface preferences`},models:{label:`Models`,description:`AI model configurations and providers`},bindings:{label:`Bindings`,description:`Key bindings and shortcuts`},broadcast:{label:`Broadcast`,description:`Broadcast and notification settings`},audio:{label:`Audio`,description:`Audio input/output settings`},session:{label:`Session`,description:`Session management and persistence`},cron:{label:`Cron`,description:`Scheduled tasks and automation`},web:{label:`Web`,description:`Web server and API settings`},discovery:{label:`Discovery`,description:`Service discovery and networking`},canvasHost:{label:`Canvas Host`,description:`Canvas rendering and display`},talk:{label:`Talk`,description:`Voice and speech settings`},plugins:{label:`Plugins`,description:`Plugin management and extensions`},diagnostics:{label:`Diagnostics`,description:`Instrumentation, OpenTelemetry, and cache-trace settings`},cli:{label:`CLI`,description:`CLI banner and startup behavior`},secrets:{label:`Secrets`,description:`Secret provider configuration`},acp:{label:`ACP`,description:`Agent Communication Protocol runtime and streaming settings`},mcp:{label:`MCP`,description:`Model Context Protocol server definitions`}};function ZM(e){return YM[e]??YM.default}function QM(e){if(!e.query)return!0;let t=NM(e.query),n=t.text,r=XM[e.key];return n&&(y(e.key).includes(n)||r?.label&&y(r.label).includes(n)||r?.description&&y(r.description).includes(n))&&t.tags.length===0?!0:zM({schema:e.schema,value:e.sectionValue,path:[e.key],hints:e.uiHints,criteria:t})}function $M(e){if(!e.schema)return i` <div class="muted">Schema unavailable.</div> `;let t=e.schema,n=e.value??{};if(Dn(t)!==`object`||!t.properties)return i` <div class="callout danger">Unsupported schema. Use Raw.</div> `;let r=new Set(e.unsupportedPaths??[]),a=t.properties,o=e.searchQuery??``,s=NM(o),c=e.activeSection,l=e.activeSubsection??null,u=Xa(Object.entries(a),(t,n)=>{let r=An([t[0]],e.uiHints)?.order??50,i=An([n[0]],e.uiHints)?.order??50;return r===i?t[0].localeCompare(n[0]):r-i}).filter(([t,r])=>!(c&&t!==c||o&&!QM({key:t,schema:r,sectionValue:n[t],uiHints:e.uiHints,query:o}))),d=null;if(c&&l&&u.length===1){let e=u[0]?.[1];e&&Dn(e)===`object`&&e.properties&&e.properties[l]&&(d={sectionKey:c,subsectionKey:l,schema:e.properties[l]})}if(u.length===0)return i`
4032
+ `},$M={env:{label:`Environment Variables`,description:`Environment variables passed to the gateway process`},update:{label:`Updates`,description:`Auto-update settings and release channel`},agents:{label:`Agents`,description:`Agent configurations, models, and identities`},auth:{label:`Authentication`,description:`API keys and authentication profiles`},channels:{label:`Channels`,description:`Messaging channels (Telegram, Discord, Slack, etc.)`},messages:{label:`Messages`,description:`Message handling and routing settings`},commands:{label:`Commands`,description:`Custom slash commands`},hooks:{label:`Hooks`,description:`Webhooks and event hooks`},skills:{label:`Skills`,description:`Skill packs and capabilities`},tools:{label:`Tools`,description:`Tool configurations (browser, search, etc.)`},gateway:{label:`Gateway`,description:`Gateway server settings (port, auth, binding)`},wizard:{label:`Setup Wizard`,description:`Setup wizard state and history`},meta:{label:`Metadata`,description:`Gateway metadata and version information`},logging:{label:`Logging`,description:`Log levels and output configuration`},browser:{label:`Browser`,description:`Browser automation settings`},ui:{label:`UI`,description:`User interface preferences`},models:{label:`Models`,description:`AI model configurations and providers`},bindings:{label:`Bindings`,description:`Key bindings and shortcuts`},broadcast:{label:`Broadcast`,description:`Broadcast and notification settings`},audio:{label:`Audio`,description:`Audio input/output settings`},session:{label:`Session`,description:`Session management and persistence`},cron:{label:`Cron`,description:`Scheduled tasks and automation`},web:{label:`Web`,description:`Web server and API settings`},discovery:{label:`Discovery`,description:`Service discovery and networking`},canvasHost:{label:`Canvas Host`,description:`Canvas rendering and display`},talk:{label:`Talk`,description:`Voice and speech settings`},plugins:{label:`Plugins`,description:`Plugin management and extensions`},diagnostics:{label:`Diagnostics`,description:`Instrumentation, OpenTelemetry, and cache-trace settings`},cli:{label:`CLI`,description:`CLI banner and startup behavior`},secrets:{label:`Secrets`,description:`Secret provider configuration`},acp:{label:`ACP`,description:`Agent Communication Protocol runtime and streaming settings`},mcp:{label:`MCP`,description:`Model Context Protocol server definitions`}};function eN(e){return QM[e]??QM.default}function tN(e){if(!e.query)return!0;let t=IM(e.query),n=t.text,r=$M[e.key];return n&&(y(e.key).includes(n)||r?.label&&y(r.label).includes(n)||r?.description&&y(r.description).includes(n))&&t.tags.length===0?!0:HM({schema:e.schema,value:e.sectionValue,path:[e.key],hints:e.uiHints,criteria:t})}function nN(e){if(!e.schema)return i` <div class="muted">Schema unavailable.</div> `;let t=e.schema,n=e.value??{};if(Dn(t)!==`object`||!t.properties)return i` <div class="callout danger">Unsupported schema. Use Raw.</div> `;let r=new Set(e.unsupportedPaths??[]),a=t.properties,o=e.searchQuery??``,s=IM(o),c=e.activeSection,l=e.activeSubsection??null,u=Xa(Object.entries(a),(t,n)=>{let r=An([t[0]],e.uiHints)?.order??50,i=An([n[0]],e.uiHints)?.order??50;return r===i?t[0].localeCompare(n[0]):r-i}).filter(([t,r])=>!(c&&t!==c||o&&!tN({key:t,schema:r,sectionValue:n[t],uiHints:e.uiHints,query:o}))),d=null;if(c&&l&&u.length===1){let e=u[0]?.[1];e&&Dn(e)===`object`&&e.properties&&e.properties[l]&&(d={sectionKey:c,subsectionKey:l,schema:e.properties[l]})}if(u.length===0)return i`
4026
4033
  <div class="config-empty">
4027
4034
  <div class="config-empty__icon">${J.search}</div>
4028
4035
  <div class="config-empty__text">
@@ -4032,21 +4039,21 @@ ${e}
4032
4039
  `;let f=t=>i`
4033
4040
  <section class="config-section-card" id=${t.id}>
4034
4041
  <div class="config-section-card__header">
4035
- <span class="config-section-card__icon">${ZM(t.sectionKey)}</span>
4042
+ <span class="config-section-card__icon">${eN(t.sectionKey)}</span>
4036
4043
  <div class="config-section-card__titles">
4037
4044
  <h3 class="config-section-card__title">${t.label}</h3>
4038
4045
  ${t.description?i`<p class="config-section-card__desc">${t.description}</p>`:g}
4039
4046
  </div>
4040
4047
  </div>
4041
4048
  <div class="config-section-card__content">
4042
- ${VM({schema:t.node,value:t.nodeValue,path:t.path,hints:e.uiHints,rawAvailable:e.rawAvailable??!0,unsupported:r,disabled:e.disabled??!1,showLabel:!1,searchCriteria:s,revealSensitive:e.revealSensitive??!1,isSensitivePathRevealed:e.isSensitivePathRevealed,onToggleSensitivePath:e.onToggleSensitivePath,onPatch:e.onPatch})}
4049
+ ${WM({schema:t.node,value:t.nodeValue,path:t.path,hints:e.uiHints,rawAvailable:e.rawAvailable??!0,unsupported:r,disabled:e.disabled??!1,showLabel:!1,searchCriteria:s,revealSensitive:e.revealSensitive??!1,isSensitivePathRevealed:e.isSensitivePathRevealed,onToggleSensitivePath:e.onToggleSensitivePath,onPatch:e.onPatch})}
4043
4050
  </div>
4044
4051
  </section>
4045
4052
  `;return i`
4046
4053
  <div class="config-form config-form--modern">
4047
- ${d?(()=>{let{sectionKey:t,subsectionKey:r,schema:i}=d,a=An([t,r],e.uiHints),o=a?.label??i.title??jn(r),s=a?.help??i.description??``,c=n[t],l=c&&typeof c==`object`?c[r]:void 0;return f({id:`config-section-${t}-${r}`,sectionKey:t,label:o,description:s,node:i,nodeValue:l,path:[t,r]})})():u.map(([e,t])=>{let r=XM[e]??{label:e.charAt(0).toUpperCase()+e.slice(1),description:t.description??``};return f({id:`config-section-${e}`,sectionKey:e,label:r.label,description:r.description,node:t,nodeValue:n[e],path:[e]})})}
4054
+ ${d?(()=>{let{sectionKey:t,subsectionKey:r,schema:i}=d,a=An([t,r],e.uiHints),o=a?.label??i.title??jn(r),s=a?.help??i.description??``,c=n[t],l=c&&typeof c==`object`?c[r]:void 0;return f({id:`config-section-${t}-${r}`,sectionKey:t,label:o,description:s,node:i,nodeValue:l,path:[t,r]})})():u.map(([e,t])=>{let r=$M[e]??{label:e.charAt(0).toUpperCase()+e.slice(1),description:t.description??``};return f({id:`config-section-${e}`,sectionKey:e,label:r.label,description:r.description,node:t,nodeValue:n[e],path:[e]})})}
4048
4055
  </div>
4049
- `}var eN=new Set([`title`,`description`,`default`,`nullable`]);function tN(e){return Object.keys(e??{}).filter(e=>!eN.has(e)).length===0}function nN(e){let t=e.filter(e=>e!=null),n=t.length!==e.length,r=[];for(let e of t)r.some(t=>Object.is(t,e))||r.push(e);return{enumValues:r,nullable:n}}function rN(e){return!e||typeof e!=`object`?{schema:null,unsupportedPaths:[`<root>`]}:iN(e,[])}function iN(e,t){let n=new Set,r={...e},i=kn(t)||`<root>`;if(e.anyOf||e.oneOf||e.allOf)return cN(e,t)||{schema:e,unsupportedPaths:[i]};let a=Array.isArray(e.type)&&e.type.includes(`null`),o=Dn(e)??(e.properties||e.additionalProperties?`object`:void 0);if(r.type=o??e.type,r.nullable=a||e.nullable,r.enum){let{enumValues:e,nullable:t}=nN(r.enum);r.enum=e,t&&(r.nullable=!0),e.length===0&&n.add(i)}if(o===`object`){let a=e.properties??{},o={};for(let[e,r]of Object.entries(a)){let i=iN(r,[...t,e]);i.schema&&(o[e]=i.schema);for(let e of i.unsupportedPaths)n.add(e)}if(r.properties=o,e.additionalProperties===!0)r.additionalProperties={};else if(e.additionalProperties===!1)r.additionalProperties=!1;else if(e.additionalProperties&&typeof e.additionalProperties==`object`&&!tN(e.additionalProperties)){let a=iN(e.additionalProperties,[...t,`*`]);r.additionalProperties=a.schema??e.additionalProperties,a.unsupportedPaths.length>0&&n.add(i)}}else if(o===`array`){let a=Array.isArray(e.items)?e.items[0]:e.items;if(!a)n.add(i);else{let e=iN(a,[...t,`*`]);r.items=e.schema??a,e.unsupportedPaths.length>0&&n.add(i)}}else o!==`string`&&o!==`number`&&o!==`integer`&&o!==`boolean`&&!r.enum&&n.add(i);return{schema:r,unsupportedPaths:Array.from(n)}}function aN(e){if(Dn(e)!==`object`)return!1;let t=e.properties?.source,n=e.properties?.provider,r=e.properties?.id;return!t||!n||!r?!1:typeof t.const==`string`&&Dn(n)===`string`&&Dn(r)===`string`}function oN(e){let t=e.oneOf??e.anyOf;return!t||t.length===0?!1:t.every(e=>aN(e))}function sN(e,t,n,r){let i=n.findIndex(e=>Dn(e)===`string`);if(i<0)return null;let a=n.filter((e,t)=>t!==i);return a.length!==1||!oN(a[0])?null:iN({...e,...n[i],nullable:r,anyOf:void 0,oneOf:void 0,allOf:void 0},t)}function cN(e,t){if(e.allOf)return null;let n=e.anyOf??e.oneOf;if(!n)return null;let r=[],i=[],a=!1;for(let e of n){if(!e||typeof e!=`object`)return null;if(Array.isArray(e.enum)){let{enumValues:t,nullable:n}=nN(e.enum);r.push(...t),n&&(a=!0);continue}if(`const`in e){if(e.const==null){a=!0;continue}r.push(e.const);continue}if(Dn(e)===`null`){a=!0;continue}i.push(e)}let o=sN(e,t,i,a);if(o)return o;if(r.length>0&&i.length===0){let t=[];for(let e of r)t.some(t=>Object.is(t,e))||t.push(e);return{schema:{...e,enum:t,nullable:a,anyOf:void 0,oneOf:void 0,allOf:void 0},unsupportedPaths:[]}}if(i.length===1){let e=iN(i[0],t);return e.schema&&(e.schema.nullable=a||e.schema.nullable),e}let s=new Set([`string`,`number`,`integer`,`boolean`,`object`,`array`]);return i.length>0&&r.length===0&&i.every(e=>{let t=Dn(e);return!!t&&s.has(String(t))})?{schema:{...e,nullable:a},unsupportedPaths:[]}:null}var lN={0:`None`,25:`Slight`,50:`Soft`,75:`Round`,100:`Full`},uN={all:i`
4056
+ `}var rN=new Set([`title`,`description`,`default`,`nullable`]);function iN(e){return Object.keys(e??{}).filter(e=>!rN.has(e)).length===0}function aN(e){let t=e.filter(e=>e!=null),n=t.length!==e.length,r=[];for(let e of t)r.some(t=>Object.is(t,e))||r.push(e);return{enumValues:r,nullable:n}}function oN(e){return!e||typeof e!=`object`?{schema:null,unsupportedPaths:[`<root>`]}:sN(e,[])}function sN(e,t){let n=new Set,r={...e},i=kn(t)||`<root>`;if(e.anyOf||e.oneOf||e.allOf)return dN(e,t)||{schema:e,unsupportedPaths:[i]};let a=Array.isArray(e.type)&&e.type.includes(`null`),o=Dn(e)??(e.properties||e.additionalProperties?`object`:void 0);if(r.type=o??e.type,r.nullable=a||e.nullable,r.enum){let{enumValues:e,nullable:t}=aN(r.enum);r.enum=e,t&&(r.nullable=!0),e.length===0&&n.add(i)}if(o===`object`){let a=e.properties??{},o={};for(let[e,r]of Object.entries(a)){let i=sN(r,[...t,e]);i.schema&&(o[e]=i.schema);for(let e of i.unsupportedPaths)n.add(e)}if(r.properties=o,e.additionalProperties===!0)r.additionalProperties={};else if(e.additionalProperties===!1)r.additionalProperties=!1;else if(e.additionalProperties&&typeof e.additionalProperties==`object`&&!iN(e.additionalProperties)){let a=sN(e.additionalProperties,[...t,`*`]);r.additionalProperties=a.schema??e.additionalProperties,a.unsupportedPaths.length>0&&n.add(i)}}else if(o===`array`){let a=Array.isArray(e.items)?e.items[0]:e.items;if(!a)n.add(i);else{let e=sN(a,[...t,`*`]);r.items=e.schema??a,e.unsupportedPaths.length>0&&n.add(i)}}else o!==`string`&&o!==`number`&&o!==`integer`&&o!==`boolean`&&!r.enum&&n.add(i);return{schema:r,unsupportedPaths:Array.from(n)}}function cN(e){if(Dn(e)!==`object`)return!1;let t=e.properties?.source,n=e.properties?.provider,r=e.properties?.id;return!t||!n||!r?!1:typeof t.const==`string`&&Dn(n)===`string`&&Dn(r)===`string`}function lN(e){let t=e.oneOf??e.anyOf;return!t||t.length===0?!1:t.every(e=>cN(e))}function uN(e,t,n,r){let i=n.findIndex(e=>Dn(e)===`string`);if(i<0)return null;let a=n.filter((e,t)=>t!==i);return a.length!==1||!lN(a[0])?null:sN({...e,...n[i],nullable:r,anyOf:void 0,oneOf:void 0,allOf:void 0},t)}function dN(e,t){if(e.allOf)return null;let n=e.anyOf??e.oneOf;if(!n)return null;let r=[],i=[],a=!1;for(let e of n){if(!e||typeof e!=`object`)return null;if(Array.isArray(e.enum)){let{enumValues:t,nullable:n}=aN(e.enum);r.push(...t),n&&(a=!0);continue}if(`const`in e){if(e.const==null){a=!0;continue}r.push(e.const);continue}if(Dn(e)===`null`){a=!0;continue}i.push(e)}let o=uN(e,t,i,a);if(o)return o;if(r.length>0&&i.length===0){let t=[];for(let e of r)t.some(t=>Object.is(t,e))||t.push(e);return{schema:{...e,enum:t,nullable:a,anyOf:void 0,oneOf:void 0,allOf:void 0},unsupportedPaths:[]}}if(i.length===1){let e=sN(i[0],t);return e.schema&&(e.schema.nullable=a||e.schema.nullable),e}let s=new Set([`string`,`number`,`integer`,`boolean`,`object`,`array`]);return i.length>0&&r.length===0&&i.every(e=>{let t=Dn(e);return!!t&&s.has(String(t))})?{schema:{...e,nullable:a},unsupportedPaths:[]}:null}var fN={0:`None`,25:`Slight`,50:`Soft`,75:`Round`,100:`Full`},pN={all:i`
4050
4057
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
4051
4058
  <rect x="3" y="3" width="7" height="7"></rect>
4052
4059
  <rect x="14" y="3" width="7" height="7"></rect>
@@ -4281,7 +4288,7 @@ ${e}
4281
4288
  <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
4282
4289
  <polyline points="14 2 14 8 20 8"></polyline>
4283
4290
  </svg>
4284
- `},dN=[{id:`core`,label:`Core`,sections:[{key:`env`,label:`Environment`},{key:`auth`,label:`Authentication`},{key:`update`,label:`Updates`},{key:`meta`,label:`Meta`},{key:`logging`,label:`Logging`},{key:`diagnostics`,label:`Diagnostics`},{key:`cli`,label:`Cli`},{key:`secrets`,label:`Secrets`}]},{id:`ai`,label:`AI & Agents`,sections:[{key:`agents`,label:`Agents`},{key:`models`,label:`Models`},{key:`skills`,label:`Skills`},{key:`tools`,label:`Tools`},{key:`memory`,label:`Memory`},{key:`session`,label:`Session`}]},{id:`communication`,label:`Communication`,sections:[{key:`channels`,label:`Channels`},{key:`messages`,label:`Messages`},{key:`broadcast`,label:`Broadcast`},{key:`talk`,label:`Talk`},{key:`audio`,label:`Audio`}]},{id:`automation`,label:`Automation`,sections:[{key:`commands`,label:`Commands`},{key:`hooks`,label:`Hooks`},{key:`bindings`,label:`Bindings`},{key:`cron`,label:`Cron`},{key:`approvals`,label:`Approvals`},{key:`plugins`,label:`Plugins`}]},{id:`infrastructure`,label:`Infrastructure`,sections:[{key:`gateway`,label:`Gateway`},{key:`web`,label:`Web`},{key:`browser`,label:`Browser`},{key:`nodeHost`,label:`NodeHost`},{key:`canvasHost`,label:`CanvasHost`},{key:`discovery`,label:`Discovery`},{key:`media`,label:`Media`},{key:`acp`,label:`Acp`},{key:`mcp`,label:`Mcp`}]},{id:`appearance`,label:p(`tabs.appearance`),sections:[{key:`__appearance__`,label:`Theme`},{key:`ui`,label:`UI`},{key:`wizard`,label:`Setup Wizard`}]}],fN=new Set(dN.flatMap(e=>e.sections.map(e=>e.key)));function pN(e){return uN[e]??uN.default}function mN(e,t){if(!e||Dn(e)!==`object`||!e.properties)return e;let n=t.include,r=t.exclude,i={};for(let[t,a]of Object.entries(e.properties))n&&n.size>0&&!n.has(t)||r&&r.size>0&&r.has(t)||(i[t]=a);return{...e,properties:i}}function hN(e,t){let n=t.include,r=t.exclude;return(!n||n.size===0)&&(!r||r.size===0)?e:e.filter(e=>{if(e===`<root>`)return!0;let[t]=e.split(`.`);return n&&n.size>0?n.has(t):r&&r.size>0?!r.has(t):!0})}function gN(e,t){return XM[e]||{label:t?.title??jn(e),description:t?.description??``}}function _N(e,t){if(!e||!t)return[];let n=[];function r(e,t,i){if(e===t)return;if(typeof e!=typeof t){n.push({path:i,from:e,to:t});return}if(typeof e!=`object`||!e||t===null){e!==t&&n.push({path:i,from:e,to:t});return}if(Array.isArray(e)&&Array.isArray(t)){JSON.stringify(e)!==JSON.stringify(t)&&n.push({path:i,from:e,to:t});return}let a=e,o=t,s=new Set([...Object.keys(a),...Object.keys(o)]);for(let e of s)r(a[e],o[e],i?`${i}.${e}`:e)}return r(e,t,``),n}function vN(e,t=40){let n;try{n=JSON.stringify(e)??String(e)}catch{n=String(e)}return n.length<=t?n:n.slice(0,t-3)+`...`}function yN(e,t,n){return Ln(e)&&t!=null&&vN(t).trim()!==``?Fn:vN(t)}function bN(e){return i`
4291
+ `},mN=[{id:`core`,label:`Core`,sections:[{key:`env`,label:`Environment`},{key:`auth`,label:`Authentication`},{key:`update`,label:`Updates`},{key:`meta`,label:`Meta`},{key:`logging`,label:`Logging`},{key:`diagnostics`,label:`Diagnostics`},{key:`cli`,label:`Cli`},{key:`secrets`,label:`Secrets`}]},{id:`ai`,label:`AI & Agents`,sections:[{key:`agents`,label:`Agents`},{key:`models`,label:`Models`},{key:`skills`,label:`Skills`},{key:`tools`,label:`Tools`},{key:`memory`,label:`Memory`},{key:`session`,label:`Session`}]},{id:`communication`,label:`Communication`,sections:[{key:`channels`,label:`Channels`},{key:`messages`,label:`Messages`},{key:`broadcast`,label:`Broadcast`},{key:`talk`,label:`Talk`},{key:`audio`,label:`Audio`}]},{id:`automation`,label:`Automation`,sections:[{key:`commands`,label:`Commands`},{key:`hooks`,label:`Hooks`},{key:`bindings`,label:`Bindings`},{key:`cron`,label:`Cron`},{key:`approvals`,label:`Approvals`},{key:`plugins`,label:`Plugins`}]},{id:`infrastructure`,label:`Infrastructure`,sections:[{key:`gateway`,label:`Gateway`},{key:`web`,label:`Web`},{key:`browser`,label:`Browser`},{key:`nodeHost`,label:`NodeHost`},{key:`canvasHost`,label:`CanvasHost`},{key:`discovery`,label:`Discovery`},{key:`media`,label:`Media`},{key:`acp`,label:`Acp`},{key:`mcp`,label:`Mcp`}]},{id:`appearance`,label:p(`tabs.appearance`),sections:[{key:`__appearance__`,label:`Theme`},{key:`ui`,label:`UI`},{key:`wizard`,label:`Setup Wizard`}]}],hN=new Set(mN.flatMap(e=>e.sections.map(e=>e.key)));function gN(e){return pN[e]??pN.default}function _N(e,t){if(!e||Dn(e)!==`object`||!e.properties)return e;let n=t.include,r=t.exclude,i={};for(let[t,a]of Object.entries(e.properties))n&&n.size>0&&!n.has(t)||r&&r.size>0&&r.has(t)||(i[t]=a);return{...e,properties:i}}function vN(e,t){let n=t.include,r=t.exclude;return(!n||n.size===0)&&(!r||r.size===0)?e:e.filter(e=>{if(e===`<root>`)return!0;let[t]=e.split(`.`);return n&&n.size>0?n.has(t):r&&r.size>0?!r.has(t):!0})}function yN(e,t){return $M[e]||{label:t?.title??jn(e),description:t?.description??``}}function bN(e,t){if(!e||!t)return[];let n=[];function r(e,t,i){if(e===t)return;if(typeof e!=typeof t){n.push({path:i,from:e,to:t});return}if(typeof e!=`object`||!e||t===null){e!==t&&n.push({path:i,from:e,to:t});return}if(Array.isArray(e)&&Array.isArray(t)){JSON.stringify(e)!==JSON.stringify(t)&&n.push({path:i,from:e,to:t});return}let a=e,o=t,s=new Set([...Object.keys(a),...Object.keys(o)]);for(let e of s)r(a[e],o[e],i?`${i}.${e}`:e)}return r(e,t,``),n}function xN(e,t=40){let n;try{n=JSON.stringify(e)??String(e)}catch{n=String(e)}return n.length<=t?n:n.slice(0,t-3)+`...`}function SN(e,t,n){return Ln(e)&&t!=null&&xN(t).trim()!==``?Fn:xN(t)}function CN(e){return i`
4285
4292
  <div class="settings-appearance">
4286
4293
  <div class="settings-appearance__section">
4287
4294
  <h3 class="settings-appearance__heading">Appearance</h3>
@@ -4317,7 +4324,7 @@ ${e}
4317
4324
  class="settings-roundness__swatch"
4318
4325
  style="border-radius: ${Math.round(t/50*10)}px"
4319
4326
  ></span>
4320
- <span class="settings-roundness__label">${lN[t]}</span>
4327
+ <span class="settings-roundness__label">${fN[t]}</span>
4321
4328
  </button>
4322
4329
  `)}
4323
4330
  </div>
@@ -4349,7 +4356,7 @@ ${e}
4349
4356
  </div>
4350
4357
  </div>
4351
4358
  </div>
4352
- `}function xN(){return{rawRevealed:!1,envRevealed:!1,validityDismissed:!1,revealedSensitivePaths:new Set}}var SN=xN();function CN(e){let t=kn(e);return t?SN.revealedSensitivePaths.has(t):!1}function wN(e){let t=kn(e);t&&(SN.revealedSensitivePaths.has(t)?SN.revealedSensitivePaths.delete(t):SN.revealedSensitivePaths.add(t))}function TN(e){let t=e.showModeToggle??!1,n=e.valid==null?`unknown`:e.valid?`valid`:`invalid`,r=e.includeVirtualSections??!0,a=e.includeSections?.length?new Set(e.includeSections):null,o=e.excludeSections?.length?new Set(e.excludeSections):null,s=rN(e.schema),c={schema:mN(s.schema,{include:a,exclude:o}),unsupportedPaths:hN(s.unsupportedPaths,{include:a,exclude:o})},l=e.schemaLoading&&!c.schema,u=c.schema?c.unsupportedPaths.length>0:!1,d=e.rawAvailable??!0,f=t&&d?e.formMode:`form`,m=SN.envRevealed,h=e.onRequestUpdate??(()=>e.onRawChange(e.raw)),_=c.schema?.properties??{},v=new Set([`__appearance__`]),y=dN.map(e=>Object.assign({},e,{sections:e.sections.filter(e=>r&&v.has(e.key)||e.key in _)})).filter(e=>e.sections.length>0),b=Object.keys(_).filter(e=>!fN.has(e)).map(e=>({key:e,label:e.charAt(0).toUpperCase()+e.slice(1)})),x=b.length>0?{id:`other`,label:`Other`,sections:b}:null,S=r&&e.activeSection!=null&&v.has(e.activeSection),ee=e.activeSection&&!S&&c.schema&&Dn(c.schema)===`object`?c.schema.properties?.[e.activeSection]:void 0,C=e.activeSection&&!S?gN(e.activeSection,ee):null,te=[{key:null,label:e.navRootLabel??`Settings`},...[...y,...x?[x]:[]].flatMap(e=>e.sections.map(e=>({key:e.key,label:e.label})))],ne=e.settingsLayout??`tabs`,w=[...y,...x?[x]:[]],re=e=>{queueMicrotask(()=>{let t=(e instanceof Element?e:null)?.closest(`.config-main`)?.querySelector(`.config-content`);if(t){if(typeof t.scrollTo==`function`){t.scrollTo({top:0,left:0,behavior:`auto`});return}t.scrollTop=0,t.scrollLeft=0}})};function T(){return i`
4359
+ `}function wN(){return{rawRevealed:!1,envRevealed:!1,validityDismissed:!1,revealedSensitivePaths:new Set}}var TN=wN();function EN(e){let t=kn(e);return t?TN.revealedSensitivePaths.has(t):!1}function DN(e){let t=kn(e);t&&(TN.revealedSensitivePaths.has(t)?TN.revealedSensitivePaths.delete(t):TN.revealedSensitivePaths.add(t))}function ON(e){let t=e.showModeToggle??!1,n=e.valid==null?`unknown`:e.valid?`valid`:`invalid`,r=e.includeVirtualSections??!0,a=e.includeSections?.length?new Set(e.includeSections):null,o=e.excludeSections?.length?new Set(e.excludeSections):null,s=oN(e.schema),c={schema:_N(s.schema,{include:a,exclude:o}),unsupportedPaths:vN(s.unsupportedPaths,{include:a,exclude:o})},l=e.schemaLoading&&!c.schema,u=c.schema?c.unsupportedPaths.length>0:!1,d=e.rawAvailable??!0,f=t&&d?e.formMode:`form`,m=TN.envRevealed,h=e.onRequestUpdate??(()=>e.onRawChange(e.raw)),_=c.schema?.properties??{},v=new Set([`__appearance__`]),y=mN.map(e=>Object.assign({},e,{sections:e.sections.filter(e=>r&&v.has(e.key)||e.key in _)})).filter(e=>e.sections.length>0),b=Object.keys(_).filter(e=>!hN.has(e)).map(e=>({key:e,label:e.charAt(0).toUpperCase()+e.slice(1)})),x=b.length>0?{id:`other`,label:`Other`,sections:b}:null,S=r&&e.activeSection!=null&&v.has(e.activeSection),ee=e.activeSection&&!S&&c.schema&&Dn(c.schema)===`object`?c.schema.properties?.[e.activeSection]:void 0,C=e.activeSection&&!S?yN(e.activeSection,ee):null,te=[{key:null,label:e.navRootLabel??`Settings`},...[...y,...x?[x]:[]].flatMap(e=>e.sections.map(e=>({key:e.key,label:e.label})))],ne=e.settingsLayout??`tabs`,w=[...y,...x?[x]:[]],re=e=>{queueMicrotask(()=>{let t=(e instanceof Element?e:null)?.closest(`.config-main`)?.querySelector(`.config-content`);if(t){if(typeof t.scrollTo==`function`){t.scrollTo({top:0,left:0,behavior:`auto`});return}t.scrollTop=0,t.scrollLeft=0}})};function T(){return i`
4353
4360
  <div class="config-accordion-nav">
4354
4361
  ${e.onBackToQuick?i`
4355
4362
  <button class="config-accordion-nav__back" @click=${e.onBackToQuick}>
@@ -4373,7 +4380,7 @@ ${e}
4373
4380
  @click=${n=>{let r=t.sections[0]?.key??null,i=t.sections.some(t=>t.key===e.activeSection);e.onSectionChange(i?null:r),re(n.currentTarget)}}
4374
4381
  >
4375
4382
  <span class="config-accordion-group__icon">
4376
- ${pN(t.sections[0]?.key??`default`)}
4383
+ ${gN(t.sections[0]?.key??`default`)}
4377
4384
  </span>
4378
4385
  <span>${t.label}</span>
4379
4386
  <svg
@@ -4396,7 +4403,7 @@ ${e}
4396
4403
  @click=${n=>{e.onSectionChange(t.key),re(n.currentTarget)}}
4397
4404
  >
4398
4405
  <span class="config-accordion-group__item-icon">
4399
- ${pN(t.key)}
4406
+ ${gN(t.key)}
4400
4407
  </span>
4401
4408
  ${t.label}
4402
4409
  </button>
@@ -4406,7 +4413,7 @@ ${e}
4406
4413
  </div>
4407
4414
  `)}
4408
4415
  </div>
4409
- `}let E=f===`form`?_N(e.originalValue,e.formValue):[],ie=f===`raw`&&e.raw!==e.originalRaw,D=f===`form`?E.length>0:ie,O=!!e.formValue&&!e.loading&&!!c.schema,k=e.connected&&!e.saving&&D&&(f===`raw`?!0:O),ae=e.connected&&!e.applying&&!e.updating&&D&&(f===`raw`?!0:O),A=e.connected&&!e.applying&&!e.updating,j=e.restartPrompt?.paths.slice(0,4)??[],oe=Math.max(0,(e.restartPrompt?.paths.length??0)-4),M=r&&f===`form`&&e.activeSection===null&&!!a?.has(`__appearance__`);return i`
4416
+ `}let ie=f===`form`?bN(e.originalValue,e.formValue):[],ae=f===`raw`&&e.raw!==e.originalRaw,E=f===`form`?ie.length>0:ae,D=!!e.formValue&&!e.loading&&!!c.schema,O=e.connected&&!e.saving&&E&&(f===`raw`?!0:D),oe=e.connected&&!e.applying&&!e.updating&&E&&(f===`raw`?!0:D),k=e.connected&&!e.applying&&!e.updating,A=e.restartPrompt?.paths.slice(0,4)??[],se=Math.max(0,(e.restartPrompt?.paths.length??0)-4),j=r&&f===`form`&&e.activeSection===null&&!!a?.has(`__appearance__`);return i`
4410
4417
  <div class="config-layout">
4411
4418
  ${e.restartPrompt?i`
4412
4419
  <div class="config-restart-modal" role="dialog" aria-modal="true">
@@ -4415,11 +4422,11 @@ ${e}
4415
4422
  <p class="config-restart-modal__body">
4416
4423
  These changes require a Gateway restart before they take effect.
4417
4424
  </p>
4418
- ${j.length>0?i`
4425
+ ${A.length>0?i`
4419
4426
  <div class="config-restart-modal__paths">
4420
- ${j.map(e=>i`<span class="config-restart-modal__path">${e}</span>`)}
4421
- ${oe>0?i`<span class="config-restart-modal__path"
4422
- >+${oe} more</span
4427
+ ${A.map(e=>i`<span class="config-restart-modal__path">${e}</span>`)}
4428
+ ${se>0?i`<span class="config-restart-modal__path"
4429
+ >+${se} more</span
4423
4430
  >`:g}
4424
4431
  </div>
4425
4432
  `:g}
@@ -4458,9 +4465,9 @@ ${e}
4458
4465
  </button>
4459
4466
  </div>
4460
4467
  `:g}
4461
- ${D?i`
4468
+ ${E?i`
4462
4469
  <span class="config-changes-badge"
4463
- >${f===`raw`?`Unsaved changes`:`${E.length} unsaved change${E.length===1?``:`s`}`}</span
4470
+ >${f===`raw`?`Unsaved changes`:`${ie.length} unsaved change${ie.length===1?``:`s`}`}</span
4464
4471
  >
4465
4472
  `:i` <span class="config-status muted">No changes</span> `}
4466
4473
  </div>
@@ -4483,16 +4490,16 @@ ${e}
4483
4490
  <button class="btn btn--sm" ?disabled=${e.loading} @click=${e.onReload}>
4484
4491
  ${e.loading?p(`common.loading`):p(`common.reload`)}
4485
4492
  </button>
4486
- <button class="btn btn--sm" ?disabled=${!D} @click=${e.onReset}>
4493
+ <button class="btn btn--sm" ?disabled=${!E} @click=${e.onReset}>
4487
4494
  Clear
4488
4495
  </button>
4489
- <button class="btn btn--sm primary" ?disabled=${!k} @click=${e.onSave}>
4496
+ <button class="btn btn--sm primary" ?disabled=${!O} @click=${e.onSave}>
4490
4497
  ${e.saving?`Saving…`:`Save`}
4491
4498
  </button>
4492
- <button class="btn btn--sm" ?disabled=${!ae} @click=${e.onApply}>
4499
+ <button class="btn btn--sm" ?disabled=${!oe} @click=${e.onApply}>
4493
4500
  ${e.applying?`Applying…`:`Apply`}
4494
4501
  </button>
4495
- <button class="btn btn--sm" ?disabled=${!A} @click=${e.onUpdate}>
4502
+ <button class="btn btn--sm" ?disabled=${!k} @click=${e.onUpdate}>
4496
4503
  ${e.updating?`Updating…`:`Update`}
4497
4504
  </button>
4498
4505
  </div>
@@ -4554,7 +4561,7 @@ ${e}
4554
4561
  </div>
4555
4562
  </div>
4556
4563
  `}
4557
- ${n===`invalid`&&!SN.validityDismissed?i`
4564
+ ${n===`invalid`&&!TN.validityDismissed?i`
4558
4565
  <div class="config-validity-warning">
4559
4566
  <svg
4560
4567
  class="config-validity-warning__icon"
@@ -4578,7 +4585,7 @@ ${e}
4578
4585
  >
4579
4586
  <button
4580
4587
  class="btn btn--sm"
4581
- @click=${()=>{SN.validityDismissed=!0,h()}}
4588
+ @click=${()=>{TN.validityDismissed=!0,h()}}
4582
4589
  >
4583
4590
  Don't remind again
4584
4591
  </button>
@@ -4586,10 +4593,10 @@ ${e}
4586
4593
  `:g}
4587
4594
 
4588
4595
  <!-- Diff panel (form mode only - raw mode doesn't have granular diff) -->
4589
- ${D&&f===`form`?i`
4596
+ ${E&&f===`form`?i`
4590
4597
  <details class="config-diff">
4591
4598
  <summary class="config-diff__summary">
4592
- <span>View ${E.length} pending change${E.length===1?``:`s`}</span>
4599
+ <span>View ${ie.length} pending change${ie.length===1?``:`s`}</span>
4593
4600
  <svg
4594
4601
  class="config-diff__chevron"
4595
4602
  viewBox="0 0 24 24"
@@ -4601,16 +4608,16 @@ ${e}
4601
4608
  </svg>
4602
4609
  </summary>
4603
4610
  <div class="config-diff__content">
4604
- ${E.map(t=>i`
4611
+ ${ie.map(t=>i`
4605
4612
  <div class="config-diff__item">
4606
4613
  <div class="config-diff__path">${t.path}</div>
4607
4614
  <div class="config-diff__values">
4608
4615
  <span class="config-diff__from"
4609
- >${yN(t.path,t.from,e.uiHints)}</span
4616
+ >${SN(t.path,t.from,e.uiHints)}</span
4610
4617
  >
4611
4618
  <span class="config-diff__arrow">→</span>
4612
4619
  <span class="config-diff__to"
4613
- >${yN(t.path,t.to,e.uiHints)}</span
4620
+ >${SN(t.path,t.to,e.uiHints)}</span
4614
4621
  >
4615
4622
  </div>
4616
4623
  </div>
@@ -4621,7 +4628,7 @@ ${e}
4621
4628
  ${C&&f===`form`?i`
4622
4629
  <div class="config-section-hero">
4623
4630
  <div class="config-section-hero__icon">
4624
- ${pN(e.activeSection??``)}
4631
+ ${gN(e.activeSection??``)}
4625
4632
  </div>
4626
4633
  <div class="config-section-hero__text">
4627
4634
  <div class="config-section-hero__title">${C.label}</div>
@@ -4633,7 +4640,7 @@ ${e}
4633
4640
  <button
4634
4641
  class="config-env-peek-btn ${m?`config-env-peek-btn--active`:``}"
4635
4642
  title=${m?`Hide env values`:`Reveal env values`}
4636
- @click=${()=>{SN.envRevealed=!SN.envRevealed,h()}}
4643
+ @click=${()=>{TN.envRevealed=!TN.envRevealed,h()}}
4637
4644
  >
4638
4645
  <svg
4639
4646
  viewBox="0 0 24 24"
@@ -4655,15 +4662,15 @@ ${e}
4655
4662
  `:g}
4656
4663
  <!-- Form content -->
4657
4664
  <div class="config-content">
4658
- ${e.activeSection===`__appearance__`?r?bN(e):g:f===`form`?i`
4659
- ${M?bN(e):g}
4665
+ ${e.activeSection===`__appearance__`?r?CN(e):g:f===`form`?i`
4666
+ ${j?CN(e):g}
4660
4667
  ${l?i`
4661
4668
  <div class="config-loading">
4662
4669
  <div class="config-loading__spinner"></div>
4663
4670
  <span>Loading schema…</span>
4664
4671
  </div>
4665
- `:$M({schema:c.schema,uiHints:e.uiHints,value:e.formValue,rawAvailable:d,disabled:e.loading||!e.formValue,unsupportedPaths:c.unsupportedPaths,onPatch:e.onFormPatch,searchQuery:e.searchQuery,activeSection:e.activeSection,activeSubsection:null,revealSensitive:e.activeSection===`env`?m:!1,isSensitivePathRevealed:CN,onToggleSensitivePath:e=>{wN(e),h()}})}
4666
- `:(()=>{let t=Vn(e.formValue,[],e.uiHints),n=t>0&&!SN.rawRevealed;return i`
4672
+ `:nN({schema:c.schema,uiHints:e.uiHints,value:e.formValue,rawAvailable:d,disabled:e.loading||!e.formValue,unsupportedPaths:c.unsupportedPaths,onPatch:e.onFormPatch,searchQuery:e.searchQuery,activeSection:e.activeSection,activeSubsection:null,revealSensitive:e.activeSection===`env`?m:!1,isSensitivePathRevealed:EN,onToggleSensitivePath:e=>{DN(e),h()}})}
4673
+ `:(()=>{let t=Vn(e.formValue,[],e.uiHints),n=t>0&&!TN.rawRevealed;return i`
4667
4674
  ${u?i`
4668
4675
  <div class="callout info" style="margin-bottom: 12px">
4669
4676
  Your config contains fields the form editor can't safely represent. Use
@@ -4683,7 +4690,7 @@ ${e}
4683
4690
  title=${n?`Reveal sensitive values`:`Hide sensitive values`}
4684
4691
  aria-label="Toggle raw config redaction"
4685
4692
  aria-pressed=${!n}
4686
- @click=${()=>{SN.rawRevealed=!SN.rawRevealed,h()}}
4693
+ @click=${()=>{TN.rawRevealed=!TN.rawRevealed,h()}}
4687
4694
  >
4688
4695
  ${n?J.eyeOff:J.eye}
4689
4696
  </button>
@@ -4710,17 +4717,17 @@ ${e}
4710
4717
  </div>`:g}
4711
4718
  </main>
4712
4719
  </div>
4713
- `}var EN=[{id:`every-morning`,label:`Every morning`,icon:`🌅`,description:`Daily at 8:00 AM`},{id:`every-evening`,label:`Every evening`,icon:`🌙`,description:`Daily at 6:00 PM`},{id:`hourly`,label:`Hourly`,icon:`🔄`,description:`Every hour`},{id:`weekdays`,label:`Weekdays`,icon:`📅`,description:`Mon–Fri at 9:00 AM`},{id:`weekly`,label:`Weekly`,icon:`📆`,description:`Every Monday at 9:00 AM`},{id:`once`,label:`Run once`,icon:`⚡`,description:`One-time, delete after run`}],DN=[{id:`notify`,label:`Notify me`,description:`Deliver results to chat`},{id:`silent`,label:`Silent`,description:`Run without notification`},{id:`isolated`,label:`Independent session`,description:`Run in its own session`}];function ON(){return{prompt:``,name:``,schedulePreset:`every-morning`,deliveryPreset:`notify`}}function kN(e=new Date){let t=new Date(e);return t.setHours(t.getHours()+1,0,0,0),`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}T${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`}function AN(e){let t={name:e.name||`Automation`,payloadKind:`agentTurn`,deleteAfterRun:!1,scheduleAt:``,payloadText:e.prompt,enabled:!0};switch(e.schedulePreset){case`every-morning`:t.scheduleKind=`cron`,t.cronExpr=`0 8 * * *`;break;case`every-evening`:t.scheduleKind=`cron`,t.cronExpr=`0 18 * * *`;break;case`hourly`:t.scheduleKind=`every`,t.everyAmount=`1`,t.everyUnit=`hours`;break;case`weekdays`:t.scheduleKind=`cron`,t.cronExpr=`0 9 * * 1-5`;break;case`weekly`:t.scheduleKind=`cron`,t.cronExpr=`0 9 * * 1`;break;case`once`:t.scheduleKind=`at`,t.scheduleAt=kN(),t.deleteAfterRun=!0;break;default:break}switch(e.deliveryPreset){case`notify`:t.sessionTarget=`isolated`,t.deliveryMode=`announce`,t.wakeMode=`now`;break;case`silent`:t.sessionTarget=`main`,t.deliveryMode=`none`,t.wakeMode=`now`;break;case`isolated`:t.sessionTarget=`isolated`,t.deliveryMode=`none`,t.wakeMode=`now`;break}return t}var jN=[`what`,`when`,`how`],MN={what:`What`,when:`When`,how:`How`};function NN(e){let t=jN.indexOf(e);return i`
4720
+ `}var kN=[{id:`every-morning`,label:`Every morning`,icon:`🌅`,description:`Daily at 8:00 AM`},{id:`every-evening`,label:`Every evening`,icon:`🌙`,description:`Daily at 6:00 PM`},{id:`hourly`,label:`Hourly`,icon:`🔄`,description:`Every hour`},{id:`weekdays`,label:`Weekdays`,icon:`📅`,description:`Mon–Fri at 9:00 AM`},{id:`weekly`,label:`Weekly`,icon:`📆`,description:`Every Monday at 9:00 AM`},{id:`once`,label:`Run once`,icon:`⚡`,description:`One-time, delete after run`}],AN=[{id:`notify`,label:`Notify me`,description:`Deliver results to chat`},{id:`silent`,label:`Silent`,description:`Run without notification`},{id:`isolated`,label:`Independent session`,description:`Run in its own session`}];function jN(){return{prompt:``,name:``,schedulePreset:`every-morning`,deliveryPreset:`notify`}}function MN(e=new Date){let t=new Date(e);return t.setHours(t.getHours()+1,0,0,0),`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}T${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`}function NN(e){let t={name:e.name||`Automation`,payloadKind:`agentTurn`,deleteAfterRun:!1,scheduleAt:``,payloadText:e.prompt,enabled:!0};switch(e.schedulePreset){case`every-morning`:t.scheduleKind=`cron`,t.cronExpr=`0 8 * * *`;break;case`every-evening`:t.scheduleKind=`cron`,t.cronExpr=`0 18 * * *`;break;case`hourly`:t.scheduleKind=`every`,t.everyAmount=`1`,t.everyUnit=`hours`;break;case`weekdays`:t.scheduleKind=`cron`,t.cronExpr=`0 9 * * 1-5`;break;case`weekly`:t.scheduleKind=`cron`,t.cronExpr=`0 9 * * 1`;break;case`once`:t.scheduleKind=`at`,t.scheduleAt=MN(),t.deleteAfterRun=!0;break;default:break}switch(e.deliveryPreset){case`notify`:t.sessionTarget=`isolated`,t.deliveryMode=`announce`,t.wakeMode=`now`;break;case`silent`:t.sessionTarget=`main`,t.deliveryMode=`none`,t.wakeMode=`now`;break;case`isolated`:t.sessionTarget=`isolated`,t.deliveryMode=`none`,t.wakeMode=`now`;break}return t}var PN=[`what`,`when`,`how`],FN={what:`What`,when:`When`,how:`How`};function IN(e){let t=PN.indexOf(e);return i`
4714
4721
  <div class="cqc-steps">
4715
- ${jN.map((e,n)=>{let r=n<t?`done`:n===t?`active`:`pending`;return i`
4722
+ ${PN.map((e,n)=>{let r=n<t?`done`:n===t?`active`:`pending`;return i`
4716
4723
  <div class="cqc-step cqc-step--${r}">
4717
4724
  <span class="cqc-step__dot">${r===`done`?`✓`:n+1}</span>
4718
- <span class="cqc-step__label">${MN[e]}</span>
4725
+ <span class="cqc-step__label">${FN[e]}</span>
4719
4726
  </div>
4720
- ${n<jN.length-1?i`<div class="cqc-step__line cqc-step__line--${r}"></div>`:g}
4727
+ ${n<PN.length-1?i`<div class="cqc-step__line cqc-step__line--${r}"></div>`:g}
4721
4728
  `})}
4722
4729
  </div>
4723
- `}function PN(e){return i`
4730
+ `}function LN(e){return i`
4724
4731
  <div class="cqc-body">
4725
4732
  <h3 class="cqc-body__heading">What should it do?</h3>
4726
4733
  <p class="cqc-body__hint muted">
@@ -4754,12 +4761,12 @@ ${e}
4754
4761
  Next ${J.chevronRight}
4755
4762
  </button>
4756
4763
  </div>
4757
- `}function FN(e){return i`
4764
+ `}function RN(e){return i`
4758
4765
  <div class="cqc-body">
4759
4766
  <h3 class="cqc-body__heading">When should it run?</h3>
4760
4767
  <p class="cqc-body__hint muted">Pick a schedule. You can fine-tune it later.</p>
4761
4768
  <div class="cqc-preset-grid">
4762
- ${EN.map(t=>i`
4769
+ ${kN.map(t=>i`
4763
4770
  <button
4764
4771
  class="cqc-preset-card ${e.draft.schedulePreset===t.id?`cqc-preset-card--active`:``}"
4765
4772
  @click=${()=>e.onDraftChange({schedulePreset:t.id})}
@@ -4777,12 +4784,12 @@ ${e}
4777
4784
  Next ${J.chevronRight}
4778
4785
  </button>
4779
4786
  </div>
4780
- `}function IN(e){return i`
4787
+ `}function zN(e){return i`
4781
4788
  <div class="cqc-body">
4782
4789
  <h3 class="cqc-body__heading">How should it work?</h3>
4783
4790
  <p class="cqc-body__hint muted">Choose how results are delivered.</p>
4784
4791
  <div class="cqc-delivery-options">
4785
- ${DN.map(t=>i`
4792
+ ${AN.map(t=>i`
4786
4793
  <label
4787
4794
  class="cqc-radio-card ${e.draft.deliveryPreset===t.id?`cqc-radio-card--active`:``}"
4788
4795
  >
@@ -4802,19 +4809,19 @@ ${e}
4802
4809
  <button class="btn" @click=${()=>e.onStepChange(`when`)}>Back</button>
4803
4810
  <button class="btn primary" @click=${e.onCreate}>Create ${J.check}</button>
4804
4811
  </div>
4805
- `}function LN(e){return e.open?i`
4812
+ `}function BN(e){return e.open?i`
4806
4813
  <div class="cqc-container">
4807
4814
  <div class="cqc-header">
4808
4815
  <h2 class="cqc-header__title">${J.zap} New Automation</h2>
4809
4816
  <button class="cqc-header__close" @click=${e.onCancel}>${J.x}</button>
4810
4817
  </div>
4811
4818
 
4812
- ${NN(e.step)}
4813
- ${e.step===`what`?PN(e):e.step===`when`?FN(e):IN(e)}
4819
+ ${IN(e.step)}
4820
+ ${e.step===`what`?LN(e):e.step===`when`?RN(e):zN(e)}
4814
4821
  </div>
4815
- `:g}var RN=/<!--\s*genesis:dreaming:diary:start\s*-->/,zN=/<!--\s*genesis:dreaming:diary:end\s*-->/;function BN(e){let t=e,n=RN.exec(e),r=zN.exec(e);n&&r&&r.index>n.index&&(t=e.slice(n.index+n[0].length,r.index));let i=[],a=t.split(/\n---\n/).filter(e=>e.trim().length>0);for(let e of a){let t=e.trim().split(`
4822
+ `:g}var VN=/<!--\s*genesis:dreaming:diary:start\s*-->/,HN=/<!--\s*genesis:dreaming:diary:end\s*-->/;function UN(e){let t=e,n=VN.exec(e),r=HN.exec(e);n&&r&&r.index>n.index&&(t=e.slice(n.index+n[0].length,r.index));let i=[],a=t.split(/\n---\n/).filter(e=>e.trim().length>0);for(let e of a){let t=e.trim().split(`
4816
4823
  `),n=``,r=[];for(let e of t){let t=e.trim();if(!n&&t.startsWith(`*`)&&t.endsWith(`*`)&&t.length>2){n=t.slice(1,-1);continue}t.startsWith(`#`)||t.startsWith(`<!--`)||t.length>0&&r.push(t)}r.length>0&&i.push({date:n,body:r.join(`
4817
- `)})}return i}function VN(e){let t=Date.parse(e);return Number.isFinite(t)?t:null}function HN(e){let t=VN(e);if(t===null)return e;let n=new Date(t);return`${n.getMonth()+1}/${n.getDate()}`}function UN(e){return Za(e).map((e,t)=>Object.assign({},e,{page:t}))}var WN=[`dreaming.phrases.consolidatingMemories`,`dreaming.phrases.tidyingKnowledgeGraph`,`dreaming.phrases.replayingConversations`,`dreaming.phrases.weavingShortTerm`,`dreaming.phrases.defragmentingMindPalace`,`dreaming.phrases.filingLooseThoughts`,`dreaming.phrases.connectingDots`,`dreaming.phrases.compostingContext`,`dreaming.phrases.alphabetizingSubconscious`,`dreaming.phrases.promotingHunches`,`dreaming.phrases.forgettingNoise`,`dreaming.phrases.dreamingEmbeddings`,`dreaming.phrases.reorganizingAttic`,`dreaming.phrases.indexingDay`,`dreaming.phrases.nurturingInsights`,`dreaming.phrases.simmeringIdeas`,`dreaming.phrases.whisperingVectorStore`],GN={light:`dreaming.phase.light`,deep:`dreaming.phase.deep`,rem:`dreaming.phase.rem`},KN=Math.floor(Math.random()*WN.length),qN=0,JN=6e3,YN=`scene`,XN=`dreams`,ZN=`recent`,QN=new Set,$N=new Set,eP=!1,tP=!1,nP=``,rP=``,iP=null,aP=``,oP=null,sP=!1,cP=null,lP=0,uP=0;function dP(e){lP=Math.max(0,Math.min(e,Math.max(0,uP-1)))}function fP(){let e=Date.now();return e-qN>JN&&(qN=e,KN=(KN+1)%WN.length),p(WN[KN]??WN[0])}var pP=[{top:8,left:15,size:3,delay:0,hue:`neutral`},{top:12,left:72,size:2,delay:1.4,hue:`neutral`},{top:22,left:35,size:3,delay:.6,hue:`accent`},{top:18,left:88,size:2,delay:2.1,hue:`neutral`},{top:35,left:8,size:2,delay:.9,hue:`neutral`},{top:45,left:92,size:2,delay:1.7,hue:`neutral`},{top:55,left:25,size:3,delay:2.5,hue:`accent`},{top:65,left:78,size:2,delay:.3,hue:`neutral`},{top:75,left:45,size:2,delay:1.1,hue:`neutral`},{top:82,left:60,size:3,delay:1.8,hue:`accent`},{top:30,left:55,size:2,delay:.4,hue:`neutral`},{top:88,left:18,size:2,delay:2.3,hue:`neutral`}],mP=i`
4824
+ `)})}return i}function WN(e){let t=Date.parse(e);return Number.isFinite(t)?t:null}function GN(e){let t=WN(e);if(t===null)return e;let n=new Date(t);return`${n.getMonth()+1}/${n.getDate()}`}function KN(e){return Za(e).map((e,t)=>Object.assign({},e,{page:t}))}var qN=[`dreaming.phrases.consolidatingMemories`,`dreaming.phrases.tidyingKnowledgeGraph`,`dreaming.phrases.replayingConversations`,`dreaming.phrases.weavingShortTerm`,`dreaming.phrases.defragmentingMindPalace`,`dreaming.phrases.filingLooseThoughts`,`dreaming.phrases.connectingDots`,`dreaming.phrases.compostingContext`,`dreaming.phrases.alphabetizingSubconscious`,`dreaming.phrases.promotingHunches`,`dreaming.phrases.forgettingNoise`,`dreaming.phrases.dreamingEmbeddings`,`dreaming.phrases.reorganizingAttic`,`dreaming.phrases.indexingDay`,`dreaming.phrases.nurturingInsights`,`dreaming.phrases.simmeringIdeas`,`dreaming.phrases.whisperingVectorStore`],JN={light:`dreaming.phase.light`,deep:`dreaming.phase.deep`,rem:`dreaming.phase.rem`},YN=Math.floor(Math.random()*qN.length),XN=0,ZN=6e3,QN=`scene`,$N=`dreams`,eP=`recent`,tP=new Set,nP=new Set,rP=!1,iP=!1,aP=``,oP=``,sP=null,cP=``,lP=null,uP=!1,dP=null,fP=0,pP=0;function mP(e){fP=Math.max(0,Math.min(e,Math.max(0,pP-1)))}function hP(){let e=Date.now();return e-XN>ZN&&(XN=e,YN=(YN+1)%qN.length),p(qN[YN]??qN[0])}var gP=[{top:8,left:15,size:3,delay:0,hue:`neutral`},{top:12,left:72,size:2,delay:1.4,hue:`neutral`},{top:22,left:35,size:3,delay:.6,hue:`accent`},{top:18,left:88,size:2,delay:2.1,hue:`neutral`},{top:35,left:8,size:2,delay:.9,hue:`neutral`},{top:45,left:92,size:2,delay:1.7,hue:`neutral`},{top:55,left:25,size:3,delay:2.5,hue:`accent`},{top:65,left:78,size:2,delay:.3,hue:`neutral`},{top:75,left:45,size:2,delay:1.1,hue:`neutral`},{top:82,left:60,size:3,delay:1.8,hue:`accent`},{top:30,left:55,size:2,delay:.4,hue:`neutral`},{top:88,left:18,size:2,delay:2.3,hue:`neutral`}],_P=i`
4818
4825
  <svg viewBox="0 0 120 120" fill="none">
4819
4826
  <defs>
4820
4827
  <linearGradient id="dream-lob-g" x1="0%" y1="0%" x2="100%" y2="100%">
@@ -4848,36 +4855,36 @@ ${e}
4848
4855
  fill="none"
4849
4856
  />
4850
4857
  </svg>
4851
- `;function hP(e){let t=!e.active,n=e.dreamingOf??fP();return i`
4858
+ `;function vP(e){let t=!e.active,n=e.dreamingOf??hP();return i`
4852
4859
  <div class="dreams-page">
4853
4860
  <!-- ── Sub-tab bar ── -->
4854
4861
  <nav class="dreams__tabs">
4855
4862
  <button
4856
- class="dreams__tab ${YN===`scene`?`dreams__tab--active`:``}"
4857
- @click=${()=>{YN=`scene`,e.onRequestUpdate?.()}}
4863
+ class="dreams__tab ${QN===`scene`?`dreams__tab--active`:``}"
4864
+ @click=${()=>{QN=`scene`,e.onRequestUpdate?.()}}
4858
4865
  >
4859
4866
  ${p(`dreaming.tabs.scene`)}
4860
4867
  </button>
4861
4868
  <button
4862
- class="dreams__tab ${YN===`diary`?`dreams__tab--active`:``}"
4863
- @click=${()=>{YN=`diary`,e.onRequestUpdate?.()}}
4869
+ class="dreams__tab ${QN===`diary`?`dreams__tab--active`:``}"
4870
+ @click=${()=>{QN=`diary`,e.onRequestUpdate?.()}}
4864
4871
  >
4865
4872
  ${p(`dreaming.tabs.diary`)}
4866
4873
  </button>
4867
4874
  <button
4868
- class="dreams__tab ${YN===`advanced`?`dreams__tab--active`:``}"
4869
- @click=${()=>{YN=`advanced`,e.onRequestUpdate?.()}}
4875
+ class="dreams__tab ${QN===`advanced`?`dreams__tab--active`:``}"
4876
+ @click=${()=>{QN=`advanced`,e.onRequestUpdate?.()}}
4870
4877
  >
4871
4878
  ${p(`dreaming.tabs.advanced`)}
4872
4879
  </button>
4873
4880
  </nav>
4874
4881
 
4875
- ${YN===`scene`?vP(e,t,n):YN===`diary`?zP(e):FP(e)}
4882
+ ${QN===`scene`?xP(e,t,n):QN===`diary`?HP(e):RP(e)}
4876
4883
  </div>
4877
- `}function gP(e){return e.split(`
4878
- `).map(e=>e.trim()).filter(e=>e.length>0&&e!==`What Happened`&&e!==`Reflections`&&e!==`Candidates`&&e!==`Possible Lasting Updates`).map(e=>e.replace(/\s*\[memory\/[^\]]+\]/g,``)).map(e=>e.replace(/^(?:\d+\.\s+|-\s+(?:\[[^\]]+\]\s+)?(?:[a-z_]+:\s+)?)/i,``).replace(/^(?:likely_durable|likely_situational|unclear):\s+/i,``).trim()).filter(e=>e.length>0)}function _P(e){return e?new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`}):`—`}function vP(e,t,n){return i`
4884
+ `}function yP(e){return e.split(`
4885
+ `).map(e=>e.trim()).filter(e=>e.length>0&&e!==`What Happened`&&e!==`Reflections`&&e!==`Candidates`&&e!==`Possible Lasting Updates`).map(e=>e.replace(/\s*\[memory\/[^\]]+\]/g,``)).map(e=>e.replace(/^(?:\d+\.\s+|-\s+(?:\[[^\]]+\]\s+)?(?:[a-z_]+:\s+)?)/i,``).replace(/^(?:likely_durable|likely_situational|unclear):\s+/i,``).trim()).filter(e=>e.length>0)}function bP(e){return e?new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`}):`—`}function xP(e,t,n){return i`
4879
4886
  <section class="dreams ${t?`dreams--idle`:``}">
4880
- ${pP.map(e=>i`
4887
+ ${gP.map(e=>i`
4881
4888
  <div
4882
4889
  class="dreams__star"
4883
4890
  style="
@@ -4908,7 +4915,7 @@ ${e}
4908
4915
  `:g}
4909
4916
 
4910
4917
  <div class="dreams__glow"></div>
4911
- <div class="dreams__lobster">${mP}</div>
4918
+ <div class="dreams__lobster">${_P}</div>
4912
4919
  <span class="dreams__z">z</span>
4913
4920
  <span class="dreams__z">z</span>
4914
4921
  <span class="dreams__z">Z</span>
@@ -4929,7 +4936,7 @@ ${e}
4929
4936
 
4930
4937
  <!-- Sleep phases -->
4931
4938
  <div class="dreams__phases">
4932
- ${Object.keys(GN).map(t=>{let n=e.phases?.[t],r=n!==void 0,a=n?.enabled===!0,o=_P(n?.nextRunAtMs),s=p(GN[t]),c=r?a?o:p(`dreaming.phase.off`):`—`;return i`
4939
+ ${Object.keys(JN).map(t=>{let n=e.phases?.[t],r=n!==void 0,a=n?.enabled===!0,o=bP(n?.nextRunAtMs),s=p(JN[t]),c=r?a?o:p(`dreaming.phase.off`):`—`;return i`
4933
4940
  <div class="dreams__phase ${r&&!a?`dreams__phase--off`:``}">
4934
4941
  <div class="dreams__phase-dot ${a?`dreams__phase-dot--on`:``}"></div>
4935
4942
  <span class="dreams__phase-name">${s}</span>
@@ -4940,40 +4947,40 @@ ${e}
4940
4947
 
4941
4948
  ${e.statusError?i`<div class="dreams__controls-error">${e.statusError}</div>`:g}
4942
4949
  </section>
4943
- `}function yP(e,t,n){return t===n?`${e}:${t}`:`${e}:${t}-${n}`}function bP(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):e}function xP(e){return e.replace(/\\/g,`/`).split(`/`).findLast(Boolean)??e}function SP(e){switch(e){case`entity`:return`entity`;case`concept`:return`concept`;case`source`:return`source`;case`synthesis`:return`synthesis`;case`report`:return`report`}return e}function CP(e){if(e.digestStatus===`withheld`)return`needs review`;switch(e.riskLevel){case`low`:return`low risk`;case`medium`:return`medium risk`;case`high`:return`high risk`;case`unknown`:return`unknown risk`}return`unknown risk`}function wP(e,t,n){e.has(t)?e.delete(t):e.add(t),n?.()}async function TP(e,t){eP=!0,tP=!0,nP=xP(e),rP=e,iP=null,aP=``,oP=null,sP=!1,cP=null,t.onRequestUpdate?.();try{let n=await t.onOpenWikiPage(e);if(!n){cP=`No wiki page found for ${e}.`;return}nP=n.title,rP=n.path,iP=n.updatedAt??null,aP=n.content,oP=typeof n.totalLines==`number`?n.totalLines:null,sP=n.truncated===!0}catch(e){cP=String(e)}finally{tP=!1,t.onRequestUpdate?.()}}function EP(e){eP=!1,tP=!1,nP=``,rP=``,iP=null,aP=``,oP=null,sP=!1,cP=null,e?.()}function DP(e){return eP?i`
4950
+ `}function SP(e,t,n){return t===n?`${e}:${t}`:`${e}:${t}-${n}`}function CP(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):e}function wP(e){return e.replace(/\\/g,`/`).split(`/`).findLast(Boolean)??e}function TP(e){switch(e){case`entity`:return`entity`;case`concept`:return`concept`;case`source`:return`source`;case`synthesis`:return`synthesis`;case`report`:return`report`}return e}function EP(e){if(e.digestStatus===`withheld`)return`needs review`;switch(e.riskLevel){case`low`:return`low risk`;case`medium`:return`medium risk`;case`high`:return`high risk`;case`unknown`:return`unknown risk`}return`unknown risk`}function DP(e,t,n){e.has(t)?e.delete(t):e.add(t),n?.()}async function OP(e,t){rP=!0,iP=!0,aP=wP(e),oP=e,sP=null,cP=``,lP=null,uP=!1,dP=null,t.onRequestUpdate?.();try{let n=await t.onOpenWikiPage(e);if(!n){dP=`No wiki page found for ${e}.`;return}aP=n.title,oP=n.path,sP=n.updatedAt??null,cP=n.content,lP=typeof n.totalLines==`number`?n.totalLines:null,uP=n.truncated===!0}catch(e){dP=String(e)}finally{iP=!1,t.onRequestUpdate?.()}}function kP(e){rP=!1,iP=!1,aP=``,oP=``,sP=null,cP=``,lP=null,uP=!1,dP=null,e?.()}function AP(e){return rP?i`
4944
4951
  <div
4945
4952
  class="dreams-diary__preview-backdrop"
4946
- @click=${()=>EP(e.onRequestUpdate)}
4953
+ @click=${()=>kP(e.onRequestUpdate)}
4947
4954
  >
4948
4955
  <div class="dreams-diary__preview-panel" @click=${e=>e.stopPropagation()}>
4949
4956
  <div class="dreams-diary__preview-header">
4950
4957
  <div>
4951
- <div class="dreams-diary__preview-title">${nP||`Wiki page`}</div>
4958
+ <div class="dreams-diary__preview-title">${aP||`Wiki page`}</div>
4952
4959
  <div class="dreams-diary__preview-meta">
4953
- ${rP} ${iP?` · ${iP}`:``}
4960
+ ${oP} ${sP?` · ${sP}`:``}
4954
4961
  </div>
4955
4962
  </div>
4956
4963
  <button
4957
4964
  class="btn btn--subtle btn--sm"
4958
- @click=${()=>EP(e.onRequestUpdate)}
4965
+ @click=${()=>kP(e.onRequestUpdate)}
4959
4966
  >
4960
4967
  Close
4961
4968
  </button>
4962
4969
  </div>
4963
4970
  <div class="dreams-diary__preview-body">
4964
- ${tP?i`<div class="dreams-diary__empty-text">Loading wiki page…</div>`:cP?i`<div class="dreams-diary__error">${cP}</div>`:i`
4965
- ${sP?i`
4971
+ ${iP?i`<div class="dreams-diary__empty-text">Loading wiki page…</div>`:dP?i`<div class="dreams-diary__error">${dP}</div>`:i`
4972
+ ${uP?i`
4966
4973
  <div class="dreams-diary__preview-hint">
4967
4974
  Showing the first chunk of this
4968
- page${oP===null?``:` (${oP} total lines)`}.
4975
+ page${lP===null?``:` (${lP} total lines)`}.
4969
4976
  </div>
4970
4977
  `:g}
4971
- <pre class="dreams-diary__preview-pre">${aP}</pre>
4978
+ <pre class="dreams-diary__preview-pre">${cP}</pre>
4972
4979
  `}
4973
4980
  </div>
4974
4981
  </div>
4975
4982
  </div>
4976
- `:g}function OP(){switch(XN){case`dreams`:return i`
4983
+ `:g}function jP(){switch($N){case`dreams`:return i`
4977
4984
  <p class="dreams-diary__explainer">
4978
4985
  This is the raw dream diary the system writes while replaying and consolidating memory;
4979
4986
  use it to inspect what the memory system is noticing, and where it still looks noisy or
@@ -4990,7 +4997,7 @@ ${e}
4990
4997
  inspect actual memory pages, claims, open questions, and contradictions rather than raw
4991
4998
  imported source chats.
4992
4999
  </p>
4993
- `}return g}function kP(e){if(!e)return-1/0;let t=Date.parse(e);return Number.isFinite(t)?t:-1/0}function AP(e,t){let n=kP(e.lastRecalledAt),r=kP(t.lastRecalledAt);return r===n?t.totalSignalCount===e.totalSignalCount?e.path.localeCompare(t.path):t.totalSignalCount-e.totalSignalCount:r-n}function jP(e,t){return t.totalSignalCount===e.totalSignalCount?t.phaseHitCount===e.phaseHitCount?AP(e,t):t.phaseHitCount-e.phaseHitCount:t.totalSignalCount-e.totalSignalCount}function MP(e,t){return t===`signals`?Xa(e,jP):Xa(e,AP)}function NP(e){let t=e.groundedCount>0,n=e.recallCount>0||e.dailyCount>0;return p(t&&n?`dreaming.advanced.originMixed`:t?`dreaming.advanced.originDailyLog`:`dreaming.advanced.originLive`)}function PP(e){return i`
5000
+ `}return g}function MP(e){if(!e)return-1/0;let t=Date.parse(e);return Number.isFinite(t)?t:-1/0}function NP(e,t){let n=MP(e.lastRecalledAt),r=MP(t.lastRecalledAt);return r===n?t.totalSignalCount===e.totalSignalCount?e.path.localeCompare(t.path):t.totalSignalCount-e.totalSignalCount:r-n}function PP(e,t){return t.totalSignalCount===e.totalSignalCount?t.phaseHitCount===e.phaseHitCount?NP(e,t):t.phaseHitCount-e.phaseHitCount:t.totalSignalCount-e.totalSignalCount}function FP(e,t){return t===`signals`?Xa(e,PP):Xa(e,NP)}function IP(e){let t=e.groundedCount>0,n=e.recallCount>0||e.dailyCount>0;return p(t&&n?`dreaming.advanced.originMixed`:t?`dreaming.advanced.originDailyLog`:`dreaming.advanced.originLive`)}function LP(e){return i`
4994
5001
  <section class="dreams-advanced__section">
4995
5002
  <div class="dreams-advanced__section-header">
4996
5003
  <div class="dreams-advanced__section-copy">
@@ -5009,7 +5016,7 @@ ${e}
5009
5016
  ${e.badge?(()=>{let n=e.badge?.(t);return n?i`<span class="dreams-advanced__badge">${n}</span>`:g})():g}
5010
5017
  <div class="dreams-advanced__snippet">${t.snippet}</div>
5011
5018
  <div class="dreams-advanced__source">
5012
- ${yP(t.path,t.startLine,t.endLine)}
5019
+ ${SP(t.path,t.startLine,t.endLine)}
5013
5020
  </div>
5014
5021
  <div class="dreams-advanced__meta">
5015
5022
  ${e.meta(t).filter(e=>e.length>0).join(` · `)}
@@ -5019,7 +5026,7 @@ ${e}
5019
5026
  </div>
5020
5027
  `}
5021
5028
  </section>
5022
- `}function FP(e){let t=e.shortTermEntries.filter(e=>e.groundedCount>0),n=MP(e.shortTermEntries,ZN),r=p(`dreaming.advanced.description`),a=[`${t.length} ${p(`dreaming.advanced.summaryFromDailyLog`)}`,`${e.shortTermCount} ${p(`dreaming.advanced.summaryWaiting`)}`,`${e.promotedCount} ${p(`dreaming.advanced.summaryPromotedToday`)}`].join(` · `);return i`
5029
+ `}function RP(e){let t=e.shortTermEntries.filter(e=>e.groundedCount>0),n=FP(e.shortTermEntries,eP),r=p(`dreaming.advanced.description`),a=[`${t.length} ${p(`dreaming.advanced.summaryFromDailyLog`)}`,`${e.shortTermCount} ${p(`dreaming.advanced.summaryWaiting`)}`,`${e.promotedCount} ${p(`dreaming.advanced.summaryPromotedToday`)}`].join(` · `);return i`
5023
5030
  <section class="dreams-advanced">
5024
5031
  <div class="dreams-advanced__header">
5025
5032
  <div class="dreams-advanced__intro">
@@ -5087,7 +5094,7 @@ ${e}
5087
5094
  `:g}
5088
5095
 
5089
5096
  <div class="dreams-advanced__sections">
5090
- ${PP({titleKey:`dreaming.advanced.stagedTitle`,descriptionKey:`dreaming.advanced.stagedDescription`,emptyKey:`dreaming.advanced.emptyGrounded`,entries:t,controls:i`
5097
+ ${LP({titleKey:`dreaming.advanced.stagedTitle`,descriptionKey:`dreaming.advanced.stagedDescription`,emptyKey:`dreaming.advanced.emptyGrounded`,entries:t,controls:i`
5091
5098
  <button
5092
5099
  class="btn btn--subtle btn--sm"
5093
5100
  ?disabled=${e.modeSaving||e.dreamDiaryActionLoading}
@@ -5096,28 +5103,28 @@ ${e}
5096
5103
  ${p(`dreaming.scene.clearGrounded`)}
5097
5104
  </button>
5098
5105
  `,badge:()=>p(`dreaming.advanced.originDailyLog`),meta:e=>[e.groundedCount>0?`${e.groundedCount} ${p(`dreaming.stats.grounded`).toLowerCase()}`:``,e.recallCount>0?`${e.recallCount} recall`:``,e.dailyCount>0?`${e.dailyCount} daily`:``]})}
5099
- ${PP({titleKey:`dreaming.advanced.shortTermTitle`,descriptionKey:`dreaming.advanced.shortTermDescription`,emptyKey:`dreaming.advanced.emptyShortTerm`,entries:n,controls:i`
5106
+ ${LP({titleKey:`dreaming.advanced.shortTermTitle`,descriptionKey:`dreaming.advanced.shortTermDescription`,emptyKey:`dreaming.advanced.emptyShortTerm`,entries:n,controls:i`
5100
5107
  <div class="dreams-advanced__sort">
5101
5108
  <button
5102
- class="dreams-advanced__sort-btn ${ZN===`recent`?`dreams-advanced__sort-btn--active`:``}"
5103
- @click=${()=>{ZN=`recent`,e.onRequestUpdate?.()}}
5109
+ class="dreams-advanced__sort-btn ${eP===`recent`?`dreams-advanced__sort-btn--active`:``}"
5110
+ @click=${()=>{eP=`recent`,e.onRequestUpdate?.()}}
5104
5111
  >
5105
5112
  ${p(`dreaming.advanced.sortRecent`)}
5106
5113
  </button>
5107
5114
  <button
5108
- class="dreams-advanced__sort-btn ${ZN===`signals`?`dreams-advanced__sort-btn--active`:``}"
5109
- @click=${()=>{ZN=`signals`,e.onRequestUpdate?.()}}
5115
+ class="dreams-advanced__sort-btn ${eP===`signals`?`dreams-advanced__sort-btn--active`:``}"
5116
+ @click=${()=>{eP=`signals`,e.onRequestUpdate?.()}}
5110
5117
  >
5111
5118
  ${p(`dreaming.advanced.sortSignals`)}
5112
5119
  </button>
5113
5120
  </div>
5114
- `,badge:e=>NP(e),meta:e=>[`${e.totalSignalCount} ${p(`dreaming.stats.signals`).toLowerCase()}`,e.recallCount>0?`${e.recallCount} recall`:``,e.dailyCount>0?`${e.dailyCount} daily`:``,e.groundedCount>0?`${e.groundedCount} ${p(`dreaming.stats.grounded`).toLowerCase()}`:``,e.phaseHitCount>0?`${e.phaseHitCount} phase hit`:``]})}
5115
- ${PP({titleKey:`dreaming.advanced.promotedTitle`,descriptionKey:`dreaming.advanced.promotedDescription`,emptyKey:`dreaming.advanced.emptyPromoted`,entries:e.promotedEntries,badge:e=>NP(e),meta:e=>[e.promotedAt?`${p(`dreaming.advanced.updatedPrefix`)} ${bP(e.promotedAt)}`:``,e.groundedCount>0?`${e.groundedCount} ${p(`dreaming.stats.grounded`).toLowerCase()}`:``,e.totalSignalCount>0?`${e.totalSignalCount} ${p(`dreaming.stats.signals`).toLowerCase()}`:``]})}
5121
+ `,badge:e=>IP(e),meta:e=>[`${e.totalSignalCount} ${p(`dreaming.stats.signals`).toLowerCase()}`,e.recallCount>0?`${e.recallCount} recall`:``,e.dailyCount>0?`${e.dailyCount} daily`:``,e.groundedCount>0?`${e.groundedCount} ${p(`dreaming.stats.grounded`).toLowerCase()}`:``,e.phaseHitCount>0?`${e.phaseHitCount} phase hit`:``]})}
5122
+ ${LP({titleKey:`dreaming.advanced.promotedTitle`,descriptionKey:`dreaming.advanced.promotedDescription`,emptyKey:`dreaming.advanced.emptyPromoted`,entries:e.promotedEntries,badge:e=>IP(e),meta:e=>[e.promotedAt?`${p(`dreaming.advanced.updatedPrefix`)} ${CP(e.promotedAt)}`:``,e.groundedCount>0?`${e.groundedCount} ${p(`dreaming.stats.grounded`).toLowerCase()}`:``,e.totalSignalCount>0?`${e.totalSignalCount} ${p(`dreaming.stats.signals`).toLowerCase()}`:``]})}
5116
5123
  </div>
5117
5124
 
5118
5125
  ${e.statusError?i`<div class="dreams__controls-error">${e.statusError}</div>`:g}
5119
5126
  </section>
5120
- `}function IP(e){let t=e.wikiImportInsights?.clusters??[];if(e.wikiImportInsightsLoading&&t.length===0)return i`
5127
+ `}function zP(e){let t=e.wikiImportInsights?.clusters??[];if(e.wikiImportInsightsLoading&&t.length===0)return i`
5121
5128
  <div class="dreams-diary__empty">
5122
5129
  <div class="dreams-diary__empty-text">Loading imported insights…</div>
5123
5130
  </div>
@@ -5128,12 +5135,12 @@ ${e}
5128
5135
  Run a ChatGPT import with apply to surface clustered imported insights here.
5129
5136
  </div>
5130
5137
  </div>
5131
- `;uP=t.length;let n=Math.max(0,Math.min(lP,t.length-1)),r=t[n];return i`
5138
+ `;pP=t.length;let n=Math.max(0,Math.min(fP,t.length-1)),r=t[n];return i`
5132
5139
  <div class="dreams-diary__daychips">
5133
5140
  ${t.map((t,r)=>i`
5134
5141
  <button
5135
5142
  class="dreams-diary__day-chip ${r===n?`dreams-diary__day-chip--active`:``}"
5136
- @click=${()=>{dP(r),e.onRequestUpdate?.()}}
5143
+ @click=${()=>{mP(r),e.onRequestUpdate?.()}}
5137
5144
  >
5138
5145
  ${t.label}
5139
5146
  </button>
@@ -5154,22 +5161,22 @@ ${e}
5154
5161
  </p>
5155
5162
  </div>
5156
5163
  <div class="dreams-diary__insights">
5157
- ${r.items.map(t=>{let n=QN.has(t.pagePath);return i`
5164
+ ${r.items.map(t=>{let n=tP.has(t.pagePath);return i`
5158
5165
  <article
5159
5166
  class="dreams-diary__insight-card dreams-diary__insight-card--clickable"
5160
5167
  data-import-page=${t.pagePath}
5161
- @click=${()=>wP(QN,t.pagePath,e.onRequestUpdate)}
5168
+ @click=${()=>DP(tP,t.pagePath,e.onRequestUpdate)}
5162
5169
  >
5163
5170
  <div class="dreams-diary__insight-topline">
5164
5171
  <div class="dreams-diary__insight-title">${t.title}</div>
5165
5172
  <span
5166
5173
  class="dreams-diary__insight-badge dreams-diary__insight-badge--${t.riskLevel}"
5167
5174
  >
5168
- ${CP(t)}
5175
+ ${EP(t)}
5169
5176
  </span>
5170
5177
  </div>
5171
5178
  <div class="dreams-diary__insight-meta">
5172
- ${t.updatedAt?bP(t.updatedAt):xP(t.pagePath)}
5179
+ ${t.updatedAt?CP(t.updatedAt):wP(t.pagePath)}
5173
5180
  ${t.activeBranchMessages>0?` · ${t.activeBranchMessages} messages`:``}
5174
5181
  </div>
5175
5182
  <p class="dreams-diary__insight-line">${t.summary}</p>
@@ -5222,13 +5229,13 @@ ${e}
5222
5229
  <div class="dreams-diary__insight-actions">
5223
5230
  <button
5224
5231
  class="btn btn--subtle btn--sm"
5225
- @click=${n=>{n.stopPropagation(),wP(QN,t.pagePath,e.onRequestUpdate)}}
5232
+ @click=${n=>{n.stopPropagation(),DP(tP,t.pagePath,e.onRequestUpdate)}}
5226
5233
  >
5227
5234
  ${n?`Hide details`:`Details`}
5228
5235
  </button>
5229
5236
  <button
5230
5237
  class="btn btn--subtle btn--sm"
5231
- @click=${n=>{n.stopPropagation(),TP(t.pagePath,e)}}
5238
+ @click=${n=>{n.stopPropagation(),OP(t.pagePath,e)}}
5232
5239
  >
5233
5240
  Open source page
5234
5241
  </button>
@@ -5237,7 +5244,7 @@ ${e}
5237
5244
  `})}
5238
5245
  </div>
5239
5246
  </article>
5240
- `}function LP(e){let t=e.wikiMemoryPalace?.clusters??[];if(e.wikiMemoryPalaceLoading&&t.length===0)return i`
5247
+ `}function BP(e){let t=e.wikiMemoryPalace?.clusters??[];if(e.wikiMemoryPalaceLoading&&t.length===0)return i`
5241
5248
  <div class="dreams-diary__empty">
5242
5249
  <div class="dreams-diary__empty-text">Loading memory palace…</div>
5243
5250
  </div>
@@ -5249,12 +5256,12 @@ ${e}
5249
5256
  useful once syntheses, entities, or concepts start getting written.
5250
5257
  </div>
5251
5258
  </div>
5252
- `;uP=t.length;let n=Math.max(0,Math.min(lP,t.length-1)),r=t[n];return i`
5259
+ `;pP=t.length;let n=Math.max(0,Math.min(fP,t.length-1)),r=t[n];return i`
5253
5260
  <div class="dreams-diary__daychips">
5254
5261
  ${t.map((t,r)=>i`
5255
5262
  <button
5256
5263
  class="dreams-diary__day-chip ${r===n?`dreams-diary__day-chip--active`:``}"
5257
- @click=${()=>{dP(r),e.onRequestUpdate?.()}}
5264
+ @click=${()=>{mP(r),e.onRequestUpdate?.()}}
5258
5265
  >
5259
5266
  ${t.label}
5260
5267
  </button>
@@ -5272,24 +5279,24 @@ ${e}
5272
5279
  <div class="dreams-diary__prose">
5273
5280
  <p class="dreams-diary__para">
5274
5281
  Compiled wiki pages currently grouped under ${r.label.toLowerCase()}.
5275
- ${r.updatedAt?` Latest update ${bP(r.updatedAt)}.`:``}
5282
+ ${r.updatedAt?` Latest update ${CP(r.updatedAt)}.`:``}
5276
5283
  </p>
5277
5284
  </div>
5278
5285
  <div class="dreams-diary__insights">
5279
- ${r.items.map(t=>{let n=$N.has(t.pagePath);return i`
5286
+ ${r.items.map(t=>{let n=nP.has(t.pagePath);return i`
5280
5287
  <article
5281
5288
  class="dreams-diary__insight-card dreams-diary__insight-card--clickable"
5282
5289
  data-palace-page=${t.pagePath}
5283
- @click=${()=>wP($N,t.pagePath,e.onRequestUpdate)}
5290
+ @click=${()=>DP(nP,t.pagePath,e.onRequestUpdate)}
5284
5291
  >
5285
5292
  <div class="dreams-diary__insight-topline">
5286
5293
  <div class="dreams-diary__insight-title">${t.title}</div>
5287
5294
  <span class="dreams-diary__insight-badge dreams-diary__insight-badge--palace">
5288
- ${SP(t.kind)}
5295
+ ${TP(t.kind)}
5289
5296
  </span>
5290
5297
  </div>
5291
5298
  <div class="dreams-diary__insight-meta">
5292
- ${t.updatedAt?bP(t.updatedAt):xP(t.pagePath)}
5299
+ ${t.updatedAt?CP(t.updatedAt):wP(t.pagePath)}
5293
5300
  · ${t.pagePath}
5294
5301
  </div>
5295
5302
  ${t.snippet?i`<p class="dreams-diary__insight-line">${t.snippet}</p>`:g}
@@ -5327,13 +5334,13 @@ ${e}
5327
5334
  <div class="dreams-diary__insight-actions">
5328
5335
  <button
5329
5336
  class="btn btn--subtle btn--sm"
5330
- @click=${n=>{n.stopPropagation(),wP($N,t.pagePath,e.onRequestUpdate)}}
5337
+ @click=${n=>{n.stopPropagation(),DP(nP,t.pagePath,e.onRequestUpdate)}}
5331
5338
  >
5332
5339
  ${n?`Hide details`:`Details`}
5333
5340
  </button>
5334
5341
  <button
5335
5342
  class="btn btn--subtle btn--sm"
5336
- @click=${n=>{n.stopPropagation(),TP(t.pagePath,e)}}
5343
+ @click=${n=>{n.stopPropagation(),OP(t.pagePath,e)}}
5337
5344
  >
5338
5345
  Open wiki page
5339
5346
  </button>
@@ -5342,7 +5349,7 @@ ${e}
5342
5349
  `})}
5343
5350
  </div>
5344
5351
  </article>
5345
- `}function RP(e){if(typeof e.dreamDiaryContent!=`string`)return i`
5352
+ `}function VP(e){if(typeof e.dreamDiaryContent!=`string`)return i`
5346
5353
  <div class="dreams-diary__empty">
5347
5354
  <div class="dreams-diary__empty-moon">
5348
5355
  <svg viewBox="0 0 32 32" fill="none" width="32" height="32">
@@ -5353,19 +5360,19 @@ ${e}
5353
5360
  <div class="dreams-diary__empty-text">${p(`dreaming.diary.noDreamsYet`)}</div>
5354
5361
  <div class="dreams-diary__empty-hint">${p(`dreaming.diary.noDreamsHint`)}</div>
5355
5362
  </div>
5356
- `;let t=BN(e.dreamDiaryContent);if(uP=t.length,t.length===0)return i`
5363
+ `;let t=UN(e.dreamDiaryContent);if(pP=t.length,t.length===0)return i`
5357
5364
  <div class="dreams-diary__empty">
5358
5365
  <div class="dreams-diary__empty-text">${p(`dreaming.diary.waitingTitle`)}</div>
5359
5366
  <div class="dreams-diary__empty-hint">${p(`dreaming.diary.waitingHint`)}</div>
5360
5367
  </div>
5361
- `;let n=UN(t),r=Math.max(0,Math.min(lP,n.length-1)),a=n[r];return i`
5368
+ `;let n=KN(t),r=Math.max(0,Math.min(fP,n.length-1)),a=n[r];return i`
5362
5369
  <div class="dreams-diary__daychips">
5363
5370
  ${n.map(t=>i`
5364
5371
  <button
5365
5372
  class="dreams-diary__day-chip ${t.page===r?`dreams-diary__day-chip--active`:``}"
5366
- @click=${()=>{dP(t.page),e.onRequestUpdate?.()}}
5373
+ @click=${()=>{mP(t.page),e.onRequestUpdate?.()}}
5367
5374
  >
5368
- ${HN(t.date)}
5375
+ ${GN(t.date)}
5369
5376
  </button>
5370
5377
  `)}
5371
5378
  </div>
@@ -5373,12 +5380,12 @@ ${e}
5373
5380
  <div class="dreams-diary__accent"></div>
5374
5381
  ${a.date?i`<time class="dreams-diary__date">${a.date}</time>`:g}
5375
5382
  <div class="dreams-diary__prose">
5376
- ${gP(a.body).map((e,t)=>i`<p class="dreams-diary__para" style="animation-delay: ${.3+t*.15}s;">
5383
+ ${yP(a.body).map((e,t)=>i`<p class="dreams-diary__para" style="animation-delay: ${.3+t*.15}s;">
5377
5384
  ${e}
5378
5385
  </p>`)}
5379
5386
  </div>
5380
5387
  </article>
5381
- `}function zP(e){let t=(XN===`insights`||XN===`palace`)&&!e.memoryWikiEnabled,n=XN===`dreams`?e.dreamDiaryError:XN===`insights`?e.wikiImportInsightsError:e.wikiMemoryPalaceError;return n&&!t?i`
5388
+ `}function HP(e){let t=($N===`insights`||$N===`palace`)&&!e.memoryWikiEnabled,n=$N===`dreams`?e.dreamDiaryError:$N===`insights`?e.wikiImportInsightsError:e.wikiMemoryPalaceError;return n&&!t?i`
5382
5389
  <section class="dreams-diary">
5383
5390
  <div class="dreams-diary__error">${n}</div>
5384
5391
  </section>
@@ -5389,33 +5396,33 @@ ${e}
5389
5396
  <span class="dreams-diary__title">${p(`dreaming.diary.title`)}</span>
5390
5397
  <div class="dreams-diary__subtabs">
5391
5398
  <button
5392
- class="dreams-diary__subtab ${XN===`dreams`?`dreams-diary__subtab--active`:``}"
5393
- @click=${()=>{EP(),XN=`dreams`,lP=0,e.onRequestUpdate?.()}}
5399
+ class="dreams-diary__subtab ${$N===`dreams`?`dreams-diary__subtab--active`:``}"
5400
+ @click=${()=>{kP(),$N=`dreams`,fP=0,e.onRequestUpdate?.()}}
5394
5401
  >
5395
5402
  Dreams
5396
5403
  </button>
5397
5404
  <button
5398
- class="dreams-diary__subtab ${XN===`insights`?`dreams-diary__subtab--active`:``}"
5399
- @click=${()=>{EP(),XN=`insights`,lP=0,e.onRequestUpdate?.()}}
5405
+ class="dreams-diary__subtab ${$N===`insights`?`dreams-diary__subtab--active`:``}"
5406
+ @click=${()=>{kP(),$N=`insights`,fP=0,e.onRequestUpdate?.()}}
5400
5407
  >
5401
5408
  Imported Insights
5402
5409
  </button>
5403
5410
  <button
5404
- class="dreams-diary__subtab ${XN===`palace`?`dreams-diary__subtab--active`:``}"
5405
- @click=${()=>{EP(),XN=`palace`,lP=0,e.onRequestUpdate?.()}}
5411
+ class="dreams-diary__subtab ${$N===`palace`?`dreams-diary__subtab--active`:``}"
5412
+ @click=${()=>{kP(),$N=`palace`,fP=0,e.onRequestUpdate?.()}}
5406
5413
  >
5407
5414
  Memory Palace
5408
5415
  </button>
5409
5416
  </div>
5410
5417
  <button
5411
5418
  class="btn btn--subtle btn--sm"
5412
- ?disabled=${t?!1:e.modeSaving||(XN===`dreams`?e.dreamDiaryLoading:XN===`insights`?e.wikiImportInsightsLoading:e.wikiMemoryPalaceLoading)}
5413
- @click=${()=>{lP=0,t?e.onOpenConfig():XN===`dreams`?e.onRefreshDiary():XN===`insights`?e.onRefreshImports():e.onRefreshMemoryPalace()}}
5419
+ ?disabled=${t?!1:e.modeSaving||($N===`dreams`?e.dreamDiaryLoading:$N===`insights`?e.wikiImportInsightsLoading:e.wikiMemoryPalaceLoading)}
5420
+ @click=${()=>{fP=0,t?e.onOpenConfig():$N===`dreams`?e.onRefreshDiary():$N===`insights`?e.onRefreshImports():e.onRefreshMemoryPalace()}}
5414
5421
  >
5415
- ${t?`How to enable`:XN===`dreams`?e.dreamDiaryLoading?p(`dreaming.diary.reloading`):p(`dreaming.diary.reload`):XN===`insights`?e.wikiImportInsightsLoading?`Reloading…`:`Reload`:e.wikiMemoryPalaceLoading?`Reloading…`:`Reload`}
5422
+ ${t?`How to enable`:$N===`dreams`?e.dreamDiaryLoading?p(`dreaming.diary.reloading`):p(`dreaming.diary.reload`):$N===`insights`?e.wikiImportInsightsLoading?`Reloading…`:`Reload`:e.wikiMemoryPalaceLoading?`Reloading…`:`Reload`}
5416
5423
  </button>
5417
5424
  </div>
5418
- ${OP()}
5425
+ ${jP()}
5419
5426
  </div>
5420
5427
 
5421
5428
  ${t?i`
@@ -5435,30 +5442,30 @@ ${e}
5435
5442
  </button>
5436
5443
  </div>
5437
5444
  </div>
5438
- `:XN===`dreams`?RP(e):XN===`insights`?IP(e):LP(e)}
5439
- ${DP(e)}
5445
+ `:$N===`dreams`?VP(e):$N===`insights`?zP(e):BP(e)}
5446
+ ${AP(e)}
5440
5447
  </section>
5441
- `}function BP(e){let t=e.trim();if(!t||UP(t))return t;let n=t.match(/^\/(?:home|Users)\/([^/]+)(.*)$/);if(n&&HP(n[1]))return VP(n[2]??``);let r=t.match(/^[A-Za-z]:[\\/]Users[\\/]([^\\/]+)(.*)$/i);return r&&HP(r[1])?VP(r[2]??``):t}function VP(e){return`~${e.replace(/\\/g,`/`)}`}function HP(e){return e!==void 0&&e!==`.`&&e!==`..`}function UP(e){return/(^|[\\/])\.{1,2}(?=[\\/]|$)/.test(e)}function WP(e){let t=Math.floor(Math.max(0,e)/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m`:`${Math.floor(n/60)}h`}function GP(e,t,n){return t?i`<div class="exec-approval-meta-row">
5442
- <span>${e}</span><span>${n?.path?BP(t):t}</span>
5443
- </div>`:g}function KP(e){return i`
5448
+ `}function UP(e){let t=e.trim();if(!t||KP(t))return t;let n=t.match(/^\/(?:home|Users)\/([^/]+)(.*)$/);if(n&&GP(n[1]))return WP(n[2]??``);let r=t.match(/^[A-Za-z]:[\\/]Users[\\/]([^\\/]+)(.*)$/i);return r&&GP(r[1])?WP(r[2]??``):t}function WP(e){return`~${e.replace(/\\/g,`/`)}`}function GP(e){return e!==void 0&&e!==`.`&&e!==`..`}function KP(e){return/(^|[\\/])\.{1,2}(?=[\\/]|$)/.test(e)}function qP(e){let t=Math.floor(Math.max(0,e)/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m`:`${Math.floor(n/60)}h`}function JP(e,t,n){return t?i`<div class="exec-approval-meta-row">
5449
+ <span>${e}</span><span>${n?.path?UP(t):t}</span>
5450
+ </div>`:g}function YP(e){return i`
5444
5451
  <div class="exec-approval-command mono">${e.command}</div>
5445
5452
  <div class="exec-approval-meta">
5446
- ${GP(`Host`,e.host)} ${GP(`Agent`,e.agentId)}
5447
- ${GP(`Session`,e.sessionKey)}
5448
- ${GP(`CWD`,e.cwd,{path:!0})}
5449
- ${GP(`Resolved`,e.resolvedPath,{path:!0})}
5450
- ${GP(`Security`,e.security)} ${GP(`Ask`,e.ask)}
5453
+ ${JP(`Host`,e.host)} ${JP(`Agent`,e.agentId)}
5454
+ ${JP(`Session`,e.sessionKey)}
5455
+ ${JP(`CWD`,e.cwd,{path:!0})}
5456
+ ${JP(`Resolved`,e.resolvedPath,{path:!0})}
5457
+ ${JP(`Security`,e.security)} ${JP(`Ask`,e.ask)}
5451
5458
  </div>
5452
- `}function qP(e){return i`
5459
+ `}function XP(e){return i`
5453
5460
  ${e.pluginDescription?i`<pre class="exec-approval-command mono" style="white-space:pre-wrap">
5454
5461
  ${e.pluginDescription}</pre
5455
5462
  >`:g}
5456
5463
  <div class="exec-approval-meta">
5457
- ${GP(`Severity`,e.pluginSeverity)}
5458
- ${GP(`Plugin`,e.pluginId)} ${GP(`Agent`,e.request.agentId)}
5459
- ${GP(`Session`,e.request.sessionKey)}
5464
+ ${JP(`Severity`,e.pluginSeverity)}
5465
+ ${JP(`Plugin`,e.pluginId)} ${JP(`Agent`,e.request.agentId)}
5466
+ ${JP(`Session`,e.request.sessionKey)}
5460
5467
  </div>
5461
- `}function JP(e){let t=e.execApprovalQueue[0];if(!t)return g;let n=t.request,r=t.expiresAtMs-Date.now(),a=r>0?`expires in ${WP(r)}`:`expired`,o=e.execApprovalQueue.length,s=t.kind===`plugin`;return i`
5468
+ `}function ZP(e){let t=e.execApprovalQueue[0];if(!t)return g;let n=t.request,r=t.expiresAtMs-Date.now(),a=r>0?`expires in ${qP(r)}`:`expired`,o=e.execApprovalQueue.length,s=t.kind===`plugin`;return i`
5462
5469
  <div class="exec-approval-overlay" role="dialog" aria-live="polite">
5463
5470
  <div class="exec-approval-card">
5464
5471
  <div class="exec-approval-header">
@@ -5468,7 +5475,7 @@ ${e.pluginDescription}</pre
5468
5475
  </div>
5469
5476
  ${o>1?i`<div class="exec-approval-queue">${o} pending</div>`:g}
5470
5477
  </div>
5471
- ${s?qP(t):KP(n)}
5478
+ ${s?XP(t):YP(n)}
5472
5479
  ${e.execApprovalError?i`<div class="exec-approval-error">${e.execApprovalError}</div>`:g}
5473
5480
  <div class="exec-approval-actions">
5474
5481
  <button
@@ -5495,7 +5502,7 @@ ${e.pluginDescription}</pre
5495
5502
  </div>
5496
5503
  </div>
5497
5504
  </div>
5498
- `}function YP(e){let{pendingGatewayUrl:t}=e;return t?i`
5505
+ `}function QP(e){let{pendingGatewayUrl:t}=e;return t?i`
5499
5506
  <div class="exec-approval-overlay" role="dialog" aria-modal="true" aria-live="polite">
5500
5507
  <div class="exec-approval-card">
5501
5508
  <div class="exec-approval-header">
@@ -5518,20 +5525,20 @@ ${e.pluginDescription}</pre
5518
5525
  </div>
5519
5526
  </div>
5520
5527
  </div>
5521
- `:g}async function XP(e){try{await navigator.clipboard.writeText(e)}catch{}}function ZP(e){return i`
5528
+ `:g}async function $P(e){try{await navigator.clipboard.writeText(e)}catch{}}function eF(e){return i`
5522
5529
  <div
5523
5530
  class="login-gate__command"
5524
5531
  role="button"
5525
5532
  tabindex="0"
5526
5533
  title="Copy command"
5527
5534
  aria-label=${`Copy command: ${e}`}
5528
- @click=${async t=>{t.target?.closest(`.chat-copy-btn`)||await XP(e)}}
5529
- @keydown=${async t=>{t.key!==`Enter`&&t.key!==` `||(t.preventDefault(),await XP(e))}}
5535
+ @click=${async t=>{t.target?.closest(`.chat-copy-btn`)||await $P(e)}}
5536
+ @keydown=${async t=>{t.key!==`Enter`&&t.key!==` `||(t.preventDefault(),await $P(e))}}
5530
5537
  >
5531
5538
  <code>${e}</code>
5532
5539
  ${QT(e,`Copy command`)}
5533
5540
  </div>
5534
- `}function QP(e){return i`
5541
+ `}function tF(e){return i`
5535
5542
  <div class="login-gate">
5536
5543
  <div class="login-gate__card">
5537
5544
  <div class="login-gate__header">
@@ -5606,8 +5613,8 @@ ${e.pluginDescription}</pre
5606
5613
  <div class="login-gate__help">
5607
5614
  <div class="login-gate__help-title">${p(`overview.connection.title`)}</div>
5608
5615
  <ol class="login-gate__steps">
5609
- <li>${p(`overview.connection.step1`)}${ZP(`genesis gateway run`)}</li>
5610
- <li>${p(`overview.connection.step2`)} ${ZP(`genesis dashboard`)}</li>
5616
+ <li>${p(`overview.connection.step1`)}${eF(`genesis gateway run`)}</li>
5617
+ <li>${p(`overview.connection.step2`)} ${eF(`genesis dashboard`)}</li>
5611
5618
  <li>${p(`overview.connection.step3`)}</li>
5612
5619
  </ol>
5613
5620
  <div class="login-gate__docs">
@@ -5622,13 +5629,13 @@ ${e.pluginDescription}</pre
5622
5629
  </div>
5623
5630
  </div>
5624
5631
  </div>
5625
- `}var $P=[{id:`notion`,name:`notion`,label:`Notion`,description:`Search, read, and update Notion pages and databases.`,icon:`📝`,url:`https://mcp.notion.com/mcp`,transport:`streamable-http`,authKind:`oauth`},{id:`linear`,name:`linear`,label:`Linear`,description:`Manage Linear issues, projects, and cycles.`,icon:`📐`,url:`https://mcp.linear.app/mcp`,transport:`streamable-http`,authKind:`oauth`},{id:`sentry`,name:`sentry`,label:`Sentry`,description:`Inspect Sentry issues, events, and releases.`,icon:`🛡️`,url:`https://mcp.sentry.dev/mcp`,transport:`streamable-http`,authKind:`oauth`},{id:`github`,name:`github`,label:`GitHub`,description:`Repositories, issues, and pull requests via a personal access token.`,icon:`🐙`,url:`https://api.githubcopilot.com/mcp/`,transport:`streamable-http`,authKind:`bearer`,tokenLabel:`GitHub personal access token`,tokenDocsUrl:`https://github.com/settings/personal-access-tokens`},{id:`context7`,name:`context7`,label:`Context7`,description:`Up-to-date library and framework documentation.`,icon:`📚`,url:`https://mcp.context7.com/mcp`,transport:`streamable-http`,authKind:`none`}];function eF(e,t,n){let r=t.trim();if(!r)return e;let i=n?.header??`Authorization`,a=n?.prefix??`Bearer `,o=e.headers&&typeof e.headers==`object`&&!Array.isArray(e.headers)?e.headers:{};return{...e,headers:{...o,[i]:`${a}${r}`}}}function tF(e,t){let n={url:e.url,transport:e.transport};return e.authKind===`oauth`?(n.auth={type:`oauth`},n):e.authKind===`bearer`?eF(n,t,{header:e.tokenHeader,prefix:e.tokenPrefix}):n}function nF(e){return e===`error`?`danger`:e===`warning`?`warn`:``}function rF(e){return e in J?J[e]:J.radio}function iF(e){return e.items.length===0?g:i`
5632
+ `}var nF=[{id:`notion`,name:`notion`,label:`Notion`,description:`Search, read, and update Notion pages and databases.`,icon:`📝`,url:`https://mcp.notion.com/mcp`,transport:`streamable-http`,authKind:`oauth`},{id:`linear`,name:`linear`,label:`Linear`,description:`Manage Linear issues, projects, and cycles.`,icon:`📐`,url:`https://mcp.linear.app/mcp`,transport:`streamable-http`,authKind:`oauth`},{id:`sentry`,name:`sentry`,label:`Sentry`,description:`Inspect Sentry issues, events, and releases.`,icon:`🛡️`,url:`https://mcp.sentry.dev/mcp`,transport:`streamable-http`,authKind:`oauth`},{id:`github`,name:`github`,label:`GitHub`,description:`Repositories, issues, and pull requests via a personal access token.`,icon:`🐙`,url:`https://api.githubcopilot.com/mcp/`,transport:`streamable-http`,authKind:`bearer`,tokenLabel:`GitHub personal access token`,tokenDocsUrl:`https://github.com/settings/personal-access-tokens`},{id:`context7`,name:`context7`,label:`Context7`,description:`Up-to-date library and framework documentation.`,icon:`📚`,url:`https://mcp.context7.com/mcp`,transport:`streamable-http`,authKind:`none`}];function rF(e,t,n){let r=t.trim();if(!r)return e;let i=n?.header??`Authorization`,a=n?.prefix??`Bearer `,o=e.headers&&typeof e.headers==`object`&&!Array.isArray(e.headers)?e.headers:{};return{...e,headers:{...o,[i]:`${a}${r}`}}}function iF(e,t){let n={url:e.url,transport:e.transport};return e.authKind===`oauth`?(n.auth={type:`oauth`},n):e.authKind===`bearer`?rF(n,t,{header:e.tokenHeader,prefix:e.tokenPrefix}):n}function aF(e){return e===`error`?`danger`:e===`warning`?`warn`:``}function oF(e){return e in J?J[e]:J.radio}function sF(e){return e.items.length===0?g:i`
5626
5633
  <section class="card ov-attention">
5627
5634
  <div class="card-title">${p(`overview.attention.title`)}</div>
5628
5635
  <div class="ov-attention-list">
5629
5636
  ${e.items.map(e=>i`
5630
- <div class="ov-attention-item ${nF(e.severity)}">
5631
- <span class="ov-attention-icon">${rF(e.icon)}</span>
5637
+ <div class="ov-attention-item ${aF(e.severity)}">
5638
+ <span class="ov-attention-icon">${oF(e.icon)}</span>
5632
5639
  <div class="ov-attention-body">
5633
5640
  <div class="ov-attention-title">${e.title}</div>
5634
5641
  <div class="muted">${e.description}</div>
@@ -5636,21 +5643,21 @@ ${e.pluginDescription}</pre
5636
5643
  ${e.href?i`<a
5637
5644
  class="ov-attention-link"
5638
5645
  href=${e.href}
5639
- target=${e.external?zj:g}
5640
- rel=${e.external?Bj():g}
5646
+ target=${e.external?Hj:g}
5647
+ rel=${e.external?Uj():g}
5641
5648
  >${p(`common.docs`)}</a
5642
5649
  >`:g}
5643
5650
  </div>
5644
5651
  `)}
5645
5652
  </div>
5646
5653
  </section>
5647
- `}function aF(e){let t=e.ts??null;return t?T(t):p(`common.na`)}function oF(e){return e?`${new Date(e).toLocaleDateString(void 0,{weekday:`short`})}, ${C(e)} (${T(e)})`:p(`common.na`)}function sF(e){if(e.totalTokens==null)return p(`common.na`);let t=e.totalTokens??0,n=e.contextTokens??0;return n?`${t} / ${n}`:String(t)}function cF(e){if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return w(e)}}function lF(e){let t=e.state??{},n=t.nextRunAtMs?C(t.nextRunAtMs):p(`common.na`),r=t.lastRunAtMs?C(t.lastRunAtMs):p(`common.na`);return`${t.lastStatus??p(`common.na`)} · next ${n} · last ${r}`}function uF(e){let t=e.schedule;if(t.kind===`at`){let e=Date.parse(t.at);return Number.isFinite(e)?`At ${C(e)}`:`At ${t.at}`}return t.kind===`every`?`Every ${ee(t.everyMs)}`:`Cron ${t.expr}${t.tz?` (${t.tz})`:``}`}function dF(e){let t=e.payload;if(t.kind===`systemEvent`)return`System: ${t.text}`;let n=`Agent: ${t.message}`,r=e.delivery;if(r&&r.mode!==`none`){let e=r.mode===`webhook`?r.to?` (${r.to})`:``:r.channel||r.to?` (${r.channel??`last`}${r.to?` -> ${r.to}`:``})`:``;return`${n} · ${r.mode}${e}`}return n}var fF=/\d{3,}/g;function pF(e){return i`${Uy(e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(fF,e=>`<span class="blur-digits">${e}</span>`))}`}function mF(e,t){return i`
5654
+ `}function cF(e){let t=e.ts??null;return t?T(t):p(`common.na`)}function lF(e){return e?`${new Date(e).toLocaleDateString(void 0,{weekday:`short`})}, ${C(e)} (${T(e)})`:p(`common.na`)}function uF(e){if(e.totalTokens==null)return p(`common.na`);let t=e.totalTokens??0,n=e.contextTokens??0;return n?`${t} / ${n}`:String(t)}function dF(e){if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return w(e)}}function fF(e){let t=e.state??{},n=t.nextRunAtMs?C(t.nextRunAtMs):p(`common.na`),r=t.lastRunAtMs?C(t.lastRunAtMs):p(`common.na`);return`${t.lastStatus??p(`common.na`)} · next ${n} · last ${r}`}function pF(e){let t=e.schedule;if(t.kind===`at`){let e=Date.parse(t.at);return Number.isFinite(e)?`At ${C(e)}`:`At ${t.at}`}return t.kind===`every`?`Every ${ee(t.everyMs)}`:`Cron ${t.expr}${t.tz?` (${t.tz})`:``}`}function mF(e){let t=e.payload;if(t.kind===`systemEvent`)return`System: ${t.text}`;let n=`Agent: ${t.message}`,r=e.delivery;if(r&&r.mode!==`none`){let e=r.mode===`webhook`?r.to?` (${r.to})`:``:r.channel||r.to?` (${r.channel??`last`}${r.to?` -> ${r.to}`:``})`:``;return`${n} · ${r.mode}${e}`}return n}var hF=/\d{3,}/g;function gF(e){return i`${Uy(e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(hF,e=>`<span class="blur-digits">${e}</span>`))}`}function _F(e,t){return i`
5648
5655
  <button class="ov-card" data-kind=${e.kind} @click=${()=>t(e.tab)}>
5649
5656
  <span class="ov-card__label">${e.label}</span>
5650
5657
  <span class="ov-card__value">${e.value}</span>
5651
5658
  <span class="ov-card__hint">${e.hint}</span>
5652
5659
  </button>
5653
- `}function hF(){return i`
5660
+ `}function vF(){return i`
5654
5661
  <section class="ov-cards">
5655
5662
  ${[0,1,2,3].map(e=>i`
5656
5663
  <div class="ov-card" style="cursor:default;animation-delay:${e*50}ms">
@@ -5660,12 +5667,12 @@ ${e.pluginDescription}</pre
5660
5667
  </div>
5661
5668
  `)}
5662
5669
  </section>
5663
- `}function gF(e){if(!(e.usageResult!=null||e.sessionsResult!=null||e.skillsReport!=null))return hF();let t=e.usageResult?.totals,n=ne(t?.totalCost),r=b(t?.totalTokens),a=t?String(e.usageResult?.aggregates?.messages?.total??0):`0`,o=e.sessionsResult?.count??null,s=e.skillsReport?.skills??[],c=s.filter(e=>!e.disabled).length,l=s.filter(e=>e.blockedByAllowlist).length,u=s.length,d=e.cronStatus?.enabled??null,f=e.cronStatus?.nextWakeAtMs??null,m=e.cronJobs.length,h=e.cronJobs.filter(e=>e.state?.lastStatus===`error`).length,_=d==null?p(`common.na`):d?`${m} jobs`:p(`common.disabled`),v=h>0?i`<span class="danger">${h} failed</span>`:f?p(`overview.stats.cronNext`,{time:oF(f)}):``,y=[{kind:`cost`,tab:`usage`,label:p(`overview.cards.cost`),value:n,hint:`${r} tokens · ${a} msgs`},{kind:`sessions`,tab:`sessions`,label:p(`overview.stats.sessions`),value:String(o??p(`common.na`)),hint:p(`overview.stats.sessionsHint`)},{kind:`skills`,tab:`skills`,label:p(`overview.cards.skills`),value:`${c}/${u}`,hint:l>0?`${l} blocked`:`${c} active`},{kind:`cron`,tab:`cron`,label:p(`overview.stats.cron`),value:_,hint:v}],x=e.modelAuthStatus===null,S=(e.modelAuthStatus?.providers??[]).filter(Oh);if(x)y.push({kind:`auth`,tab:`overview`,label:p(`overview.cards.modelAuth`),value:p(`common.na`),hint:``});else if(S.length>0){let e=S.filter(e=>e.status===`expired`||e.status===`missing`).length,t=S.filter(e=>e.status===`expiring`).length,n=e>0?i`<span class="danger"
5670
+ `}function yF(e){if(!(e.usageResult!=null||e.sessionsResult!=null||e.skillsReport!=null))return vF();let t=e.usageResult?.totals,n=ne(t?.totalCost),r=b(t?.totalTokens),a=t?String(e.usageResult?.aggregates?.messages?.total??0):`0`,o=e.sessionsResult?.count??null,s=e.skillsReport?.skills??[],c=s.filter(e=>!e.disabled).length,l=s.filter(e=>e.blockedByAllowlist).length,u=s.length,d=e.cronStatus?.enabled??null,f=e.cronStatus?.nextWakeAtMs??null,m=e.cronJobs.length,h=e.cronJobs.filter(e=>e.state?.lastStatus===`error`).length,_=d==null?p(`common.na`):d?`${m} jobs`:p(`common.disabled`),v=h>0?i`<span class="danger">${h} failed</span>`:f?p(`overview.stats.cronNext`,{time:lF(f)}):``,y=[{kind:`cost`,tab:`usage`,label:p(`overview.cards.cost`),value:n,hint:`${r} tokens · ${a} msgs`},{kind:`sessions`,tab:`sessions`,label:p(`overview.stats.sessions`),value:String(o??p(`common.na`)),hint:p(`overview.stats.sessionsHint`)},{kind:`skills`,tab:`skills`,label:p(`overview.cards.skills`),value:`${c}/${u}`,hint:l>0?`${l} blocked`:`${c} active`},{kind:`cron`,tab:`cron`,label:p(`overview.stats.cron`),value:_,hint:v}],x=e.modelAuthStatus===null,S=(e.modelAuthStatus?.providers??[]).filter(Oh);if(x)y.push({kind:`auth`,tab:`overview`,label:p(`overview.cards.modelAuth`),value:p(`common.na`),hint:``});else if(S.length>0){let e=S.filter(e=>e.status===`expired`||e.status===`missing`).length,t=S.filter(e=>e.status===`expiring`).length,n=e>0?i`<span class="danger"
5664
5671
  >${p(`overview.cards.modelAuthExpired`,{count:String(e)})}</span
5665
5672
  >`:t>0?i`<span class="warn"
5666
5673
  >${p(`overview.cards.modelAuthExpiring`,{count:String(t)})}</span
5667
5674
  >`:p(`overview.cards.modelAuthOk`,{count:String(S.length)}),r=(e,t)=>{if(!e||!Number.isFinite(e)||t>=25)return null;let n=new Date(e);return Number.isNaN(n.getTime())?null:e-Date.now()<1440*60*1e3?n.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`}):n.toLocaleDateString(void 0,{month:`short`,day:`numeric`})},a=S.map(e=>{let t=[];for(let n of e.usage?.windows??[]){let e=Math.max(0,Math.min(100,Math.round(100-n.usedPercent))),i=(n.label||``).trim(),a=i?`${i} `:``,o=p(`overview.cards.modelAuthUsageLeft`,{pct:String(e)}),s=r(n.resetAt,e);t.push(s?`${a}${o} (${s})`:`${a}${o}`)}return e.expiry&&Number.isFinite(e.expiry.at)&&e.status!==`static`&&e.expiry.label&&e.expiry.label!==`unknown`&&t.push(p(`overview.cards.modelAuthExpiresIn`,{when:e.expiry.label})),t.length>0?`${e.displayName}: ${t.join(`, `)}`:null}).filter(e=>e!==null).slice(0,2).join(` · `)||p(`overview.cards.modelAuthProviders`,{count:String(S.length)});y.push({kind:`auth`,tab:`overview`,label:p(`overview.cards.modelAuth`),value:n,hint:a})}let ee=e.sessionsResult?.sessions.slice(0,5)??[];return i`
5668
- <section class="ov-cards">${y.map(t=>mF(t,e.onNavigate))}</section>
5675
+ <section class="ov-cards">${y.map(t=>_F(t,e.onNavigate))}</section>
5669
5676
 
5670
5677
  ${ee.length>0?i`
5671
5678
  <section class="ov-recent">
@@ -5674,7 +5681,7 @@ ${e.pluginDescription}</pre
5674
5681
  ${ee.map(e=>i`
5675
5682
  <li class="ov-recent__row">
5676
5683
  <span class="ov-recent__key"
5677
- >${pF(e.displayName||e.label||e.key)}</span
5684
+ >${gF(e.displayName||e.label||e.key)}</span
5678
5685
  >
5679
5686
  <span class="ov-recent__model">${e.model??``}</span>
5680
5687
  <span class="ov-recent__time"
@@ -5685,7 +5692,7 @@ ${e.pluginDescription}</pre
5685
5692
  </ul>
5686
5693
  </section>
5687
5694
  `:g}
5688
- `}function _F(e){if(e.events.length===0)return g;let t=e.events.slice(0,20);return i`
5695
+ `}function bF(e){if(e.events.length===0)return g;let t=e.events.slice(0,20);return i`
5689
5696
  <details class="card ov-event-log" open>
5690
5697
  <summary class="ov-expandable-toggle">
5691
5698
  <span class="nav-item__icon">${J.radio}</span>
@@ -5698,13 +5705,13 @@ ${e.pluginDescription}</pre
5698
5705
  <span class="ov-event-log-ts">${new Date(e.ts).toLocaleTimeString()}</span>
5699
5706
  <span class="ov-event-log-name">${e.event}</span>
5700
5707
  ${e.payload?i`<span class="ov-event-log-payload muted"
5701
- >${cF(e.payload).slice(0,120)}</span
5708
+ >${dF(e.payload).slice(0,120)}</span
5702
5709
  >`:g}
5703
5710
  </div>
5704
5711
  `)}
5705
5712
  </div>
5706
5713
  </details>
5707
- `}var vF=new Set([L.AUTH_REQUIRED,L.AUTH_TOKEN_MISSING,L.AUTH_PASSWORD_MISSING,L.AUTH_TOKEN_NOT_CONFIGURED,L.AUTH_PASSWORD_NOT_CONFIGURED]),yF=new Set([...vF,L.AUTH_UNAUTHORIZED,L.AUTH_TOKEN_MISMATCH,L.AUTH_PASSWORD_MISMATCH,L.AUTH_DEVICE_TOKEN_MISMATCH,L.AUTH_RATE_LIMITED,L.AUTH_TAILSCALE_IDENTITY_MISSING,L.AUTH_TAILSCALE_PROXY_MISSING,L.AUTH_TAILSCALE_WHOIS_FAILED,L.AUTH_TAILSCALE_IDENTITY_MISMATCH]),bF=new Set([L.CONTROL_UI_DEVICE_IDENTITY_REQUIRED,L.DEVICE_IDENTITY_REQUIRED]);function xF(e,t,n){if(e||!t)return null;let r=Se(t);return r?{kind:r.reason===`scope-upgrade`?`scope-upgrade-pending`:r.reason===`role-upgrade`?`role-upgrade-pending`:r.reason===`metadata-upgrade`?`metadata-upgrade-pending`:`pairing-required`,requestId:r.requestId??null}:n===L.PAIRING_REQUIRED?{kind:`pairing-required`,requestId:null}:null}function SF(e){return e.connected||!e.lastError?null:e.lastErrorCode?yF.has(e.lastErrorCode)?vF.has(e.lastErrorCode)?`required`:`failed`:null:y(e.lastError).includes(`unauthorized`)?!e.hasToken&&!e.hasPassword?`required`:`failed`:null}function CF(e,t,n){if(e||!t)return!1;if(n)return bF.has(n);let r=y(t);return r.includes(`secure context`)||r.includes(`device identity required`)}function wF(e){return e.replace(/\x1b\]8;;.*?\x1b\\|\x1b\]8;;\x1b\\/g,``).replace(/\x1b\[[0-9;]*m/g,``)}function TF(e){if(e.lines.length===0)return g;let t=e.lines.slice(-50).map(e=>wF(e)).join(`
5714
+ `}var xF=new Set([L.AUTH_REQUIRED,L.AUTH_TOKEN_MISSING,L.AUTH_PASSWORD_MISSING,L.AUTH_TOKEN_NOT_CONFIGURED,L.AUTH_PASSWORD_NOT_CONFIGURED]),SF=new Set([...xF,L.AUTH_UNAUTHORIZED,L.AUTH_TOKEN_MISMATCH,L.AUTH_PASSWORD_MISMATCH,L.AUTH_DEVICE_TOKEN_MISMATCH,L.AUTH_RATE_LIMITED,L.AUTH_TAILSCALE_IDENTITY_MISSING,L.AUTH_TAILSCALE_PROXY_MISSING,L.AUTH_TAILSCALE_WHOIS_FAILED,L.AUTH_TAILSCALE_IDENTITY_MISMATCH]),CF=new Set([L.CONTROL_UI_DEVICE_IDENTITY_REQUIRED,L.DEVICE_IDENTITY_REQUIRED]);function wF(e,t,n){if(e||!t)return null;let r=Se(t);return r?{kind:r.reason===`scope-upgrade`?`scope-upgrade-pending`:r.reason===`role-upgrade`?`role-upgrade-pending`:r.reason===`metadata-upgrade`?`metadata-upgrade-pending`:`pairing-required`,requestId:r.requestId??null}:n===L.PAIRING_REQUIRED?{kind:`pairing-required`,requestId:null}:null}function TF(e){return e.connected||!e.lastError?null:e.lastErrorCode?SF.has(e.lastErrorCode)?xF.has(e.lastErrorCode)?`required`:`failed`:null:y(e.lastError).includes(`unauthorized`)?!e.hasToken&&!e.hasPassword?`required`:`failed`:null}function EF(e,t,n){if(e||!t)return!1;if(n)return CF.has(n);let r=y(t);return r.includes(`secure context`)||r.includes(`device identity required`)}function DF(e){return e.replace(/\x1b\]8;;.*?\x1b\\|\x1b\]8;;\x1b\\/g,``).replace(/\x1b\[[0-9;]*m/g,``)}function OF(e){if(e.lines.length===0)return g;let t=e.lines.slice(-50).map(e=>DF(e)).join(`
5708
5715
  `);return i`
5709
5716
  <details class="card ov-log-tail" open>
5710
5717
  <summary class="ov-expandable-toggle">
@@ -5719,7 +5726,7 @@ ${e.pluginDescription}</pre
5719
5726
  </summary>
5720
5727
  <pre class="ov-log-tail-content">${t}</pre>
5721
5728
  </details>
5722
- `}var EF={"pairing-required":{titleKey:null,summaryKey:null},"scope-upgrade-pending":{titleKey:`overview.pairing.scopeUpgradeTitle`,summaryKey:`overview.pairing.scopeUpgradeSummary`},"role-upgrade-pending":{titleKey:`overview.pairing.roleUpgradeTitle`,summaryKey:`overview.pairing.roleUpgradeSummary`},"metadata-upgrade-pending":{titleKey:`overview.pairing.metadataUpgradeTitle`,summaryKey:`overview.pairing.metadataUpgradeSummary`}};function DF(e){return e.length<=18?e:`${e.slice(0,10)}...${e.slice(-6)}`}function OF(e){navigator.clipboard?.writeText(e).catch(()=>void 0)}function kF(e){let t=e.walletSummary,n=t?.accounts??[];return i`
5729
+ `}var kF={"pairing-required":{titleKey:null,summaryKey:null},"scope-upgrade-pending":{titleKey:`overview.pairing.scopeUpgradeTitle`,summaryKey:`overview.pairing.scopeUpgradeSummary`},"role-upgrade-pending":{titleKey:`overview.pairing.roleUpgradeTitle`,summaryKey:`overview.pairing.roleUpgradeSummary`},"metadata-upgrade-pending":{titleKey:`overview.pairing.metadataUpgradeTitle`,summaryKey:`overview.pairing.metadataUpgradeSummary`}};function AF(e){return e.length<=18?e:`${e.slice(0,10)}...${e.slice(-6)}`}function jF(e){navigator.clipboard?.writeText(e).catch(()=>void 0)}function MF(e){let t=e.walletSummary,n=t?.accounts??[];return i`
5723
5730
  <div class="card">
5724
5731
  <div class="row" style="justify-content: space-between; align-items: flex-start;">
5725
5732
  <div>
@@ -5744,14 +5751,14 @@ ${e.pluginDescription}</pre
5744
5751
  ${e.network?i`<span class="muted">· ${e.network}</span>`:g}
5745
5752
  </div>
5746
5753
  <div class="mono" title=${e.address}>
5747
- ${DF(e.address)}
5754
+ ${AF(e.address)}
5748
5755
  </div>
5749
5756
  </div>
5750
5757
  <button
5751
5758
  class="icon-btn"
5752
5759
  title=${p(`overview.wallet.copyAddress`)}
5753
5760
  aria-label=${p(`overview.wallet.copyAddress`)}
5754
- @click=${()=>OF(e.address)}
5761
+ @click=${()=>jF(e.address)}
5755
5762
  >
5756
5763
  ${J.copy}
5757
5764
  </button>
@@ -5763,7 +5770,7 @@ ${e.pluginDescription}</pre
5763
5770
  </div>`:g}
5764
5771
  `}
5765
5772
  </div>
5766
- `}function AF(e){let n=e.hello?.snapshot,r=n?.uptimeMs?ee(n.uptimeMs):p(`common.na`),a=e.hello?.policy?.tickIntervalMs,o=a?`${(a/1e3).toFixed(a%1e3==0?0:1)}s`:p(`common.na`),c=n?.authMode===`trusted-proxy`,l=(()=>{let t=xF(e.connected,e.lastError,e.lastErrorCode);if(!t)return null;let n=EF[t.kind];return i`
5773
+ `}function NF(e){let n=e.hello?.snapshot,r=n?.uptimeMs?ee(n.uptimeMs):p(`common.na`),a=e.hello?.policy?.tickIntervalMs,o=a?`${(a/1e3).toFixed(a%1e3==0?0:1)}s`:p(`common.na`),c=n?.authMode===`trusted-proxy`,l=(()=>{let t=wF(e.connected,e.lastError,e.lastErrorCode);if(!t)return null;let n=kF[t.kind];return i`
5767
5774
  <div class="muted" style="margin-top: 8px">
5768
5775
  ${n.titleKey?p(n.titleKey):p(`overview.pairing.hint`)}
5769
5776
  ${n.summaryKey?i`<div style="margin-top: 6px">${p(n.summaryKey)}</div>`:g}
@@ -5777,14 +5784,14 @@ ${e.pluginDescription}</pre
5777
5784
  <a
5778
5785
  class="session-link"
5779
5786
  href="https://genesis.pixelzx.com/docs/web/control-ui#device-pairing-first-connection"
5780
- target=${zj}
5781
- rel=${Bj()}
5787
+ target=${Hj}
5788
+ rel=${Uj()}
5782
5789
  title=${p(`overview.pairing.docsTitle`)}
5783
5790
  >${p(`overview.pairing.docsLink`)}</a
5784
5791
  >
5785
5792
  </div>
5786
5793
  </div>
5787
- `})(),d=(()=>{let t=SF({connected:e.connected,lastError:e.lastError,lastErrorCode:e.lastErrorCode,hasToken:!!e.settings.token.trim(),hasPassword:!!e.password.trim()});return t==null?null:t===`required`?i`
5794
+ `})(),d=(()=>{let t=TF({connected:e.connected,lastError:e.lastError,lastErrorCode:e.lastErrorCode,hasToken:!!e.settings.token.trim(),hasPassword:!!e.password.trim()});return t==null?null:t===`required`?i`
5788
5795
  <div class="muted" style="margin-top: 8px">
5789
5796
  ${p(`overview.auth.required`)}
5790
5797
  <div style="margin-top: 6px">
@@ -5795,8 +5802,8 @@ ${e.pluginDescription}</pre
5795
5802
  <a
5796
5803
  class="session-link"
5797
5804
  href="https://genesis.pixelzx.com/docs/web/dashboard"
5798
- target=${zj}
5799
- rel=${Bj()}
5805
+ target=${Hj}
5806
+ rel=${Uj()}
5800
5807
  title=${p(`overview.connection.authDocsTitle`)}
5801
5808
  >${p(`overview.connection.authDocsLink`)}</a
5802
5809
  >
@@ -5809,14 +5816,14 @@ ${e.pluginDescription}</pre
5809
5816
  <a
5810
5817
  class="session-link"
5811
5818
  href="https://genesis.pixelzx.com/docs/web/dashboard"
5812
- target=${zj}
5813
- rel=${Bj()}
5819
+ target=${Hj}
5820
+ rel=${Uj()}
5814
5821
  title=${p(`overview.connection.authDocsTitle`)}
5815
5822
  >${p(`overview.connection.authDocsLink`)}</a
5816
5823
  >
5817
5824
  </div>
5818
5825
  </div>
5819
- `})(),f=e.connected||!e.lastError||!(typeof window<`u`)||window.isSecureContext||!CF(e.connected,e.lastError,e.lastErrorCode)?null:i`
5826
+ `})(),f=e.connected||!e.lastError||!(typeof window<`u`)||window.isSecureContext||!EF(e.connected,e.lastError,e.lastErrorCode)?null:i`
5820
5827
  <div class="muted" style="margin-top: 8px">
5821
5828
  ${p(`overview.insecure.hint`,{url:`http://127.0.0.1:18789`})}
5822
5829
  <div style="margin-top: 6px">
@@ -5826,8 +5833,8 @@ ${e.pluginDescription}</pre
5826
5833
  <a
5827
5834
  class="session-link"
5828
5835
  href="https://genesis.pixelzx.com/docs/gateway/tailscale"
5829
- target=${zj}
5830
- rel=${Bj()}
5836
+ target=${Hj}
5837
+ rel=${Uj()}
5831
5838
  title=${p(`overview.connection.tailscaleDocsTitle`)}
5832
5839
  >${p(`overview.connection.tailscaleDocsLink`)}</a
5833
5840
  >
@@ -5835,8 +5842,8 @@ ${e.pluginDescription}</pre
5835
5842
  <a
5836
5843
  class="session-link"
5837
5844
  href="https://genesis.pixelzx.com/docs/web/control-ui#insecure-http"
5838
- target=${zj}
5839
- rel=${Bj()}
5845
+ target=${Hj}
5846
+ rel=${Uj()}
5840
5847
  title=${p(`overview.connection.insecureHttpDocsTitle`)}
5841
5848
  >${p(`overview.connection.insecureHttpDocsLink`)}</a
5842
5849
  >
@@ -5944,10 +5951,10 @@ ${e.pluginDescription}</pre
5944
5951
  <div class="login-gate__help-title">${p(`overview.connection.title`)}</div>
5945
5952
  <ol class="login-gate__steps">
5946
5953
  <li>
5947
- ${p(`overview.connection.step1`)} ${ZP(`genesis gateway run`)}
5954
+ ${p(`overview.connection.step1`)} ${eF(`genesis gateway run`)}
5948
5955
  </li>
5949
5956
  <li>
5950
- ${p(`overview.connection.step2`)} ${ZP(`genesis dashboard`)}
5957
+ ${p(`overview.connection.step2`)} ${eF(`genesis dashboard`)}
5951
5958
  </li>
5952
5959
  <li>${p(`overview.connection.step3`)}</li>
5953
5960
  <li>
@@ -6005,31 +6012,31 @@ ${e.pluginDescription}</pre
6005
6012
  </div>
6006
6013
  `}
6007
6014
  </div>
6008
- ${kF(e)}
6015
+ ${MF(e)}
6009
6016
  </section>
6010
6017
 
6011
6018
  <div class="ov-section-divider"></div>
6012
6019
 
6013
- ${gF({usageResult:e.usageResult,sessionsResult:e.sessionsResult,skillsReport:e.skillsReport,cronJobs:e.cronJobs,cronStatus:e.cronStatus,modelAuthStatus:e.modelAuthStatus,presenceCount:e.presenceCount,onNavigate:e.onNavigate})}
6014
- ${iF({items:e.attentionItems})}
6020
+ ${yF({usageResult:e.usageResult,sessionsResult:e.sessionsResult,skillsReport:e.skillsReport,cronJobs:e.cronJobs,cronStatus:e.cronStatus,modelAuthStatus:e.modelAuthStatus,presenceCount:e.presenceCount,onNavigate:e.onNavigate})}
6021
+ ${sF({items:e.attentionItems})}
6015
6022
 
6016
6023
  <div class="ov-section-divider"></div>
6017
6024
 
6018
6025
  <div class="ov-bottom-grid">
6019
- ${_F({events:e.eventLog})}
6020
- ${TF({lines:e.overviewLogLines,onRefreshLogs:e.onRefreshLogs})}
6026
+ ${bF({events:e.eventLog})}
6027
+ ${OF({lines:e.overviewLogLines,onRefreshLogs:e.onRefreshLogs})}
6021
6028
  </div>
6022
- `}function jF(e){return Nl(e,{search:e.sessionsSearchQuery})}var MF;function NF(e){return e instanceof Error&&e.message?e.message:String(e)}function PF(e){let t={mod:null,promise:null,error:null},n=()=>t.promise?t.promise:t.mod?Promise.resolve():(t.error=null,t.promise=e().then(e=>{t.mod=e}).catch(e=>{t.error=NF(e),console.error(`[genesis] failed to load Control UI view:`,e)}).finally(()=>{t.promise=null,MF?.()}),t.promise);return()=>t.mod?{status:`ready`,mod:t.mod}:(!t.promise&&!t.error&&n(),t.error?{status:`error`,message:t.error,retry:()=>{t.error=null,n(),MF?.()}}:{status:`loading`,promise:t.promise??n()})}var FF=PF(()=>d(()=>import(`./agents-BQsvYsmp.js`),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)),IF=PF(()=>d(()=>import(`./canvas-D92UKk4C.js`),__vite__mapDeps([6,1]),import.meta.url)),LF=PF(()=>d(()=>import(`./channels-B23D1XmP.js`),__vite__mapDeps([7,1,2,3,4]),import.meta.url)),RF=PF(()=>d(()=>import(`./cron-CYzrBBv6.js`),__vite__mapDeps([8,1,2,3]),import.meta.url)),zF=PF(()=>d(()=>import(`./debug-C8av-vpc.js`),__vite__mapDeps([9,1]),import.meta.url)),BF=PF(()=>d(()=>import(`./instances-qfDdYtE0.js`),__vite__mapDeps([10,1]),import.meta.url)),VF=PF(()=>d(()=>import(`./logs-COvy4E7t.js`),__vite__mapDeps([11,1,3]),import.meta.url)),HF=PF(()=>d(()=>import(`./mcp-CipBqkHK.js`),__vite__mapDeps([12,1]),import.meta.url)),UF=PF(()=>d(()=>import(`./nodes-WP7e87Mm.js`),__vite__mapDeps([13,1,2,3]),import.meta.url)),WF=PF(()=>d(()=>import(`./plugins-BZGJKpWs.js`),__vite__mapDeps([14,1,2,3]),import.meta.url)),GF=PF(()=>d(()=>import(`./sessions-7NbJpVyg.js`),__vite__mapDeps([15,1,2,3]),import.meta.url)),KF=PF(()=>d(()=>import(`./skills-hW_GTRp3.js`),__vite__mapDeps([16,1,2,3,5]),import.meta.url)),qF=PF(()=>d(()=>import(`./wallet-Bga18qp4.js`),__vite__mapDeps([17,1,2,3]),import.meta.url));async function JF(e,t){let n=await Tm(e,t);n&&(e.mcpOAuthFlow=n,e.mcpOAuthPopup=VT(n.authorizeUrl,`mcp-oauth-${encodeURIComponent(t)}`,`width=520,height=720,noopener=no`))}function YF(e){return typeof e!=`number`||!Number.isFinite(e)?null:new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function XF(e){if(!e?.phases)return null;let t;for(let n of Object.values(e.phases))!n.enabled||typeof n.nextRunAtMs!=`number`||(t===void 0||n.nextRunAtMs<t)&&(t=n.nextRunAtMs);return YF(t)}var ZF=null,QF=null;function $F(){return i`
6029
+ `}function PF(e){return Nl(e,{search:e.sessionsSearchQuery})}function FF(e){!e.client||!e.connected||e.modelsLoading||e.chatModelCatalog.length>0||(e.modelsLoading=!0,vl(e.client).then(t=>{e.chatModelCatalog=t}).finally(()=>{e.modelsLoading=!1}))}function IF(e){let t=e.agentsSelectedId??e.assistantAgentId;!e.client||!e.connected||e.memoryLoading||!t||e.memoryEntries.length>0||(e.memoryLoading=!0,e.memoryError=null,Bj(e.client,t).then(t=>{e.memoryEntries=t}).catch(t=>{e.memoryError=String(t)}).finally(()=>{e.memoryLoading=!1}))}var LF;function RF(e){return e instanceof Error&&e.message?e.message:String(e)}function zF(e){let t={mod:null,promise:null,error:null},n=()=>t.promise?t.promise:t.mod?Promise.resolve():(t.error=null,t.promise=e().then(e=>{t.mod=e}).catch(e=>{t.error=RF(e),console.error(`[genesis] failed to load Control UI view:`,e)}).finally(()=>{t.promise=null,LF?.()}),t.promise);return()=>t.mod?{status:`ready`,mod:t.mod}:(!t.promise&&!t.error&&n(),t.error?{status:`error`,message:t.error,retry:()=>{t.error=null,n(),LF?.()}}:{status:`loading`,promise:t.promise??n()})}var BF=zF(()=>d(()=>import(`./agents-CdobtTOW.js`),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)),VF=zF(()=>d(()=>import(`./canvas-Cy2AiGPQ.js`),__vite__mapDeps([6,1]),import.meta.url)),HF=zF(()=>d(()=>import(`./channels-DdgVKbNz.js`),__vite__mapDeps([7,1,2,3,4]),import.meta.url)),UF=zF(()=>d(()=>import(`./cron-CCNOjNyY.js`),__vite__mapDeps([8,1,2,3]),import.meta.url)),WF=zF(()=>d(()=>import(`./debug-B8lJz0xl.js`),__vite__mapDeps([9,1]),import.meta.url)),GF=zF(()=>d(()=>import(`./instances-DRlIDzRt.js`),__vite__mapDeps([10,1]),import.meta.url)),KF=zF(()=>d(()=>import(`./logs-BYrqUHTd.js`),__vite__mapDeps([11,1,3]),import.meta.url)),qF=zF(()=>d(()=>import(`./mcp-C7ry874X.js`),__vite__mapDeps([12,1]),import.meta.url)),JF=zF(()=>d(()=>import(`./models-WJk_luH_.js`),__vite__mapDeps([13,1]),import.meta.url)),YF=zF(()=>d(()=>import(`./memory-Dk8DVFlc.js`),__vite__mapDeps([14,1]),import.meta.url)),XF=zF(()=>d(()=>import(`./nodes-SWmxABM8.js`),__vite__mapDeps([15,1,2,3]),import.meta.url)),ZF=zF(()=>d(()=>import(`./plugins-bulpMEFW.js`),__vite__mapDeps([16,1,2,3]),import.meta.url)),QF=zF(()=>d(()=>import(`./sessions-bCilYtM1.js`),__vite__mapDeps([17,1,2,3]),import.meta.url)),$F=zF(()=>d(()=>import(`./skills-C1LNGjhW.js`),__vite__mapDeps([18,1,2,3,5]),import.meta.url)),eI=zF(()=>d(()=>import(`./wallet-BwqvP_oc.js`),__vite__mapDeps([19,1,2,3]),import.meta.url));async function tI(e,t){let n=await Tm(e,t);n&&(e.mcpOAuthFlow=n,e.mcpOAuthPopup=VT(n.authorizeUrl,`mcp-oauth-${encodeURIComponent(t)}`,`width=520,height=720,noopener=no`))}function nI(e){return typeof e!=`number`||!Number.isFinite(e)?null:new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function rI(e){if(!e?.phases)return null;let t;for(let n of Object.values(e.phases))!n.enabled||typeof n.nextRunAtMs!=`number`||(t===void 0||n.nextRunAtMs<t)&&(t=n.nextRunAtMs);return nI(t)}var iI=null,aI=null;function oI(){return i`
6023
6030
  <section class="card">
6024
6031
  <div class="muted">${p(`common.loading`)}</div>
6025
6032
  </section>
6026
- `}function eI(e,t){return i`
6033
+ `}function sI(e,t){return i`
6027
6034
  <section class="card">
6028
6035
  <div class="callout danger">${e}</div>
6029
6036
  ${t?i` <button class="btn" style="margin-top: 12px;" @click=${t}>Retry</button> `:g}
6030
6037
  </section>
6031
- `}function tI(e,t){let n=e();if(n.status===`loading`)return Jy(n.promise.then(()=>{let n=e();if(n.status===`ready`)try{return t(n.mod)}catch(e){return eI(NF(e))}return n.status===`error`?eI(n.message,n.retry):$F()}).catch(e=>eI(NF(e))),$F());if(n.status===`error`)return eI(n.message,n.retry);try{return t(n.mod)}catch(e){return eI(NF(e))}}var nI=`genesis:control-ui:update-banner-dismissed:v1`,rI=[`off`,`minimal`,`low`,`medium`,`high`],iI=[`UTC`,`America/Los_Angeles`,`America/Denver`,`America/Chicago`,`America/New_York`,`Europe/London`,`Europe/Berlin`,`Asia/Tokyo`];function aI(e){return/^https?:\/\//i.test(e.trim())}function oI(e){return typeof e==`string`?e.trim():``}function sI(e){let t=new Set,n=[];for(let r of e){let e=r.trim();if(!e)continue;let i=e.toLowerCase();t.has(i)||(t.add(i),n.push(e))}return n}function cI(){try{let e=m()?.getItem(nI);if(!e)return null;let t=JSON.parse(e);return!t||typeof t.latestVersion!=`string`?null:{latestVersion:t.latestVersion,channel:typeof t.channel==`string`?t.channel:null,dismissedAtMs:typeof t.dismissedAtMs==`number`?t.dismissedAtMs:Date.now()}}catch{return null}}function lI(e){let t=cI();if(!t)return!1;let n=e,r=n&&typeof n.latestVersion==`string`?n.latestVersion:null,i=n&&typeof n.channel==`string`?n.channel:null;return!!(r&&t.latestVersion===r&&t.channel===i)}function uI(e){let t=e,n=t&&typeof t.latestVersion==`string`?t.latestVersion:null;if(!n)return;let r={latestVersion:n,channel:t&&typeof t.channel==`string`?t.channel:null,dismissedAtMs:Date.now()};try{m()?.setItem(nI,JSON.stringify(r))}catch{}}var dI=[`channels`,`messages`,`broadcast`,`talk`,`audio`],fI=[`__appearance__`,`ui`,`wizard`],pI=[`commands`,`hooks`,`bindings`,`cron`,`approvals`,`plugins`],mI=[`gateway`,`web`,`browser`,`nodeHost`,`canvasHost`,`discovery`,`media`,`acp`,`mcp`],hI=[`agents`,`models`,`skills`,`tools`,`memory`,`session`],gI=new Set([...dI,...fI,...pI,...mI,...hI]);function _I(e,t){return e&&gI.has(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function vI(e,t,n){return e&&!n.includes(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function yI(e){let t=e.agentsList?.agents??[],n=la(e.sessionKey)?.agentId??e.agentsList?.defaultId??`main`,r=t.find(e=>e.id===n)?.identity,i=r?.avatarUrl??r?.avatar;if(i&&gu(i))return i}var bI=[{id:`telegram`,label:`Telegram`},{id:`discord`,label:`Discord`},{id:`slack`,label:`Slack`},{id:`whatsapp`,label:`WhatsApp`},{id:`signal`,label:`Signal`},{id:`imessage`,label:`iMessage`}],xI=[{provider:`anthropic`,label:`Anthropic`,envKey:`ANTHROPIC_API_KEY`},{provider:`openai`,label:`OpenAI`,envKey:`OPENAI_API_KEY`},{provider:`google`,label:`Google`,envKey:`GOOGLE_API_KEY`},{provider:`openrouter`,label:`OpenRouter`,envKey:`OPENROUTER_API_KEY`}];function SI(e){let t=e.trim();return t?t.split(/[-_]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):`Unknown`}function CI(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return[];let n=`channels`in t&&t.channels&&typeof t.channels==`object`?t.channels:{},r=Object.keys(n).filter(e=>e.trim().length>0),i=r.length>0?Xa(r,(e,t)=>e.localeCompare(t)):bI.map(({id:e})=>e),a=new Map(bI.map(({id:e,label:t})=>[e,t])),o=[];for(let e of i){let t=n[e],r=typeof t==`object`&&!!t&&Object.keys(t).length>0;o.push({id:e,label:a.get(e)??SI(e),connected:r,detail:r?`Configured`:void 0})}return o}function wI(e){let t=e.configForm??e.configSnapshot?.config,n=t&&typeof t==`object`?t.env:null,r=n&&typeof n==`object`?n:{},i=r.vars&&typeof r.vars==`object`?r.vars:{};return xI.map(({provider:e,label:t,envKey:n})=>{let a=typeof i[n]==`string`?i[n]:r[n],o=typeof a==`string`&&a.trim().length>0;return{provider:e,label:t,masked:o?`••••${a.slice(-4)}`:void 0,isSet:o}})}function TI(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return 0;let n=t.mcp;if(!n||typeof n!=`object`)return 0;let r=`servers`in n&&n.servers&&typeof n.servers==`object`?n.servers:{};return Object.keys(r).length}function EI(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return{gatewayAuth:`unknown`,execPolicy:`unknown`,deviceAuth:!1};let n=t,r=`gateway`in n&&n.gateway&&typeof n.gateway==`object`?n.gateway:null,i=r&&`auth`in r&&r.auth&&typeof r.auth==`object`?r.auth:null,a=`unknown`;i&&(a=(typeof i.mode==`string`?i.mode.trim():``)||(i.password?`password`:i.token?`token`:i.trustedProxy?`trusted-proxy`:`none`));let o=n.agents,s=`allowlist`;if(o&&typeof o==`object`){let e=o.defaults;if(e&&typeof e==`object`){let t=e.exec;if(t&&typeof t==`object`){let e=t.security;typeof e==`string`&&(s=e)}}}let c=!0;return r&&(`controlUi`in r&&r.controlUi&&typeof r.controlUi==`object`?r.controlUi:null)?.dangerouslyDisableDeviceAuth===!0&&(c=!1),{gatewayAuth:a,execPolicy:s,deviceAuth:c}}function DI(e){return e.sessionsResult?.sessions?.find(t=>t.key===e.sessionKey)}async function OI(e,t){if(!e.client||!e.connected)return;let n=rM(t);if(n){e.configApplying=!0,e.lastError=null;try{e.configSnapshot?.hash||await Qn(e);let t=e.configSnapshot?.hash?.trim();if(!t)throw Error(`Config base hash unavailable. Reload config and retry.`);let r=_p(Gn(e.configForm??e.configSnapshot?.config??{}),n.patch);await e.client.request(`config.patch`,{raw:Kn(r),baseHash:t}),await Qn(e)}catch(t){e.lastError=`Failed to apply preset: ${String(t)}`}finally{e.configApplying=!1}}}function kI(e,t){return LN({open:e.cronQuickCreateOpen,step:e.cronQuickCreateStep,draft:e.cronQuickCreateDraft??ON(),onDraftChange:n=>{e.cronQuickCreateDraft={...e.cronQuickCreateDraft??ON(),...n},t?.()},onStepChange:n=>{e.cronQuickCreateStep=n,t?.()},onCreate:()=>{let n=AN(e.cronQuickCreateDraft??ON());e.cronEditingJobId=null,e.cronForm={...xd,...n},t?.(),(async()=>{if(await Xf(e),e.cronError||Mf(e.cronFieldErrors)){t?.();return}e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t?.()})()},onCancel:()=>{e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t?.()}})}function AI(e){let t=e,n=typeof t.requestUpdate==`function`?()=>t.requestUpdate?.():void 0;if(MF=n,!e.connected)return i` ${QP(e)} ${YP(e)} `;let r=e.presenceEntries.length,a=e.sessionsResult?.count??null,o=e.cronStatus?.nextWakeAtMs??null,s=e.connected?null:p(`chat.disconnected`),c=e.tab===`chat`,l=c&&(e.settings.chatFocusMode||e.onboarding),u=e.navDrawerOpen&&!l&&!e.onboarding,d=e.settings.navCollapsed&&!u,f=!e.onboarding,m=!e.onboarding,h=yI(e),_=e.chatAvatarUrl??h??null,v=e.configForm??e.configSnapshot?.config,y=Pp(v),b=e.dreamingStatus?.enabled??y.enabled,x=XF(e.dreamingStatus),S=e.dreamingStatusLoading||e.dreamingModeSaving,ee=e.dreamingStatusLoading||e.dreamDiaryLoading,C=()=>{(async()=>{await Qn(e),await Promise.all([Kp(e),qp(e),Jp(e),Yp(e)])})()},te=async t=>{if(!e.client||!e.connected)return null;let n=await e.client.request(`wiki.get`,{lookup:t,fromLine:1,lineCount:5e3}),r=typeof n?.title==`string`&&n.title.trim()?n.title.trim():t,i=typeof n?.path==`string`&&n.path.trim()?n.path.trim():t,a=typeof n?.content==`string`&&n.content.length>0?n.content:`No wiki content available.`,o=typeof n?.updatedAt==`string`&&n.updatedAt.trim()?n.updatedAt.trim():void 0,s=typeof n?.totalLines==`number`&&Number.isFinite(n.totalLines)?Math.max(0,Math.floor(n.totalLines)):void 0,c=n?.truncated===!0;return{title:r,path:i,content:a,...s===void 0?{}:{totalLines:s},...c?{truncated:c}:{},...o?{updatedAt:o}:{}}},ne=t=>{e.dreamingModeSaving||b===t||(async()=>{await um(e,t)&&(await Qn(e),await Kp(e))})()},w=Wl(e.basePath??``),re=()=>e.agentsSelectedId??e.agentsList?.defaultId??e.agentsList?.agents?.[0]?.id??null,T=re(),E=pa(e.sessionKey),ie=!!(T&&E&&T===E),D=()=>e.configForm??e.configSnapshot?.config,O=e=>wr(D(),e),k=t=>Tr(e,t),ae=(e,t)=>{let n=t?k(e):O(e);return n>=0?[`agents`,`list`,n,`tools`]:null},A=e=>{let t=D()?.agents?.list,n=Array.isArray(t)?t[e]?.model:void 0;return{basePath:[`agents`,`list`,e,`model`],existing:n}},j=Au(new Set([...e.agentsList?.agents?.map(e=>e.id.trim())??[],...e.cronJobs.map(e=>typeof e.agentId==`string`?e.agentId.trim():``).filter(Boolean)].filter(Boolean))),oe=Au(new Set([...e.cronModelSuggestions,...ju(v),...e.cronJobs.map(e=>e.payload.kind!==`agentTurn`||typeof e.payload.model!=`string`?``:e.payload.model.trim()).filter(Boolean)].filter(Boolean))),M=Rf(e),N=e.cronForm.deliveryChannel&&e.cronForm.deliveryChannel.trim()?e.cronForm.deliveryChannel.trim():`last`,se=e.cronJobs.map(e=>oI(e.delivery?.to)).filter(Boolean),ce=(N===`last`?Object.values(e.channelsSnapshot?.channelAccounts??{}).flat():e.channelsSnapshot?.channelAccounts?.[N]??[]).flatMap(e=>[oI(e.accountId),oI(e.name)]).filter(Boolean),P=sI([...se,...ce]),F=sI(ce),I=e.cronForm.deliveryMode===`webhook`?P.filter(e=>aI(e)):P,le={raw:e.configRaw,originalRaw:e.configRawOriginal,valid:e.configValid,issues:e.configIssues,loading:e.configLoading,saving:e.configSaving,applying:e.configApplying,updating:e.updateRunning,connected:e.connected,schema:e.configSchema,schemaLoading:e.configSchemaLoading,uiHints:e.configUiHints,formValue:e.configForm,originalValue:e.configFormOriginal,restartPrompt:e.configRestartPrompt,onRawChange:t=>{e.configRaw=t},onRequestUpdate:n,onFormPatch:(t,n)=>xr(e,t,n),onReload:()=>Qn(e),onReset:()=>Sr(e),onSave:()=>pr(e),onApply:()=>hr(e),onRestartNow:()=>gr(e),onRestartLater:()=>_r(e),onCancelRestartChanges:()=>vr(e),onUpdate:()=>yr(e),onOpenFile:()=>Er(e),version:e.hello?.server?.version??``,theme:e.theme,themeMode:e.themeMode,setTheme:(t,n)=>e.setTheme(t,n),setThemeMode:(t,n)=>e.setThemeMode(t,n),borderRadius:e.settings.borderRadius,setBorderRadius:t=>e.setBorderRadius(t),gatewayUrl:e.settings.gatewayUrl,assistantName:e.assistantName,configPath:e.configSnapshot?.path??null,rawAvailable:typeof e.configSnapshot?.raw==`string`},ue=e=>TN({...le,includeVirtualSections:!1,...e}),de=_I(e.configActiveSection,e.configActiveSubsection),L=vI(e.communicationsActiveSection,e.communicationsActiveSubsection,dI),fe=vI(e.appearanceActiveSection,e.appearanceActiveSubsection,fI),pe=vI(e.automationActiveSection,e.automationActiveSubsection,pI),R=vI(e.infrastructureActiveSection,e.infrastructureActiveSubsection,mI),z=vI(e.aiAgentsActiveSection,e.aiAgentsActiveSubsection,hI),me=()=>{switch(e.tab){case`config`:if(e.configSettingsMode===`quick`){let t=e.configForm??e.configSnapshot?.config??{},r=t.agents?.defaults??{},i=DI(e),a=typeof i?.model==`string`?i.model:typeof r.model==`string`?r.model:`default`,o=typeof i?.thinkingLevel==`string`?i.thinkingLevel:typeof r.thinkingLevel==`string`?r.thinkingLevel:`off`,s=typeof i?.fastMode==`boolean`?i.fastMode:r.fastMode===!0;return SM({currentModel:a,thinkingLevel:o,fastMode:s,onModelChange:()=>{e.configSettingsMode=`advanced`,e.tab=`aiAgents`,e.aiAgentsActiveSection=`models`,n?.()},onThinkingChange:t=>{Fl(e,e.sessionKey,{thinkingLevel:t}).then(()=>n?.())},onFastModeToggle:()=>{Fl(e,e.sessionKey,{fastMode:!s}).then(()=>n?.())},channels:CI(e),onChannelConfigure:()=>{e.tab=`communications`,e.communicationsActiveSection=`channels`,n?.()},apiKeys:wI(e),onApiKeyChange:()=>{e.configSettingsMode=`advanced`,e.configActiveSection=`env`,n?.()},automation:{cronJobCount:e.cronJobs?.length??0,skillCount:e.skillsReport?.skills?.length??0,mcpServerCount:TI(e)},onManageCron:()=>{e.tab=`cron`,n?.()},onBrowseSkills:()=>{e.tab=`skills`,n?.()},onConfigureMcp:()=>{e.tab=`infrastructure`,e.infrastructureActiveSection=`mcp`,n?.()},security:EI(e),onSecurityConfigure:()=>{e.configSettingsMode=`advanced`,e.configActiveSection=`auth`,n?.()},theme:e.theme,themeMode:e.themeMode,borderRadius:e.settings.borderRadius,setTheme:(t,n)=>e.setTheme(t,n),setThemeMode:(t,n)=>e.setThemeMode(t,n),setBorderRadius:t=>e.setBorderRadius(t),userName:e.userName??null,userAvatar:e.userAvatar??null,onUserNameChange:t=>e.applyLocalUserIdentity?.({name:t}),onUserAvatarChange:t=>e.applyLocalUserIdentity?.({avatar:t}),configObject:t,onApplyPreset:t=>{OI(e,t).then(()=>n?.())},onAdvancedSettings:()=>{e.configSettingsMode=`advanced`,n?.()},connected:e.connected,gatewayUrl:e.settings.gatewayUrl,assistantName:e.assistantName,version:e.hello?.server?.version??``})}return ue({formMode:e.configFormMode,searchQuery:e.configSearchQuery,activeSection:de.activeSection,activeSubsection:de.activeSubsection,onFormModeChange:t=>e.configFormMode=t,onSearchChange:t=>e.configSearchQuery=t,onSectionChange:t=>{e.configActiveSection=t,e.configActiveSubsection=null},onSubsectionChange:t=>e.configActiveSubsection=t,showModeToggle:!0,settingsLayout:`accordion`,onBackToQuick:()=>{e.configSettingsMode=`quick`,n?.()},excludeSections:[...dI,...pI,...mI,...hI,`ui`,`wizard`]});case`communications`:return ue({formMode:e.communicationsFormMode,searchQuery:e.communicationsSearchQuery,activeSection:L.activeSection,activeSubsection:L.activeSubsection,onFormModeChange:t=>e.communicationsFormMode=t,onSearchChange:t=>e.communicationsSearchQuery=t,onSectionChange:t=>{e.communicationsActiveSection=t,e.communicationsActiveSubsection=null},onSubsectionChange:t=>e.communicationsActiveSubsection=t,navRootLabel:`Communication`,includeSections:[...dI]});case`appearance`:return ue({formMode:e.appearanceFormMode,searchQuery:e.appearanceSearchQuery,activeSection:fe.activeSection,activeSubsection:fe.activeSubsection,onFormModeChange:t=>e.appearanceFormMode=t,onSearchChange:t=>e.appearanceSearchQuery=t,onSectionChange:t=>{e.appearanceActiveSection=t,e.appearanceActiveSubsection=null},onSubsectionChange:t=>e.appearanceActiveSubsection=t,navRootLabel:p(`tabs.appearance`),includeSections:[...fI],includeVirtualSections:!0});case`automation`:return ue({formMode:e.automationFormMode,searchQuery:e.automationSearchQuery,activeSection:pe.activeSection,activeSubsection:pe.activeSubsection,onFormModeChange:t=>e.automationFormMode=t,onSearchChange:t=>e.automationSearchQuery=t,onSectionChange:t=>{e.automationActiveSection=t,e.automationActiveSubsection=null},onSubsectionChange:t=>e.automationActiveSubsection=t,navRootLabel:`Automation`,includeSections:[...pI]});case`infrastructure`:return ue({formMode:e.infrastructureFormMode,searchQuery:e.infrastructureSearchQuery,activeSection:R.activeSection,activeSubsection:R.activeSubsection,onFormModeChange:t=>e.infrastructureFormMode=t,onSearchChange:t=>e.infrastructureSearchQuery=t,onSectionChange:t=>{e.infrastructureActiveSection=t,e.infrastructureActiveSubsection=null},onSubsectionChange:t=>e.infrastructureActiveSubsection=t,navRootLabel:`Infrastructure`,includeSections:[...mI]});case`aiAgents`:return ue({formMode:e.aiAgentsFormMode,searchQuery:e.aiAgentsSearchQuery,activeSection:z.activeSection,activeSubsection:z.activeSubsection,onFormModeChange:t=>e.aiAgentsFormMode=t,onSearchChange:t=>e.aiAgentsSearchQuery=t,onSectionChange:t=>{e.aiAgentsActiveSection=t,e.aiAgentsActiveSubsection=null},onSubsectionChange:t=>e.aiAgentsActiveSubsection=t,navRootLabel:`AI & Agents`,includeSections:[...hI]});default:return g}},he=t=>{if(t)switch(e.agentsPanel){case`files`:ff(e,t);return;case`skills`:_f(e,t);return;case`tools`:xf(e,t),Tf(e);return;case`overview`:case`channels`:case`cron`:return}},B=t=>{if(t===`channels`){Sn(e,!1);return}t===`cron`&&e.loadCron()},ge=(t=!1)=>{e.agentFilesList=null,e.agentFilesError=null,e.agentFileActive=null,e.agentFileContents={},e.agentFileDrafts={},t&&(e.agentFilesLoading=!1)},_e=()=>{ge(!0),e.agentSkillsReport=null,e.agentSkillsError=null,e.agentSkillsAgentId=null,e.toolsCatalogResult=null,e.toolsCatalogError=null,e.toolsCatalogLoading=!1,Cf(e)};return i`
6032
- ${tM({open:e.paletteOpen,query:e.paletteQuery,activeIndex:e.paletteActiveIndex,onToggle:()=>{e.paletteOpen=!e.paletteOpen},onQueryChange:t=>{e.paletteQuery=t},onActiveIndexChange:t=>{e.paletteActiveIndex=t},onNavigate:t=>{e.setTab(t)},onSlashCommand:t=>{e.setTab(`chat`),e.chatMessage=t.endsWith(` `)?t:`${t} `}})}
6038
+ `}function cI(e,t){let n=e();if(n.status===`loading`)return Jy(n.promise.then(()=>{let n=e();if(n.status===`ready`)try{return t(n.mod)}catch(e){return sI(RF(e))}return n.status===`error`?sI(n.message,n.retry):oI()}).catch(e=>sI(RF(e))),oI());if(n.status===`error`)return sI(n.message,n.retry);try{return t(n.mod)}catch(e){return sI(RF(e))}}var lI=`genesis:control-ui:update-banner-dismissed:v1`,uI=[`off`,`minimal`,`low`,`medium`,`high`],dI=[`UTC`,`America/Los_Angeles`,`America/Denver`,`America/Chicago`,`America/New_York`,`Europe/London`,`Europe/Berlin`,`Asia/Tokyo`];function fI(e){return/^https?:\/\//i.test(e.trim())}function pI(e){return typeof e==`string`?e.trim():``}function mI(e){let t=new Set,n=[];for(let r of e){let e=r.trim();if(!e)continue;let i=e.toLowerCase();t.has(i)||(t.add(i),n.push(e))}return n}function hI(){try{let e=m()?.getItem(lI);if(!e)return null;let t=JSON.parse(e);return!t||typeof t.latestVersion!=`string`?null:{latestVersion:t.latestVersion,channel:typeof t.channel==`string`?t.channel:null,dismissedAtMs:typeof t.dismissedAtMs==`number`?t.dismissedAtMs:Date.now()}}catch{return null}}function gI(e){let t=hI();if(!t)return!1;let n=e,r=n&&typeof n.latestVersion==`string`?n.latestVersion:null,i=n&&typeof n.channel==`string`?n.channel:null;return!!(r&&t.latestVersion===r&&t.channel===i)}function _I(e){let t=e,n=t&&typeof t.latestVersion==`string`?t.latestVersion:null;if(!n)return;let r={latestVersion:n,channel:t&&typeof t.channel==`string`?t.channel:null,dismissedAtMs:Date.now()};try{m()?.setItem(lI,JSON.stringify(r))}catch{}}var vI=[`channels`,`messages`,`broadcast`,`talk`,`audio`],yI=[`__appearance__`,`ui`,`wizard`],bI=[`commands`,`hooks`,`bindings`,`cron`,`approvals`,`plugins`],xI=[`gateway`,`web`,`browser`,`nodeHost`,`canvasHost`,`discovery`,`media`,`acp`,`mcp`],SI=[`agents`,`models`,`skills`,`tools`,`memory`,`session`],CI=new Set([...vI,...yI,...bI,...xI,...SI]);function wI(e,t){return e&&CI.has(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function TI(e,t,n){return e&&!n.includes(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function EI(e){let t=e.agentsList?.agents??[],n=la(e.sessionKey)?.agentId??e.agentsList?.defaultId??`main`,r=t.find(e=>e.id===n)?.identity,i=r?.avatarUrl??r?.avatar;if(i&&gu(i))return i}var DI=[{id:`telegram`,label:`Telegram`},{id:`discord`,label:`Discord`},{id:`slack`,label:`Slack`},{id:`whatsapp`,label:`WhatsApp`},{id:`signal`,label:`Signal`},{id:`imessage`,label:`iMessage`}],OI=[{provider:`anthropic`,label:`Anthropic`,envKey:`ANTHROPIC_API_KEY`},{provider:`openai`,label:`OpenAI`,envKey:`OPENAI_API_KEY`},{provider:`google`,label:`Google`,envKey:`GOOGLE_API_KEY`},{provider:`openrouter`,label:`OpenRouter`,envKey:`OPENROUTER_API_KEY`}];function kI(e){let t=e.trim();return t?t.split(/[-_]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):`Unknown`}function AI(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return[];let n=`channels`in t&&t.channels&&typeof t.channels==`object`?t.channels:{},r=Object.keys(n).filter(e=>e.trim().length>0),i=r.length>0?Xa(r,(e,t)=>e.localeCompare(t)):DI.map(({id:e})=>e),a=new Map(DI.map(({id:e,label:t})=>[e,t])),o=[];for(let e of i){let t=n[e],r=typeof t==`object`&&!!t&&Object.keys(t).length>0;o.push({id:e,label:a.get(e)??kI(e),connected:r,detail:r?`Configured`:void 0})}return o}function jI(e){let t=e.configForm??e.configSnapshot?.config,n=t&&typeof t==`object`?t.env:null,r=n&&typeof n==`object`?n:{},i=r.vars&&typeof r.vars==`object`?r.vars:{};return OI.map(({provider:e,label:t,envKey:n})=>{let a=typeof i[n]==`string`?i[n]:r[n],o=typeof a==`string`&&a.trim().length>0;return{provider:e,label:t,masked:o?`••••${a.slice(-4)}`:void 0,isSet:o}})}function MI(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return 0;let n=t.mcp;if(!n||typeof n!=`object`)return 0;let r=`servers`in n&&n.servers&&typeof n.servers==`object`?n.servers:{};return Object.keys(r).length}function NI(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return{gatewayAuth:`unknown`,execPolicy:`unknown`,deviceAuth:!1};let n=t,r=`gateway`in n&&n.gateway&&typeof n.gateway==`object`?n.gateway:null,i=r&&`auth`in r&&r.auth&&typeof r.auth==`object`?r.auth:null,a=`unknown`;i&&(a=(typeof i.mode==`string`?i.mode.trim():``)||(i.password?`password`:i.token?`token`:i.trustedProxy?`trusted-proxy`:`none`));let o=n.agents,s=`allowlist`;if(o&&typeof o==`object`){let e=o.defaults;if(e&&typeof e==`object`){let t=e.exec;if(t&&typeof t==`object`){let e=t.security;typeof e==`string`&&(s=e)}}}let c=!0;return r&&(`controlUi`in r&&r.controlUi&&typeof r.controlUi==`object`?r.controlUi:null)?.dangerouslyDisableDeviceAuth===!0&&(c=!1),{gatewayAuth:a,execPolicy:s,deviceAuth:c}}function PI(e){return e.sessionsResult?.sessions?.find(t=>t.key===e.sessionKey)}async function FI(e,t){if(!e.client||!e.connected)return;let n=oM(t);if(n){e.configApplying=!0,e.lastError=null;try{e.configSnapshot?.hash||await Qn(e);let t=e.configSnapshot?.hash?.trim();if(!t)throw Error(`Config base hash unavailable. Reload config and retry.`);let r=_p(Gn(e.configForm??e.configSnapshot?.config??{}),n.patch);await e.client.request(`config.patch`,{raw:Kn(r),baseHash:t}),await Qn(e)}catch(t){e.lastError=`Failed to apply preset: ${String(t)}`}finally{e.configApplying=!1}}}function II(e,t){return BN({open:e.cronQuickCreateOpen,step:e.cronQuickCreateStep,draft:e.cronQuickCreateDraft??jN(),onDraftChange:n=>{e.cronQuickCreateDraft={...e.cronQuickCreateDraft??jN(),...n},t?.()},onStepChange:n=>{e.cronQuickCreateStep=n,t?.()},onCreate:()=>{let n=NN(e.cronQuickCreateDraft??jN());e.cronEditingJobId=null,e.cronForm={...xd,...n},t?.(),(async()=>{if(await Xf(e),e.cronError||Mf(e.cronFieldErrors)){t?.();return}e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t?.()})()},onCancel:()=>{e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t?.()}})}function LI(e){let t=e,n=typeof t.requestUpdate==`function`?()=>t.requestUpdate?.():void 0;if(LF=n,!e.connected)return i` ${tF(e)} ${QP(e)} `;let r=e.presenceEntries.length,a=e.sessionsResult?.count??null,o=e.cronStatus?.nextWakeAtMs??null,s=e.connected?null:p(`chat.disconnected`),c=e.tab===`chat`,l=c&&(e.settings.chatFocusMode||e.onboarding),u=e.navDrawerOpen&&!l&&!e.onboarding,d=e.settings.navCollapsed&&!u,f=!e.onboarding,m=!e.onboarding,h=EI(e),_=e.chatAvatarUrl??h??null,v=e.configForm??e.configSnapshot?.config,y=Pp(v),b=e.dreamingStatus?.enabled??y.enabled,x=rI(e.dreamingStatus),S=e.dreamingStatusLoading||e.dreamingModeSaving,ee=e.dreamingStatusLoading||e.dreamDiaryLoading,C=()=>{(async()=>{await Qn(e),await Promise.all([Kp(e),qp(e),Jp(e),Yp(e)])})()},te=async t=>{if(!e.client||!e.connected)return null;let n=await e.client.request(`wiki.get`,{lookup:t,fromLine:1,lineCount:5e3}),r=typeof n?.title==`string`&&n.title.trim()?n.title.trim():t,i=typeof n?.path==`string`&&n.path.trim()?n.path.trim():t,a=typeof n?.content==`string`&&n.content.length>0?n.content:`No wiki content available.`,o=typeof n?.updatedAt==`string`&&n.updatedAt.trim()?n.updatedAt.trim():void 0,s=typeof n?.totalLines==`number`&&Number.isFinite(n.totalLines)?Math.max(0,Math.floor(n.totalLines)):void 0,c=n?.truncated===!0;return{title:r,path:i,content:a,...s===void 0?{}:{totalLines:s},...c?{truncated:c}:{},...o?{updatedAt:o}:{}}},ne=t=>{e.dreamingModeSaving||b===t||(async()=>{await um(e,t)&&(await Qn(e),await Kp(e))})()},w=Wl(e.basePath??``),re=()=>e.agentsSelectedId??e.agentsList?.defaultId??e.agentsList?.agents?.[0]?.id??null,T=re(),ie=pa(e.sessionKey),ae=!!(T&&ie&&T===ie),E=()=>e.configForm??e.configSnapshot?.config,D=e=>wr(E(),e),O=t=>Tr(e,t),oe=(e,t)=>{let n=t?O(e):D(e);return n>=0?[`agents`,`list`,n,`tools`]:null},k=e=>{let t=E()?.agents?.list,n=Array.isArray(t)?t[e]?.model:void 0;return{basePath:[`agents`,`list`,e,`model`],existing:n}},A=Au(new Set([...e.agentsList?.agents?.map(e=>e.id.trim())??[],...e.cronJobs.map(e=>typeof e.agentId==`string`?e.agentId.trim():``).filter(Boolean)].filter(Boolean))),se=Au(new Set([...e.cronModelSuggestions,...ju(v),...e.cronJobs.map(e=>e.payload.kind!==`agentTurn`||typeof e.payload.model!=`string`?``:e.payload.model.trim()).filter(Boolean)].filter(Boolean))),j=Rf(e),M=e.cronForm.deliveryChannel&&e.cronForm.deliveryChannel.trim()?e.cronForm.deliveryChannel.trim():`last`,N=e.cronJobs.map(e=>pI(e.delivery?.to)).filter(Boolean),ce=(M===`last`?Object.values(e.channelsSnapshot?.channelAccounts??{}).flat():e.channelsSnapshot?.channelAccounts?.[M]??[]).flatMap(e=>[pI(e.accountId),pI(e.name)]).filter(Boolean),P=mI([...N,...ce]),F=mI(ce),I=e.cronForm.deliveryMode===`webhook`?P.filter(e=>fI(e)):P,le={raw:e.configRaw,originalRaw:e.configRawOriginal,valid:e.configValid,issues:e.configIssues,loading:e.configLoading,saving:e.configSaving,applying:e.configApplying,updating:e.updateRunning,connected:e.connected,schema:e.configSchema,schemaLoading:e.configSchemaLoading,uiHints:e.configUiHints,formValue:e.configForm,originalValue:e.configFormOriginal,restartPrompt:e.configRestartPrompt,onRawChange:t=>{e.configRaw=t},onRequestUpdate:n,onFormPatch:(t,n)=>xr(e,t,n),onReload:()=>Qn(e),onReset:()=>Sr(e),onSave:()=>pr(e),onApply:()=>hr(e),onRestartNow:()=>gr(e),onRestartLater:()=>_r(e),onCancelRestartChanges:()=>vr(e),onUpdate:()=>yr(e),onOpenFile:()=>Er(e),version:e.hello?.server?.version??``,theme:e.theme,themeMode:e.themeMode,setTheme:(t,n)=>e.setTheme(t,n),setThemeMode:(t,n)=>e.setThemeMode(t,n),borderRadius:e.settings.borderRadius,setBorderRadius:t=>e.setBorderRadius(t),gatewayUrl:e.settings.gatewayUrl,assistantName:e.assistantName,configPath:e.configSnapshot?.path??null,rawAvailable:typeof e.configSnapshot?.raw==`string`},ue=e=>ON({...le,includeVirtualSections:!1,...e}),de=wI(e.configActiveSection,e.configActiveSubsection),L=TI(e.communicationsActiveSection,e.communicationsActiveSubsection,vI),fe=TI(e.appearanceActiveSection,e.appearanceActiveSubsection,yI),pe=TI(e.automationActiveSection,e.automationActiveSubsection,bI),R=TI(e.infrastructureActiveSection,e.infrastructureActiveSubsection,xI),z=TI(e.aiAgentsActiveSection,e.aiAgentsActiveSubsection,SI),me=()=>{switch(e.tab){case`config`:if(e.configSettingsMode===`quick`){let t=e.configForm??e.configSnapshot?.config??{},r=t.agents?.defaults??{},i=PI(e),a=typeof i?.model==`string`?i.model:typeof r.model==`string`?r.model:`default`,o=typeof i?.thinkingLevel==`string`?i.thinkingLevel:typeof r.thinkingLevel==`string`?r.thinkingLevel:`off`,s=typeof i?.fastMode==`boolean`?i.fastMode:r.fastMode===!0;return TM({currentModel:a,thinkingLevel:o,fastMode:s,onModelChange:()=>{e.configSettingsMode=`advanced`,e.tab=`aiAgents`,e.aiAgentsActiveSection=`models`,n?.()},onThinkingChange:t=>{Fl(e,e.sessionKey,{thinkingLevel:t}).then(()=>n?.())},onFastModeToggle:()=>{Fl(e,e.sessionKey,{fastMode:!s}).then(()=>n?.())},channels:AI(e),onChannelConfigure:()=>{e.tab=`communications`,e.communicationsActiveSection=`channels`,n?.()},apiKeys:jI(e),onApiKeyChange:()=>{e.configSettingsMode=`advanced`,e.configActiveSection=`env`,n?.()},automation:{cronJobCount:e.cronJobs?.length??0,skillCount:e.skillsReport?.skills?.length??0,mcpServerCount:MI(e)},onManageCron:()=>{e.tab=`cron`,n?.()},onBrowseSkills:()=>{e.tab=`skills`,n?.()},onConfigureMcp:()=>{e.tab=`infrastructure`,e.infrastructureActiveSection=`mcp`,n?.()},security:NI(e),onSecurityConfigure:()=>{e.configSettingsMode=`advanced`,e.configActiveSection=`auth`,n?.()},theme:e.theme,themeMode:e.themeMode,borderRadius:e.settings.borderRadius,setTheme:(t,n)=>e.setTheme(t,n),setThemeMode:(t,n)=>e.setThemeMode(t,n),setBorderRadius:t=>e.setBorderRadius(t),userName:e.userName??null,userAvatar:e.userAvatar??null,onUserNameChange:t=>e.applyLocalUserIdentity?.({name:t}),onUserAvatarChange:t=>e.applyLocalUserIdentity?.({avatar:t}),configObject:t,onApplyPreset:t=>{FI(e,t).then(()=>n?.())},onAdvancedSettings:()=>{e.configSettingsMode=`advanced`,n?.()},connected:e.connected,gatewayUrl:e.settings.gatewayUrl,assistantName:e.assistantName,version:e.hello?.server?.version??``})}return ue({formMode:e.configFormMode,searchQuery:e.configSearchQuery,activeSection:de.activeSection,activeSubsection:de.activeSubsection,onFormModeChange:t=>e.configFormMode=t,onSearchChange:t=>e.configSearchQuery=t,onSectionChange:t=>{e.configActiveSection=t,e.configActiveSubsection=null},onSubsectionChange:t=>e.configActiveSubsection=t,showModeToggle:!0,settingsLayout:`accordion`,onBackToQuick:()=>{e.configSettingsMode=`quick`,n?.()},excludeSections:[...vI,...bI,...xI,...SI,`ui`,`wizard`]});case`communications`:return ue({formMode:e.communicationsFormMode,searchQuery:e.communicationsSearchQuery,activeSection:L.activeSection,activeSubsection:L.activeSubsection,onFormModeChange:t=>e.communicationsFormMode=t,onSearchChange:t=>e.communicationsSearchQuery=t,onSectionChange:t=>{e.communicationsActiveSection=t,e.communicationsActiveSubsection=null},onSubsectionChange:t=>e.communicationsActiveSubsection=t,navRootLabel:`Communication`,includeSections:[...vI]});case`appearance`:return ue({formMode:e.appearanceFormMode,searchQuery:e.appearanceSearchQuery,activeSection:fe.activeSection,activeSubsection:fe.activeSubsection,onFormModeChange:t=>e.appearanceFormMode=t,onSearchChange:t=>e.appearanceSearchQuery=t,onSectionChange:t=>{e.appearanceActiveSection=t,e.appearanceActiveSubsection=null},onSubsectionChange:t=>e.appearanceActiveSubsection=t,navRootLabel:p(`tabs.appearance`),includeSections:[...yI],includeVirtualSections:!0});case`automation`:return ue({formMode:e.automationFormMode,searchQuery:e.automationSearchQuery,activeSection:pe.activeSection,activeSubsection:pe.activeSubsection,onFormModeChange:t=>e.automationFormMode=t,onSearchChange:t=>e.automationSearchQuery=t,onSectionChange:t=>{e.automationActiveSection=t,e.automationActiveSubsection=null},onSubsectionChange:t=>e.automationActiveSubsection=t,navRootLabel:`Automation`,includeSections:[...bI]});case`infrastructure`:return ue({formMode:e.infrastructureFormMode,searchQuery:e.infrastructureSearchQuery,activeSection:R.activeSection,activeSubsection:R.activeSubsection,onFormModeChange:t=>e.infrastructureFormMode=t,onSearchChange:t=>e.infrastructureSearchQuery=t,onSectionChange:t=>{e.infrastructureActiveSection=t,e.infrastructureActiveSubsection=null},onSubsectionChange:t=>e.infrastructureActiveSubsection=t,navRootLabel:`Infrastructure`,includeSections:[...xI]});case`aiAgents`:return ue({formMode:e.aiAgentsFormMode,searchQuery:e.aiAgentsSearchQuery,activeSection:z.activeSection,activeSubsection:z.activeSubsection,onFormModeChange:t=>e.aiAgentsFormMode=t,onSearchChange:t=>e.aiAgentsSearchQuery=t,onSectionChange:t=>{e.aiAgentsActiveSection=t,e.aiAgentsActiveSubsection=null},onSubsectionChange:t=>e.aiAgentsActiveSubsection=t,navRootLabel:`AI & Agents`,includeSections:[...SI]});default:return g}},he=t=>{if(t)switch(e.agentsPanel){case`files`:ff(e,t);return;case`skills`:_f(e,t);return;case`tools`:xf(e,t),Tf(e);return;case`overview`:case`channels`:case`cron`:return}},B=t=>{if(t===`channels`){Sn(e,!1);return}t===`cron`&&e.loadCron()},ge=(t=!1)=>{e.agentFilesList=null,e.agentFilesError=null,e.agentFileActive=null,e.agentFileContents={},e.agentFileDrafts={},t&&(e.agentFilesLoading=!1)},_e=()=>{ge(!0),e.agentSkillsReport=null,e.agentSkillsError=null,e.agentSkillsAgentId=null,e.toolsCatalogResult=null,e.toolsCatalogError=null,e.toolsCatalogLoading=!1,Cf(e)};return i`
6039
+ ${iM({open:e.paletteOpen,query:e.paletteQuery,activeIndex:e.paletteActiveIndex,onToggle:()=>{e.paletteOpen=!e.paletteOpen},onQueryChange:t=>{e.paletteQuery=t},onActiveIndexChange:t=>{e.paletteActiveIndex=t},onNavigate:t=>{e.setTab(t)},onSlashCommand:t=>{e.setTab(`chat`),e.chatMessage=t.endsWith(` `)?t:`${t} `}})}
6033
6040
  <div
6034
6041
  class="shell ${c?`shell--chat`:``} ${l?`shell--chat-focus`:``} ${d?`shell--nav-collapsed`:``} ${u?`shell--nav-drawer-open`:``} ${e.onboarding?`shell--onboarding`:``}"
6035
6042
  >
@@ -6128,8 +6135,8 @@ ${e.pluginDescription}</pre
6128
6135
  <a
6129
6136
  class="nav-item nav-item--external sidebar-utility-link"
6130
6137
  href="https://genesis.pixelzx.com/docs"
6131
- target=${zj}
6132
- rel=${Bj()}
6138
+ target=${Hj}
6139
+ rel=${Uj()}
6133
6140
  title="${p(`common.docs`)} (opens in new tab)"
6134
6141
  >
6135
6142
  <span class="nav-item__icon" aria-hidden="true">${J.book}</span>
@@ -6154,7 +6161,7 @@ ${e.pluginDescription}</pre
6154
6161
  </aside>
6155
6162
  </div>
6156
6163
  <main class="content ${c?`content--chat`:``}">
6157
- ${e.updateAvailable&&e.updateAvailable.latestVersion!==e.updateAvailable.currentVersion&&!lI(e.updateAvailable)?i`<div class="update-banner callout danger" role="alert">
6164
+ ${e.updateAvailable&&e.updateAvailable.latestVersion!==e.updateAvailable.currentVersion&&!gI(e.updateAvailable)?i`<div class="update-banner callout danger" role="alert">
6158
6165
  <strong>Update available:</strong> v${e.updateAvailable.latestVersion} (running
6159
6166
  v${e.updateAvailable.currentVersion}).
6160
6167
  <button
@@ -6169,7 +6176,7 @@ ${e.pluginDescription}</pre
6169
6176
  type="button"
6170
6177
  title="Dismiss"
6171
6178
  aria-label="Dismiss update banner"
6172
- @click=${()=>{uI(e.updateAvailable),e.updateAvailable=null}}
6179
+ @click=${()=>{_I(e.updateAvailable),e.updateAvailable=null}}
6173
6180
  >
6174
6181
  ${J.x}
6175
6182
  </button>
@@ -6205,34 +6212,36 @@ ${e.pluginDescription}</pre
6205
6212
  ${c?Aj(e):g}
6206
6213
  </div>
6207
6214
  </section>`}
6208
- ${e.tab===`overview`?AF({connected:e.connected,hello:e.hello,settings:e.settings,password:e.password,lastError:e.lastError,lastErrorCode:e.lastErrorCode,presenceCount:r,sessionsCount:a,cronEnabled:e.cronStatus?.enabled??null,cronNext:o,lastChannelsRefresh:e.channelsLastSuccess,warnQueryToken:cO,modelAuthStatus:e.modelAuthStatusResult,usageResult:e.usageResult,sessionsResult:e.sessionsResult,skillsReport:e.skillsReport,cronJobs:e.cronJobs,cronStatus:e.cronStatus,walletSummary:e.walletSummary,walletSummaryError:e.walletSummaryError,attentionItems:e.attentionItems,eventLog:e.eventLog,overviewLogLines:e.overviewLogLines,showGatewayToken:e.overviewShowGatewayToken,showGatewayPassword:e.overviewShowGatewayPassword,onSettingsChange:t=>e.applySettings(t),onPasswordChange:t=>e.password=t,onSessionKeyChange:t=>{e.sessionKey=t,e.chatMessage=``,e.chatMessages=[],e.chatToolMessages=[],e.chatStream=null,e.chatRunId=null,e.chatQueue=[],e.resetToolStream(),e.applySettings({...e.settings,sessionKey:t,lastActiveSessionKey:t})},onToggleGatewayTokenVisibility:()=>{e.overviewShowGatewayToken=!e.overviewShowGatewayToken},onToggleGatewayPasswordVisibility:()=>{e.overviewShowGatewayPassword=!e.overviewShowGatewayPassword},onConnect:()=>e.connect(),onRefresh:()=>e.loadOverview({refresh:!0}),onNavigate:t=>e.setTab(t),onRefreshLogs:()=>e.loadOverview({refresh:!0})}):g}
6209
- ${e.tab===`canvas`?tI(IF,t=>t.renderCanvas({connected:e.connected,client:e.client,gatewayUrl:e.settings.gatewayUrl,authToken:e.settings.token,password:e.password,basePath:e.basePath,canvasHostUrl:e.hello?.canvasHostUrl??null,embedSandboxMode:e.embedSandboxMode,allowExternalEmbedUrls:e.allowExternalEmbedUrls,onNavigateToChat:()=>e.setTab(`chat`),onRequestUpdate:n})):g}
6210
- ${e.tab===`channels`?tI(LF,t=>t.renderChannels({connected:e.connected,loading:e.channelsLoading,snapshot:e.channelsSnapshot,lastError:e.channelsError,lastSuccessAt:e.channelsLastSuccess,whatsappMessage:e.whatsappLoginMessage,whatsappQrDataUrl:e.whatsappLoginQrDataUrl,whatsappConnected:e.whatsappLoginConnected,whatsappBusy:e.whatsappBusy,configSchema:e.configSchema,configSchemaLoading:e.configSchemaLoading,configForm:e.configForm,configUiHints:e.configUiHints,configSaving:e.configSaving,configFormDirty:e.configFormDirty,nostrProfileFormState:e.nostrProfileFormState,nostrProfileAccountId:e.nostrProfileAccountId,channelWizardStep:e.channelWizardStep,channelWizardInput:e.channelWizardInput,channelWizardBusy:e.channelWizardBusy,channelWizardError:e.channelWizardError,channelWizardMessage:e.channelWizardMessage,onRefresh:t=>Sn(e,t),onChannelWizardStart:()=>e.handleChannelWizardStart(),onChannelWizardSubmit:()=>e.handleChannelWizardSubmit(),onChannelWizardCancel:()=>e.handleChannelWizardCancel(),onChannelWizardInput:t=>e.handleChannelWizardInput(t),onChannelWizardClose:()=>e.handleChannelWizardClose(),onWhatsAppStart:t=>e.handleWhatsAppStart(t),onWhatsAppWait:()=>e.handleWhatsAppWait(),onWhatsAppLogout:()=>e.handleWhatsAppLogout(),onConfigPatch:(t,n)=>xr(e,t,n),onConfigSave:()=>e.handleChannelConfigSave(),onConfigReload:()=>e.handleChannelConfigReload(),onNostrProfileEdit:(t,n)=>e.handleNostrProfileEdit(t,n),onNostrProfileCancel:()=>e.handleNostrProfileCancel(),onNostrProfileFieldChange:(t,n)=>e.handleNostrProfileFieldChange(t,n),onNostrProfileSave:()=>e.handleNostrProfileSave(),onNostrProfileImport:()=>e.handleNostrProfileImport(),onNostrProfileToggleAdvanced:()=>e.handleNostrProfileToggleAdvanced()})):g}
6211
- ${e.tab===`instances`?tI(BF,t=>t.renderInstances({loading:e.presenceLoading,entries:e.presenceEntries,lastError:e.presenceError,statusMessage:e.presenceStatus,onRefresh:()=>Wm(e)})):g}
6212
- ${e.tab===`sessions`?tI(GF,t=>t.renderSessions({loading:e.sessionsLoading,result:e.sessionsResult,error:e.sessionsError,activeMinutes:e.sessionsFilterActive,limit:e.sessionsFilterLimit,includeGlobal:e.sessionsIncludeGlobal,includeUnknown:e.sessionsIncludeUnknown,basePath:e.basePath,searchQuery:e.sessionsSearchQuery,sortColumn:e.sessionsSortColumn,sortDir:e.sessionsSortDir,page:e.sessionsPage,pageSize:e.sessionsPageSize,selectedKeys:e.sessionsSelectedKeys,expandedCheckpointKey:e.sessionsExpandedCheckpointKey,checkpointItemsByKey:e.sessionsCheckpointItemsByKey,checkpointLoadingKey:e.sessionsCheckpointLoadingKey,checkpointBusyKey:e.sessionsCheckpointBusyKey,checkpointErrorByKey:e.sessionsCheckpointErrorByKey,onFiltersChange:t=>{e.sessionsFilterActive=t.activeMinutes,e.sessionsFilterLimit=t.limit,e.sessionsIncludeGlobal=t.includeGlobal,e.sessionsIncludeUnknown=t.includeUnknown,e.sessionsPage=0,jF(e)},onSearchChange:t=>{e.sessionsSearchQuery=t,e.sessionsPage=0,jF(e)},onSortChange:(t,n)=>{e.sessionsSortColumn=t,e.sessionsSortDir=n,e.sessionsPage=0},onPageChange:t=>{e.sessionsPage=t},onPageSizeChange:t=>{e.sessionsPageSize=t,e.sessionsPage=0},onRefresh:()=>jF(e),onPatch:(t,n)=>Fl(e,t,n),onToggleSelect:t=>{let n=new Set(e.sessionsSelectedKeys);n.has(t)?n.delete(t):n.add(t),e.sessionsSelectedKeys=n},onSelectPage:t=>{let n=new Set(e.sessionsSelectedKeys);for(let e of t)n.add(e);e.sessionsSelectedKeys=n},onDeselectPage:t=>{let n=new Set(e.sessionsSelectedKeys);for(let e of t)n.delete(e);e.sessionsSelectedKeys=n},onDeselectAll:()=>{e.sessionsSelectedKeys=new Set},onDeleteSelected:async()=>{let t=await Il(e,[...e.sessionsSelectedKeys]);if(t.length>0){let n=new Set(e.sessionsSelectedKeys);for(let e of t)n.delete(e);e.sessionsSelectedKeys=n}},onNavigateToChat:t=>{Mj(e,t),e.setTab(`chat`)},onToggleCheckpointDetails:t=>Ll(e,t),onBranchFromCheckpoint:async(t,n)=>{let r=await Rl(e,t,n);r&&(Mj(e,r),e.setTab(`chat`))},onRestoreCheckpoint:(t,n)=>zl(e,t,n)})):g}
6215
+ ${e.tab===`overview`?NF({connected:e.connected,hello:e.hello,settings:e.settings,password:e.password,lastError:e.lastError,lastErrorCode:e.lastErrorCode,presenceCount:r,sessionsCount:a,cronEnabled:e.cronStatus?.enabled??null,cronNext:o,lastChannelsRefresh:e.channelsLastSuccess,warnQueryToken:cO,modelAuthStatus:e.modelAuthStatusResult,usageResult:e.usageResult,sessionsResult:e.sessionsResult,skillsReport:e.skillsReport,cronJobs:e.cronJobs,cronStatus:e.cronStatus,walletSummary:e.walletSummary,walletSummaryError:e.walletSummaryError,attentionItems:e.attentionItems,eventLog:e.eventLog,overviewLogLines:e.overviewLogLines,showGatewayToken:e.overviewShowGatewayToken,showGatewayPassword:e.overviewShowGatewayPassword,onSettingsChange:t=>e.applySettings(t),onPasswordChange:t=>e.password=t,onSessionKeyChange:t=>{e.sessionKey=t,e.chatMessage=``,e.chatMessages=[],e.chatToolMessages=[],e.chatStream=null,e.chatRunId=null,e.chatQueue=[],e.resetToolStream(),e.applySettings({...e.settings,sessionKey:t,lastActiveSessionKey:t})},onToggleGatewayTokenVisibility:()=>{e.overviewShowGatewayToken=!e.overviewShowGatewayToken},onToggleGatewayPasswordVisibility:()=>{e.overviewShowGatewayPassword=!e.overviewShowGatewayPassword},onConnect:()=>e.connect(),onRefresh:()=>e.loadOverview({refresh:!0}),onNavigate:t=>e.setTab(t),onRefreshLogs:()=>e.loadOverview({refresh:!0})}):g}
6216
+ ${e.tab===`canvas`?cI(VF,t=>t.renderCanvas({connected:e.connected,client:e.client,gatewayUrl:e.settings.gatewayUrl,authToken:e.settings.token,password:e.password,basePath:e.basePath,canvasHostUrl:e.hello?.canvasHostUrl??null,embedSandboxMode:e.embedSandboxMode,allowExternalEmbedUrls:e.allowExternalEmbedUrls,onNavigateToChat:()=>e.setTab(`chat`),onRequestUpdate:n})):g}
6217
+ ${e.tab===`channels`?cI(HF,t=>t.renderChannels({connected:e.connected,loading:e.channelsLoading,snapshot:e.channelsSnapshot,lastError:e.channelsError,lastSuccessAt:e.channelsLastSuccess,whatsappMessage:e.whatsappLoginMessage,whatsappQrDataUrl:e.whatsappLoginQrDataUrl,whatsappConnected:e.whatsappLoginConnected,whatsappBusy:e.whatsappBusy,configSchema:e.configSchema,configSchemaLoading:e.configSchemaLoading,configForm:e.configForm,configUiHints:e.configUiHints,configSaving:e.configSaving,configFormDirty:e.configFormDirty,nostrProfileFormState:e.nostrProfileFormState,nostrProfileAccountId:e.nostrProfileAccountId,channelWizardStep:e.channelWizardStep,channelWizardInput:e.channelWizardInput,channelWizardBusy:e.channelWizardBusy,channelWizardError:e.channelWizardError,channelWizardMessage:e.channelWizardMessage,onRefresh:t=>Sn(e,t),onChannelWizardStart:()=>e.handleChannelWizardStart(),onChannelWizardSubmit:()=>e.handleChannelWizardSubmit(),onChannelWizardCancel:()=>e.handleChannelWizardCancel(),onChannelWizardInput:t=>e.handleChannelWizardInput(t),onChannelWizardClose:()=>e.handleChannelWizardClose(),onWhatsAppStart:t=>e.handleWhatsAppStart(t),onWhatsAppWait:()=>e.handleWhatsAppWait(),onWhatsAppLogout:()=>e.handleWhatsAppLogout(),onConfigPatch:(t,n)=>xr(e,t,n),onConfigSave:()=>e.handleChannelConfigSave(),onConfigReload:()=>e.handleChannelConfigReload(),onNostrProfileEdit:(t,n)=>e.handleNostrProfileEdit(t,n),onNostrProfileCancel:()=>e.handleNostrProfileCancel(),onNostrProfileFieldChange:(t,n)=>e.handleNostrProfileFieldChange(t,n),onNostrProfileSave:()=>e.handleNostrProfileSave(),onNostrProfileImport:()=>e.handleNostrProfileImport(),onNostrProfileToggleAdvanced:()=>e.handleNostrProfileToggleAdvanced()})):g}
6218
+ ${e.tab===`instances`?cI(GF,t=>t.renderInstances({loading:e.presenceLoading,entries:e.presenceEntries,lastError:e.presenceError,statusMessage:e.presenceStatus,onRefresh:()=>Wm(e)})):g}
6219
+ ${e.tab===`sessions`?cI(QF,t=>t.renderSessions({loading:e.sessionsLoading,result:e.sessionsResult,error:e.sessionsError,activeMinutes:e.sessionsFilterActive,limit:e.sessionsFilterLimit,includeGlobal:e.sessionsIncludeGlobal,includeUnknown:e.sessionsIncludeUnknown,basePath:e.basePath,searchQuery:e.sessionsSearchQuery,sortColumn:e.sessionsSortColumn,sortDir:e.sessionsSortDir,page:e.sessionsPage,pageSize:e.sessionsPageSize,selectedKeys:e.sessionsSelectedKeys,expandedCheckpointKey:e.sessionsExpandedCheckpointKey,checkpointItemsByKey:e.sessionsCheckpointItemsByKey,checkpointLoadingKey:e.sessionsCheckpointLoadingKey,checkpointBusyKey:e.sessionsCheckpointBusyKey,checkpointErrorByKey:e.sessionsCheckpointErrorByKey,onFiltersChange:t=>{e.sessionsFilterActive=t.activeMinutes,e.sessionsFilterLimit=t.limit,e.sessionsIncludeGlobal=t.includeGlobal,e.sessionsIncludeUnknown=t.includeUnknown,e.sessionsPage=0,PF(e)},onSearchChange:t=>{e.sessionsSearchQuery=t,e.sessionsPage=0,PF(e)},onSortChange:(t,n)=>{e.sessionsSortColumn=t,e.sessionsSortDir=n,e.sessionsPage=0},onPageChange:t=>{e.sessionsPage=t},onPageSizeChange:t=>{e.sessionsPageSize=t,e.sessionsPage=0},onRefresh:()=>PF(e),onPatch:(t,n)=>Fl(e,t,n),onToggleSelect:t=>{let n=new Set(e.sessionsSelectedKeys);n.has(t)?n.delete(t):n.add(t),e.sessionsSelectedKeys=n},onSelectPage:t=>{let n=new Set(e.sessionsSelectedKeys);for(let e of t)n.add(e);e.sessionsSelectedKeys=n},onDeselectPage:t=>{let n=new Set(e.sessionsSelectedKeys);for(let e of t)n.delete(e);e.sessionsSelectedKeys=n},onDeselectAll:()=>{e.sessionsSelectedKeys=new Set},onDeleteSelected:async()=>{let t=await Il(e,[...e.sessionsSelectedKeys]);if(t.length>0){let n=new Set(e.sessionsSelectedKeys);for(let e of t)n.delete(e);e.sessionsSelectedKeys=n}},onNavigateToChat:t=>{Mj(e,t),e.setTab(`chat`)},onToggleCheckpointDetails:t=>Ll(e,t),onBranchFromCheckpoint:async(t,n)=>{let r=await Rl(e,t,n);r&&(Mj(e,r),e.setTab(`chat`))},onRestoreCheckpoint:(t,n)=>zl(e,t,n)})):g}
6213
6220
  ${ZA(e)}
6214
- ${e.tab===`wallet`?tI(qF,t=>t.renderWallet({connected:e.connected,loading:e.walletSummaryLoading,balancesLoading:e.walletBalancesLoading,summary:e.walletSummary,error:e.walletSummaryError,lastUpdatedAt:e.walletLastUpdatedAt,recoveryPhraseMode:e.walletRecoveryPhraseMode,recoveryPhraseBusy:e.walletRecoveryPhraseBusy,recoveryPhraseError:e.walletRecoveryPhraseError,recoveryPhraseGeneratedMnemonic:e.walletRecoveryPhraseGeneratedMnemonic,recoveryPhraseStatus:e.walletRecoveryPhraseStatus,onRefresh:()=>Eh(e,{includeBalances:!0}),onRecoveryPhraseModeChange:t=>{e.walletRecoveryPhraseMode=t,e.walletRecoveryPhraseError=null,e.walletRecoveryPhraseGeneratedMnemonic=null,e.walletRecoveryPhraseStatus=null,n?.()},onManageRecoveryPhrase:t=>Dh(e,t),onConfigure:()=>{e.configSettingsMode=`advanced`,e.configFormMode=`form`,e.configActiveSection=`wallet`,e.configActiveSubsection=null,e.setTab(`config`),n?.()}})):g}
6215
- ${e.tab===`cron`?kI(e,n):g}
6216
- ${e.tab===`cron`?tI(RF,t=>t.renderCron({basePath:e.basePath,loading:e.cronLoading,status:e.cronStatus,jobs:M,jobsLoadingMore:e.cronJobsLoadingMore,jobsTotal:e.cronJobsTotal,jobsHasMore:e.cronJobsHasMore,jobsQuery:e.cronJobsQuery,jobsEnabledFilter:e.cronJobsEnabledFilter,jobsScheduleKindFilter:e.cronJobsScheduleKindFilter,jobsLastStatusFilter:e.cronJobsLastStatusFilter,jobsSortBy:e.cronJobsSortBy,jobsSortDir:e.cronJobsSortDir,editingJobId:e.cronEditingJobId,error:e.cronError,busy:e.cronBusy,form:e.cronForm,channels:e.channelsSnapshot?.channelMeta?.length?e.channelsSnapshot.channelMeta.map(e=>e.id):e.channelsSnapshot?.channelOrder??[],channelLabels:e.channelsSnapshot?.channelLabels??{},channelMeta:e.channelsSnapshot?.channelMeta??[],runsJobId:e.cronRunsJobId,runs:e.cronRuns,runsTotal:e.cronRunsTotal,runsHasMore:e.cronRunsHasMore,runsLoadingMore:e.cronRunsLoadingMore,runsScope:e.cronRunsScope,runsStatuses:e.cronRunsStatuses,runsDeliveryStatuses:e.cronRunsDeliveryStatuses,runsStatusFilter:e.cronRunsStatusFilter,runsQuery:e.cronRunsQuery,runsSortDir:e.cronRunsSortDir,fieldErrors:e.cronFieldErrors,canSubmit:!Mf(e.cronFieldErrors),agentSuggestions:j,modelSuggestions:oe,thinkingSuggestions:rI,timezoneSuggestions:iI,deliveryToSuggestions:I,accountSuggestions:F,onFormChange:t=>{e.cronForm=Af({...e.cronForm,...t}),e.cronFieldErrors=jf(e.cronForm)},onRefresh:()=>e.loadCron(),onAdd:()=>Xf(e),onEdit:t=>rp(e,t),onClone:t=>ap(e,t),onCancelEdit:()=>op(e),onToggle:(t,n)=>Zf(e,t,n),onRun:(t,n)=>Qf(e,t,n??`force`),onRemove:t=>$f(e,t),onQuickCreate:()=>{e.cronQuickCreateOpen=!0,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=ON(),n?.()},onLoadRuns:async t=>{np(e,{cronRunsScope:`job`}),await ep(e,t)},onLoadMoreJobs:()=>If(e,{append:!0}),onJobsFiltersChange:async t=>{Lf(e,t),(typeof t.cronJobsQuery==`string`||t.cronJobsEnabledFilter||t.cronJobsSortBy||t.cronJobsSortDir)&&await If(e,{append:!1})},onJobsFiltersReset:async()=>{Lf(e,{cronJobsQuery:``,cronJobsEnabledFilter:`all`,cronJobsScheduleKindFilter:`all`,cronJobsLastStatusFilter:`all`,cronJobsSortBy:`nextRunAtMs`,cronJobsSortDir:`asc`}),await If(e,{append:!1})},onLoadMoreRuns:()=>tp(e),onRunsFiltersChange:async t=>{if(np(e,t),e.cronRunsScope===`all`){await ep(e,null);return}await ep(e,e.cronRunsJobId)},onNavigateToChat:t=>{Mj(e,t),e.setTab(`chat`)}})):g}
6217
- ${e.tab===`agents`?tI(FF,t=>t.renderAgents({basePath:e.basePath??``,connected:e.connected,loading:e.agentsLoading,error:e.agentsError,agentsList:e.agentsList,selectedAgentId:T,activePanel:e.agentsPanel,config:{form:v,loading:e.configLoading,saving:e.configSaving,dirty:e.configFormDirty},channels:{snapshot:e.channelsSnapshot,loading:e.channelsLoading,error:e.channelsError,lastSuccess:e.channelsLastSuccess},cron:{status:e.cronStatus,jobs:e.cronJobs,loading:e.cronLoading,error:e.cronError},agentFiles:{list:e.agentFilesList,loading:e.agentFilesLoading,error:e.agentFilesError,active:e.agentFileActive,contents:e.agentFileContents,drafts:e.agentFileDrafts,saving:e.agentFileSaving},agentIdentityLoading:e.agentIdentityLoading,agentIdentityError:e.agentIdentityError,agentIdentityById:e.agentIdentityById,agentSkills:{report:e.agentSkillsReport,loading:e.agentSkillsLoading,error:e.agentSkillsError,agentId:e.agentSkillsAgentId,filter:e.skillsFilter},toolsCatalog:{loading:e.toolsCatalogLoading,error:e.toolsCatalogError,result:e.toolsCatalogResult},toolsEffective:{loading:e.toolsEffectiveLoading,error:e.toolsEffectiveError,result:e.toolsEffectiveResult},runtimeSessionKey:e.sessionKey,runtimeSessionMatchesSelectedAgent:ie,modelCatalog:e.chatModelCatalog??[],modelProviderWizardStep:e.modelProviderWizardStep,modelProviderWizardInput:e.modelProviderWizardInput,modelProviderWizardBusy:e.modelProviderWizardBusy,modelProviderWizardError:e.modelProviderWizardError,modelProviderWizardMessage:e.modelProviderWizardMessage,onRefresh:async()=>{await bf(e);let t=e.agentsList?.agents?.map(e=>e.id)??[];t.length>0&&gf(e,t),he(re()),B(e.agentsPanel)},onSelectAgent:t=>{e.agentsSelectedId!==t&&(e.agentsSelectedId=t,_e(),hf(e,t),he(t))},onSelectPanel:t=>{if(e.agentsPanel=t,t===`files`&&T&&e.agentFilesList?.agentId!==T&&(ge(),ff(e,T)),t===`skills`&&T&&_f(e,T),t===`tools`&&T)if((e.toolsCatalogResult?.agentId!==T||e.toolsCatalogError)&&xf(e,T),T===pa(e.sessionKey)){let t=wf(e,{agentId:T,sessionKey:e.sessionKey});(e.toolsEffectiveResultKey!==t||e.toolsEffectiveError)&&Sf(e,{agentId:T,sessionKey:e.sessionKey})}else Cf(e);B(t)},onLoadFiles:t=>ff(e,t),onSelectFile:t=>{e.agentFileActive=t,T&&pf(e,T,t)},onFileDraftChange:(t,n)=>{e.agentFileDrafts={...e.agentFileDrafts,[t]:n}},onFileReset:t=>{let n=e.agentFileContents[t]??``;e.agentFileDrafts={...e.agentFileDrafts,[t]:n}},onFileSave:t=>{T&&mf(e,T,t,e.agentFileDrafts[t]??e.agentFileContents[t]??``)},onToolsProfileChange:(t,n,r)=>{let i=ae(t,!!(n||r));i&&(n?xr(e,[...i,`profile`],n):Cr(e,[...i,`profile`]),r&&Cr(e,[...i,`allow`]))},onToolsOverridesChange:(t,n,r)=>{let i=ae(t,n.length>0||r.length>0);i&&(n.length>0?xr(e,[...i,`alsoAllow`],n):Cr(e,[...i,`alsoAllow`]),r.length>0?xr(e,[...i,`deny`],r):Cr(e,[...i,`deny`]))},onConfigReload:()=>Qn(e),onConfigSave:()=>Df(e),onModelProviderWizardStart:()=>e.handleModelProviderWizardStart(),onModelProviderWizardSubmit:()=>e.handleModelProviderWizardSubmit(),onModelProviderWizardCancel:()=>e.handleModelProviderWizardCancel(),onModelProviderWizardInput:t=>e.handleModelProviderWizardInput(t),onModelProviderWizardClose:()=>e.handleModelProviderWizardClose(),onChannelsRefresh:()=>Sn(e,!1),onCronRefresh:()=>e.loadCron(),onCronRunNow:t=>{let n=e.cronJobs.find(e=>e.id===t);n&&Qf(e,n,`force`)},onSkillsFilterChange:t=>e.skillsFilter=t,onSkillsRefresh:()=>{T&&_f(e,T)},onAgentSkillToggle:(t,n,r)=>{let i=k(t);if(i<0)return;let a=D()?.agents?.list,o=Array.isArray(a)?a[i]:void 0,s=n.trim();if(!s)return;let c=e.agentSkillsReport?.skills?.map(e=>e.name).filter(Boolean)??[],l=(Array.isArray(o?.skills)?o.skills.map(e=>String(e).trim()).filter(Boolean):void 0)??c,u=new Set(l);r?u.add(s):u.delete(s),xr(e,[`agents`,`list`,i,`skills`],[...u])},onAgentSkillsClear:t=>{let n=O(t);n<0||Cr(e,[`agents`,`list`,n,`skills`])},onAgentSkillsDisableAll:t=>{let n=k(t);n<0||xr(e,[`agents`,`list`,n,`skills`],[])},onModelChange:(t,n)=>{let r=n?k(t):O(t);if(r<0)return;let{basePath:i,existing:a}=A(r);if(!n)Cr(e,i);else if(a&&typeof a==`object`&&!Array.isArray(a)){let t=a.fallbacks;xr(e,i,{primary:n,...Array.isArray(t)?{fallbacks:t}:{}})}else xr(e,i,n);Tf(e)},onModelFallbacksChange:(t,n)=>{let r=n.map(e=>e.trim()).filter(Boolean),i=xu(D(),t),a=Tu(i.entry?.model)??Tu(i.defaults?.model),o=Du(i.entry?.model,i.defaults?.model),s=r.length>0?a?k(t):-1:(o?.length??0)>0||O(t)>=0?k(t):-1;if(s<0)return;let{basePath:c,existing:l}=A(s),u=(()=>{if(typeof l==`string`)return l.trim()||null;if(l&&typeof l==`object`&&!Array.isArray(l)){let e=l.primary;if(typeof e==`string`)return e.trim()||null}return null})()??a;if(r.length===0){u?xr(e,c,u):Cr(e,c);return}u&&xr(e,c,{primary:u,fallbacks:r})},onSetDefault:t=>{v&&xr(e,[`agents`,`defaultId`],t)}})):g}
6218
- ${e.tab===`skills`?tI(KF,t=>t.renderSkills({connected:e.connected,loading:e.skillsLoading,report:e.skillsReport,error:e.skillsError,filter:e.skillsFilter,statusFilter:e.skillsStatusFilter,edits:e.skillEdits,messages:e.skillMessages,busyKey:e.skillsBusyKey,detailKey:e.skillsDetailKey,clawhubQuery:e.clawhubSearchQuery,clawhubResults:e.clawhubSearchResults,clawhubSearchLoading:e.clawhubSearchLoading,clawhubSearchError:e.clawhubSearchError,clawhubDetail:e.clawhubDetail,clawhubDetailSlug:e.clawhubDetailSlug,clawhubDetailLoading:e.clawhubDetailLoading,clawhubDetailError:e.clawhubDetailError,clawhubInstallSlug:e.clawhubInstallSlug,clawhubInstallMessage:e.clawhubInstallMessage,onFilterChange:t=>e.skillsFilter=t,onStatusFilterChange:t=>e.skillsStatusFilter=t,onRefresh:()=>Ym(e,{clearMessages:!0}),onToggle:(t,n)=>Qm(e,t,n),onEdit:(t,n)=>Xm(e,t,n),onSaveKey:t=>$m(e,t),onInstall:(t,n,r)=>eh(e,t,n,r),onDetailOpen:t=>e.skillsDetailKey=t,onDetailClose:()=>e.skillsDetailKey=null,onClawHubQueryChange:t=>{Jm(e,t),ZF&&clearTimeout(ZF),ZF=setTimeout(()=>th(e,t),300)},onClawHubDetailOpen:t=>nh(e,t),onClawHubDetailClose:()=>rh(e),onClawHubInstall:t=>ih(e,t)})):g}
6219
- ${e.tab===`mcp`?tI(HF,t=>t.renderMcp({connected:e.connected,loading:e.mcpServersLoading,servers:e.mcpServers,path:e.mcpServersPath,error:e.mcpServersError,busy:e.mcpBusy,message:e.mcpMessage,addMode:e.mcpAddMode,linkUrl:e.mcpLinkUrl,linkLoading:e.mcpLinkMetadataLoading,linkError:e.mcpLinkMetadataError,linkMetadata:e.mcpLinkMetadata,draftName:e.mcpDraftName,draftConfig:e.mcpDraftConfig,authToken:e.mcpAuthToken,presetId:e.mcpPresetId,oauthStatus:e.mcpOAuthStatus,oauthFlow:e.mcpOAuthFlow,testStatus:e.mcpTestStatus,onAddModeChange:t=>e.mcpAddMode=t,onLinkUrlChange:t=>e.mcpLinkUrl=t,onLinkFetch:()=>void Sm(e,e.mcpLinkUrl),onLinkClear:()=>{e.mcpLinkMetadata=null,e.mcpLinkMetadataError=null},onRefresh:()=>{ym(e),wm(e)},onDraftNameChange:t=>{e.mcpDraftName=t},onDraftConfigChange:t=>{e.mcpDraftConfig=t},onAuthTokenChange:t=>{e.mcpAuthToken=t},onPresetSelect:t=>{e.mcpPresetId=t.id,e.mcpDraftName=t.name,e.mcpAuthToken=``,e.mcpMessage=null},onPresetSave:t=>{let n=e.mcpDraftName.trim()||t.name,r=tF(t,e.mcpAuthToken);e.mcpDraftName=n,bm(e,n,r).then(()=>{e.mcpMessage?.kind===`success`&&(e.mcpPresetId=null,wm(e))})},onEdit:t=>{e.mcpAddMode=`json`,e.mcpDraftName=t;let n=e.mcpServers?.[t];e.mcpDraftConfig=n?JSON.stringify(n,null,2):``,e.mcpMessage=null},onSave:()=>{let t=e.mcpDraftConfig.trim(),n;try{n=t?JSON.parse(t):{}}catch(t){e.mcpMessage={kind:`error`,text:`Invalid JSON: ${t instanceof Error?t.message:String(t)}`};return}if(typeof n!=`object`||!n||Array.isArray(n)){e.mcpMessage={kind:`error`,text:`Config must be a JSON object.`};return}bm(e,e.mcpDraftName,n)},onSaveMetadata:t=>{let n=e.mcpDraftName.trim()||t.name,r={url:t.url,transport:t.transport};t.oauth&&t.oauthIssuer?r.auth={type:`oauth`,issuer:t.oauthIssuer}:t.oauth?r.auth={type:`oauth`}:r=eF(r,e.mcpAuthToken),e.mcpDraftName=n,e.mcpDraftConfig=JSON.stringify(r,null,2),bm(e,n,r).then(()=>{e.mcpMessage?.kind===`success`&&(e.mcpLinkMetadata=null,e.mcpLinkUrl=``,wm(e))})},onDelete:t=>{confirm(`Remove MCP server "${t}"?`)&&xm(e,t)},onTest:t=>{Cm(e,t)},onOAuthConnect:t=>{JF(e,t)},onOAuthDisconnect:t=>{Dm(e,t)},onOAuthCancel:()=>{Om(e)}})):g}
6220
- ${e.tab===`plugins`?tI(WF,t=>t.renderPlugins({connected:e.connected,loading:e.pluginsLoading,report:e.pluginsReport,error:e.pluginsError,filter:e.pluginsFilter,statusFilter:e.pluginsStatusFilter,busyKey:e.pluginsBusyKey,messages:e.pluginMessages,detailKey:e.pluginDetailKey,clawhubQuery:e.pluginClawhubSearchQuery,clawhubResults:e.pluginClawhubSearchResults,clawhubSearchLoading:e.pluginClawhubSearchLoading,clawhubSearchError:e.pluginClawhubSearchError,clawhubDetail:e.pluginClawhubDetail,clawhubDetailName:e.pluginClawhubDetailName,clawhubDetailLoading:e.pluginClawhubDetailLoading,clawhubDetailError:e.pluginClawhubDetailError,clawhubInstallName:e.pluginClawhubInstallName,clawhubInstallMessage:e.pluginClawhubInstallMessage,onFilterChange:t=>e.pluginsFilter=t,onStatusFilterChange:t=>e.pluginsStatusFilter=t,onRefresh:()=>Fm(e,{clearMessages:!0}),onToggle:(t,n)=>Lm(e,t,n),onUninstall:t=>Rm(e,t),onDetailOpen:t=>e.pluginDetailKey=t,onDetailClose:()=>e.pluginDetailKey=null,onClawHubQueryChange:t=>{zm(e,t),QF&&clearTimeout(QF),QF=setTimeout(()=>Bm(e,t),300)},onClawHubDetailOpen:t=>Vm(e,t),onClawHubDetailClose:()=>Hm(e),onClawHubInstall:t=>Um(e,t)})):g}
6221
- ${e.tab===`nodes`?tI(UF,t=>t.renderNodes({loading:e.nodesLoading,nodes:e.nodes,nodeManagementSelectedId:e.nodeManagementSelectedId,nodeManagementRename:e.nodeManagementRename,nodeManagementCommand:e.nodeManagementCommand,nodeManagementParams:e.nodeManagementParams,nodeManagementShell:e.nodeManagementShell,nodeManagementCwd:e.nodeManagementCwd,nodeManagementTimeoutMs:e.nodeManagementTimeoutMs,nodeManagementBusy:e.nodeManagementBusy,nodeManagementError:e.nodeManagementError,nodeManagementResult:e.nodeManagementResult,devicesLoading:e.devicesLoading,devicesError:e.devicesError,devicesList:e.devicesList,configForm:e.configForm??e.configSnapshot?.config,configLoading:e.configLoading,configSaving:e.configSaving,configDirty:e.configFormDirty,configFormMode:e.configFormMode,execApprovalsLoading:e.execApprovalsLoading,execApprovalsSaving:e.execApprovalsSaving,execApprovalsDirty:e.execApprovalsDirty,execApprovalsSnapshot:e.execApprovalsSnapshot,execApprovalsForm:e.execApprovalsForm,execApprovalsSelectedAgent:e.execApprovalsSelectedAgent,execApprovalsTarget:e.execApprovalsTarget,execApprovalsTargetNodeId:e.execApprovalsTargetNodeId,onRefresh:()=>Zd(e),onNodeManagementSelect:t=>Qd(e,t),onNodeManagementRenameChange:t=>{e.nodeManagementRename=t},onNodeManagementCommandChange:t=>$d(e,t),onNodeManagementParamsChange:t=>{e.nodeManagementParams=t},onNodeManagementShellChange:t=>{e.nodeManagementShell=t},onNodeManagementCwdChange:t=>{e.nodeManagementCwd=t},onNodeManagementTimeoutChange:t=>{e.nodeManagementTimeoutMs=t},onNodeManagementRename:()=>ef(e),onNodeManagementInvoke:()=>tf(e),onNodeManagementRunShell:()=>nf(e),onNodeManagementPreset:t=>rf(e,t),onDevicesRefresh:()=>sp(e),onDeviceApprove:t=>cp(e,t),onDeviceReject:t=>lp(e,t),onDeviceRotate:(t,n,r)=>up(e,{deviceId:t,role:n,scopes:r}),onDeviceRevoke:(t,n)=>dp(e,{deviceId:t,role:n}),onLoadConfig:()=>Qn(e),onLoadExecApprovals:()=>pm(e,e.execApprovalsTarget===`node`&&e.execApprovalsTargetNodeId?{kind:`node`,nodeId:e.execApprovalsTargetNodeId}:{kind:`gateway`}),onBindDefault:t=>{t?xr(e,[`tools`,`exec`,`node`],t):Cr(e,[`tools`,`exec`,`node`])},onBindAgent:(t,n)=>{let r=[`agents`,`list`,t,`tools`,`exec`,`node`];n?xr(e,r,n):Cr(e,r)},onSaveBindings:()=>pr(e),onExecApprovalsTargetChange:(t,n)=>{e.execApprovalsTarget=t,e.execApprovalsTargetNodeId=n,e.execApprovalsSnapshot=null,e.execApprovalsForm=null,e.execApprovalsDirty=!1,e.execApprovalsSelectedAgent=null},onExecApprovalsSelectAgent:t=>{e.execApprovalsSelectedAgent=t},onExecApprovalsPatch:(t,n)=>gm(e,t,n),onExecApprovalsRemove:t=>_m(e,t),onSaveExecApprovals:()=>hm(e,e.execApprovalsTarget===`node`&&e.execApprovalsTargetNodeId?{kind:`node`,nodeId:e.execApprovalsTargetNodeId}:{kind:`gateway`})})):g}
6221
+ ${e.tab===`wallet`?cI(eI,t=>t.renderWallet({connected:e.connected,loading:e.walletSummaryLoading,balancesLoading:e.walletBalancesLoading,summary:e.walletSummary,error:e.walletSummaryError,lastUpdatedAt:e.walletLastUpdatedAt,recoveryPhraseMode:e.walletRecoveryPhraseMode,recoveryPhraseBusy:e.walletRecoveryPhraseBusy,recoveryPhraseError:e.walletRecoveryPhraseError,recoveryPhraseGeneratedMnemonic:e.walletRecoveryPhraseGeneratedMnemonic,recoveryPhraseStatus:e.walletRecoveryPhraseStatus,onRefresh:()=>Eh(e,{includeBalances:!0}),onRecoveryPhraseModeChange:t=>{e.walletRecoveryPhraseMode=t,e.walletRecoveryPhraseError=null,e.walletRecoveryPhraseGeneratedMnemonic=null,e.walletRecoveryPhraseStatus=null,n?.()},onManageRecoveryPhrase:t=>Dh(e,t),onConfigure:()=>{e.configSettingsMode=`advanced`,e.configFormMode=`form`,e.configActiveSection=`wallet`,e.configActiveSubsection=null,e.setTab(`config`),n?.()}})):g}
6222
+ ${e.tab===`cron`?II(e,n):g}
6223
+ ${e.tab===`cron`?cI(UF,t=>t.renderCron({basePath:e.basePath,loading:e.cronLoading,status:e.cronStatus,jobs:j,jobsLoadingMore:e.cronJobsLoadingMore,jobsTotal:e.cronJobsTotal,jobsHasMore:e.cronJobsHasMore,jobsQuery:e.cronJobsQuery,jobsEnabledFilter:e.cronJobsEnabledFilter,jobsScheduleKindFilter:e.cronJobsScheduleKindFilter,jobsLastStatusFilter:e.cronJobsLastStatusFilter,jobsSortBy:e.cronJobsSortBy,jobsSortDir:e.cronJobsSortDir,editingJobId:e.cronEditingJobId,error:e.cronError,busy:e.cronBusy,form:e.cronForm,channels:e.channelsSnapshot?.channelMeta?.length?e.channelsSnapshot.channelMeta.map(e=>e.id):e.channelsSnapshot?.channelOrder??[],channelLabels:e.channelsSnapshot?.channelLabels??{},channelMeta:e.channelsSnapshot?.channelMeta??[],runsJobId:e.cronRunsJobId,runs:e.cronRuns,runsTotal:e.cronRunsTotal,runsHasMore:e.cronRunsHasMore,runsLoadingMore:e.cronRunsLoadingMore,runsScope:e.cronRunsScope,runsStatuses:e.cronRunsStatuses,runsDeliveryStatuses:e.cronRunsDeliveryStatuses,runsStatusFilter:e.cronRunsStatusFilter,runsQuery:e.cronRunsQuery,runsSortDir:e.cronRunsSortDir,fieldErrors:e.cronFieldErrors,canSubmit:!Mf(e.cronFieldErrors),agentSuggestions:A,modelSuggestions:se,thinkingSuggestions:uI,timezoneSuggestions:dI,deliveryToSuggestions:I,accountSuggestions:F,onFormChange:t=>{e.cronForm=Af({...e.cronForm,...t}),e.cronFieldErrors=jf(e.cronForm)},onRefresh:()=>e.loadCron(),onAdd:()=>Xf(e),onEdit:t=>rp(e,t),onClone:t=>ap(e,t),onCancelEdit:()=>op(e),onToggle:(t,n)=>Zf(e,t,n),onRun:(t,n)=>Qf(e,t,n??`force`),onRemove:t=>$f(e,t),onQuickCreate:()=>{e.cronQuickCreateOpen=!0,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=jN(),n?.()},onLoadRuns:async t=>{np(e,{cronRunsScope:`job`}),await ep(e,t)},onLoadMoreJobs:()=>If(e,{append:!0}),onJobsFiltersChange:async t=>{Lf(e,t),(typeof t.cronJobsQuery==`string`||t.cronJobsEnabledFilter||t.cronJobsSortBy||t.cronJobsSortDir)&&await If(e,{append:!1})},onJobsFiltersReset:async()=>{Lf(e,{cronJobsQuery:``,cronJobsEnabledFilter:`all`,cronJobsScheduleKindFilter:`all`,cronJobsLastStatusFilter:`all`,cronJobsSortBy:`nextRunAtMs`,cronJobsSortDir:`asc`}),await If(e,{append:!1})},onLoadMoreRuns:()=>tp(e),onRunsFiltersChange:async t=>{if(np(e,t),e.cronRunsScope===`all`){await ep(e,null);return}await ep(e,e.cronRunsJobId)},onNavigateToChat:t=>{Mj(e,t),e.setTab(`chat`)}})):g}
6224
+ ${e.tab===`agents`?cI(BF,t=>t.renderAgents({basePath:e.basePath??``,connected:e.connected,loading:e.agentsLoading,error:e.agentsError,agentsList:e.agentsList,selectedAgentId:T,activePanel:e.agentsPanel,config:{form:v,loading:e.configLoading,saving:e.configSaving,dirty:e.configFormDirty},channels:{snapshot:e.channelsSnapshot,loading:e.channelsLoading,error:e.channelsError,lastSuccess:e.channelsLastSuccess},cron:{status:e.cronStatus,jobs:e.cronJobs,loading:e.cronLoading,error:e.cronError},agentFiles:{list:e.agentFilesList,loading:e.agentFilesLoading,error:e.agentFilesError,active:e.agentFileActive,contents:e.agentFileContents,drafts:e.agentFileDrafts,saving:e.agentFileSaving},agentIdentityLoading:e.agentIdentityLoading,agentIdentityError:e.agentIdentityError,agentIdentityById:e.agentIdentityById,agentSkills:{report:e.agentSkillsReport,loading:e.agentSkillsLoading,error:e.agentSkillsError,agentId:e.agentSkillsAgentId,filter:e.skillsFilter},toolsCatalog:{loading:e.toolsCatalogLoading,error:e.toolsCatalogError,result:e.toolsCatalogResult},toolsEffective:{loading:e.toolsEffectiveLoading,error:e.toolsEffectiveError,result:e.toolsEffectiveResult},runtimeSessionKey:e.sessionKey,runtimeSessionMatchesSelectedAgent:ae,modelCatalog:e.chatModelCatalog??[],modelProviderWizardStep:e.modelProviderWizardStep,modelProviderWizardInput:e.modelProviderWizardInput,modelProviderWizardBusy:e.modelProviderWizardBusy,modelProviderWizardError:e.modelProviderWizardError,modelProviderWizardMessage:e.modelProviderWizardMessage,onRefresh:async()=>{await bf(e);let t=e.agentsList?.agents?.map(e=>e.id)??[];t.length>0&&gf(e,t),he(re()),B(e.agentsPanel)},onSelectAgent:t=>{e.agentsSelectedId!==t&&(e.agentsSelectedId=t,_e(),hf(e,t),he(t))},onSelectPanel:t=>{if(e.agentsPanel=t,t===`files`&&T&&e.agentFilesList?.agentId!==T&&(ge(),ff(e,T)),t===`skills`&&T&&_f(e,T),t===`tools`&&T)if((e.toolsCatalogResult?.agentId!==T||e.toolsCatalogError)&&xf(e,T),T===pa(e.sessionKey)){let t=wf(e,{agentId:T,sessionKey:e.sessionKey});(e.toolsEffectiveResultKey!==t||e.toolsEffectiveError)&&Sf(e,{agentId:T,sessionKey:e.sessionKey})}else Cf(e);B(t)},onLoadFiles:t=>ff(e,t),onSelectFile:t=>{e.agentFileActive=t,T&&pf(e,T,t)},onFileDraftChange:(t,n)=>{e.agentFileDrafts={...e.agentFileDrafts,[t]:n}},onFileReset:t=>{let n=e.agentFileContents[t]??``;e.agentFileDrafts={...e.agentFileDrafts,[t]:n}},onFileSave:t=>{T&&mf(e,T,t,e.agentFileDrafts[t]??e.agentFileContents[t]??``)},onToolsProfileChange:(t,n,r)=>{let i=oe(t,!!(n||r));i&&(n?xr(e,[...i,`profile`],n):Cr(e,[...i,`profile`]),r&&Cr(e,[...i,`allow`]))},onToolsOverridesChange:(t,n,r)=>{let i=oe(t,n.length>0||r.length>0);i&&(n.length>0?xr(e,[...i,`alsoAllow`],n):Cr(e,[...i,`alsoAllow`]),r.length>0?xr(e,[...i,`deny`],r):Cr(e,[...i,`deny`]))},onConfigReload:()=>Qn(e),onConfigSave:()=>Df(e),onModelProviderWizardStart:()=>e.handleModelProviderWizardStart(),onModelProviderWizardSubmit:()=>e.handleModelProviderWizardSubmit(),onModelProviderWizardCancel:()=>e.handleModelProviderWizardCancel(),onModelProviderWizardInput:t=>e.handleModelProviderWizardInput(t),onModelProviderWizardClose:()=>e.handleModelProviderWizardClose(),onChannelsRefresh:()=>Sn(e,!1),onCronRefresh:()=>e.loadCron(),onCronRunNow:t=>{let n=e.cronJobs.find(e=>e.id===t);n&&Qf(e,n,`force`)},onSkillsFilterChange:t=>e.skillsFilter=t,onSkillsRefresh:()=>{T&&_f(e,T)},onAgentSkillToggle:(t,n,r)=>{let i=O(t);if(i<0)return;let a=E()?.agents?.list,o=Array.isArray(a)?a[i]:void 0,s=n.trim();if(!s)return;let c=e.agentSkillsReport?.skills?.map(e=>e.name).filter(Boolean)??[],l=(Array.isArray(o?.skills)?o.skills.map(e=>String(e).trim()).filter(Boolean):void 0)??c,u=new Set(l);r?u.add(s):u.delete(s),xr(e,[`agents`,`list`,i,`skills`],[...u])},onAgentSkillsClear:t=>{let n=D(t);n<0||Cr(e,[`agents`,`list`,n,`skills`])},onAgentSkillsDisableAll:t=>{let n=O(t);n<0||xr(e,[`agents`,`list`,n,`skills`],[])},onModelChange:(t,n)=>{let r=n?O(t):D(t);if(r<0)return;let{basePath:i,existing:a}=k(r);if(!n)Cr(e,i);else if(a&&typeof a==`object`&&!Array.isArray(a)){let t=a.fallbacks;xr(e,i,{primary:n,...Array.isArray(t)?{fallbacks:t}:{}})}else xr(e,i,n);Tf(e)},onModelFallbacksChange:(t,n)=>{let r=n.map(e=>e.trim()).filter(Boolean),i=xu(E(),t),a=Tu(i.entry?.model)??Tu(i.defaults?.model),o=Du(i.entry?.model,i.defaults?.model),s=r.length>0?a?O(t):-1:(o?.length??0)>0||D(t)>=0?O(t):-1;if(s<0)return;let{basePath:c,existing:l}=k(s),u=(()=>{if(typeof l==`string`)return l.trim()||null;if(l&&typeof l==`object`&&!Array.isArray(l)){let e=l.primary;if(typeof e==`string`)return e.trim()||null}return null})()??a;if(r.length===0){u?xr(e,c,u):Cr(e,c);return}u&&xr(e,c,{primary:u,fallbacks:r})},onSetDefault:t=>{v&&xr(e,[`agents`,`defaultId`],t)}})):g}
6225
+ ${e.tab===`skills`?cI($F,t=>t.renderSkills({connected:e.connected,loading:e.skillsLoading,report:e.skillsReport,error:e.skillsError,filter:e.skillsFilter,statusFilter:e.skillsStatusFilter,edits:e.skillEdits,messages:e.skillMessages,busyKey:e.skillsBusyKey,detailKey:e.skillsDetailKey,clawhubQuery:e.clawhubSearchQuery,clawhubResults:e.clawhubSearchResults,clawhubSearchLoading:e.clawhubSearchLoading,clawhubSearchError:e.clawhubSearchError,clawhubDetail:e.clawhubDetail,clawhubDetailSlug:e.clawhubDetailSlug,clawhubDetailLoading:e.clawhubDetailLoading,clawhubDetailError:e.clawhubDetailError,clawhubInstallSlug:e.clawhubInstallSlug,clawhubInstallMessage:e.clawhubInstallMessage,onFilterChange:t=>e.skillsFilter=t,onStatusFilterChange:t=>e.skillsStatusFilter=t,onRefresh:()=>Ym(e,{clearMessages:!0}),onToggle:(t,n)=>Qm(e,t,n),onEdit:(t,n)=>Xm(e,t,n),onSaveKey:t=>$m(e,t),onInstall:(t,n,r)=>eh(e,t,n,r),onDetailOpen:t=>e.skillsDetailKey=t,onDetailClose:()=>e.skillsDetailKey=null,onClawHubQueryChange:t=>{Jm(e,t),iI&&clearTimeout(iI),iI=setTimeout(()=>th(e,t),300)},onClawHubDetailOpen:t=>nh(e,t),onClawHubDetailClose:()=>rh(e),onClawHubInstall:t=>ih(e,t)})):g}
6226
+ ${e.tab===`mcp`?cI(qF,t=>t.renderMcp({connected:e.connected,loading:e.mcpServersLoading,servers:e.mcpServers,path:e.mcpServersPath,error:e.mcpServersError,busy:e.mcpBusy,message:e.mcpMessage,addMode:e.mcpAddMode,linkUrl:e.mcpLinkUrl,linkLoading:e.mcpLinkMetadataLoading,linkError:e.mcpLinkMetadataError,linkMetadata:e.mcpLinkMetadata,draftName:e.mcpDraftName,draftConfig:e.mcpDraftConfig,authToken:e.mcpAuthToken,presetId:e.mcpPresetId,oauthStatus:e.mcpOAuthStatus,oauthFlow:e.mcpOAuthFlow,testStatus:e.mcpTestStatus,onAddModeChange:t=>e.mcpAddMode=t,onLinkUrlChange:t=>e.mcpLinkUrl=t,onLinkFetch:()=>void Sm(e,e.mcpLinkUrl),onLinkClear:()=>{e.mcpLinkMetadata=null,e.mcpLinkMetadataError=null},onRefresh:()=>{ym(e),wm(e)},onDraftNameChange:t=>{e.mcpDraftName=t},onDraftConfigChange:t=>{e.mcpDraftConfig=t},onAuthTokenChange:t=>{e.mcpAuthToken=t},onPresetSelect:t=>{e.mcpPresetId=t.id,e.mcpDraftName=t.name,e.mcpAuthToken=``,e.mcpMessage=null},onPresetSave:t=>{let n=e.mcpDraftName.trim()||t.name,r=iF(t,e.mcpAuthToken);e.mcpDraftName=n,bm(e,n,r).then(()=>{e.mcpMessage?.kind===`success`&&(e.mcpPresetId=null,wm(e))})},onEdit:t=>{e.mcpAddMode=`json`,e.mcpDraftName=t;let n=e.mcpServers?.[t];e.mcpDraftConfig=n?JSON.stringify(n,null,2):``,e.mcpMessage=null},onSave:()=>{let t=e.mcpDraftConfig.trim(),n;try{n=t?JSON.parse(t):{}}catch(t){e.mcpMessage={kind:`error`,text:`Invalid JSON: ${t instanceof Error?t.message:String(t)}`};return}if(typeof n!=`object`||!n||Array.isArray(n)){e.mcpMessage={kind:`error`,text:`Config must be a JSON object.`};return}bm(e,e.mcpDraftName,n)},onSaveMetadata:t=>{let n=e.mcpDraftName.trim()||t.name,r={url:t.url,transport:t.transport};t.oauth&&t.oauthIssuer?r.auth={type:`oauth`,issuer:t.oauthIssuer}:t.oauth?r.auth={type:`oauth`}:r=rF(r,e.mcpAuthToken),e.mcpDraftName=n,e.mcpDraftConfig=JSON.stringify(r,null,2),bm(e,n,r).then(()=>{e.mcpMessage?.kind===`success`&&(e.mcpLinkMetadata=null,e.mcpLinkUrl=``,wm(e))})},onDelete:t=>{confirm(`Remove MCP server "${t}"?`)&&xm(e,t)},onTest:t=>{Cm(e,t)},onOAuthConnect:t=>{tI(e,t)},onOAuthDisconnect:t=>{Dm(e,t)},onOAuthCancel:()=>{Om(e)}})):g}
6227
+ ${e.tab===`plugins`?cI(ZF,t=>t.renderPlugins({connected:e.connected,loading:e.pluginsLoading,report:e.pluginsReport,error:e.pluginsError,filter:e.pluginsFilter,statusFilter:e.pluginsStatusFilter,busyKey:e.pluginsBusyKey,messages:e.pluginMessages,detailKey:e.pluginDetailKey,clawhubQuery:e.pluginClawhubSearchQuery,clawhubResults:e.pluginClawhubSearchResults,clawhubSearchLoading:e.pluginClawhubSearchLoading,clawhubSearchError:e.pluginClawhubSearchError,clawhubDetail:e.pluginClawhubDetail,clawhubDetailName:e.pluginClawhubDetailName,clawhubDetailLoading:e.pluginClawhubDetailLoading,clawhubDetailError:e.pluginClawhubDetailError,clawhubInstallName:e.pluginClawhubInstallName,clawhubInstallMessage:e.pluginClawhubInstallMessage,onFilterChange:t=>e.pluginsFilter=t,onStatusFilterChange:t=>e.pluginsStatusFilter=t,onRefresh:()=>Fm(e,{clearMessages:!0}),onToggle:(t,n)=>Lm(e,t,n),onUninstall:t=>Rm(e,t),onDetailOpen:t=>e.pluginDetailKey=t,onDetailClose:()=>e.pluginDetailKey=null,onClawHubQueryChange:t=>{zm(e,t),aI&&clearTimeout(aI),aI=setTimeout(()=>Bm(e,t),300)},onClawHubDetailOpen:t=>Vm(e,t),onClawHubDetailClose:()=>Hm(e),onClawHubInstall:t=>Um(e,t)})):g}
6228
+ ${e.tab===`models`?(FF(e),cI(JF,t=>t.renderModels({connected:e.connected,loading:e.modelsLoading,models:e.chatModelCatalog,panel:e.modelsPanel,error:null,onPanelChange:t=>{e.modelsPanel=t},onRefresh:()=>{e.chatModelCatalog=[],FF(e)}}))):g}
6229
+ ${e.tab===`memory`?(IF(e),cI(YF,t=>t.renderMemory({connected:e.connected,loading:e.memoryLoading,agentId:e.agentsSelectedId??e.assistantAgentId,entries:e.memoryEntries,error:e.memoryError,onRefresh:()=>{e.memoryEntries=[],IF(e)}}))):g}
6230
+ ${e.tab===`nodes`?cI(XF,t=>t.renderNodes({loading:e.nodesLoading,nodes:e.nodes,nodeManagementSelectedId:e.nodeManagementSelectedId,nodeManagementRename:e.nodeManagementRename,nodeManagementCommand:e.nodeManagementCommand,nodeManagementParams:e.nodeManagementParams,nodeManagementShell:e.nodeManagementShell,nodeManagementCwd:e.nodeManagementCwd,nodeManagementTimeoutMs:e.nodeManagementTimeoutMs,nodeManagementBusy:e.nodeManagementBusy,nodeManagementError:e.nodeManagementError,nodeManagementResult:e.nodeManagementResult,devicesLoading:e.devicesLoading,devicesError:e.devicesError,devicesList:e.devicesList,configForm:e.configForm??e.configSnapshot?.config,configLoading:e.configLoading,configSaving:e.configSaving,configDirty:e.configFormDirty,configFormMode:e.configFormMode,execApprovalsLoading:e.execApprovalsLoading,execApprovalsSaving:e.execApprovalsSaving,execApprovalsDirty:e.execApprovalsDirty,execApprovalsSnapshot:e.execApprovalsSnapshot,execApprovalsForm:e.execApprovalsForm,execApprovalsSelectedAgent:e.execApprovalsSelectedAgent,execApprovalsTarget:e.execApprovalsTarget,execApprovalsTargetNodeId:e.execApprovalsTargetNodeId,onRefresh:()=>Zd(e),onNodeManagementSelect:t=>Qd(e,t),onNodeManagementRenameChange:t=>{e.nodeManagementRename=t},onNodeManagementCommandChange:t=>$d(e,t),onNodeManagementParamsChange:t=>{e.nodeManagementParams=t},onNodeManagementShellChange:t=>{e.nodeManagementShell=t},onNodeManagementCwdChange:t=>{e.nodeManagementCwd=t},onNodeManagementTimeoutChange:t=>{e.nodeManagementTimeoutMs=t},onNodeManagementRename:()=>ef(e),onNodeManagementInvoke:()=>tf(e),onNodeManagementRunShell:()=>nf(e),onNodeManagementPreset:t=>rf(e,t),onDevicesRefresh:()=>sp(e),onDeviceApprove:t=>cp(e,t),onDeviceReject:t=>lp(e,t),onDeviceRotate:(t,n,r)=>up(e,{deviceId:t,role:n,scopes:r}),onDeviceRevoke:(t,n)=>dp(e,{deviceId:t,role:n}),onLoadConfig:()=>Qn(e),onLoadExecApprovals:()=>pm(e,e.execApprovalsTarget===`node`&&e.execApprovalsTargetNodeId?{kind:`node`,nodeId:e.execApprovalsTargetNodeId}:{kind:`gateway`}),onBindDefault:t=>{t?xr(e,[`tools`,`exec`,`node`],t):Cr(e,[`tools`,`exec`,`node`])},onBindAgent:(t,n)=>{let r=[`agents`,`list`,t,`tools`,`exec`,`node`];n?xr(e,r,n):Cr(e,r)},onSaveBindings:()=>pr(e),onExecApprovalsTargetChange:(t,n)=>{e.execApprovalsTarget=t,e.execApprovalsTargetNodeId=n,e.execApprovalsSnapshot=null,e.execApprovalsForm=null,e.execApprovalsDirty=!1,e.execApprovalsSelectedAgent=null},onExecApprovalsSelectAgent:t=>{e.execApprovalsSelectedAgent=t},onExecApprovalsPatch:(t,n)=>gm(e,t,n),onExecApprovalsRemove:t=>_m(e,t),onSaveExecApprovals:()=>hm(e,e.execApprovalsTarget===`node`&&e.execApprovalsTargetNodeId?{kind:`node`,nodeId:e.execApprovalsTargetNodeId}:{kind:`gateway`})})):g}
6222
6231
  ${e.tab===`chat`?iO({sessionKey:e.sessionKey,onSessionKeyChange:t=>{Mj(e,t)},thinkingLevel:e.chatThinkingLevel,showThinking:f,showToolCalls:m,loading:e.chatLoading,sending:e.chatSending,compactionStatus:e.compactionStatus,fallbackStatus:e.fallbackStatus,assistantAvatarUrl:_,messages:e.chatMessages,sideResult:e.chatSideResult,toolMessages:e.chatToolMessages,streamSegments:e.chatStreamSegments,stream:e.chatStream,streamStartedAt:e.chatStreamStartedAt,draft:e.chatMessage,queue:e.chatQueue,realtimeTalkActive:e.realtimeTalkActive,realtimeTalkStatus:e.realtimeTalkStatus,realtimeTalkDetail:e.realtimeTalkDetail,realtimeTalkTranscript:e.realtimeTalkTranscript,connected:e.connected,canSend:e.connected,disabledReason:s,error:e.lastError,sessions:e.sessionsResult,focusMode:l,onRefresh:()=>(e.chatSideResult=null,e.resetToolStream(),ad(e,{scheduleScroll:!1})),onToggleFocusMode:()=>{e.onboarding||e.applySettings({...e.settings,chatFocusMode:!e.settings.chatFocusMode})},onChatScroll:t=>e.handleChatScroll(t),getDraft:()=>e.chatMessage,onDraftChange:t=>e.chatMessage=t,onRequestUpdate:n,attachments:e.chatAttachments,onAttachmentsChange:t=>e.chatAttachments=t,onSend:()=>e.handleSendChat(),onCompact:()=>e.handleSendChat(`/compact`,{restoreDraft:!0}),onToggleRealtimeTalk:()=>e.toggleRealtimeTalk(),canAbort:!!e.chatRunId,onAbort:()=>void e.handleAbortChat(),onQueueRemove:t=>e.removeQueuedMessage(t),onQueueSteer:t=>void e.steerQueuedChatMessage(t),onDismissSideResult:()=>{e.chatSideResult=null},onNewSession:()=>e.handleSendChat(`/new`,{restoreDraft:!0}),onClearHistory:async()=>{if(!(!e.client||!e.connected))try{await e.client.request(`sessions.reset`,{key:e.sessionKey}),e.chatMessages=[],e.chatSideResult=null,e.chatStream=null,e.chatRunId=null,await ol(e)}catch(t){e.lastError=String(t)}},agentsList:e.agentsList,currentAgentId:T??`main`,onAgentChange:t=>{Mj(e,fa({agentId:t}))},onNavigateToAgent:()=>{e.agentsSelectedId=T,e.setTab(`agents`)},onSessionSelect:t=>{Mj(e,t)},showNewMessages:e.chatNewMessagesBelow&&!e.chatManualRefreshInFlight,onScrollToBottom:()=>e.scrollToBottom(),sidebarOpen:e.sidebarOpen,sidebarContent:e.sidebarContent,sidebarError:e.sidebarError,splitRatio:e.splitRatio,canvasHostUrl:e.hello?.canvasHostUrl??null,onOpenSidebar:t=>e.handleOpenSidebar(t),onCloseSidebar:()=>e.handleCloseSidebar(),onSplitRatioChange:t=>e.handleSplitRatioChange(t),assistantName:e.assistantName,assistantAvatar:e.assistantAvatar,userName:e.userName??null,userAvatar:e.userAvatar??null,localMediaPreviewRoots:e.localMediaPreviewRoots,embedSandboxMode:e.embedSandboxMode,allowExternalEmbedUrls:e.allowExternalEmbedUrls,assistantAttachmentAuthToken:wj(e),basePath:e.basePath??``}):g}
6223
6232
  ${me()}
6224
- ${e.tab===`debug`?tI(zF,t=>t.renderDebug({loading:e.debugLoading,status:e.debugStatus,health:e.debugHealth,models:e.debugModels,heartbeat:e.debugHeartbeat,eventLog:e.eventLog,methods:Xa(e.hello?.features?.methods??[]),callMethod:e.debugCallMethod,callParams:e.debugCallParams,callResult:e.debugCallResult,callError:e.debugCallError,onCallMethodChange:t=>e.debugCallMethod=t,onCallParamsChange:t=>e.debugCallParams=t,onRefresh:()=>Ad(e),onCall:()=>jd(e)})):g}
6225
- ${e.tab===`logs`?tI(VF,t=>t.renderLogs({loading:e.logsLoading,error:e.logsError,file:e.logsFile,entries:e.logsEntries,filterText:e.logsFilterText,levelFilters:e.logsLevelFilters,autoFollow:e.logsAutoFollow,truncated:e.logsTruncated,onFilterTextChange:t=>e.logsFilterText=t,onLevelToggle:(t,n)=>{e.logsLevelFilters={...e.logsLevelFilters,[t]:n}},onToggleAutoFollow:t=>e.logsAutoFollow=t,onRefresh:()=>Ld(e,{reset:!0}),onExport:(t,n)=>e.exportLogs(t,n),onScroll:t=>e.handleLogsScroll(t)})):g}
6226
- ${e.tab===`dreams`?hP({active:b,shortTermCount:e.dreamingStatus?.shortTermCount??0,groundedSignalCount:e.dreamingStatus?.groundedSignalCount??0,totalSignalCount:e.dreamingStatus?.totalSignalCount??0,promotedCount:e.dreamingStatus?.promotedToday??0,phases:e.dreamingStatus?.phases??void 0,shortTermEntries:e.dreamingStatus?.shortTermEntries??[],promotedEntries:e.dreamingStatus?.promotedEntries??[],dreamingOf:null,nextCycle:x,timezone:e.dreamingStatus?.timezone??null,statusLoading:e.dreamingStatusLoading,statusError:e.dreamingStatusError,modeSaving:e.dreamingModeSaving,dreamDiaryLoading:e.dreamDiaryLoading,dreamDiaryActionLoading:e.dreamDiaryActionLoading,dreamDiaryActionMessage:e.dreamDiaryActionMessage,dreamDiaryActionArchivePath:e.dreamDiaryActionArchivePath,dreamDiaryError:e.dreamDiaryError,dreamDiaryPath:e.dreamDiaryPath,dreamDiaryContent:e.dreamDiaryContent,memoryWikiEnabled:vp(e.configSnapshot,`memory-wiki`,{enabledByDefault:!1}),wikiImportInsightsLoading:e.wikiImportInsightsLoading,wikiImportInsightsError:e.wikiImportInsightsError,wikiImportInsights:e.wikiImportInsights,wikiMemoryPalaceLoading:e.wikiMemoryPalaceLoading,wikiMemoryPalaceError:e.wikiMemoryPalaceError,wikiMemoryPalace:e.wikiMemoryPalace,onRefresh:C,onRefreshDiary:()=>qp(e),onRefreshImports:()=>{(async()=>{await Qn(e),await Jp(e)})()},onRefreshMemoryPalace:()=>{(async()=>{await Qn(e),await Yp(e)})()},onOpenConfig:()=>Er(e),onOpenWikiPage:e=>te(e),onBackfillDiary:()=>Zp(e),onCopyDreamingArchivePath:()=>{tm(e)},onDedupeDreamDiary:()=>nm(e),onResetDiary:()=>Qp(e),onResetGroundedShortTerm:()=>$p(e),onRepairDreamingArtifacts:()=>em(e),onRequestUpdate:n}):g}
6233
+ ${e.tab===`debug`?cI(WF,t=>t.renderDebug({loading:e.debugLoading,status:e.debugStatus,health:e.debugHealth,models:e.debugModels,heartbeat:e.debugHeartbeat,eventLog:e.eventLog,methods:Xa(e.hello?.features?.methods??[]),callMethod:e.debugCallMethod,callParams:e.debugCallParams,callResult:e.debugCallResult,callError:e.debugCallError,onCallMethodChange:t=>e.debugCallMethod=t,onCallParamsChange:t=>e.debugCallParams=t,onRefresh:()=>Ad(e),onCall:()=>jd(e)})):g}
6234
+ ${e.tab===`logs`?cI(KF,t=>t.renderLogs({loading:e.logsLoading,error:e.logsError,file:e.logsFile,entries:e.logsEntries,filterText:e.logsFilterText,levelFilters:e.logsLevelFilters,autoFollow:e.logsAutoFollow,truncated:e.logsTruncated,onFilterTextChange:t=>e.logsFilterText=t,onLevelToggle:(t,n)=>{e.logsLevelFilters={...e.logsLevelFilters,[t]:n}},onToggleAutoFollow:t=>e.logsAutoFollow=t,onRefresh:()=>Ld(e,{reset:!0}),onExport:(t,n)=>e.exportLogs(t,n),onScroll:t=>e.handleLogsScroll(t)})):g}
6235
+ ${e.tab===`dreams`?vP({active:b,shortTermCount:e.dreamingStatus?.shortTermCount??0,groundedSignalCount:e.dreamingStatus?.groundedSignalCount??0,totalSignalCount:e.dreamingStatus?.totalSignalCount??0,promotedCount:e.dreamingStatus?.promotedToday??0,phases:e.dreamingStatus?.phases??void 0,shortTermEntries:e.dreamingStatus?.shortTermEntries??[],promotedEntries:e.dreamingStatus?.promotedEntries??[],dreamingOf:null,nextCycle:x,timezone:e.dreamingStatus?.timezone??null,statusLoading:e.dreamingStatusLoading,statusError:e.dreamingStatusError,modeSaving:e.dreamingModeSaving,dreamDiaryLoading:e.dreamDiaryLoading,dreamDiaryActionLoading:e.dreamDiaryActionLoading,dreamDiaryActionMessage:e.dreamDiaryActionMessage,dreamDiaryActionArchivePath:e.dreamDiaryActionArchivePath,dreamDiaryError:e.dreamDiaryError,dreamDiaryPath:e.dreamDiaryPath,dreamDiaryContent:e.dreamDiaryContent,memoryWikiEnabled:vp(e.configSnapshot,`memory-wiki`,{enabledByDefault:!1}),wikiImportInsightsLoading:e.wikiImportInsightsLoading,wikiImportInsightsError:e.wikiImportInsightsError,wikiImportInsights:e.wikiImportInsights,wikiMemoryPalaceLoading:e.wikiMemoryPalaceLoading,wikiMemoryPalaceError:e.wikiMemoryPalaceError,wikiMemoryPalace:e.wikiMemoryPalace,onRefresh:C,onRefreshDiary:()=>qp(e),onRefreshImports:()=>{(async()=>{await Qn(e),await Jp(e)})()},onRefreshMemoryPalace:()=>{(async()=>{await Qn(e),await Yp(e)})()},onOpenConfig:()=>Er(e),onOpenWikiPage:e=>te(e),onBackfillDiary:()=>Zp(e),onCopyDreamingArchivePath:()=>{tm(e)},onDedupeDreamDiary:()=>nm(e),onResetDiary:()=>Qp(e),onResetGroundedShortTerm:()=>$p(e),onRepairDreamingArtifacts:()=>em(e),onRequestUpdate:n}):g}
6227
6236
  </main>
6228
- ${JP(e)} ${YP(e)} ${g}
6237
+ ${ZP(e)} ${QP(e)} ${g}
6229
6238
  </div>
6230
- `}var jI=`genesis:canvas:agent-run-request`,MI=`/__genesis__/canvas`,NI=`/__genesis__/cap`;function PI(e){return!!(e&&typeof e==`object`&&!Array.isArray(e))}function FI(e){if(!PI(e)||e.type!==jI)return null;let t=typeof e.message==`string`?e.message.trim():``;return t?{message:t,...`context`in e?{context:e.context}:{}}:null}function II(e){if(e===MI||e.startsWith(`${MI}/`))return!0;if(!e.startsWith(`${NI}/`))return!1;let t=`${MI}/`;return e.includes(t)||e.endsWith(MI)}function LI(e,t=document){return e?Array.from(t.querySelectorAll(`iframe`)).some(t=>{if(t.contentWindow!==e)return!1;let n=t.getAttribute(`src`)?.trim();if(!n)return!1;try{return II(new URL(n,window.location.href).pathname)}catch{return!1}}):!1}async function RI(e,t,n){let r=FI(t.data);return!r||!LI(t.source,n?.root??document)?!1:!e.connected||!e.client?(e.lastError=`Gateway not connected`,!0):((n?.confirm??window.confirm.bind(window))(`Canvas wants to send this to Genesis:\n\n${r.message}\n\nSend it now?`)&&await e.handleSendChat(r.message),!0)}var zI=`genesis_agent_consult`;function BI(e){let t=HI(e,`question`);if(!t)throw Error(`question required`);return{question:t,context:HI(e,`context`),responseStyle:HI(e,`responseStyle`)}}function VI(e){let t=BI(e);return[t.question,t.context?`Context:\n${t.context}`:void 0,t.responseStyle?`Spoken style:\n${t.responseStyle}`:void 0].filter(Boolean).join(`
6239
+ `}var RI=`genesis:canvas:agent-run-request`,zI=`/__genesis__/canvas`,BI=`/__genesis__/cap`;function VI(e){return!!(e&&typeof e==`object`&&!Array.isArray(e))}function HI(e){if(!VI(e)||e.type!==RI)return null;let t=typeof e.message==`string`?e.message.trim():``;return t?{message:t,...`context`in e?{context:e.context}:{}}:null}function UI(e){if(e===zI||e.startsWith(`${zI}/`))return!0;if(!e.startsWith(`${BI}/`))return!1;let t=`${zI}/`;return e.includes(t)||e.endsWith(zI)}function WI(e,t=document){return e?Array.from(t.querySelectorAll(`iframe`)).some(t=>{if(t.contentWindow!==e)return!1;let n=t.getAttribute(`src`)?.trim();if(!n)return!1;try{return UI(new URL(n,window.location.href).pathname)}catch{return!1}}):!1}async function GI(e,t,n){let r=HI(t.data);return!r||!WI(t.source,n?.root??document)?!1:!e.connected||!e.client?(e.lastError=`Gateway not connected`,!0):((n?.confirm??window.confirm.bind(window))(`Canvas wants to send this to Genesis:\n\n${r.message}\n\nSend it now?`)&&await e.handleSendChat(r.message),!0)}var KI=`genesis_agent_consult`;function qI(e){let t=YI(e,`question`);if(!t)throw Error(`question required`);return{question:t,context:YI(e,`context`),responseStyle:YI(e,`responseStyle`)}}function JI(e){let t=qI(e);return[t.question,t.context?`Context:\n${t.context}`:void 0,t.responseStyle?`Spoken style:\n${t.responseStyle}`:void 0].filter(Boolean).join(`
6231
6240
 
6232
- `)}function HI(e,t){if(!(!e||typeof e!=`object`||Array.isArray(e)))return v(e[t])}function UI(e){if(!e||typeof e!=`object`)return``;let t=e;return typeof t.text==`string`?t.text:(Array.isArray(t.content)?t.content:[]).map(e=>{if(!e||typeof e!=`object`)return``;let t=e;return t.type===`text`&&typeof t.text==`string`?t.text:``}).filter(Boolean).join(`
6241
+ `)}function YI(e,t){if(!(!e||typeof e!=`object`||Array.isArray(e)))return v(e[t])}function XI(e){if(!e||typeof e!=`object`)return``;let t=e;return typeof t.text==`string`?t.text:(Array.isArray(t.content)?t.content:[]).map(e=>{if(!e||typeof e!=`object`)return``;let t=e;return t.type===`text`&&typeof t.text==`string`?t.text:``}).filter(Boolean).join(`
6233
6242
 
6234
- `).trim()}function WI(e){return new Promise((t,n)=>{let r=window.setTimeout(()=>{i(),n(Error(`Genesis tool call timed out`))},e.timeoutMs),i=e.client.addEventListener(a=>{if(a.event!==`chat`)return;let o=a.payload;!o||o.runId!==e.runId||(o.state===`final`?(window.clearTimeout(r),i(),t(UI(o.message)||`Genesis finished with no text.`)):o.state===`error`&&(window.clearTimeout(r),i(),n(Error(o.errorMessage??`Genesis tool call failed`))))})})}var GI=class{constructor(e,t,n={}){this.client=e,this.sessionKey=t,this.callbacks=n,this.peer=null,this.channel=null,this.media=null,this.audio=null,this.closed=!1,this.toolBuffers=new Map}async start(){if(!navigator.mediaDevices?.getUserMedia||typeof RTCPeerConnection>`u`)throw Error(`Realtime Talk requires browser WebRTC and microphone access`);this.closed=!1,this.callbacks.onStatus?.(`connecting`);let e=await this.client.request(`talk.realtime.session`,{sessionKey:this.sessionKey});this.peer=new RTCPeerConnection,this.audio=document.createElement(`audio`),this.audio.autoplay=!0,this.audio.style.display=`none`,document.body.append(this.audio),this.peer.addEventListener(`track`,e=>{this.audio&&(this.audio.srcObject=e.streams[0])}),this.media=await navigator.mediaDevices.getUserMedia({audio:!0});for(let e of this.media.getAudioTracks())this.peer.addTrack(e,this.media);this.channel=this.peer.createDataChannel(`oai-events`),this.channel.addEventListener(`open`,()=>this.callbacks.onStatus?.(`listening`)),this.channel.addEventListener(`message`,e=>this.handleRealtimeEvent(e.data)),this.peer.addEventListener(`connectionstatechange`,()=>{this.closed||(this.peer?.connectionState===`failed`||this.peer?.connectionState===`closed`)&&this.callbacks.onStatus?.(`error`,`Realtime connection closed`)});let t=await this.peer.createOffer();await this.peer.setLocalDescription(t);let n=await fetch(`https://api.openai.com/v1/realtime/calls`,{method:`POST`,body:t.sdp,headers:{Authorization:`Bearer ${e.clientSecret}`,"Content-Type":`application/sdp`}});if(!n.ok)throw Error(`Realtime WebRTC setup failed (${n.status})`);await this.peer.setRemoteDescription({type:`answer`,sdp:await n.text()})}stop(){this.closed=!0,this.callbacks.onStatus?.(`idle`),this.channel?.close(),this.channel=null,this.peer?.close(),this.peer=null,this.media?.getTracks().forEach(e=>e.stop()),this.media=null,this.audio?.remove(),this.audio=null,this.toolBuffers.clear()}send(e){this.channel?.readyState===`open`&&this.channel.send(JSON.stringify(e))}handleRealtimeEvent(e){let t;try{t=JSON.parse(String(e))}catch{return}switch(t.type){case`conversation.item.input_audio_transcription.completed`:t.transcript&&this.callbacks.onTranscript?.({role:`user`,text:t.transcript,final:!0});return;case`response.audio_transcript.done`:t.transcript&&this.callbacks.onTranscript?.({role:`assistant`,text:t.transcript,final:!0});return;case`response.function_call_arguments.delta`:this.bufferToolDelta(t);return;case`response.function_call_arguments.done`:this.handleToolCall(t);return;default:return}}bufferToolDelta(e){let t=e.item_id??`unknown`,n=this.toolBuffers.get(t);if(n){n.args+=e.delta??``;return}this.toolBuffers.set(t,{name:e.name??``,callId:e.call_id??``,args:e.delta??``})}async handleToolCall(e){let t=e.item_id??`unknown`,n=this.toolBuffers.get(t);this.toolBuffers.delete(t);let r=n?.name||e.name||``,i=n?.callId||e.call_id||``;if(r!==`genesis_agent_consult`||!i)return;this.callbacks.onStatus?.(`thinking`);let a=``;try{a=VI(JSON.parse(n?.args||e.arguments||`{}`))}catch{}if(!a){this.submitToolResult(i,{error:`${zI} requires a question`}),this.callbacks.onStatus?.(`listening`);return}try{let e=sn(),t=await this.client.request(`chat.send`,{sessionKey:this.sessionKey,message:a,idempotencyKey:e}),n=await WI({client:this.client,runId:t.runId??e,timeoutMs:12e4});this.submitToolResult(i,{result:n})}catch(e){this.submitToolResult(i,{error:e instanceof Error?e.message:String(e)})}finally{this.callbacks.onStatus?.(`listening`)}}submitToolResult(e,t){this.send({type:`conversation.item.create`,item:{type:`function_call_output`,call_id:e,output:JSON.stringify(t)}}),this.send({type:`response.create`})}};function KI(e){if(e.dataSource!==`genesis-mcp-oauth`)return!1;if(e.expectedOrigin!==``&&e.origin===e.expectedOrigin)return!0;let t=e.origin===``||e.origin===`null`,n=e.popup!=null&&e.source===e.popup;return t&&n}var qI=Zy({}),JI=fg();function YI(){if(!window.location.search)return!1;let e=new URLSearchParams(window.location.search).get(`onboarding`);if(!e)return!1;let t=e.trim().toLowerCase();return t===`1`||t===`true`||t===`yes`||t===`on`}var $=class extends c{constructor(){super(),this.i18nController=new h(this),this.clientInstanceId=sn(),this.connectGeneration=0,this.settings=ug(),this.password=``,this.loginShowGatewayToken=!1,this.loginShowGatewayPassword=!1,this.tab=`chat`,this.onboarding=YI(),this.connected=!1,this.theme=this.settings.theme??`mono`,this.themeMode=this.settings.themeMode??`system`,this.themeResolved=`dark`,this.themeOrder=this.buildThemeOrder(this.theme),this.hello=null,this.lastError=null,this.lastErrorCode=null,this.eventLog=[],this.eventLogBuffer=[],this.toolStreamSyncTimer=null,this.sidebarCloseTimer=null,this.assistantName=qI.name,this.assistantAvatar=qI.avatar,this.assistantAgentId=qI.agentId??null,this.userName=JI.name,this.userAvatar=JI.avatar,this.localMediaPreviewRoots=[],this.embedSandboxMode=`scripts`,this.allowExternalEmbedUrls=!1,this.serverVersion=null,this.sessionKey=this.settings.sessionKey,this.chatLoading=!1,this.chatSending=!1,this.chatMessage=``,this.chatMessages=[],this.chatToolMessages=[],this.chatStreamSegments=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.chatSideResult=null,this.compactionStatus=null,this.fallbackStatus=null,this.chatAvatarUrl=null,this.chatThinkingLevel=null,this.chatModelOverrides={},this.chatModelsLoading=!1,this.chatModelCatalog=[],this.chatQueue=[],this.chatAttachments=[],this.realtimeTalkActive=!1,this.realtimeTalkStatus=`idle`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null,this.realtimeTalkSession=null,this.chatManualRefreshInFlight=!1,this.navDrawerOpen=!1,this.sidebarOpen=!1,this.sidebarContent=null,this.sidebarError=null,this.splitRatio=this.settings.splitRatio,this.nodesLoading=!1,this.nodes=[],this.nodeManagementSelectedId=null,this.nodeManagementRename=``,this.nodeManagementCommand=``,this.nodeManagementParams=`{
6243
+ `).trim()}function ZI(e){return new Promise((t,n)=>{let r=window.setTimeout(()=>{i(),n(Error(`Genesis tool call timed out`))},e.timeoutMs),i=e.client.addEventListener(a=>{if(a.event!==`chat`)return;let o=a.payload;!o||o.runId!==e.runId||(o.state===`final`?(window.clearTimeout(r),i(),t(XI(o.message)||`Genesis finished with no text.`)):o.state===`error`&&(window.clearTimeout(r),i(),n(Error(o.errorMessage??`Genesis tool call failed`))))})})}var QI=class{constructor(e,t,n={}){this.client=e,this.sessionKey=t,this.callbacks=n,this.peer=null,this.channel=null,this.media=null,this.audio=null,this.closed=!1,this.toolBuffers=new Map}async start(){if(!navigator.mediaDevices?.getUserMedia||typeof RTCPeerConnection>`u`)throw Error(`Realtime Talk requires browser WebRTC and microphone access`);this.closed=!1,this.callbacks.onStatus?.(`connecting`);let e=await this.client.request(`talk.realtime.session`,{sessionKey:this.sessionKey});this.peer=new RTCPeerConnection,this.audio=document.createElement(`audio`),this.audio.autoplay=!0,this.audio.style.display=`none`,document.body.append(this.audio),this.peer.addEventListener(`track`,e=>{this.audio&&(this.audio.srcObject=e.streams[0])}),this.media=await navigator.mediaDevices.getUserMedia({audio:!0});for(let e of this.media.getAudioTracks())this.peer.addTrack(e,this.media);this.channel=this.peer.createDataChannel(`oai-events`),this.channel.addEventListener(`open`,()=>this.callbacks.onStatus?.(`listening`)),this.channel.addEventListener(`message`,e=>this.handleRealtimeEvent(e.data)),this.peer.addEventListener(`connectionstatechange`,()=>{this.closed||(this.peer?.connectionState===`failed`||this.peer?.connectionState===`closed`)&&this.callbacks.onStatus?.(`error`,`Realtime connection closed`)});let t=await this.peer.createOffer();await this.peer.setLocalDescription(t);let n=await fetch(`https://api.openai.com/v1/realtime/calls`,{method:`POST`,body:t.sdp,headers:{Authorization:`Bearer ${e.clientSecret}`,"Content-Type":`application/sdp`}});if(!n.ok)throw Error(`Realtime WebRTC setup failed (${n.status})`);await this.peer.setRemoteDescription({type:`answer`,sdp:await n.text()})}stop(){this.closed=!0,this.callbacks.onStatus?.(`idle`),this.channel?.close(),this.channel=null,this.peer?.close(),this.peer=null,this.media?.getTracks().forEach(e=>e.stop()),this.media=null,this.audio?.remove(),this.audio=null,this.toolBuffers.clear()}send(e){this.channel?.readyState===`open`&&this.channel.send(JSON.stringify(e))}handleRealtimeEvent(e){let t;try{t=JSON.parse(String(e))}catch{return}switch(t.type){case`conversation.item.input_audio_transcription.completed`:t.transcript&&this.callbacks.onTranscript?.({role:`user`,text:t.transcript,final:!0});return;case`response.audio_transcript.done`:t.transcript&&this.callbacks.onTranscript?.({role:`assistant`,text:t.transcript,final:!0});return;case`response.function_call_arguments.delta`:this.bufferToolDelta(t);return;case`response.function_call_arguments.done`:this.handleToolCall(t);return;default:return}}bufferToolDelta(e){let t=e.item_id??`unknown`,n=this.toolBuffers.get(t);if(n){n.args+=e.delta??``;return}this.toolBuffers.set(t,{name:e.name??``,callId:e.call_id??``,args:e.delta??``})}async handleToolCall(e){let t=e.item_id??`unknown`,n=this.toolBuffers.get(t);this.toolBuffers.delete(t);let r=n?.name||e.name||``,i=n?.callId||e.call_id||``;if(r!==`genesis_agent_consult`||!i)return;this.callbacks.onStatus?.(`thinking`);let a=``;try{a=JI(JSON.parse(n?.args||e.arguments||`{}`))}catch{}if(!a){this.submitToolResult(i,{error:`${KI} requires a question`}),this.callbacks.onStatus?.(`listening`);return}try{let e=sn(),t=await this.client.request(`chat.send`,{sessionKey:this.sessionKey,message:a,idempotencyKey:e}),n=await ZI({client:this.client,runId:t.runId??e,timeoutMs:12e4});this.submitToolResult(i,{result:n})}catch(e){this.submitToolResult(i,{error:e instanceof Error?e.message:String(e)})}finally{this.callbacks.onStatus?.(`listening`)}}submitToolResult(e,t){this.send({type:`conversation.item.create`,item:{type:`function_call_output`,call_id:e,output:JSON.stringify(t)}}),this.send({type:`response.create`})}};function $I(e){if(e.dataSource!==`genesis-mcp-oauth`)return!1;if(e.expectedOrigin!==``&&e.origin===e.expectedOrigin)return!0;let t=e.origin===``||e.origin===`null`,n=e.popup!=null&&e.source===e.popup;return t&&n}var eL=Zy({}),tL=fg();function nL(){if(!window.location.search)return!1;let e=new URLSearchParams(window.location.search).get(`onboarding`);if(!e)return!1;let t=e.trim().toLowerCase();return t===`1`||t===`true`||t===`yes`||t===`on`}var $=class extends c{constructor(){super(),this.i18nController=new h(this),this.clientInstanceId=sn(),this.connectGeneration=0,this.settings=ug(),this.password=``,this.loginShowGatewayToken=!1,this.loginShowGatewayPassword=!1,this.tab=`chat`,this.onboarding=nL(),this.connected=!1,this.theme=this.settings.theme??`mono`,this.themeMode=this.settings.themeMode??`system`,this.themeResolved=`dark`,this.themeOrder=this.buildThemeOrder(this.theme),this.hello=null,this.lastError=null,this.lastErrorCode=null,this.eventLog=[],this.eventLogBuffer=[],this.toolStreamSyncTimer=null,this.sidebarCloseTimer=null,this.assistantName=eL.name,this.assistantAvatar=eL.avatar,this.assistantAgentId=eL.agentId??null,this.userName=tL.name,this.userAvatar=tL.avatar,this.localMediaPreviewRoots=[],this.embedSandboxMode=`scripts`,this.allowExternalEmbedUrls=!1,this.serverVersion=null,this.sessionKey=this.settings.sessionKey,this.chatLoading=!1,this.chatSending=!1,this.chatMessage=``,this.chatMessages=[],this.chatToolMessages=[],this.chatStreamSegments=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.chatSideResult=null,this.compactionStatus=null,this.fallbackStatus=null,this.chatAvatarUrl=null,this.chatThinkingLevel=null,this.chatModelOverrides={},this.chatModelsLoading=!1,this.chatModelCatalog=[],this.modelsPanel=`catalog`,this.modelsLoading=!1,this.memoryEntries=[],this.memoryLoading=!1,this.memoryError=null,this.chatQueue=[],this.chatAttachments=[],this.realtimeTalkActive=!1,this.realtimeTalkStatus=`idle`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null,this.realtimeTalkSession=null,this.chatManualRefreshInFlight=!1,this.navDrawerOpen=!1,this.sidebarOpen=!1,this.sidebarContent=null,this.sidebarError=null,this.splitRatio=this.settings.splitRatio,this.nodesLoading=!1,this.nodes=[],this.nodeManagementSelectedId=null,this.nodeManagementRename=``,this.nodeManagementCommand=``,this.nodeManagementParams=`{
6235
6244
  }`,this.nodeManagementShell=`genesis --version`,this.nodeManagementCwd=``,this.nodeManagementTimeoutMs=`120000`,this.nodeManagementBusy=!1,this.nodeManagementError=null,this.nodeManagementResult=null,this.devicesLoading=!1,this.devicesError=null,this.devicesList=null,this.execApprovalsLoading=!1,this.execApprovalsSaving=!1,this.execApprovalsDirty=!1,this.execApprovalsSnapshot=null,this.execApprovalsForm=null,this.execApprovalsSelectedAgent=null,this.execApprovalsTarget=`gateway`,this.execApprovalsTargetNodeId=null,this.execApprovalQueue=[],this.execApprovalBusy=!1,this.execApprovalError=null,this.pendingGatewayUrl=null,this.pendingGatewayToken=null,this.configLoading=!1,this.configRaw=`{
6236
6245
  }
6237
- `,this.configRawOriginal=``,this.configValid=null,this.configIssues=[],this.configSaving=!1,this.configApplying=!1,this.updateRunning=!1,this.applySessionKey=this.settings.lastActiveSessionKey,this.configSnapshot=null,this.configSchema=null,this.configSchemaVersion=null,this.configSchemaLoading=!1,this.configUiHints={},this.configForm=null,this.configFormOriginal=null,this.configRestartPrompt=null,this.dreamingStatusLoading=!1,this.dreamingStatusError=null,this.dreamingStatus=null,this.dreamingModeSaving=!1,this.dreamDiaryLoading=!1,this.dreamDiaryActionLoading=!1,this.dreamDiaryActionMessage=null,this.dreamDiaryActionArchivePath=null,this.dreamDiaryError=null,this.dreamDiaryPath=null,this.dreamDiaryContent=null,this.wikiImportInsightsLoading=!1,this.wikiImportInsightsError=null,this.wikiImportInsights=null,this.wikiMemoryPalaceLoading=!1,this.wikiMemoryPalaceError=null,this.wikiMemoryPalace=null,this.configFormDirty=!1,this.configSettingsMode=`quick`,this.configFormMode=`form`,this.configSearchQuery=``,this.configActiveSection=null,this.configActiveSubsection=null,this.communicationsFormMode=`form`,this.communicationsSearchQuery=``,this.communicationsActiveSection=null,this.communicationsActiveSubsection=null,this.appearanceFormMode=`form`,this.appearanceSearchQuery=``,this.appearanceActiveSection=null,this.appearanceActiveSubsection=null,this.automationFormMode=`form`,this.automationSearchQuery=``,this.automationActiveSection=null,this.automationActiveSubsection=null,this.infrastructureFormMode=`form`,this.infrastructureSearchQuery=``,this.infrastructureActiveSection=null,this.infrastructureActiveSubsection=null,this.aiAgentsFormMode=`form`,this.aiAgentsSearchQuery=``,this.aiAgentsActiveSection=null,this.aiAgentsActiveSubsection=null,this.channelsLoading=!1,this.channelsSnapshot=null,this.channelsError=null,this.channelsLastSuccess=null,this.whatsappLoginMessage=null,this.whatsappLoginQrDataUrl=null,this.whatsappLoginConnected=null,this.whatsappBusy=!1,this.nostrProfileFormState=null,this.nostrProfileAccountId=null,this.channelWizardSessionId=null,this.channelWizardStep=null,this.channelWizardInput=null,this.channelWizardBusy=!1,this.channelWizardError=null,this.channelWizardMessage=null,this.modelProviderWizardSessionId=null,this.modelProviderWizardStep=null,this.modelProviderWizardInput=null,this.modelProviderWizardBusy=!1,this.modelProviderWizardError=null,this.modelProviderWizardMessage=null,this.presenceLoading=!1,this.presenceEntries=[],this.presenceError=null,this.presenceStatus=null,this.agentsLoading=!1,this.agentsList=null,this.agentsError=null,this.agentsSelectedId=null,this.toolsCatalogLoading=!1,this.toolsCatalogError=null,this.toolsCatalogResult=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveResult=null,this.agentsPanel=`files`,this.agentFilesLoading=!1,this.agentFilesError=null,this.agentFilesList=null,this.agentFileContents={},this.agentFileDrafts={},this.agentFileActive=null,this.agentFileSaving=!1,this.agentIdentityLoading=!1,this.agentIdentityError=null,this.agentIdentityById={},this.agentSkillsLoading=!1,this.agentSkillsError=null,this.agentSkillsReport=null,this.agentSkillsAgentId=null,this.mcpServersLoading=!1,this.mcpServers=null,this.mcpServersPath=null,this.mcpServersError=null,this.mcpBusy=!1,this.mcpMessage=null,this.mcpDraftName=``,this.mcpDraftConfig=``,this.mcpAddMode=`preset`,this.mcpAuthToken=``,this.mcpPresetId=null,this.mcpLinkUrl=``,this.mcpLinkMetadataLoading=!1,this.mcpLinkMetadataError=null,this.mcpLinkMetadata=null,this.mcpOAuthStatus={},this.mcpOAuthFlow=null,this.mcpOAuthPopup=null,this.mcpTestStatus={},this.sessionsLoading=!1,this.sessionsResult=null,this.sessionsError=null,this.sessionsFilterActive=``,this.sessionsFilterLimit=`120`,this.sessionsIncludeGlobal=!0,this.sessionsIncludeUnknown=!1,this.sessionsHideCron=!0,this.sessionsSearchQuery=``,this.sessionsSortColumn=`updated`,this.sessionsSortDir=`desc`,this.sessionsPage=0,this.sessionsPageSize=25,this.sessionsSelectedKeys=new Set,this.sessionsExpandedCheckpointKey=null,this.sessionsCheckpointItemsByKey={},this.sessionsCheckpointLoadingKey=null,this.sessionsCheckpointBusyKey=null,this.sessionsCheckpointErrorByKey={},this.usageLoading=!1,this.usageResult=null,this.usageCostSummary=null,this.usageError=null,this.usageStartDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.usageEndDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.usageSelectedSessions=[],this.usageSelectedDays=[],this.usageSelectedHours=[],this.usageChartMode=`tokens`,this.usageDailyChartMode=`by-type`,this.usageTimeSeriesMode=`per-turn`,this.usageTimeSeriesBreakdownMode=`by-type`,this.usageTimeSeries=null,this.usageTimeSeriesLoading=!1,this.usageTimeSeriesCursorStart=null,this.usageTimeSeriesCursorEnd=null,this.usageSessionLogs=null,this.usageSessionLogsLoading=!1,this.usageSessionLogsExpanded=!1,this.usageQuery=``,this.usageQueryDraft=``,this.usageSessionSort=`recent`,this.usageSessionSortDir=`desc`,this.usageRecentSessions=[],this.usageTimeZone=`local`,this.usageContextExpanded=!1,this.usageHeaderPinned=!1,this.usageSessionsTab=`all`,this.usageVisibleColumns=[`channel`,`agent`,`provider`,`model`,`messages`,`tools`,`errors`,`duration`],this.usageLogFilterRoles=[],this.usageLogFilterTools=[],this.usageLogFilterHasTools=!1,this.usageLogFilterQuery=``,this.usageQueryDebounceTimer=null,this.cronLoading=!1,this.cronQuickCreateOpen=!1,this.cronQuickCreateStep=`what`,this.cronQuickCreateDraft=null,this.cronJobsLoadingMore=!1,this.cronJobs=[],this.cronJobsTotal=0,this.cronJobsHasMore=!1,this.cronJobsNextOffset=null,this.cronJobsLimit=50,this.cronJobsQuery=``,this.cronJobsEnabledFilter=`all`,this.cronJobsScheduleKindFilter=`all`,this.cronJobsLastStatusFilter=`all`,this.cronJobsSortBy=`nextRunAtMs`,this.cronJobsSortDir=`asc`,this.cronStatus=null,this.cronError=null,this.cronForm={...xd},this.cronFieldErrors={},this.cronEditingJobId=null,this.cronRunsJobId=null,this.cronRunsLoadingMore=!1,this.cronRuns=[],this.cronRunsTotal=0,this.cronRunsHasMore=!1,this.cronRunsNextOffset=null,this.cronRunsLimit=50,this.cronRunsScope=`all`,this.cronRunsStatuses=[],this.cronRunsDeliveryStatuses=[],this.cronRunsStatusFilter=`all`,this.cronRunsQuery=``,this.cronRunsSortDir=`desc`,this.cronModelSuggestions=[],this.cronBusy=!1,this.updateAvailable=null,this.attentionItems=[],this.paletteOpen=!1,this.paletteQuery=``,this.paletteActiveIndex=0,this.overviewShowGatewayToken=!1,this.overviewShowGatewayPassword=!1,this.overviewLogLines=[],this.overviewLogCursor=0,this.walletSummary=null,this.walletSummaryError=null,this.walletSummaryLoading=!1,this.walletBalancesLoading=!1,this.walletLastUpdatedAt=null,this.walletRecoveryPhraseMode=`generate`,this.walletRecoveryPhraseBusy=!1,this.walletRecoveryPhraseError=null,this.walletRecoveryPhraseGeneratedMnemonic=null,this.walletRecoveryPhraseStatus=null,this.skillsLoading=!1,this.skillsReport=null,this.skillsError=null,this.skillsFilter=``,this.skillsStatusFilter=`all`,this.skillEdits={},this.skillsBusyKey=null,this.skillMessages={},this.skillsDetailKey=null,this.clawhubSearchQuery=``,this.clawhubSearchResults=null,this.clawhubSearchLoading=!1,this.clawhubSearchError=null,this.clawhubDetail=null,this.clawhubDetailSlug=null,this.clawhubDetailLoading=!1,this.clawhubDetailError=null,this.clawhubInstallSlug=null,this.clawhubInstallMessage=null,this.pluginsLoading=!1,this.pluginsReport=null,this.pluginsError=null,this.pluginsFilter=``,this.pluginsStatusFilter=`all`,this.pluginsBusyKey=null,this.pluginMessages={},this.pluginDetailKey=null,this.pluginClawhubSearchQuery=``,this.pluginClawhubSearchResults=null,this.pluginClawhubSearchLoading=!1,this.pluginClawhubSearchError=null,this.pluginClawhubDetail=null,this.pluginClawhubDetailName=null,this.pluginClawhubDetailLoading=!1,this.pluginClawhubDetailError=null,this.pluginClawhubInstallName=null,this.pluginClawhubInstallMessage=null,this.healthLoading=!1,this.healthResult=null,this.healthError=null,this.modelAuthStatusLoading=!1,this.modelAuthStatusResult=null,this.modelAuthStatusError=null,this.debugLoading=!1,this.debugStatus=null,this.debugHealth=null,this.debugModels=[],this.debugHeartbeat=null,this.debugCallMethod=``,this.debugCallParams=`{}`,this.debugCallResult=null,this.debugCallError=null,this.logsLoading=!1,this.logsError=null,this.logsFile=null,this.logsEntries=[],this.logsFilterText=``,this.logsLevelFilters={...bd},this.logsAutoFollow=!0,this.logsTruncated=!1,this.logsCursor=null,this.logsLastFetchAt=null,this.logsLimit=500,this.logsMaxBytes=25e4,this.logsAtBottom=!0,this.client=null,this.chatScrollFrame=null,this.chatScrollTimeout=null,this.chatHasAutoScrolled=!1,this.chatUserNearBottom=!0,this.chatNewMessagesBelow=!1,this.nodesPollInterval=null,this.logsPollInterval=null,this.debugPollInterval=null,this.logsScrollFrame=null,this.toolStreamById=new Map,this.toolStreamOrder=[],this.refreshSessionsAfterChat=new Set,this.chatSideResultTerminalRuns=new Set,this.basePath=``,this.popStateHandler=()=>wO(this),this.topbarObserver=null,this.globalKeydownHandler=e=>{(e.metaKey||e.ctrlKey)&&!e.shiftKey&&e.key===`k`&&(e.preventDefault(),this.paletteOpen=!this.paletteOpen,this.paletteOpen&&(this.paletteQuery=``,this.paletteActiveIndex=0))},this.canvasAgentRunMessageHandler=e=>{RI(this,e)},this.mcpOAuthMessageHandler=e=>{let t=e.data;if(!t)return;let n=typeof window<`u`&&window.location?window.location.origin:``;if(KI({origin:e.origin,source:e.source,expectedOrigin:n,popup:this.mcpOAuthPopup,dataSource:t.source}))if(t.type===`mcp-oauth-callback`){if(this.mcpOAuthPopup&&!this.mcpOAuthPopup.closed)try{this.mcpOAuthPopup.close()}catch{}if(this.mcpOAuthPopup=null,!this.mcpOAuthFlow)return;if(t.error){this.mcpMessage={kind:`error`,text:`OAuth failed: ${t.error}`},this.mcpOAuthFlow=null;return}if(!t.code||!t.state){this.mcpMessage={kind:`error`,text:`OAuth callback missing code or state.`},this.mcpOAuthFlow=null;return}Em(this,t.code,t.state)}else t.type===`mcp-oauth-cancelled`&&(Om(this),this.mcpMessage={kind:`error`,text:`Authorization was cancelled.`})},t(this.settings.locale)&&u.setLocale(this.settings.locale)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.onSlashAction=e=>{switch(e){case`toggle-focus`:this.applySettings({...this.settings,chatFocusMode:!this.settings.chatFocusMode});break;case`export`:By(this.chatMessages,this.assistantName);break;case`refresh-tools-effective`:Tf(this);break}},document.addEventListener(`keydown`,this.globalKeydownHandler),window.addEventListener(`message`,this.canvasAgentRunMessageHandler),window.addEventListener(`message`,this.mcpOAuthMessageHandler),_k(this)}firstUpdated(){vk(this)}disconnectedCallback(){document.removeEventListener(`keydown`,this.globalKeydownHandler),window.removeEventListener(`message`,this.canvasAgentRunMessageHandler),window.removeEventListener(`message`,this.mcpOAuthMessageHandler),yk(this),super.disconnectedCallback()}updated(e){if(bk(this,e),!e.has(`sessionKey`)||this.agentsPanel!==`tools`)return;let t=pa(this.sessionKey);if(this.agentsSelectedId&&this.agentsSelectedId===t){Sf(this,{agentId:this.agentsSelectedId,sessionKey:this.sessionKey});return}this.toolsEffectiveResult=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null}connect(){uk(this)}handleChatScroll(e){ri(this,e)}handleLogsScroll(e){ii(this,e)}exportLogs(e,t){oi(e,t)}resetToolStream(){Ai(this)}resetChatScroll(){ai(this)}scrollToBottom(e){ai(this),ti(this,!0,!!e?.smooth)}async loadAssistantIdentity(){await zO(this)}applySettings(e){aO(this,e)}applyLocalUserIdentity(e){oO(this,e)}setTab(e){uO(this,e),this.navDrawerOpen=!1}setTheme(e,t){fO(this,e,t),this.themeOrder=this.buildThemeOrder(e)}setThemeMode(e,t){pO(this,e,t)}setBorderRadius(e){aO(this,{...this.settings,borderRadius:e}),this.requestUpdate()}buildThemeOrder(e){return[e,...[...kh].filter(t=>t!==e)]}async loadOverview(e){await AO(this,e)}async loadCron(){await IO(this)}async handleAbortChat(){await Gu(this)}removeQueuedMessage(e){Qu(this,e)}async handleSendChat(e,t){await ed(this,e,t)}async toggleRealtimeTalk(){if(this.realtimeTalkSession){this.realtimeTalkSession.stop(),this.realtimeTalkSession=null,this.realtimeTalkActive=!1,this.realtimeTalkStatus=`idle`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null;return}if(!this.client||!this.connected){this.lastError=`Gateway not connected`;return}this.realtimeTalkActive=!0,this.realtimeTalkStatus=`connecting`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null;let e=new GI(this.client,this.sessionKey,{onStatus:(e,t)=>{this.realtimeTalkStatus=e,this.realtimeTalkDetail=t??null,(e===`idle`||e===`error`)&&(this.realtimeTalkActive=e!==`idle`)},onTranscript:e=>{this.realtimeTalkTranscript=`${e.role===`user`?`You`:`Genesis`}: ${e.text}`}});this.realtimeTalkSession=e;try{await e.start()}catch(t){e.stop(),this.realtimeTalkSession===e&&(this.realtimeTalkSession=null),this.realtimeTalkActive=!1,this.realtimeTalkStatus=`error`,this.realtimeTalkDetail=t instanceof Error?t.message:String(t),this.lastError=this.realtimeTalkDetail}}async steerQueuedChatMessage(e){await Xu(this,e)}async handleWhatsAppStart(e){await Ar(this,e)}async handleWhatsAppWait(){await jr(this)}async handleWhatsAppLogout(){await Mr(this)}async handleChannelConfigSave(){await Nr(this)}async handleChannelConfigReload(){await Pr(this)}async handleChannelWizardStart(){await Lr(this)}async handleChannelWizardSubmit(){await zr(this)}async handleChannelWizardCancel(){await Br(this)}handleChannelWizardInput(e){Rr(this,e)}handleChannelWizardClose(){Vr(this)}async handleModelProviderWizardStart(){await wk(this)}async handleModelProviderWizardSubmit(){await Ek(this)}async handleModelProviderWizardCancel(){await Dk(this)}handleModelProviderWizardInput(e){Tk(this,e)}handleModelProviderWizardClose(){Ok(this)}handleNostrProfileEdit(e,t){Kr(this,e,t)}handleNostrProfileCancel(){qr(this)}handleNostrProfileFieldChange(e,t){Jr(this,e,t)}async handleNostrProfileSave(){await Xr(this)}async handleNostrProfileImport(){await Zr(this)}handleNostrProfileToggleAdvanced(){Yr(this)}async handleExecApprovalDecision(e){let t=this.execApprovalQueue[0];if(!(!t||!this.client||this.execApprovalBusy)){this.execApprovalBusy=!0,this.execApprovalError=null;try{let n=t.kind===`plugin`?`plugin.approval.resolve`:`exec.approval.resolve`;await this.client.request(n,{id:t.id,decision:e}),this.execApprovalQueue=this.execApprovalQueue.filter(e=>e.id!==t.id)}catch(e){this.execApprovalError=`Approval failed: ${String(e)}`}finally{this.execApprovalBusy=!1}}}handleGatewayUrlConfirm(){let e=this.pendingGatewayUrl;if(!e)return;let t=this.pendingGatewayToken?.trim()||``;this.pendingGatewayUrl=null,this.pendingGatewayToken=null,aO(this,{...this.settings,gatewayUrl:e,token:t}),this.connect()}handleGatewayUrlCancel(){this.pendingGatewayUrl=null,this.pendingGatewayToken=null}handleOpenSidebar(e){this.sidebarCloseTimer!=null&&(window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=null),this.sidebarContent=e,this.sidebarError=null,this.sidebarOpen=!0}handleCloseSidebar(){this.sidebarOpen=!1,this.sidebarCloseTimer!=null&&window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=window.setTimeout(()=>{this.sidebarOpen||(this.sidebarContent=null,this.sidebarError=null,this.sidebarCloseTimer=null)},200)}handleSplitRatioChange(e){let t=Math.max(.4,Math.min(.7,e));this.splitRatio=t,this.applySettings({...this.settings,splitRatio:t})}render(){return AI(this)}};X([F()],$.prototype,`settings`,void 0),X([F()],$.prototype,`password`,void 0),X([F()],$.prototype,`loginShowGatewayToken`,void 0),X([F()],$.prototype,`loginShowGatewayPassword`,void 0),X([F()],$.prototype,`tab`,void 0),X([F()],$.prototype,`onboarding`,void 0),X([F()],$.prototype,`connected`,void 0),X([F()],$.prototype,`theme`,void 0),X([F()],$.prototype,`themeMode`,void 0),X([F()],$.prototype,`themeResolved`,void 0),X([F()],$.prototype,`themeOrder`,void 0),X([F()],$.prototype,`hello`,void 0),X([F()],$.prototype,`lastError`,void 0),X([F()],$.prototype,`lastErrorCode`,void 0),X([F()],$.prototype,`eventLog`,void 0),X([F()],$.prototype,`assistantName`,void 0),X([F()],$.prototype,`assistantAvatar`,void 0),X([F()],$.prototype,`assistantAgentId`,void 0),X([F()],$.prototype,`userName`,void 0),X([F()],$.prototype,`userAvatar`,void 0),X([F()],$.prototype,`localMediaPreviewRoots`,void 0),X([F()],$.prototype,`embedSandboxMode`,void 0),X([F()],$.prototype,`allowExternalEmbedUrls`,void 0),X([F()],$.prototype,`serverVersion`,void 0),X([F()],$.prototype,`sessionKey`,void 0),X([F()],$.prototype,`chatLoading`,void 0),X([F()],$.prototype,`chatSending`,void 0),X([F()],$.prototype,`chatMessage`,void 0),X([F()],$.prototype,`chatMessages`,void 0),X([F()],$.prototype,`chatToolMessages`,void 0),X([F()],$.prototype,`chatStreamSegments`,void 0),X([F()],$.prototype,`chatStream`,void 0),X([F()],$.prototype,`chatStreamStartedAt`,void 0),X([F()],$.prototype,`chatRunId`,void 0),X([F()],$.prototype,`chatSideResult`,void 0),X([F()],$.prototype,`compactionStatus`,void 0),X([F()],$.prototype,`fallbackStatus`,void 0),X([F()],$.prototype,`chatAvatarUrl`,void 0),X([F()],$.prototype,`chatThinkingLevel`,void 0),X([F()],$.prototype,`chatModelOverrides`,void 0),X([F()],$.prototype,`chatModelsLoading`,void 0),X([F()],$.prototype,`chatModelCatalog`,void 0),X([F()],$.prototype,`chatQueue`,void 0),X([F()],$.prototype,`chatAttachments`,void 0),X([F()],$.prototype,`realtimeTalkActive`,void 0),X([F()],$.prototype,`realtimeTalkStatus`,void 0),X([F()],$.prototype,`realtimeTalkDetail`,void 0),X([F()],$.prototype,`realtimeTalkTranscript`,void 0),X([F()],$.prototype,`chatManualRefreshInFlight`,void 0),X([F()],$.prototype,`navDrawerOpen`,void 0),X([F()],$.prototype,`sidebarOpen`,void 0),X([F()],$.prototype,`sidebarContent`,void 0),X([F()],$.prototype,`sidebarError`,void 0),X([F()],$.prototype,`splitRatio`,void 0),X([F()],$.prototype,`nodesLoading`,void 0),X([F()],$.prototype,`nodes`,void 0),X([F()],$.prototype,`nodeManagementSelectedId`,void 0),X([F()],$.prototype,`nodeManagementRename`,void 0),X([F()],$.prototype,`nodeManagementCommand`,void 0),X([F()],$.prototype,`nodeManagementParams`,void 0),X([F()],$.prototype,`nodeManagementShell`,void 0),X([F()],$.prototype,`nodeManagementCwd`,void 0),X([F()],$.prototype,`nodeManagementTimeoutMs`,void 0),X([F()],$.prototype,`nodeManagementBusy`,void 0),X([F()],$.prototype,`nodeManagementError`,void 0),X([F()],$.prototype,`nodeManagementResult`,void 0),X([F()],$.prototype,`devicesLoading`,void 0),X([F()],$.prototype,`devicesError`,void 0),X([F()],$.prototype,`devicesList`,void 0),X([F()],$.prototype,`execApprovalsLoading`,void 0),X([F()],$.prototype,`execApprovalsSaving`,void 0),X([F()],$.prototype,`execApprovalsDirty`,void 0),X([F()],$.prototype,`execApprovalsSnapshot`,void 0),X([F()],$.prototype,`execApprovalsForm`,void 0),X([F()],$.prototype,`execApprovalsSelectedAgent`,void 0),X([F()],$.prototype,`execApprovalsTarget`,void 0),X([F()],$.prototype,`execApprovalsTargetNodeId`,void 0),X([F()],$.prototype,`execApprovalQueue`,void 0),X([F()],$.prototype,`execApprovalBusy`,void 0),X([F()],$.prototype,`execApprovalError`,void 0),X([F()],$.prototype,`pendingGatewayUrl`,void 0),X([F()],$.prototype,`configLoading`,void 0),X([F()],$.prototype,`configRaw`,void 0),X([F()],$.prototype,`configRawOriginal`,void 0),X([F()],$.prototype,`configValid`,void 0),X([F()],$.prototype,`configIssues`,void 0),X([F()],$.prototype,`configSaving`,void 0),X([F()],$.prototype,`configApplying`,void 0),X([F()],$.prototype,`updateRunning`,void 0),X([F()],$.prototype,`applySessionKey`,void 0),X([F()],$.prototype,`configSnapshot`,void 0),X([F()],$.prototype,`configSchema`,void 0),X([F()],$.prototype,`configSchemaVersion`,void 0),X([F()],$.prototype,`configSchemaLoading`,void 0),X([F()],$.prototype,`configUiHints`,void 0),X([F()],$.prototype,`configForm`,void 0),X([F()],$.prototype,`configFormOriginal`,void 0),X([F()],$.prototype,`configRestartPrompt`,void 0),X([F()],$.prototype,`dreamingStatusLoading`,void 0),X([F()],$.prototype,`dreamingStatusError`,void 0),X([F()],$.prototype,`dreamingStatus`,void 0),X([F()],$.prototype,`dreamingModeSaving`,void 0),X([F()],$.prototype,`dreamDiaryLoading`,void 0),X([F()],$.prototype,`dreamDiaryActionLoading`,void 0),X([F()],$.prototype,`dreamDiaryActionMessage`,void 0),X([F()],$.prototype,`dreamDiaryActionArchivePath`,void 0),X([F()],$.prototype,`dreamDiaryError`,void 0),X([F()],$.prototype,`dreamDiaryPath`,void 0),X([F()],$.prototype,`dreamDiaryContent`,void 0),X([F()],$.prototype,`wikiImportInsightsLoading`,void 0),X([F()],$.prototype,`wikiImportInsightsError`,void 0),X([F()],$.prototype,`wikiImportInsights`,void 0),X([F()],$.prototype,`wikiMemoryPalaceLoading`,void 0),X([F()],$.prototype,`wikiMemoryPalaceError`,void 0),X([F()],$.prototype,`wikiMemoryPalace`,void 0),X([F()],$.prototype,`configFormDirty`,void 0),X([F()],$.prototype,`configSettingsMode`,void 0),X([F()],$.prototype,`configFormMode`,void 0),X([F()],$.prototype,`configSearchQuery`,void 0),X([F()],$.prototype,`configActiveSection`,void 0),X([F()],$.prototype,`configActiveSubsection`,void 0),X([F()],$.prototype,`communicationsFormMode`,void 0),X([F()],$.prototype,`communicationsSearchQuery`,void 0),X([F()],$.prototype,`communicationsActiveSection`,void 0),X([F()],$.prototype,`communicationsActiveSubsection`,void 0),X([F()],$.prototype,`appearanceFormMode`,void 0),X([F()],$.prototype,`appearanceSearchQuery`,void 0),X([F()],$.prototype,`appearanceActiveSection`,void 0),X([F()],$.prototype,`appearanceActiveSubsection`,void 0),X([F()],$.prototype,`automationFormMode`,void 0),X([F()],$.prototype,`automationSearchQuery`,void 0),X([F()],$.prototype,`automationActiveSection`,void 0),X([F()],$.prototype,`automationActiveSubsection`,void 0),X([F()],$.prototype,`infrastructureFormMode`,void 0),X([F()],$.prototype,`infrastructureSearchQuery`,void 0),X([F()],$.prototype,`infrastructureActiveSection`,void 0),X([F()],$.prototype,`infrastructureActiveSubsection`,void 0),X([F()],$.prototype,`aiAgentsFormMode`,void 0),X([F()],$.prototype,`aiAgentsSearchQuery`,void 0),X([F()],$.prototype,`aiAgentsActiveSection`,void 0),X([F()],$.prototype,`aiAgentsActiveSubsection`,void 0),X([F()],$.prototype,`channelsLoading`,void 0),X([F()],$.prototype,`channelsSnapshot`,void 0),X([F()],$.prototype,`channelsError`,void 0),X([F()],$.prototype,`channelsLastSuccess`,void 0),X([F()],$.prototype,`whatsappLoginMessage`,void 0),X([F()],$.prototype,`whatsappLoginQrDataUrl`,void 0),X([F()],$.prototype,`whatsappLoginConnected`,void 0),X([F()],$.prototype,`whatsappBusy`,void 0),X([F()],$.prototype,`nostrProfileFormState`,void 0),X([F()],$.prototype,`nostrProfileAccountId`,void 0),X([F()],$.prototype,`channelWizardSessionId`,void 0),X([F()],$.prototype,`channelWizardStep`,void 0),X([F()],$.prototype,`channelWizardInput`,void 0),X([F()],$.prototype,`channelWizardBusy`,void 0),X([F()],$.prototype,`channelWizardError`,void 0),X([F()],$.prototype,`channelWizardMessage`,void 0),X([F()],$.prototype,`modelProviderWizardSessionId`,void 0),X([F()],$.prototype,`modelProviderWizardStep`,void 0),X([F()],$.prototype,`modelProviderWizardInput`,void 0),X([F()],$.prototype,`modelProviderWizardBusy`,void 0),X([F()],$.prototype,`modelProviderWizardError`,void 0),X([F()],$.prototype,`modelProviderWizardMessage`,void 0),X([F()],$.prototype,`presenceLoading`,void 0),X([F()],$.prototype,`presenceEntries`,void 0),X([F()],$.prototype,`presenceError`,void 0),X([F()],$.prototype,`presenceStatus`,void 0),X([F()],$.prototype,`agentsLoading`,void 0),X([F()],$.prototype,`agentsList`,void 0),X([F()],$.prototype,`agentsError`,void 0),X([F()],$.prototype,`agentsSelectedId`,void 0),X([F()],$.prototype,`toolsCatalogLoading`,void 0),X([F()],$.prototype,`toolsCatalogError`,void 0),X([F()],$.prototype,`toolsCatalogResult`,void 0),X([F()],$.prototype,`toolsEffectiveLoading`,void 0),X([F()],$.prototype,`toolsEffectiveLoadingKey`,void 0),X([F()],$.prototype,`toolsEffectiveResultKey`,void 0),X([F()],$.prototype,`toolsEffectiveError`,void 0),X([F()],$.prototype,`toolsEffectiveResult`,void 0),X([F()],$.prototype,`agentsPanel`,void 0),X([F()],$.prototype,`agentFilesLoading`,void 0),X([F()],$.prototype,`agentFilesError`,void 0),X([F()],$.prototype,`agentFilesList`,void 0),X([F()],$.prototype,`agentFileContents`,void 0),X([F()],$.prototype,`agentFileDrafts`,void 0),X([F()],$.prototype,`agentFileActive`,void 0),X([F()],$.prototype,`agentFileSaving`,void 0),X([F()],$.prototype,`agentIdentityLoading`,void 0),X([F()],$.prototype,`agentIdentityError`,void 0),X([F()],$.prototype,`agentIdentityById`,void 0),X([F()],$.prototype,`agentSkillsLoading`,void 0),X([F()],$.prototype,`agentSkillsError`,void 0),X([F()],$.prototype,`agentSkillsReport`,void 0),X([F()],$.prototype,`agentSkillsAgentId`,void 0),X([F()],$.prototype,`mcpServersLoading`,void 0),X([F()],$.prototype,`mcpServers`,void 0),X([F()],$.prototype,`mcpServersPath`,void 0),X([F()],$.prototype,`mcpServersError`,void 0),X([F()],$.prototype,`mcpBusy`,void 0),X([F()],$.prototype,`mcpMessage`,void 0),X([F()],$.prototype,`mcpDraftName`,void 0),X([F()],$.prototype,`mcpDraftConfig`,void 0),X([F()],$.prototype,`mcpAddMode`,void 0),X([F()],$.prototype,`mcpAuthToken`,void 0),X([F()],$.prototype,`mcpPresetId`,void 0),X([F()],$.prototype,`mcpLinkUrl`,void 0),X([F()],$.prototype,`mcpLinkMetadataLoading`,void 0),X([F()],$.prototype,`mcpLinkMetadataError`,void 0),X([F()],$.prototype,`mcpLinkMetadata`,void 0),X([F()],$.prototype,`mcpOAuthStatus`,void 0),X([F()],$.prototype,`mcpOAuthFlow`,void 0),X([F()],$.prototype,`mcpOAuthPopup`,void 0),X([F()],$.prototype,`mcpTestStatus`,void 0),X([F()],$.prototype,`sessionsLoading`,void 0),X([F()],$.prototype,`sessionsResult`,void 0),X([F()],$.prototype,`sessionsError`,void 0),X([F()],$.prototype,`sessionsFilterActive`,void 0),X([F()],$.prototype,`sessionsFilterLimit`,void 0),X([F()],$.prototype,`sessionsIncludeGlobal`,void 0),X([F()],$.prototype,`sessionsIncludeUnknown`,void 0),X([F()],$.prototype,`sessionsHideCron`,void 0),X([F()],$.prototype,`sessionsSearchQuery`,void 0),X([F()],$.prototype,`sessionsSortColumn`,void 0),X([F()],$.prototype,`sessionsSortDir`,void 0),X([F()],$.prototype,`sessionsPage`,void 0),X([F()],$.prototype,`sessionsPageSize`,void 0),X([F()],$.prototype,`sessionsSelectedKeys`,void 0),X([F()],$.prototype,`sessionsExpandedCheckpointKey`,void 0),X([F()],$.prototype,`sessionsCheckpointItemsByKey`,void 0),X([F()],$.prototype,`sessionsCheckpointLoadingKey`,void 0),X([F()],$.prototype,`sessionsCheckpointBusyKey`,void 0),X([F()],$.prototype,`sessionsCheckpointErrorByKey`,void 0),X([F()],$.prototype,`usageLoading`,void 0),X([F()],$.prototype,`usageResult`,void 0),X([F()],$.prototype,`usageCostSummary`,void 0),X([F()],$.prototype,`usageError`,void 0),X([F()],$.prototype,`usageStartDate`,void 0),X([F()],$.prototype,`usageEndDate`,void 0),X([F()],$.prototype,`usageSelectedSessions`,void 0),X([F()],$.prototype,`usageSelectedDays`,void 0),X([F()],$.prototype,`usageSelectedHours`,void 0),X([F()],$.prototype,`usageChartMode`,void 0),X([F()],$.prototype,`usageDailyChartMode`,void 0),X([F()],$.prototype,`usageTimeSeriesMode`,void 0),X([F()],$.prototype,`usageTimeSeriesBreakdownMode`,void 0),X([F()],$.prototype,`usageTimeSeries`,void 0),X([F()],$.prototype,`usageTimeSeriesLoading`,void 0),X([F()],$.prototype,`usageTimeSeriesCursorStart`,void 0),X([F()],$.prototype,`usageTimeSeriesCursorEnd`,void 0),X([F()],$.prototype,`usageSessionLogs`,void 0),X([F()],$.prototype,`usageSessionLogsLoading`,void 0),X([F()],$.prototype,`usageSessionLogsExpanded`,void 0),X([F()],$.prototype,`usageQuery`,void 0),X([F()],$.prototype,`usageQueryDraft`,void 0),X([F()],$.prototype,`usageSessionSort`,void 0),X([F()],$.prototype,`usageSessionSortDir`,void 0),X([F()],$.prototype,`usageRecentSessions`,void 0),X([F()],$.prototype,`usageTimeZone`,void 0),X([F()],$.prototype,`usageContextExpanded`,void 0),X([F()],$.prototype,`usageHeaderPinned`,void 0),X([F()],$.prototype,`usageSessionsTab`,void 0),X([F()],$.prototype,`usageVisibleColumns`,void 0),X([F()],$.prototype,`usageLogFilterRoles`,void 0),X([F()],$.prototype,`usageLogFilterTools`,void 0),X([F()],$.prototype,`usageLogFilterHasTools`,void 0),X([F()],$.prototype,`usageLogFilterQuery`,void 0),X([F()],$.prototype,`cronLoading`,void 0),X([F()],$.prototype,`cronQuickCreateOpen`,void 0),X([F()],$.prototype,`cronQuickCreateStep`,void 0),X([F()],$.prototype,`cronQuickCreateDraft`,void 0),X([F()],$.prototype,`cronJobsLoadingMore`,void 0),X([F()],$.prototype,`cronJobs`,void 0),X([F()],$.prototype,`cronJobsTotal`,void 0),X([F()],$.prototype,`cronJobsHasMore`,void 0),X([F()],$.prototype,`cronJobsNextOffset`,void 0),X([F()],$.prototype,`cronJobsLimit`,void 0),X([F()],$.prototype,`cronJobsQuery`,void 0),X([F()],$.prototype,`cronJobsEnabledFilter`,void 0),X([F()],$.prototype,`cronJobsScheduleKindFilter`,void 0),X([F()],$.prototype,`cronJobsLastStatusFilter`,void 0),X([F()],$.prototype,`cronJobsSortBy`,void 0),X([F()],$.prototype,`cronJobsSortDir`,void 0),X([F()],$.prototype,`cronStatus`,void 0),X([F()],$.prototype,`cronError`,void 0),X([F()],$.prototype,`cronForm`,void 0),X([F()],$.prototype,`cronFieldErrors`,void 0),X([F()],$.prototype,`cronEditingJobId`,void 0),X([F()],$.prototype,`cronRunsJobId`,void 0),X([F()],$.prototype,`cronRunsLoadingMore`,void 0),X([F()],$.prototype,`cronRuns`,void 0),X([F()],$.prototype,`cronRunsTotal`,void 0),X([F()],$.prototype,`cronRunsHasMore`,void 0),X([F()],$.prototype,`cronRunsNextOffset`,void 0),X([F()],$.prototype,`cronRunsLimit`,void 0),X([F()],$.prototype,`cronRunsScope`,void 0),X([F()],$.prototype,`cronRunsStatuses`,void 0),X([F()],$.prototype,`cronRunsDeliveryStatuses`,void 0),X([F()],$.prototype,`cronRunsStatusFilter`,void 0),X([F()],$.prototype,`cronRunsQuery`,void 0),X([F()],$.prototype,`cronRunsSortDir`,void 0),X([F()],$.prototype,`cronModelSuggestions`,void 0),X([F()],$.prototype,`cronBusy`,void 0),X([F()],$.prototype,`updateAvailable`,void 0),X([F()],$.prototype,`attentionItems`,void 0),X([F()],$.prototype,`paletteOpen`,void 0),X([F()],$.prototype,`paletteQuery`,void 0),X([F()],$.prototype,`paletteActiveIndex`,void 0),X([F()],$.prototype,`overviewShowGatewayToken`,void 0),X([F()],$.prototype,`overviewShowGatewayPassword`,void 0),X([F()],$.prototype,`overviewLogLines`,void 0),X([F()],$.prototype,`overviewLogCursor`,void 0),X([F()],$.prototype,`walletSummary`,void 0),X([F()],$.prototype,`walletSummaryError`,void 0),X([F()],$.prototype,`walletSummaryLoading`,void 0),X([F()],$.prototype,`walletBalancesLoading`,void 0),X([F()],$.prototype,`walletLastUpdatedAt`,void 0),X([F()],$.prototype,`walletRecoveryPhraseMode`,void 0),X([F()],$.prototype,`walletRecoveryPhraseBusy`,void 0),X([F()],$.prototype,`walletRecoveryPhraseError`,void 0),X([F()],$.prototype,`walletRecoveryPhraseGeneratedMnemonic`,void 0),X([F()],$.prototype,`walletRecoveryPhraseStatus`,void 0),X([F()],$.prototype,`skillsLoading`,void 0),X([F()],$.prototype,`skillsReport`,void 0),X([F()],$.prototype,`skillsError`,void 0),X([F()],$.prototype,`skillsFilter`,void 0),X([F()],$.prototype,`skillsStatusFilter`,void 0),X([F()],$.prototype,`skillEdits`,void 0),X([F()],$.prototype,`skillsBusyKey`,void 0),X([F()],$.prototype,`skillMessages`,void 0),X([F()],$.prototype,`skillsDetailKey`,void 0),X([F()],$.prototype,`clawhubSearchQuery`,void 0),X([F()],$.prototype,`clawhubSearchResults`,void 0),X([F()],$.prototype,`clawhubSearchLoading`,void 0),X([F()],$.prototype,`clawhubSearchError`,void 0),X([F()],$.prototype,`clawhubDetail`,void 0),X([F()],$.prototype,`clawhubDetailSlug`,void 0),X([F()],$.prototype,`clawhubDetailLoading`,void 0),X([F()],$.prototype,`clawhubDetailError`,void 0),X([F()],$.prototype,`clawhubInstallSlug`,void 0),X([F()],$.prototype,`clawhubInstallMessage`,void 0),X([F()],$.prototype,`pluginsLoading`,void 0),X([F()],$.prototype,`pluginsReport`,void 0),X([F()],$.prototype,`pluginsError`,void 0),X([F()],$.prototype,`pluginsFilter`,void 0),X([F()],$.prototype,`pluginsStatusFilter`,void 0),X([F()],$.prototype,`pluginsBusyKey`,void 0),X([F()],$.prototype,`pluginMessages`,void 0),X([F()],$.prototype,`pluginDetailKey`,void 0),X([F()],$.prototype,`pluginClawhubSearchQuery`,void 0),X([F()],$.prototype,`pluginClawhubSearchResults`,void 0),X([F()],$.prototype,`pluginClawhubSearchLoading`,void 0),X([F()],$.prototype,`pluginClawhubSearchError`,void 0),X([F()],$.prototype,`pluginClawhubDetail`,void 0),X([F()],$.prototype,`pluginClawhubDetailName`,void 0),X([F()],$.prototype,`pluginClawhubDetailLoading`,void 0),X([F()],$.prototype,`pluginClawhubDetailError`,void 0),X([F()],$.prototype,`pluginClawhubInstallName`,void 0),X([F()],$.prototype,`pluginClawhubInstallMessage`,void 0),X([F()],$.prototype,`healthLoading`,void 0),X([F()],$.prototype,`healthResult`,void 0),X([F()],$.prototype,`healthError`,void 0),X([F()],$.prototype,`modelAuthStatusLoading`,void 0),X([F()],$.prototype,`modelAuthStatusResult`,void 0),X([F()],$.prototype,`modelAuthStatusError`,void 0),X([F()],$.prototype,`debugLoading`,void 0),X([F()],$.prototype,`debugStatus`,void 0),X([F()],$.prototype,`debugHealth`,void 0),X([F()],$.prototype,`debugModels`,void 0),X([F()],$.prototype,`debugHeartbeat`,void 0),X([F()],$.prototype,`debugCallMethod`,void 0),X([F()],$.prototype,`debugCallParams`,void 0),X([F()],$.prototype,`debugCallResult`,void 0),X([F()],$.prototype,`debugCallError`,void 0),X([F()],$.prototype,`logsLoading`,void 0),X([F()],$.prototype,`logsError`,void 0),X([F()],$.prototype,`logsFile`,void 0),X([F()],$.prototype,`logsEntries`,void 0),X([F()],$.prototype,`logsFilterText`,void 0),X([F()],$.prototype,`logsLevelFilters`,void 0),X([F()],$.prototype,`logsAutoFollow`,void 0),X([F()],$.prototype,`logsTruncated`,void 0),X([F()],$.prototype,`logsCursor`,void 0),X([F()],$.prototype,`logsLastFetchAt`,void 0),X([F()],$.prototype,`logsLimit`,void 0),X([F()],$.prototype,`logsMaxBytes`,void 0),X([F()],$.prototype,`logsAtBottom`,void 0),X([F()],$.prototype,`chatNewMessagesBelow`,void 0),$=X([N(`genesis-app`)],$);export{Cu as A,Dn as B,Ru as C,Mu as D,wu as E,ou as F,tn as H,Kl as I,Xa as L,Bu as M,pu as N,xu as O,fu as P,ga as R,Pu as S,mu as T,Ie as U,fn as V,ke as W,ev as _,oF as a,bu as b,$P as c,zj as d,Bj as f,J as g,Uy as h,cF as i,Tu as j,Eu as k,rN as l,cx as m,uF as n,aF as o,zT as p,lF as r,sF as s,dF as t,VM as u,$_ as v,zu as w,Su as x,zg as y,Or as z};
6238
- //# sourceMappingURL=index-ChL66WCS.js.map
6246
+ `,this.configRawOriginal=``,this.configValid=null,this.configIssues=[],this.configSaving=!1,this.configApplying=!1,this.updateRunning=!1,this.applySessionKey=this.settings.lastActiveSessionKey,this.configSnapshot=null,this.configSchema=null,this.configSchemaVersion=null,this.configSchemaLoading=!1,this.configUiHints={},this.configForm=null,this.configFormOriginal=null,this.configRestartPrompt=null,this.dreamingStatusLoading=!1,this.dreamingStatusError=null,this.dreamingStatus=null,this.dreamingModeSaving=!1,this.dreamDiaryLoading=!1,this.dreamDiaryActionLoading=!1,this.dreamDiaryActionMessage=null,this.dreamDiaryActionArchivePath=null,this.dreamDiaryError=null,this.dreamDiaryPath=null,this.dreamDiaryContent=null,this.wikiImportInsightsLoading=!1,this.wikiImportInsightsError=null,this.wikiImportInsights=null,this.wikiMemoryPalaceLoading=!1,this.wikiMemoryPalaceError=null,this.wikiMemoryPalace=null,this.configFormDirty=!1,this.configSettingsMode=`quick`,this.configFormMode=`form`,this.configSearchQuery=``,this.configActiveSection=null,this.configActiveSubsection=null,this.communicationsFormMode=`form`,this.communicationsSearchQuery=``,this.communicationsActiveSection=null,this.communicationsActiveSubsection=null,this.appearanceFormMode=`form`,this.appearanceSearchQuery=``,this.appearanceActiveSection=null,this.appearanceActiveSubsection=null,this.automationFormMode=`form`,this.automationSearchQuery=``,this.automationActiveSection=null,this.automationActiveSubsection=null,this.infrastructureFormMode=`form`,this.infrastructureSearchQuery=``,this.infrastructureActiveSection=null,this.infrastructureActiveSubsection=null,this.aiAgentsFormMode=`form`,this.aiAgentsSearchQuery=``,this.aiAgentsActiveSection=null,this.aiAgentsActiveSubsection=null,this.channelsLoading=!1,this.channelsSnapshot=null,this.channelsError=null,this.channelsLastSuccess=null,this.whatsappLoginMessage=null,this.whatsappLoginQrDataUrl=null,this.whatsappLoginConnected=null,this.whatsappBusy=!1,this.nostrProfileFormState=null,this.nostrProfileAccountId=null,this.channelWizardSessionId=null,this.channelWizardStep=null,this.channelWizardInput=null,this.channelWizardBusy=!1,this.channelWizardError=null,this.channelWizardMessage=null,this.modelProviderWizardSessionId=null,this.modelProviderWizardStep=null,this.modelProviderWizardInput=null,this.modelProviderWizardBusy=!1,this.modelProviderWizardError=null,this.modelProviderWizardMessage=null,this.presenceLoading=!1,this.presenceEntries=[],this.presenceError=null,this.presenceStatus=null,this.agentsLoading=!1,this.agentsList=null,this.agentsError=null,this.agentsSelectedId=null,this.toolsCatalogLoading=!1,this.toolsCatalogError=null,this.toolsCatalogResult=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveResult=null,this.agentsPanel=`files`,this.agentFilesLoading=!1,this.agentFilesError=null,this.agentFilesList=null,this.agentFileContents={},this.agentFileDrafts={},this.agentFileActive=null,this.agentFileSaving=!1,this.agentIdentityLoading=!1,this.agentIdentityError=null,this.agentIdentityById={},this.agentSkillsLoading=!1,this.agentSkillsError=null,this.agentSkillsReport=null,this.agentSkillsAgentId=null,this.mcpServersLoading=!1,this.mcpServers=null,this.mcpServersPath=null,this.mcpServersError=null,this.mcpBusy=!1,this.mcpMessage=null,this.mcpDraftName=``,this.mcpDraftConfig=``,this.mcpAddMode=`preset`,this.mcpAuthToken=``,this.mcpPresetId=null,this.mcpLinkUrl=``,this.mcpLinkMetadataLoading=!1,this.mcpLinkMetadataError=null,this.mcpLinkMetadata=null,this.mcpOAuthStatus={},this.mcpOAuthFlow=null,this.mcpOAuthPopup=null,this.mcpTestStatus={},this.sessionsLoading=!1,this.sessionsResult=null,this.sessionsError=null,this.sessionsFilterActive=``,this.sessionsFilterLimit=`120`,this.sessionsIncludeGlobal=!0,this.sessionsIncludeUnknown=!1,this.sessionsHideCron=!0,this.sessionsSearchQuery=``,this.sessionsSortColumn=`updated`,this.sessionsSortDir=`desc`,this.sessionsPage=0,this.sessionsPageSize=25,this.sessionsSelectedKeys=new Set,this.sessionsExpandedCheckpointKey=null,this.sessionsCheckpointItemsByKey={},this.sessionsCheckpointLoadingKey=null,this.sessionsCheckpointBusyKey=null,this.sessionsCheckpointErrorByKey={},this.usageLoading=!1,this.usageResult=null,this.usageCostSummary=null,this.usageError=null,this.usageStartDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.usageEndDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.usageSelectedSessions=[],this.usageSelectedDays=[],this.usageSelectedHours=[],this.usageChartMode=`tokens`,this.usageDailyChartMode=`by-type`,this.usageTimeSeriesMode=`per-turn`,this.usageTimeSeriesBreakdownMode=`by-type`,this.usageTimeSeries=null,this.usageTimeSeriesLoading=!1,this.usageTimeSeriesCursorStart=null,this.usageTimeSeriesCursorEnd=null,this.usageSessionLogs=null,this.usageSessionLogsLoading=!1,this.usageSessionLogsExpanded=!1,this.usageQuery=``,this.usageQueryDraft=``,this.usageSessionSort=`recent`,this.usageSessionSortDir=`desc`,this.usageRecentSessions=[],this.usageTimeZone=`local`,this.usageContextExpanded=!1,this.usageHeaderPinned=!1,this.usageSessionsTab=`all`,this.usageVisibleColumns=[`channel`,`agent`,`provider`,`model`,`messages`,`tools`,`errors`,`duration`],this.usageLogFilterRoles=[],this.usageLogFilterTools=[],this.usageLogFilterHasTools=!1,this.usageLogFilterQuery=``,this.usageQueryDebounceTimer=null,this.cronLoading=!1,this.cronQuickCreateOpen=!1,this.cronQuickCreateStep=`what`,this.cronQuickCreateDraft=null,this.cronJobsLoadingMore=!1,this.cronJobs=[],this.cronJobsTotal=0,this.cronJobsHasMore=!1,this.cronJobsNextOffset=null,this.cronJobsLimit=50,this.cronJobsQuery=``,this.cronJobsEnabledFilter=`all`,this.cronJobsScheduleKindFilter=`all`,this.cronJobsLastStatusFilter=`all`,this.cronJobsSortBy=`nextRunAtMs`,this.cronJobsSortDir=`asc`,this.cronStatus=null,this.cronError=null,this.cronForm={...xd},this.cronFieldErrors={},this.cronEditingJobId=null,this.cronRunsJobId=null,this.cronRunsLoadingMore=!1,this.cronRuns=[],this.cronRunsTotal=0,this.cronRunsHasMore=!1,this.cronRunsNextOffset=null,this.cronRunsLimit=50,this.cronRunsScope=`all`,this.cronRunsStatuses=[],this.cronRunsDeliveryStatuses=[],this.cronRunsStatusFilter=`all`,this.cronRunsQuery=``,this.cronRunsSortDir=`desc`,this.cronModelSuggestions=[],this.cronBusy=!1,this.updateAvailable=null,this.attentionItems=[],this.paletteOpen=!1,this.paletteQuery=``,this.paletteActiveIndex=0,this.overviewShowGatewayToken=!1,this.overviewShowGatewayPassword=!1,this.overviewLogLines=[],this.overviewLogCursor=0,this.walletSummary=null,this.walletSummaryError=null,this.walletSummaryLoading=!1,this.walletBalancesLoading=!1,this.walletLastUpdatedAt=null,this.walletRecoveryPhraseMode=`generate`,this.walletRecoveryPhraseBusy=!1,this.walletRecoveryPhraseError=null,this.walletRecoveryPhraseGeneratedMnemonic=null,this.walletRecoveryPhraseStatus=null,this.skillsLoading=!1,this.skillsReport=null,this.skillsError=null,this.skillsFilter=``,this.skillsStatusFilter=`all`,this.skillEdits={},this.skillsBusyKey=null,this.skillMessages={},this.skillsDetailKey=null,this.clawhubSearchQuery=``,this.clawhubSearchResults=null,this.clawhubSearchLoading=!1,this.clawhubSearchError=null,this.clawhubDetail=null,this.clawhubDetailSlug=null,this.clawhubDetailLoading=!1,this.clawhubDetailError=null,this.clawhubInstallSlug=null,this.clawhubInstallMessage=null,this.pluginsLoading=!1,this.pluginsReport=null,this.pluginsError=null,this.pluginsFilter=``,this.pluginsStatusFilter=`all`,this.pluginsBusyKey=null,this.pluginMessages={},this.pluginDetailKey=null,this.pluginClawhubSearchQuery=``,this.pluginClawhubSearchResults=null,this.pluginClawhubSearchLoading=!1,this.pluginClawhubSearchError=null,this.pluginClawhubDetail=null,this.pluginClawhubDetailName=null,this.pluginClawhubDetailLoading=!1,this.pluginClawhubDetailError=null,this.pluginClawhubInstallName=null,this.pluginClawhubInstallMessage=null,this.healthLoading=!1,this.healthResult=null,this.healthError=null,this.modelAuthStatusLoading=!1,this.modelAuthStatusResult=null,this.modelAuthStatusError=null,this.debugLoading=!1,this.debugStatus=null,this.debugHealth=null,this.debugModels=[],this.debugHeartbeat=null,this.debugCallMethod=``,this.debugCallParams=`{}`,this.debugCallResult=null,this.debugCallError=null,this.logsLoading=!1,this.logsError=null,this.logsFile=null,this.logsEntries=[],this.logsFilterText=``,this.logsLevelFilters={...bd},this.logsAutoFollow=!0,this.logsTruncated=!1,this.logsCursor=null,this.logsLastFetchAt=null,this.logsLimit=500,this.logsMaxBytes=25e4,this.logsAtBottom=!0,this.client=null,this.chatScrollFrame=null,this.chatScrollTimeout=null,this.chatHasAutoScrolled=!1,this.chatUserNearBottom=!0,this.chatNewMessagesBelow=!1,this.nodesPollInterval=null,this.logsPollInterval=null,this.debugPollInterval=null,this.logsScrollFrame=null,this.toolStreamById=new Map,this.toolStreamOrder=[],this.refreshSessionsAfterChat=new Set,this.chatSideResultTerminalRuns=new Set,this.basePath=``,this.popStateHandler=()=>wO(this),this.topbarObserver=null,this.globalKeydownHandler=e=>{(e.metaKey||e.ctrlKey)&&!e.shiftKey&&e.key===`k`&&(e.preventDefault(),this.paletteOpen=!this.paletteOpen,this.paletteOpen&&(this.paletteQuery=``,this.paletteActiveIndex=0))},this.canvasAgentRunMessageHandler=e=>{GI(this,e)},this.mcpOAuthMessageHandler=e=>{let t=e.data;if(!t)return;let n=typeof window<`u`&&window.location?window.location.origin:``;if($I({origin:e.origin,source:e.source,expectedOrigin:n,popup:this.mcpOAuthPopup,dataSource:t.source}))if(t.type===`mcp-oauth-callback`){if(this.mcpOAuthPopup&&!this.mcpOAuthPopup.closed)try{this.mcpOAuthPopup.close()}catch{}if(this.mcpOAuthPopup=null,!this.mcpOAuthFlow)return;if(t.error){this.mcpMessage={kind:`error`,text:`OAuth failed: ${t.error}`},this.mcpOAuthFlow=null;return}if(!t.code||!t.state){this.mcpMessage={kind:`error`,text:`OAuth callback missing code or state.`},this.mcpOAuthFlow=null;return}Em(this,t.code,t.state)}else t.type===`mcp-oauth-cancelled`&&(Om(this),this.mcpMessage={kind:`error`,text:`Authorization was cancelled.`})},t(this.settings.locale)&&u.setLocale(this.settings.locale)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.onSlashAction=e=>{switch(e){case`toggle-focus`:this.applySettings({...this.settings,chatFocusMode:!this.settings.chatFocusMode});break;case`export`:By(this.chatMessages,this.assistantName);break;case`refresh-tools-effective`:Tf(this);break}},document.addEventListener(`keydown`,this.globalKeydownHandler),window.addEventListener(`message`,this.canvasAgentRunMessageHandler),window.addEventListener(`message`,this.mcpOAuthMessageHandler),_k(this)}firstUpdated(){vk(this)}disconnectedCallback(){document.removeEventListener(`keydown`,this.globalKeydownHandler),window.removeEventListener(`message`,this.canvasAgentRunMessageHandler),window.removeEventListener(`message`,this.mcpOAuthMessageHandler),yk(this),super.disconnectedCallback()}updated(e){if(bk(this,e),!e.has(`sessionKey`)||this.agentsPanel!==`tools`)return;let t=pa(this.sessionKey);if(this.agentsSelectedId&&this.agentsSelectedId===t){Sf(this,{agentId:this.agentsSelectedId,sessionKey:this.sessionKey});return}this.toolsEffectiveResult=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null}connect(){uk(this)}handleChatScroll(e){ri(this,e)}handleLogsScroll(e){ii(this,e)}exportLogs(e,t){oi(e,t)}resetToolStream(){Ai(this)}resetChatScroll(){ai(this)}scrollToBottom(e){ai(this),ti(this,!0,!!e?.smooth)}async loadAssistantIdentity(){await zO(this)}applySettings(e){aO(this,e)}applyLocalUserIdentity(e){oO(this,e)}setTab(e){uO(this,e),this.navDrawerOpen=!1}setTheme(e,t){fO(this,e,t),this.themeOrder=this.buildThemeOrder(e)}setThemeMode(e,t){pO(this,e,t)}setBorderRadius(e){aO(this,{...this.settings,borderRadius:e}),this.requestUpdate()}buildThemeOrder(e){return[e,...[...kh].filter(t=>t!==e)]}async loadOverview(e){await AO(this,e)}async loadCron(){await IO(this)}async handleAbortChat(){await Gu(this)}removeQueuedMessage(e){Qu(this,e)}async handleSendChat(e,t){await ed(this,e,t)}async toggleRealtimeTalk(){if(this.realtimeTalkSession){this.realtimeTalkSession.stop(),this.realtimeTalkSession=null,this.realtimeTalkActive=!1,this.realtimeTalkStatus=`idle`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null;return}if(!this.client||!this.connected){this.lastError=`Gateway not connected`;return}this.realtimeTalkActive=!0,this.realtimeTalkStatus=`connecting`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null;let e=new QI(this.client,this.sessionKey,{onStatus:(e,t)=>{this.realtimeTalkStatus=e,this.realtimeTalkDetail=t??null,(e===`idle`||e===`error`)&&(this.realtimeTalkActive=e!==`idle`)},onTranscript:e=>{this.realtimeTalkTranscript=`${e.role===`user`?`You`:`Genesis`}: ${e.text}`}});this.realtimeTalkSession=e;try{await e.start()}catch(t){e.stop(),this.realtimeTalkSession===e&&(this.realtimeTalkSession=null),this.realtimeTalkActive=!1,this.realtimeTalkStatus=`error`,this.realtimeTalkDetail=t instanceof Error?t.message:String(t),this.lastError=this.realtimeTalkDetail}}async steerQueuedChatMessage(e){await Xu(this,e)}async handleWhatsAppStart(e){await Ar(this,e)}async handleWhatsAppWait(){await jr(this)}async handleWhatsAppLogout(){await Mr(this)}async handleChannelConfigSave(){await Nr(this)}async handleChannelConfigReload(){await Pr(this)}async handleChannelWizardStart(){await Lr(this)}async handleChannelWizardSubmit(){await zr(this)}async handleChannelWizardCancel(){await Br(this)}handleChannelWizardInput(e){Rr(this,e)}handleChannelWizardClose(){Vr(this)}async handleModelProviderWizardStart(){await wk(this)}async handleModelProviderWizardSubmit(){await Ek(this)}async handleModelProviderWizardCancel(){await Dk(this)}handleModelProviderWizardInput(e){Tk(this,e)}handleModelProviderWizardClose(){Ok(this)}handleNostrProfileEdit(e,t){Kr(this,e,t)}handleNostrProfileCancel(){qr(this)}handleNostrProfileFieldChange(e,t){Jr(this,e,t)}async handleNostrProfileSave(){await Xr(this)}async handleNostrProfileImport(){await Zr(this)}handleNostrProfileToggleAdvanced(){Yr(this)}async handleExecApprovalDecision(e){let t=this.execApprovalQueue[0];if(!(!t||!this.client||this.execApprovalBusy)){this.execApprovalBusy=!0,this.execApprovalError=null;try{let n=t.kind===`plugin`?`plugin.approval.resolve`:`exec.approval.resolve`;await this.client.request(n,{id:t.id,decision:e}),this.execApprovalQueue=this.execApprovalQueue.filter(e=>e.id!==t.id)}catch(e){this.execApprovalError=`Approval failed: ${String(e)}`}finally{this.execApprovalBusy=!1}}}handleGatewayUrlConfirm(){let e=this.pendingGatewayUrl;if(!e)return;let t=this.pendingGatewayToken?.trim()||``;this.pendingGatewayUrl=null,this.pendingGatewayToken=null,aO(this,{...this.settings,gatewayUrl:e,token:t}),this.connect()}handleGatewayUrlCancel(){this.pendingGatewayUrl=null,this.pendingGatewayToken=null}handleOpenSidebar(e){this.sidebarCloseTimer!=null&&(window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=null),this.sidebarContent=e,this.sidebarError=null,this.sidebarOpen=!0}handleCloseSidebar(){this.sidebarOpen=!1,this.sidebarCloseTimer!=null&&window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=window.setTimeout(()=>{this.sidebarOpen||(this.sidebarContent=null,this.sidebarError=null,this.sidebarCloseTimer=null)},200)}handleSplitRatioChange(e){let t=Math.max(.4,Math.min(.7,e));this.splitRatio=t,this.applySettings({...this.settings,splitRatio:t})}render(){return LI(this)}};X([F()],$.prototype,`settings`,void 0),X([F()],$.prototype,`password`,void 0),X([F()],$.prototype,`loginShowGatewayToken`,void 0),X([F()],$.prototype,`loginShowGatewayPassword`,void 0),X([F()],$.prototype,`tab`,void 0),X([F()],$.prototype,`onboarding`,void 0),X([F()],$.prototype,`connected`,void 0),X([F()],$.prototype,`theme`,void 0),X([F()],$.prototype,`themeMode`,void 0),X([F()],$.prototype,`themeResolved`,void 0),X([F()],$.prototype,`themeOrder`,void 0),X([F()],$.prototype,`hello`,void 0),X([F()],$.prototype,`lastError`,void 0),X([F()],$.prototype,`lastErrorCode`,void 0),X([F()],$.prototype,`eventLog`,void 0),X([F()],$.prototype,`assistantName`,void 0),X([F()],$.prototype,`assistantAvatar`,void 0),X([F()],$.prototype,`assistantAgentId`,void 0),X([F()],$.prototype,`userName`,void 0),X([F()],$.prototype,`userAvatar`,void 0),X([F()],$.prototype,`localMediaPreviewRoots`,void 0),X([F()],$.prototype,`embedSandboxMode`,void 0),X([F()],$.prototype,`allowExternalEmbedUrls`,void 0),X([F()],$.prototype,`serverVersion`,void 0),X([F()],$.prototype,`sessionKey`,void 0),X([F()],$.prototype,`chatLoading`,void 0),X([F()],$.prototype,`chatSending`,void 0),X([F()],$.prototype,`chatMessage`,void 0),X([F()],$.prototype,`chatMessages`,void 0),X([F()],$.prototype,`chatToolMessages`,void 0),X([F()],$.prototype,`chatStreamSegments`,void 0),X([F()],$.prototype,`chatStream`,void 0),X([F()],$.prototype,`chatStreamStartedAt`,void 0),X([F()],$.prototype,`chatRunId`,void 0),X([F()],$.prototype,`chatSideResult`,void 0),X([F()],$.prototype,`compactionStatus`,void 0),X([F()],$.prototype,`fallbackStatus`,void 0),X([F()],$.prototype,`chatAvatarUrl`,void 0),X([F()],$.prototype,`chatThinkingLevel`,void 0),X([F()],$.prototype,`chatModelOverrides`,void 0),X([F()],$.prototype,`chatModelsLoading`,void 0),X([F()],$.prototype,`chatModelCatalog`,void 0),X([F()],$.prototype,`modelsPanel`,void 0),X([F()],$.prototype,`modelsLoading`,void 0),X([F()],$.prototype,`memoryEntries`,void 0),X([F()],$.prototype,`memoryLoading`,void 0),X([F()],$.prototype,`memoryError`,void 0),X([F()],$.prototype,`chatQueue`,void 0),X([F()],$.prototype,`chatAttachments`,void 0),X([F()],$.prototype,`realtimeTalkActive`,void 0),X([F()],$.prototype,`realtimeTalkStatus`,void 0),X([F()],$.prototype,`realtimeTalkDetail`,void 0),X([F()],$.prototype,`realtimeTalkTranscript`,void 0),X([F()],$.prototype,`chatManualRefreshInFlight`,void 0),X([F()],$.prototype,`navDrawerOpen`,void 0),X([F()],$.prototype,`sidebarOpen`,void 0),X([F()],$.prototype,`sidebarContent`,void 0),X([F()],$.prototype,`sidebarError`,void 0),X([F()],$.prototype,`splitRatio`,void 0),X([F()],$.prototype,`nodesLoading`,void 0),X([F()],$.prototype,`nodes`,void 0),X([F()],$.prototype,`nodeManagementSelectedId`,void 0),X([F()],$.prototype,`nodeManagementRename`,void 0),X([F()],$.prototype,`nodeManagementCommand`,void 0),X([F()],$.prototype,`nodeManagementParams`,void 0),X([F()],$.prototype,`nodeManagementShell`,void 0),X([F()],$.prototype,`nodeManagementCwd`,void 0),X([F()],$.prototype,`nodeManagementTimeoutMs`,void 0),X([F()],$.prototype,`nodeManagementBusy`,void 0),X([F()],$.prototype,`nodeManagementError`,void 0),X([F()],$.prototype,`nodeManagementResult`,void 0),X([F()],$.prototype,`devicesLoading`,void 0),X([F()],$.prototype,`devicesError`,void 0),X([F()],$.prototype,`devicesList`,void 0),X([F()],$.prototype,`execApprovalsLoading`,void 0),X([F()],$.prototype,`execApprovalsSaving`,void 0),X([F()],$.prototype,`execApprovalsDirty`,void 0),X([F()],$.prototype,`execApprovalsSnapshot`,void 0),X([F()],$.prototype,`execApprovalsForm`,void 0),X([F()],$.prototype,`execApprovalsSelectedAgent`,void 0),X([F()],$.prototype,`execApprovalsTarget`,void 0),X([F()],$.prototype,`execApprovalsTargetNodeId`,void 0),X([F()],$.prototype,`execApprovalQueue`,void 0),X([F()],$.prototype,`execApprovalBusy`,void 0),X([F()],$.prototype,`execApprovalError`,void 0),X([F()],$.prototype,`pendingGatewayUrl`,void 0),X([F()],$.prototype,`configLoading`,void 0),X([F()],$.prototype,`configRaw`,void 0),X([F()],$.prototype,`configRawOriginal`,void 0),X([F()],$.prototype,`configValid`,void 0),X([F()],$.prototype,`configIssues`,void 0),X([F()],$.prototype,`configSaving`,void 0),X([F()],$.prototype,`configApplying`,void 0),X([F()],$.prototype,`updateRunning`,void 0),X([F()],$.prototype,`applySessionKey`,void 0),X([F()],$.prototype,`configSnapshot`,void 0),X([F()],$.prototype,`configSchema`,void 0),X([F()],$.prototype,`configSchemaVersion`,void 0),X([F()],$.prototype,`configSchemaLoading`,void 0),X([F()],$.prototype,`configUiHints`,void 0),X([F()],$.prototype,`configForm`,void 0),X([F()],$.prototype,`configFormOriginal`,void 0),X([F()],$.prototype,`configRestartPrompt`,void 0),X([F()],$.prototype,`dreamingStatusLoading`,void 0),X([F()],$.prototype,`dreamingStatusError`,void 0),X([F()],$.prototype,`dreamingStatus`,void 0),X([F()],$.prototype,`dreamingModeSaving`,void 0),X([F()],$.prototype,`dreamDiaryLoading`,void 0),X([F()],$.prototype,`dreamDiaryActionLoading`,void 0),X([F()],$.prototype,`dreamDiaryActionMessage`,void 0),X([F()],$.prototype,`dreamDiaryActionArchivePath`,void 0),X([F()],$.prototype,`dreamDiaryError`,void 0),X([F()],$.prototype,`dreamDiaryPath`,void 0),X([F()],$.prototype,`dreamDiaryContent`,void 0),X([F()],$.prototype,`wikiImportInsightsLoading`,void 0),X([F()],$.prototype,`wikiImportInsightsError`,void 0),X([F()],$.prototype,`wikiImportInsights`,void 0),X([F()],$.prototype,`wikiMemoryPalaceLoading`,void 0),X([F()],$.prototype,`wikiMemoryPalaceError`,void 0),X([F()],$.prototype,`wikiMemoryPalace`,void 0),X([F()],$.prototype,`configFormDirty`,void 0),X([F()],$.prototype,`configSettingsMode`,void 0),X([F()],$.prototype,`configFormMode`,void 0),X([F()],$.prototype,`configSearchQuery`,void 0),X([F()],$.prototype,`configActiveSection`,void 0),X([F()],$.prototype,`configActiveSubsection`,void 0),X([F()],$.prototype,`communicationsFormMode`,void 0),X([F()],$.prototype,`communicationsSearchQuery`,void 0),X([F()],$.prototype,`communicationsActiveSection`,void 0),X([F()],$.prototype,`communicationsActiveSubsection`,void 0),X([F()],$.prototype,`appearanceFormMode`,void 0),X([F()],$.prototype,`appearanceSearchQuery`,void 0),X([F()],$.prototype,`appearanceActiveSection`,void 0),X([F()],$.prototype,`appearanceActiveSubsection`,void 0),X([F()],$.prototype,`automationFormMode`,void 0),X([F()],$.prototype,`automationSearchQuery`,void 0),X([F()],$.prototype,`automationActiveSection`,void 0),X([F()],$.prototype,`automationActiveSubsection`,void 0),X([F()],$.prototype,`infrastructureFormMode`,void 0),X([F()],$.prototype,`infrastructureSearchQuery`,void 0),X([F()],$.prototype,`infrastructureActiveSection`,void 0),X([F()],$.prototype,`infrastructureActiveSubsection`,void 0),X([F()],$.prototype,`aiAgentsFormMode`,void 0),X([F()],$.prototype,`aiAgentsSearchQuery`,void 0),X([F()],$.prototype,`aiAgentsActiveSection`,void 0),X([F()],$.prototype,`aiAgentsActiveSubsection`,void 0),X([F()],$.prototype,`channelsLoading`,void 0),X([F()],$.prototype,`channelsSnapshot`,void 0),X([F()],$.prototype,`channelsError`,void 0),X([F()],$.prototype,`channelsLastSuccess`,void 0),X([F()],$.prototype,`whatsappLoginMessage`,void 0),X([F()],$.prototype,`whatsappLoginQrDataUrl`,void 0),X([F()],$.prototype,`whatsappLoginConnected`,void 0),X([F()],$.prototype,`whatsappBusy`,void 0),X([F()],$.prototype,`nostrProfileFormState`,void 0),X([F()],$.prototype,`nostrProfileAccountId`,void 0),X([F()],$.prototype,`channelWizardSessionId`,void 0),X([F()],$.prototype,`channelWizardStep`,void 0),X([F()],$.prototype,`channelWizardInput`,void 0),X([F()],$.prototype,`channelWizardBusy`,void 0),X([F()],$.prototype,`channelWizardError`,void 0),X([F()],$.prototype,`channelWizardMessage`,void 0),X([F()],$.prototype,`modelProviderWizardSessionId`,void 0),X([F()],$.prototype,`modelProviderWizardStep`,void 0),X([F()],$.prototype,`modelProviderWizardInput`,void 0),X([F()],$.prototype,`modelProviderWizardBusy`,void 0),X([F()],$.prototype,`modelProviderWizardError`,void 0),X([F()],$.prototype,`modelProviderWizardMessage`,void 0),X([F()],$.prototype,`presenceLoading`,void 0),X([F()],$.prototype,`presenceEntries`,void 0),X([F()],$.prototype,`presenceError`,void 0),X([F()],$.prototype,`presenceStatus`,void 0),X([F()],$.prototype,`agentsLoading`,void 0),X([F()],$.prototype,`agentsList`,void 0),X([F()],$.prototype,`agentsError`,void 0),X([F()],$.prototype,`agentsSelectedId`,void 0),X([F()],$.prototype,`toolsCatalogLoading`,void 0),X([F()],$.prototype,`toolsCatalogError`,void 0),X([F()],$.prototype,`toolsCatalogResult`,void 0),X([F()],$.prototype,`toolsEffectiveLoading`,void 0),X([F()],$.prototype,`toolsEffectiveLoadingKey`,void 0),X([F()],$.prototype,`toolsEffectiveResultKey`,void 0),X([F()],$.prototype,`toolsEffectiveError`,void 0),X([F()],$.prototype,`toolsEffectiveResult`,void 0),X([F()],$.prototype,`agentsPanel`,void 0),X([F()],$.prototype,`agentFilesLoading`,void 0),X([F()],$.prototype,`agentFilesError`,void 0),X([F()],$.prototype,`agentFilesList`,void 0),X([F()],$.prototype,`agentFileContents`,void 0),X([F()],$.prototype,`agentFileDrafts`,void 0),X([F()],$.prototype,`agentFileActive`,void 0),X([F()],$.prototype,`agentFileSaving`,void 0),X([F()],$.prototype,`agentIdentityLoading`,void 0),X([F()],$.prototype,`agentIdentityError`,void 0),X([F()],$.prototype,`agentIdentityById`,void 0),X([F()],$.prototype,`agentSkillsLoading`,void 0),X([F()],$.prototype,`agentSkillsError`,void 0),X([F()],$.prototype,`agentSkillsReport`,void 0),X([F()],$.prototype,`agentSkillsAgentId`,void 0),X([F()],$.prototype,`mcpServersLoading`,void 0),X([F()],$.prototype,`mcpServers`,void 0),X([F()],$.prototype,`mcpServersPath`,void 0),X([F()],$.prototype,`mcpServersError`,void 0),X([F()],$.prototype,`mcpBusy`,void 0),X([F()],$.prototype,`mcpMessage`,void 0),X([F()],$.prototype,`mcpDraftName`,void 0),X([F()],$.prototype,`mcpDraftConfig`,void 0),X([F()],$.prototype,`mcpAddMode`,void 0),X([F()],$.prototype,`mcpAuthToken`,void 0),X([F()],$.prototype,`mcpPresetId`,void 0),X([F()],$.prototype,`mcpLinkUrl`,void 0),X([F()],$.prototype,`mcpLinkMetadataLoading`,void 0),X([F()],$.prototype,`mcpLinkMetadataError`,void 0),X([F()],$.prototype,`mcpLinkMetadata`,void 0),X([F()],$.prototype,`mcpOAuthStatus`,void 0),X([F()],$.prototype,`mcpOAuthFlow`,void 0),X([F()],$.prototype,`mcpOAuthPopup`,void 0),X([F()],$.prototype,`mcpTestStatus`,void 0),X([F()],$.prototype,`sessionsLoading`,void 0),X([F()],$.prototype,`sessionsResult`,void 0),X([F()],$.prototype,`sessionsError`,void 0),X([F()],$.prototype,`sessionsFilterActive`,void 0),X([F()],$.prototype,`sessionsFilterLimit`,void 0),X([F()],$.prototype,`sessionsIncludeGlobal`,void 0),X([F()],$.prototype,`sessionsIncludeUnknown`,void 0),X([F()],$.prototype,`sessionsHideCron`,void 0),X([F()],$.prototype,`sessionsSearchQuery`,void 0),X([F()],$.prototype,`sessionsSortColumn`,void 0),X([F()],$.prototype,`sessionsSortDir`,void 0),X([F()],$.prototype,`sessionsPage`,void 0),X([F()],$.prototype,`sessionsPageSize`,void 0),X([F()],$.prototype,`sessionsSelectedKeys`,void 0),X([F()],$.prototype,`sessionsExpandedCheckpointKey`,void 0),X([F()],$.prototype,`sessionsCheckpointItemsByKey`,void 0),X([F()],$.prototype,`sessionsCheckpointLoadingKey`,void 0),X([F()],$.prototype,`sessionsCheckpointBusyKey`,void 0),X([F()],$.prototype,`sessionsCheckpointErrorByKey`,void 0),X([F()],$.prototype,`usageLoading`,void 0),X([F()],$.prototype,`usageResult`,void 0),X([F()],$.prototype,`usageCostSummary`,void 0),X([F()],$.prototype,`usageError`,void 0),X([F()],$.prototype,`usageStartDate`,void 0),X([F()],$.prototype,`usageEndDate`,void 0),X([F()],$.prototype,`usageSelectedSessions`,void 0),X([F()],$.prototype,`usageSelectedDays`,void 0),X([F()],$.prototype,`usageSelectedHours`,void 0),X([F()],$.prototype,`usageChartMode`,void 0),X([F()],$.prototype,`usageDailyChartMode`,void 0),X([F()],$.prototype,`usageTimeSeriesMode`,void 0),X([F()],$.prototype,`usageTimeSeriesBreakdownMode`,void 0),X([F()],$.prototype,`usageTimeSeries`,void 0),X([F()],$.prototype,`usageTimeSeriesLoading`,void 0),X([F()],$.prototype,`usageTimeSeriesCursorStart`,void 0),X([F()],$.prototype,`usageTimeSeriesCursorEnd`,void 0),X([F()],$.prototype,`usageSessionLogs`,void 0),X([F()],$.prototype,`usageSessionLogsLoading`,void 0),X([F()],$.prototype,`usageSessionLogsExpanded`,void 0),X([F()],$.prototype,`usageQuery`,void 0),X([F()],$.prototype,`usageQueryDraft`,void 0),X([F()],$.prototype,`usageSessionSort`,void 0),X([F()],$.prototype,`usageSessionSortDir`,void 0),X([F()],$.prototype,`usageRecentSessions`,void 0),X([F()],$.prototype,`usageTimeZone`,void 0),X([F()],$.prototype,`usageContextExpanded`,void 0),X([F()],$.prototype,`usageHeaderPinned`,void 0),X([F()],$.prototype,`usageSessionsTab`,void 0),X([F()],$.prototype,`usageVisibleColumns`,void 0),X([F()],$.prototype,`usageLogFilterRoles`,void 0),X([F()],$.prototype,`usageLogFilterTools`,void 0),X([F()],$.prototype,`usageLogFilterHasTools`,void 0),X([F()],$.prototype,`usageLogFilterQuery`,void 0),X([F()],$.prototype,`cronLoading`,void 0),X([F()],$.prototype,`cronQuickCreateOpen`,void 0),X([F()],$.prototype,`cronQuickCreateStep`,void 0),X([F()],$.prototype,`cronQuickCreateDraft`,void 0),X([F()],$.prototype,`cronJobsLoadingMore`,void 0),X([F()],$.prototype,`cronJobs`,void 0),X([F()],$.prototype,`cronJobsTotal`,void 0),X([F()],$.prototype,`cronJobsHasMore`,void 0),X([F()],$.prototype,`cronJobsNextOffset`,void 0),X([F()],$.prototype,`cronJobsLimit`,void 0),X([F()],$.prototype,`cronJobsQuery`,void 0),X([F()],$.prototype,`cronJobsEnabledFilter`,void 0),X([F()],$.prototype,`cronJobsScheduleKindFilter`,void 0),X([F()],$.prototype,`cronJobsLastStatusFilter`,void 0),X([F()],$.prototype,`cronJobsSortBy`,void 0),X([F()],$.prototype,`cronJobsSortDir`,void 0),X([F()],$.prototype,`cronStatus`,void 0),X([F()],$.prototype,`cronError`,void 0),X([F()],$.prototype,`cronForm`,void 0),X([F()],$.prototype,`cronFieldErrors`,void 0),X([F()],$.prototype,`cronEditingJobId`,void 0),X([F()],$.prototype,`cronRunsJobId`,void 0),X([F()],$.prototype,`cronRunsLoadingMore`,void 0),X([F()],$.prototype,`cronRuns`,void 0),X([F()],$.prototype,`cronRunsTotal`,void 0),X([F()],$.prototype,`cronRunsHasMore`,void 0),X([F()],$.prototype,`cronRunsNextOffset`,void 0),X([F()],$.prototype,`cronRunsLimit`,void 0),X([F()],$.prototype,`cronRunsScope`,void 0),X([F()],$.prototype,`cronRunsStatuses`,void 0),X([F()],$.prototype,`cronRunsDeliveryStatuses`,void 0),X([F()],$.prototype,`cronRunsStatusFilter`,void 0),X([F()],$.prototype,`cronRunsQuery`,void 0),X([F()],$.prototype,`cronRunsSortDir`,void 0),X([F()],$.prototype,`cronModelSuggestions`,void 0),X([F()],$.prototype,`cronBusy`,void 0),X([F()],$.prototype,`updateAvailable`,void 0),X([F()],$.prototype,`attentionItems`,void 0),X([F()],$.prototype,`paletteOpen`,void 0),X([F()],$.prototype,`paletteQuery`,void 0),X([F()],$.prototype,`paletteActiveIndex`,void 0),X([F()],$.prototype,`overviewShowGatewayToken`,void 0),X([F()],$.prototype,`overviewShowGatewayPassword`,void 0),X([F()],$.prototype,`overviewLogLines`,void 0),X([F()],$.prototype,`overviewLogCursor`,void 0),X([F()],$.prototype,`walletSummary`,void 0),X([F()],$.prototype,`walletSummaryError`,void 0),X([F()],$.prototype,`walletSummaryLoading`,void 0),X([F()],$.prototype,`walletBalancesLoading`,void 0),X([F()],$.prototype,`walletLastUpdatedAt`,void 0),X([F()],$.prototype,`walletRecoveryPhraseMode`,void 0),X([F()],$.prototype,`walletRecoveryPhraseBusy`,void 0),X([F()],$.prototype,`walletRecoveryPhraseError`,void 0),X([F()],$.prototype,`walletRecoveryPhraseGeneratedMnemonic`,void 0),X([F()],$.prototype,`walletRecoveryPhraseStatus`,void 0),X([F()],$.prototype,`skillsLoading`,void 0),X([F()],$.prototype,`skillsReport`,void 0),X([F()],$.prototype,`skillsError`,void 0),X([F()],$.prototype,`skillsFilter`,void 0),X([F()],$.prototype,`skillsStatusFilter`,void 0),X([F()],$.prototype,`skillEdits`,void 0),X([F()],$.prototype,`skillsBusyKey`,void 0),X([F()],$.prototype,`skillMessages`,void 0),X([F()],$.prototype,`skillsDetailKey`,void 0),X([F()],$.prototype,`clawhubSearchQuery`,void 0),X([F()],$.prototype,`clawhubSearchResults`,void 0),X([F()],$.prototype,`clawhubSearchLoading`,void 0),X([F()],$.prototype,`clawhubSearchError`,void 0),X([F()],$.prototype,`clawhubDetail`,void 0),X([F()],$.prototype,`clawhubDetailSlug`,void 0),X([F()],$.prototype,`clawhubDetailLoading`,void 0),X([F()],$.prototype,`clawhubDetailError`,void 0),X([F()],$.prototype,`clawhubInstallSlug`,void 0),X([F()],$.prototype,`clawhubInstallMessage`,void 0),X([F()],$.prototype,`pluginsLoading`,void 0),X([F()],$.prototype,`pluginsReport`,void 0),X([F()],$.prototype,`pluginsError`,void 0),X([F()],$.prototype,`pluginsFilter`,void 0),X([F()],$.prototype,`pluginsStatusFilter`,void 0),X([F()],$.prototype,`pluginsBusyKey`,void 0),X([F()],$.prototype,`pluginMessages`,void 0),X([F()],$.prototype,`pluginDetailKey`,void 0),X([F()],$.prototype,`pluginClawhubSearchQuery`,void 0),X([F()],$.prototype,`pluginClawhubSearchResults`,void 0),X([F()],$.prototype,`pluginClawhubSearchLoading`,void 0),X([F()],$.prototype,`pluginClawhubSearchError`,void 0),X([F()],$.prototype,`pluginClawhubDetail`,void 0),X([F()],$.prototype,`pluginClawhubDetailName`,void 0),X([F()],$.prototype,`pluginClawhubDetailLoading`,void 0),X([F()],$.prototype,`pluginClawhubDetailError`,void 0),X([F()],$.prototype,`pluginClawhubInstallName`,void 0),X([F()],$.prototype,`pluginClawhubInstallMessage`,void 0),X([F()],$.prototype,`healthLoading`,void 0),X([F()],$.prototype,`healthResult`,void 0),X([F()],$.prototype,`healthError`,void 0),X([F()],$.prototype,`modelAuthStatusLoading`,void 0),X([F()],$.prototype,`modelAuthStatusResult`,void 0),X([F()],$.prototype,`modelAuthStatusError`,void 0),X([F()],$.prototype,`debugLoading`,void 0),X([F()],$.prototype,`debugStatus`,void 0),X([F()],$.prototype,`debugHealth`,void 0),X([F()],$.prototype,`debugModels`,void 0),X([F()],$.prototype,`debugHeartbeat`,void 0),X([F()],$.prototype,`debugCallMethod`,void 0),X([F()],$.prototype,`debugCallParams`,void 0),X([F()],$.prototype,`debugCallResult`,void 0),X([F()],$.prototype,`debugCallError`,void 0),X([F()],$.prototype,`logsLoading`,void 0),X([F()],$.prototype,`logsError`,void 0),X([F()],$.prototype,`logsFile`,void 0),X([F()],$.prototype,`logsEntries`,void 0),X([F()],$.prototype,`logsFilterText`,void 0),X([F()],$.prototype,`logsLevelFilters`,void 0),X([F()],$.prototype,`logsAutoFollow`,void 0),X([F()],$.prototype,`logsTruncated`,void 0),X([F()],$.prototype,`logsCursor`,void 0),X([F()],$.prototype,`logsLastFetchAt`,void 0),X([F()],$.prototype,`logsLimit`,void 0),X([F()],$.prototype,`logsMaxBytes`,void 0),X([F()],$.prototype,`logsAtBottom`,void 0),X([F()],$.prototype,`chatNewMessagesBelow`,void 0),$=X([M(`genesis-app`)],$);export{Cu as A,Dn as B,Ru as C,Mu as D,wu as E,ou as F,tn as H,Kl as I,Xa as L,Bu as M,pu as N,xu as O,fu as P,ga as R,Pu as S,mu as T,Ie as U,fn as V,ke as W,ev as _,lF as a,bu as b,nF as c,Hj as d,Uj as f,J as g,Uy as h,dF as i,Tu as j,Eu as k,oN as l,cx as m,pF as n,cF as o,zT as p,fF as r,uF as s,mF as t,WM as u,$_ as v,zu as w,Su as x,zg as y,Or as z};
6247
+ //# sourceMappingURL=index-DTwo_TE_.js.map