@hybridaione/hybridclaw 0.27.2 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +16 -12
  3. package/config.example.json +6 -0
  4. package/console/dist/assets/apps-C1v9uVsi.css +1 -0
  5. package/console/dist/assets/apps-zKDO-H6v.js +1 -0
  6. package/console/dist/assets/chat-BdYrPyYT.js +4 -0
  7. package/console/dist/assets/chat-sidebar-HHXRwhq-.js +5 -0
  8. package/console/dist/assets/{index-B7ZQvYLH.js → index-B90akSlV.js} +38 -37
  9. package/console/dist/assets/index-DV7JemOI.css +1 -0
  10. package/console/dist/assets/{terminal-CJP-btmG.js → terminal-DW6yIbMu.js} +1 -1
  11. package/console/dist/index.html +2 -2
  12. package/console/package.json +1 -1
  13. package/container/npm-shrinkwrap.json +2 -2
  14. package/container/package-lock.json +2 -2
  15. package/container/package.json +1 -1
  16. package/dist/a2a/a2a-inbound.d.ts.map +1 -1
  17. package/dist/a2a/a2a-inbound.js +23 -27
  18. package/dist/a2a/a2a-inbound.js.map +1 -1
  19. package/dist/a2a/a2a-inbox-dispatch-store.d.ts +47 -0
  20. package/dist/a2a/a2a-inbox-dispatch-store.d.ts.map +1 -0
  21. package/dist/a2a/a2a-inbox-dispatch-store.js +175 -0
  22. package/dist/a2a/a2a-inbox-dispatch-store.js.map +1 -0
  23. package/dist/a2a/a2a-inbox-dispatcher.d.ts +49 -0
  24. package/dist/a2a/a2a-inbox-dispatcher.d.ts.map +1 -0
  25. package/dist/a2a/a2a-inbox-dispatcher.js +456 -0
  26. package/dist/a2a/a2a-inbox-dispatcher.js.map +1 -0
  27. package/dist/a2a/a2a-outbox-persistence.d.ts +16 -0
  28. package/dist/a2a/a2a-outbox-persistence.d.ts.map +1 -1
  29. package/dist/a2a/a2a-outbox-persistence.js +25 -0
  30. package/dist/a2a/a2a-outbox-persistence.js.map +1 -1
  31. package/dist/a2a/identity-resolver.d.ts.map +1 -1
  32. package/dist/a2a/identity-resolver.js +2 -4
  33. package/dist/a2a/identity-resolver.js.map +1 -1
  34. package/dist/a2a/identity.d.ts +2 -0
  35. package/dist/a2a/identity.d.ts.map +1 -1
  36. package/dist/a2a/identity.js +38 -0
  37. package/dist/a2a/identity.js.map +1 -1
  38. package/dist/a2a/runtime.d.ts.map +1 -1
  39. package/dist/a2a/runtime.js +11 -4
  40. package/dist/a2a/runtime.js.map +1 -1
  41. package/dist/a2a/webhook-inbound.d.ts.map +1 -1
  42. package/dist/a2a/webhook-inbound.js +6 -39
  43. package/dist/a2a/webhook-inbound.js.map +1 -1
  44. package/dist/agent/delegation-manager.d.ts +1 -1
  45. package/dist/agent/delegation-manager.d.ts.map +1 -1
  46. package/dist/agent/delegation-manager.js +2 -1
  47. package/dist/agent/delegation-manager.js.map +1 -1
  48. package/dist/audit/audit-trail.js +2 -2
  49. package/dist/audit/audit-trail.js.map +1 -1
  50. package/dist/cli/help.d.ts +1 -0
  51. package/dist/cli/help.d.ts.map +1 -1
  52. package/dist/cli/help.js +22 -0
  53. package/dist/cli/help.js.map +1 -1
  54. package/dist/cli/token-command.d.ts +2 -0
  55. package/dist/cli/token-command.d.ts.map +1 -0
  56. package/dist/cli/token-command.js +149 -0
  57. package/dist/cli/token-command.js.map +1 -0
  58. package/dist/cli.d.ts.map +1 -1
  59. package/dist/cli.js +7 -0
  60. package/dist/cli.js.map +1 -1
  61. package/dist/config/config.d.ts +2 -0
  62. package/dist/config/config.d.ts.map +1 -1
  63. package/dist/config/config.js +4 -0
  64. package/dist/config/config.js.map +1 -1
  65. package/dist/config/runtime-config.d.ts +10 -0
  66. package/dist/config/runtime-config.d.ts.map +1 -1
  67. package/dist/config/runtime-config.js +56 -2
  68. package/dist/config/runtime-config.js.map +1 -1
  69. package/dist/gateway/a2a-inbox-dispatch.d.ts +3 -0
  70. package/dist/gateway/a2a-inbox-dispatch.d.ts.map +1 -0
  71. package/dist/gateway/a2a-inbox-dispatch.js +68 -0
  72. package/dist/gateway/a2a-inbox-dispatch.js.map +1 -0
  73. package/dist/gateway/gateway-admin-tokens.d.ts +31 -0
  74. package/dist/gateway/gateway-admin-tokens.d.ts.map +1 -0
  75. package/dist/gateway/gateway-admin-tokens.js +128 -0
  76. package/dist/gateway/gateway-admin-tokens.js.map +1 -0
  77. package/dist/gateway/gateway-chat-service.js +46 -11
  78. package/dist/gateway/gateway-chat-service.js.map +1 -1
  79. package/dist/gateway/gateway-http-server.d.ts.map +1 -1
  80. package/dist/gateway/gateway-http-server.js +1878 -78
  81. package/dist/gateway/gateway-http-server.js.map +1 -1
  82. package/dist/gateway/gateway-service.d.ts +10 -2
  83. package/dist/gateway/gateway-service.d.ts.map +1 -1
  84. package/dist/gateway/gateway-service.js +231 -158
  85. package/dist/gateway/gateway-service.js.map +1 -1
  86. package/dist/gateway/gateway-types.d.ts +12 -0
  87. package/dist/gateway/gateway-types.d.ts.map +1 -1
  88. package/dist/gateway/gateway-types.js.map +1 -1
  89. package/dist/gateway/gateway-url-utils.d.ts +14 -0
  90. package/dist/gateway/gateway-url-utils.d.ts.map +1 -1
  91. package/dist/gateway/gateway-url-utils.js +28 -0
  92. package/dist/gateway/gateway-url-utils.js.map +1 -1
  93. package/dist/gateway/gateway.js +12 -2
  94. package/dist/gateway/gateway.js.map +1 -1
  95. package/dist/gateway/msteams-tab.d.ts +36 -0
  96. package/dist/gateway/msteams-tab.d.ts.map +1 -0
  97. package/dist/gateway/msteams-tab.js +116 -0
  98. package/dist/gateway/msteams-tab.js.map +1 -0
  99. package/dist/gateway/openai-compatible-response.d.ts +3 -1
  100. package/dist/gateway/openai-compatible-response.d.ts.map +1 -1
  101. package/dist/gateway/openai-compatible-response.js +6 -3
  102. package/dist/gateway/openai-compatible-response.js.map +1 -1
  103. package/dist/gateway/openai-compatible.d.ts +1 -0
  104. package/dist/gateway/openai-compatible.d.ts.map +1 -1
  105. package/dist/gateway/openai-compatible.js +74 -1
  106. package/dist/gateway/openai-compatible.js.map +1 -1
  107. package/dist/memory/apps.d.ts +1 -0
  108. package/dist/memory/apps.d.ts.map +1 -1
  109. package/dist/memory/apps.js +18 -0
  110. package/dist/memory/apps.js.map +1 -1
  111. package/dist/memory/db.d.ts +44 -1
  112. package/dist/memory/db.d.ts.map +1 -1
  113. package/dist/memory/db.js +194 -2
  114. package/dist/memory/db.js.map +1 -1
  115. package/dist/security/admin-rbac.d.ts +14 -13
  116. package/dist/security/admin-rbac.d.ts.map +1 -1
  117. package/dist/security/admin-rbac.js +77 -0
  118. package/dist/security/admin-rbac.js.map +1 -1
  119. package/dist/security/api-tokens.d.ts +38 -0
  120. package/dist/security/api-tokens.d.ts.map +1 -0
  121. package/dist/security/api-tokens.js +208 -0
  122. package/dist/security/api-tokens.js.map +1 -0
  123. package/dist/security/app-publications.d.ts +64 -0
  124. package/dist/security/app-publications.d.ts.map +1 -0
  125. package/dist/security/app-publications.js +307 -0
  126. package/dist/security/app-publications.js.map +1 -0
  127. package/dist/security/token-verifier.d.ts +3 -0
  128. package/dist/security/token-verifier.d.ts.map +1 -0
  129. package/dist/security/token-verifier.js +49 -0
  130. package/dist/security/token-verifier.js.map +1 -0
  131. package/docs/content/README.md +16 -3
  132. package/docs/content/channels/admin-console.md +8 -0
  133. package/docs/content/developer-guide/admin-access-control.md +7 -0
  134. package/docs/content/guides/README.md +2 -0
  135. package/docs/content/guides/a2a-peer-pairing.md +260 -0
  136. package/docs/content/navigation.json +4 -0
  137. package/docs/content/reference/commands.md +41 -0
  138. package/docs/content/reference/configuration.md +6 -2
  139. package/docs/static/teams-color.png +0 -0
  140. package/docs/static/teams-outline.png +0 -0
  141. package/npm-shrinkwrap.json +6 -5
  142. package/package.json +2 -1
  143. package/console/dist/assets/apps-_oJDy7mi.js +0 -1
  144. package/console/dist/assets/apps-fd_S5yFK.css +0 -1
  145. package/console/dist/assets/chat-DtbW21G6.js +0 -4
  146. package/console/dist/assets/chat-sidebar-ZV6o-A2S.js +0 -5
  147. package/console/dist/assets/index-BIPFwWNZ.css +0 -1
@@ -1,7 +1,7 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/terminal-CJP-btmG.js","assets/rolldown-runtime-Bh1tDfsg.js","assets/query-o_Dd9s85.js","assets/terminal-CCHv1x3w.js","assets/terminal-kHJ-D0s7.css","assets/chat-DtbW21G6.js","assets/chat-sidebar-ZV6o-A2S.js","assets/router-DoNPHesn.js","assets/chat-BBTk0x5Q.css","assets/apps-_oJDy7mi.js","assets/apps-fd_S5yFK.css"])))=>i.map(i=>d[i]);
2
- import{n as e,t}from"./rolldown-runtime-Bh1tDfsg.js";import{t as n}from"./vendor-GuSYcVD5.js";import{C as r,S as i,_ as a,a as o,b as s,c,d as l,f as u,g as d,h as f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S,v as C,x as w,y as T}from"./query-o_Dd9s85.js";import{a as E,c as D,d as O,f as k,i as A,l as j,n as M,o as N,r as P,s as F,t as I,u as ee}from"./router-DoNPHesn.js";(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 L=`hybridclaw-theme`;function te(){if(typeof window>`u`)return`system`;let e=window.localStorage.getItem(L);return e===`light`||e===`dark`||e===`system`?e:`system`}function ne(){return typeof window>`u`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function re(e,t){return e===`system`?t:e}function ie(e){if(typeof document>`u`)return;let t=document.documentElement;t.dataset.theme=e,t.style.colorScheme=e}function ae(){let e=te(),t=re(e,ne());return ie(t),{theme:e,resolved:t}}ae();var oe=class extends i{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new b({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=se(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=se(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=se(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=se(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){S.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>f(t,e))}findAll(e={}){return this.getAll().filter(t=>f(e,t))}notify(e){S.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return S.batch(()=>Promise.all(e.map(e=>e.continue().catch(a))))}};function se(e){return e.options.scope?.id}var ce=class extends i{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??v(r,t),a=this.get(i);return a||(a=new c({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){S.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>d(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>d(e,t)):t}notify(e){S.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){S.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){S.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},le=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ce,this.#t=e.mutationCache||new oe,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=w.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(T(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=l(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return S.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;S.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return S.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=S.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(a).catch(a)}invalidateQueries(e,t={}){return S.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=S.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(a)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(a)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(T(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(a).catch(a)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(a).catch(a)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return m.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(u(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{C(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(u(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{C(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=v(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===s&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},R=e(r(),1),ue=e(n(),1),de=`hybridclaw_token`,fe=`hybridclaw:auth-required`,pe=`__hybridclaw_token_bootstrapped`,me=`hybridclaw_local_auth_reload_at`,he=15e3,ge=()=>window.location.reload();function _e(e,t){let n=e.trim();return{...n?{Authorization:`Bearer ${n}`}:{},...t===void 0?{}:{"Content-Type":`application/json`}}}function ve(e){return{sessionId:e.sessionId,guildId:null,channelId:`web`,args:e.args,...e.userId?{userId:e.userId}:{},...e.username?{username:e.username}:{}}}function ye(e){ke(),!be()&&window.dispatchEvent(new CustomEvent(fe,{detail:{message:e}}))}function be(){if(!xe())return!1;let e=Date.now(),t=Number(window.sessionStorage.getItem(me)||`0`);if(Number.isFinite(t)){let n=e-t;if(n>=0&&n<he)return!1}return window.sessionStorage.setItem(me,String(e)),ge(),!0}function xe(){if(!Se(window.location.hostname))return!1;let e=window.location.pathname;return e===`/admin`||e.startsWith(`/admin/`)||e===`/chat`||e.startsWith(`/chat/`)}function Se(e){let t=e.toLowerCase();return t===`localhost`||t===`::1`||t===`[::1]`||/^127(?:\.\d{1,3}){3}$/.test(t)}async function Ce(e){let t=`${e.status} ${e.statusText}`,n=(await e.text().catch(()=>``)).trim();if(!n)return t;try{let e=JSON.parse(n);return e.error||e.text||n}catch{return n}}var we=class extends Error{status;constructor(e,t){super(e),this.name=`HttpResponseError`,this.status=t}};async function Te(e,t){let n=await Ce(e);throw e.status===401&&t?.onAuthError!==`ignore`&&ye(n),new we(n,e.status)}async function z(e,t){let n=await fetch(e,{method:t.method||`GET`,headers:{..._e(t.token,t.body),...t.extraHeaders},body:t.body===void 0?t.rawBody??void 0:JSON.stringify(t.body)});return n.ok||await Te(n,{onAuthError:t.onAuthError}),await n.json().catch(()=>({}))}function Ee(){return De([`token`,pe]),ke(),``}function De(e){let t=new URL(window.location.href),n=!1;for(let r of e)t.searchParams.has(r)&&(t.searchParams.delete(r),n=!0);n&&window.history.replaceState(window.history.state,``,`${t.pathname}${t.search}${t.hash}`)}function Oe(e){ke()}function ke(){window.sessionStorage.removeItem(de),window.localStorage.removeItem(de)}function Ae(e){return`/api/events`}function je(e){return z(`/api/status`,{token:e,onAuthError:`ignore`})}function Me(){return z(`/health`,{token:``,onAuthError:`ignore`})}function Ne(e){return z(`/api/admin/overview`,{token:e})}function Pe(e){return z(`/api/admin/tunnel`,{token:e})}function Fe(e,t){return z(`/api/admin/tunnel`,{token:e,method:`PUT`,body:t})}async function Ie(e){return(await z(`/api/admin/tunnel/reconnect`,{token:e,method:`POST`})).tunnel}async function Le(e){return(await z(`/api/admin/tunnel/stop`,{token:e,method:`POST`})).tunnel}function Re(e,t){return z(`/api/admin/statistics${typeof t==`number`&&Number.isFinite(t)?`?days=${Math.max(1,Math.floor(t))}`:``}`,{token:e})}function ze(e,t){let n=new URLSearchParams;t?.fileId&&n.set(`file`,t.fileId),t?.tailBytes&&n.set(`tailBytes`,String(t.tailBytes));let r=n.toString();return z(r?`/api/admin/logs?${r}`:`/api/admin/logs`,{token:e})}function Be(e){return z(`/api/admin/a2a/trust`,{token:e})}function Ve(e){return z(`/api/admin/fleet-topology`,{token:e})}function He(e){return z(`/api/admin/distill`,{token:e})}function Ue(e,t){return z(`/api/admin/distill/subjects`,{token:e,method:`POST`,body:t})}function We(e,t){return z(`/api/admin/distill/consent`,{token:e,method:`POST`,body:t})}function Ge(e,t){return z(`/api/admin/distill/register`,{token:e,method:`POST`,body:t})}function Ke(e,t){return z(`/api/admin/distill/runs`,{token:e,method:`POST`,body:t})}function qe(e,t,n){let r=new URLSearchParams({alias:n.alias});return n.agentId?.trim()&&r.set(`agentId`,n.agentId.trim()),n.kind?.trim()&&r.set(`kind`,n.kind.trim()),z(`/api/admin/distill/sources/upload?${r.toString()}`,{token:e,method:`POST`,rawBody:t,extraHeaders:{"Content-Type":t.type||`application/octet-stream`,"X-Hybridclaw-Filename":encodeURIComponent(t.name||`source.txt`)}})}function Je(e){let t=new URLSearchParams({alias:e.alias});return e.agentId?.trim()&&t.set(`agentId`,e.agentId.trim()),`/api/admin/distill/corpus/${encodeURIComponent(e.documentId)}?${t.toString()}`}async function Ye(e,t){let n=await fetch(Je(t),{headers:_e(e),cache:`no-store`});return n.ok||await Te(n),n.blob()}function Xe(e,t){return z(Je(t),{token:e,method:`DELETE`})}function Ze(e,t){return z(`/api/admin/fleet-topology`,{token:e,method:`POST`,body:t})}function Qe(e,t){return z(`/api/admin/fleet-topology?${new URLSearchParams({peerId:t}).toString()}`,{token:e,method:`DELETE`})}function $e(e,t){return z(`/api/admin/a2a/inbox${t?.trim()?`?${new URLSearchParams({threadId:t.trim()}).toString()}`:``}`,{token:e})}function et(e,t){let n=new URLSearchParams({peerId:t.peerId});return t.reason?.trim()&&n.set(`reason`,t.reason.trim()),z(`/api/admin/a2a/trust?${n.toString()}`,{token:e,method:`DELETE`})}function tt(e,t){return z(`/api/admin/a2a/trust`,{token:e,method:`POST`,body:t})}function nt(e,t){return z(`/api/admin/a2a/trust?${new URLSearchParams({peerId:t,action:`delete`}).toString()}`,{token:e,method:`DELETE`})}function rt(e,t){return z(`/api/admin/a2a/pairing`,{token:e,method:`POST`,body:t})}function it(e,t){return z(`/api/admin/a2a/pairing/preview`,{token:e,method:`POST`,body:t})}function at(e,t,n){return z(`/api/admin/a2a/pairing/approve`,{token:e,method:`POST`,body:{requestId:t,...n?.trim()?{reason:n.trim()}:{}}})}function ot(e,t,n){return z(`/api/admin/a2a/pairing/decline`,{token:e,method:`POST`,body:{requestId:t,...n?.trim()?{reason:n.trim()}:{}}})}function st(e){return z(`/api/admin/config/reload`,{token:e,method:`POST`})}function ct(e,t){return z(`/api/admin/terminal`,{token:e,method:`POST`,body:t??{}})}function lt(e,t){return z(`/api/admin/terminal?${new URLSearchParams({sessionId:t}).toString()}`,{token:e,method:`DELETE`})}function ut(e,t){let n=window.location.protocol===`https:`?`wss:`:`ws:`,r=new URL(`/api/admin/terminal/stream`,`${n}//${window.location.host}`);return r.searchParams.set(`sessionId`,t),r.toString()}function dt(e){return z(`/api/agents`,{token:e})}async function ft(e){let t=await z(`/api/agents/list`,{token:e}),n=t.agents.map(e=>({...e,source:{type:`local`}})),r=(t.remotePeers??[]).flatMap(e=>e.agents.map(t=>({...t,source:{type:`remote`,peerId:e.peerId,instanceId:e.instanceId}})));return[...n,...r]}async function pt(e){return(await z(`/api/admin/agents`,{token:e})).agents}async function mt(e,t){let n=new URLSearchParams;t?.trim()&&n.set(`baseUrl`,t.trim());let r=n.toString();return(await z(`/api/admin/hybridai/bots${r?`?${r}`:``}`,{token:e})).bots}async function ht(e,t,n){return(await z(`/api/admin/agents/${encodeURIComponent(t)}`,{token:e,method:`PUT`,body:n})).agent}function gt(e){return z(`/api/admin/team-structure`,{token:e})}function _t(e,t){return z(`/api/admin/team-structure/revisions/${encodeURIComponent(String(t))}`,{token:e})}function vt(e,t){return z(`/api/admin/team-structure/revisions/${encodeURIComponent(String(t))}/restore`,{token:e,method:`POST`})}function yt(e,t){return z(`/api/admin/agents/${encodeURIComponent(t.agentId)}/files/${encodeURIComponent(t.fileName)}`,{token:e})}function bt(e,t){return z(`/api/admin/agents/${encodeURIComponent(t.agentId)}/files/${encodeURIComponent(t.fileName)}`,{token:e,method:`PUT`,body:{content:t.content}})}function xt(e,t){return z(`/api/admin/agents/${encodeURIComponent(t.agentId)}/files/${encodeURIComponent(t.fileName)}/revisions/${encodeURIComponent(t.revisionId)}`,{token:e})}function St(e,t){return z(`/api/admin/agents/${encodeURIComponent(t.agentId)}/files/${encodeURIComponent(t.fileName)}/revisions/${encodeURIComponent(t.revisionId)}/restore`,{token:e,method:`POST`})}function Ct(e){return z(`/api/admin/jobs/context`,{token:e})}function wt(e,t){let n=new URLSearchParams;for(let e of t||[]){let t=e.trim();t&&n.append(`agentId`,t)}let r=n.toString();return z(`/api/admin/jobs/budgets${r?`?${r}`:``}`,{token:e})}async function Tt(e){return(await z(`/api/admin/sessions`,{token:e})).sessions}function Et(e){return z(`/api/admin/email`,{token:e})}function Dt(e,t){let n=new URLSearchParams({folder:t.folder});return typeof t.limit==`number`&&n.set(`limit`,String(t.limit)),typeof t.offset==`number`&&n.set(`offset`,String(t.offset)),z(`/api/admin/email/messages?${n.toString()}`,{token:e})}function Ot(e,t){return z(`/api/admin/email/message?${new URLSearchParams({folder:t.folder,uid:String(t.uid)}).toString()}`,{token:e})}function kt(e,t){return z(`/api/admin/email/message?${new URLSearchParams({folder:t.folder,uid:String(t.uid)}).toString()}`,{token:e,method:`DELETE`})}function At(e,t,n){let r=new URLSearchParams({sessionId:t});return n?.onlyWithoutUserMessages&&r.set(`ifNoUserMessages`,`1`),z(`/api/admin/sessions?${r.toString()}`,{token:e,method:`DELETE`})}function jt(e){return z(`/api/admin/channels`,{token:e})}function Mt(e){return z(`/api/admin/config`,{token:e})}function Nt(e){return z(`/api/admin/browser-pool/health`,{token:e})}function Pt(e){return z(`/api/admin/browser-pool/start`,{method:`POST`,token:e})}function Ft(e,t={}){let n=new URLSearchParams,r=String(t.handleId||``).trim();r&&n.set(`handleId`,r);let i=n.toString();return z(`/api/admin/email-config/fetch${i?`?${i}`:``}`,{token:e})}function It(e,t){return z(`/api/admin/config`,{token:e,method:`PUT`,body:{config:t}})}function Lt(e,t){return z(`/api/admin/slack-webhook-targets`,{token:e,method:`PUT`,body:t})}function Rt(e,t){return z(`/api/admin/discord-webhook-targets`,{token:e,method:`PUT`,body:t})}function zt(e,t){return z(`/api/admin/signal/link`,{token:e,method:`POST`,body:t})}function Bt(e){return z(`/api/admin/signal/link`,{token:e})}function Vt(e,t){return z(`/api/command`,{token:e,method:`POST`,body:ve({sessionId:`web-admin-secrets`,args:t})})}function Ht(e,t,n){return Vt(e,[`secret`,`set`,t,n])}function Ut(e){return z(`/api/admin/secrets`,{token:e})}function Wt(e,t,n){return z(`/api/admin/secrets/${encodeURIComponent(t)}`,{token:e,method:`PUT`,body:{value:n}})}function Gt(e,t){return z(`/api/admin/secrets/${encodeURIComponent(t)}`,{token:e,method:`DELETE`})}function Kt(e){return z(`/api/admin/models`,{token:e})}function qt(e,t){return z(`/api/admin/models`,{token:e,method:`PUT`,body:t})}function Jt(e){return z(`/api/admin/scheduler`,{token:e})}function Yt(e,t){return z(`/api/admin/scheduler`,{token:e,method:`PUT`,body:{job:t}})}function Xt(e,t){return z(`/api/admin/scheduler?${new URLSearchParams(t.source===`task`?{source:`task`,taskId:String(t.taskId??``)}:{jobId:t.id}).toString()}`,{token:e,method:`DELETE`})}function Zt(e,t){return z(`/api/admin/scheduler`,{token:e,method:`POST`,body:t})}function Qt(e,t){return z(`/api/admin/scheduler`,{token:e,method:`POST`,body:{action:`move`,...t}})}function $t(e){return z(`/api/admin/mcp`,{token:e})}function en(e){return z(`/api/admin/connectors`,{token:e})}function tn(e,t){return z(`/api/admin/connectors/hybridai/key`,{token:e,method:`PUT`,body:{apiKey:t}})}function nn(e,t){return z(`/api/admin/connectors/oauth/start`,{token:e,method:`POST`,body:t})}function rn(e,t){return z(`/api/admin/connectors/logout`,{token:e,method:`POST`,body:{provider:t}})}function an(e,t){return z(`/api/admin/connectors/test`,{token:e,method:`POST`,body:{provider:t}})}function on(e,t){return z(`/api/admin/mcp`,{token:e,method:`PUT`,body:t})}function sn(e,t){return z(`/api/admin/mcp?${new URLSearchParams({name:t}).toString()}`,{token:e,method:`DELETE`})}function cn(e,t){return z(`/api/admin/mcp/oauth/start`,{token:e,method:`POST`,body:{name:t}})}function ln(e,t){return z(`/api/admin/mcp/oauth/status?${new URLSearchParams({name:t}).toString()}`,{token:e})}function un(e,t){return z(`/api/admin/mcp/oauth/logout`,{token:e,method:`POST`,body:{name:t}})}function dn(e,t){let n=new URLSearchParams;t.query&&n.set(`query`,t.query),t.sessionId&&n.set(`sessionId`,t.sessionId),t.eventType&&n.set(`eventType`,t.eventType),t.since&&n.set(`since`,t.since),t.until&&n.set(`until`,t.until),typeof t.cursor==`number`&&t.cursor>0&&n.set(`cursor`,String(t.cursor)),typeof t.limit==`number`&&n.set(`limit`,String(t.limit));let r=n.toString();return z(r?`/api/admin/audit?${r}`:`/api/admin/audit`,{token:e})}function fn(e,t){let n=new URLSearchParams;t?.agentId&&n.set(`agentId`,t.agentId);let r=n.toString();return z(r?`/api/admin/approvals?${r}`:`/api/admin/approvals`,{token:e})}function pn(e,t){return z(`/api/interactive-escalations/resume`,{token:e,method:`POST`,body:t})}function mn(e,t){return z(`/api/admin/policy`,{token:e,method:`PUT`,body:t})}function hn(e,t){return z(`/api/admin/policy`,{token:e,method:`PUT`,body:t})}function gn(e,t){return z(`/api/admin/policy`,{token:e,method:`PUT`,body:{agentId:t.agentId,lanHttpAccessMode:t.mode}})}function _n(e,t){return z(`/api/admin/policy`,{token:e,method:`PUT`,body:t})}function vn(e,t){return z(`/api/admin/policy?${new URLSearchParams({agentId:t.agentId,index:String(t.index)}).toString()}`,{token:e,method:`DELETE`})}function yn(e){return z(`/api/admin/skills`,{token:e})}function bn(e,t){return z(`/api/admin/skills`,{token:e,method:`POST`,body:t})}function xn(e,t,n){return z(n?.force?`/api/admin/skills/upload?force=true`:`/api/admin/skills/upload`,{token:e,method:`POST`,rawBody:t,extraHeaders:{"Content-Type":`application/zip`}})}function Sn(e,t){return z(`/api/admin/skills/unblock`,{token:e,method:`POST`,body:{name:t}})}function Cn(e,t){return z(`/api/admin/skills/${encodeURIComponent(t)}/files`,{token:e})}function wn(e,t){return z(`/api/admin/skills/${encodeURIComponent(t)}/invocations`,{token:e})}function Tn(e,t){return z(`/api/admin/skills/${encodeURIComponent(t.skillName)}/files/content?path=${encodeURIComponent(t.path)}`,{token:e})}function En(e,t){return z(`/api/admin/skills/${encodeURIComponent(t.skillName)}/files/content?path=${encodeURIComponent(t.path)}`,{token:e,method:`PUT`,body:{content:t.content}})}function Dn(e){return z(`/api/admin/plugins`,{token:e})}function On(e){return z(`/api/admin/output-guard`,{token:e})}function kn(e,t){return z(`/api/admin/output-guard`,{token:e,method:`PUT`,body:{profile:t}})}function An(e,t,n){return z(`/api/admin/output-guard/preview`,{token:e,method:`POST`,body:{profile:t,sample:n}})}function jn(e){return z(`/api/skills/health`,{token:e})}function Mn(e){return z(`/api/admin/agent-scoreboard`,{token:e})}function Nn(e,t){return z(`/api/admin/harness-evolution?${new URLSearchParams({targetRoot:t}).toString()}`,{token:e})}function Pn(e,t,n){return z(`/api/admin/harness-evolution?${new URLSearchParams({targetRoot:t,summaryPath:n}).toString()}`,{token:e})}function Fn(e,t,n){return z(`/api/admin/harness-evolution?${new URLSearchParams({targetRoot:t,manifestPath:n}).toString()}`,{token:e})}function In(e){return z(`/api/skills/amendments`,{token:e})}function Ln(e,t){return z(`/api/skills/amendments/${encodeURIComponent(t)}`,{token:e})}function Rn(e,t,n=`console`){return z(`/api/skills/amendments/${encodeURIComponent(t)}/apply`,{token:e,method:`POST`,body:{reviewedBy:n}})}function zn(e,t,n=`console`){return z(`/api/skills/amendments/${encodeURIComponent(t)}/reject`,{token:e,method:`POST`,body:{reviewedBy:n}})}function Bn(e){return z(`/api/admin/tools`,{token:e})}function Vn(e,t){return z(`/api/admin/skills`,{token:e,method:`PUT`,body:t})}var B=_(),Hn=(0,R.createContext)(null);function Un(e){let[t]=(0,R.useState)(()=>Ee()),[n,r]=(0,R.useState)({status:`checking`,token:t,gatewayStatus:null,error:null});(0,R.useEffect)(()=>{let e=!1;return(async()=>{try{let n=await Me();if(e)return;if(n.webAuthConfigured){if(!t.trim()){try{let t=await je(``);if(e)return;r({status:`ready`,token:``,gatewayStatus:t,error:null});return}catch{if(e)return}r({status:`prompt`,token:``,gatewayStatus:null,error:null});return}try{let n=await je(t);if(e)return;r({status:`ready`,token:t,gatewayStatus:n,error:null});return}catch(t){if(e)return;ke(),r({status:`prompt`,token:``,gatewayStatus:null,error:t instanceof Error?t.message:String(t)});return}}try{let n=await je(t);if(e)return;r({status:`ready`,token:t,gatewayStatus:n,error:null})}catch{if(e)return;ke(),r({status:`error`,token:``,gatewayStatus:n,error:`This admin console is localhost-only unless WEB_API_TOKEN is configured.`})}}catch(t){if(e)return;r({status:`error`,token:``,gatewayStatus:null,error:t instanceof Error?t.message:String(t)})}})(),()=>{e=!0}},[t]),(0,R.useEffect)(()=>{let e=e=>{let t=e instanceof CustomEvent&&e.detail&&typeof e.detail==`object`?e.detail:null;r({status:`prompt`,token:``,gatewayStatus:null,error:typeof t?.message==`string`?t.message:`API token required.`})};return window.addEventListener(fe,e),()=>{window.removeEventListener(fe,e)}},[]);let i=(0,R.useCallback)(async e=>{let t=e.trim();if(!t){r({status:`prompt`,token:``,gatewayStatus:null,error:`Enter a WEB_API_TOKEN to continue.`});return}r({status:`checking`,token:t,gatewayStatus:null,error:null});try{let e=await je(t);Oe(t),r({status:`ready`,token:t,gatewayStatus:e,error:null})}catch(e){ke(),r({status:`prompt`,token:``,gatewayStatus:null,error:e instanceof Error?e.message:String(e)})}},[]),a=(0,R.useCallback)(()=>{ke(),r(e=>e.gatewayStatus?.webAuthConfigured?{status:`prompt`,token:``,gatewayStatus:null,error:null}:e.gatewayStatus?{status:`ready`,token:``,gatewayStatus:e.gatewayStatus,error:null}:{status:`checking`,token:``,gatewayStatus:null,error:null})},[]),o=(0,R.useCallback)(async()=>{window.location.reload()},[]),s=(0,R.useMemo)(()=>({...n,login:i,logout:a,retry:o}),[n,i,a,o]);return(0,B.jsx)(Hn.Provider,{value:s,children:e.children})}function Wn(e){return e.status===`ready`}function Gn(){let e=(0,R.useContext)(Hn);if(!e)throw Error(`useAuth must be used inside AuthProvider.`);return e}function Kn({children:e,viewBox:t=`0 0 24 24`,fill:n=`none`,stroke:r=`currentColor`,strokeWidth:i=`2`,...a}){return(0,B.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,viewBox:t,fill:n,stroke:r,strokeWidth:i,...a,children:e})}function qn(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`path`,{d:`M12 3l7 4v10l-7 4-7-4V7l7-4z`}),(0,B.jsx)(`path`,{d:`M12 8v8`}),(0,B.jsx)(`path`,{d:`M8.5 10 12 8l3.5 2`})]})}function Jn(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`circle`,{cx:`9`,cy:`8`,r:`4`}),(0,B.jsx)(`circle`,{cx:`17`,cy:`9`,r:`3`}),(0,B.jsx)(`path`,{d:`M3 21v-2a6 6 0 0 1 12 0v2`}),(0,B.jsx)(`path`,{d:`M14 17.5a5 5 0 0 1 7 4.5`})]})}function Yn(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`rect`,{x:`3`,y:`3`,width:`7`,height:`7`,rx:`2`}),(0,B.jsx)(`rect`,{x:`14`,y:`3`,width:`7`,height:`7`,rx:`2`}),(0,B.jsx)(`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`2`}),(0,B.jsx)(`rect`,{x:`14`,y:`14`,width:`7`,height:`7`,rx:`2`})]})}function Xn(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`path`,{d:`M12 3 5 6v5c0 4.5 3 8.4 7 10 4-1.6 7-5.5 7-10V6l-7-3Z`}),(0,B.jsx)(`path`,{d:`m9.5 12 1.7 1.7 3.3-3.7`})]})}function Zn(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`path`,{d:`M9 4 7 20`}),(0,B.jsx)(`path`,{d:`M17 4 15 20`}),(0,B.jsx)(`path`,{d:`M4 9h16`}),(0,B.jsx)(`path`,{d:`M3 15h16`})]})}function Qn(e){return(0,B.jsx)(Kn,{...e,children:(0,B.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`})})}function $n(e){return(0,B.jsx)(Kn,{strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:(0,B.jsx)(`path`,{d:`M4.5 12.5l5 5L19.5 6.5`})})}function er(e){return(0,B.jsx)(Kn,{strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:(0,B.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}function tr(e){return(0,B.jsx)(Kn,{strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:(0,B.jsx)(`path`,{d:`m15 18-6-6 6-6`})})}function nr(e){return(0,B.jsx)(Kn,{strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:(0,B.jsx)(`path`,{d:`m9 18 6-6-6-6`})})}function rr(e){return(0,B.jsx)(Kn,{fill:`currentColor`,stroke:`none`,...e,children:(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`5`})})}function ir(e){return(0,B.jsxs)(Kn,{strokeWidth:`1.8`,...e,children:[(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3.25`}),(0,B.jsx)(`path`,{d:`M12 2.75v2.5`}),(0,B.jsx)(`path`,{d:`M12 18.75v2.5`}),(0,B.jsx)(`path`,{d:`m4.93 4.93 1.77 1.77`}),(0,B.jsx)(`path`,{d:`m17.3 17.3 1.77 1.77`}),(0,B.jsx)(`path`,{d:`M2.75 12h2.5`}),(0,B.jsx)(`path`,{d:`M18.75 12h2.5`}),(0,B.jsx)(`path`,{d:`m4.93 19.07 1.77-1.77`}),(0,B.jsx)(`path`,{d:`m17.3 6.7 1.77-1.77`})]})}function ar(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3.25`}),(0,B.jsx)(`path`,{d:`M12 2.75v2.5`}),(0,B.jsx)(`path`,{d:`M12 18.75v2.5`}),(0,B.jsx)(`path`,{d:`m4.93 4.93 1.77 1.77`}),(0,B.jsx)(`path`,{d:`m17.3 17.3 1.77 1.77`}),(0,B.jsx)(`path`,{d:`M2.75 12h2.5`}),(0,B.jsx)(`path`,{d:`M18.75 12h2.5`}),(0,B.jsx)(`path`,{d:`m4.93 19.07 1.77-1.77`}),(0,B.jsx)(`path`,{d:`m17.3 6.7 1.77-1.77`})]})}function or(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`path`,{d:`M4 13.5a8 8 0 1 1 16 0`}),(0,B.jsx)(`path`,{d:`M12 13l4-4`}),(0,B.jsx)(`path`,{d:`M12 13v.01`})]})}function sr(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`path`,{d:`M4 19.5A2.5 2.5 0 0 1 6.5 17H20`}),(0,B.jsx)(`path`,{d:`M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2Z`})]})}function cr(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`path`,{d:`M4 6h16v12H4z`}),(0,B.jsx)(`path`,{d:`m4 7 8 6 8-6`})]})}function lr(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`path`,{d:`M15 2H6a2 2 0 0 0-2 2v12`}),(0,B.jsx)(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h11z`}),(0,B.jsx)(`path`,{d:`M15 2v4h4`}),(0,B.jsx)(`path`,{d:`M10 12h5`}),(0,B.jsx)(`path`,{d:`M10 16h5`})]})}function ur(e){return(0,B.jsxs)(Kn,{strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[(0,B.jsx)(`path`,{d:`M9 3h6`}),(0,B.jsx)(`path`,{d:`M10 3v5.2l-4.4 8.2A3 3 0 0 0 8.2 21h7.6a3 3 0 0 0 2.6-4.6L14 8.2V3`}),(0,B.jsx)(`path`,{d:`M8 14h8`}),(0,B.jsx)(`path`,{d:`M9.5 17h5`})]})}function dr(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`path`,{d:`M12 3v18`}),(0,B.jsx)(`path`,{d:`M6 7h6`}),(0,B.jsx)(`path`,{d:`M6 17h6`}),(0,B.jsx)(`path`,{d:`M12 12h6`})]})}function fr(e){return(0,B.jsxs)(Kn,{strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[(0,B.jsx)(`path`,{d:`M8 4 5 11v8`}),(0,B.jsx)(`path`,{d:`m16 4 3 7v8`}),(0,B.jsx)(`path`,{d:`M8 4h8`}),(0,B.jsx)(`path`,{d:`M9 6.5 12 12l3-5.5`}),(0,B.jsx)(`path`,{d:`M7 13h10`}),(0,B.jsx)(`path`,{d:`M6 17h12`}),(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.6`})]})}function pr(e){return(0,B.jsxs)(Kn,{viewBox:`0 0 800 880`,fill:`currentColor`,stroke:`none`,strokeWidth:`0`,...e,children:[(0,B.jsx)(`path`,{d:`M507.729828,92.190903 C542.757812,110.456673 571.424255,135.694031 595.775391,166.119827 C619.579956,195.862732 638.856934,228.219177 652.442078,263.850647 C658.479370,279.685486 662.272888,296.087799 661.244873,313.145020 C660.222595,330.108704 654.180420,344.928284 640.343445,355.720642 C627.428833,365.793610 612.935364,367.856323 597.373230,363.754395 C593.516968,362.737946 589.397949,361.895905 586.067444,359.873871 C578.530823,355.298187 571.261902,355.886414 563.224670,358.424438 C554.176697,361.281677 544.599487,361.880035 535.139954,362.708588 C503.348907,365.493256 471.935760,363.967682 441.306305,354.183746 C434.485138,352.004822 427.884583,349.166840 421.995331,344.941254 C419.271454,342.986908 417.618744,340.549011 417.634216,336.997040 C417.692871,323.504272 417.707977,310.010254 417.567596,296.518463 C417.531677,293.064697 418.864990,291.103882 421.903137,289.475525 C436.048309,281.894226 442.159882,269.402985 438.696381,255.741867 C435.398956,242.735855 422.214264,232.561279 408.365753,232.335831 C393.614441,232.095627 380.572144,241.785385 376.695343,255.865250 C373.262543,268.332550 379.366638,282.005371 391.995056,288.564514 C396.547821,290.929199 398.147736,293.803955 398.053528,298.719421 C397.823578,310.714386 397.861786,322.719879 398.084869,334.715698 C398.191528,340.450714 395.656799,344.207092 390.831329,346.768372 C373.951355,355.727936 355.739044,360.035950 336.916931,362.253662 C313.460205,365.017487 290.059021,364.294250 266.684662,361.281708 C259.407349,360.343781 252.176224,359.038208 245.221390,356.759186 C241.066254,355.397644 237.558655,355.908691 233.732346,357.664001 C223.539429,362.339905 213.099457,366.176178 201.562149,365.444641 C180.953476,364.137970 167.133926,353.166199 159.023743,334.804932 C152.313522,319.613129 152.931183,303.777405 156.128448,287.774323 C159.920319,268.795105 167.141647,251.115952 176.011139,234.097870 C194.991669,197.679611 217.903442,164.023529 247.837326,135.612793 C284.602356,100.718506 327.367798,77.135025 377.670380,68.302414 C404.830780,63.533329 431.707947,65.339912 458.279724,72.516678 C475.401306,77.141045 491.769989,83.646782 507.729828,92.190903 M470.811340,314.083008 C470.004425,323.096130 474.067200,328.937256 482.844788,330.662079 C487.729767,331.621948 492.735657,332.280182 497.706848,332.433624 C520.719727,333.143982 535.795471,326.973236 546.370361,305.011780 C555.453369,286.148468 556.519897,265.994873 553.154419,245.902328 C546.768616,207.778671 527.574890,176.891663 496.885162,153.448715 C484.902252,144.295334 471.551483,137.419052 456.489288,134.546432 C453.536621,133.983307 450.726898,134.271683 449.076050,137.233429 C447.403961,140.233276 449.269409,142.167389 451.297638,144.118927 C479.605591,171.356659 498.163116,203.667862 501.754364,243.367645 C503.720459,265.101898 501.622894,285.523987 480.042206,298.356262 C474.805237,301.470245 471.806488,306.984283 470.811340,314.083008 M329.727112,189.313919 C338.691223,172.616455 349.535278,157.346970 363.640320,144.538696 C365.809113,142.569290 367.789154,140.284348 366.029358,137.166122 C364.403717,134.285568 361.513763,133.855591 358.580414,134.623001 C352.951447,136.095657 347.315094,137.514465 341.928986,139.849701 C316.388824,150.923141 297.420502,169.350677 283.061371,192.751572 C270.537994,213.160721 261.867645,234.963089 261.049652,259.297241 C260.507629,275.420837 261.752777,291.198181 269.221588,305.964874 C276.934692,321.214478 288.591034,330.449554 306.034454,332.208008 C314.443176,333.055634 322.708710,332.456726 330.912598,331.318970 C341.340057,329.872833 346.440338,321.370148 343.830902,311.162964 C342.019531,304.077393 337.202148,299.397003 331.425964,295.481537 C324.501526,290.787750 318.864258,285.062592 316.345215,276.830078 C313.737213,268.306732 312.861694,259.494812 313.126587,250.678513 C313.771637,229.209946 319.520844,209.020950 329.727112,189.313919z`}),(0,B.jsx)(`path`,{d:`M210.441925,503.432068 C247.314560,521.655334 270.317474,551.237915 283.528076,589.123047 C289.629333,606.620056 292.365021,624.554260 290.347961,643.101990 C290.016632,646.148682 289.197571,648.751587 286.167908,649.869995 C283.190613,650.969055 281.061493,649.108337 279.156433,647.167358 C267.260620,635.047302 256.051575,622.210938 242.719162,611.580750 C234.493866,605.022583 225.924133,598.988037 215.194504,597.085693 C200.833801,594.539795 188.392563,607.695862 191.780853,621.933044 C193.693115,629.968079 197.764282,636.645081 204.262115,641.860107 C216.682327,651.828186 218.891983,658.008240 213.988632,673.136963 C210.513336,683.859680 213.396210,692.388367 220.839249,699.991882 C229.883942,709.231567 237.973907,718.883972 240.500259,732.248047 C241.883179,739.563599 247.428726,745.056335 251.031647,751.407288 C251.852844,752.854797 252.775574,754.244385 253.631058,755.672913 C255.236221,758.353577 256.426758,761.245178 254.355469,764.057312 C252.421570,766.682800 249.463562,766.379333 246.560349,765.872375 C237.975800,764.373169 229.700104,761.742432 221.880203,758.039795 C164.170914,730.714600 122.057175,688.404114 99.029068,628.335876 C90.255867,605.451233 88.103424,581.417664 94.028709,557.622742 C101.470154,527.739014 117.483910,504.193390 149.043518,495.366455 C170.327591,489.413544 190.550797,494.424347 210.441925,503.432068z`}),(0,B.jsx)(`path`,{d:`M640.615479,493.459625 C667.304382,489.860901 695.193481,504.364319 709.507935,528.717224 C722.905701,551.510681 726.558411,575.965637 722.703125,601.847168 C717.553955,636.414795 701.183960,665.708923 679.347839,692.118103 C656.996399,719.150574 630.089172,740.753845 598.253967,755.859619 C588.767761,760.360779 578.968872,764.106262 568.520752,765.842896 C565.648743,766.320251 562.780396,766.750061 560.787231,763.973999 C558.808044,761.217529 559.927429,758.526123 561.426941,756.035645 C563.488403,752.611816 565.623230,749.224304 567.887085,745.931641 C572.165955,739.708069 575.530457,733.196716 577.233276,725.682800 C579.447754,715.910645 585.968201,708.461121 592.832886,701.679077 C601.942932,692.678711 605.207275,682.939880 600.619202,670.489197 C596.713379,659.890076 599.624023,651.059448 608.571899,643.888428 C615.665344,638.203613 621.245422,631.798767 622.887512,622.429504 C626.035400,604.467957 612.231873,592.284424 595.018127,598.238892 C583.116821,602.355835 573.453125,610.135315 564.456116,618.593323 C554.869324,627.605652 545.811768,637.180359 536.499146,646.485535 C534.383179,648.599854 532.246399,651.213562 528.806763,649.913391 C525.276855,648.579041 524.961304,645.211548 524.782654,641.974182 C522.545105,601.437134 535.967896,566.400452 562.338318,536.055786 C578.995972,516.887573 599.140625,502.900116 623.956787,496.301331 C629.261719,494.890717 634.625854,493.649292 640.615479,493.459625z`}),(0,B.jsx)(`path`,{d:`M468.599182,550.247314 C464.299561,543.652771 462.516388,536.847412 464.750977,529.526917 C465.784729,526.140381 464.889954,523.844788 462.544281,521.545593 C456.240387,515.366516 450.116364,509.002441 443.755402,502.883881 C440.911163,500.148041 439.673248,497.143341 439.684113,493.166016 C439.786652,455.688446 439.806519,418.210327 439.684692,380.732910 C439.670319,376.301147 440.880646,374.021332 445.609497,374.638824 C449.879700,375.196442 455.025452,372.535126 458.237366,375.244293 C461.583588,378.066681 459.546631,383.464661 459.669006,387.634949 C460.049500,400.598785 459.686951,413.584137 459.627960,426.561188 C459.531860,447.699371 459.461884,468.837708 459.336121,489.975708 C459.324097,491.996735 460.238068,493.427795 461.539825,494.801849 C466.234283,499.757050 470.913818,504.726837 475.556030,509.730927 C477.466278,511.790070 479.497192,513.295166 482.535095,512.453491 C495.185608,508.948456 507.935699,517.325562 511.492493,527.866821 C515.294739,539.135559 511.046326,551.084900 501.021515,556.859741 C489.936981,563.245056 478.048737,560.910522 468.599182,550.247314 M496.982025,536.538208 C496.770538,533.039612 495.752441,529.997742 492.320801,528.328796 C487.451416,525.960632 482.015778,528.163513 480.079102,533.287659 C478.099823,538.524475 480.947906,543.754456 486.579681,545.224976 C491.595184,546.534546 495.767731,543.361328 496.982025,536.538208z`}),(0,B.jsx)(`path`,{d:`M356.795441,377.276306 C358.570312,373.325073 361.812286,374.631226 364.406616,374.640961 C377.276550,374.689148 376.261200,372.900696 376.261505,386.300385 C376.262329,420.964844 376.142242,455.629761 376.314972,490.293304 C376.343658,496.051331 374.859314,500.493958 370.533966,504.428375 C364.623566,509.804596 359.262390,515.779663 353.488892,521.313538 C350.824829,523.867004 349.948547,526.308105 350.811951,530.130371 C353.632477,542.616760 347.402344,554.466003 336.312744,558.686890 C324.835907,563.055115 311.826599,558.901672 305.822906,548.503418 C301.051239,540.238831 300.863159,531.586243 306.099304,523.425598 C311.989105,514.246155 320.793640,510.488220 331.432312,512.172913 C335.489044,512.815369 338.095398,511.959229 340.602783,509.030670 C343.091858,506.123474 345.522675,503.011139 348.547791,500.749390 C355.593506,495.481659 356.946106,488.662384 356.846680,480.237152 C356.443573,446.078033 356.706177,411.911072 356.795441,377.276306 M319.366730,540.885925 C322.839935,547.054688 331.732574,546.091553 334.369110,541.196594 C336.488281,537.262146 336.474487,533.435852 333.266266,530.160461 C330.271698,527.103210 326.635437,526.473572 322.763397,528.566406 C318.566284,530.834839 317.510376,534.236206 319.366730,540.885925z`}),(0,B.jsx)(`path`,{d:`M397.757507,474.000000 C397.767456,443.015961 397.770599,412.531952 397.790222,382.047913 C397.794830,374.856567 398.814270,373.908691 405.898315,374.311066 C418.147675,375.006805 418.198730,375.006805 418.198700,387.454956 C418.198669,420.770599 418.266083,454.086914 418.074982,487.401611 C417.972778,505.217773 417.412598,523.031677 417.013458,540.845520 C416.907379,545.579224 415.979919,549.960632 410.475372,551.298706 C403.426117,553.012268 398.875366,549.348022 398.656097,541.937988 C397.990967,519.463440 397.611664,496.985260 397.757507,474.000000z`}),(0,B.jsx)(`path`,{d:`M360.751953,742.683472 C369.855377,737.399231 378.604431,732.231812 387.436768,727.210754 C392.079071,724.571716 393.099060,725.095703 393.129089,730.151917 C393.225952,746.481079 393.161377,762.811157 393.234253,779.140564 C393.249176,782.487732 391.916534,784.739136 389.028870,786.463684 C375.157532,794.748108 361.371002,803.174438 347.520050,811.493286 C342.855103,814.294983 341.771393,813.685059 341.755859,808.231934 C341.708893,791.735596 341.799683,775.238708 341.697449,758.742920 C341.676544,755.373047 342.740387,753.120422 345.787476,751.470825 C350.764130,748.776489 355.560028,745.748291 360.751953,742.683472z`}),(0,B.jsx)(`path`,{d:`M332.093964,801.947632 C331.760712,805.977661 332.959869,809.695801 331.200684,812.930603 C329.162689,813.653503 328.033783,812.451416 326.800446,811.701782 C312.860718,803.229004 298.958557,794.694031 284.984558,786.278320 C282.253204,784.633362 281.025085,782.475037 281.029907,779.344238 C281.055298,762.871399 280.980652,746.398376 281.035919,729.925659 C281.051880,725.171509 282.218719,724.492859 286.357208,726.917419 C300.289673,735.079773 314.118530,743.419373 328.069000,751.550537 C331.505981,753.553772 332.097595,756.473267 332.086121,759.991394 C332.041107,773.813232 332.083099,787.635437 332.093964,801.947632z`}),(0,B.jsx)(`path`,{d:`M510.988220,736.939758 C518.181946,732.855774 525.055542,728.951355 532.303040,724.834534 C534.077637,729.453430 533.824402,733.483521 533.840332,737.327759 C533.898804,751.442505 533.563293,765.558472 533.452698,779.674561 C533.431580,782.369751 532.768982,784.459229 530.290649,785.950684 C515.610229,794.786133 500.976410,803.699219 486.330658,812.592346 C485.462372,813.119568 484.611511,813.630737 483.538574,813.190186 C482.480682,812.616028 482.462708,811.586121 482.465576,810.590271 C482.514679,793.450134 482.679840,776.309204 482.555359,759.170349 C482.527588,755.348999 483.802521,753.029785 487.089142,751.158264 C495.036560,746.632812 502.819031,741.817627 510.988220,736.939758z`}),(0,B.jsx)(`path`,{d:`M462.988831,809.092651 C450.594604,801.522034 438.564270,794.058777 426.406189,786.809814 C423.033508,784.798950 421.524933,782.387817 421.570007,778.363953 C421.749023,762.372559 421.628937,746.377991 421.662231,730.384644 C421.665588,728.776306 421.216278,727.029419 422.706512,725.421326 C426.142639,725.317139 428.693085,727.741577 431.440002,729.350708 C443.796448,736.588623 455.969757,744.139587 468.339905,751.353455 C471.329254,753.096680 472.447418,755.132324 472.450867,758.535339 C472.467255,774.686218 472.713593,790.836792 472.852478,806.987732 C472.869385,808.955505 473.408234,811.332886 471.643188,812.614197 C469.608276,814.091431 468.016998,811.878967 466.311554,811.064453 C465.264130,810.564331 464.303833,809.881714 462.988831,809.092651z`}),(0,B.jsx)(`path`,{d:`M334.049652,472.364777 C329.851746,485.123169 319.751007,492.206665 307.625488,491.249023 C296.145966,490.342407 287.243134,481.918701 285.131378,469.965515 C283.584503,461.209595 288.805450,450.791870 297.853424,445.880554 C301.209595,444.058777 302.159424,441.887573 302.135468,438.374908 C302.010559,420.073547 302.020477,401.771027 302.043915,383.468994 C302.054291,375.385590 302.498322,375.000183 310.468628,374.890930 C322.029694,374.732452 322.159515,374.735016 321.932068,386.275970 C321.565033,404.901001 322.669952,423.539703 321.378479,442.153137 C321.253815,443.949432 321.665100,445.332520 323.276001,446.411011 C332.435516,452.543060 335.539978,461.295593 334.049652,472.364777 M301.286713,468.201569 C301.926910,471.882355 303.459656,474.829193 307.487854,475.707001 C312.580322,476.816681 317.530975,473.739471 318.528381,468.851685 C319.463409,464.269745 315.974487,459.568787 311.069092,458.801056 C305.804382,457.977020 302.192810,461.147827 301.286713,468.201569z`}),(0,B.jsx)(`path`,{d:`M402.333496,659.057800 C402.332642,675.136841 402.332642,690.726379 402.332642,705.881348 C399.778137,707.423340 398.410583,706.140991 397.041565,705.347717 C383.367462,697.424133 369.746063,689.409241 356.041962,681.538269 C352.951447,679.763184 351.633270,677.467224 351.671326,673.870972 C351.840515,657.896790 351.783417,641.920349 351.886963,625.945251 C351.916473,621.395630 352.969971,620.721191 356.851105,622.948120 C371.131256,631.141846 385.334198,639.470032 399.580200,647.723511 C404.234619,650.420044 401.673492,654.889648 402.333496,659.057800z`}),(0,B.jsx)(`path`,{d:`M429.495911,639.469910 C440.424438,633.205566 451.039642,627.129272 461.337219,621.234802 C463.939026,623.247498 463.296173,625.226074 463.301849,626.944702 C463.353546,642.591858 463.294312,658.239319 463.358154,673.886414 C463.370422,676.894836 462.928711,679.292053 459.952606,680.990112 C445.789825,689.070984 431.719910,697.314636 417.616730,705.499939 C416.476288,706.161865 415.356293,706.897827 413.973480,706.661255 C412.098877,705.236328 412.683075,703.254761 412.679016,701.529236 C412.642059,685.715454 412.765411,669.900696 412.627319,654.088074 C412.595612,650.458801 413.762421,648.235840 417.062408,646.611572 C421.233002,644.558838 425.153961,641.999084 429.495911,639.469910z`}),(0,B.jsx)(`path`,{d:`M376.128784,623.927246 C370.444305,620.567993 365.071198,617.399170 360.017731,614.418884 C360.361847,612.379517 361.224030,611.862549 362.099670,611.362976 C375.693115,603.607910 389.289429,595.857849 402.879791,588.097290 C405.850555,586.400940 408.783264,586.144592 411.868347,587.905029 C425.316833,595.579468 438.797577,603.197327 452.254578,610.856812 C453.384918,611.500183 454.665497,612.089172 454.776520,613.716125 C454.316376,615.348572 452.802216,615.852478 451.535400,616.583313 C438.554993,624.071289 425.504456,631.440308 412.610260,639.073486 C408.987427,641.218201 405.997528,641.120789 402.448486,639.004456 C393.870270,633.889221 385.120667,629.061340 376.128784,623.927246z`}),(0,B.jsx)(`path`,{d:`M242.299408,438.279297 C252.006012,431.762848 256.521606,423.593109 255.230011,411.674988 C254.124954,401.477997 255.108200,391.064331 254.958374,380.749542 C254.894836,376.375488 256.324188,374.182953 261.038269,374.608673 C264.174500,374.891907 267.360840,374.764954 270.517426,374.638702 C273.965332,374.500732 275.282196,376.118652 275.269684,379.441071 C275.208832,395.582062 275.260773,411.723480 275.189850,427.864380 C275.174652,431.323761 273.830261,434.303436 271.218719,436.704590 C255.913254,450.777130 240.649780,464.895386 225.328384,478.950531 C222.506638,481.539032 219.517548,483.925323 217.617462,487.362701 C217.149307,488.209595 216.453644,489.032227 215.664200,489.580261 C213.626511,490.994812 202.953079,488.164825 200.974960,485.431274 C198.439163,481.927155 199.473038,478.288910 202.061020,475.385132 C205.150391,471.918823 208.638962,468.793976 212.077835,465.656250 C222.031769,456.574066 232.047455,447.559570 242.299408,438.279297z`}),(0,B.jsx)(`path`,{d:`M570.742676,461.278748 C561.963379,453.334656 553.505554,445.564453 544.928284,437.928406 C541.193726,434.603699 539.515381,430.755615 539.582947,425.652100 C539.783386,410.507263 539.721375,395.355774 539.501526,380.210632 C539.443237,376.195526 540.513245,374.481873 544.786621,374.568481 C561.698853,374.911438 559.023621,372.368805 559.200256,388.668945 C559.321045,399.820587 559.307190,410.975037 559.205200,422.126862 C559.178650,425.035919 560.154236,427.028046 562.351257,428.991577 C578.359253,443.298340 594.240356,457.747131 610.160095,472.152710 C611.891785,473.719696 613.585938,475.318970 614.633911,477.464844 C616.886536,482.077789 615.586426,485.446991 610.811646,487.347382 C608.648010,488.208557 606.497803,489.106934 604.313538,489.912445 C602.230042,490.680786 600.327332,490.332275 598.937378,488.514526 C590.982117,478.110687 580.327515,470.503998 570.742676,461.278748z`}),(0,B.jsx)(`path`,{d:`M510.884399,726.950562 C501.595795,732.536011 492.540253,737.804871 483.671234,743.370911 C479.665771,745.884583 476.244019,745.942749 472.145966,743.440186 C459.377014,735.642700 446.422150,728.149597 433.537201,720.542114 C432.261719,719.789001 430.851013,719.196472 430.273254,717.820374 C430.332611,715.982300 431.756744,715.550171 432.850616,714.911316 C446.346527,707.030090 459.875153,699.204834 473.359283,691.303589 C476.171722,689.655579 478.815643,689.226013 481.782227,690.968445 C495.401306,698.967834 509.068542,706.885254 522.708679,714.848816 C523.705750,715.430969 524.729614,716.054199 525.050781,718.083313 C521.179993,721.707764 515.692810,723.508545 510.884399,726.950562z`}),(0,B.jsx)(`path`,{d:`M324.203491,696.145752 C333.136627,688.303589 341.200531,689.493774 350.293427,696.006470 C359.593140,702.667236 369.971863,707.818481 379.852081,713.674683 C381.518341,714.662292 383.572815,715.268738 384.283936,717.379883 C383.937531,719.392090 382.201355,719.964783 380.829590,720.776306 C368.081451,728.317749 355.281097,735.770935 342.541473,743.326660 C339.322388,745.235779 336.181396,746.163269 332.705566,744.086853 C319.129486,735.976318 305.539307,727.889282 291.976074,719.757385 C291.164337,719.270691 290.542145,718.467957 288.922760,716.973267 C300.905212,709.897705 312.395447,703.112732 324.203491,696.145752z`}),(0,B.jsx)(`path`,{d:`M512.233826,378.381226 C512.297852,398.654144 512.391785,418.463837 512.277649,438.272278 C512.256714,441.891632 513.409912,443.966949 516.724182,445.658112 C526.928101,450.864990 531.905396,460.905609 529.860474,471.209717 C527.713806,482.026276 518.785034,490.092407 507.716095,491.214630 C497.467255,492.253693 487.039459,486.051971 482.787994,476.389221 C478.463409,466.560303 480.865051,455.472931 489.336761,448.361389 C492.073517,446.063995 492.974487,443.789825 492.934479,440.295929 C492.705811,420.322388 492.810242,400.345245 492.641724,380.370697 C492.607269,376.283234 494.140503,374.551086 498.222900,374.794891 C501.375824,374.983185 504.546661,374.856812 507.708984,374.906128 C509.835632,374.939270 511.721954,375.390259 512.233826,378.381226 M508.578430,475.418884 C512.508789,473.681152 514.549866,470.555817 514.241516,466.373993 C513.978394,462.805420 511.836823,460.386047 508.280029,459.166016 C504.668549,457.927277 501.737152,458.888092 499.220062,461.432556 C496.393768,464.289673 496.455627,467.846588 497.841187,471.180756 C499.667908,475.576477 503.488800,476.386444 508.578430,475.418884z`})]})}function mr(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`rect`,{x:`4`,y:`5`,width:`16`,height:`14`,rx:`2.5`}),(0,B.jsx)(`path`,{d:`M8 9h8`}),(0,B.jsx)(`path`,{d:`M8 13h5`}),(0,B.jsx)(`path`,{d:`M8 17h7`})]})}function hr(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`path`,{d:`M9 18h6`}),(0,B.jsx)(`path`,{d:`M10 22h4`}),(0,B.jsx)(`path`,{d:`M12 2a7 7 0 0 0-4 12.74V16a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-1.26A7 7 0 0 0 12 2z`})]})}function gr(e){return(0,B.jsxs)(Kn,{strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[(0,B.jsx)(`rect`,{width:`16`,height:`16`,x:`4`,y:`4`,rx:`2`}),(0,B.jsx)(`rect`,{width:`6`,height:`6`,x:`9`,y:`9`}),(0,B.jsx)(`path`,{d:`M15 2v2`}),(0,B.jsx)(`path`,{d:`M15 20v2`}),(0,B.jsx)(`path`,{d:`M2 15h2`}),(0,B.jsx)(`path`,{d:`M2 9h2`}),(0,B.jsx)(`path`,{d:`M20 15h2`}),(0,B.jsx)(`path`,{d:`M20 9h2`}),(0,B.jsx)(`path`,{d:`M9 2v2`}),(0,B.jsx)(`path`,{d:`M9 20v2`})]})}function _r(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`}),(0,B.jsx)(`polyline`,{points:`16 17 21 12 16 7`}),(0,B.jsx)(`line`,{x1:`21`,y1:`12`,x2:`9`,y2:`12`})]})}function vr(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`path`,{d:`M6 3h9l3 3v15H6z`}),(0,B.jsx)(`path`,{d:`M14 3v4h4`}),(0,B.jsx)(`path`,{d:`M9 11h6`}),(0,B.jsx)(`path`,{d:`M9 15h6`}),(0,B.jsx)(`path`,{d:`M9 19h3`})]})}function yr(e){return(0,B.jsxs)(Kn,{strokeWidth:`1.8`,...e,children:[(0,B.jsx)(`path`,{d:`M4 7h16`}),(0,B.jsx)(`path`,{d:`M4 12h16`}),(0,B.jsx)(`path`,{d:`M4 17h16`})]})}function br(e){return(0,B.jsx)(Kn,{strokeWidth:`2.4`,strokeLinecap:`round`,...e,children:(0,B.jsx)(`path`,{d:`M5 12h14`})})}function xr(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`ellipse`,{cx:`12`,cy:`6`,rx:`6.5`,ry:`2.5`}),(0,B.jsx)(`path`,{d:`M5.5 6v6c0 1.4 2.9 2.5 6.5 2.5s6.5-1.1 6.5-2.5V6`}),(0,B.jsx)(`path`,{d:`M5.5 12v6c0 1.4 2.9 2.5 6.5 2.5s6.5-1.1 6.5-2.5v-6`})]})}function Sr(e){return(0,B.jsxs)(Kn,{strokeWidth:`1.8`,...e,children:[(0,B.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,B.jsx)(`path`,{d:`M9 3v18`})]})}function Cr(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`path`,{d:`M9 3v6`}),(0,B.jsx)(`path`,{d:`M15 15v6`}),(0,B.jsx)(`path`,{d:`M15 3v2`}),(0,B.jsx)(`path`,{d:`M9 19v2`}),(0,B.jsx)(`path`,{d:`M8 8h2a3 3 0 1 1 0 6H8a3 3 0 1 1 0-6Z`}),(0,B.jsx)(`path`,{d:`M14 10h2a3 3 0 1 1 0 6h-2a3 3 0 1 1 0-6Z`})]})}function wr(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`path`,{d:`M12 3 5 6v5c0 4.5 3 8.4 7 10 4-1.6 7-5.5 7-10V6l-7-3Z`}),(0,B.jsx)(`path`,{d:`M9 10h6`}),(0,B.jsx)(`path`,{d:`M9 13h4`})]})}function Tr(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8`}),(0,B.jsx)(`path`,{d:`M12 7v5l3 2`})]})}function Er(e){return(0,B.jsxs)(Kn,{strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[(0,B.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,B.jsx)(`path`,{d:`m20 20-3.5-3.5`})]})}function Dr(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`rect`,{x:`4`,y:`11`,width:`16`,height:`9`,rx:`2`}),(0,B.jsx)(`path`,{d:`M8 11V7a4 4 0 0 1 8 0v4`}),(0,B.jsx)(`circle`,{cx:`12`,cy:`15.5`,r:`1.2`,fill:`currentColor`,stroke:`none`})]})}function Or(e){return(0,B.jsxs)(Kn,{strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[(0,B.jsx)(`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`}),(0,B.jsx)(`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`}),(0,B.jsx)(`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`}),(0,B.jsx)(`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`})]})}function kr(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`rect`,{x:`4`,y:`5`,width:`16`,height:`12`,rx:`2.5`}),(0,B.jsx)(`path`,{d:`M8 19h8`}),(0,B.jsx)(`path`,{d:`M9 9h6`}),(0,B.jsx)(`path`,{d:`M9 13h4`})]})}function Ar(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`path`,{d:`M4 19V5`}),(0,B.jsx)(`path`,{d:`M4 19h16`}),(0,B.jsx)(`rect`,{x:`7`,y:`12`,width:`3`,height:`7`}),(0,B.jsx)(`rect`,{x:`12`,y:`8`,width:`3`,height:`11`}),(0,B.jsx)(`rect`,{x:`17`,y:`14`,width:`3`,height:`5`})]})}function jr(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`path`,{d:`m5 7 4 5-4 5`}),(0,B.jsx)(`path`,{d:`M13 17h6`})]})}function Mr({filled:e=!1,...t}){return(0,B.jsxs)(Kn,{fill:e?`currentColor`:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,...t,children:[(0,B.jsx)(`path`,{d:`M17 14V2`}),(0,B.jsx)(`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`})]})}function Nr({filled:e=!1,...t}){return(0,B.jsxs)(Kn,{fill:e?`currentColor`:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,...t,children:[(0,B.jsx)(`path`,{d:`M7 10v12`}),(0,B.jsx)(`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`})]})}function Pr(e){return(0,B.jsxs)(Kn,{...e,children:[(0,B.jsx)(`path`,{d:`m14.7 6.3 3 3`}),(0,B.jsx)(`path`,{d:`m11.5 9.5 6.2 6.2`}),(0,B.jsx)(`path`,{d:`m3 21 6.2-6.2`}),(0,B.jsx)(`path`,{d:`M7.8 16.2 5 19l-2-2 2.8-2.8`}),(0,B.jsx)(`path`,{d:`M14 4a4 4 0 0 0-4 5l-6 6 3 3 6-6a4 4 0 0 0 5-4Z`})]})}function Fr(e){return(0,B.jsxs)(Kn,{strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[(0,B.jsx)(`path`,{d:`M3 6h18`}),(0,B.jsx)(`path`,{d:`M8 6V4h8v2`}),(0,B.jsx)(`path`,{d:`M19 6l-1 14H6L5 6`}),(0,B.jsx)(`path`,{d:`M10 11v5`}),(0,B.jsx)(`path`,{d:`M14 11v5`})]})}function Ir(){let e=Gn(),[t,n]=(0,R.useState)(e.token);return(0,B.jsx)(`div`,{className:`login-shell`,children:(0,B.jsxs)(`div`,{className:`login-card`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`HybridClaw Admin`}),(0,B.jsx)(`h1`,{children:`Enter API token.`}),(0,B.jsxs)(`p`,{className:`supporting-text`,children:[`This instance has `,(0,B.jsx)(`code`,{children:`WEB_API_TOKEN`}),` enabled. Enter it once and the console will keep it in local storage, the same way`,(0,B.jsx)(`code`,{children:` /chat`}),` already does.`]}),(0,B.jsxs)(`form`,{className:`stack-form`,onSubmit:async n=>{n.preventDefault(),await e.login(t)},children:[(0,B.jsxs)(`label`,{className:`field`,children:[(0,B.jsx)(`span`,{children:`Token`}),(0,B.jsx)(`input`,{autoComplete:`off`,spellCheck:!1,type:`password`,value:t,onChange:e=>n(e.target.value),placeholder:`Paste WEB_API_TOKEN`})]}),e.error?(0,B.jsx)(`p`,{className:`error-banner`,children:e.error}):null,(0,B.jsx)(`button`,{className:`primary-button`,type:`submit`,children:e.status===`checking`?`Checking...`:`Continue`})]})]})})}function Lr(e){return e===`/chat`||e.startsWith(`/chat/`)?`HybridClaw Chat`:e===`/agents`||e.startsWith(`/agents/`)?`HybridClaw Agents`:e===`/admin`||e.startsWith(`/admin/`)?`HybridClaw Admin`:`HybridClaw`}var Rr=[{label:`Overview`,items:[{to:`/admin`,label:`Dashboard`,icon:or},{to:`/admin/statistics`,label:`Statistics`,icon:Ar},{to:`/admin/approvals`,label:`Approvals`,icon:wr},{to:`/admin/audit`,label:`Audit`,icon:Xn},{to:`/admin/jobs`,label:`Jobs`,icon:mr},{to:`/admin/harness-evolution`,label:`Harness Evolution`,icon:fr},{to:`/admin/distill`,label:`Distill`,icon:ur}]},{label:`A2A`,items:[{to:`/admin/a2a-inbox`,label:`Inbox`,icon:Qn},{to:`/admin/a2a-trust`,label:`Trust`,icon:wr}]},{label:`Runtime`,items:[{to:`/admin/terminal`,label:`Terminal`,icon:jr},{to:`/admin/gateway`,label:`Gateway`,icon:dr},{to:`/admin/logs`,label:`Logs`,icon:vr},{to:`/admin/fleet-topology`,label:`Fleet`,icon:Or},{to:`/admin/sessions`,label:`Sessions`,icon:kr},{to:`/admin/channels`,label:`Channels`,icon:Zn},{to:`/admin/email`,label:`Email`,icon:cr,requiresEmail:!0},{to:`/admin/models`,label:`Models`,icon:xr},{to:`/admin/scheduler`,label:`Scheduler`,icon:Tr},{to:`/admin/connectors`,label:`Connectors`,icon:Cr},{to:`/admin/mcp`,label:`MCP`,icon:ir}]},{label:`Configuration`,items:[{to:`/admin/agents`,label:`Agent Files`,icon:lr},{to:`/admin/agent-scoreboard`,label:`Agents`,icon:Jn},{to:`/admin/skills`,label:`Skills`,icon:hr},{to:`/admin/plugins`,label:`Plugins`,icon:Cr},{to:`/admin/output-guard`,label:`Output Guard`,icon:wr},{to:`/admin/tools`,label:`Tools`,icon:Pr},{to:`/admin/secrets`,label:`Secrets`,icon:Dr},{to:`/admin/config`,label:`Config`,icon:ar}]}],zr=Rr.flatMap(e=>e.items.map(({to:e,label:t})=>({to:e,label:t}))).concat([{to:`/agents`,label:`Agents`}]);function Br(e){return e.startsWith(`/admin/skills/`)?{to:`/admin/skills`,label:`Skill`}:zr.find(t=>t.to===e)??zr[0]}function V(...e){return e.filter(Boolean).join(` `)}var Vr=k();function Hr(e,t,n){(0,R.useEffect)(()=>{if(!t)return;let r=e.current;if(!r||typeof r.getAnimations!=`function`){n();return}let i=r.getAnimations();if(i.length===0){n();return}let a=!1;return Promise.all(i.map(e=>e.finished)).then(()=>{a||n()},()=>{a||n()}),()=>{a=!0}},[t,e,n])}function Ur(e,t){let n=(0,R.useRef)(e);(0,R.useEffect)(()=>{n.current=e},[e]),(0,R.useEffect)(()=>{if(!t)return;function e(e){if(e.key!==`Escape`)return;let t=e.target;t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.isContentEditable||(e.stopPropagation(),n.current())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t])}function Wr({onFocus:e}){return(0,B.jsx)(`span`,{tabIndex:0,"aria-hidden":`true`,style:{position:`fixed`,outline:`none`,opacity:0,pointerEvents:`none`},onFocus:e})}var Gr=`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`;function Kr(e){return Array.from(e.querySelectorAll(Gr))}function qr(e,t,n){(0,R.useEffect)(()=>{if(!t)return;let r=e.current;if(!r)return;let i=document.activeElement,a=requestAnimationFrame(()=>{(n?.current??Kr(r)[0])?.focus({preventScroll:!0})});function o(e){if(e.key!==`Tab`||!r)return;let t=Kr(r);if(!t.length){e.preventDefault();return}let n=t[0],i=t[t.length-1],a=document.activeElement;e.shiftKey?(a===n||!r.contains(a))&&(e.preventDefault(),i.focus({preventScroll:!0})):(a===i||!r.contains(a))&&(e.preventDefault(),n.focus({preventScroll:!0}))}return document.addEventListener(`keydown`,o),()=>{cancelAnimationFrame(a),document.removeEventListener(`keydown`,o),i?.focus({preventScroll:!0})}},[t,e,n])}var Jr=new WeakMap;function Yr(e){let t=(Jr.get(e)??0)+1;Jr.set(e,t),t===1&&(e.inert=!0)}function Xr(e){let t=(Jr.get(e)??1)-1;t<=0?(Jr.delete(e),e.inert=!1):Jr.set(e,t)}function Zr(e,t){(0,R.useEffect)(()=>{if(!t)return;let n=e.current;if(!n)return;let r=[];for(let e of document.body.children)e===n||e.contains(n)||(Yr(e),r.push(e));return()=>{for(let e of r)Xr(e)}},[t,e])}var Qr=0;function $r(e){(0,R.useEffect)(()=>{if(e){if(Qr++===0){let e=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow=`hidden`,e>0&&(document.body.style.paddingRight=`${e}px`)}return()=>{--Qr===0&&(document.body.style.overflow=``,document.body.style.paddingRight=``)}}},[e])}var ei={backdrop:`_backdrop_18ebo_1`,dialogFadeIn:`_dialogFadeIn_18ebo_1`,viewport:`_viewport_18ebo_9`,content:`_content_18ebo_19`,dialogSlideIn:`_dialogSlideIn_18ebo_1`,sm:`_sm_18ebo_36`,lg:`_lg_18ebo_40`,header:`_header_18ebo_44`,title:`_title_18ebo_49`,description:`_description_18ebo_57`,footer:`_footer_18ebo_63`,exiting:`_exiting_18ebo_82`,dialogFadeOut:`_dialogFadeOut_18ebo_1`,dialogSlideOut:`_dialogSlideOut_18ebo_1`,overlay:`_overlay_18ebo_118`,overlayVisible:`_overlayVisible_18ebo_131`,drawer:`_drawer_18ebo_114`,left:`_left_18ebo_151`,right:`_right_18ebo_162`,top:`_top_18ebo_173`,bottom:`_bottom_18ebo_184`,drawerOpen:`_drawerOpen_18ebo_114`,srOnly:`_srOnly_18ebo_201 _srOnly_jfnet_1`},ti=(0,R.createContext)(null);function ni(){let e=(0,R.useContext)(ti);if(!e)throw Error(`Dialog components must be used within <Dialog>.`);return e}function ri(e){let t=(0,R.useId)(),n=(0,R.useId)();return(0,B.jsx)(ti.Provider,{value:{open:e.open,onOpenChange:e.onOpenChange,titleId:t,descriptionId:n,isDrawer:e.isDrawer??!1},children:e.children})}function ii({children:e,className:t,size:n,initialFocus:r,preventCloseOnOutsideClick:i,role:a,side:o=`right`,...s}){let c=ni(),l=(0,R.useRef)(null),u=(0,R.useRef)(null),d=(0,R.useRef)(null),{open:f,onOpenChange:p,titleId:m,descriptionId:h,isDrawer:g}=c,[_,v]=(0,R.useState)(!1),y=(0,R.useRef)(f);(0,R.useEffect)(()=>{!g&&y.current&&!f&&v(!0),y.current=f},[f,g]);let b=(0,R.useCallback)(()=>v(!1),[]);Hr(u,!g&&_,b);let x=g?d:u;$r(f),qr(x,f,r),Ur(()=>p(!1),f),Zr(l,f);let S=(0,R.useCallback)(()=>{Array.from(u.current?.querySelectorAll(`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)??[])[0]?.focus({preventScroll:!0})},[]),C=(0,R.useCallback)(()=>{let e=Array.from(u.current?.querySelectorAll(`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)??[]);e[e.length-1]?.focus({preventScroll:!0})},[]);if((0,R.useEffect)(()=>{},[f,m]),typeof document>`u`)return null;if(g)return(0,Vr.createPortal)((0,B.jsxs)(`div`,{ref:l,children:[(0,B.jsx)(`div`,{"data-sheet":`overlay`,className:V(ei.overlay,f&&ei.overlayVisible),"aria-hidden":`true`,onClick:()=>!i&&p(!1)}),(0,B.jsx)(`section`,{...s,ref:d,role:a??`dialog`,"aria-modal":f?`true`:void 0,"aria-hidden":f?void 0:!0,inert:!f,"aria-labelledby":m,"aria-describedby":h,"data-sheet":`content`,"data-side":o,"data-state":f?`open`:`closed`,className:V(ei.drawer,ei[o],f&&ei.drawerOpen,t),children:e})]}),document.body);if(!f&&!_)return null;let w=n===`sm`?ei.sm:n===`lg`?ei.lg:void 0;return(0,Vr.createPortal)((0,B.jsxs)(`div`,{ref:l,children:[(0,B.jsx)(`div`,{className:V(ei.backdrop,_&&ei.exiting),"aria-hidden":`true`,onClick:()=>!_&&!i&&p(!1)}),(0,B.jsxs)(`div`,{className:ei.viewport,children:[(0,B.jsx)(Wr,{onFocus:C}),(0,B.jsx)(`div`,{...s,ref:u,role:a??`dialog`,"aria-modal":`true`,"aria-labelledby":m,"aria-describedby":h,"data-state":_?`closed`:`open`,className:V(ei.content,w,_&&ei.exiting,t),children:e}),(0,B.jsx)(Wr,{onFocus:S})]})]}),document.body)}function ai(e){return(0,B.jsx)(`div`,{className:V(e.visuallyHidden?ei.srOnly:ei.header,e.className),children:e.children})}function oi(e){let{titleId:t}=ni();return(0,B.jsx)(`h3`,{id:t,className:V(ei.title,e.className),children:e.children})}function si(e){let{descriptionId:t}=ni();return(0,B.jsx)(`p`,{id:t,className:V(ei.description,e.className),children:e.children})}function ci(e){return(0,B.jsx)(`div`,{className:V(ei.footer,e.className),children:e.children})}function li(e){let{onOpenChange:t}=ni(),{children:n,className:r,onClick:i,...a}=e;return(0,B.jsx)(`button`,{...a,type:`button`,className:r,onClick:e=>{i?.(e),t(!1)},children:n})}var ui=new Set,di=te(),fi=ne(),pi=null,mi=!1,hi=gi();function gi(){return{theme:di,resolved:re(di,fi)}}function _i(){hi=gi(),ie(hi.resolved);for(let e of ui)e()}function vi(e){fi=e.matches?`dark`:`light`,_i()}function yi(e){e.key===`hybridclaw-theme`&&(di=te(),_i())}function bi(){mi||typeof window>`u`||(mi=!0,di=te(),fi=ne(),hi=gi(),ie(hi.resolved),pi=window.matchMedia(`(prefers-color-scheme: dark)`),pi.addEventListener(`change`,vi),window.addEventListener(`storage`,yi))}function xi(){return hi}function Si(e){di=e,typeof window<`u`&&window.localStorage.setItem(L,e),_i()}function Ci(e){return bi(),ui.add(e),()=>ui.delete(e)}function wi(){return(0,R.useSyncExternalStore)(Ci,xi,xi)}var Ti={content:`_content_y9cp1_1`},Ei=(0,R.createContext)(null);function Di(e){let t=(0,R.useContext)(Ei);if(!t)throw Error(`${e} must be used within <Popover>`);return t}function Oi({children:e,open:t,defaultOpen:n=!1,onOpenChange:r}){let[i,a]=(0,R.useState)(n),[o,s]=(0,R.useState)(null),[c,l]=(0,R.useState)(null),u=(0,R.useId)(),d=t!==void 0,f=d?t:i,p=(0,R.useCallback)(e=>{d||a(e),r?.(e)},[d,r]),m=(0,R.useCallback)(()=>p(!f),[f,p]),h=(0,R.useMemo)(()=>({open:f,setOpen:p,toggle:m,triggerEl:o,setTriggerEl:s,contentEl:c,setContentEl:l,contentId:u}),[f,p,m,o,c,u]);return(0,B.jsx)(Ei.Provider,{value:h,children:e})}function ki({children:e,className:t,...n}){return(0,B.jsx)(`div`,{ref:Di(`PopoverAnchor`).setTriggerEl,className:t,...n,children:e})}function Ai({align:e=`start`,side:t=`bottom`,sideOffset:n=4,focusOnOpen:r=`first-button`,closeOnEscape:i=!0,closeOnOutsideClick:a=!0,className:o,style:s,children:c,ref:l,...u}){let d=Di(`PopoverContent`),f=(0,R.useRef)(null),[p,m]=(0,R.useState)(null),{setContentEl:h}=d,g=(0,R.useCallback)(e=>{f.current=e,h(e),typeof l==`function`?l(e):l&&(l.current=e)},[h,l]);if((0,R.useLayoutEffect)(()=>{let r=f.current;if(!d.open||!d.triggerEl||!r)return;let i=0,a=()=>{if(!d.triggerEl||!r)return;let i=d.triggerEl.getBoundingClientRect(),a=r.getBoundingClientRect(),o=window.innerWidth,s=window.innerHeight,c=i.left;e===`end`?c=i.right-a.width:e===`center`&&(c=i.left+(i.width-a.width)/2);let l=t===`top`?i.top-a.height-n:i.bottom+n;if(c+a.width>o-8&&(c=o-a.width-8),c<8&&(c=8),t===`bottom`&&l+a.height>s-8){let e=i.top-a.height-n;e>=8&&(l=e)}t===`top`&&l<8&&(l=8),m({x:c,y:l,minWidth:i.width})},o=()=>{i||=window.requestAnimationFrame(()=>{i=0,a()})};a();let s=typeof ResizeObserver>`u`?null:new ResizeObserver(o);return s?.observe(d.triggerEl),s?.observe(r),window.addEventListener(`resize`,a),window.addEventListener(`scroll`,a,!0),()=>{i&&window.cancelAnimationFrame(i),s?.disconnect(),window.removeEventListener(`resize`,a),window.removeEventListener(`scroll`,a,!0)}},[d.open,d.triggerEl,e,t,n]),(0,R.useEffect)(()=>{let e=f.current;if(!d.open||!e||r===`none`)return;let t=window.setTimeout(()=>{r===`first-button`?e.querySelector(`button:not(:disabled)`)?.focus():r(e)},0);return()=>window.clearTimeout(t)},[d.open,r]),(0,R.useEffect)(()=>{if(!d.open||!a)return;let e=f.current,t=d.triggerEl;if(!e||!t)return;let n=n=>{let r=n.target;t.contains(r)||e.contains(r)||d.setOpen(!1)};return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[d.open,d.triggerEl,d.setOpen,a]),(0,R.useEffect)(()=>{if(!d.open||!i)return;let e=d.triggerEl,t=t=>{t.key===`Escape`&&(d.setOpen(!1),e&&`focus`in e&&e.focus())};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[d.open,d.triggerEl,d.setOpen,i]),!d.open||typeof document>`u`)return null;let _={left:p?.x??0,top:p?.y??0,minWidth:p?.minWidth,visibility:p?`visible`:`hidden`};return(0,Vr.createPortal)((0,B.jsx)(`div`,{ref:g,id:d.contentId,"data-state":`open`,className:V(Ti.content,o),style:{..._,...s},...u,children:c}),document.body)}var ji={trigger:`_trigger_sn70v_1`,content:`_content_sn70v_17`,item:`_item_sn70v_29`};function Mi({children:e,open:t,defaultOpen:n,onOpenChange:r}){return(0,B.jsx)(Oi,{open:t,defaultOpen:n,onOpenChange:r,children:e})}function Ni({children:e,className:t=``,"aria-label":n,title:r}){let i=Di(`DropdownTrigger`);return(0,B.jsx)(`button`,{ref:i.setTriggerEl,type:`button`,className:V(ji.trigger,t),"aria-haspopup":`menu`,"aria-expanded":i.open,"aria-controls":i.contentId,"aria-label":n,title:r,"data-state":i.open?`open`:`closed`,onClick:i.toggle,onKeyDown:e=>{(e.key===`Enter`||e.key===` `||e.key===`ArrowDown`)&&(e.preventDefault(),i.setOpen(!0))},children:e})}function Pi({children:e,className:t=``,align:n=`start`,sideOffset:r=4}){return(0,B.jsx)(Ai,{role:`menu`,align:n,sideOffset:r,focusOnOpen:`first-button`,className:V(ji.content,t),children:e})}function Fi({children:e,className:t=``,active:n=!1,onSelect:r}){let i=Di(`DropdownItem`);return(0,B.jsx)(`button`,{type:`button`,role:`menuitem`,className:V(ji.item,t),"data-active":n?`true`:`false`,onClick:()=>{r?.(),i.setOpen(!1)},children:e})}var Ii=()=>(0,B.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:[(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`5`}),(0,B.jsx)(`path`,{d:`M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42`})]}),Li=()=>(0,B.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z`})}),Ri=()=>(0,B.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:[(0,B.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`,ry:`2`}),(0,B.jsx)(`path`,{d:`M8 21h8M12 17v4`})]});function zi({theme:e}){return e===`light`?(0,B.jsx)(Ii,{}):e===`dark`?(0,B.jsx)(Li,{}):(0,B.jsx)(Ri,{})}var Bi=[{value:`light`,label:`Light`},{value:`dark`,label:`Dark`},{value:`system`,label:`System`}];function Vi(e){let{theme:t,resolved:n}=wi(),r=Bi.find(e=>e.value===t)?.label??t;return(0,B.jsxs)(Mi,{children:[(0,B.jsxs)(Ni,{className:`theme-toggle-trigger`,"aria-label":`Theme: ${t} (${n})`,title:`Change theme`,children:[(0,B.jsx)(zi,{theme:t}),(0,B.jsx)(`span`,{className:e.labelClassName,children:r})]}),(0,B.jsx)(Pi,{className:`theme-toggle-menu`,align:`end`,children:Bi.map(e=>(0,B.jsxs)(Fi,{className:`theme-toggle-option`,active:t===e.value,onSelect:()=>Si(e.value),children:[(0,B.jsx)(zi,{theme:e.value}),(0,B.jsx)(`span`,{children:e.label})]},e.value))})]})}var Hi={layout:`_layout_1qte4_1`,root:`_root_1qte4_10`,header:`_header_1qte4_36`,footer:`_footer_1qte4_37`,content:`_content_1qte4_49`,inset:`_inset_1qte4_65`,trigger:`_trigger_1qte4_73`,group:`_group_1qte4_104`,groupContent:`_groupContent_1qte4_105`,eyebrow:`_eyebrow_1qte4_114`,groupLabel:`_groupLabel_1qte4_123`,menu:`_menu_1qte4_141`,menuItem:`_menuItem_1qte4_146`,menuButton:`_menuButton_1qte4_150`,menuButtonActive:`_menuButtonActive_1qte4_176`,headerRow:`_headerRow_1qte4_182`,sidebarToggle:`_sidebarToggle_1qte4_189`,brand:`_brand_1qte4_202`,brandTitle:`_brandTitle_1qte4_208`,brandText:`_brandText_1qte4_215`,brandMark:`_brandMark_1qte4_229`,menuIcon:`_menuIcon_1qte4_230`,icon:`_icon_1qte4_231`,footerMeta:`_footerMeta_1qte4_266`,footerValue:`_footerValue_1qte4_271`,footerBlock:`_footerBlock_1qte4_279`,footerDivider:`_footerDivider_1qte4_286`,footerActions:`_footerActions_1qte4_292`,footerMenu:`_footerMenu_1qte4_293`,footerAction:`_footerAction_1qte4_292`,footerButton:`_footerButton_1qte4_308`,themeToggleLabel:`_themeToggleLabel_1qte4_345`},Ui=1080,Wi=`b`,Gi=(0,R.createContext)(null);function Ki(){let e=(0,R.useContext)(Gi);if(!e)throw Error(`Sidebar components must be used within SidebarProvider.`);return e}function qi(){return typeof window>`u`?!1:window.innerWidth<Ui}var Ji=`hybridclaw_sidebar_state`;function Yi(e,t){if(!t||typeof window>`u`)return e;let n=localStorage.getItem(t);return n===`true`?!0:n===`false`?!1:e}function Xi(e){let t=e.storageKey??Ji,[n,r]=(0,R.useState)(()=>Yi(e.defaultOpen??!0,t)),i=(0,R.useCallback)(e=>{r(n=>{let r=typeof e==`function`?e(n):e;if(r===n)return n;if(t)try{localStorage.setItem(t,String(r))}catch{}return r})},[t]),[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(qi);(0,R.useEffect)(()=>{if(typeof window>`u`)return;let e=qi();function t(){let t=qi();t!==e&&(e=t,c(t),t||o(!1))}function n(e){if(e.key.toLowerCase()!==Wi||!(e.metaKey||e.ctrlKey))return;let t=e.target;t instanceof HTMLElement&&(t.isContentEditable||t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`)||(e.preventDefault(),qi()?o(e=>!e):i(e=>!e))}return t(),window.addEventListener(`resize`,t),window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`resize`,t),window.removeEventListener(`keydown`,n)}},[i]);let l=(0,R.useMemo)(()=>({state:n?`expanded`:`collapsed`,open:n,setOpen:i,openMobile:a,setOpenMobile:o,isMobile:s,toggleSidebar(){s?o(e=>!e):i(e=>!e)}}),[s,n,a,i]);return(0,B.jsx)(Gi.Provider,{value:l,children:(0,B.jsx)(`div`,{className:Hi.layout,style:e.style,children:e.children})})}function Zi(){return Ki()}function Qi({side:e=`left`,collapsible:t=`icon`,children:n}){let r=Ki();if(r.isMobile)return(0,B.jsx)(ri,{open:r.openMobile,onOpenChange:r.setOpenMobile,isDrawer:!0,children:(0,B.jsxs)(ii,{side:e,"data-sidebar":`sidebar`,"data-mobile":`true`,style:{"--sheet-width":`var(--sidebar-width-mobile)`},children:[(0,B.jsxs)(ai,{visuallyHidden:!0,children:[(0,B.jsx)(oi,{children:`Navigation`}),(0,B.jsx)(si,{children:`Sidebar navigation panel.`})]}),n]})});if(t===`none`)return(0,B.jsx)(`aside`,{className:Hi.root,"data-side":e,"data-state":`expanded`,children:n});let i=r.open?`expanded`:`collapsed`;return(0,B.jsx)(`aside`,{className:Hi.root,"data-hc-sidebar-root":``,"data-side":e,"data-state":i,children:n})}function $i(e){return(0,B.jsx)(`div`,{className:Hi.header,"data-hc-sidebar-header":``,children:e.children})}function ea(e){return(0,B.jsx)(`div`,{className:Hi.content,children:e.children})}function ta(e){return(0,B.jsx)(`div`,{className:Hi.footer,children:e.children})}function na(e){let{className:t,children:n,...r}=e;return(0,B.jsx)(`main`,{...r,className:V(Hi.inset,t),"data-hc-main-panel":``,children:n})}function ra(e){let{className:t,children:n,...r}=e,i=Ki(),a=i.isMobile?i.openMobile?`Close sidebar`:`Open sidebar`:i.open?`Collapse sidebar`:`Expand sidebar`;return(0,B.jsx)(`button`,{...r,type:e.type??`button`,className:V(Hi.trigger,t),"aria-label":e[`aria-label`]??a,"aria-expanded":i.isMobile?i.openMobile:i.open,onClick:t=>{e.onClick?.(t),t.defaultPrevented||i.toggleSidebar()},children:n??(0,B.jsx)(Sr,{})})}function ia(e){let{isMobile:t}=Ki();return t?(0,B.jsx)(ra,{className:e.className}):null}function aa(e){return(0,B.jsx)(`section`,{className:Hi.group,children:e.children})}function oa(e){return(0,B.jsx)(`p`,{className:Hi.groupLabel,children:e.children})}function sa(e){return(0,B.jsx)(`div`,{className:Hi.groupContent,children:e.children})}function ca(e){return(0,B.jsx)(`nav`,{className:Hi.menu,"aria-label":e.ariaLabel,children:e.children})}function la(e){return(0,B.jsx)(`div`,{className:Hi.menuItem,children:e.children})}function ua(e){return(0,B.jsx)(`div`,{className:Hi.footerActions,children:e.children})}function da(e){return(0,B.jsx)(`div`,{className:Hi.footerMenu,children:e.children})}function fa(e){return(0,B.jsx)(`div`,{className:Hi.footerAction,children:e.children})}function pa(e,t=e){return{"--sidebar-width":e,"--sidebar-width-icon":`4rem`,"--sidebar-width-mobile":t}}function ma(e){return(0,B.jsxs)(Qi,{collapsible:`icon`,children:[(0,B.jsx)($i,{children:(0,B.jsxs)(`div`,{className:Hi.headerRow,children:[(0,B.jsx)(ha,{subtitle:`Admin console`}),(0,B.jsx)(ra,{className:Hi.sidebarToggle})]})}),(0,B.jsx)(ea,{children:e.groups.map(e=>(0,B.jsxs)(aa,{children:[(0,B.jsx)(oa,{children:e.label}),(0,B.jsx)(sa,{children:(0,B.jsx)(ca,{ariaLabel:e.label,children:e.items.map(e=>(0,B.jsx)(la,{children:(0,B.jsx)(ga,{item:e})},e.to))})})]},e.label))}),(0,B.jsxs)(ta,{children:[(0,B.jsxs)(`div`,{className:Hi.footerBlock,children:[(0,B.jsx)(_a,{version:e.version}),(0,B.jsx)(ua,{children:(0,B.jsx)(da,{children:(0,B.jsx)(fa,{children:(0,B.jsx)(Vi,{labelClassName:Hi.themeToggleLabel})})})})]}),e.showLogout?(0,B.jsx)(va,{onLogout:e.onLogout}):null]})]})}function ha(e){return(0,B.jsx)(`div`,{className:Hi.brand,children:(0,B.jsxs)(`div`,{className:Hi.brandTitle,children:[(0,B.jsx)(`span`,{className:Hi.brandMark,"aria-hidden":`true`,children:(0,B.jsx)(pr,{})}),(0,B.jsxs)(`div`,{className:Hi.brandText,children:[(0,B.jsx)(`h1`,{children:`HybridClaw`}),e.subtitle?(0,B.jsx)(`span`,{className:Hi.eyebrow,children:e.subtitle}):null]})]})})}function ga(e){let{isMobile:t,setOpenMobile:n}=Zi();return(0,B.jsxs)(D,{to:e.item.to,title:e.item.label,activeProps:{className:V(Hi.menuButton,Hi.menuButtonActive)},inactiveProps:{className:Hi.menuButton},activeOptions:{exact:!0},onClick:()=>{t&&n(!1)},children:[(0,B.jsx)(`span`,{className:Hi.menuIcon,"aria-hidden":`true`,children:(0,B.jsx)(e.item.icon,{})}),(0,B.jsx)(`span`,{children:e.item.label})]})}function _a(e){return e.version?(0,B.jsx)(`div`,{className:Hi.footerMeta,children:(0,B.jsxs)(`span`,{className:Hi.footerValue,children:[`v`,e.version]})}):null}function va(e){let[t,n]=(0,R.useState)(!1);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:Hi.footerDivider}),(0,B.jsx)(ua,{children:(0,B.jsx)(da,{children:(0,B.jsx)(fa,{children:(0,B.jsxs)(`button`,{className:Hi.footerButton,type:`button`,onClick:()=>n(!0),children:[(0,B.jsx)(`span`,{className:Hi.icon,"aria-hidden":`true`,children:(0,B.jsx)(_r,{})}),`Forget token`]})})})}),(0,B.jsx)(ri,{open:t,onOpenChange:n,children:(0,B.jsxs)(ii,{size:`sm`,role:`alertdialog`,children:[(0,B.jsxs)(ai,{children:[(0,B.jsx)(oi,{children:`Forget token?`}),(0,B.jsx)(si,{children:`You will be logged out and will need to enter your token again to access the admin console.`})]}),(0,B.jsxs)(ci,{children:[(0,B.jsx)(li,{className:`ghost-button`,children:`Cancel`}),(0,B.jsx)(li,{className:`danger-button`,onClick:e.onLogout,children:`Forget token`})]})]})})]})}var ya=[{href:`/chat`,icon:`chat`,label:`Chat`},{href:`/agents`,icon:`agents`,label:`Agents`},{href:`/admin`,icon:`admin`,label:`Admin`},{href:`https://github.com/HybridAIOne/hybridclaw`,image:`/icons/github.svg`,label:`GitHub`},{href:`/docs`,icon:`docs`,label:`Docs`}],ba={admin:qn,agents:Yn,chat:Qn,docs:sr},xa=[`/admin`,`/agents`,`/chat`],Sa=3e4;function Ca(e){return y({queryKey:[`config`,e],queryFn:()=>Mt(e),staleTime:3e4,refetchInterval:Sa,refetchOnWindowFocus:!0}).data?.config.ui?.navigation}function wa(e,t){return e===t||e.startsWith(`${t}/`)}function Ta(e){return/^https?:\/\//iu.test(e)}function Ea(e){return xa.some(t=>e===t||e.startsWith(`${t}/`))}function Da({item:e}){return e.image?(0,B.jsx)(`img`,{src:e.image,alt:``,"aria-hidden":`true`,decoding:`async`,draggable:!1,referrerPolicy:`no-referrer`}):(0,B.jsx)(e.icon?ba[e.icon]:rr,{})}function Oa(e,t){return t.filter(t=>!Ta(t.href)&&wa(e,t.href)).sort((e,t)=>t.href.length-e.href.length)[0]?.href??null}function ka(e){let t=I({select:e=>e.location.pathname}),n=e.items??ya;if(n.length===0)return null;let r=Oa(t,n);return(0,B.jsx)(`nav`,{className:`view-switch`,"aria-label":`Switch view`,children:n.map((e,t)=>{let n=`${e.href}:${e.label}:${t}`,i=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`nav-link-icon`,"aria-hidden":`true`,children:(0,B.jsx)(Da,{item:e})}),(0,B.jsx)(`span`,{children:e.label})]}),a=Ta(e.href);if(a||!Ea(e.href)){let t=e.href===r;return(0,B.jsx)(`a`,{className:t?`view-switch-link active`:`view-switch-link`,href:e.href,"aria-current":t?`page`:void 0,target:a?`_blank`:void 0,rel:a?`noopener noreferrer`:void 0,children:i},n)}return e.href===r?(0,B.jsx)(`span`,{className:`view-switch-link active`,"aria-current":`page`,children:i},n):(0,B.jsx)(D,{className:`view-switch-link`,to:e.href,children:i},n)})})}var Aa=pa(`15.5rem`,`18rem`),ja=(0,R.createContext)({emailEnabled:!1});function Ma(e){let t=Gn(),n=Wn(t),r=I({select:e=>e.location.pathname}),i=y({queryKey:[`status`,t.token],queryFn:()=>je(t.token),initialData:t.gatewayStatus??void 0,enabled:n,staleTime:3e4}),a=Ca(t.token),o=(i.data?.emailEnabled??t.gatewayStatus?.emailEnabled)===!0,s=Rr.map(e=>({...e,items:e.items.filter(e=>!e.requiresEmail||o||r===e.to)})).filter(e=>e.items.length>0),c=Br(r);return(0,B.jsx)(ja.Provider,{value:{emailEnabled:o},children:(0,B.jsxs)(Xi,{style:Aa,children:[(0,B.jsx)(ma,{groups:s,version:t.gatewayStatus?.version,showLogout:!!t.token,onLogout:t.logout}),(0,B.jsxs)(na,{className:`main-panel`,children:[(0,B.jsxs)(`div`,{className:`topbar`,children:[(0,B.jsx)(`div`,{className:`topbar-title`,children:(0,B.jsxs)(`div`,{className:`topbar-heading`,children:[(0,B.jsx)(ia,{}),(0,B.jsx)(`h2`,{children:c.label})]})}),(0,B.jsx)(ka,{items:a})]}),(0,B.jsx)(`div`,{className:`page-content`,children:e.children})]})]})})}function Na(){return(0,R.useContext)(ja)}var Pa={skeleton:`_skeleton_z1cth_1`,"skeleton-pulse":`_skeleton-pulse_z1cth_1`},Fa=(0,R.forwardRef)(function({className:e,...t},n){return(0,B.jsx)(`div`,{ref:n,"data-slot":`skeleton`,className:V(Pa.skeleton,e),...t})}),Ia=(0,R.createContext)(null);function La(){let e=(0,R.useContext)(Ia);if(!e)throw Error(`<ToggleGroupItem> must be used inside <ToggleGroup>`);return e}function Ra(e){let t=e.disabled??!1,n=(0,R.useMemo)(()=>({value:e.value,onValueChange:e.onValueChange,disabled:t}),[e.value,e.onValueChange,t]);return(0,B.jsx)(Ia.Provider,{value:n,children:(0,B.jsx)(`fieldset`,{"aria-label":e.ariaLabel,className:V(`binary-toggle`,e.size===`sm`&&`toggle-group--sm`,e.className),"data-disabled":t||void 0,children:e.children})})}function za(e){let t=La(),n=e.value===t.value,r=e.activeTone??`is-on`,i=e.disabled??t.disabled;return(0,B.jsx)(`button`,{type:`button`,"aria-pressed":n,"data-state":n?r===`is-off`?`off`:`on`:`off`,className:V(`binary-toggle-button`,n&&`active`,n&&r),disabled:i,"data-disabled":i||void 0,onClick:()=>{!n&&!i&&t.onValueChange(e.value)},children:e.children})}function Ba(e,t){let[n,r]=(0,R.useState)(t.initialSort);return{sortedRows:(0,R.useMemo)(()=>{let r=t.sorters[n.key];return r?[...e].sort((e,t)=>{let i=r(e,t);return i===0?0:n.direction===`asc`?i:-i}):[...e]},[t.sorters,e,n]),sortState:n,toggleSort:e=>{r(n=>n.key===e?{key:e,direction:n.direction===`asc`?`desc`:`asc`}:{key:e,direction:t.defaultDirections?.[e]||`asc`})}}}function Va(e){let t=e.sortState.key===e.sortKey;return(0,B.jsx)(`th`,{"aria-sort":t?e.sortState.direction===`asc`?`ascending`:`descending`:`none`,children:(0,B.jsxs)(`button`,{type:`button`,className:`table-sort-button`,onClick:()=>e.onToggle(e.sortKey),children:[(0,B.jsx)(`span`,{children:e.label}),(0,B.jsx)(`span`,{"aria-hidden":`true`,className:t?`table-sort-indicator is-active is-${e.sortState.direction}`:`table-sort-indicator`})]})})}function Ha(e){return!e.description&&!e.actions?null:(0,B.jsxs)(`div`,{className:`page-header`,children:[e.description?(0,B.jsx)(`div`,{className:`supporting-text page-header-description`,children:e.description}):(0,B.jsx)(`span`,{}),e.actions?(0,B.jsx)(`div`,{className:`header-actions`,children:e.actions}):null]})}function Ua(e){let t=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{children:e.label}),e.loading?(0,B.jsx)(Fa,{className:`metric-card-value-skeleton`}):(0,B.jsx)(`strong`,{children:e.value}),e.loading&&e.detail!==void 0?(0,B.jsx)(Fa,{className:`metric-card-detail-skeleton`}):!e.loading&&e.detail?(0,B.jsx)(`small`,{children:e.detail}):null]});return e.href?(0,B.jsx)(`a`,{className:`metric-card metric-card-link`,href:e.href,children:t}):(0,B.jsx)(`div`,{className:`metric-card`,children:t})}function Wa(e){return(0,B.jsx)(Ra,{value:e.value,onValueChange:t=>e.onChange(t),ariaLabel:e.ariaLabel,className:e.className,disabled:e.disabled,size:e.size,children:e.options.map(e=>(0,B.jsx)(za,{value:e.value,activeTone:e.activeTone,children:e.label},e.value))})}function Ga(e){let t=e.value?e.trueLabel??`on`:e.falseLabel??`off`,n=!e.value&&e.falseTone===`danger`?` tone-danger`:``;return(0,B.jsxs)(`span`,{className:e.value?`boolean-pill is-on`:`boolean-pill is-off${n}`,children:[(0,B.jsx)(`span`,{className:`boolean-pill-dot`}),t]})}function H(e){return e instanceof Error?e.message||`An unexpected error occurred.`:typeof e==`string`?e:typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`?e.message||`An unexpected error occurred.`:String(e)}function Ka(e){return new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}).format(e)}function qa(e){return typeof e==`number`&&Number.isFinite(e)?e:0}function Ja(e){return`${Ka(qa(e.inputTokens))} in / ${Ka(qa(e.outputTokens))} out`}function Ya(e){return`${Math.round(e*100)}%`}function Xa(e){return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:e>=1?2:4,maximumFractionDigits:e>=1?2:6}).format(e)}function Za(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return`unknown`;let n=Date.now()-t.getTime(),r=6e4,i=60*r,a=24*i;return n<r?`just now`:n<i?`${Math.floor(n/r)}m ago`:n<a?`${Math.floor(n/i)}h ago`:`${Math.floor(n/a)}d ago`}function Qa(e){if(!e)return`never`;let t=new Date(e);return Number.isNaN(t.getTime())?`unknown`:t.toLocaleString()}function $a(e){let t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return[t?`${t}d`:null,n?`${n}h`:null,`${r}m`].filter(Boolean).join(` `)}function eo(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function to(e){return e.split(/[\n,]/g).map(e=>e.trim()).filter(Boolean)}function no(e){return(e||[]).join(`, `)}function ro(e){let t=e.latestMessage?.content.replace(/\s+/g,` `).trim();return t?t.length>140?`${t.slice(0,137)}...`:t:`No message content`}function io(e){return e.participants.length===0?`No participants`:e.participants.length<=2?e.participants.join(` -> `):`${e.participants.slice(0,2).join(` -> `)} +${e.participants.length-2}`}function ao(e){return`${e} message${e===1?``:`s`}`}function oo(e){return e===`escalate`||e===`policy.update`?`mailbox-role-pill needs-reply`:`mailbox-role-pill replied`}function so(e){let{message:t}=e;return(0,B.jsxs)(`article`,{className:`mailbox-message-card user`,children:[(0,B.jsxs)(`div`,{className:`mailbox-message-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:t.senderAgentId}),(0,B.jsxs)(`small`,{children:[`To: `,t.recipientAgentId]}),(0,B.jsx)(`small`,{children:Qa(t.createdAt)})]}),(0,B.jsx)(`span`,{children:t.intent})]}),(0,B.jsxs)(`div`,{className:`mailbox-message-metadata`,children:[(0,B.jsx)(`small`,{children:t.id}),t.parentMessageId?(0,B.jsxs)(`small`,{children:[`Parent: `,t.parentMessageId]}):null]}),(0,B.jsx)(`div`,{className:`mailbox-message-body`,children:t.content})]})}function co(){let e=Gn(),[t,n]=(0,R.useState)(null),r=y({queryKey:[`a2a-inbox`,e.token,t],queryFn:()=>$e(e.token,t)}),i=r.data?.threads||[],a=t||r.data?.selectedThreadId||null,o=i.find(e=>e.id===a)||null,s=r.data?.messages||[];return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{}),(0,B.jsxs)(`div`,{className:`mailbox-shell a2a-inbox-shell`,children:[(0,B.jsxs)(`section`,{className:`mailbox-main`,children:[(0,B.jsx)(`div`,{className:`mailbox-column-header`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:`Threads`}),(0,B.jsx)(`small`,{children:r.isLoading&&!r.data?`Loading threads...`:`${i.length} total`})]})}),(0,B.jsx)(`div`,{className:`mailbox-thread-list`,children:r.isLoading&&!r.data?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading A2A threads...`}):r.isError?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(r.error)}):i.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No A2A threads recorded.`}):i.map(e=>{let t=e.latestMessage;return(0,B.jsx)(`div`,{className:[`mailbox-thread-row`,e.id===a?`is-unread`:``].filter(Boolean).join(` `),children:(0,B.jsxs)(`button`,{className:`mailbox-thread-button`,type:`button`,onClick:()=>n(e.id),children:[(0,B.jsxs)(`div`,{className:`mailbox-thread-summary`,children:[(0,B.jsx)(`strong`,{className:`mailbox-thread-sender`,children:e.id}),(0,B.jsx)(`span`,{className:`mailbox-thread-separator`,children:`-`}),(0,B.jsx)(`strong`,{className:`mailbox-thread-subject`,children:t?.intent||`thread`}),(0,B.jsx)(`span`,{className:`mailbox-thread-separator`,children:`-`}),(0,B.jsx)(`span`,{className:`mailbox-thread-preview`,children:ro(e)})]}),(0,B.jsx)(`span`,{className:`mailbox-thread-time`,children:t?.createdAt?Za(t.createdAt):`unknown`})]})},e.id)})})]}),(0,B.jsx)(`section`,{className:`mailbox-detail`,children:o?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`mailbox-detail-header`,children:(0,B.jsxs)(`div`,{className:`mailbox-detail-copy`,children:[(0,B.jsxs)(`div`,{className:`mailbox-detail-heading`,children:[(0,B.jsx)(`h3`,{children:o.id}),o.latestMessage?(0,B.jsx)(`span`,{className:oo(o.latestMessage.intent),children:o.latestMessage.intent}):null]}),(0,B.jsxs)(`p`,{className:`supporting-text`,children:[io(o),` ·`,` `,ao(o.messageCount),` ·`,` `,o.ownerCoworkerId?`Owned by ${o.ownerCoworkerId}`:`No owner`]}),o.latestMessage?(0,B.jsxs)(`p`,{className:`supporting-text`,children:[`Last message:`,` `,Qa(o.latestMessage.createdAt)]}):null]})}),(0,B.jsx)(`div`,{className:`mailbox-message-list`,children:r.isFetching&&!r.data?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading messages...`}):s.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No messages in this thread.`}):s.map(e=>(0,B.jsx)(so,{message:e},e.id))})]}):(0,B.jsx)(`div`,{className:`empty-state mailbox-detail-empty`,children:`Select an A2A thread.`})})]})]})}var lo={card:`_card_1739l_1`,header:`_header_1739l_34`,action:`_action_1739l_41`,title:`_title_1739l_45`,description:`_description_1739l_54`,content:`_content_1739l_70`,footer:`_footer_1739l_77`},U=(0,R.forwardRef)(function({variant:e=`default`,interactive:t,className:n,...r},i){return(0,B.jsx)(`div`,{ref:i,"data-slot":`card`,"data-variant":e,"data-interactive":t?``:void 0,tabIndex:t?r.tabIndex??0:r.tabIndex,className:V(lo.card,n),...r})}),W=(0,R.forwardRef)(function({className:e,...t},n){return(0,B.jsx)(`div`,{ref:n,"data-slot":`card-header`,className:V(lo.header,e),...t})}),G=(0,R.forwardRef)(function({className:e,...t},n){return(0,B.jsx)(`h4`,{ref:n,"data-slot":`card-title`,className:V(lo.title,e),...t})}),uo=(0,R.forwardRef)(function({className:e,...t},n){return(0,B.jsx)(`p`,{ref:n,"data-slot":`card-description`,className:V(lo.description,e),...t})}),fo=(0,R.forwardRef)(function({className:e,...t},n){return(0,B.jsx)(`div`,{ref:n,"data-slot":`card-action`,className:V(lo.action,e),...t})}),K=(0,R.forwardRef)(function({className:e,...t},n){return(0,B.jsx)(`div`,{ref:n,"data-slot":`card-content`,className:V(lo.content,e),...t})});(0,R.forwardRef)(function({className:e,...t},n){return(0,B.jsx)(`div`,{ref:n,"data-slot":`card-footer`,className:V(lo.footer,e),...t})});function po(e){let t=(0,R.useRef)(e);return(0,R.useLayoutEffect)(()=>{t.current=e}),(0,R.useCallback)((...e)=>t.current(...e),[])}var mo=(0,R.createContext)(null);function ho(){return(0,R.useContext)(mo)}var go=(0,R.createContext)(null);function _o(){return(0,R.useContext)(go)}var vo=(0,R.createContext)(null),yo=(0,R.createContext)(null),bo=(0,R.createContext)(null);function xo(){return(0,R.useContext)(vo)}function So(){return(0,R.useContext)(bo)}var Co={label:`_label_g5ybj_1`};function wo({className:e,...t}){return(0,B.jsx)(`label`,{"data-slot":`label`,className:V(Co.label,e),...t})}var To=(0,R.createContext)({id:void 0,labelId:void 0,descriptionId:void 0,errorId:void 0,invalid:void 0,disabled:void 0,required:void 0,error:null,setError:()=>{},touched:!1,setTouched:()=>{}});function Eo(){return(0,R.useContext)(To)}function Do(e){let t=Eo(),n=Oo(t.descriptionId,t.invalid?t.errorId:void 0,e[`aria-describedby`]),r=e.required??t.required;return{...e,id:e.id??t.id,disabled:e.disabled??t.disabled,required:r,"aria-invalid":e[`aria-invalid`]??t.invalid,"aria-required":e[`aria-required`]??(r?!0:void 0),"aria-describedby":n}}function Oo(...e){let t=e.filter(e=>!!e);return t.length===0?void 0:t.join(` `)}var ko={fieldSet:`_fieldSet_ykv3y_3`,legend:`_legend_ykv3y_10`,group:`_group_ykv3y_30`,field:`_field_ykv3y_3`,orientationVertical:`_orientationVertical_ykv3y_58`,orientationHorizontal:`_orientationHorizontal_ykv3y_66`,orientationResponsive:`_orientationResponsive_ykv3y_81`,content:`_content_ykv3y_104`,label:`_label_ykv3y_114`,title:`_title_ykv3y_126`,description:`_description_ykv3y_139`,error:`_error_ykv3y_159`,errorList:`_errorList_ykv3y_166`,separator:`_separator_ykv3y_176`,separatorLine:`_separatorLine_ykv3y_187`,separatorLabel:`_separatorLabel_ykv3y_194`},Ao=e=>e==null||typeof e==`string`&&e.trim()===``?`Required.`:null;function jo(e){return e===void 0?Ao:t=>t==null||typeof t==`string`&&t.trim()===``?e:null}function Mo(e,t){return n=>typeof n==`string`?(e.lastIndex=0,e.test(n)?null:t):null}function No(...e){let t=e.filter(e=>typeof e==`function`);return e=>{for(let n of t){let t=n(e);if(t)return t}return null}}var Po={vertical:ko.orientationVertical,horizontal:ko.orientationHorizontal,responsive:ko.orientationResponsive};function Fo({className:e,...t}){return(0,B.jsx)(`fieldset`,{"data-slot":`field-set`,className:V(ko.fieldSet,e),...t})}function Io({className:e,variant:t=`legend`,...n}){return(0,B.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:V(ko.legend,e),...n})}function Lo({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`field-group`,className:V(ko.group,e),...t})}function q({className:e,orientation:t=`vertical`,invalid:n,disabled:r,required:i,controlId:a,onErrorChange:o,error:s,touched:c,validate:l,onBlur:u,onChange:d,...f}){let p=_o(),m=(0,R.useId)(),h=a??p?.id??m,g=i??p?.required,_=r??p?.disabled,v=l??p?.validate,[y,b]=(0,R.useState)(null),[x,S]=(0,R.useState)(!1),C=po(o??Ro),w=s!==void 0,T=c??x,E=(0,R.useCallback)(e=>{w||b(t=>t===e?t:e)},[w]),D=w?s:y??p?.error??null,O=xo();(0,R.useEffect)(()=>{O&&O.registerError(h,D)},[O,h,D]),(0,R.useEffect)(()=>{if(O)return()=>O.registerError(h,null)},[O,h]),(0,R.useEffect)(()=>{if(!(!O||w))return O.registerErrorSetter(h,e=>{e!==null&&S(!0),E(e)})},[O,h,w,E]),(0,R.useEffect)(()=>{C(D)},[D,C]);let k=So(),A=k?.submitAttempted??!1,j=k?.resetSeq??0,M=(0,R.useRef)(j);M.current!==j&&(M.current=j,S(!1),b(null));let N=po(v??zo);(0,R.useEffect)(()=>{if(!(v===void 0||!O))return O.registerValidator(h,()=>{let e=N();return E(e),e})},[O,h,v,N,E]);let P;P=n===void 0?(w||T||A)&&D!==null?!0:void 0:n;let F=(0,R.useMemo)(()=>({id:h,labelId:`${h}-label`,descriptionId:`${h}-description`,errorId:`${h}-error`,invalid:P,disabled:_,required:g,error:D,setError:E,touched:T,setTouched:S}),[h,P,_,g,D,E,T]);return(0,B.jsx)(To.Provider,{value:F,children:(0,B.jsx)(`div`,{"data-slot":`field`,"data-orientation":t,"data-invalid":P||void 0,"data-disabled":_||void 0,className:V(ko.field,Po[t],e),onBlur:e=>{S(!0),u?.(e)},onChange:e=>{S(!0),d?.(e)},...f})})}function Ro(){}function zo(){return null}function Bo({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`field-content`,className:V(ko.content,e),...t})}function J({className:e,htmlFor:t,id:n,...r}){let i=Eo();return(0,B.jsx)(wo,{"data-slot":`field-label`,id:n??i.labelId,htmlFor:t??i.id,className:V(ko.label,e),...r})}function Vo({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`field-title`,className:V(ko.title,e),...t})}function Ho({className:e,id:t,...n}){let r=Eo();return(0,B.jsx)(`p`,{"data-slot":`field-description`,id:t??r.descriptionId,className:V(ko.description,e),...n})}function Uo(e,t,n){if(e)return e;if(t?.length){let e=[...new Map(t.map(e=>[e?.message,e])).values()].filter(e=>!!e?.message);return e.length===0?n:e.length===1?e[0]?.message:(0,B.jsx)(`ul`,{className:ko.errorList,children:e.map(e=>(0,B.jsx)(`li`,{children:e.message},e.message))})}return n}function Wo({className:e,children:t,errors:n,id:r,...i}){let a=Eo(),o=Uo(t,n,a.error);return!o||!a.invalid?null:(0,B.jsx)(`div`,{...i,role:`alert`,"data-slot":`field-error`,id:r??a.errorId,className:V(ko.error,e),children:o})}var Go={input:`_input_19no1_1`,sizeDefault:`_sizeDefault_19no1_68`,sizeSm:`_sizeSm_19no1_73`},Ko={default:Go.sizeDefault,sm:Go.sizeSm};function Y({className:e,type:t=`text`,size:n=`default`,...r}){return(0,B.jsx)(`input`,{...Do(r),type:t,"data-slot":`input`,"data-size":n,className:V(Go.input,Ko[n],e)})}var qo={textarea:`_textarea_1euii_1`,autoSize:`_autoSize_1euii_49`};function Jo({className:e,autoSize:t=!1,...n}){return(0,B.jsx)(`textarea`,{...Do(n),"data-slot":`textarea`,"data-auto-size":t?``:void 0,className:V(qo.textarea,t&&qo.autoSize,e)})}function Yo(e){return e.length>18?`${e.slice(0,12)}...${e.slice(-6)}`:e}function Xo(e){return e.status===`revoked`?(0,B.jsx)(Ga,{value:!1,falseLabel:`revoked`,falseTone:`danger`}):(0,B.jsx)(Ga,{value:!0,trueLabel:`trusted`})}function Zo(){let e=Gn(),t=o(),[n,r]=(0,R.useState)(null),[i,a]=(0,R.useState)(``),[s,c]=(0,R.useState)(``),[l,u]=(0,R.useState)(``),[d,f]=(0,R.useState)(``),[p,m]=(0,R.useState)(``),[h,_]=(0,R.useState)(``),[v,b]=(0,R.useState)(``),[x,S]=(0,R.useState)(``),[C,w]=(0,R.useState)(``),[T,E]=(0,R.useState)(``),[D,O]=(0,R.useState)(``),[k,A]=(0,R.useState)(!0),[j,M]=(0,R.useState)(null),[N,P]=(0,R.useState)(null),[F,I]=(0,R.useState)(``),ee=y({queryKey:[`a2a-trust`,e.token],queryFn:()=>Be(e.token)}),L=g({mutationFn:t=>et(e.token,{peerId:t,reason:i}),onSuccess:n=>{t.setQueryData([`a2a-trust`,e.token],n)}}),te=g({mutationFn:()=>{let t=h.trim()?JSON.parse(h):void 0;return tt(e.token,{peerId:s,agentCardUrl:l||void 0,deliveryUrl:d||void 0,publicKeyFingerprint:p||void 0,publicKeyJwk:t,reason:v||void 0})},onSuccess:n=>{t.setQueryData([`a2a-trust`,e.token],n)}}),ne=g({mutationFn:t=>nt(e.token,t),onSuccess:n=>{t.setQueryData([`a2a-trust`,e.token],n),r(n.peers[0]?.peerId||null)}}),re=g({mutationFn:()=>rt(e.token,{peerUrl:x||void 0,canonicalId:C||void 0,canonicalInstanceId:T||void 0,reason:D||void 0,notifyPeer:k}),onSuccess:n=>{t.setQueryData([`a2a-trust`,e.token],n),P(n),r(n.proposal.peerId)}}),ie=g({mutationFn:()=>it(e.token,{peerUrl:x||void 0,canonicalId:C||void 0,canonicalInstanceId:T||void 0}),onSuccess:e=>{M(e),P(null)}}),ae=g({mutationFn:t=>at(e.token,t,F),onSuccess:n=>{t.setQueryData([`a2a-trust`,e.token],n)}}),oe=g({mutationFn:t=>ot(e.token,t,F),onSuccess:n=>{t.setQueryData([`a2a-trust`,e.token],n)}}),se=ee.data?.peers||[],ce=ee.data?.pairingRequests||[],le=se.find(e=>e.peerId===n)||se[0]||null;function ue(e){c(e.peerId),u(e.agentCardUrl),f(e.deliveryUrl),m(e.publicKeyFingerprint),_(e.publicKeyJwk?JSON.stringify(e.publicKeyJwk,null,2):``),b(``)}function de(){M(null),P(null)}return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Local identity`})}),(0,B.jsx)(K,{children:ee.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading identity...`}):ee.data?(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Instance`}),(0,B.jsx)(`strong`,{children:ee.data.identity.instanceId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Public key`}),(0,B.jsx)(`strong`,{children:Yo(ee.data.identity.publicKeyFingerprint)})]})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Identity unavailable.`})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Add peer instance`}),(0,B.jsx)(uo,{children:`Fetch a peer Agent Card, pin its public key, and notify the remote operator.`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Peer URL`}),(0,B.jsx)(Y,{placeholder:`https://peer.example.com`,value:x,onChange:e=>{S(e.target.value),de()}})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Canonical agent id`}),(0,B.jsx)(Y,{placeholder:`agent@user@instance`,value:C,onChange:e=>{w(e.target.value),de()}})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Canonical instance id`}),(0,B.jsx)(Y,{placeholder:`instance-prod`,value:T,onChange:e=>{E(e.target.value),de()}})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Reason`}),(0,B.jsx)(Y,{value:D,onChange:e=>O(e.target.value)})]}),(0,B.jsxs)(`label`,{className:`inline-checkbox`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:k,onChange:e=>A(e.target.checked)}),(0,B.jsx)(`span`,{children:`Send peer-side approval prompt`})]}),(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:!x.trim()&&!C.trim()&&!T.trim()||ie.isPending,onClick:()=>ie.mutate(),children:`Fetch peer`}),j?(0,B.jsx)(`div`,{className:`info-row`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:j.proposal.peerId}),(0,B.jsx)(`small`,{children:j.proposal.agentCardUrl}),(0,B.jsx)(`small`,{children:j.proposal.deliveryUrl}),(0,B.jsx)(`small`,{children:j.proposal.publicKeyFingerprint})]})}):null,(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:!j||re.isPending||ie.isPending,onClick:()=>re.mutate(),children:`Trust peer`}),N?(0,B.jsx)(`small`,{className:`row-status-note`,children:`Trusted ${N.proposal.peerId} (${Yo(N.proposal.publicKeyFingerprint)}); peer prompt ${N.remoteNotification.status}.`}):null,re.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:re.error instanceof Error?re.error.message:`Pairing failed.`}):null,ie.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:ie.error instanceof Error?ie.error.message:`Pairing preview failed.`}):null]})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Incoming pairing requests`}),(0,B.jsx)(uo,{children:`${ce.length} request${ce.length===1?``:`s`}`})]}),(0,B.jsx)(K,{children:ce.length?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Decision reason`}),(0,B.jsx)(Y,{value:F,onChange:e=>I(e.target.value)})]}),(0,B.jsx)(`div`,{className:`list-stack`,children:ce.map(e=>(0,B.jsxs)(`div`,{className:`info-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.peerId}),(0,B.jsx)(`small`,{children:`${e.status} - ${Yo(e.publicKeyFingerprint)}`}),e.pairingId?(0,B.jsx)(`small`,{children:`Pairing ${e.pairingId}`}):null]}),(0,B.jsxs)(`div`,{className:`row-actions`,children:[(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:e.status!==`pending`||ae.isPending,onClick:()=>ae.mutate(e.requestId),children:`Approve`}),(0,B.jsx)(`button`,{className:`danger-button`,type:`button`,disabled:e.status!==`pending`||oe.isPending,onClick:()=>oe.mutate(e.requestId),children:`Decline`})]})]},e.requestId))}),ae.error||oe.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:(ae.error||oe.error)instanceof Error?(ae.error||oe.error)?.message:`Pairing decision failed.`}):null]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No incoming pairing requests.`})})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Trusted peers`}),(0,B.jsx)(uo,{children:`${se.length} peer${se.length===1?``:`s`}`})]}),(0,B.jsx)(K,{children:ee.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading peers...`}):se.length?(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:se.map(e=>(0,B.jsxs)(`button`,{className:e.peerId===le?.peerId?`selectable-row active`:`selectable-row`,type:`button`,onClick:()=>r(e.peerId),children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.peerId}),(0,B.jsx)(`small`,{children:Yo(e.publicKeyFingerprint)})]}),Xo(e)]},e.peerId))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No A2A peer keys cached.`})})]}),(0,B.jsxs)(`div`,{className:`sticky-detail`,children:[(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Peer detail`})}),(0,B.jsx)(K,{children:le?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Peer`}),(0,B.jsx)(`strong`,{children:le.peerId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Status`}),(0,B.jsx)(`strong`,{children:le.status})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Trusted`}),(0,B.jsx)(`strong`,{children:Qa(le.trustedAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Last seen`}),(0,B.jsx)(`strong`,{children:Za(le.lastSeenAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Agent Card`}),(0,B.jsx)(`strong`,{children:le.agentCardUrl})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Delivery URL`}),(0,B.jsx)(`strong`,{children:le.deliveryUrl})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Fingerprint`}),(0,B.jsx)(`strong`,{children:le.publicKeyFingerprint})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Mismatch`}),(0,B.jsx)(`strong`,{children:le.lastMismatchAt||`none`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Revocation reason`}),(0,B.jsx)(Y,{value:i,onChange:e=>a(e.target.value)})]}),(0,B.jsx)(`button`,{className:`danger-button`,type:`button`,disabled:le.status===`revoked`||L.isPending,onClick:()=>L.mutate(le.peerId),children:`Revoke`}),(0,B.jsx)(`button`,{className:`danger-button`,type:`button`,disabled:ne.isPending,onClick:()=>ne.mutate(le.peerId),children:`Delete`}),(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,onClick:()=>ue(le),children:`Use in override`}),L.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:L.error instanceof Error?L.error.message:`Revocation failed.`}):null,ne.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:ne.error instanceof Error?ne.error.message:`Delete failed.`}):null]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Select a peer.`})})]}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Operator override`})}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Peer`}),(0,B.jsx)(Y,{value:s,onChange:e=>c(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Agent Card`}),(0,B.jsx)(Y,{value:l,onChange:e=>u(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Delivery URL`}),(0,B.jsx)(Y,{value:d,onChange:e=>f(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Fingerprint`}),(0,B.jsx)(Y,{value:p,onChange:e=>m(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Public JWK`}),(0,B.jsx)(Jo,{rows:5,value:h,onChange:e=>_(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Reason`}),(0,B.jsx)(Y,{value:v,onChange:e=>b(e.target.value)})]}),(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:!s.trim()||te.isPending,onClick:()=>te.mutate(),children:`Trust`}),te.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:te.error instanceof Error?te.error.message:`Trust update failed.`}):null]})})]})]})]})]})}function Qo(e){return String(e||``).trim().toLowerCase()}function X(e,t){return Qo(e).localeCompare(Qo(t))}function $o(e,t){return(e??0)-(t??0)}function es(e,t){return Number(e)-Number(t)}function ts(e,t){let n=Date.parse(String(e||``)),r=Date.parse(String(t||``));return(Number.isNaN(n)?0:n)-(Number.isNaN(r)?0:r)}function ns(e){let t=e.best_skills[0];return t?`${t.skill_name} (${t.score}/100)`:`No observed skill runs`}var rs={agent:(e,t)=>X(e.display_name,t.display_name)||X(e.agent_id,t.agent_id),score:(e,t)=>$o(e.avg_score,t.avg_score)||X(e.display_name,t.display_name),runs:(e,t)=>$o(e.total_executions,t.total_executions)||X(e.display_name,t.display_name),quality:(e,t)=>$o(e.avg_quality_score,t.avg_quality_score)||X(e.display_name,t.display_name),reliability:(e,t)=>$o(e.avg_reliability_score,t.avg_reliability_score)||X(e.display_name,t.display_name),timing:(e,t)=>$o(e.avg_timing_score,t.avg_timing_score)||X(e.display_name,t.display_name),anomalies:(e,t)=>$o(e.weekly_anomalies_flagged,t.weekly_anomalies_flagged)||X(e.display_name,t.display_name),skill:(e,t)=>X(ns(e),ns(t))||X(e.display_name,t.display_name),recent:(e,t)=>X(e.last_observed_at||``,t.last_observed_at||``)||X(e.display_name,t.display_name)},is={score:`desc`,runs:`desc`,quality:`desc`,reliability:`desc`,timing:`desc`,anomalies:`desc`,recent:`desc`};function as(){let e=Gn(),t=y({queryKey:[`agent-scoreboard`,e.token],queryFn:()=>Mn(e.token)}),n=t.data?.agents||[],r=t.data?.observed_skill_count??0,i=[...n].sort((e,t)=>t.avg_score-e.avg_score)[0],{sortedRows:a,sortState:o,toggleSort:s}=Ba(n,{initialSort:{key:`score`,direction:`desc`},sorters:rs,defaultDirections:is});return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{description:`Review agent skill track records, top strengths, and generated CV paths.`}),(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Ua,{label:`Observed agents`,value:String(n.length),detail:`with recorded skill runs`,loading:!t.data}),(0,B.jsx)(Ua,{label:`Observed skills`,value:String(r),detail:`across agent runs`,loading:!t.data}),(0,B.jsx)(Ua,{label:`Best average score`,value:i?`${i.avg_score}/100`:`0/100`,detail:i?.display_name||`No runs yet`,loading:!t.data}),(0,B.jsx)(Ua,{label:`Total runs`,value:String(n.reduce((e,t)=>e+t.total_executions,0)),detail:`skill executions`,loading:!t.data})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Agent scoreboard`}),(0,B.jsx)(uo,{children:`${a.length} agent${a.length===1?``:`s`} visible`})]}),(0,B.jsx)(K,{children:t.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading agent scoreboard...`}):a.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No agent skill runs recorded yet.`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Va,{label:`Agent`,sortKey:`agent`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Score`,sortKey:`score`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Runs`,sortKey:`runs`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Quality`,sortKey:`quality`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Reliability`,sortKey:`reliability`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Timing`,sortKey:`timing`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Best at`,sortKey:`skill`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Anomalies`,sortKey:`anomalies`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Recent`,sortKey:`recent`,sortState:o,onToggle:s}),(0,B.jsx)(`th`,{children:`CV`})]})}),(0,B.jsx)(`tbody`,{children:a.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.display_name}),(0,B.jsx)(`div`,{className:`supporting-text`,children:e.agent_id})]}),(0,B.jsxs)(`td`,{children:[e.avg_score,`/100`]}),(0,B.jsx)(`td`,{children:e.total_executions}),(0,B.jsxs)(`td`,{children:[e.avg_quality_score,`/100`]}),(0,B.jsxs)(`td`,{children:[e.avg_reliability_score,`/100`]}),(0,B.jsxs)(`td`,{children:[e.avg_timing_score,`/100`]}),(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:ns(e)}),e.best_skills[0]?(0,B.jsxs)(`div`,{className:`supporting-text`,children:[`Q `,e.best_skills[0].quality_score,` · R`,` `,e.best_skills[0].reliability_score,` · T`,` `,e.best_skills[0].timing_score]}):null]}),(0,B.jsxs)(`td`,{children:[e.weekly_anomalies_flagged,(0,B.jsxs)(`div`,{className:`supporting-text`,children:[e.weekly_anomalies_confirmed_normal,` confirmed normal`]})]}),(0,B.jsx)(`td`,{children:e.last_observed_at?Za(e.last_observed_at):`No recent runs`}),(0,B.jsx)(`td`,{children:(0,B.jsx)(`a`,{href:`/admin/agents?agent=${encodeURIComponent(e.agent_id)}&file=CV.md`,children:`CV.md`})})]},e.agent_id))})]})})})]})]})}var os={button:`_button_kxq2k_1`,default:`_default_kxq2k_50`,ghost:`_ghost_kxq2k_60`,outline:`_outline_kxq2k_70`,danger:`_danger_kxq2k_80`,sizeDefault:`_sizeDefault_kxq2k_92`,sizeSm:`_sizeSm_kxq2k_97`,sizeIcon:`_sizeIcon_kxq2k_103`},ss={default:os.default,ghost:os.ghost,outline:os.outline,danger:os.danger},cs={default:os.sizeDefault,sm:os.sizeSm,icon:os.sizeIcon},Z=(0,R.forwardRef)(function({variant:e=`default`,size:t=`default`,loading:n=!1,disabled:r,className:i,onClick:a,type:o,render:s,children:c,...l},u){let d=r||n,f=e=>{if(d){e.preventDefault();return}a?.(e)},p=V(os.button,ss[e],cs[t],i),m={"data-disabled":d?``:void 0,"data-loading":n?``:void 0};if(s&&(0,R.isValidElement)(s)){let e=s.props;return(0,R.cloneElement)(s,{...l,ref:u,className:V(p,e.className),"aria-disabled":d||void 0,"aria-busy":n||void 0,onClick:f,children:c??e.children,...m})}return(0,B.jsx)(`button`,{ref:u,type:o??`button`,className:p,disabled:r,"aria-disabled":n||void 0,"aria-busy":n||void 0,onClick:f,...m,...l,children:c})}),ls={wrapper:`_wrapper_1gpbx_1`,select:`_select_1gpbx_12`,chevron:`_chevron_1gpbx_55`,option:`_option_1gpbx_66`,optgroup:`_optgroup_1gpbx_71`,sizeDefault:`_sizeDefault_1gpbx_78`,sizeSm:`_sizeSm_1gpbx_83`},us={default:ls.sizeDefault,sm:ls.sizeSm};function ds({className:e,size:t=`default`,children:n,...r}){let i=Do(r);return(0,B.jsxs)(`div`,{className:ls.wrapper,"data-slot":`native-select-wrapper`,children:[(0,B.jsx)(`select`,{...i,"data-slot":`native-select`,"data-size":t,className:V(ls.select,us[t],e),children:n}),(0,B.jsx)(er,{"aria-hidden":`true`,className:ls.chevron,"data-slot":`native-select-icon`})]})}function Q({className:e,...t}){return(0,B.jsx)(`option`,{...t,"data-slot":`native-select-option`,className:V(ls.option,e)})}function fs({className:e,...t}){return(0,B.jsx)(`optgroup`,{...t,"data-slot":`native-select-optgroup`,className:V(ls.optgroup,e)})}var ps={viewport:`_viewport_ct6pf_1`,toast:`_toast_ct6pf_18`,toastSlideIn:`_toastSlideIn_ct6pf_1`,exiting:`_exiting_ct6pf_34`,toastSlideOut:`_toastSlideOut_ct6pf_1`,body:`_body_ct6pf_38`,title:`_title_ct6pf_45`,description:`_description_ct6pf_52`,success:`_success_ct6pf_59`,error:`_error_ct6pf_68`,info:`_info_ct6pf_77`,actions:`_actions_ct6pf_86`,actionButton:`_actionButton_ct6pf_93`,closeButton:`_closeButton_ct6pf_108`},ms=(0,R.createContext)(null);function hs(){let e=(0,R.useContext)(ms);if(!e)throw Error(`useToast must be used within <ToastProvider>.`);return e}var gs=0;function _s(e){return Math.max(0,e)}function vs(e){let t=e.limit??3,[n,r]=(0,R.useState)([]),i=(0,R.useRef)(null),[a,o]=(0,R.useState)(!1);(0,R.useEffect)(()=>{function e(){o(!0)}function t(){o(!1)}return window.addEventListener(`blur`,e),window.addEventListener(`focus`,t),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`focus`,t)}},[]);let s=(0,R.useCallback)(e=>{r(t=>t.filter(t=>t.id!==e))},[]),c=(0,R.useCallback)(e=>{r(t=>t.map(t=>t.id===e?{...t,exiting:!0}:t))},[]),l=(0,R.useCallback)(e=>{let n=`toast-${++gs}`,i={id:n,title:e.title,description:e.description,type:e.type??`default`,duration:_s(e.duration??5e3),action:e.action,pinned:e.pinned??!1,exiting:!1};return r(e=>{let n=[...e,i];if(n.length>t){let e=n.length-t;return n.map(t=>e>0&&!t.exiting&&!t.pinned?(--e,{...t,exiting:!0}):t)}return n}),n},[t]),u=(0,R.useCallback)((e,t)=>{r(n=>n.map(n=>{if(n.id!==e)return n;let r={...n,...t};return t.duration!==void 0&&(r.duration=_s(t.duration)),r}))},[]),d=(0,R.useCallback)((e,t)=>l({title:e,description:t,type:`success`}),[l]),f=(0,R.useCallback)((e,t)=>l({title:e,description:t,type:`error`,duration:0}),[l]),p=(0,R.useCallback)((e,t)=>l({title:e,description:t,type:`info`}),[l]);(0,R.useEffect)(()=>{function e(e){if(e.key===`F8`){i.current?.focus({preventScroll:!0});return}e.key===`Escape`&&(!i.current||!i.current.contains(document.activeElement)||r(e=>{let t;for(let n=e.length-1;n>=0;n--)if(!e[n].exiting){t=e[n];break}return t?e.map(e=>e.id===t.id?{...e,exiting:!0}:e):e}))}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]);let m=(0,R.useMemo)(()=>({add:l,success:d,error:f,info:p,update:u,dismiss:c}),[l,d,f,p,u,c]);return(0,B.jsxs)(ms.Provider,{value:m,children:[e.children,typeof document<`u`&&(0,Vr.createPortal)((0,B.jsx)(ys,{ref:i,toasts:n,windowBlurred:a,onDismiss:c,onRemove:s}),document.body)]})}var ys=(0,R.forwardRef)(function(e,t){return(0,B.jsx)(`div`,{ref:t,className:ps.viewport,tabIndex:-1,children:e.toasts.map(t=>(0,B.jsx)(bs,{toast:t,windowBlurred:e.windowBlurred,onDismiss:e.onDismiss,onRemove:e.onRemove},t.id))})});function bs(e){let{toast:t,windowBlurred:n,onDismiss:r,onRemove:i}=e,a=(0,R.useRef)(null),[o,s]=(0,R.useState)(!1),[c,l]=(0,R.useState)(!1),u=(0,R.useRef)(t.duration),d=(0,R.useRef)(0),f=o||c||n;(0,R.useEffect)(()=>{if(t.duration<=0||t.exiting||f)return;d.current=Date.now();let e=setTimeout(()=>r(t.id),u.current);return()=>{clearTimeout(e),u.current-=Date.now()-d.current,u.current<0&&(u.current=0)}},[t.id,t.duration,t.exiting,f,r]);let p=(0,R.useCallback)(()=>i(t.id),[i,t.id]);return Hr(a,t.exiting,p),(0,B.jsxs)(`div`,{ref:a,className:V(ps.toast,t.type===`success`&&ps.success,t.type===`error`&&ps.error,t.type===`info`&&ps.info,t.exiting&&ps.exiting),"data-type":t.type,role:t.type===`error`?`alert`:`status`,"aria-live":t.type===`error`?`assertive`:`polite`,"aria-atomic":`true`,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onFocus:()=>l(!0),onBlur:()=>l(!1),children:[(0,B.jsxs)(`div`,{className:ps.body,children:[(0,B.jsx)(`p`,{className:ps.title,children:t.title}),t.description?(0,B.jsx)(`p`,{className:ps.description,children:t.description}):null]}),(0,B.jsxs)(`div`,{className:ps.actions,children:[t.action?(0,B.jsx)(`button`,{type:`button`,className:ps.actionButton,onClick:()=>{try{t.action?.onClick()}catch(e){console.error(`Toast action callback failed:`,e)}r(t.id)},children:t.action.label}):null,(0,B.jsx)(`button`,{type:`button`,className:ps.closeButton,"aria-label":`Dismiss`,onClick:()=>r(t.id),children:`×`})]})]})}function xs(e){return e&&(e.markdownFiles.find(e=>e.exists)?.name||e.markdownFiles[0]?.name)||null}function Ss(e,t){return!e||!t?null:`${e}:${t}`}function Cs(e){return e.displayName||e.name}function ws(e){return Array.isArray(e)?e.length>0?e.join(`, `):`none`:e||`none`}function Ts(e){let t=[];for(let n of e.added)t.push(`+ ${n.id}`);for(let n of e.removed)t.push(`- ${n.id}`);for(let n of e.changed)for(let e of n.fields)t.push(`~ ${n.agentId}.${e.field}: ${ws(e.before)} -> ${ws(e.after)}`);return t.length>0?t.join(`
3
- `):`No field changes recorded.`}var Es=10;function Ds(){let e=Gn(),t=o(),n=hs(),r=new URLSearchParams(window.location.search),[i,a]=(0,R.useState)(r.get(`agent`)),[s,c]=(0,R.useState)(r.get(`file`)),[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)(null),[p,m]=(0,R.useState)(Es),[h,_]=(0,R.useState)(Es),[v,b]=(0,R.useState)(``),x=(0,R.useRef)(null),S=(0,R.useRef)(``),C=y({queryKey:[`admin-agents`,e.token],queryFn:()=>pt(e.token)}),w=C.data?.find(e=>e.id===i)||C.data?.[0]||null;(0,R.useEffect)(()=>{w&&w.id!==i&&a(w.id)},[w,i]),(0,R.useEffect)(()=>{if(!C.data)return;if(!w){s!==null&&(c(null),u(null));return}let e=w.markdownFiles.find(e=>e.name===s)?.name||xs(w);e!==s&&(c(e),u(null),m(Es))},[C.data,w,s]);let T=w?.markdownFiles.find(e=>e.name===s)||null,E=Ss(w?.id,s),D=y({queryKey:[`admin-agent-markdown`,e.token,w?.id||``,s||``],queryFn:()=>yt(e.token,{agentId:w?.id||``,fileName:s||``}),enabled:!!(w?.id&&s),refetchOnWindowFocus:!1}),O=D.data?.file.name===s?D.data.file:T,k=w?.markdownFiles.filter(e=>!e.readOnly),A=w?.markdownFiles.filter(e=>e.readOnly),j=!!O?.readOnly,M=O?Cs(O):s,N=y({queryKey:[`admin-agent-markdown-revision`,e.token,w?.id||``,s||``,l||``],queryFn:()=>xt(e.token,{agentId:w?.id||``,fileName:s||``,revisionId:l||``}),enabled:!!(w?.id&&s&&l),refetchOnWindowFocus:!1}),P=y({queryKey:[`admin-team-structure`,e.token],queryFn:()=>gt(e.token),refetchOnWindowFocus:!1}),F=y({queryKey:[`admin-team-structure-revision`,e.token,d||0],queryFn:()=>_t(e.token,d||0),enabled:!!d,refetchOnWindowFocus:!1});(0,R.useEffect)(()=>{if(!E){x.current=null,S.current=``,b(``);return}if(!D.data)return;let e=D.data.file.content;(x.current!==E||v===S.current)&&(x.current=E,S.current=e,b(e))},[v,D.data,E]);let I=g({mutationFn:async()=>{if(!w||!s)throw Error(`Select an agent and markdown file first.`);return bt(e.token,{agentId:w.id,fileName:s,content:v})},onSuccess:r=>{let i=Ss(r.agent.id,r.file.name);t.setQueryData([`admin-agent-markdown`,e.token,r.agent.id,r.file.name],r),t.invalidateQueries({queryKey:[`admin-agents`,e.token]}),x.current=i,S.current=r.file.content,b(r.file.content),n.success(`Saved ${r.file.name} for ${r.agent.name||r.agent.id}.`)},onError:e=>{n.error(`Save failed`,H(e))}}),ee=g({mutationFn:async()=>{if(!w||!s||!l)throw Error(`Select a version to restore first.`);return St(e.token,{agentId:w.id,fileName:s,revisionId:l})},onSuccess:r=>{let i=Ss(r.agent.id,r.file.name);t.setQueryData([`admin-agent-markdown`,e.token,r.agent.id,r.file.name],r),t.invalidateQueries({queryKey:[`admin-agents`,e.token]}),x.current=i,S.current=r.file.content,b(r.file.content),n.success(`Restored ${r.file.name} from version history.`)},onError:e=>{n.error(`Restore failed`,H(e))}}),L=g({mutationFn:async()=>{if(!d)throw Error(`Select a team revision to restore first.`);return vt(e.token,d)},onSuccess:r=>{t.setQueryData([`admin-team-structure`,e.token],r),t.invalidateQueries({queryKey:[`admin-agents`,e.token]}),f(null),n.success(`Restored team structure from revision history.`)},onError:e=>{n.error(`Team restore failed`,H(e))}}),te=D.data?v!==D.data.file.content:!1,ne=D.data?.file.revisions||[],re=ne.slice(0,p),ie=Math.max(0,ne.length-p),ae=P.data?.revisions||[],oe=ae.slice(0,h),se=Math.max(0,ae.length-h);return(0,B.jsx)(`div`,{className:`page-stack`,children:(0,B.jsx)(U,{variant:`muted`,children:C.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading agents...`}):C.data?.length?w?s?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Agent`}),(0,B.jsx)(ds,{value:w.id,onChange:e=>{a(e.target.value),u(null)},children:C.data.map(e=>(0,B.jsx)(Q,{value:e.id,children:e.name||e.id},e.id))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Markdown file`}),(0,B.jsxs)(ds,{value:s,onChange:e=>{c(e.target.value),u(null),m(Es)},children:[k?.map(e=>(0,B.jsx)(Q,{value:e.name,children:Cs(e)},e.name)),A?.length?(0,B.jsx)(fs,{label:`Shared memory`,children:A.map(e=>(0,B.jsx)(Q,{value:e.name,children:Cs(e)},e.name))}):null]})]})]}),T?(0,B.jsx)(`div`,{className:`agent-file-meta`,children:(0,B.jsx)(`p`,{className:`supporting-text agent-file-meta-line`,children:O?.exists?O.readOnly?`${O.cloudPath||O.path} · read-only cloud memory cache`:O.updatedAt?`Last updated ${Za(O.updatedAt)} · ${Qa(O.updatedAt)} · ${O.path}`:O.path:O?.readOnly?`Shared memory has not synced to this agent yet`:`File not created yet`})}):null,D.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading markdown file...`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{className:`field textarea-field`,children:[(0,B.jsx)(`span`,{className:`agent-file-editor-title`,children:M}),(0,B.jsx)(Jo,{className:`code-editor`,rows:28,readOnly:j,value:v,onChange:e=>b(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{type:`button`,loading:I.isPending,disabled:j||I.isPending||!D.data||!te,onClick:()=>I.mutate(),children:I.isPending?`Saving...`:`Save Markdown`}),(0,B.jsx)(Z,{variant:`ghost`,type:`button`,disabled:!D.data||I.isPending||!te||j,onClick:()=>{let e=D.data?.file.content||``;E&&(x.current=E),S.current=e,b(e)},children:`Reset to Disk`}),(0,B.jsx)(`p`,{className:`supporting-text`,children:j?O?.exists?`Read-only cloud memory cache.`:`Waiting for cloud memory sync.`:te?`Unsaved changes.`:T?.exists?`Disk copy loaded.`:`Saving will create this file in the agent workspace.`})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Versions`}),(0,B.jsx)(uo,{children:`${D.data?.file.revisions.length||0} saved revision${D.data?.file.revisions.length===1?``:`s`}`})]}),(0,B.jsx)(K,{children:D.data?.file.revisions.length?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:re.map(e=>(0,B.jsx)(`button`,{className:e.id===l?`selectable-row active`:`selectable-row`,type:`button`,onClick:()=>u(e.id),children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:Qa(e.createdAt)}),(0,B.jsxs)(`small`,{children:[Za(e.createdAt),` ·`,` `,e.source,` · `,e.sizeBytes,` `,`bytes`]})]})},e.id))}),ie>0?(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsxs)(Z,{variant:`outline`,size:`sm`,type:`button`,onClick:()=>m(e=>Math.min(e+Es,ne.length)),children:[`Show`,` `,Math.min(Es,ie),` `,`more`]})}):null]}):(0,B.jsx)(`div`,{className:`empty-state`,children:j?`Shared memory files are read-only and do not have local revisions.`:`Revisions appear here after the file changes.`})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Version Preview`})}),(0,B.jsx)(K,{children:l?N.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading version...`}):N.data?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsx)(`span`,{children:Qa(N.data.revision.createdAt)}),(0,B.jsxs)(`p`,{children:[N.data.revision.sha256.slice(0,16),` `,`· `,N.data.revision.source]})]}),(0,B.jsxs)(`label`,{className:`field textarea-field`,children:[(0,B.jsx)(`span`,{children:`Saved content`}),(0,B.jsx)(Jo,{className:`code-editor`,rows:14,readOnly:!0,value:N.data.revision.content})]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{type:`button`,loading:ee.isPending,disabled:ee.isPending,onClick:()=>ee.mutate(),children:ee.isPending?`Restoring...`:`Restore Version`}),(0,B.jsx)(Z,{variant:`ghost`,type:`button`,onClick:()=>b(N.data?.revision.content||``),children:`Copy to Editor`})]})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Version details are unavailable.`}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Select a saved version to preview or restore it.`})})]})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Team Revisions`}),(0,B.jsx)(uo,{children:`${P.data?.revisions.length||0} saved revision${P.data?.revisions.length===1?``:`s`}`})]}),(0,B.jsx)(K,{children:P.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading team revisions...`}):P.data?.revisions.length?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:oe.map(e=>(0,B.jsx)(`button`,{className:e.id===d?`selectable-row active`:`selectable-row`,type:`button`,onClick:()=>f(e.id),children:(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`strong`,{children:[`#`,e.id,` ·`,` `,Qa(e.createdAt)]}),(0,B.jsxs)(`small`,{children:[Za(e.createdAt),` ·`,` `,e.changeCount,` change`,e.changeCount===1?``:`s`,` ·`,` `,e.route]})]})},e.id))}),se>0?(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsxs)(Z,{variant:`outline`,size:`sm`,type:`button`,onClick:()=>_(e=>Math.min(e+Es,ae.length)),children:[`Show`,` `,Math.min(Es,se),` `,`more`]})}):null]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Team revisions appear here after org-chart changes.`})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Team Diff`})}),(0,B.jsx)(K,{children:d?F.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading team revision...`}):F.data?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsxs)(`span`,{children:[`Revision #`,F.data.revision.id]}),(0,B.jsxs)(`p`,{children:[F.data.revision.md5.slice(0,16),` `,`· `,F.data.revision.source]})]}),(0,B.jsxs)(`label`,{className:`field textarea-field`,children:[(0,B.jsx)(`span`,{children:`Diff`}),(0,B.jsx)(Jo,{className:`code-editor`,rows:10,readOnly:!0,value:Ts(F.data.revision.diff)})]}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{type:`button`,loading:L.isPending,disabled:L.isPending,onClick:()=>L.mutate(),children:L.isPending?`Restoring...`:`Restore Team`})})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Team revision details are unavailable.`}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Select a team revision to inspect its diff.`})})]})]})]})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`This agent does not expose editable markdown files.`}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Select an agent to edit its files.`}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No agents are registered yet.`})})})}function Os(e){console.error(`Navigation failed:`,e)}var ks=[{key:`all`,label:`All`},{key:`active`,label:`Active`},{key:`idle`,label:`Idle`},{key:`stopped`,label:`Stopped`}];function As(e){return e.model||`Inherited default`}function js(e){return e.sessionCount?`${e.sessionCount} total · ${e.activeSessions} active · ${e.idleSessions} idle · ${e.stoppedSessions} stopped`:`No persisted sessions`}function Ms(e){return`Chatbot ${e.chatbotId?.trim()||`none`} · RAG ${e.enableRag==null?`inherit`:e.enableRag?`on`:`off`}`}function Ns(e){return e.channelName&&e.channelName!==e.channelId?`${e.channelName} · ${e.channelId}`:e.channelId||`unknown`}function Ps(e){return`is-${e}`}function Fs(e){return(0,B.jsxs)(`span`,{className:`agents-status-badge ${Ps(e.status)}`,children:[(0,B.jsx)(`span`,{className:`agents-status-badge-dot`,"aria-hidden":`true`}),e.status]})}function Is(e){let t=e.toLowerCase();return e.startsWith(`$`)?`is-command`:t.includes(`error`)||t.includes(`failed`)?`is-error`:t.includes(`idle`)||t.includes(`waiting`)?`is-warning`:t.includes(`healthy`)||t.includes(`success`)?`is-success`:``}function Ls(e,t){let n=new Map;return t.map(t=>{let r=(n.get(t)??0)+1;return n.set(t,r),{key:`${e}-${r}-${t}`,line:t}})}function Rs(e){let t=(0,R.useMemo)(()=>Ls(e.sessionId,e.output),[e.sessionId,e.output]);return(0,B.jsxs)(`div`,{className:`agents-terminal`,children:[(0,B.jsxs)(`div`,{className:`agents-terminal-top`,children:[(0,B.jsx)(`span`,{className:`agents-terminal-dot is-red`}),(0,B.jsx)(`span`,{className:`agents-terminal-dot is-yellow`}),(0,B.jsx)(`span`,{className:`agents-terminal-dot is-green`}),(0,B.jsx)(`span`,{className:`agents-terminal-label`,children:e.title})]}),(0,B.jsx)(`div`,{className:`agents-session-output`,children:t.map(({key:e,line:t})=>(0,B.jsx)(`span`,{className:`agents-terminal-line ${Is(t)}`,children:t},e))})]})}var zs=(0,R.memo)(Rs,(e,t)=>e.sessionId===t.sessionId&&e.title===t.title&&e.output.length===t.output.length&&e.output.every((e,n)=>e===t.output[n]));function Bs(){let e=Gn(),t=j(),n=Ca(e.token),[r,i]=(0,R.useState)(`all`),[a,o]=(0,R.useState)(new Set),s=y({queryKey:[`agents-overview`,e.token],queryFn:()=>dt(e.token),refetchInterval:15e3}),c=s.data,l=(0,R.useMemo)(()=>{let e=c?.sessions||[];return r===`all`?e:e.filter(e=>e.status===r)},[r,c?.sessions]);function u(e){o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}if(s.isLoading&&!c)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading agents...`});if(s.isError&&!c)return(0,B.jsx)(`div`,{className:`empty-state error`,children:`Agent overview unavailable.`});if(!c)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Agent overview unavailable.`});let d=c.totals.sessions,f={all:d.all,active:d.active,idle:d.idle,stopped:d.stopped};return(0,B.jsxs)(`div`,{className:`page-stack agents-dashboard`,children:[(0,B.jsxs)(`header`,{className:`agents-page-header`,children:[(0,B.jsxs)(`div`,{className:`agents-title-row`,children:[(0,B.jsx)(`h1`,{children:`Agents`}),(0,B.jsxs)(`button`,{className:s.isFetching?`agents-refresh-chip is-spinning`:`agents-refresh-chip`,type:`button`,onClick:()=>void s.refetch(),children:[(0,B.jsx)(`span`,{className:`agents-refresh-spinner`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:c?`Last refresh ${Qa(c.generatedAt)}`:`Loading agents`})]}),c?(0,B.jsxs)(`span`,{className:`agents-uptime-chip`,children:[`uptime `,$a(c.uptime)]}):null]}),(0,B.jsx)(ka,{items:n})]}),(0,B.jsxs)(`div`,{className:`agents-stats-row`,children:[(0,B.jsxs)(`div`,{className:`agents-stat-card`,children:[(0,B.jsx)(`span`,{className:`agents-metric-accent is-green`,children:`A`}),(0,B.jsx)(`span`,{children:`Agents`}),(0,B.jsx)(`strong`,{children:c.totals.agents.all}),(0,B.jsxs)(`small`,{children:[c.totals.agents.active,` active`]})]}),(0,B.jsxs)(`div`,{className:`agents-stat-card`,children:[(0,B.jsx)(`span`,{className:`agents-metric-accent is-blue`,children:`S`}),(0,B.jsx)(`span`,{children:`Sessions Live`}),(0,B.jsx)(`strong`,{children:d.running}),(0,B.jsxs)(`small`,{children:[d.all,` total`]})]}),(0,B.jsxs)(`div`,{className:`agents-stat-card`,children:[(0,B.jsx)(`span`,{className:`agents-metric-accent is-gold`,children:`T`}),(0,B.jsx)(`span`,{children:`Tokens Used`}),(0,B.jsx)(`strong`,{children:Ka(d.totalTokens)}),(0,B.jsx)(`small`,{children:Ja({inputTokens:d.totalInputTokens,outputTokens:d.totalOutputTokens})})]}),(0,B.jsxs)(`div`,{className:`agents-stat-card`,children:[(0,B.jsx)(`span`,{className:`agents-metric-accent is-slate`,children:`$`}),(0,B.jsx)(`span`,{children:`Total Cost`}),(0,B.jsx)(`strong`,{children:Xa(d.totalCostUsd)}),(0,B.jsxs)(`small`,{children:[`Ralph `,c.ralph?.enabled?`enabled`:`disabled`]})]})]}),(0,B.jsxs)(`section`,{className:`agents-dashboard-panel`,children:[(0,B.jsx)(`div`,{className:`agents-section-head`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{children:`Registered Agents`}),(0,B.jsxs)(`p`,{children:[c.agents.length.toString(),` workspace`,c.agents.length===1?``:`s`,` aggregated across every bound session.`]})]})}),(0,B.jsx)(`div`,{children:c.agents.length?(0,B.jsx)(`div`,{className:`agents-overview-grid`,children:c.agents.map(e=>(0,B.jsxs)(`article`,{className:`agents-overview-card ${Ps(e.status)}`,children:[(0,B.jsxs)(`div`,{className:`agents-overview-card-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{children:e.name||e.id}),(0,B.jsx)(`p`,{children:js(e)}),e.recentSessionId?(0,B.jsx)(`div`,{className:`agents-tag-row`,children:(0,B.jsxs)(`span`,{className:`agents-tag`,children:[`Recent `,e.recentSessionId]})}):null]}),(0,B.jsx)(Fs,{status:e.status})]}),(0,B.jsxs)(`div`,{className:`agents-meta-grid`,children:[(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Default Model`}),(0,B.jsx)(`strong`,{children:As(e)})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Session Models`}),(0,B.jsx)(`strong`,{children:e.effectiveModels.length?e.effectiveModels.join(`, `):`none`})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Workspace`}),(0,B.jsx)(`strong`,{children:e.workspacePath})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Token I/O`}),(0,B.jsx)(`strong`,{children:Ja({inputTokens:e.inputTokens,outputTokens:e.outputTokens})})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Cost`}),(0,B.jsx)(`strong`,{children:Xa(e.costUsd)})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Chatbot / RAG`}),(0,B.jsx)(`strong`,{children:Ms(e)})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Last Active`}),(0,B.jsx)(`strong`,{children:Qa(e.lastActive)})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Messages / Tools`}),(0,B.jsxs)(`strong`,{children:[e.messageCount,` msgs / `,e.toolCalls,` calls`]})]})]})]},e.id))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No agents found.`})})]}),(0,B.jsxs)(`section`,{className:`agents-dashboard-panel`,children:[(0,B.jsx)(`div`,{className:`agents-section-head`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{children:`Sessions`}),(0,B.jsxs)(`p`,{children:[l.length,` visible of `,d.all,` persisted per-channel and per-client sessions.`]})]})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`agents-filter-row`,role:`tablist`,"aria-label":`Session filters`,children:ks.map(e=>(0,B.jsxs)(`button`,{className:r===e.key?`agents-filter-pill is-active`:`agents-filter-pill`,type:`button`,role:`tab`,"aria-selected":r===e.key,onClick:()=>i(e.key),children:[e.label,(0,B.jsx)(`span`,{className:`agents-filter-count`,children:f[e.key]})]},e.key))}),l.length?(0,B.jsx)(`div`,{className:`agents-session-list`,children:l.map(e=>{let n=a.has(e.id),r=e.output.length?e.output:[`No recent activity captured for this session yet.`];return(0,B.jsxs)(`article`,{className:`agents-session-card ${Ps(e.status)}`,children:[(0,B.jsxs)(`div`,{className:`agents-overview-card-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{children:e.name}),(0,B.jsx)(`p`,{children:e.task}),e.fullAutoEnabled?(0,B.jsx)(`span`,{className:`agents-fullauto-badge`,children:`Full auto`}):null]}),(0,B.jsx)(Fs,{status:e.status})]}),(e.lastQuestion||e.lastAnswer)&&(0,B.jsxs)(`div`,{className:`agents-preview`,children:[e.lastQuestion?(0,B.jsxs)(`p`,{children:[(0,B.jsx)(`span`,{children:`Q`}),e.lastQuestion]}):null,e.lastAnswer?(0,B.jsxs)(`p`,{children:[(0,B.jsx)(`span`,{children:`A`}),e.lastAnswer]}):null]}),(0,B.jsxs)(`div`,{className:`agents-meta-grid`,children:[(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Model`}),(0,B.jsx)(`strong`,{children:e.model})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Agent`}),(0,B.jsx)(`strong`,{children:e.agentId})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Session ID`}),(0,B.jsx)(`strong`,{children:e.sessionId})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Channel`}),(0,B.jsx)(`strong`,{children:Ns(e)})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Runtime`}),(0,B.jsxs)(`strong`,{children:[e.runtimeMinutes,`m`]})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Token I/O`}),(0,B.jsx)(`strong`,{children:Ja({inputTokens:e.inputTokens,outputTokens:e.outputTokens})})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Cost`}),(0,B.jsx)(`strong`,{children:Xa(e.costUsd)})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Last Active`}),(0,B.jsx)(`strong`,{children:Za(e.lastActive)})]})]}),n?(0,B.jsx)(zs,{sessionId:e.id,title:e.previewTitle,output:r}):null,(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,onClick:()=>{t({to:`/admin/sessions`,search:{sessionId:e.id}}).catch(Os)},children:`Open Session`}),(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,onClick:()=>u(e.id),children:n?`Hide Output`:`Show Output`})]})]},e.id)})}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No sessions match this filter.`})]})]})]})}function Vs(e){let t=Gn(),n=o(),r=hs(),[i,a]=(0,R.useState)(``),s=g({mutationFn:e=>pn(t.token,e),onSuccess:()=>{a(``),n.invalidateQueries({queryKey:[`admin-approvals`,t.token]}),n.invalidateQueries({queryKey:[`jobs-context`,t.token]}),e.onResumed?.(),r.success(`Blocked session resumed.`)},onError:e=>{r.error(`Failed to resume blocked session`,H(e))}});function c(t){if(t.kind===`code`&&!t.value.trim()){r.error(`Code required`,`Enter the operator-provided code first.`);return}s.mutate({sessionId:e.session.sessionId,response:t})}return(0,B.jsxs)(`div`,{className:`button-row`,children:[e.session.expectedReturnKinds.includes(`code`)?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`input`,{"aria-label":`Code for ${e.session.sessionId}`,value:i,disabled:s.isPending,placeholder:`Code`,onChange:e=>a(e.target.value)}),(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:s.isPending,onClick:()=>c({kind:`code`,value:i.trim()}),children:`Resume`})]}):null,e.session.expectedReturnKinds.includes(`approved`)?(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:s.isPending,onClick:()=>c({kind:`approved`}),children:`Approved`}):null,e.session.expectedReturnKinds.includes(`scanned`)?(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:s.isPending,onClick:()=>c({kind:`scanned`}),children:`Scanned`}):null,e.session.expectedReturnKinds.includes(`declined`)?(0,B.jsx)(`button`,{className:`danger-button`,type:`button`,disabled:s.isPending,onClick:()=>c({kind:`declined`}),children:`Decline`}):null,e.session.expectedReturnKinds.includes(`timeout`)?(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,disabled:s.isPending,onClick:()=>c({kind:`timeout`}),children:`Timeout`}):null]})}function Hs(e){let t=[`once`];return e.allowSession&&t.push(`session`),e.allowAgent&&t.push(`agent`),e.allowAll&&t.push(`all`),t.join(`, `)}function Us(e){return e.comment&&e.managedByPreset?`${e.comment} · preset:${e.managedByPreset}`:e.comment?e.comment:e.managedByPreset?`preset:${e.managedByPreset}`:``}function Ws(e){return{action:`allow`,host:``,port:`*`,methods:`*`,paths:`/**`,agent:e||`*`,comment:``}}function Gs(e){return{action:e.action,host:e.host,port:String(e.port),methods:e.methods.join(`, `),paths:e.paths.join(`, `),agent:e.agent,comment:e.comment||``}}function Ks(e,t){let n=e.split(`,`).map(e=>e.trim()).filter(Boolean);return n.length>0?n:t}function qs(e){let t=e.trim();if(!t||t===`*`)return`*`;if(!/^\d+$/.test(t))throw Error("Port must be `*` or a whole number from 1 to 65535.");let n=Number(t);if(!Number.isSafeInteger(n)||n<=0||n>65535)throw Error("Port must be `*` or a whole number from 1 to 65535.");return n}function Js(e){let t=e.host.trim();if(!t)throw Error(`Host is required.`);let n=e.agent.trim()||`*`,r=e.comment.trim();return{action:e.action,host:t,port:qs(e.port),methods:Ks(e.methods,[`*`]),paths:Ks(e.paths,[`/**`]),agent:n,...r?{comment:r}:{}}}function Ys(){let e=Gn(),t=o(),n=hs(),[r,i]=(0,R.useState)(``),[a,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(null),[u,d]=(0,R.useState)(null),[f,p]=(0,R.useState)(null),[m,h]=(0,R.useState)(()=>Ws(`main`)),_=y({queryKey:[`admin-approvals`,e.token,r],queryFn:()=>fn(e.token,r?{agentId:r}:void 0)}),v=r||_.data?.selectedAgentId||`main`,b=_.data?.agents||[];(0,R.useEffect)(()=>{l(null),d(null),h(Ws(v))},[v]);function x(){l(null),d(null),h(Ws(v))}function S(){l(`create`),d(null),h(Ws(v))}let C=g({mutationFn:t=>mn(e.token,{agentId:v,...t.index==null?{}:{index:t.index},rule:t.rule}),onSuccess:(r,i)=>{x(),t.invalidateQueries({queryKey:[`admin-approvals`,e.token]}),n.success(i.index==null?`Policy rule added.`:`Rule #${i.index} updated.`)},onError:(e,t)=>{n.error(t.index==null?`Failed to add rule`:`Failed to update rule`,H(e))}}),w=g({mutationFn:t=>vn(e.token,{agentId:v,index:t}),onSuccess:(r,i)=>{u===i&&x(),t.invalidateQueries({queryKey:[`admin-approvals`,e.token]}),n.success(`Rule #${i} deleted.`)},onError:(e,t)=>{n.error(`Failed to delete rule #${t}`,H(e))}}),T=g({mutationFn:t=>_n(e.token,{agentId:v,presetName:t}),onSuccess:(r,i)=>{t.invalidateQueries({queryKey:[`admin-approvals`,e.token]}),n.success(`Template '${i}' applied.`)},onError:e=>{n.error(`Failed to apply template`,H(e))}}),E=g({mutationFn:t=>hn(e.token,{agentId:v,defaultAction:t}),onSuccess:(r,i)=>{t.invalidateQueries({queryKey:[`admin-approvals`,e.token]}),n.success(`Default policy set to ${i}.`)},onError:e=>{n.error(`Failed to update default policy`,H(e))}}),D=g({mutationFn:t=>gn(e.token,{agentId:v,mode:t}),onSuccess:(r,i)=>{t.invalidateQueries({queryKey:[`admin-approvals`,e.token]}),n.success(`LAN HTTP access set to ${i}.`)},onError:e=>{n.error(`Failed to update LAN HTTP access`,H(e))}});function O(e){e.preventDefault();try{C.mutate({index:u,rule:Js(m)})}catch(e){n.error(`Invalid policy rule`,H(e))}}function k(e){l(`edit`),d(e.index),h(Gs(e))}function A(e){p(e)}let j=_.data?.policy.rules||[],M=(_.data?.availablePresets||[]).filter(e=>!_.data?.policy.presets.includes(e.name)).sort((e,t)=>e.name.localeCompare(t.name)),N=C.isPending||w.isPending||E.isPending||D.isPending||T.isPending,P=c!==null,F=E.isPending&&E.variables?E.variables:_.data?.policy.defaultAction||`deny`,I=D.isPending&&D.variables?D.variables:_.data?.policy.lanHttpAccess?.mode||`off`;return(0,R.useEffect)(()=>{s(e=>e&&M.some(t=>t.name===e)?e:M[0]?.name||``)},[M]),(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{actions:(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Policy agent`}),(0,B.jsx)(ds,{value:v,disabled:_.isLoading&&b.length===0,onChange:e=>i(e.target.value),children:b.length?b.map(e=>(0,B.jsx)(Q,{value:e.id,children:e.name?`${e.name} (${e.id})`:e.id},e.id)):(0,B.jsx)(Q,{value:v,children:`Loading agents...`})})]})}),(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Ua,{label:`Pending approvals`,value:String(_.data?.pending.length??0),loading:!_.data}),(0,B.jsx)(Ua,{label:`Blocked sessions`,value:String(_.data?.suspendedSessions.length??0),loading:!_.data}),(0,B.jsx)(Ua,{label:`Policy rules`,value:String(j.length),loading:!_.data}),(0,B.jsx)(Ua,{label:`Applied presets`,value:String(_.data?.policy.presets.length??0),loading:!_.data}),(0,B.jsxs)(`div`,{className:`metric-card`,children:[(0,B.jsx)(`span`,{children:`Default policy`}),(0,B.jsx)(`div`,{className:`field`,children:(0,B.jsxs)(ds,{value:F,disabled:!_.data||N,onChange:e=>E.mutate(e.target.value===`allow`?`allow`:`deny`),children:[(0,B.jsx)(Q,{value:`deny`,children:`deny`}),(0,B.jsx)(Q,{value:`allow`,children:`allow`})]})})]}),(0,B.jsxs)(`div`,{className:`metric-card`,children:[(0,B.jsx)(`span`,{children:`LAN HTTP access`}),(0,B.jsx)(`div`,{className:`field`,children:(0,B.jsxs)(`select`,{"aria-label":`LAN HTTP access`,value:I,disabled:!_.data||N,onChange:e=>{let t=e.target.value;if(t===`custom`){S();return}D.mutate(t)},children:[(0,B.jsx)(`option`,{value:`off`,children:`Off`}),(0,B.jsx)(`option`,{value:`read-only`,children:`Read-only LAN`}),(0,B.jsx)(`option`,{value:`read-write`,children:`Read-write LAN`}),(0,B.jsx)(`option`,{value:`custom`,children:`Custom`})]})})]})]}),(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Policy`})}),(0,B.jsx)(K,{children:_.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading policy...`}):_.data?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[j.length?(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{className:`policy-rules-table`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`#`}),(0,B.jsx)(`th`,{children:`Action`}),(0,B.jsx)(`th`,{children:`Host`}),(0,B.jsx)(`th`,{children:`Port`}),(0,B.jsx)(`th`,{children:`Methods`}),(0,B.jsx)(`th`,{children:`Paths`}),(0,B.jsx)(`th`,{children:`Agent`}),(0,B.jsx)(`th`,{children:`Comment`}),(0,B.jsx)(`th`,{children:`Actions`})]})}),(0,B.jsx)(`tbody`,{children:j.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:e.index}),(0,B.jsx)(`td`,{children:(0,B.jsx)(`strong`,{children:e.action.toUpperCase()})}),(0,B.jsx)(`td`,{children:e.host}),(0,B.jsx)(`td`,{children:String(e.port)}),(0,B.jsx)(`td`,{children:e.methods.join(`, `)}),(0,B.jsx)(`td`,{children:e.paths.join(`, `)}),(0,B.jsx)(`td`,{children:e.agent}),(0,B.jsx)(`td`,{children:Us(e)}),(0,B.jsx)(`td`,{children:(0,B.jsxs)(`div`,{className:`policy-table-actions`,children:[(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,disabled:N,onClick:()=>k(e),children:`Edit`}),(0,B.jsx)(`button`,{className:`danger-button`,type:`button`,disabled:N,onClick:()=>A(e),children:`Delete`})]})})]},`${e.index}:${e.host}:${e.agent}`))})]})}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No policy rules found.`}),(0,B.jsxs)(`div`,{className:`policy-action-row`,children:[(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:N,onClick:S,children:`New rule`}),(0,B.jsxs)(`div`,{className:`policy-template-actions`,children:[(0,B.jsxs)(`label`,{className:`policy-template-inline`,children:[(0,B.jsx)(`span`,{children:`Template:`}),(0,B.jsx)(ds,{value:a,disabled:N||M.length===0,onChange:e=>s(e.target.value),children:M.length>0?M.map(e=>(0,B.jsx)(Q,{value:e.name,children:e.name},e.name)):(0,B.jsx)(Q,{value:``,children:`No templates available`})})]}),(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,disabled:N||!a,onClick:()=>T.mutate(a),children:`Add template`})]})]}),P?(0,B.jsxs)(`form`,{className:`config-section detail-stack`,onSubmit:O,children:[(0,B.jsx)(`strong`,{children:c===`edit`&&u!=null?`Edit rule #${u}`:`Add rule`}),(0,B.jsxs)(`div`,{className:`field-grid policy-editor-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Action`}),(0,B.jsxs)(ds,{value:m.action,disabled:N,onChange:e=>h(t=>({...t,action:e.target.value===`deny`?`deny`:`allow`})),children:[(0,B.jsx)(Q,{value:`allow`,children:`allow`}),(0,B.jsx)(Q,{value:`deny`,children:`deny`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Host`}),(0,B.jsx)(Y,{value:m.host,disabled:N,placeholder:`example.com`,onChange:e=>h(t=>({...t,host:e.target.value}))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Port`}),(0,B.jsx)(Y,{value:m.port,disabled:N,placeholder:`*`,onChange:e=>h(t=>({...t,port:e.target.value}))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Methods`}),(0,B.jsx)(Y,{value:m.methods,disabled:N,placeholder:`*`,onChange:e=>h(t=>({...t,methods:e.target.value}))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Paths`}),(0,B.jsx)(Y,{value:m.paths,disabled:N,placeholder:`/**`,onChange:e=>h(t=>({...t,paths:e.target.value}))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Agent`}),(0,B.jsx)(Y,{value:m.agent,disabled:N,placeholder:`*`,onChange:e=>h(t=>({...t,agent:e.target.value}))})]}),(0,B.jsxs)(`label`,{className:`field policy-comment-field`,children:[(0,B.jsx)(`span`,{children:`Comment`}),(0,B.jsx)(Jo,{rows:2,value:m.comment,disabled:N,placeholder:`Optional note`,onChange:e=>h(t=>({...t,comment:e.target.value}))})]})]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(`button`,{className:`primary-button`,type:`submit`,disabled:N,children:C.isPending?(0,B.jsxs)(`span`,{className:`button-with-spinner`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`button-spinner`}),c===`edit`?`Saving...`:`Adding...`]}):c===`edit`?`Save changes`:`Save`}),(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,disabled:N,onClick:x,children:`Cancel`})]})]}):null]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Policy state is unavailable.`})})]}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Blocked sessions`})}),(0,B.jsx)(K,{children:_.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading blocked sessions...`}):_.data?.suspendedSessions.length?(0,B.jsx)(`div`,{className:`list-stack`,children:_.data.suspendedSessions.map(e=>(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Status`}),(0,B.jsx)(`strong`,{children:e.blockedLabel})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Modality`}),(0,B.jsx)(`strong`,{children:e.modality})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Agent`}),(0,B.jsx)(`strong`,{children:e.agentId||`unknown`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Host`}),(0,B.jsx)(`strong`,{children:e.context.host||`unknown`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Created`}),(0,B.jsx)(`strong`,{title:Qa(e.createdAt),children:Za(e.createdAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Expires`}),(0,B.jsx)(`strong`,{title:Qa(e.expiresAt),children:Za(e.expiresAt)})]})]}),(0,B.jsx)(`p`,{className:`supporting-text`,children:e.prompt}),(0,B.jsx)(Vs,{session:e})]},e.sessionId))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No blocked sessions right now.`})})]}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Pending approvals`})}),(0,B.jsx)(K,{children:_.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading pending approvals...`}):_.data?.pending.length?(0,B.jsx)(`div`,{className:`list-stack`,children:_.data.pending.map(e=>(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Approval`}),(0,B.jsx)(`strong`,{children:e.actionKey||e.approvalId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Agent`}),(0,B.jsx)(`strong`,{children:e.agentId||`unknown`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Session`}),(0,B.jsx)(`strong`,{children:e.sessionId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Trust scopes`}),(0,B.jsx)(`strong`,{children:Hs({allowSession:e.allowSession,allowAgent:e.allowAgent,allowAll:e.allowAll})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Created`}),(0,B.jsx)(`strong`,{title:Qa(e.createdAt),children:Za(e.createdAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Expires`}),(0,B.jsx)(`strong`,{title:Qa(e.expiresAt),children:Za(e.expiresAt)})]})]}),(0,B.jsx)(`p`,{className:`supporting-text`,children:e.prompt})]},e.approvalId))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No pending approvals right now.`})})]})]}),(0,B.jsx)(ri,{open:f!==null,onOpenChange:e=>{e||p(null)},children:(0,B.jsxs)(ii,{size:`sm`,role:`alertdialog`,children:[(0,B.jsxs)(ai,{children:[(0,B.jsx)(oi,{children:`Delete policy rule?`}),(0,B.jsx)(si,{children:f?`This will remove rule #${f.index} for ${f.host}.`:`This will remove the selected policy rule.`})]}),(0,B.jsxs)(ci,{children:[(0,B.jsx)(li,{className:`ghost-button`,children:`Cancel`}),(0,B.jsx)(li,{className:`danger-button`,onClick:()=>{f&&w.mutate(f.index)},children:`Delete`})]})]})})]})}var Xs={page:`_page_rr4vj_1`,toolbar:`_toolbar_rr4vj_8`,searchRow:`_searchRow_rr4vj_16`,searchWrap:`_searchWrap_rr4vj_23`,searchIcon:`_searchIcon_rr4vj_31`,searchInput:`_searchInput_rr4vj_41`,shortcutHint:`_shortcutHint_rr4vj_47`,timeRange:`_timeRange_rr4vj_64`,meta:`_meta_rr4vj_106`,chipRow:`_chipRow_rr4vj_117`,categoryChip:`_categoryChip_rr4vj_128`,activeRow:`_activeRow_rr4vj_211`,activeChip:`_activeChip_rr4vj_224`,activeChipRemove:`_activeChipRemove_rr4vj_242`,clearAll:`_clearAll_rr4vj_263`,tableWrap:`_tableWrap_rr4vj_284`,table:`_table_rr4vj_284`,colTime:`_colTime_rr4vj_344`,colEvent:`_colEvent_rr4vj_349`,colSession:`_colSession_rr4vj_353`,colSeq:`_colSeq_rr4vj_359`,colId:`_colId_rr4vj_360`,colRun:`_colRun_rr4vj_368`,mono:`_mono_rr4vj_378`,eventPill:`_eventPill_rr4vj_382`,empty:`_empty_rr4vj_442`,loadMoreRow:`_loadMoreRow_rr4vj_449`,loadMore:`_loadMore_rr4vj_449`,sheet:`_sheet_rr4vj_485`,sheetHeader:`_sheetHeader_rr4vj_492`,sheetHeaderMain:`_sheetHeaderMain_rr4vj_501`,sheetHeaderId:`_sheetHeaderId_rr4vj_508`,sheetClose:`_sheetClose_rr4vj_514`,sheetBody:`_sheetBody_rr4vj_538`,sheetMeta:`_sheetMeta_rr4vj_547`,payloadSection:`_payloadSection_rr4vj_571`,payloadHeader:`_payloadHeader_rr4vj_578`,payloadBlock:`_payloadBlock_rr4vj_589`},Zs=[`session`,`turn`,`onboarding`,`model`,`tool`,`autonomy`,`authorization`,`approval`,`a2a`],Qs=new Set(Zs),$s=[{value:`all`,label:`All`},{value:`1h`,label:`1h`},{value:`24h`,label:`24h`},{value:`7d`,label:`7d`}],ec=new Set($s.map(e=>e.value)),tc={"1h":3600*1e3,"24h":1440*60*1e3,"7d":10080*60*1e3};function nc(e){let t=e.split(`.`,1)[0]??``;return Qs.has(t)?t:`default`}function rc(e,t=Date.now()){if(e!==`all`)return new Date(t-tc[e]).toISOString()}function ic(e){return e&&ec.has(e)?e:`all`}var ac={session:`session`,type:`type`,event:`type`};function oc(e){let t=[],n=``,r=!1;for(let i of e){if(i===`"`){r=!r,n+=i;continue}if(!r&&/\s/.test(i)){n&&=(t.push(n),``);continue}n+=i}return n&&t.push(n),t}function sc(e){return e.length>=2&&e.startsWith(`"`)&&e.endsWith(`"`)?e.slice(1,-1):e.startsWith(`"`)?e.slice(1):e.endsWith(`"`)?e.slice(0,-1):e}function cc(e){let t=e.indexOf(`:`);if(t>0){let n=ac[e.slice(0,t).toLowerCase()];if(n)return{kind:`field`,key:n,value:sc(e.slice(t+1)),raw:e}}return{kind:`text`,value:sc(e),raw:e}}function lc(e){let t=oc(e).map(cc),n=``,r=``,i=[];for(let e of t)e.kind===`field`?e.key===`session`?n=e.value:r=e.value:e.value&&i.push(e.value);return{sessionId:n,eventType:r,query:i.join(` `)}}function uc(e,t){return oc(e).map(cc).filter(e=>!(e.kind===`field`&&e.key===t)).map(e=>e.raw).join(` `)}function dc(e,t,n){let r=n.trim(),i=uc(e,t);if(!r)return i;let a=`${t}:${/\s/.test(r)?`"${r}"`:r}`;return i?`${i} ${a}`:a}var fc=200;function pc(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function mc(e){if(!e)return null;let t=nc(e);return t==="default"?null:t}function hc(){let e=Gn(),t=j(),n=ee({strict:!1}),r=n.q??``,i=ic(n.range),[a,o]=(0,R.useState)(r),[s,c]=(0,R.useState)(i),[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)(!1),p=(0,R.useRef)(null),m=(0,R.useRef)(null),g=(0,R.useRef)(n.q),_=(0,R.useRef)(n.range),v=(0,R.useMemo)(()=>lc(a),[a]),{query:y,sessionId:b,eventType:S}=(0,R.useDeferredValue)(v);(0,R.useEffect)(()=>{let e=a.trim()||void 0,n=s===`all`?void 0:s;e===g.current&&n===_.current||(g.current=e,_.current=n,t({to:`/admin/audit`,search:{q:e,range:n},replace:!0}).catch(Os))},[t,a,s]),(0,R.useEffect)(()=>{n.q!==g.current&&(g.current=n.q,o(n.q??``)),n.range!==_.current&&(_.current=n.range,c(ic(n.range)))},[n.q,n.range]),(0,R.useEffect)(()=>{function e(e){if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target,n=t?.tagName;n===`INPUT`||n===`TEXTAREA`||t?.isContentEditable||(e.preventDefault(),p.current?.focus(),p.current?.select())}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let[C,w]=(0,R.useState)(()=>Date.now()),T=(0,R.useRef)(0);(0,R.useEffect)(()=>{if(s===`all`)return;w(Date.now());let e=window.setInterval(()=>{T.current>1||w(Date.now())},3e4);return()=>window.clearInterval(e)},[s]);let E=(0,R.useMemo)(()=>rc(s,C),[s,C]),D=x({queryKey:[`audit`,e.token,y,b,S,E],initialPageParam:void 0,queryFn:({pageParam:t})=>dn(e.token,{query:y,sessionId:b,eventType:S,since:E,cursor:t,limit:fc}),getNextPageParam:e=>e.nextCursor??void 0,placeholderData:h}),O=(0,R.useRef)(D);O.current=D,T.current=D.data?.pages.length??0,(0,R.useEffect)(()=>{let e=m.current;if(!e||!D.hasNextPage)return;let t=new IntersectionObserver(([e])=>{let t=O.current;e?.isIntersecting&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},{rootMargin:`400px`});return t.observe(e),()=>t.disconnect()},[D.hasNextPage]);let k=(0,R.useMemo)(()=>D.data?.pages.flatMap(e=>e.entries)??[],[D.data]),A=D.data?.pages[0]?.total??k.length,M=(0,R.useMemo)(()=>mc(v.eventType),[v.eventType]),N=!!(v.query||v.sessionId||v.eventType||s!==`all`);function P(e){u(e),f(!0)}function F(e,t){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),P(t))}let I=(0,R.useCallback)(e=>{o(t=>e===null||mc(lc(t).eventType)===e?uc(t,`type`):dc(t,`type`,e))},[]);function L(){o(e=>uc(e,`session`))}function te(){o(e=>uc(e,`type`))}function ne(){o(``),c(`all`)}return(0,B.jsxs)(`div`,{className:Xs.page,children:[(0,B.jsxs)(`div`,{className:Xs.toolbar,children:[(0,B.jsxs)(`div`,{className:Xs.searchRow,children:[(0,B.jsxs)(`div`,{className:Xs.searchWrap,children:[(0,B.jsx)(Er,{className:Xs.searchIcon,"aria-hidden":`true`}),(0,B.jsx)(Y,{ref:p,className:Xs.searchInput,value:a,onChange:e=>o(e.target.value),placeholder:`Search payloads… try session:web type:tool`,"aria-label":`Audit search`,spellCheck:!1,autoComplete:`off`}),(0,B.jsx)(`span`,{className:Xs.shortcutHint,"data-hidden":a?`true`:void 0,"aria-hidden":`true`,children:`/`})]}),(0,B.jsx)(`div`,{className:Xs.timeRange,role:`toolbar`,"aria-label":`Time range`,children:$s.map(e=>{let t=s===e.value;return(0,B.jsx)(`button`,{type:`button`,"aria-pressed":t,"data-active":t||void 0,onClick:()=>c(e.value),children:e.label},e.value)})}),(0,B.jsx)(`div`,{className:Xs.meta,"aria-live":`polite`,children:D.isLoading?`Loading…`:`${A} event${A===1?``:`s`}`})]}),(0,B.jsxs)(`div`,{className:Xs.chipRow,role:`toolbar`,"aria-label":`Event category`,children:[(0,B.jsx)(`button`,{type:`button`,className:Xs.categoryChip,"data-category":`all`,"aria-pressed":M===null,"data-active":M===null||void 0,onClick:()=>I(null),children:`all`}),Zs.map(e=>{let t=M===e;return(0,B.jsx)(`button`,{type:`button`,className:Xs.categoryChip,"data-category":e,"aria-pressed":t,"data-active":t||void 0,onClick:()=>I(e),children:e},e)})]}),(0,B.jsxs)(`div`,{className:Xs.activeRow,"data-empty":N?void 0:`true`,children:[v.sessionId?(0,B.jsxs)(`span`,{className:Xs.activeChip,children:[(0,B.jsx)(`strong`,{children:`session:`}),v.sessionId,(0,B.jsx)(`button`,{type:`button`,className:Xs.activeChipRemove,"aria-label":`Remove session filter ${v.sessionId}`,onClick:L,children:`×`})]}):null,v.eventType?(0,B.jsxs)(`span`,{className:Xs.activeChip,children:[(0,B.jsx)(`strong`,{children:`type:`}),v.eventType,(0,B.jsx)(`button`,{type:`button`,className:Xs.activeChipRemove,"aria-label":`Remove event type filter ${v.eventType}`,onClick:te,children:`×`})]}):null,s===`all`?null:(0,B.jsxs)(`span`,{className:Xs.activeChip,children:[(0,B.jsx)(`strong`,{children:`last:`}),s,(0,B.jsx)(`button`,{type:`button`,className:Xs.activeChipRemove,"aria-label":`Reset time range`,onClick:()=>c(`all`),children:`×`})]}),N?(0,B.jsx)(`button`,{type:`button`,className:Xs.clearAll,onClick:ne,children:`Clear all`}):null]})]}),(0,B.jsxs)(`div`,{className:Xs.tableWrap,children:[(0,B.jsxs)(`table`,{className:Xs.table,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{scope:`col`,children:`Time`}),(0,B.jsx)(`th`,{scope:`col`,children:`Event`}),(0,B.jsx)(`th`,{scope:`col`,children:`Session`}),(0,B.jsx)(`th`,{scope:`col`,"data-col":`run`,children:`Run`}),(0,B.jsx)(`th`,{scope:`col`,className:Xs.colSeq,children:`Seq`}),(0,B.jsx)(`th`,{scope:`col`,className:Xs.colId,children:`ID`})]})}),(0,B.jsx)(`tbody`,{children:k.map(e=>{let t=nc(e.eventType);return(0,B.jsxs)(`tr`,{role:`button`,tabIndex:0,"data-selected":e.id===l?.id||void 0,"aria-label":`Inspect audit event ${e.id} (${e.eventType})`,onClick:()=>P(e),onKeyDown:t=>F(t,e),children:[(0,B.jsx)(`td`,{className:Xs.colTime,title:Qa(e.timestamp),children:Za(e.timestamp)}),(0,B.jsx)(`td`,{className:Xs.colEvent,children:(0,B.jsx)(`span`,{className:Xs.eventPill,"data-category":t,children:e.eventType})}),(0,B.jsx)(`td`,{className:Xs.colSession,title:e.sessionId,children:(0,B.jsx)(`span`,{className:Xs.mono,children:e.sessionId})}),(0,B.jsx)(`td`,{className:Xs.colRun,title:e.runId,children:e.runId}),(0,B.jsx)(`td`,{className:Xs.colSeq,children:e.seq}),(0,B.jsxs)(`td`,{className:Xs.colId,children:[`#`,e.id]})]},e.id)})})]}),k.length===0?(0,B.jsx)(`div`,{className:Xs.empty,children:D.isLoading?`Loading audit entries…`:`No audit entries match these filters.`}):null,D.hasNextPage?(0,B.jsx)(`div`,{ref:m,className:Xs.loadMoreRow,children:(0,B.jsx)(`button`,{type:`button`,className:Xs.loadMore,onClick:()=>{D.fetchNextPage()},disabled:D.isFetchingNextPage,children:D.isFetchingNextPage?`Loading…`:`Load more`})}):null]}),(0,B.jsx)(ri,{open:d,onOpenChange:f,isDrawer:!0,children:(0,B.jsxs)(ii,{side:`right`,className:Xs.sheet,children:[(0,B.jsx)(ai,{children:(0,B.jsx)(oi,{children:l?`Audit event #${l.id} (${l.eventType})`:`Audit event`})}),l?(0,B.jsx)(gc,{entry:l,onClose:()=>f(!1)}):null]})})]})}function gc({entry:e,onClose:t}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:Xs.sheetHeader,children:[(0,B.jsxs)(`div`,{className:Xs.sheetHeaderMain,children:[(0,B.jsx)(`span`,{className:Xs.eventPill,"data-category":nc(e.eventType),children:e.eventType}),(0,B.jsxs)(`span`,{className:Xs.sheetHeaderId,children:[`#`,e.id,` · `,Qa(e.timestamp)]})]}),(0,B.jsx)(`button`,{type:`button`,className:Xs.sheetClose,"aria-label":`Close inspector`,onClick:t,children:`×`})]}),(0,B.jsxs)(`div`,{className:Xs.sheetBody,children:[(0,B.jsxs)(`dl`,{className:Xs.sheetMeta,children:[(0,B.jsx)(`dt`,{children:`Session`}),(0,B.jsx)(`dd`,{children:e.sessionId}),(0,B.jsx)(`dt`,{children:`Run ID`}),(0,B.jsx)(`dd`,{children:e.runId}),(0,B.jsx)(`dt`,{children:`Parent run`}),(0,B.jsx)(`dd`,{children:e.parentRunId||`—`}),(0,B.jsx)(`dt`,{children:`Seq`}),(0,B.jsx)(`dd`,{children:e.seq}),(0,B.jsx)(`dt`,{children:`Timestamp`}),(0,B.jsx)(`dd`,{children:Qa(e.timestamp)})]}),(0,B.jsxs)(`section`,{className:Xs.payloadSection,children:[(0,B.jsx)(`div`,{className:Xs.payloadHeader,children:(0,B.jsx)(`span`,{children:`Payload`})}),(0,B.jsx)(`pre`,{className:Xs.payloadBlock,children:pc(e.payload)})]})]})]})}function _c(e){switch(e.kind){case`discord`:case`discord_webhook`:return(0,B.jsx)(`span`,{className:`channel-logo`,"aria-hidden":`true`,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 32 32`,"aria-hidden":`true`,focusable:`false`,children:[(0,B.jsx)(`rect`,{x:`3`,y:`3`,width:`26`,height:`26`,rx:`9`,fill:`#5865F2`}),(0,B.jsx)(`path`,{fill:`#FFFFFF`,d:`M10.6 21.7c1.5 1 3.3 1.7 5.1 1.9l.6-1.1c1 .2 2 .2 3 0l.6 1.1c1.9-.2 3.6-.9 5.1-1.9.3-3.2-.4-6.2-2-8.9a11.4 11.4 0 0 0-4.1-1.8l-.5 1a12.2 12.2 0 0 0-3.5 0l-.5-1a11.4 11.4 0 0 0-4.1 1.8c-1.6 2.7-2.3 5.7-2 8.9Z`}),(0,B.jsx)(`circle`,{cx:`13.6`,cy:`16.9`,r:`1.25`,fill:`#5865F2`}),(0,B.jsx)(`circle`,{cx:`18.4`,cy:`16.9`,r:`1.25`,fill:`#5865F2`})]})});case`whatsapp`:return(0,B.jsx)(`span`,{className:`channel-logo`,"aria-hidden":`true`,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 32 32`,"aria-hidden":`true`,focusable:`false`,children:[(0,B.jsx)(`circle`,{cx:`16`,cy:`16`,r:`13`,fill:`#25D366`}),(0,B.jsx)(`path`,{fill:`#FFFFFF`,d:`M16 8.1a7.5 7.5 0 0 0-6.4 11.5l-.8 3 3.1-.8A7.5 7.5 0 1 0 16 8.1Zm0 13.3a5.8 5.8 0 0 1-3-.8l-.4-.2-1.8.5.5-1.7-.3-.4a5.8 5.8 0 1 1 5 2.6Z`}),(0,B.jsx)(`path`,{fill:`#25D366`,d:`M13.2 12.3c-.2 0-.4.1-.5.4-.3.4-.7 1-.7 1.8s.7 1.7.8 1.8c.1.1 1.5 2.3 3.6 3.2 1.8.8 2.2.7 2.6.6.4-.1 1.2-.5 1.4-1 .1-.5.1-.8.1-.9 0-.1-.2-.2-.5-.3l-1.4-.7c-.2-.1-.4-.1-.5.1l-.6.8c-.1.1-.3.2-.5.1-.3-.1-1-.4-1.9-1.2-.8-.7-1.2-1.5-1.4-1.7-.1-.3 0-.4.1-.5l.4-.5c.1-.1.1-.3.2-.4s0-.3 0-.4l-.6-1.5c-.1-.3-.3-.4-.5-.4Z`})]})});case`telegram`:return(0,B.jsx)(`span`,{className:`channel-logo`,"aria-hidden":`true`,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 32 32`,"aria-hidden":`true`,focusable:`false`,children:[(0,B.jsx)(`circle`,{cx:`16`,cy:`16`,r:`13`,fill:`#27A7E7`}),(0,B.jsx)(`path`,{fill:`#FFFFFF`,d:`m23.4 10.2-2.3 11c-.2 1-.8 1.3-1.6.8l-3.5-2.6-1.7 1.6c-.2.2-.4.4-.7.4l.3-3.7 6.8-6.1c.3-.3-.1-.4-.4-.2l-8.4 5.3-3.6-1.1c-.8-.2-.8-.8.2-1.2l14-5.4c.7-.3 1.2.2 1 .9Z`})]})});case`threema`:return(0,B.jsx)(`span`,{className:`channel-logo`,"aria-hidden":`true`,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 32 32`,"aria-hidden":`true`,focusable:`false`,children:[(0,B.jsx)(`rect`,{x:`3`,y:`3`,width:`26`,height:`26`,rx:`8`,fill:`#F4C430`}),(0,B.jsx)(`path`,{fill:`#111827`,d:`M10 13.6h2.2v-1.5c0-2.3 1.7-4.1 3.8-4.1s3.8 1.8 3.8 4.1v1.5H22c.7 0 1.2.5 1.2 1.2v7.9c0 .7-.5 1.2-1.2 1.2H10c-.7 0-1.2-.5-1.2-1.2v-7.9c0-.7.5-1.2 1.2-1.2Zm4.1 0h3.8v-1.5c0-1.2-.8-2.1-1.9-2.1s-1.9.9-1.9 2.1v1.5Z`})]})});case`signal`:return(0,B.jsx)(`span`,{className:`channel-logo channel-logo-compact`,"aria-hidden":`true`,children:(0,B.jsx)(`svg`,{viewBox:`0 0 128 128`,"aria-hidden":`true`,focusable:`false`,children:(0,B.jsx)(`path`,{fill:`#3A76F0`,d:`M48.64,1.87l1.44,5.82A57.84,57.84,0,0,0,34,14.34L30.92,9.2A63.76,63.76,0,0,1,48.64,1.87Zm30.72,0L77.92,7.69A57.84,57.84,0,0,1,94,14.34l3.1-5.14A63.76,63.76,0,0,0,79.36,1.87ZM9.2,30.92A63.76,63.76,0,0,0,1.87,48.64l5.82,1.44A57.84,57.84,0,0,1,14.34,34ZM6,64a57.9,57.9,0,0,1,.65-8.69l-5.93-.9a64.23,64.23,0,0,0,0,19.18l5.93-.9A57.9,57.9,0,0,1,6,64Zm91.08,54.8L94,113.66a57.84,57.84,0,0,1-16.06,6.65l1.44,5.82A63.76,63.76,0,0,0,97.08,118.8ZM122,64a57.9,57.9,0,0,1-.65,8.69l5.93.9a64.23,64.23,0,0,0,0-19.18l-5.93.9A57.9,57.9,0,0,1,122,64Zm4.13,15.36-5.82-1.44A57.84,57.84,0,0,1,113.66,94l5.14,3.1A63.76,63.76,0,0,0,126.13,79.36Zm-53.44,42a58.41,58.41,0,0,1-17.38,0l-.9,5.93a64.23,64.23,0,0,0,19.18,0Zm38-22.95A58.21,58.21,0,0,1,98.4,110.69l3.56,4.83A64.1,64.1,0,0,0,115.52,102ZM98.4,17.31A58.21,58.21,0,0,1,110.69,29.6L115.52,26A64.1,64.1,0,0,0,102,12.48ZM17.31,29.6A58.21,58.21,0,0,1,29.6,17.31L26,12.48A64.1,64.1,0,0,0,12.48,26ZM118.8,30.92,113.66,34a57.84,57.84,0,0,1,6.65,16.06l5.82-1.44A63.76,63.76,0,0,0,118.8,30.92ZM55.31,6.65a58.41,58.41,0,0,1,17.38,0l.9-5.93a64.23,64.23,0,0,0-19.18,0ZM20.39,117.11,8,120l2.89-12.39-5.84-1.37L2.16,118.63a6,6,0,0,0,7.21,7.21L21.75,123ZM6.3,100.89l5.84,1.36,2-8.59A57.75,57.75,0,0,1,7.69,77.92L1.87,79.36a63.52,63.52,0,0,0,5.9,15.21Zm28,13-8.59,2,1.36,5.84,6.32-1.47a63.52,63.52,0,0,0,15.21,5.9l1.44-5.82A57.75,57.75,0,0,1,34.34,113.85ZM64,12A52,52,0,0,0,20,91.67L15,113l21.33-5A52,52,0,1,0,64,12Z`})})});case`voice`:return(0,B.jsx)(`span`,{className:`channel-logo`,"aria-hidden":`true`,children:(0,B.jsx)(`svg`,{viewBox:`0 0 100 30`,"aria-hidden":`true`,focusable:`false`,fill:`#F22F46`,children:(0,B.jsx)(`path`,{d:`M14.4 11.3c0 1.7-1.4 3.1-3.1 3.1S8.2 13 8.2 11.3s1.4-3.1 3.1-3.1 3.1 1.4 3.1 3.1zm-3.1 4.3c-1.7 0-3.1 1.4-3.1 3.1s1.4 3.1 3.1 3.1 3.1-1.4 3.1-3.1-1.4-3.1-3.1-3.1zM30 15c0 8.3-6.7 15-15 15S0 23.3 0 15 6.7 0 15 0s15 6.7 15 15zm-4 0c0-6.1-4.9-11-11-11S4 8.9 4 15s4.9 11 11 11 11-4.9 11-11zm-7.3.6c-1.7 0-3.1 1.4-3.1 3.1s1.4 3.1 3.1 3.1 3.1-1.4 3.1-3.1-1.4-3.1-3.1-3.1zm0-7.4c-1.7 0-3.1 1.4-3.1 3.1s1.4 3.1 3.1 3.1 3.1-1.4 3.1-3.1-1.4-3.1-3.1-3.1zm51.6-2.3c.1 0 .2.1.3.2v3.2c0 .2-.2.3-.3.3H65c-.2 0-.3-.2-.3-.3V6.2c0-.2.2-.3.3-.3h5.3zm-.1 4.5H60c-.1 0-.3.1-.3.3l-1.3 5-.1.3-1.6-5.3c0-.1-.2-.3-.3-.3h-4c-.1 0-.3.1-.3.3l-1.5 5-.1.3-.1-.3-.6-2.5-.6-2.5c0-.1-.2-.3-.3-.3h-8V6.1c0-.1-.2-.3-.4-.2l-5 1.6c-.2 0-.3.1-.3.3v2.7h-1.3c-.1 0-.3.1-.3.3v3.8c0 .1.1.3.3.3h1.3v4.7c0 3.3 1.8 4.8 5.1 4.8 1.4 0 2.7-.3 3.6-.8v-4c0-.2-.2-.3-.3-.2-.5.2-1 .3-1.4.3-.9 0-1.4-.4-1.4-1.4v-3.4h2.9c.1 0 .3-.1.3-.3v-3.2L47.8 24c0 .1.2.3.3.3h4.2c.1 0 .3-.1.3-.3l1.8-5.6.9 2.9.8 2.7c0 .1.2.3.3.3h4.2c.1 0 .3-.1.3-.3l3.8-12.6V24c0 .1.1.3.3.3h5.1c.1 0 .3-.1.3-.3V10.7c0-.1-.1-.3-.2-.3zm6.7-4.5h-5.1c-.1 0-.3.1-.3.3v17.7c0 .1.1.3.3.3h5.1c.1 0 .3-.1.3-.3V6.1c0-.1-.1-.2-.3-.2zm6.8 0h-5.3c-.1 0-.3.1-.3.3v3.1c0 .1.1.3.3.3h5.3c.1 0 .3-.1.3-.3V6.1c0-.1-.1-.2-.3-.2zm-.1 4.5h-5.1c-.1 0-.3.1-.3.3v13.1c0 .1.1.3.3.3h5.1c.1 0 .3-.1.3-.3V10.7c0-.1-.1-.3-.3-.3zm16.1 6.8c0 3.8-3.2 7.1-7.7 7.1-4.4 0-7.6-3.3-7.6-7.1s3.2-7.1 7.7-7.1c4.4 0 7.6 3.3 7.6 7.1zm-5.4.1c0-1.4-1-2.5-2.2-2.4-1.3 0-2.2 1.1-2.2 2.4s1 2.4 2.2 2.4c1.3 0 2.2-1.1 2.2-2.4z`})})});case`email`:return(0,B.jsx)(`span`,{className:`channel-logo`,"aria-hidden":`true`,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 32 32`,"aria-hidden":`true`,focusable:`false`,children:[(0,B.jsx)(`rect`,{x:`3`,y:`5`,width:`26`,height:`22`,rx:`6`,fill:`#2563EB`}),(0,B.jsx)(`path`,{fill:`#FFFFFF`,d:`M8 10.5h16v11H8z`}),(0,B.jsx)(`path`,{d:`m8.8 11.6 7.2 5.2 7.2-5.2`,fill:`none`,stroke:`#2563EB`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,B.jsx)(`path`,{d:`m8.8 20.8 5.5-4.6m8.9 4.6-5.5-4.6`,fill:`none`,stroke:`#93C5FD`,strokeWidth:`1.4`,strokeLinecap:`round`})]})});case`slack`:case`slack_webhook`:return(0,B.jsx)(`span`,{className:`channel-logo channel-logo-compact`,"aria-hidden":`true`,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 127 127`,"aria-hidden":`true`,focusable:`false`,children:[(0,B.jsx)(`path`,{fill:`#E01E5A`,d:`M27.2 80c0 7.3-5.9 13.2-13.2 13.2C6.7 93.2.8 87.3.8 80c0-7.3 5.9-13.2 13.2-13.2h13.2V80zm6.6 0c0-7.3 5.9-13.2 13.2-13.2 7.3 0 13.2 5.9 13.2 13.2v33c0 7.3-5.9 13.2-13.2 13.2-7.3 0-13.2-5.9-13.2-13.2V80z`}),(0,B.jsx)(`path`,{fill:`#36C5F0`,d:`M47 27c-7.3 0-13.2-5.9-13.2-13.2C33.8 6.5 39.7.6 47 .6c7.3 0 13.2 5.9 13.2 13.2V27H47zm0 6.7c7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2H13.9C6.6 60.1.7 54.2.7 46.9c0-7.3 5.9-13.2 13.2-13.2H47z`}),(0,B.jsx)(`path`,{fill:`#2EB67D`,d:`M99.9 46.9c0-7.3 5.9-13.2 13.2-13.2 7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2H99.9V46.9zm-6.6 0c0 7.3-5.9 13.2-13.2 13.2-7.3 0-13.2-5.9-13.2-13.2V13.8C66.9 6.5 72.8.6 80.1.6c7.3 0 13.2 5.9 13.2 13.2v33.1z`}),(0,B.jsx)(`path`,{fill:`#ECB22E`,d:`M80.1 99.8c7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2-7.3 0-13.2-5.9-13.2-13.2V99.8h13.2zm0-6.6c-7.3 0-13.2-5.9-13.2-13.2 0-7.3 5.9-13.2 13.2-13.2h33.1c7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2H80.1z`})]})});case`msteams`:return(0,B.jsx)(`span`,{className:`channel-logo`,"aria-hidden":`true`,children:(0,B.jsxs)(`svg`,{viewBox:`4 4 36 38`,"aria-hidden":`true`,focusable:`false`,fill:`none`,children:[(0,B.jsx)(`path`,{fill:`url(#teams-logo-a)`,d:`M21.9999 20h12c3.3137 0 6 2.6863 6 6v10c0 3.3137-2.6863 6-6 6s-6-2.6863-6-6V26c0-3.3137-2.6863-6-6-6`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-b)`,d:`M7.99988 24c0-3.3137 2.68632-6 6.00002-6h8c3.3137 0 6 2.6863 6 6v12c0 3.3137 2.6863 6 6 6l-16.0001-.0001c-5.5228 0-9.99992-4.4771-9.99992-10z`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-c)`,fillOpacity:`.7`,d:`M7.99988 24c0-3.3137 2.68632-6 6.00002-6h8c3.3137 0 6 2.6863 6 6v12c0 3.3137 2.6863 6 6 6l-16.0001-.0001c-5.5228 0-9.99992-4.4771-9.99992-10z`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-d)`,fillOpacity:`.7`,d:`M7.99988 24c0-3.3137 2.68632-6 6.00002-6h8c3.3137 0 6 2.6863 6 6v12c0 3.3137 2.6863 6 6 6l-16.0001-.0001c-5.5228 0-9.99992-4.4771-9.99992-10z`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-e)`,d:`M32.9999 18c2.7614 0 5-2.2386 5-5s-2.2386-5-5-5-5 2.2386-5 5 2.2386 5 5 5`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-f)`,fillOpacity:`.46`,d:`M32.9999 18c2.7614 0 5-2.2386 5-5s-2.2386-5-5-5-5 2.2386-5 5 2.2386 5 5 5`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-g)`,fillOpacity:`.4`,d:`M32.9999 18c2.7614 0 5-2.2386 5-5s-2.2386-5-5-5-5 2.2386-5 5 2.2386 5 5 5`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-h)`,d:`M17.9999 16c3.3137 0 6-2.6863 6-6 0-3.31371-2.6863-6-6-6s-6 2.68629-6 6c0 3.3137 2.6863 6 6 6`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-i)`,fillOpacity:`.6`,d:`M17.9999 16c3.3137 0 6-2.6863 6-6 0-3.31371-2.6863-6-6-6s-6 2.68629-6 6c0 3.3137 2.6863 6 6 6`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-j)`,fillOpacity:`.5`,d:`M17.9999 16c3.3137 0 6-2.6863 6-6 0-3.31371-2.6863-6-6-6s-6 2.68629-6 6c0 3.3137 2.6863 6 6 6`}),(0,B.jsx)(`rect`,{width:`16`,height:`16`,x:`4`,y:`23`,fill:`url(#teams-logo-k)`,rx:`3.25`}),(0,B.jsx)(`rect`,{width:`16`,height:`16`,x:`4`,y:`23`,fill:`url(#teams-logo-l)`,fillOpacity:`.7`,rx:`3.25`}),(0,B.jsx)(`path`,{fill:`#fff`,d:`M15.4792 28.1054h-2.4471v7.466h-2.0648v-7.466H8.52014v-1.6768h6.95906z`}),(0,B.jsxs)(`defs`,{children:[(0,B.jsxs)(`radialGradient`,{id:`teams-logo-a`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`matrix(13.4784 0 0 33.2694 39.7967 22.1739)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{stopColor:`#a98aff`}),(0,B.jsx)(`stop`,{offset:`.14`,stopColor:`#8c75ff`}),(0,B.jsx)(`stop`,{offset:`.565`,stopColor:`#5f50e2`}),(0,B.jsx)(`stop`,{offset:`.9`,stopColor:`#3c2cb8`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-b`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`rotate(68.1539 -7.71566095 14.71355834)scale(32.752 33.1231)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{stopColor:`#85c2ff`}),(0,B.jsx)(`stop`,{offset:`.69`,stopColor:`#7588ff`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#6459fe`})]}),(0,B.jsxs)(`linearGradient`,{id:`teams-logo-c`,x1:`20.5936`,x2:`20.5936`,y1:`18`,y2:`42`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`.801159`,stopColor:`#6864f6`,stopOpacity:`0`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#5149de`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-d`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`rotate(113.326 8.09285255 17.64474501)scale(19.2186 15.4273)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{stopColor:`#bd96ff`}),(0,B.jsx)(`stop`,{offset:`.686685`,stopColor:`#bd96ff`,stopOpacity:`0`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-e`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`matrix(0 -10 12.6216 0 32.9999 11.5714)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`.268201`,stopColor:`#6868f7`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#3923b1`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-f`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`rotate(40.0516 -.03068196 44.8729095)scale(7.14629 10.3363)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`.270711`,stopColor:`#a1d3ff`}),(0,B.jsx)(`stop`,{offset:`.813393`,stopColor:`#a1d3ff`,stopOpacity:`0`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-g`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`rotate(-41.6581 32.11799918 -43.41948423)scale(8.51275 20.8824)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{stopColor:`#e3acfd`}),(0,B.jsx)(`stop`,{offset:`.816041`,stopColor:`#9fa2ff`,stopOpacity:`0`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-h`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`matrix(0 -12 15.146 0 17.9999 8.28571)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`.268201`,stopColor:`#8282ff`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#3923b1`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-i`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`rotate(40.0516 -3.15465147 21.41641466)scale(8.57554 12.4035)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`.270711`,stopColor:`#a1d3ff`}),(0,B.jsx)(`stop`,{offset:`.813393`,stopColor:`#a1d3ff`,stopOpacity:`0`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-j`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`rotate(-41.6581 20.38180375 -26.51566158)scale(10.2153 25.0589)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{stopColor:`#e3acfd`}),(0,B.jsx)(`stop`,{offset:`.816041`,stopColor:`#9fa2ff`,stopOpacity:`0`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-k`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`rotate(45 -25.76345597 16.32842712)scale(22.6274)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`.046875`,stopColor:`#688eff`}),(0,B.jsx)(`stop`,{offset:`.946875`,stopColor:`#230f94`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-l`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`matrix(0 11.2 -13.0702 0 12 32.6)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`.570647`,stopColor:`#6965f6`,stopOpacity:`0`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#8f8fff`})]})]})]})});case`imessage`:return(0,B.jsx)(`span`,{className:`channel-logo`,"aria-hidden":`true`,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 32 32`,"aria-hidden":`true`,focusable:`false`,children:[(0,B.jsx)(`path`,{fill:`#34C759`,d:`M16 4.5c6.4 0 11.5 4.2 11.5 9.5 0 5.2-5.1 9.5-11.5 9.5-1 0-2-.1-2.9-.3L7.4 27l1.8-4.2C6.3 21 4.5 17.8 4.5 14c0-5.3 5.1-9.5 11.5-9.5Z`}),(0,B.jsx)(`path`,{fill:`#FFFFFF`,d:`M10.7 12.2h10.6c.6 0 1 .4 1 1s-.4 1-1 1H10.7c-.6 0-1-.4-1-1s.4-1 1-1Zm0 4.6h7.8c.6 0 1 .4 1 1s-.4 1-1 1h-7.8c-.6 0-1-.4-1-1s.4-1 1-1Z`})]})})}}function vc(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!=`object`||typeof t!=`object`)return!1;if(e instanceof Date||t instanceof Date)return!(e instanceof Date)||!(t instanceof Date)?!1:e.getTime()===t.getTime();let n=Array.isArray(e),r=Array.isArray(t);if(n!==r)return!1;if(n&&r){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!vc(e[n],t[n]))return!1;return!0}let i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(let n of i)if(!Object.hasOwn(t,n)||!vc(e[n],t[n]))return!1;return!0}var yc=new Set([`__proto__`,`prototype`,`constructor`]);function bc(e){return yc.has(e)}function xc(e,t){if(e==null)return;let n=t.split(`.`),r=e;for(let e of n){if(typeof r!=`object`||!r||bc(e))return;r=r[e]}return r}function Sc(e,t,n){if(!t)throw Error(`setPath requires a non-empty path.`);let r=t.split(`.`);if(r.some(bc))throw Error(`setPath rejected an unsafe path segment in "${t}".`);return wc(e,r,0,n)}function Cc(e){return Array.isArray(e)?[...e]:{...e}}function wc(e,t,n,r){let i=t[n],a=n===t.length-1,o=typeof e==`object`&&!!e;if(a){if(o&&e[i]===r)return e;let t=o?Cc(e):{};return t[i]=r,t}let s=o?e[i]:void 0,c=wc(s,t,n+1,r);if(o&&c===s)return e;let l=o?Cc(e):{};return l[i]=c,l}function Tc(e){let{source:t}=e,n=e.equals??vc,[r,i]=(0,R.useState)(()=>t??null),a=(0,R.useRef)(t);(0,R.useEffect)(()=>{if(t===void 0)return;let e=a.current;if(a.current=t,r===null){i(t);return}e!==void 0&&!n(e,t)&&n(r,e)&&i(t)},[t,r,n]);let o=(0,R.useMemo)(()=>r===null||t===void 0?!1:!n(r,t),[r,t,n]),s=(0,R.useCallback)(()=>{t!==void 0&&i(t)},[t]),c=(0,R.useCallback)(e=>{i(e)},[]);return{draft:r,setDraft:i,setField:(0,R.useCallback)((e,t)=>{i(n=>n===null?n:Sc(n,e,t))},[]),isDirty:o,discard:s,commit:c}}function $(e){let{form:t,name:n,rules:r,required:i,disabled:a,render:o,children:s}=e,c=ho(),l=t??c;if(!l)throw Error("FormField requires either a `form` prop or to be nested inside <Form>.");let u=(0,R.useId)(),d=(0,R.useMemo)(()=>{let e=[];if(i&&e.push(jo()),r)for(let t of r)typeof t==`function`&&e.push(t);return No(...e)},[i,r]),f=xc(l.draft,n),p=d(f),m=(0,R.useCallback)(e=>{l.setField(n,Ec(e))},[l,n]),h=(0,R.useCallback)(()=>d(xc(l.draft,n)),[l,n,d]),g=(0,R.useMemo)(()=>({name:n,value:f,id:u,onChange:m,"aria-required":i?!0:void 0,disabled:a}),[n,f,u,m,i,a]),_=(0,R.useMemo)(()=>({error:p,invalid:p!==null}),[p]),v=(0,R.useMemo)(()=>({name:n,id:u,error:p,validate:h,required:i,disabled:a}),[n,u,p,h,i,a]),y=o?.({field:g,fieldState:_})??(typeof s==`function`?s({field:g,fieldState:_}):s);return(0,B.jsx)(go.Provider,{value:v,children:y})}function Ec(e){if(typeof e!=`object`||!e)return e;let t=e;if(!t.target||typeof t.target!=`object`)return e;let n=t.target;return n.type===`checkbox`?n.checked??!1:`value`in n?n.value:e}function Dc(e){let[t,n]=(0,R.useState)(()=>new Map),[r,i]=(0,R.useState)(0),a=(0,R.useRef)(new Map),o=(0,R.useRef)(new Map),s=(0,R.useRef)(t);s.current=t;let c=(0,R.useCallback)((e,t)=>{n(n=>{if(t===null){if(!n.has(e))return n;let t=new Map(n);return t.delete(e),t}if(n.get(e)===t)return n;let r=new Map(n);return r.set(e,t),r})},[]),l=(0,R.useCallback)((e,t)=>(a.current.set(e,t),()=>{a.current.get(e)===t&&a.current.delete(e)}),[]),u=(0,R.useCallback)((e,t)=>(o.current.set(e,t),()=>{o.current.get(e)===t&&o.current.delete(e)}),[]),d=(0,R.useCallback)(()=>{let e=new Map(s.current);for(let[t,n]of a.current){let r=n();r===null?e.delete(t):e.set(t,r),c(t,r)}return e},[c]),f=(0,R.useCallback)(e=>{for(let[t,n]of Object.entries(e)){let e=o.current.get(t);e?e(n):c(t,n)}},[c]),p=(0,R.useCallback)(()=>{for(let e of o.current.values())e(null);n(e=>e.size===0?e:new Map)},[]),m=(0,R.useCallback)(()=>{n(e=>e.size===0?e:new Map),i(e=>e+1)},[]),h=(0,R.useMemo)(()=>({registerError:c,registerValidator:l,registerErrorSetter:u,validateAll:d,setErrors:f,clearErrors:p,reset:m,resetSeq:r,errors:t,isValid:t.size===0}),[c,l,u,d,f,p,m,r,t]),g=Tc({source:e?.source,equals:e?.equals});return e?{...h,...g}:h}function Oc({form:e,onSubmit:t,children:n,noValidate:r=!0,...i}){let[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(!1),l=(0,R.useRef)(e.validateAll);l.current=e.validateAll;let u=(0,R.useRef)(t);u.current=t;let d=(0,R.useRef)(!1),f=(0,R.useRef)(e.resetSeq);f.current!==e.resetSeq&&(f.current=e.resetSeq,a&&o(!1));let p=(0,R.useCallback)(e=>{if(e.preventDefault(),d.current)return;o(!0);let t=l.current();if(t.size>0){let e=Ac(t);if(e){let t=document.getElementById(e);t&&typeof t.focus==`function`&&t.focus()}return}let n=u.current?.();if(!kc(n))return;d.current=!0,c(!0);let r=()=>{d.current=!1,c(!1)};n.then(r,r)},[]),m=(0,R.useMemo)(()=>({registerError:e.registerError,registerValidator:e.registerValidator,registerErrorSetter:e.registerErrorSetter}),[e.registerError,e.registerValidator,e.registerErrorSetter]),h=(0,R.useMemo)(()=>({isValid:e.isValid,errors:e.errors}),[e.isValid,e.errors]),g=(0,R.useMemo)(()=>({submitAttempted:a,resetSeq:e.resetSeq,isSubmitting:s}),[a,e.resetSeq,s]),_=(0,R.useMemo)(()=>{if(!(`setField`in e&&`draft`in e))return null;let t=e;return{draft:t.draft,setField:t.setField}},[e]);return(0,B.jsx)(mo.Provider,{value:_,children:(0,B.jsx)(vo.Provider,{value:m,children:(0,B.jsx)(yo.Provider,{value:h,children:(0,B.jsx)(bo.Provider,{value:g,children:(0,B.jsx)(`form`,{noValidate:r,...i,onSubmit:p,children:n})})})})})}function kc(e){return typeof e==`object`&&!!e&&typeof e.then==`function`}function Ac(e){if(e.size===0)return;if(typeof document>`u`)return e.keys().next().value;let t=null;for(let n of e.keys()){let e=document.getElementById(n);e&&(t===null||(t.el.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)!==0)&&(t={id:n,el:e})}return t?.id??e.keys().next().value}function jc({value:e,onValueChange:t,onErrorChange:n,integer:r,min:i,max:a,step:o,emptyValue:s,requiredMessage:c=`Required.`,...l}){let[u,d]=(0,R.useState)(()=>String(e)),f=(0,R.useRef)(u);f.current=u;let p=Eo(),m=po(e=>{p.setError(e),n?.(e)});(0,R.useEffect)(()=>{let t=f.current;t.trim()===``&&s!==void 0&&e===s||Number(t)!==e&&(d(String(e)),m(null))},[e,s,m]);let h=e=>{if(e.trim()===``)return s===void 0?{error:c}:{value:s,error:null};let t=Number(e);return Number.isFinite(t)?r&&!Number.isInteger(t)?{error:`Enter a whole number.`}:i!==void 0&&t<i?{error:`Must be ≥ ${i}.`}:a!==void 0&&t>a?{error:`Must be ≤ ${a}.`}:{value:t,error:null}:{error:`Enter a valid number.`}};return(0,B.jsx)(Y,{...l,type:r?`number`:`text`,inputMode:r?`numeric`:`decimal`,min:i,max:a,step:r?o:void 0,value:u,onBlur:t=>{if(!r){let t=Number(u);Number.isFinite(t)||(d(String(e)),m(null))}l.onBlur?.(t)},onChange:e=>{let n=e.target.value;d(n);let r=h(n);m(r.error),r.error===null&&r.value!==void 0&&t(r.value)}})}var Mc={root:`_root_tqjv2_1`,thumb:`_thumb_tqjv2_40`,sizeDefault:`_sizeDefault_tqjv2_50`,sizeSm:`_sizeSm_tqjv2_65`},Nc={default:Mc.sizeDefault,sm:Mc.sizeSm};function Pc({checked:e,onCheckedChange:t,disabled:n,size:r=`default`,className:i,onClick:a,name:o,value:s=`on`,required:c,...l}){let{required:u,...d}=Do({disabled:n,required:c,...l}),f=Eo(),p=e?`checked`:`unchecked`,m=d.disabled,h=n=>{m||(a?.(n),!n.defaultPrevented&&(f.setTouched(!0),t?.(!e)))};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{...d,type:`button`,role:`switch`,"aria-checked":e,"data-slot":`switch`,"data-state":p,"data-size":r,className:V(Mc.root,Nc[r],i),onClick:h,children:(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`switch-thumb`,"data-state":p,className:Mc.thumb})}),o&&e&&!m?(0,B.jsx)(`input`,{type:`hidden`,name:o,value:s}):null]})}function Fc(e){let t=o();return g({mutationFn:async t=>{try{return await e.mutationFn(t)}catch(e){throw e instanceof Error?e:Error(String(e),{cause:e})}},onSuccess:(n,r)=>{e.onSuccess?.(n,r);for(let n of e.invalidates??[])t.invalidateQueries({queryKey:n})},onError:(t,n)=>{e.onError?.(t,n)}})}var Ic=`hybridclaw_session`,Lc=new Set;function Rc(){try{return localStorage.getItem(Ic)??``}catch{return``}}function zc(e){if(Rc()!==e){try{e?localStorage.setItem(Ic,e):localStorage.removeItem(Ic)}catch{}for(let e of Lc)e()}}var Bc=`main`;function Vc(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}function Hc(){return`sess_${new Date().toISOString().slice(0,19).replace(/[-:]/g,``).replace(`T`,`_`)}_${Vc(4)}`}function Uc(){let e=`hybridclaw_user_id`,t=localStorage.getItem(e);if(t)return t;let n=`web-user-${Vc(4)}`;return localStorage.setItem(e,n),n}function Wc(e){zc(e)}var Gc=0;function Kc(){return Gc+=1,`local-${Gc}-${Date.now()}`}async function qc(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}function Jc(e){if(!e)return``;if(e.summary)return e.summary;let t=[];return e.intent&&t.push(`Approval needed for: ${e.intent}`),e.reason&&t.push(`Why: ${e.reason}`),t.push(`Approval ID: ${e.approvalId}`),t.join(`
4
- `)}var Yc={once:`/approve yes`,session:`/approve session`,agent:`/approve agent`,all:`/approve all`,deny:`/approve no`};function Xc(e,t){let n=Yc[e],r=t.trim();return/\s/.test(r)?null:r?`${n} ${r}`:n}function Zc(e){return(e.name??``).trim()||`clipboard${{"application/pdf":`.pdf`,"image/gif":`.gif`,"image/jpeg":`.jpg`,"image/png":`.png`,"image/webp":`.webp`,"text/plain":`.txt`}[(e.type??``).trim().toLowerCase()]??``}`}function Qc(e){let t=Zc(e);return e.name===t?e:new File([e],t,{type:e.type||`application/octet-stream`,lastModified:Number.isFinite(e.lastModified)?e.lastModified:Date.now()})}function $c(e){if(!e)return[];let t=[];for(let n of Array.from(e.files))t.push(Qc(n));if(t.length>0)return t;let n=new Set;for(let r of Array.from(e.items)){if(r.kind!==`file`)continue;let e=r.getAsFile();if(!e)continue;let i=Qc(e),a=`${i.name}:${i.size}:${i.type}:${i.lastModified}`;n.has(a)||(n.add(a),t.push(i))}return t}function el(e){return Object.keys(e).length}function tl(e){return el(e.discord.guilds)}function nl(e){return Object.values(e.discord.guilds).reduce((e,t)=>e+el(t.channels),0)}function rl(e){return el(e.msteams.teams)}function il(e){return Object.values(e.msteams.teams).reduce((e,t)=>e+el(t.channels),0)}function al(e,t){let n=tl(e),r=nl(e),i=e.discord.commandsOnly||e.discord.groupPolicy!==`disabled`,a=t.discordTokenConfigured===!0,o=i&&a,s=o?`active`:o||a||n>0||r>0?`configured`:`available`;return{kind:`discord`,label:`Discord`,summary:`${eo(n,`guild default`)} · ${eo(r,`explicit override`)}`,statusTone:s,statusLabel:s===`active`?`active`:s===`configured`?`configured`:`available`}}function ol(e,t){let n=t.whatsappLinked===!0,r=e.whatsapp.dmPolicy!==`disabled`||e.whatsapp.groupPolicy!==`disabled`,i=n?r?`Linked device · groups ${e.whatsapp.groupPolicy}`:`Linked device available but transport is off`:r?`Link device to enable WhatsApp`:`WhatsApp transport is off`,a=n?r?`active`:`configured`:`available`;return{kind:`whatsapp`,label:`WhatsApp`,summary:i,statusTone:a,statusLabel:a===`active`?`active`:a===`configured`?`configured`:`available`}}function sl(e,t){let n=t.telegramTokenConfigured===!0,r=e.telegram.dmPolicy!==`disabled`||e.telegram.groupPolicy!==`disabled`,i=e.telegram.enabled&&n&&r,a=i||e.telegram.enabled||n||e.telegram.allowFrom.length>0||e.telegram.groupAllowFrom.length>0,o=i?`active`:a?`configured`:`available`;return{kind:`telegram`,label:`Telegram`,summary:`DM ${e.telegram.dmPolicy} · groups ${e.telegram.groupPolicy}`,statusTone:o,statusLabel:o===`active`?`active`:o===`configured`?`configured`:`available`}}function cl(e,t){let n=t.signalDaemonUrlConfigured===!0,r=t.signalAccountConfigured===!0,i=t.signalCliAvailable===!0,a=e.signal.dmPolicy!==`disabled`||e.signal.groupPolicy!==`disabled`,o=e.signal.enabled&&n&&r&&a,s=o||e.signal.enabled||n||r||i||e.signal.allowFrom.length>0||e.signal.groupAllowFrom.length>0,c=o?`active`:s?`configured`:`available`;return{kind:`signal`,label:`Signal`,summary:`DM ${e.signal.dmPolicy} · groups ${e.signal.groupPolicy}${i?` · QR ready`:``}`,statusTone:c,statusLabel:c===`active`?`active`:c===`configured`?`configured`:`available`}}function ll(e,t){let n=t.threemaSecretConfigured===!0,r=e.threema.enabled&&!!e.threema.identity&&n&&e.threema.dmPolicy!==`disabled`,i=r||e.threema.enabled||!!e.threema.identity||n||e.threema.allowFrom.length>0,a=r?`active`:i?`configured`:`available`;return{kind:`threema`,label:`Threema`,summary:e.threema.identity?`Gateway ${e.threema.identity} · DM ${e.threema.dmPolicy}`:`No Gateway identity configured yet`,statusTone:a,statusLabel:a===`active`?`active`:a===`configured`?`configured`:`available`}}function ul(e,t){let n=t.slackBotTokenConfigured===!0,r=t.slackAppTokenConfigured===!0,i=e.slack.enabled&&n&&r,a=i||e.slack.enabled||n||r||e.slack.allowFrom.length>0||e.slack.groupAllowFrom.length>0,o=i?`active`:a?`configured`:`available`;return{kind:`slack`,label:`Slack`,summary:`DM ${e.slack.dmPolicy} · channels ${e.slack.groupPolicy}`,statusTone:o,statusLabel:o===`active`?`active`:o===`configured`?`configured`:`available`}}function dl(e,t){let n=Object.keys(e.slackWebhook.webhooks).length,r=e.slackWebhook.enabled&&t.slackWebhookDefaultConfigured===!0,i=r||e.slackWebhook.enabled||n>0,a=r?`active`:i?`configured`:`available`;return{kind:`slack_webhook`,label:`Slack Incoming Webhook`,summary:n>0?`${eo(n,`webhook target`)} · outbound only`:`No webhook targets configured yet`,statusTone:a,statusLabel:a===`active`?`active`:a===`configured`?`configured`:`available`}}function fl(e,t){let n=Object.keys(e.discordWebhook.webhooks).length,r=e.discordWebhook.enabled&&t.discordWebhookDefaultConfigured===!0,i=r||e.discordWebhook.enabled||n>0,a=r?`active`:i?`configured`:`available`;return{kind:`discord_webhook`,label:`Discord Incoming Webhook`,summary:n>0?`${eo(n,`webhook target`)} · outbound only`:`No webhook targets configured yet`,statusTone:a,statusLabel:a===`active`?`active`:a===`configured`?`configured`:`available`}}function pl(e,t){let n=t.voiceAuthTokenConfigured===!0,r=e.voice.twilio.accountSid.trim(),i=e.voice.twilio.fromNumber.trim(),a=e.voice.enabled&&!!r&&!!i&&n,o=a||e.voice.enabled||!!r||!!i||n,s=a?`active`:o?`configured`:`available`;return{kind:`voice`,label:`Voice`,summary:`Twilio · webhook ${e.voice.webhookPath}`,statusTone:s,statusLabel:s===`active`?`active`:s===`configured`?`configured`:`available`}}function ml(e,t){let n=t.emailPasswordConfigured===!0,r=String(e.email.address||``).trim(),i=Array.isArray(e.email.accounts)?e.email.accounts:[],a=i.filter(e=>e.address||e.agentId),o=r.length>0&&a.some(e=>{let t=String(e.agentId||``).trim(),n=String(e.address||``).trim();return!t||t===`main`||n.toLowerCase()===r.toLowerCase()}),s=a.length+(r&&!o?1:0),c=i.some(e=>{let t=e.password;return(typeof t==`string`?t.trim().length>0:!!t?.id)&&!!e.agentId&&!!e.address&&!!e.imapHost&&!!e.smtpHost}),l=e.email.enabled&&(c||n&&!!e.email.address&&!!e.email.imapHost&&!!e.email.smtpHost),u=l||a.length>0||!!e.email.address||!!e.email.imapHost||!!e.email.smtpHost||e.email.allowFrom.length>0,d=l?`active`:u?`configured`:`available`;return{kind:`email`,label:`Email`,summary:s>0?`${s} mailbox${s===1?``:`es`}`:e.email.address||`No mailbox address configured yet`,statusTone:d,statusLabel:d===`active`?`active`:d===`configured`?`configured`:`available`}}function hl(e){let t=rl(e),n=il(e),r=e.msteams.enabled&&!!e.msteams.appId&&!!e.msteams.tenantId,i=r||e.msteams.enabled||!!e.msteams.appId||!!e.msteams.tenantId||t>0||n>0,a=r?`active`:i?`configured`:`available`;return{kind:`msteams`,label:`Microsoft Teams`,summary:`${eo(t,`team default`)} · ${eo(n,`channel override`)}`,statusTone:a,statusLabel:a===`active`?`active`:a===`configured`?`configured`:`available`}}function gl(e,t){let n=e.imessage.backend===`bluebubbles`,r=t.imessagePasswordConfigured===!0,i=(n?e.imessage.enabled&&r&&e.imessage.serverUrl&&e.imessage.webhookPath:e.imessage.enabled&&e.imessage.cliPath&&e.imessage.dbPath)?`active`:`available`;return{kind:`imessage`,label:`iMessage`,summary:`${n?`Remote`:`Local`} backend · DM ${e.imessage.dmPolicy}`,statusTone:i,statusLabel:i===`active`?`active`:`available`}}function _l(e){switch(e.statusTone){case`active`:return 2;case`configured`:return 1;default:return 0}}function vl(e,t={}){return[al(e,t),fl(e,t),ul(e,t),dl(e,t),sl(e,t),cl(e,t),ll(e,t),pl(e,t),ol(e,t),ml(e,t),hl(e),gl(e,t)].sort((e,t)=>{let n=_l(t)-_l(e);return n===0?e.label.localeCompare(t.label):n})}function yl(e){return e.discord.commandsOnly||e.discord.groupPolicy!==`disabled`}function bl(e){return e.whatsapp.dmPolicy!==`disabled`||e.whatsapp.groupPolicy!==`disabled`}function xl(e){return e.telegram.dmPolicy!==`disabled`||e.telegram.groupPolicy!==`disabled`}function Sl(e){return(0,B.jsxs)(`label`,{className:`field textarea-field`,children:[(0,B.jsx)(`span`,{children:e.label}),(0,B.jsx)(Jo,{rows:e.rows??3,value:no(e.value),onChange:t=>e.onChange(to(t.target.value)),placeholder:e.placeholder})]})}var Cl=`*`;function wl(e){return e.trim()||null}function Tl(e){let t=[];for(let n of e)!n||t.includes(n)||t.push(n);return t}function El(e){let[t,n]=(0,R.useState)(``),r=Tl(e.value),i=wl(t),a=i!==null,o=()=>{if(!i||i===Cl&&!r.includes(Cl)&&!window.confirm(`Adding * allows every sender for this allowlist. Continue?`))return;let t=Tl([...r,i]);e.onChange(t),e.onAdd?.(t),n(``)},s=t=>{e.onChange(r.filter(e=>e!==t))};return(0,B.jsxs)(q,{className:`allow-list-field`,children:[(0,B.jsx)(J,{children:e.label}),(0,B.jsxs)(`div`,{className:`allow-list-add-row`,children:[(0,B.jsx)(Y,{value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},placeholder:e.placeholder}),(0,B.jsx)(Z,{type:`button`,variant:`ghost`,disabled:!a,onClick:o,children:`Add`})]}),r.length>0?(0,B.jsx)(`ul`,{className:`allow-list-items`,children:r.map(e=>(0,B.jsxs)(`li`,{className:e===Cl?`allow-list-item allow-list-item-wildcard`:`allow-list-item`,children:[(0,B.jsxs)(`div`,{className:`allow-list-entry-main`,children:[(0,B.jsx)(`span`,{className:`allow-list-entry-value`,children:e}),e===Cl?(0,B.jsx)(`span`,{className:`allow-list-warning-label`,children:`all senders`}):null]}),(0,B.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Remove ${e}`,onClick:()=>s(e),children:(0,B.jsx)(Fr,{width:15,height:15})})]},e))}):(0,B.jsx)(`p`,{className:`muted-copy`,children:`No allowed senders configured.`})]})}function Dl(e){return Array.isArray(e.email.accounts)?e.email.accounts:[]}function Ol(e){return{agentId:``,imapHost:e.imapHost,imapPort:e.imapPort,imapSecure:e.imapSecure,smtpHost:e.smtpHost,smtpPort:e.smtpPort,smtpSecure:e.smtpSecure,address:``,password:``,pollIntervalMs:e.pollIntervalMs,folders:[...e.folders],allowFrom:[...e.allowFrom],mediaMaxMb:e.mediaMaxMb}}function kl(e){let t=e.password;return t&&typeof t==`object`&&t.source===`store`?t.id:``}function Al(e,t){let n={...e};return t?n.password={source:`store`,id:t}:delete n.password,n}function jl(e){return e.name?`${e.name} (${e.id})`:e.id}function Ml(e){let t=e.find(e=>e.id===Bc);return t?jl(t):`Main Agent (${Bc})`}function Nl(e){return e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,`_`).replace(/^_+|_+$/g,``)||`AGENT`}function Pl(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36).toUpperCase().padStart(6,`0`)}function Fl(e,t){return`${Nl(e.agentId||t)}_${Pl(`${e.agentId||``}\n${t}\n${e.address||``}`)}_EMAIL_PASSWORD`}function Il(e,t){let n=t.find(t=>t.id===e.agentId);return String(n?.chatbotId||e.agentId||``).trim()}function Ll(){return`mailbox-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function Rl(e){return(0,B.jsx)($,{name:`channelInstructions.${e.kind}`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Channel instructions`}),(0,B.jsx)(Jo,{rows:4,...e,placeholder:`Optional extra instructions for this channel only.`})]})})}function zl(e){let[t,n]=(0,R.useState)(!1),[r,i]=(0,R.useState)(``),[a,o]=(0,R.useState)(!1),s=e.source!==null||a||e.configured||String(e.configValue||``).trim().length>0?`Change ${e.secretLabel}`:`Set ${e.secretLabel}`,c=hs(),l=g({mutationFn:async t=>Ht(e.token,e.secretName,t),onSuccess:()=>{o(!0),e.onSecretSaved(),n(!1),i(``),c.success(`${e.label} updated in encrypted runtime secrets.`)},onError:e=>{c.error(`Save failed`,H(e))}});return(0,B.jsxs)(q,{className:`managed-secret-field`,children:[(0,B.jsx)(Vo,{children:e.label}),t?null:(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{className:`managed-secret-action`,variant:`ghost`,type:`button`,onClick:()=>{l.reset(),n(!0),i(``)},children:s})}),t?(0,B.jsxs)(`div`,{className:`managed-secret-editor`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`New ${e.secretLabel}`}),(0,B.jsx)(Y,{type:`password`,value:r,autoComplete:`new-password`,onChange:e=>i(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{type:`button`,loading:l.isPending,disabled:!r.trim()||l.isPending,onClick:()=>l.mutate(r),children:l.isPending?`Saving...`:`Save ${e.secretLabel}`}),(0,B.jsx)(Z,{variant:`ghost`,type:`button`,disabled:l.isPending,onClick:()=>{l.reset(),n(!1),i(``)},children:`Cancel`})]})]}):null]})}function Bl(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:yl(e.draft),onCheckedChange:t=>{let n=e.draft.discord,r=t&&n.groupPolicy===`disabled`&&!n.commandsOnly?`open`:t?n.groupPolicy:`disabled`,i=t?n.commandsOnly:!1;e.form.setField(`discord.groupPolicy`,r),e.form.setField(`discord.commandsOnly`,i)}}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Enabled`})})]}),(0,B.jsx)(zl,{label:`Bot token`,secretName:`DISCORD_TOKEN`,secretLabel:`token`,configured:e.tokenConfigured,source:e.tokenSource,token:e.token,onSecretSaved:e.onSecretSaved}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`discord.prefix`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Prefix`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)($,{name:`discord.groupPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Group policy`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),(0,B.jsx)($,{name:`discord.commandsOnly`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Commands only`})})]})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`discord.commandMode`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Command mode`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`public`,children:`public`}),(0,B.jsx)(Q,{value:`restricted`,children:`restricted`})]})]})}),(0,B.jsx)($,{name:`discord.sendPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Send policy`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),(0,B.jsx)($,{name:`discord.commandAllowedUserIds`,render:({field:e})=>(0,B.jsx)(Sl,{label:`Allowed command user IDs`,value:e.value,rows:3,placeholder:`comma or newline separated`,onChange:e.onChange})}),(0,B.jsx)($,{name:`discord.sendAllowedChannelIds`,render:({field:e})=>(0,B.jsx)(Sl,{label:`Allowed outbound channel IDs`,value:e.value,rows:3,placeholder:`comma or newline separated`,onChange:e.onChange})}),(0,B.jsx)($,{name:`discord.freeResponseChannels`,render:({field:e})=>(0,B.jsx)(Sl,{label:`Free response channel IDs`,value:e.value,rows:3,placeholder:`comma or newline separated`,onChange:e.onChange})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`discord.typingMode`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Typing mode`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`instant`,children:`instant`}),(0,B.jsx)(Q,{value:`thinking`,children:`thinking`}),(0,B.jsx)(Q,{value:`streaming`,children:`streaming`}),(0,B.jsx)(Q,{value:`never`,children:`never`})]})]})}),(0,B.jsx)($,{name:`discord.ackReaction`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Ack reaction`}),(0,B.jsx)(Y,{...e,placeholder:`👀`})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`discord.ackReactionScope`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Ack reaction scope`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`all`,children:`all`}),(0,B.jsx)(Q,{value:`group-mentions`,children:`group-mentions`}),(0,B.jsx)(Q,{value:`direct`,children:`direct`}),(0,B.jsx)(Q,{value:`off`,children:`off`})]})]})}),(0,B.jsx)($,{name:`discord.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`discord.debounceMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Debounce ms`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`discord.maxLinesPerMessage`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Max lines per message`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`discord.rateLimitPerUser`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Rate limit per user`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`discord.maxConcurrentPerChannel`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Max concurrent per channel`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)($,{name:`discord.removeAckAfterReply`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Remove ack after reply`})})]})}),(0,B.jsx)(Rl,{kind:`discord`}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`Discord guild defaults and explicit per-channel overrides stay intact. This page edits the transport defaults that apply across the space.`})]})}function Vl(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:bl(e.draft),onCheckedChange:t=>{let n=e.draft.whatsapp,r=t&&n.dmPolicy===`disabled`?`pairing`:t?n.dmPolicy:`disabled`,i=t?n.groupPolicy:`disabled`;e.form.setField(`whatsapp.dmPolicy`,r),e.form.setField(`whatsapp.groupPolicy`,i)}}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Enabled`})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`whatsapp.dmPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`DM policy`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`pairing`,children:`pairing`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})}),(0,B.jsx)($,{name:`whatsapp.groupPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Group policy`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),bl(e.draft)&&!e.linked?(0,B.jsxs)(`div`,{className:`field whatsapp-pairing-field`,children:[(0,B.jsx)(`span`,{children:`Pairing QR`}),e.pairingQrText?(0,B.jsx)(`pre`,{className:`whatsapp-pairing-qr`,role:`img`,"aria-label":`WhatsApp pairing QR`,children:e.pairingQrText}):(0,B.jsx)(`p`,{className:`muted-copy`,children:e.pairingError||`Waiting for a fresh QR from the gateway.`})]}):null,(0,B.jsx)($,{name:`whatsapp.allowFrom`,render:({field:e})=>(0,B.jsx)(El,{label:`Allowed DM senders`,value:e.value,placeholder:`+14155551212 or *`,onChange:e.onChange})}),(0,B.jsx)($,{name:`whatsapp.groupAllowFrom`,render:({field:e})=>(0,B.jsx)(El,{label:`Allowed group senders`,value:e.value,placeholder:`+14155551212 or *`,onChange:e.onChange})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`whatsapp.debounceMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Debounce ms`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`whatsapp.ackReaction`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Ack reaction`}),(0,B.jsx)(Y,{...e})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`whatsapp.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`whatsapp.mediaMaxMb`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Media max MB`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)($,{name:`whatsapp.sendReadReceipts`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Send read receipts`})})]})}),(0,B.jsx)(Rl,{kind:`whatsapp`})]})}function Hl(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`telegram.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)(zl,{label:`Bot token`,secretName:`TELEGRAM_BOT_TOKEN`,secretLabel:`token`,configValue:e.draft.telegram.botToken,configured:e.tokenConfigured,source:e.tokenSource,token:e.token,onSecretSaved:e.onSecretSaved}),(0,B.jsx)($,{name:`telegram.pollIntervalMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Poll interval ms`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`telegram.dmPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`DM policy`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})}),(0,B.jsx)($,{name:`telegram.groupPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Group policy`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),(0,B.jsx)($,{name:`telegram.requireMention`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Require mention in groups`})})]})}),(0,B.jsx)($,{name:`telegram.allowFrom`,render:({field:e})=>(0,B.jsx)(El,{label:`Allowed DM senders`,value:e.value,placeholder:`numeric user id, @username, or *`,onChange:e.onChange})}),(0,B.jsx)($,{name:`telegram.groupAllowFrom`,render:({field:e})=>(0,B.jsx)(El,{label:`Allowed group senders`,value:e.value,placeholder:`numeric user id, @username, or *`,onChange:e.onChange})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`telegram.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`telegram.mediaMaxMb`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Media max MB`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`Telegram inbound handling stays off until DM or group policy is opened or allowlisted.`}),xl(e.draft)?null:(0,B.jsx)(`p`,{className:`muted-copy`,children:`This page edits transport-level Telegram settings. Discord and Teams remain the only transports with per-channel override bindings.`}),(0,B.jsx)(Rl,{kind:`telegram`})]})}function Ul(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`threema.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`threema.identity`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Gateway identity`}),(0,B.jsx)(Y,{...e,placeholder:`*HYBRID1`})]})}),(0,B.jsx)(zl,{label:`Gateway secret`,secretName:`THREEMA_GATEWAY_SECRET`,secretLabel:`secret`,configValue:e.draft.threema.secret,configured:e.secretConfigured,source:e.secretSource,token:e.token,onSecretSaved:e.onSecretSaved})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`threema.apiBaseUrl`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`API base URL`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)($,{name:`threema.dmPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`DM policy`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),(0,B.jsx)($,{name:`threema.allowFrom`,render:({field:e})=>(0,B.jsx)(El,{label:`Allowed senders`,value:e.value,placeholder:`threema:ABCDEFGH, threema:phone:41791234567, or *`,onChange:e.onChange})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`threema.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`threema.outboundDelayMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Outbound delay ms`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`Threema Gateway Basic mode supports outbound text only. Inbound chat history, typing, and attachments are not available.`}),(0,B.jsx)(Rl,{kind:`threema`})]})}function Wl(e){let t=o(),n=hs(),[r,i]=(0,R.useState)(`signal-cli`),[a,s]=(0,R.useState)(`HybridClaw`),c=y({queryKey:[`signal-link`,e.token],queryFn:()=>Bt(e.token),refetchInterval:e=>{let t=e.state.data?.status;return t===`starting`||t===`qr`?2e3:!1}}).data,l=g({mutationFn:()=>zt(e.token,{cliPath:r,deviceName:a}),onSuccess:r=>{t.setQueryData([`signal-link`,e.token],r),n.success(`Signal linked-device QR started.`),t.invalidateQueries({queryKey:[`status`,e.token]})},onError:e=>{n.error(`Signal link failed`,H(e))}});return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`signal.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`signal-cli path`}),(0,B.jsx)(Y,{value:r,onChange:e=>i(e.target.value),placeholder:`signal-cli`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Device name`}),(0,B.jsx)(Y,{value:a,onChange:e=>s(e.target.value),placeholder:`HybridClaw`})]})]}),(0,B.jsxs)(`div`,{className:`field whatsapp-pairing-field`,children:[(0,B.jsx)(`span`,{children:`Linked-device QR`}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{type:`button`,variant:`ghost`,loading:l.isPending,disabled:!e.cliAvailable||l.isPending||c?.status===`starting`||c?.status===`qr`,onClick:()=>l.mutate(),children:l.isPending?`Starting...`:`Start QR link`})}),e.cliAvailable?c?.pairingQrText?(0,B.jsx)(`pre`,{className:`whatsapp-pairing-qr`,role:`img`,"aria-label":`Signal linked-device QR`,children:c.pairingQrText}):c?.status===`starting`?(0,B.jsx)(`p`,{className:`muted-copy`,children:`Waiting for signal-cli to print a QR.`}):c?.status===`complete`?(0,B.jsx)(`p`,{className:`muted-copy`,children:`Linked-device flow completed. Start the daemon and save the account below.`}):c?.status===`error`?(0,B.jsx)(`p`,{className:`muted-copy`,children:c.error||`Signal linked-device setup failed.`}):(0,B.jsxs)(`p`,{className:`muted-copy`,children:["Starts `signal-cli link -n HybridClaw` on the gateway host",e.cliVersion?` (${e.cliVersion})`:``,`.`]}):(0,B.jsxs)(`p`,{className:`muted-copy`,children:[`signal-cli is not available on this gateway host. Install signal-cli, use a bundled cloud amd64 gateway image, or configure an external daemon/sidecar.`,e.cliError?` ${e.cliError}`:``]})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`signal.daemonUrl`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Daemon URL`}),(0,B.jsx)(Y,{...e,placeholder:`http://127.0.0.1:8080`})]})}),(0,B.jsx)($,{name:`signal.account`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Account`}),(0,B.jsx)(Y,{...e,placeholder:`+14155550123`})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`signal.dmPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`DM policy`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})}),(0,B.jsx)($,{name:`signal.groupPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Group policy`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),(0,B.jsx)($,{name:`signal.allowFrom`,render:({field:e})=>(0,B.jsx)(El,{label:`Allowed DM senders`,value:e.value,placeholder:`+14155551212, Signal UUID, or *`,onChange:e.onChange})}),(0,B.jsx)($,{name:`signal.groupAllowFrom`,render:({field:e})=>(0,B.jsx)(El,{label:`Allowed group senders`,value:e.value,placeholder:`+14155551212, Signal UUID, or *`,onChange:e.onChange})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`signal.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`signal.reconnectIntervalMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Reconnect interval ms`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`signal.outboundDelayMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Outbound delay ms`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`After scanning the QR in Signal mobile, start the daemon and save the daemon URL here. Groups stay disabled by default; start with one allowlisted DM sender.`}),(0,B.jsx)(Rl,{kind:`signal`})]})}function Gl(e){let[t,n]=(0,R.useState)(!1),[r,i]=(0,R.useState)(null),a=hs(),o=Dl(e.draft),[s,c]=(0,R.useState)(()=>o.map(()=>Ll()));(0,R.useEffect)(()=>{c(e=>e.length===o.length?e:e.length>o.length?e.slice(0,o.length):[...e,...Array.from({length:o.length-e.length},Ll)])},[o.length]);function l(t){e.form.setField(`email.accounts`,t)}function u(e,t){l(o.map((n,r)=>r===e?t(n):n))}function d(){c(e=>[...e,Ll()]),l([...o,Ol(e.draft.email)])}function f(e){c(t=>t.filter((t,n)=>n!==e)),l(o.filter((t,n)=>n!==e))}function p(t){let n={...e.draft,email:{...e.draft.email,allowFrom:t}};e.form.setDraft(n),e.onAutoSave(n)}async function m(){n(!0);try{let t=await Ft(e.token),n=t?.handles;if(!Array.isArray(n)||n.length===0){a.info(`No HybridAI agent handles found.`);return}let r=t?.credentials;if(!r){let e=n.map(e=>`${e.handle} (${e.status})`).join(`, `);a.info(`Handles found: ${e}. Could not retrieve mailbox credentials.`);return}if(r.email&&e.form.setField(`email.address`,r.email),r.imap_host&&e.form.setField(`email.imapHost`,r.imap_host),r.imap_port!=null&&e.form.setField(`email.imapPort`,r.imap_port),r.smtp_host&&e.form.setField(`email.smtpHost`,r.smtp_host),r.smtp_port!=null&&e.form.setField(`email.smtpPort`,r.smtp_port),r.password)try{await Ht(e.token,`EMAIL_PASSWORD`,r.password),e.onSecretSaved()}catch(e){a.error(`Password could not be saved`,H(e)),a.info(`Email fields were populated, but password was not saved.`);return}let i=t.handleId||`HybridAI`;a.success(`Email config loaded from ${i}.`)}catch(e){a.error(`Failed to fetch email config`,H(e))}finally{n(!1)}}async function h(t){let n=o[t];if(!n)return;let r=Il(n,e.agents);if(!r){a.info(`Select an agent before fetching a HybridAI mailbox.`);return}i(t);try{let i=await Ft(e.token,{handleId:r}),o=i?.credentials;if(!o){a.info(`Could not retrieve mailbox credentials for ${i?.handleId||r}.`);return}let s=Fl(n,i.handleId||r);if(o.password)try{await Ht(e.token,s,o.password),e.onSecretSaved()}catch(e){a.error(`Password could not be saved`,H(e)),a.info(`Mailbox credentials were not applied because the password was not saved.`);return}u(t,e=>({...e,...o.email?{address:o.email}:{},...o.imap_host?{imapHost:o.imap_host}:{},...o.imap_port==null?{}:{imapPort:o.imap_port},...o.smtp_host?{smtpHost:o.smtp_host}:{},...o.smtp_port==null?{}:{smtpPort:o.smtp_port},...o.password?{password:{source:`store`,id:s}}:{}})),a.success(`Mailbox config loaded from ${i.handleId||r}.`)}catch(e){a.error(`Failed to fetch mailbox config`,H(e))}finally{i(null)}}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`email.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),e.hybridaiApiKeyConfigured?(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{type:`button`,variant:`ghost`,loading:t,disabled:t,onClick:m,children:t?`Fetching…`:`Fetch HybridAI Agent Email`})}):null,(0,B.jsx)(`div`,{className:`email-account-section-header`,children:(0,B.jsxs)(`div`,{className:`email-account-section-copy`,children:[(0,B.jsxs)(`h4`,{children:[`Default agent mailbox:`,(0,B.jsx)(`span`,{className:`email-default-agent-target`,children:Ml(e.agents)})]}),(0,B.jsx)(`p`,{children:`Inbound target; outbound fallback for agents without an additional mailbox.`})]})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`email.address`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Default mailbox address`}),(0,B.jsx)(Y,{...e,placeholder:`bot@example.com`})]})}),(0,B.jsx)(zl,{label:`Default mailbox password`,secretName:`EMAIL_PASSWORD`,secretLabel:`password`,configValue:e.draft.email.password,configured:e.passwordConfigured,source:e.passwordSource,token:e.token,onSecretSaved:e.onSecretSaved})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`email.imapHost`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`IMAP host`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)($,{name:`email.smtpHost`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`SMTP host`}),(0,B.jsx)(Y,{...e})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`email.imapPort`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`IMAP port`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`email.smtpPort`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`SMTP port`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`email.imapSecure`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`IMAP secure`})})]})}),(0,B.jsx)($,{name:`email.smtpSecure`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`SMTP secure`})})]})})]}),(0,B.jsx)($,{name:`email.folders`,render:({field:e})=>(0,B.jsx)(Sl,{label:`Folders`,value:e.value,rows:3,placeholder:`INBOX, Support`,onChange:e.onChange})}),(0,B.jsx)($,{name:`email.allowFrom`,render:({field:e})=>(0,B.jsx)(El,{label:`Allowed senders`,value:e.value,placeholder:`name@example.com, *@example.com`,onChange:e.onChange,onAdd:p})}),(0,B.jsxs)(`details`,{className:`channel-advanced-settings`,children:[(0,B.jsx)(`summary`,{children:`Advanced settings`}),(0,B.jsxs)(`div`,{className:`channel-advanced-settings-body`,children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`email.pollIntervalMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Poll interval ms`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`email.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)($,{name:`email.mediaMaxMb`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Media max MB`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)(Rl,{kind:`email`})]})]}),(0,B.jsxs)(`div`,{className:`email-account-section`,children:[(0,B.jsxs)(`div`,{className:`email-account-section-header`,children:[(0,B.jsx)(`h4`,{children:`Additional agent mailboxes`}),(0,B.jsx)(Z,{type:`button`,variant:`ghost`,onClick:d,children:`Add additional mailbox`})]}),o.length===0?(0,B.jsx)(`div`,{className:`empty-state email-account-empty`,children:`No additional agent mailboxes configured.`}):(0,B.jsx)(`div`,{className:`email-account-list`,children:o.map((t,n)=>{let i=s[n]||`${t.agentId}:${t.address}:${t.imapHost}:${t.smtpHost}`,a=e.agents.some(e=>e.id===t.agentId),o=Il(t,e.agents),c=r===n;return(0,B.jsxs)(`div`,{className:`email-account-row`,children:[(0,B.jsxs)(`div`,{className:`email-account-row-header`,children:[(0,B.jsx)(`strong`,{children:t.address||`Mailbox ${n+1}`}),(0,B.jsxs)(`div`,{className:`email-account-row-actions`,children:[e.hybridaiApiKeyConfigured?(0,B.jsx)(Z,{type:`button`,variant:`ghost`,loading:c,disabled:r!==null||!o,title:o?`Fetch HybridAI mailbox for ${o}`:`Select an agent before fetching a HybridAI mailbox`,onClick:()=>h(n),children:`Fetch HybridAI mailbox`}):null,(0,B.jsx)(Z,{"aria-label":`Remove mailbox ${n+1}`,title:`Remove mailbox ${n+1}`,className:`email-account-remove`,type:`button`,variant:`ghost`,size:`icon`,onClick:()=>f(n),children:(0,B.jsx)(Fr,{width:`16`,height:`16`})})]})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Agent`}),e.agents.length>0?(0,B.jsxs)(ds,{value:t.agentId,onChange:e=>u(n,t=>({...t,agentId:e.target.value})),children:[(0,B.jsx)(Q,{value:``,children:`Select agent`}),e.agents.map(e=>(0,B.jsx)(Q,{value:e.id,children:jl(e)},e.id)),t.agentId&&!a?(0,B.jsx)(Q,{value:t.agentId,children:t.agentId}):null]}):(0,B.jsx)(Y,{value:t.agentId,placeholder:`sales`,onChange:e=>u(n,t=>({...t,agentId:e.target.value}))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Mailbox address`}),(0,B.jsx)(Y,{type:`email`,value:t.address,placeholder:`sales@example.com`,onChange:e=>u(n,t=>({...t,address:e.target.value}))})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Password SecretRef id`}),(0,B.jsx)(Y,{value:kl(t),placeholder:`SALES_EMAIL_PASSWORD`,onChange:e=>u(n,t=>Al(t,e.target.value.trim()))})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Mailbox IMAP host`}),(0,B.jsx)(Y,{value:t.imapHost,onChange:e=>u(n,t=>({...t,imapHost:e.target.value}))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Mailbox SMTP host`}),(0,B.jsx)(Y,{value:t.smtpHost,onChange:e=>u(n,t=>({...t,smtpHost:e.target.value}))})]})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Mailbox IMAP port`}),(0,B.jsx)(jc,{integer:!0,min:0,value:t.imapPort,onValueChange:e=>u(n,t=>({...t,imapPort:e}))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Mailbox SMTP port`}),(0,B.jsx)(jc,{integer:!0,min:0,value:t.smtpPort,onValueChange:e=>u(n,t=>({...t,smtpPort:e}))})]})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:t.imapSecure,onCheckedChange:e=>u(n,t=>({...t,imapSecure:e}))}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Mailbox IMAP secure`})})]}),(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:t.smtpSecure,onCheckedChange:e=>u(n,t=>({...t,smtpSecure:e}))}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Mailbox SMTP secure`})})]})]}),(0,B.jsx)(Sl,{label:`Mailbox folders`,value:t.folders,rows:2,placeholder:`INBOX, Support`,onChange:e=>u(n,t=>({...t,folders:e}))}),(0,B.jsx)(El,{label:`Mailbox allowed senders`,value:t.allowFrom,placeholder:`name@example.com, *@example.com`,onChange:e=>u(n,t=>({...t,allowFrom:e}))}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Mailbox poll interval ms`}),(0,B.jsx)(jc,{integer:!0,min:0,value:t.pollIntervalMs,onValueChange:e=>u(n,t=>({...t,pollIntervalMs:e}))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Mailbox media max MB`}),(0,B.jsx)(jc,{integer:!0,min:0,value:t.mediaMaxMb,onValueChange:e=>u(n,t=>({...t,mediaMaxMb:e}))})]})]})]},i)})})]})]})}function Kl(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`voice.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`voice.twilio.accountSid`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Twilio account SID`}),(0,B.jsx)(Y,{...e,placeholder:`AC...`})]})}),(0,B.jsx)($,{name:`voice.twilio.fromNumber`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`From number`}),(0,B.jsx)(Y,{...e,placeholder:`+14155550123`})]})})]}),(0,B.jsx)(zl,{label:`Twilio auth token`,secretName:`TWILIO_AUTH_TOKEN`,secretLabel:`token`,configValue:e.draft.voice.twilio.authToken,configured:e.authTokenConfigured,source:e.authTokenSource,token:e.token,onSecretSaved:e.onSecretSaved}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`voice.webhookPath`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Webhook path`}),(0,B.jsx)(Y,{...e,placeholder:`/voice`})]})}),(0,B.jsx)($,{name:`voice.maxConcurrentCalls`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Max concurrent calls`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`voice.relay.ttsProvider`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`TTS provider`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`default`,children:`default`}),(0,B.jsx)(Q,{value:`google`,children:`google`}),(0,B.jsx)(Q,{value:`amazon`,children:`amazon`})]})]})}),(0,B.jsx)($,{name:`voice.relay.voice`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Voice`}),(0,B.jsx)(Y,{...e,placeholder:`en-US-Journey-D`})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`voice.relay.transcriptionProvider`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Transcription provider`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`default`,children:`default`}),(0,B.jsx)(Q,{value:`deepgram`,children:`deepgram`}),(0,B.jsx)(Q,{value:`google`,children:`google`})]})]})}),(0,B.jsx)($,{name:`voice.relay.language`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Language`}),(0,B.jsx)(Y,{...e,placeholder:`en-US`})]})})]}),(0,B.jsx)($,{name:`voice.relay.interruptible`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Interruptible`})})]})}),(0,B.jsx)($,{name:`voice.relay.welcomeGreeting`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Welcome greeting`}),(0,B.jsx)(Jo,{rows:3,...e})]})}),(0,B.jsx)(Rl,{kind:`voice`}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`Voice uses Twilio ConversationRelay. Expose the configured webhook path over public HTTPS and WSS so Twilio can reach both the webhook and the relay socket.`})]})}function ql(e){let t=rl(e.draft),n=il(e.draft);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Team defaults`}),(0,B.jsx)(`strong`,{children:String(t)}),(0,B.jsx)(`small`,{children:`Per-team rules preserved`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Channel overrides`}),(0,B.jsx)(`strong`,{children:String(n)}),(0,B.jsx)(`small`,{children:`Explicit Teams channel entries`})]})]}),(0,B.jsx)($,{name:`msteams.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`msteams.appId`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`App ID`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)($,{name:`msteams.tenantId`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Tenant ID`}),(0,B.jsx)(Y,{...e})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`msteams.webhook.path`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Webhook path`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)($,{name:`msteams.webhook.port`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Webhook port`}),(0,B.jsx)(jc,{integer:!0,min:0,max:65535,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`msteams.dmPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`DM policy`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})}),(0,B.jsx)($,{name:`msteams.groupPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Group policy`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`msteams.requireMention`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Require mention`})})]})}),(0,B.jsx)($,{name:`msteams.replyStyle`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Reply style`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`thread`,children:`thread`}),(0,B.jsx)(Q,{value:`top-level`,children:`top-level`})]})]})})]}),(0,B.jsx)($,{name:`msteams.allowFrom`,render:({field:e})=>(0,B.jsx)(El,{label:`Allowed AAD object IDs`,value:e.value,placeholder:`AAD object ID or *`,onChange:e.onChange})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`msteams.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`msteams.mediaMaxMb`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Media max MB`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)(Rl,{kind:`msteams`})]})}function Jl(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`slack.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsx)(zl,{label:`Bot token`,secretName:`SLACK_BOT_TOKEN`,secretLabel:`token`,configured:e.botTokenConfigured,source:e.botTokenSource,token:e.token,onSecretSaved:e.onSecretSaved}),(0,B.jsx)(zl,{label:`App token`,secretName:`SLACK_APP_TOKEN`,secretLabel:`token`,configured:e.appTokenConfigured,source:e.appTokenSource,token:e.token,onSecretSaved:e.onSecretSaved}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`slack.dmPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`DM policy`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})}),(0,B.jsx)($,{name:`slack.groupPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Group policy`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`slack.requireMention`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Require mention`})})]})}),(0,B.jsx)($,{name:`slack.replyStyle`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Reply style`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`thread`,children:`thread`}),(0,B.jsx)(Q,{value:`top-level`,children:`top-level`})]})]})})]}),(0,B.jsx)($,{name:`slack.allowFrom`,render:({field:e})=>(0,B.jsx)(El,{label:`Allowed DM Slack user IDs`,value:e.value,placeholder:`Slack user ID or *`,onChange:e.onChange})}),(0,B.jsx)($,{name:`slack.groupAllowFrom`,render:({field:e})=>(0,B.jsx)(El,{label:`Allowed channel Slack user IDs`,value:e.value,placeholder:`Slack user ID or *`,onChange:e.onChange})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`slack.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`slack.mediaMaxMb`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Media max MB`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`Slack runs through Socket Mode. HybridClaw needs both a bot token and an app token before the gateway can connect.`}),(0,B.jsx)(Rl,{kind:`slack`})]})}function Yl(e){let t=hs(),n=Object.keys(e.draft.slackWebhook.webhooks).sort(),[r,i]=(0,R.useState)(n[0]||`default`),[a,o]=(0,R.useState)(``),[s,c]=(0,R.useState)(``),[l,u]=(0,R.useState)(``),[d,f]=(0,R.useState)(``),p=e.draft.slackWebhook.webhooks[r],m=g({mutationFn:async()=>Lt(e.token,{target:r,webhookUrl:a.trim()||void 0,defaultUsername:s,defaultIconEmoji:l,defaultIconUrl:d}),onSuccess:n=>{e.onConfigSaved(n.config),o(``),t.success(`Slack webhook target saved.`)},onError:e=>{t.error(`Save failed`,H(e))}});return(0,R.useEffect)(()=>{let t=e.draft.slackWebhook.webhooks[r];c(t?.defaultUsername||``),u(t?.defaultIconEmoji||``),f(t?.defaultIconUrl||``)},[e.draft.slackWebhook.webhooks,r]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`slackWebhook.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsxs)(`div`,{className:`field`,children:[(0,B.jsx)(`span`,{children:`Webhook targets`}),(0,B.jsx)(`div`,{className:`readonly-value`,children:n.length>0?n.join(`, `):`none`})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Target`}),(0,B.jsx)(Y,{list:`slack-webhook-targets`,value:r,onChange:e=>i(e.target.value)}),(0,B.jsx)(`datalist`,{id:`slack-webhook-targets`,children:n.map(e=>(0,B.jsx)(Q,{value:e},e))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Webhook URL`}),(0,B.jsx)(Y,{type:`password`,autoComplete:`off`,placeholder:p?`leave blank to keep current URL`:`required`,value:a,onChange:e=>o(e.target.value)})]})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Username`}),(0,B.jsx)(Y,{value:s,onChange:e=>c(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Icon emoji`}),(0,B.jsx)(Y,{value:l,onChange:e=>u(e.target.value)})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Icon URL`}),(0,B.jsx)(Y,{value:d,onChange:e=>f(e.target.value)})]}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(`button`,{className:`secondary-button`,type:`button`,disabled:m.isPending,onClick:()=>m.mutate(),children:m.isPending?`Saving...`:`Save webhook target`})}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`Webhook URLs are stored as encrypted runtime secrets and are never shown after save.`}),(0,B.jsx)(Rl,{kind:`slack_webhook`})]})}function Xl(e){let t=hs(),n=Object.keys(e.draft.discordWebhook.webhooks).sort(),[r,i]=(0,R.useState)(n[0]||`default`),[a,o]=(0,R.useState)(``),[s,c]=(0,R.useState)(``),[l,u]=(0,R.useState)(``),d=e.draft.discordWebhook.webhooks[r],f=g({mutationFn:async()=>Rt(e.token,{target:r,webhookUrl:a.trim()||void 0,defaultUsername:s,defaultAvatarUrl:l}),onSuccess:n=>{e.onConfigSaved(n.config),o(``),t.success(`Discord webhook target saved.`)},onError:e=>{t.error(`Save failed`,H(e))}});return(0,R.useEffect)(()=>{let t=e.draft.discordWebhook.webhooks[r];c(t?.defaultUsername||``),u(t?.defaultAvatarUrl||``)},[e.draft.discordWebhook.webhooks,r]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`discordWebhook.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsxs)(`div`,{className:`field`,children:[(0,B.jsx)(`span`,{children:`Webhook targets`}),(0,B.jsx)(`div`,{className:`readonly-value`,children:n.length>0?n.join(`, `):`none`})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Target`}),(0,B.jsx)(Y,{list:`discord-webhook-targets`,value:r,onChange:e=>i(e.target.value)}),(0,B.jsx)(`datalist`,{id:`discord-webhook-targets`,children:n.map(e=>(0,B.jsx)(Q,{value:e},e))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Webhook URL`}),(0,B.jsx)(Y,{type:`password`,autoComplete:`off`,placeholder:d?`leave blank to keep current URL`:`required`,value:a,onChange:e=>o(e.target.value)})]})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Username`}),(0,B.jsx)(Y,{value:s,onChange:e=>c(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Avatar URL`}),(0,B.jsx)(Y,{value:l,onChange:e=>u(e.target.value)})]})]}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(`button`,{className:`secondary-button`,type:`button`,disabled:f.isPending,onClick:()=>f.mutate(),children:f.isPending?`Saving...`:`Save webhook target`})}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`Webhook URLs are stored as encrypted runtime secrets and are never shown after save.`}),(0,B.jsx)(Rl,{kind:`discord_webhook`})]})}function Zl(e){let t=e.draft.imessage.backend===`bluebubbles`;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`imessage.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsx)($,{name:`imessage.backend`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Backend`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`local`,children:`local`}),(0,B.jsx)(Q,{value:`bluebubbles`,children:`remote`})]})]})}),t?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`imessage.serverUrl`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Server URL`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)(zl,{label:`Password`,secretName:`IMESSAGE_PASSWORD`,secretLabel:`password`,configValue:e.draft.imessage.password,configured:e.passwordConfigured,source:e.passwordSource,token:e.token,onSecretSaved:e.onSecretSaved})]}),(0,B.jsx)($,{name:`imessage.webhookPath`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Webhook path`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)($,{name:`imessage.allowPrivateNetwork`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Allow private network`})})]})})]}):(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`imessage.cliPath`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`CLI path`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)($,{name:`imessage.dbPath`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Database path`}),(0,B.jsx)(Y,{...e})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`imessage.dmPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`DM policy`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})}),(0,B.jsx)($,{name:`imessage.groupPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Group policy`}),(0,B.jsxs)(ds,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),(0,B.jsx)($,{name:`imessage.allowFrom`,render:({field:e})=>(0,B.jsx)(El,{label:`Allowed DM senders`,value:e.value,placeholder:`phone, email, or chat:id`,onChange:e.onChange})}),(0,B.jsx)($,{name:`imessage.groupAllowFrom`,render:({field:e})=>(0,B.jsx)(El,{label:`Allowed group senders`,value:e.value,placeholder:`phone, email, or chat:id`,onChange:e.onChange})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`imessage.pollIntervalMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:t?`Webhook / poll interval ms`:`Poll interval ms`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`imessage.debounceMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Debounce ms`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`imessage.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`imessage.mediaMaxMb`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Media max MB`}),(0,B.jsx)(jc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)(Rl,{kind:`imessage`})]})}function Ql(e,t,n,r,i,a,o,s,c,l,u,d){switch(e){case`discord`:return(0,B.jsx)(Bl,{draft:t,form:n,tokenConfigured:i.discord.configured,tokenSource:i.discord.source,token:r,onSecretSaved:d});case`whatsapp`:return(0,B.jsx)(Vl,{draft:t,form:n,linked:o.linked,pairingQrText:o.pairingQrText,pairingError:o.pairingError});case`slack`:return(0,B.jsx)(Jl,{draft:t,form:n,botTokenConfigured:i.slack.botConfigured,botTokenSource:i.slack.botSource,appTokenConfigured:i.slack.appConfigured,appTokenSource:i.slack.appSource,token:r,onSecretSaved:d});case`slack_webhook`:return(0,B.jsx)(Yl,{draft:t,onConfigSaved:l,token:r,form:n});case`discord_webhook`:return(0,B.jsx)(Xl,{draft:t,onConfigSaved:l,token:r,form:n});case`telegram`:return(0,B.jsx)(Hl,{draft:t,form:n,tokenConfigured:i.telegram.configured,tokenSource:i.telegram.source,token:r,onSecretSaved:d});case`signal`:return(0,B.jsx)(Wl,{draft:t,form:n,token:r,cliAvailable:s.cliAvailable,cliVersion:s.cliVersion,cliError:s.cliError});case`threema`:return(0,B.jsx)(Ul,{draft:t,form:n,secretConfigured:i.threema.configured,secretSource:i.threema.source,token:r,onSecretSaved:d});case`voice`:return(0,B.jsx)(Kl,{draft:t,form:n,authTokenConfigured:i.voice.configured,authTokenSource:i.voice.source,token:r,onSecretSaved:d});case`email`:return(0,B.jsx)(Gl,{draft:t,form:n,passwordConfigured:i.email.configured,passwordSource:i.email.source,hybridaiApiKeyConfigured:a,agents:c,token:r,onAutoSave:u,onSecretSaved:d});case`msteams`:return(0,B.jsx)(ql,{draft:t,form:n});case`imessage`:return(0,B.jsx)(Zl,{draft:t,form:n,passwordConfigured:i.imessage.configured,passwordSource:i.imessage.source,token:r,onSecretSaved:d})}}function $l(){let e=Gn(),t=o(),n=hs(),[r,i]=(0,R.useState)(null),a=y({queryKey:[`config`,e.token],queryFn:()=>Mt(e.token)}),s=y({queryKey:[`status`,e.token],queryFn:()=>je(e.token),initialData:e.gatewayStatus,refetchInterval:3e3}),c=y({queryKey:[`admin-agents`,e.token],queryFn:()=>pt(e.token),enabled:r===`email`}),l=Dc({source:a.data?.config}),{draft:u,isDirty:d,commit:f}=l,p=Fc({mutationFn:t=>It(e.token,t),onSuccess:r=>{t.setQueryData([`config`,e.token],r),f(r.config),n.success(`Channel settings saved.`)},onError:e=>{n.error(`Save failed`,e.message)},invalidates:[[`status`,e.token],[`overview`]]}),m=u?vl(u,{discordTokenConfigured:s.data?.discord?.tokenConfigured,discordWebhookDefaultConfigured:s.data?.discordWebhook?.defaultTargetConfigured,slackBotTokenConfigured:s.data?.slack?.botTokenConfigured,slackAppTokenConfigured:s.data?.slack?.appTokenConfigured,slackWebhookDefaultConfigured:s.data?.slackWebhook?.defaultTargetConfigured,telegramTokenConfigured:s.data?.telegram?.tokenConfigured,threemaSecretConfigured:s.data?.threema?.secretConfigured,signalDaemonUrlConfigured:s.data?.signal?.daemonUrlConfigured,signalAccountConfigured:s.data?.signal?.accountConfigured,signalCliAvailable:s.data?.signal?.cliAvailable,voiceAuthTokenConfigured:s.data?.voice?.authTokenConfigured,whatsappLinked:s.data?.whatsapp?.linked,emailPasswordConfigured:s.data?.email?.passwordConfigured,imessagePasswordConfigured:s.data?.imessage?.passwordConfigured}):[];(0,R.useEffect)(()=>{let e=m[0];e&&i(t=>{let n=window.location.hash.replace(/^#/,``),r=m.find(e=>e.kind===n);return r?r.kind:t&&m.some(e=>e.kind===t)?t:e.kind})},[m]),(0,R.useEffect)(()=>{let e=window.location.hash.replace(/^#/,``);!r||r!==e||window.setTimeout(()=>{let e=document.getElementById(r);typeof e?.scrollIntoView==`function`&&e.scrollIntoView({block:`start`})},0)},[r]);let h=p.reset;if((0,R.useEffect)(()=>{d&&h()},[d,h]),a.isLoading&&!u)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading channel settings...`});if(!u)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Channel settings are unavailable.`});let g=m.find(e=>e.kind===r)??m[0]??null,_={discord:{configured:s.data?.discord?.tokenConfigured??!1,source:s.data?.discord?.tokenSource??null},slack:{botConfigured:s.data?.slack?.botTokenConfigured??!1,botSource:s.data?.slack?.botTokenSource??null,appConfigured:s.data?.slack?.appTokenConfigured??!1,appSource:s.data?.slack?.appTokenSource??null},telegram:{configured:s.data?.telegram?.tokenConfigured??!1,source:s.data?.telegram?.tokenSource??null},threema:{configured:s.data?.threema?.secretConfigured??!1,source:s.data?.threema?.secretSource??null},voice:{configured:s.data?.voice?.authTokenConfigured??!1,source:s.data?.voice?.authTokenSource??null},email:{configured:s.data?.email?.passwordConfigured??!1,source:s.data?.email?.passwordSource??null},imessage:{configured:s.data?.imessage?.passwordConfigured??!1,source:s.data?.imessage?.passwordSource??null}},v={linked:s.data?.whatsapp?.linked??!1,pairingQrText:s.data?.whatsapp?.pairingQrText??null,pairingError:s.data?.whatsapp?.pairingError??null},b={cliAvailable:s.data?.signal?.cliAvailable??!1,cliVersion:s.data?.signal?.cliVersion??null,cliError:s.data?.signal?.cliError??null},x=s.data?.hybridai?.apiKeyConfigured??!1;return(0,B.jsx)(`div`,{className:`page-stack`,children:(0,B.jsxs)(`div`,{className:`two-column-grid channels-layout`,children:[(0,B.jsx)(U,{children:(0,B.jsx)(`div`,{className:`list-stack selectable-list channel-catalog`,children:m.map(e=>(0,B.jsxs)(`button`,{className:e.kind===g?.kind?`selectable-row active channel-selectable-row`:`selectable-row channel-selectable-row`,type:`button`,onClick:()=>i(e.kind),children:[(0,B.jsxs)(`div`,{className:`channel-row-main`,children:[(0,B.jsx)(_c,{kind:e.kind}),(0,B.jsxs)(`div`,{className:`channel-row-copy`,children:[(0,B.jsx)(`strong`,{children:e.label}),(0,B.jsx)(`small`,{children:e.summary})]})]}),(0,B.jsx)(`div`,{className:`row-status-stack`,children:(0,B.jsx)(`span`,{className:`channel-status-badge channel-status-${e.statusTone}`,children:e.statusLabel})})]},e.kind))})}),(0,B.jsx)(Oc,{form:l,onSubmit:()=>p.mutate(u),children:(0,B.jsxs)(U,{id:g?.kind,variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:g?`${g.label} settings`:`Channels`})}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`stack-form`,children:[g?Ql(g.kind,u,l,e.token,_,x,v,b,c.data||[],n=>{let r={path:a.data?.path||``,config:n};t.setQueryData([`config`,e.token],r),f(n),t.invalidateQueries({queryKey:[`status`,e.token]})},e=>p.mutate(e),()=>{t.invalidateQueries({queryKey:[`status`,e.token]})}):null,(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{type:`submit`,loading:p.isPending,disabled:!d||p.isPending,children:p.isPending?`Saving...`:`Save channel settings`}),(0,B.jsx)(Z,{variant:`ghost`,type:`button`,disabled:!d||!a.data,onClick:()=>{a.data&&(p.reset(),l.discard())},children:`Reset changes`})]})]})})]})})]})})}var eu=[`fatal`,`error`,`warn`,`info`,`debug`,`trace`,`silent`];function tu(e){let{isDirty:t,title:n=`Discard unsaved changes?`,description:r=`You have unsaved edits. Leaving this page will discard them.`,keepLabel:i=`Keep editing`,discardLabel:a=`Discard and leave`}=e,o=M({shouldBlockFn:({next:e,current:n})=>t&&e.pathname!==n.pathname,enableBeforeUnload:()=>t,withResolver:!0});return{dialog:(0,B.jsx)(ri,{open:o.status===`blocked`,onOpenChange:e=>{!e&&o.status===`blocked`&&o.reset()},children:(0,B.jsxs)(ii,{role:`alertdialog`,size:`sm`,children:[(0,B.jsxs)(ai,{children:[(0,B.jsx)(oi,{children:n}),(0,B.jsx)(si,{children:r})]}),(0,B.jsxs)(ci,{children:[(0,B.jsx)(Z,{variant:`ghost`,onClick:()=>{o.status===`blocked`&&o.reset()},children:i}),(0,B.jsx)(Z,{variant:`danger`,onClick:()=>{o.status===`blocked`&&o.proceed()},children:a})]})]})})}}function nu(e,t,n){return e.includes(t)?t:n}function ru(e,t){return e.includes(t)}var iu={page:`_page_4ys0b_1`,content:`_content_4ys0b_9`,path:`_path_4ys0b_16`,statusInline:`_statusInline_4ys0b_21`,statusDot:`_statusDot_4ys0b_36`,formNote:`_formNote_4ys0b_45`,sectionDescription:`_sectionDescription_4ys0b_61`,sectionCard:`_sectionCard_4ys0b_66`,jsonField:`_jsonField_4ys0b_71`,poolStatusPending:`_poolStatusPending_4ys0b_75`,jsonEditor:`_jsonEditor_4ys0b_80`,navigationList:`_navigationList_4ys0b_85`,navigationRow:`_navigationRow_4ys0b_90`,navigationControl:`_navigationControl_4ys0b_100`,unavailable:`_unavailable_4ys0b_104`};function au(e){return JSON.stringify(e,null,2)}var ou=`main`,su=[{value:`local`,label:`Local (Playwright)`},{value:`camofox`,label:`Camoufox (anti-detection)`},{value:`managed-cloud`,label:`Managed cloud (Docker pool)`},{value:`browser-use-cloud`,label:`Browser Use cloud`},{value:`mac-cua`,label:`Mac CUA (native browser)`}],cu=/^\d+(?:\.\d+)?[kKmMgG]?$/,lu=48,uu=`(?:/(?!/).*|https?://.+)`,du=`Use a local path starting with / or an http(s) URL.`,fu=`(?:|/(?!/).*|https?://.+)`,pu=`Use a local image path starting with / or an http(s) image URL.`,mu={href:``,label:``};function hu(){return{provider:`local`,allowPrivateNetwork:!1,local:{profileDir:``,headed:!1},camofox:{profileDir:``,headed:!1},managedCloud:{endpointUrl:`http://127.0.0.1:8787`,poolTokenRef:void 0,defaultTenantId:``,pricing:{actionUsd:0}},browserUseCloud:{apiKeyRef:void 0,projectId:``,profileId:``,region:``,keepAlive:!1,pricing:{browserUsdPerMinute:0,actionUsd:0}},macCua:{browser:`chrome`,driverCommand:``,driverArgs:[],screenshotMode:`som`}}}function gu(e){try{let t=new URL(e),n=t.hostname.toLowerCase();return t.protocol===`http:`&&(n===`localhost`||n===`127.0.0.1`||n===`::1`)}catch{return!1}}function _u(e){return e.provider!==`managed-cloud`||!gu(e.managedCloud.endpointUrl)||e.managedCloud.defaultTenantId.trim()?e:{...e,managedCloud:{...e.managedCloud,defaultTenantId:ou}}}function vu(e){return _u({...hu(),...e.browser??{},local:{...hu().local,...e.browser?.local??{}},camofox:{...hu().camofox,...e.browser?.camofox??{}},managedCloud:{...hu().managedCloud,...e.browser?.managedCloud??{},pricing:{...hu().managedCloud.pricing,...e.browser?.managedCloud?.pricing??{}}},browserUseCloud:{...hu().browserUseCloud,...e.browser?.browserUseCloud??{},pricing:{...hu().browserUseCloud.pricing,...e.browser?.browserUseCloud?.pricing??{}}},macCua:{...hu().macCua,...e.browser?.macCua??{}}})}function yu(e){return Array.isArray(e.ui?.navigation)?e.ui.navigation:ya.map(e=>({...e}))}function bu(e){return e.trim()===``?`Required.`:e.length>lu?`Must be at most ${lu} characters.`:null}function xu(e){let t=e.trim();if(t===``)return`Required.`;if(t.startsWith(`/`)){if(t.startsWith(`//`))return du;try{return new URL(t,`http://127.0.0.1`),null}catch{return du}}try{let e=new URL(t);return e.protocol===`http:`||e.protocol===`https:`?null:du}catch{return du}}function Su(e){let t=(e??``).trim();if(t===``)return null;if(t.startsWith(`/`)){if(t.startsWith(`//`))return pu;try{return new URL(t,`http://127.0.0.1`),null}catch{return pu}}try{let e=new URL(t);return e.protocol===`http:`||e.protocol===`https:`?null:pu}catch{return pu}}function Cu(e,t){return e&&{...e,browser:t(vu(e))}}function wu(e,t){return e&&{...e,ui:{...e.ui??{},navigation:t(yu(e))}}}function Tu(e,t,n){e(e=>Cu(e,e=>({...e,[t]:{...e[t],...n}})))}function Eu(e,t,n){e(e=>Cu(e,e=>({...e,[t]:{...e[t],pricing:{...e[t].pricing,...n}}})))}function Du(e){return e?e.status===`online`?`list-status list-status-success`:e.status===`offline`?`list-status list-status-danger`:`list-status list-status-warning`:`list-status`}function Ou(e){return e?e.status===`online`?`status-dot status-dot-success`:e.status===`offline`?`status-dot status-dot-danger`:`status-dot status-dot-warning`:`status-dot`}function ku(e,t){return t?`checking`:e?e.status===`online`?`online - ${e.healthyNodeCount}/${e.nodeCount} nodes healthy`:`${e.status} - ${e.message}`:`not checked`}function Au({provider:e,config:t,setDraft:n}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Profile directory`}),(0,B.jsx)(Y,{value:t.profileDir,onChange:t=>Tu(n,e,{profileDir:t.target.value})})]}),(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:t.headed,onCheckedChange:t=>Tu(n,e,{headed:t})}),(0,B.jsxs)(Bo,{children:[(0,B.jsx)(J,{children:`Headed browser`}),(0,B.jsx)(Ho,{children:`Show the browser window instead of running headless.`})]})]})]})}function ju({items:e,setDraft:t}){let n=(0,R.useRef)(0),r=(0,R.useRef)([]),i=e=>{for(;r.current.length<=e;){let e=n.current;n.current+=1,r.current.push(`navigation-row-${e}`)}return r.current[e]},a=(e,n)=>{t(t=>wu(t,t=>t.map((t,r)=>r===e?{...t,...n}:t)))},o=e=>{r.current.splice(e,1),t(t=>wu(t,t=>t.filter((t,n)=>n!==e)))};return(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Navigation links`}),(0,B.jsxs)(Ho,{children:[`Local paths like `,(0,B.jsx)(`code`,{children:`/admin/channels`}),` and HTTP(S) URLs are shown in the top navigation strip. Optional image paths or URLs render as the link icon.`]}),e.length>0?(0,B.jsx)(`div`,{className:iu.navigationList,children:e.map((e,t)=>{let n=i(t);return(0,B.jsxs)(`div`,{className:iu.navigationRow,children:[(0,B.jsxs)(q,{required:!0,error:bu(e.label),className:iu.navigationControl,children:[(0,B.jsx)(Y,{"aria-label":`Navigation item ${t+1} label`,value:e.label,placeholder:`Link text`,maxLength:lu,onChange:e=>a(t,{icon:void 0,label:e.target.value})}),(0,B.jsx)(Wo,{})]}),(0,B.jsxs)(q,{required:!0,error:xu(e.href),className:iu.navigationControl,children:[(0,B.jsx)(Y,{"aria-label":`Navigation item ${t+1} href`,value:e.href,placeholder:`/admin/channels or https://hybridclaw.io`,pattern:uu,title:du,onChange:e=>a(t,{href:e.target.value,icon:void 0})}),(0,B.jsx)(Wo,{})]}),(0,B.jsxs)(q,{error:Su(e.image),className:iu.navigationControl,children:[(0,B.jsx)(Y,{"aria-label":`Navigation item ${t+1} image`,value:e.image??``,placeholder:`/icons/hybridai.png`,pattern:fu,title:pu,onChange:e=>a(t,{image:e.target.value.trim()?e.target.value:void 0})}),(0,B.jsx)(Wo,{})]}),(0,B.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Remove navigation item ${t+1}`,onClick:()=>o(t),children:(0,B.jsx)(Fr,{width:15,height:15})})]},n)})}):(0,B.jsx)(`p`,{className:`muted-copy`,children:`No navigation links configured.`}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{type:`button`,variant:`ghost`,onClick:()=>{let e=n.current;n.current+=1,r.current.push(`navigation-row-${e}`),t(e=>wu(e,e=>[...e,{...mu}]))},children:`Add link`})})]})}function Mu(){let e=Gn(),t=hs(),n=o(),[r,i]=(0,R.useState)(`form`),[a,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(null),u=y({queryKey:[`config`,e.token],queryFn:()=>Mt(e.token)}),d=Dc({source:u.data?.config}),{draft:f,setDraft:p,isDirty:m,discard:h,commit:_}=d,v=(0,R.useMemo)(()=>u.data?au(u.data.config):``,[u.data]),b=(0,R.useRef)(!1);!b.current&&v!==``&&(b.current=!0,s(v));let x=r===`json`?a!==v:m,S=Fc({mutationFn:t=>It(e.token,t),onSuccess:r=>{n.setQueryData([`config`,e.token],r),_(r.config),s(au(r.config)),l(null),t.success(`Runtime config saved.`)},onError:e=>{t.error(`Save failed`,e.message)}}),C=f?vu(f):hu(),w=u.data?.config.browser?.provider??`local`,T=C.provider!==w,E=C.managedCloud.poolTokenRef?.id??``,O=C.browserUseCloud.apiKeyRef?.id??``,k=y({queryKey:[`browser-pool-health`,e.token,C.provider,C.managedCloud.endpointUrl],queryFn:()=>Nt(e.token),enabled:!!(f&&r===`form`&&C.provider===`managed-cloud`),refetchInterval:15e3}),A=k.data,j=g({mutationFn:()=>Pt(e.token),onSuccess:e=>{e.ok?t.success(`Browser pool start requested.`,e.message):t.error(`Browser pool did not start`,e.message),e.poolTokenRefId&&Tu(p,`managedCloud`,{poolTokenRef:{source:`store`,id:e.poolTokenRefId}}),u.refetch(),k.refetch()},onError:e=>{t.error(`Browser pool start failed`,H(e))}}),M=(0,R.useCallback)(e=>{s(e);try{JSON.parse(e),l(null)}catch(e){l(H(e))}},[]),{dialog:N}=tu({isDirty:x,description:`You have unsaved edits to the runtime config. Leaving this page will discard them.`});if(u.isLoading&&!f)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading runtime config…`});if(!f||!u.data)return(0,B.jsxs)(`div`,{className:iu.unavailable,children:[(0,B.jsx)(`p`,{children:`Runtime config is unavailable.`}),(0,B.jsx)(Z,{variant:`ghost`,onClick:()=>void u.refetch(),disabled:u.isFetching,children:u.isFetching?`Retrying…`:`Retry`})]});let P=C,F=yu(f),I=e=>{let t=e===`json`?`json`:`form`;if(t!==r){if(t===`form`){try{p(JSON.parse(a)),l(null),i(`form`)}catch(e){l(H(e))}return}s(au(f)),l(null),i(`json`)}},ee=()=>{h(),u.data&&s(au(u.data.config)),l(null)},L=()=>{if(r===`json`){try{let e=JSON.parse(a);p(e),l(null),S.mutate(e)}catch(e){l(H(e))}return}S.mutate(f)},te=S.isPending||(r===`json`?!!c:!d.isValid);return(0,B.jsxs)(Oc,{form:d,className:iu.page,onSubmit:L,children:[(0,B.jsx)(Ha,{description:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:iu.path,children:u.data.path}),x?(0,B.jsxs)(`span`,{className:iu.statusInline,children:[(0,B.jsx)(`span`,{className:iu.statusDot,"aria-hidden":`true`}),`Unsaved changes`]}):(0,B.jsx)(`span`,{className:iu.statusInline,children:`Saved`})]}),actions:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(Ra,{ariaLabel:`Editor view`,value:r,onValueChange:I,size:`sm`,children:[(0,B.jsx)(za,{value:`form`,children:`Form`}),(0,B.jsx)(za,{value:`json`,children:`JSON`})]}),x?(0,B.jsx)(Z,{variant:`ghost`,onClick:ee,children:`Discard`}):null,x||S.isPending?(0,B.jsx)(Z,{type:`submit`,loading:S.isPending,disabled:te,children:S.isPending?`Saving…`:`Save changes`}):null]})}),(0,B.jsxs)(`p`,{className:iu.formNote,children:[`Form covers core runtime fields. For the full schema (channels, deployment, plugins, scheduler…) switch to `,(0,B.jsx)(`strong`,{children:`JSON`}),`.`]}),(0,B.jsx)(`div`,{className:iu.content,children:r===`json`?(0,B.jsxs)(q,{className:iu.jsonField,invalid:!!c,children:[(0,B.jsx)(J,{children:`config.json`}),(0,B.jsx)(Jo,{className:`code-editor ${iu.jsonEditor}`,spellCheck:!1,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,value:a,onChange:e=>M(e.target.value)}),(0,B.jsx)(Wo,{children:c})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(U,{className:iu.sectionCard,children:(0,B.jsxs)(Fo,{children:[(0,B.jsx)(Io,{children:`Operations`}),(0,B.jsx)(Ho,{className:iu.sectionDescription,children:`Gateway listener and log verbosity.`}),(0,B.jsxs)(Lo,{children:[(0,B.jsx)($,{name:`ops.healthHost`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Health host`}),(0,B.jsx)(Y,{...e}),(0,B.jsxs)(Ho,{children:[`Interface the gateway binds to. Use`,` `,(0,B.jsx)(`code`,{children:`127.0.0.1`}),` for loopback-only.`]})]})}),(0,B.jsx)($,{name:`ops.healthPort`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Health port`}),(0,B.jsx)(jc,{integer:!0,min:1,max:65535,value:e.value,onValueChange:e.onChange}),(0,B.jsx)(Wo,{})]})}),(0,B.jsx)($,{name:`ops.logLevel`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Log level`}),(0,B.jsx)(ds,{value:e.value,onChange:t=>{let n=t.target.value;ru(eu,n)&&e.onChange(n)},children:eu.map(e=>(0,B.jsx)(Q,{value:e,children:e},e))})]})}),(0,B.jsx)($,{name:`ops.gatewayBaseUrl`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Gateway public URL`}),(0,B.jsx)(Y,{...e}),(0,B.jsx)(Ho,{children:`Externally reachable URL used for webhooks and public callbacks.`})]})}),(0,B.jsx)($,{name:`ops.gatewayInternalBaseUrl`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Gateway internal URL`}),(0,B.jsx)(Y,{...e}),(0,B.jsx)(Ho,{children:`Local URL used by TUI, containers, and host-side gateway clients.`})]})})]})]})}),(0,B.jsx)(U,{className:iu.sectionCard,children:(0,B.jsxs)(Fo,{children:[(0,B.jsx)(Io,{children:`Navigation`}),(0,B.jsx)(Ho,{className:iu.sectionDescription,children:`Top-level links shown in the console navigation strip.`}),(0,B.jsx)(Lo,{children:(0,B.jsx)(ju,{items:F,setDraft:p})})]})}),(0,B.jsx)(U,{className:iu.sectionCard,children:(0,B.jsxs)(Fo,{children:[(0,B.jsx)(Io,{children:`Security`}),(0,B.jsx)(Ho,{className:iu.sectionDescription,children:`Sensitive-content guards applied to agent output.`}),(0,B.jsx)(Lo,{children:(0,B.jsx)($,{name:`security.confidentialRedactionEnabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsxs)(Bo,{children:[(0,B.jsx)(J,{children:`Confidential leak guard`}),(0,B.jsx)(Ho,{children:`Redact secrets and sensitive patterns before they leave the agent.`})]})]})})})]})}),(0,B.jsx)(U,{className:iu.sectionCard,children:(0,B.jsxs)(Fo,{children:[(0,B.jsx)(Io,{children:`HybridAI`}),(0,B.jsx)(Ho,{className:iu.sectionDescription,children:`HybridAI provider defaults.`}),(0,B.jsxs)(Lo,{children:[(0,B.jsx)($,{name:`hybridai.baseUrl`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Base URL`}),(0,B.jsx)(Y,{type:`url`,...e})]})}),(0,B.jsx)($,{name:`hybridai.defaultModel`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Default model`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)($,{name:`hybridai.enableRag`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsxs)(Bo,{children:[(0,B.jsx)(J,{children:`RAG default`}),(0,B.jsx)(Ho,{children:`Enable retrieval augmentation by default for new conversations.`})]})]})})]})]})}),(0,B.jsx)(U,{className:iu.sectionCard,children:(0,B.jsxs)(Fo,{children:[(0,B.jsx)(Io,{children:`Container`}),(0,B.jsx)(Ho,{className:iu.sectionDescription,children:`Sandboxed container runtime for tool execution.`}),(0,B.jsxs)(Lo,{children:[(0,B.jsx)($,{name:`container.memory`,rules:[jo(),Mo(cu,`Use a number with optional k, m, or g suffix.`)],render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Memory`}),(0,B.jsx)(Y,{...e,placeholder:`1024m`}),(0,B.jsxs)(Ho,{children:[`Docker memory limit. e.g. `,(0,B.jsx)(`code`,{children:`512m`}),`,`,` `,(0,B.jsx)(`code`,{children:`1g`}),`, `,(0,B.jsx)(`code`,{children:`2048m`}),`.`]}),(0,B.jsx)(Wo,{})]})}),(0,B.jsx)($,{name:`container.persistBashState`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsxs)(Bo,{children:[(0,B.jsx)(J,{children:`Persistent bash state`}),(0,B.jsx)(Ho,{children:`Reuse the same shell across tool calls so cwd, env, and aliases survive.`})]})]})})]})]})}),(0,B.jsx)(U,{className:iu.sectionCard,children:(0,B.jsxs)(Fo,{children:[(0,B.jsx)(Io,{children:`Browser`}),(0,B.jsx)(Ho,{className:iu.sectionDescription,children:`Browser provider used for agent web tasks.`}),(0,B.jsxs)(Lo,{children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Provider`}),(0,B.jsx)(ds,{value:P.provider,onChange:e=>p(t=>Cu(t,t=>({...t,provider:e.target.value}))),children:su.map(e=>(0,B.jsx)(Q,{value:e.value,children:e.label},e.value))})]}),(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:P.allowPrivateNetwork,onCheckedChange:e=>p(t=>Cu(t,t=>({...t,allowPrivateNetwork:e})))}),(0,B.jsxs)(Bo,{children:[(0,B.jsx)(J,{children:`Allow private network navigation`}),(0,B.jsx)(Ho,{children:`Allow the browser to navigate to private and loopback network addresses.`})]})]}),P.provider===`local`?(0,B.jsx)(Au,{provider:`local`,config:P.local,setDraft:p}):null,P.provider===`camofox`?(0,B.jsx)(Au,{provider:`camofox`,config:P.camofox,setDraft:p}):null,P.provider===`managed-cloud`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Pool status`}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsxs)(`span`,{className:Du(A),children:[(0,B.jsx)(`span`,{className:Ou(A)}),ku(A,k.isLoading)]}),(0,B.jsx)(Z,{variant:`ghost`,type:`button`,disabled:k.isFetching,onClick:()=>void k.refetch(),children:k.isFetching?`Checking...`:`Check now`}),(0,B.jsx)(Z,{variant:`ghost`,type:`button`,disabled:j.isPending,onClick:()=>j.mutate(),children:j.isPending?`Starting...`:`Start Docker pool`})]}),T?(0,B.jsxs)(Ho,{className:iu.poolStatusPending,children:[`Pending save — status above reflects the previously saved provider (`,w,`). Save changes to refresh.`]}):null]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Pool endpoint URL`}),(0,B.jsx)(Y,{type:`url`,value:P.managedCloud.endpointUrl,onChange:e=>Tu(p,`managedCloud`,{endpointUrl:e.target.value})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Pool token SecretRef id`}),(0,B.jsx)(Y,{value:E,placeholder:`MANAGED_BROWSER_POOL_TOKEN`,onChange:e=>{let t=e.target.value.trim();Tu(p,`managedCloud`,{poolTokenRef:t?{source:`store`,id:t}:void 0})}})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Default tenant id (optional)`}),(0,B.jsx)(Y,{value:P.managedCloud.defaultTenantId,placeholder:`Uses agent id when blank`,onChange:e=>Tu(p,`managedCloud`,{defaultTenantId:e.target.value})})]}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(D,{to:`/admin/approvals`,className:`ghost-button`,children:`Manage network policy`})}),(0,B.jsxs)(q,{controlId:`managed-cloud-action-usd`,children:[(0,B.jsx)(J,{children:`Action price USD`}),(0,B.jsx)(jc,{id:`managed-cloud-action-usd`,min:0,emptyValue:0,value:P.managedCloud.pricing.actionUsd,onValueChange:e=>Eu(p,`managedCloud`,{actionUsd:e})}),(0,B.jsx)(Wo,{})]})]}):null,P.provider===`browser-use-cloud`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`API key SecretRef id`}),(0,B.jsx)(Y,{value:O,onChange:e=>{let t=e.target.value.trim();Tu(p,`browserUseCloud`,{apiKeyRef:t?{source:`store`,id:t}:void 0})}})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Project id`}),(0,B.jsx)(Y,{value:P.browserUseCloud.projectId,onChange:e=>Tu(p,`browserUseCloud`,{projectId:e.target.value})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Profile id`}),(0,B.jsx)(Y,{value:P.browserUseCloud.profileId,onChange:e=>Tu(p,`browserUseCloud`,{profileId:e.target.value})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Region`}),(0,B.jsx)(Y,{value:P.browserUseCloud.region,onChange:e=>Tu(p,`browserUseCloud`,{region:e.target.value})})]}),(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:P.browserUseCloud.keepAlive,onCheckedChange:e=>Tu(p,`browserUseCloud`,{keepAlive:e})}),(0,B.jsxs)(Bo,{children:[(0,B.jsx)(J,{children:`Keep alive`}),(0,B.jsx)(Ho,{children:`Keep the cloud browser session alive between calls instead of tearing it down.`})]})]}),(0,B.jsxs)(q,{controlId:`browser-use-browser-usd`,children:[(0,B.jsx)(J,{children:`Browser price USD/min`}),(0,B.jsx)(jc,{id:`browser-use-browser-usd`,min:0,emptyValue:0,value:P.browserUseCloud.pricing.browserUsdPerMinute,onValueChange:e=>Eu(p,`browserUseCloud`,{browserUsdPerMinute:e})}),(0,B.jsx)(Wo,{})]}),(0,B.jsxs)(q,{controlId:`browser-use-action-usd`,children:[(0,B.jsx)(J,{children:`Action price USD`}),(0,B.jsx)(jc,{id:`browser-use-action-usd`,min:0,emptyValue:0,value:P.browserUseCloud.pricing.actionUsd,onValueChange:e=>Eu(p,`browserUseCloud`,{actionUsd:e})}),(0,B.jsx)(Wo,{})]})]}):null,P.provider===`mac-cua`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Native browser`}),(0,B.jsxs)(ds,{value:P.macCua.browser,onChange:e=>p(t=>Cu(t,t=>({...t,macCua:{...t.macCua,browser:e.target.value}}))),children:[(0,B.jsx)(Q,{value:`safari`,children:`safari`}),(0,B.jsx)(Q,{value:`chrome`,children:`chrome`}),(0,B.jsx)(Q,{value:`firefox`,children:`firefox`}),(0,B.jsx)(Q,{value:`brave`,children:`brave`}),(0,B.jsx)(Q,{value:`arc`,children:`arc`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Driver command`}),(0,B.jsx)(Y,{value:P.macCua.driverCommand,placeholder:`cua-driver`,onChange:e=>p(t=>Cu(t,t=>({...t,macCua:{...t.macCua,driverCommand:e.target.value}})))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Driver args`}),(0,B.jsx)(Y,{value:P.macCua.driverArgs.join(` `),placeholder:`mcp --no-daemon-relaunch`,onChange:e=>p(t=>Cu(t,t=>({...t,macCua:{...t.macCua,driverArgs:e.target.value.split(/\s+/u).map(e=>e.trim()).filter(Boolean)}})))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Screenshot mode`}),(0,B.jsxs)(ds,{value:P.macCua.screenshotMode,onChange:e=>p(t=>Cu(t,t=>({...t,macCua:{...t.macCua,screenshotMode:e.target.value}}))),children:[(0,B.jsx)(Q,{value:`som`,children:`som`}),(0,B.jsx)(Q,{value:`vision`,children:`vision`}),(0,B.jsx)(Q,{value:`ax`,children:`ax`})]})]})]}):null]})]})})]})}),N]})}var Nu=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%20role='img'%20aria-label='LM%20Studio'%3e%3cdefs%3e%3clinearGradient%20id='lmstudio-bg'%20x1='84'%20y1='37'%20x2='426'%20y2='473'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%236f7df1'/%3e%3cstop%20offset='0.53'%20stop-color='%235c3de1'/%3e%3cstop%20offset='1'%20stop-color='%234c0fcb'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20width='512'%20height='512'%20rx='108'%20fill='url(%23lmstudio-bg)'/%3e%3cg%20opacity='.72'%20fill='%23b5a9f3'%3e%3crect%20x='68'%20y='91'%20width='290'%20height='43'%20rx='21.5'/%3e%3crect%20x='156'%20y='150'%20width='290'%20height='43'%20rx='21.5'/%3e%3crect%20x='105'%20y='208'%20width='290'%20height='43'%20rx='21.5'/%3e%3crect%20x='40'%20y='269'%20width='291'%20height='43'%20rx='21.5'/%3e%3crect%20x='105'%20y='327'%20width='290'%20height='43'%20rx='21.5'/%3e%3crect%20x='245'%20y='385'%20width='214'%20height='43'%20rx='21.5'/%3e%3c/g%3e%3cg%20fill='%23f2f1ff'%20opacity='.95'%3e%3crect%20x='68'%20y='91'%20width='223'%20height='43'%20rx='21.5'/%3e%3crect%20x='156'%20y='150'%20width='223'%20height='43'%20rx='21.5'/%3e%3crect%20x='105'%20y='208'%20width='222'%20height='43'%20rx='21.5'/%3e%3crect%20x='40'%20y='269'%20width='223'%20height='43'%20rx='21.5'/%3e%3crect%20x='105'%20y='327'%20width='222'%20height='43'%20rx='21.5'/%3e%3crect%20x='245'%20y='385'%20width='146'%20height='43'%20rx='21.5'/%3e%3c/g%3e%3cg%20fill='%23fff'%20opacity='.22'%3e%3crect%20x='135'%20y='91'%20width='156'%20height='43'%20rx='21.5'/%3e%3crect%20x='224'%20y='150'%20width='155'%20height='43'%20rx='21.5'/%3e%3crect%20x='173'%20y='208'%20width='154'%20height='43'%20rx='21.5'/%3e%3crect%20x='108'%20y='269'%20width='155'%20height='43'%20rx='21.5'/%3e%3crect%20x='173'%20y='327'%20width='154'%20height='43'%20rx='21.5'/%3e%3crect%20x='312'%20y='385'%20width='79'%20height='43'%20rx='21.5'/%3e%3c/g%3e%3c/svg%3e`;function Pu(e){return(0,B.jsxs)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:`18`,height:`18`,viewBox:`0 0 100 100`,xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,...e,children:[(0,B.jsxs)(`defs`,{children:[(0,B.jsx)(`style`,{children:`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/terminal-DW6yIbMu.js","assets/rolldown-runtime-Bh1tDfsg.js","assets/query-o_Dd9s85.js","assets/terminal-CCHv1x3w.js","assets/terminal-kHJ-D0s7.css","assets/chat-BdYrPyYT.js","assets/chat-sidebar-HHXRwhq-.js","assets/router-DoNPHesn.js","assets/chat-BBTk0x5Q.css","assets/apps-zKDO-H6v.js","assets/apps-C1v9uVsi.css"])))=>i.map(i=>d[i]);
2
+ import{n as e,t}from"./rolldown-runtime-Bh1tDfsg.js";import{t as n}from"./vendor-GuSYcVD5.js";import{C as r,S as i,_ as a,a as o,b as s,c,d as l,f as u,g as d,h as f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S,v as C,x as w,y as T}from"./query-o_Dd9s85.js";import{a as E,c as D,d as O,f as k,i as A,l as j,n as M,o as N,r as P,s as F,t as I,u as ee}from"./router-DoNPHesn.js";(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 L=`hybridclaw-theme`;function te(){if(typeof window>`u`)return`system`;let e=window.localStorage.getItem(L);return e===`light`||e===`dark`||e===`system`?e:`system`}function ne(){return typeof window>`u`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function re(e,t){return e===`system`?t:e}function ie(e){if(typeof document>`u`)return;let t=document.documentElement;t.dataset.theme=e,t.style.colorScheme=e}function ae(){let e=te(),t=re(e,ne());return ie(t),{theme:e,resolved:t}}ae();var oe=class extends i{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new b({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=se(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=se(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=se(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=se(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){S.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>f(t,e))}findAll(e={}){return this.getAll().filter(t=>f(e,t))}notify(e){S.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return S.batch(()=>Promise.all(e.map(e=>e.continue().catch(a))))}};function se(e){return e.options.scope?.id}var ce=class extends i{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??v(r,t),a=this.get(i);return a||(a=new c({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){S.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>d(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>d(e,t)):t}notify(e){S.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){S.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){S.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},le=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ce,this.#t=e.mutationCache||new oe,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=w.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(T(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=l(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return S.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;S.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return S.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=S.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(a).catch(a)}invalidateQueries(e,t={}){return S.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=S.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(a)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(a)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(T(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(a).catch(a)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(a).catch(a)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return m.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(u(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{C(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(u(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{C(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=v(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===s&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},R=e(r(),1),ue=e(n(),1),de=`hybridclaw_token`,fe=`hybridclaw:auth-required`,pe=`__hybridclaw_token_bootstrapped`,me=`hybridclaw_local_auth_reload_at`,he=15e3,ge=()=>window.location.reload();function _e(e,t){let n=e.trim();return{...n?{Authorization:`Bearer ${n}`}:{},...t===void 0?{}:{"Content-Type":`application/json`}}}function ve(e){return{sessionId:e.sessionId,guildId:null,channelId:`web`,args:e.args,...e.userId?{userId:e.userId}:{},...e.username?{username:e.username}:{}}}function ye(e){ke(),!be()&&window.dispatchEvent(new CustomEvent(fe,{detail:{message:e}}))}function be(){if(!xe())return!1;let e=Date.now(),t=Number(window.sessionStorage.getItem(me)||`0`);if(Number.isFinite(t)){let n=e-t;if(n>=0&&n<he)return!1}return window.sessionStorage.setItem(me,String(e)),ge(),!0}function xe(){if(!Se(window.location.hostname))return!1;let e=window.location.pathname;return e===`/admin`||e.startsWith(`/admin/`)||e===`/chat`||e.startsWith(`/chat/`)}function Se(e){let t=e.toLowerCase();return t===`localhost`||t===`::1`||t===`[::1]`||/^127(?:\.\d{1,3}){3}$/.test(t)}async function Ce(e){let t=`${e.status} ${e.statusText}`,n=(await e.text().catch(()=>``)).trim();if(!n)return t;try{let e=JSON.parse(n);return e.error||e.text||n}catch{return n}}var we=class extends Error{status;constructor(e,t){super(e),this.name=`HttpResponseError`,this.status=t}};async function Te(e,t){let n=await Ce(e);throw e.status===401&&t?.onAuthError!==`ignore`&&ye(n),new we(n,e.status)}async function z(e,t){let n=await fetch(e,{method:t.method||`GET`,headers:{..._e(t.token,t.body),...t.extraHeaders},body:t.body===void 0?t.rawBody??void 0:JSON.stringify(t.body)});return n.ok||await Te(n,{onAuthError:t.onAuthError}),await n.json().catch(()=>({}))}function Ee(){return De([`token`,pe]),ke(),``}function De(e){let t=new URL(window.location.href),n=!1;for(let r of e)t.searchParams.has(r)&&(t.searchParams.delete(r),n=!0);n&&window.history.replaceState(window.history.state,``,`${t.pathname}${t.search}${t.hash}`)}function Oe(e){ke()}function ke(){window.sessionStorage.removeItem(de),window.localStorage.removeItem(de)}function Ae(e){return`/api/events`}function je(e){return z(`/api/status`,{token:e,onAuthError:`ignore`})}function Me(){return z(`/health`,{token:``,onAuthError:`ignore`})}function Ne(e){return z(`/api/admin/overview`,{token:e})}function Pe(e){return z(`/api/admin/tunnel`,{token:e})}function Fe(e,t){return z(`/api/admin/tunnel`,{token:e,method:`PUT`,body:t})}async function Ie(e){return(await z(`/api/admin/tunnel/reconnect`,{token:e,method:`POST`})).tunnel}async function Le(e){return(await z(`/api/admin/tunnel/stop`,{token:e,method:`POST`})).tunnel}function Re(e,t){return z(`/api/admin/statistics${typeof t==`number`&&Number.isFinite(t)?`?days=${Math.max(1,Math.floor(t))}`:``}`,{token:e})}function ze(e,t){let n=new URLSearchParams;t?.fileId&&n.set(`file`,t.fileId),t?.tailBytes&&n.set(`tailBytes`,String(t.tailBytes));let r=n.toString();return z(r?`/api/admin/logs?${r}`:`/api/admin/logs`,{token:e})}function Be(e){return z(`/api/admin/a2a/trust`,{token:e})}function Ve(e){return z(`/api/admin/fleet-topology`,{token:e})}function He(e){return z(`/api/admin/distill`,{token:e})}function Ue(e,t){return z(`/api/admin/distill/subjects`,{token:e,method:`POST`,body:t})}function We(e,t){return z(`/api/admin/distill/consent`,{token:e,method:`POST`,body:t})}function Ge(e,t){return z(`/api/admin/distill/register`,{token:e,method:`POST`,body:t})}function Ke(e,t){return z(`/api/admin/distill/runs`,{token:e,method:`POST`,body:t})}function qe(e,t,n){let r=new URLSearchParams({alias:n.alias});return n.agentId?.trim()&&r.set(`agentId`,n.agentId.trim()),n.kind?.trim()&&r.set(`kind`,n.kind.trim()),z(`/api/admin/distill/sources/upload?${r.toString()}`,{token:e,method:`POST`,rawBody:t,extraHeaders:{"Content-Type":t.type||`application/octet-stream`,"X-Hybridclaw-Filename":encodeURIComponent(t.name||`source.txt`)}})}function Je(e){let t=new URLSearchParams({alias:e.alias});return e.agentId?.trim()&&t.set(`agentId`,e.agentId.trim()),`/api/admin/distill/corpus/${encodeURIComponent(e.documentId)}?${t.toString()}`}async function Ye(e,t){let n=await fetch(Je(t),{headers:_e(e),cache:`no-store`});return n.ok||await Te(n),n.blob()}function Xe(e,t){return z(Je(t),{token:e,method:`DELETE`})}function Ze(e,t){return z(`/api/admin/fleet-topology`,{token:e,method:`POST`,body:t})}function Qe(e,t){return z(`/api/admin/fleet-topology?${new URLSearchParams({peerId:t}).toString()}`,{token:e,method:`DELETE`})}function $e(e,t){return z(`/api/admin/a2a/inbox${t?.trim()?`?${new URLSearchParams({threadId:t.trim()}).toString()}`:``}`,{token:e})}function et(e,t){return z(`/api/admin/a2a/outbox/status?${new URLSearchParams({messageId:t}).toString()}`,{token:e})}function tt(e,t){let n=new URLSearchParams({peerId:t.peerId});return t.reason?.trim()&&n.set(`reason`,t.reason.trim()),z(`/api/admin/a2a/trust?${n.toString()}`,{token:e,method:`DELETE`})}function nt(e,t){return z(`/api/admin/a2a/trust`,{token:e,method:`POST`,body:t})}function rt(e,t){return z(`/api/admin/a2a/trust?${new URLSearchParams({peerId:t,action:`delete`}).toString()}`,{token:e,method:`DELETE`})}function it(e,t){return z(`/api/admin/a2a/pairing`,{token:e,method:`POST`,body:t})}function at(e,t){return z(`/api/admin/a2a/pairing/preview`,{token:e,method:`POST`,body:t})}function ot(e,t,n){return z(`/api/admin/a2a/pairing/approve`,{token:e,method:`POST`,body:{requestId:t,...n?.trim()?{reason:n.trim()}:{}}})}function st(e,t,n){return z(`/api/admin/a2a/pairing/decline`,{token:e,method:`POST`,body:{requestId:t,...n?.trim()?{reason:n.trim()}:{}}})}function ct(e){return z(`/api/admin/config/reload`,{token:e,method:`POST`})}function lt(e,t){return z(`/api/admin/terminal`,{token:e,method:`POST`,body:t??{}})}function ut(e,t){return z(`/api/admin/terminal?${new URLSearchParams({sessionId:t}).toString()}`,{token:e,method:`DELETE`})}function dt(e,t){let n=window.location.protocol===`https:`?`wss:`:`ws:`,r=new URL(`/api/admin/terminal/stream`,`${n}//${window.location.host}`);return r.searchParams.set(`sessionId`,t),r.toString()}function ft(e){return z(`/api/agents`,{token:e})}async function pt(e){let t=await z(`/api/agents/list`,{token:e}),n=t.agents.map(e=>({...e,source:{type:`local`}})),r=(t.remotePeers??[]).flatMap(e=>e.agents.map(t=>({...t,source:{type:`remote`,peerId:e.peerId,instanceId:e.instanceId}})));return[...n,...r]}async function mt(e){return(await z(`/api/admin/agents`,{token:e})).agents}async function ht(e,t){let n=new URLSearchParams;t?.trim()&&n.set(`baseUrl`,t.trim());let r=n.toString();return(await z(`/api/admin/hybridai/bots${r?`?${r}`:``}`,{token:e})).bots}async function gt(e,t,n){return(await z(`/api/admin/agents/${encodeURIComponent(t)}`,{token:e,method:`PUT`,body:n})).agent}function _t(e){return z(`/api/admin/team-structure`,{token:e})}function vt(e,t){return z(`/api/admin/team-structure/revisions/${encodeURIComponent(String(t))}`,{token:e})}function yt(e,t){return z(`/api/admin/team-structure/revisions/${encodeURIComponent(String(t))}/restore`,{token:e,method:`POST`})}function bt(e,t){return z(`/api/admin/agents/${encodeURIComponent(t.agentId)}/files/${encodeURIComponent(t.fileName)}`,{token:e})}function xt(e,t){return z(`/api/admin/agents/${encodeURIComponent(t.agentId)}/files/${encodeURIComponent(t.fileName)}`,{token:e,method:`PUT`,body:{content:t.content}})}function St(e,t){return z(`/api/admin/agents/${encodeURIComponent(t.agentId)}/files/${encodeURIComponent(t.fileName)}/revisions/${encodeURIComponent(t.revisionId)}`,{token:e})}function Ct(e,t){return z(`/api/admin/agents/${encodeURIComponent(t.agentId)}/files/${encodeURIComponent(t.fileName)}/revisions/${encodeURIComponent(t.revisionId)}/restore`,{token:e,method:`POST`})}function wt(e){return z(`/api/admin/jobs/context`,{token:e})}function Tt(e,t){let n=new URLSearchParams;for(let e of t||[]){let t=e.trim();t&&n.append(`agentId`,t)}let r=n.toString();return z(`/api/admin/jobs/budgets${r?`?${r}`:``}`,{token:e})}async function Et(e){return(await z(`/api/admin/sessions`,{token:e})).sessions}function Dt(e){return z(`/api/admin/email`,{token:e})}function Ot(e,t){let n=new URLSearchParams({folder:t.folder});return typeof t.limit==`number`&&n.set(`limit`,String(t.limit)),typeof t.offset==`number`&&n.set(`offset`,String(t.offset)),z(`/api/admin/email/messages?${n.toString()}`,{token:e})}function kt(e,t){return z(`/api/admin/email/message?${new URLSearchParams({folder:t.folder,uid:String(t.uid)}).toString()}`,{token:e})}function At(e,t){return z(`/api/admin/email/message?${new URLSearchParams({folder:t.folder,uid:String(t.uid)}).toString()}`,{token:e,method:`DELETE`})}function jt(e,t,n){let r=new URLSearchParams({sessionId:t});return n?.onlyWithoutUserMessages&&r.set(`ifNoUserMessages`,`1`),z(`/api/admin/sessions?${r.toString()}`,{token:e,method:`DELETE`})}function Mt(e){return z(`/api/admin/channels`,{token:e})}function Nt(e){return z(`/api/admin/config`,{token:e})}function Pt(e){return z(`/api/admin/msteams/tab-status`,{token:e})}async function Ft(e){let t=await fetch(`/api/admin/msteams/tab-manifest`,{headers:_e(e)});return t.ok||await Te(t),t.blob()}function It(e){return z(`/api/admin/browser-pool/health`,{token:e})}function Lt(e){return z(`/api/admin/browser-pool/start`,{method:`POST`,token:e})}function Rt(e,t={}){let n=new URLSearchParams,r=String(t.handleId||``).trim();r&&n.set(`handleId`,r);let i=n.toString();return z(`/api/admin/email-config/fetch${i?`?${i}`:``}`,{token:e})}function zt(e,t){return z(`/api/admin/config`,{token:e,method:`PUT`,body:{config:t}})}function Bt(e,t){return z(`/api/admin/slack-webhook-targets`,{token:e,method:`PUT`,body:t})}function Vt(e,t){return z(`/api/admin/discord-webhook-targets`,{token:e,method:`PUT`,body:t})}function Ht(e,t){return z(`/api/admin/signal/link`,{token:e,method:`POST`,body:t})}function Ut(e){return z(`/api/admin/signal/link`,{token:e})}function Wt(e,t){return z(`/api/command`,{token:e,method:`POST`,body:ve({sessionId:`web-admin-secrets`,args:t})})}function Gt(e,t,n){return Wt(e,[`secret`,`set`,t,n])}function Kt(e){return z(`/api/admin/secrets`,{token:e})}function qt(e,t,n){return z(`/api/admin/secrets/${encodeURIComponent(t)}`,{token:e,method:`PUT`,body:{value:n}})}function Jt(e,t){return z(`/api/admin/secrets/${encodeURIComponent(t)}`,{token:e,method:`DELETE`})}function Yt(e){return z(`/api/admin/tokens`,{token:e})}function Xt(e,t){return z(`/api/admin/tokens`,{token:e,method:`POST`,body:t})}function Zt(e,t){return z(`/api/admin/tokens/${encodeURIComponent(t)}`,{token:e,method:`DELETE`})}function Qt(e){return z(`/api/admin/models`,{token:e})}function $t(e,t){return z(`/api/admin/models`,{token:e,method:`PUT`,body:t})}function en(e){return z(`/api/admin/scheduler`,{token:e})}function tn(e,t){return z(`/api/admin/scheduler`,{token:e,method:`PUT`,body:{job:t}})}function nn(e,t){return z(`/api/admin/scheduler?${new URLSearchParams(t.source===`task`?{source:`task`,taskId:String(t.taskId??``)}:{jobId:t.id}).toString()}`,{token:e,method:`DELETE`})}function rn(e,t){return z(`/api/admin/scheduler`,{token:e,method:`POST`,body:t})}function an(e,t){return z(`/api/admin/scheduler`,{token:e,method:`POST`,body:{action:`move`,...t}})}function on(e){return z(`/api/admin/mcp`,{token:e})}function sn(e){return z(`/api/admin/connectors`,{token:e})}function cn(e,t){return z(`/api/admin/connectors/hybridai/key`,{token:e,method:`PUT`,body:{apiKey:t}})}function ln(e,t){return z(`/api/admin/connectors/oauth/start`,{token:e,method:`POST`,body:t})}function un(e,t){return z(`/api/admin/connectors/logout`,{token:e,method:`POST`,body:{provider:t}})}function dn(e,t){return z(`/api/admin/connectors/test`,{token:e,method:`POST`,body:{provider:t}})}function fn(e,t){return z(`/api/admin/mcp`,{token:e,method:`PUT`,body:t})}function pn(e,t){return z(`/api/admin/mcp?${new URLSearchParams({name:t}).toString()}`,{token:e,method:`DELETE`})}function mn(e,t){return z(`/api/admin/mcp/oauth/start`,{token:e,method:`POST`,body:{name:t}})}function hn(e,t){return z(`/api/admin/mcp/oauth/status?${new URLSearchParams({name:t}).toString()}`,{token:e})}function gn(e,t){return z(`/api/admin/mcp/oauth/logout`,{token:e,method:`POST`,body:{name:t}})}function _n(e,t){let n=new URLSearchParams;t.query&&n.set(`query`,t.query),t.sessionId&&n.set(`sessionId`,t.sessionId),t.eventType&&n.set(`eventType`,t.eventType),t.since&&n.set(`since`,t.since),t.until&&n.set(`until`,t.until),typeof t.cursor==`number`&&t.cursor>0&&n.set(`cursor`,String(t.cursor)),typeof t.limit==`number`&&n.set(`limit`,String(t.limit));let r=n.toString();return z(r?`/api/admin/audit?${r}`:`/api/admin/audit`,{token:e})}function vn(e,t){let n=new URLSearchParams;t?.agentId&&n.set(`agentId`,t.agentId);let r=n.toString();return z(r?`/api/admin/approvals?${r}`:`/api/admin/approvals`,{token:e})}function yn(e,t){return z(`/api/interactive-escalations/resume`,{token:e,method:`POST`,body:t})}function bn(e,t){return z(`/api/admin/policy`,{token:e,method:`PUT`,body:t})}function xn(e,t){return z(`/api/admin/policy`,{token:e,method:`PUT`,body:t})}function Sn(e,t){return z(`/api/admin/policy`,{token:e,method:`PUT`,body:{agentId:t.agentId,lanHttpAccessMode:t.mode}})}function Cn(e,t){return z(`/api/admin/policy`,{token:e,method:`PUT`,body:t})}function wn(e,t){return z(`/api/admin/policy?${new URLSearchParams({agentId:t.agentId,index:String(t.index)}).toString()}`,{token:e,method:`DELETE`})}function Tn(e){return z(`/api/admin/skills`,{token:e})}function En(e,t){return z(`/api/admin/skills`,{token:e,method:`POST`,body:t})}function Dn(e,t,n){return z(n?.force?`/api/admin/skills/upload?force=true`:`/api/admin/skills/upload`,{token:e,method:`POST`,rawBody:t,extraHeaders:{"Content-Type":`application/zip`}})}function On(e,t){return z(`/api/admin/skills/unblock`,{token:e,method:`POST`,body:{name:t}})}function kn(e,t){return z(`/api/admin/skills/${encodeURIComponent(t)}/files`,{token:e})}function An(e,t){return z(`/api/admin/skills/${encodeURIComponent(t)}/invocations`,{token:e})}function jn(e,t){return z(`/api/admin/skills/${encodeURIComponent(t.skillName)}/files/content?path=${encodeURIComponent(t.path)}`,{token:e})}function Mn(e,t){return z(`/api/admin/skills/${encodeURIComponent(t.skillName)}/files/content?path=${encodeURIComponent(t.path)}`,{token:e,method:`PUT`,body:{content:t.content}})}function Nn(e){return z(`/api/admin/plugins`,{token:e})}function Pn(e){return z(`/api/admin/output-guard`,{token:e})}function Fn(e,t){return z(`/api/admin/output-guard`,{token:e,method:`PUT`,body:{profile:t}})}function In(e,t,n){return z(`/api/admin/output-guard/preview`,{token:e,method:`POST`,body:{profile:t,sample:n}})}function Ln(e){return z(`/api/skills/health`,{token:e})}function Rn(e){return z(`/api/admin/agent-scoreboard`,{token:e})}function zn(e,t){return z(`/api/admin/harness-evolution?${new URLSearchParams({targetRoot:t}).toString()}`,{token:e})}function Bn(e,t,n){return z(`/api/admin/harness-evolution?${new URLSearchParams({targetRoot:t,summaryPath:n}).toString()}`,{token:e})}function Vn(e,t,n){return z(`/api/admin/harness-evolution?${new URLSearchParams({targetRoot:t,manifestPath:n}).toString()}`,{token:e})}function Hn(e){return z(`/api/skills/amendments`,{token:e})}function Un(e,t){return z(`/api/skills/amendments/${encodeURIComponent(t)}`,{token:e})}function Wn(e,t,n=`console`){return z(`/api/skills/amendments/${encodeURIComponent(t)}/apply`,{token:e,method:`POST`,body:{reviewedBy:n}})}function Gn(e,t,n=`console`){return z(`/api/skills/amendments/${encodeURIComponent(t)}/reject`,{token:e,method:`POST`,body:{reviewedBy:n}})}function Kn(e){return z(`/api/admin/tools`,{token:e})}function qn(e,t){return z(`/api/admin/skills`,{token:e,method:`PUT`,body:t})}var B=_(),Jn=(0,R.createContext)(null);function Yn(e){let[t]=(0,R.useState)(()=>Ee()),[n,r]=(0,R.useState)({status:`checking`,token:t,gatewayStatus:null,error:null});(0,R.useEffect)(()=>{let e=!1;return(async()=>{try{let n=await Me();if(e)return;if(n.webAuthConfigured){if(!t.trim()){try{let t=await je(``);if(e)return;r({status:`ready`,token:``,gatewayStatus:t,error:null});return}catch{if(e)return}r({status:`prompt`,token:``,gatewayStatus:null,error:null});return}try{let n=await je(t);if(e)return;r({status:`ready`,token:t,gatewayStatus:n,error:null});return}catch(t){if(e)return;ke(),r({status:`prompt`,token:``,gatewayStatus:null,error:t instanceof Error?t.message:String(t)});return}}try{let n=await je(t);if(e)return;r({status:`ready`,token:t,gatewayStatus:n,error:null})}catch{if(e)return;ke(),r({status:`error`,token:``,gatewayStatus:n,error:`This admin console is localhost-only unless WEB_API_TOKEN is configured.`})}}catch(t){if(e)return;r({status:`error`,token:``,gatewayStatus:null,error:t instanceof Error?t.message:String(t)})}})(),()=>{e=!0}},[t]),(0,R.useEffect)(()=>{let e=e=>{let t=e instanceof CustomEvent&&e.detail&&typeof e.detail==`object`?e.detail:null;r({status:`prompt`,token:``,gatewayStatus:null,error:typeof t?.message==`string`?t.message:`API token required.`})};return window.addEventListener(fe,e),()=>{window.removeEventListener(fe,e)}},[]);let i=(0,R.useCallback)(async e=>{let t=e.trim();if(!t){r({status:`prompt`,token:``,gatewayStatus:null,error:`Enter a WEB_API_TOKEN to continue.`});return}r({status:`checking`,token:t,gatewayStatus:null,error:null});try{let e=await je(t);Oe(t),r({status:`ready`,token:t,gatewayStatus:e,error:null})}catch(e){ke(),r({status:`prompt`,token:``,gatewayStatus:null,error:e instanceof Error?e.message:String(e)})}},[]),a=(0,R.useCallback)(()=>{ke(),r(e=>e.gatewayStatus?.webAuthConfigured?{status:`prompt`,token:``,gatewayStatus:null,error:null}:e.gatewayStatus?{status:`ready`,token:``,gatewayStatus:e.gatewayStatus,error:null}:{status:`checking`,token:``,gatewayStatus:null,error:null})},[]),o=(0,R.useCallback)(async()=>{window.location.reload()},[]),s=(0,R.useMemo)(()=>({...n,login:i,logout:a,retry:o}),[n,i,a,o]);return(0,B.jsx)(Jn.Provider,{value:s,children:e.children})}function Xn(e){return e.status===`ready`}function Zn(){let e=(0,R.useContext)(Jn);if(!e)throw Error(`useAuth must be used inside AuthProvider.`);return e}function Qn({children:e,viewBox:t=`0 0 24 24`,fill:n=`none`,stroke:r=`currentColor`,strokeWidth:i=`2`,...a}){return(0,B.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,viewBox:t,fill:n,stroke:r,strokeWidth:i,...a,children:e})}function $n(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`path`,{d:`M12 3l7 4v10l-7 4-7-4V7l7-4z`}),(0,B.jsx)(`path`,{d:`M12 8v8`}),(0,B.jsx)(`path`,{d:`M8.5 10 12 8l3.5 2`})]})}function er(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`circle`,{cx:`9`,cy:`8`,r:`4`}),(0,B.jsx)(`circle`,{cx:`17`,cy:`9`,r:`3`}),(0,B.jsx)(`path`,{d:`M3 21v-2a6 6 0 0 1 12 0v2`}),(0,B.jsx)(`path`,{d:`M14 17.5a5 5 0 0 1 7 4.5`})]})}function tr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`rect`,{x:`3`,y:`3`,width:`7`,height:`7`,rx:`2`}),(0,B.jsx)(`rect`,{x:`14`,y:`3`,width:`7`,height:`7`,rx:`2`}),(0,B.jsx)(`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`2`}),(0,B.jsx)(`rect`,{x:`14`,y:`14`,width:`7`,height:`7`,rx:`2`})]})}function nr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`path`,{d:`M12 3 5 6v5c0 4.5 3 8.4 7 10 4-1.6 7-5.5 7-10V6l-7-3Z`}),(0,B.jsx)(`path`,{d:`m9.5 12 1.7 1.7 3.3-3.7`})]})}function rr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`path`,{d:`M9 4 7 20`}),(0,B.jsx)(`path`,{d:`M17 4 15 20`}),(0,B.jsx)(`path`,{d:`M4 9h16`}),(0,B.jsx)(`path`,{d:`M3 15h16`})]})}function ir(e){return(0,B.jsx)(Qn,{...e,children:(0,B.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`})})}function ar(e){return(0,B.jsx)(Qn,{strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:(0,B.jsx)(`path`,{d:`M4.5 12.5l5 5L19.5 6.5`})})}function or(e){return(0,B.jsx)(Qn,{strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:(0,B.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}function sr(e){return(0,B.jsx)(Qn,{strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:(0,B.jsx)(`path`,{d:`m15 18-6-6 6-6`})})}function cr(e){return(0,B.jsx)(Qn,{strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:(0,B.jsx)(`path`,{d:`m9 18 6-6-6-6`})})}function lr(e){return(0,B.jsx)(Qn,{fill:`currentColor`,stroke:`none`,...e,children:(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`5`})})}function ur(e){return(0,B.jsxs)(Qn,{strokeWidth:`1.8`,...e,children:[(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3.25`}),(0,B.jsx)(`path`,{d:`M12 2.75v2.5`}),(0,B.jsx)(`path`,{d:`M12 18.75v2.5`}),(0,B.jsx)(`path`,{d:`m4.93 4.93 1.77 1.77`}),(0,B.jsx)(`path`,{d:`m17.3 17.3 1.77 1.77`}),(0,B.jsx)(`path`,{d:`M2.75 12h2.5`}),(0,B.jsx)(`path`,{d:`M18.75 12h2.5`}),(0,B.jsx)(`path`,{d:`m4.93 19.07 1.77-1.77`}),(0,B.jsx)(`path`,{d:`m17.3 6.7 1.77-1.77`})]})}function dr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3.25`}),(0,B.jsx)(`path`,{d:`M12 2.75v2.5`}),(0,B.jsx)(`path`,{d:`M12 18.75v2.5`}),(0,B.jsx)(`path`,{d:`m4.93 4.93 1.77 1.77`}),(0,B.jsx)(`path`,{d:`m17.3 17.3 1.77 1.77`}),(0,B.jsx)(`path`,{d:`M2.75 12h2.5`}),(0,B.jsx)(`path`,{d:`M18.75 12h2.5`}),(0,B.jsx)(`path`,{d:`m4.93 19.07 1.77-1.77`}),(0,B.jsx)(`path`,{d:`m17.3 6.7 1.77-1.77`})]})}function fr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`path`,{d:`M4 13.5a8 8 0 1 1 16 0`}),(0,B.jsx)(`path`,{d:`M12 13l4-4`}),(0,B.jsx)(`path`,{d:`M12 13v.01`})]})}function pr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`path`,{d:`M4 19.5A2.5 2.5 0 0 1 6.5 17H20`}),(0,B.jsx)(`path`,{d:`M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2Z`})]})}function mr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`path`,{d:`M4 6h16v12H4z`}),(0,B.jsx)(`path`,{d:`m4 7 8 6 8-6`})]})}function hr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`path`,{d:`M15 2H6a2 2 0 0 0-2 2v12`}),(0,B.jsx)(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h11z`}),(0,B.jsx)(`path`,{d:`M15 2v4h4`}),(0,B.jsx)(`path`,{d:`M10 12h5`}),(0,B.jsx)(`path`,{d:`M10 16h5`})]})}function gr(e){return(0,B.jsxs)(Qn,{strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[(0,B.jsx)(`path`,{d:`M9 3h6`}),(0,B.jsx)(`path`,{d:`M10 3v5.2l-4.4 8.2A3 3 0 0 0 8.2 21h7.6a3 3 0 0 0 2.6-4.6L14 8.2V3`}),(0,B.jsx)(`path`,{d:`M8 14h8`}),(0,B.jsx)(`path`,{d:`M9.5 17h5`})]})}function _r(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`path`,{d:`M12 3v18`}),(0,B.jsx)(`path`,{d:`M6 7h6`}),(0,B.jsx)(`path`,{d:`M6 17h6`}),(0,B.jsx)(`path`,{d:`M12 12h6`})]})}function vr(e){return(0,B.jsxs)(Qn,{strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[(0,B.jsx)(`path`,{d:`M8 4 5 11v8`}),(0,B.jsx)(`path`,{d:`m16 4 3 7v8`}),(0,B.jsx)(`path`,{d:`M8 4h8`}),(0,B.jsx)(`path`,{d:`M9 6.5 12 12l3-5.5`}),(0,B.jsx)(`path`,{d:`M7 13h10`}),(0,B.jsx)(`path`,{d:`M6 17h12`}),(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.6`})]})}function yr(e){return(0,B.jsxs)(Qn,{viewBox:`0 0 800 880`,fill:`currentColor`,stroke:`none`,strokeWidth:`0`,...e,children:[(0,B.jsx)(`path`,{d:`M507.729828,92.190903 C542.757812,110.456673 571.424255,135.694031 595.775391,166.119827 C619.579956,195.862732 638.856934,228.219177 652.442078,263.850647 C658.479370,279.685486 662.272888,296.087799 661.244873,313.145020 C660.222595,330.108704 654.180420,344.928284 640.343445,355.720642 C627.428833,365.793610 612.935364,367.856323 597.373230,363.754395 C593.516968,362.737946 589.397949,361.895905 586.067444,359.873871 C578.530823,355.298187 571.261902,355.886414 563.224670,358.424438 C554.176697,361.281677 544.599487,361.880035 535.139954,362.708588 C503.348907,365.493256 471.935760,363.967682 441.306305,354.183746 C434.485138,352.004822 427.884583,349.166840 421.995331,344.941254 C419.271454,342.986908 417.618744,340.549011 417.634216,336.997040 C417.692871,323.504272 417.707977,310.010254 417.567596,296.518463 C417.531677,293.064697 418.864990,291.103882 421.903137,289.475525 C436.048309,281.894226 442.159882,269.402985 438.696381,255.741867 C435.398956,242.735855 422.214264,232.561279 408.365753,232.335831 C393.614441,232.095627 380.572144,241.785385 376.695343,255.865250 C373.262543,268.332550 379.366638,282.005371 391.995056,288.564514 C396.547821,290.929199 398.147736,293.803955 398.053528,298.719421 C397.823578,310.714386 397.861786,322.719879 398.084869,334.715698 C398.191528,340.450714 395.656799,344.207092 390.831329,346.768372 C373.951355,355.727936 355.739044,360.035950 336.916931,362.253662 C313.460205,365.017487 290.059021,364.294250 266.684662,361.281708 C259.407349,360.343781 252.176224,359.038208 245.221390,356.759186 C241.066254,355.397644 237.558655,355.908691 233.732346,357.664001 C223.539429,362.339905 213.099457,366.176178 201.562149,365.444641 C180.953476,364.137970 167.133926,353.166199 159.023743,334.804932 C152.313522,319.613129 152.931183,303.777405 156.128448,287.774323 C159.920319,268.795105 167.141647,251.115952 176.011139,234.097870 C194.991669,197.679611 217.903442,164.023529 247.837326,135.612793 C284.602356,100.718506 327.367798,77.135025 377.670380,68.302414 C404.830780,63.533329 431.707947,65.339912 458.279724,72.516678 C475.401306,77.141045 491.769989,83.646782 507.729828,92.190903 M470.811340,314.083008 C470.004425,323.096130 474.067200,328.937256 482.844788,330.662079 C487.729767,331.621948 492.735657,332.280182 497.706848,332.433624 C520.719727,333.143982 535.795471,326.973236 546.370361,305.011780 C555.453369,286.148468 556.519897,265.994873 553.154419,245.902328 C546.768616,207.778671 527.574890,176.891663 496.885162,153.448715 C484.902252,144.295334 471.551483,137.419052 456.489288,134.546432 C453.536621,133.983307 450.726898,134.271683 449.076050,137.233429 C447.403961,140.233276 449.269409,142.167389 451.297638,144.118927 C479.605591,171.356659 498.163116,203.667862 501.754364,243.367645 C503.720459,265.101898 501.622894,285.523987 480.042206,298.356262 C474.805237,301.470245 471.806488,306.984283 470.811340,314.083008 M329.727112,189.313919 C338.691223,172.616455 349.535278,157.346970 363.640320,144.538696 C365.809113,142.569290 367.789154,140.284348 366.029358,137.166122 C364.403717,134.285568 361.513763,133.855591 358.580414,134.623001 C352.951447,136.095657 347.315094,137.514465 341.928986,139.849701 C316.388824,150.923141 297.420502,169.350677 283.061371,192.751572 C270.537994,213.160721 261.867645,234.963089 261.049652,259.297241 C260.507629,275.420837 261.752777,291.198181 269.221588,305.964874 C276.934692,321.214478 288.591034,330.449554 306.034454,332.208008 C314.443176,333.055634 322.708710,332.456726 330.912598,331.318970 C341.340057,329.872833 346.440338,321.370148 343.830902,311.162964 C342.019531,304.077393 337.202148,299.397003 331.425964,295.481537 C324.501526,290.787750 318.864258,285.062592 316.345215,276.830078 C313.737213,268.306732 312.861694,259.494812 313.126587,250.678513 C313.771637,229.209946 319.520844,209.020950 329.727112,189.313919z`}),(0,B.jsx)(`path`,{d:`M210.441925,503.432068 C247.314560,521.655334 270.317474,551.237915 283.528076,589.123047 C289.629333,606.620056 292.365021,624.554260 290.347961,643.101990 C290.016632,646.148682 289.197571,648.751587 286.167908,649.869995 C283.190613,650.969055 281.061493,649.108337 279.156433,647.167358 C267.260620,635.047302 256.051575,622.210938 242.719162,611.580750 C234.493866,605.022583 225.924133,598.988037 215.194504,597.085693 C200.833801,594.539795 188.392563,607.695862 191.780853,621.933044 C193.693115,629.968079 197.764282,636.645081 204.262115,641.860107 C216.682327,651.828186 218.891983,658.008240 213.988632,673.136963 C210.513336,683.859680 213.396210,692.388367 220.839249,699.991882 C229.883942,709.231567 237.973907,718.883972 240.500259,732.248047 C241.883179,739.563599 247.428726,745.056335 251.031647,751.407288 C251.852844,752.854797 252.775574,754.244385 253.631058,755.672913 C255.236221,758.353577 256.426758,761.245178 254.355469,764.057312 C252.421570,766.682800 249.463562,766.379333 246.560349,765.872375 C237.975800,764.373169 229.700104,761.742432 221.880203,758.039795 C164.170914,730.714600 122.057175,688.404114 99.029068,628.335876 C90.255867,605.451233 88.103424,581.417664 94.028709,557.622742 C101.470154,527.739014 117.483910,504.193390 149.043518,495.366455 C170.327591,489.413544 190.550797,494.424347 210.441925,503.432068z`}),(0,B.jsx)(`path`,{d:`M640.615479,493.459625 C667.304382,489.860901 695.193481,504.364319 709.507935,528.717224 C722.905701,551.510681 726.558411,575.965637 722.703125,601.847168 C717.553955,636.414795 701.183960,665.708923 679.347839,692.118103 C656.996399,719.150574 630.089172,740.753845 598.253967,755.859619 C588.767761,760.360779 578.968872,764.106262 568.520752,765.842896 C565.648743,766.320251 562.780396,766.750061 560.787231,763.973999 C558.808044,761.217529 559.927429,758.526123 561.426941,756.035645 C563.488403,752.611816 565.623230,749.224304 567.887085,745.931641 C572.165955,739.708069 575.530457,733.196716 577.233276,725.682800 C579.447754,715.910645 585.968201,708.461121 592.832886,701.679077 C601.942932,692.678711 605.207275,682.939880 600.619202,670.489197 C596.713379,659.890076 599.624023,651.059448 608.571899,643.888428 C615.665344,638.203613 621.245422,631.798767 622.887512,622.429504 C626.035400,604.467957 612.231873,592.284424 595.018127,598.238892 C583.116821,602.355835 573.453125,610.135315 564.456116,618.593323 C554.869324,627.605652 545.811768,637.180359 536.499146,646.485535 C534.383179,648.599854 532.246399,651.213562 528.806763,649.913391 C525.276855,648.579041 524.961304,645.211548 524.782654,641.974182 C522.545105,601.437134 535.967896,566.400452 562.338318,536.055786 C578.995972,516.887573 599.140625,502.900116 623.956787,496.301331 C629.261719,494.890717 634.625854,493.649292 640.615479,493.459625z`}),(0,B.jsx)(`path`,{d:`M468.599182,550.247314 C464.299561,543.652771 462.516388,536.847412 464.750977,529.526917 C465.784729,526.140381 464.889954,523.844788 462.544281,521.545593 C456.240387,515.366516 450.116364,509.002441 443.755402,502.883881 C440.911163,500.148041 439.673248,497.143341 439.684113,493.166016 C439.786652,455.688446 439.806519,418.210327 439.684692,380.732910 C439.670319,376.301147 440.880646,374.021332 445.609497,374.638824 C449.879700,375.196442 455.025452,372.535126 458.237366,375.244293 C461.583588,378.066681 459.546631,383.464661 459.669006,387.634949 C460.049500,400.598785 459.686951,413.584137 459.627960,426.561188 C459.531860,447.699371 459.461884,468.837708 459.336121,489.975708 C459.324097,491.996735 460.238068,493.427795 461.539825,494.801849 C466.234283,499.757050 470.913818,504.726837 475.556030,509.730927 C477.466278,511.790070 479.497192,513.295166 482.535095,512.453491 C495.185608,508.948456 507.935699,517.325562 511.492493,527.866821 C515.294739,539.135559 511.046326,551.084900 501.021515,556.859741 C489.936981,563.245056 478.048737,560.910522 468.599182,550.247314 M496.982025,536.538208 C496.770538,533.039612 495.752441,529.997742 492.320801,528.328796 C487.451416,525.960632 482.015778,528.163513 480.079102,533.287659 C478.099823,538.524475 480.947906,543.754456 486.579681,545.224976 C491.595184,546.534546 495.767731,543.361328 496.982025,536.538208z`}),(0,B.jsx)(`path`,{d:`M356.795441,377.276306 C358.570312,373.325073 361.812286,374.631226 364.406616,374.640961 C377.276550,374.689148 376.261200,372.900696 376.261505,386.300385 C376.262329,420.964844 376.142242,455.629761 376.314972,490.293304 C376.343658,496.051331 374.859314,500.493958 370.533966,504.428375 C364.623566,509.804596 359.262390,515.779663 353.488892,521.313538 C350.824829,523.867004 349.948547,526.308105 350.811951,530.130371 C353.632477,542.616760 347.402344,554.466003 336.312744,558.686890 C324.835907,563.055115 311.826599,558.901672 305.822906,548.503418 C301.051239,540.238831 300.863159,531.586243 306.099304,523.425598 C311.989105,514.246155 320.793640,510.488220 331.432312,512.172913 C335.489044,512.815369 338.095398,511.959229 340.602783,509.030670 C343.091858,506.123474 345.522675,503.011139 348.547791,500.749390 C355.593506,495.481659 356.946106,488.662384 356.846680,480.237152 C356.443573,446.078033 356.706177,411.911072 356.795441,377.276306 M319.366730,540.885925 C322.839935,547.054688 331.732574,546.091553 334.369110,541.196594 C336.488281,537.262146 336.474487,533.435852 333.266266,530.160461 C330.271698,527.103210 326.635437,526.473572 322.763397,528.566406 C318.566284,530.834839 317.510376,534.236206 319.366730,540.885925z`}),(0,B.jsx)(`path`,{d:`M397.757507,474.000000 C397.767456,443.015961 397.770599,412.531952 397.790222,382.047913 C397.794830,374.856567 398.814270,373.908691 405.898315,374.311066 C418.147675,375.006805 418.198730,375.006805 418.198700,387.454956 C418.198669,420.770599 418.266083,454.086914 418.074982,487.401611 C417.972778,505.217773 417.412598,523.031677 417.013458,540.845520 C416.907379,545.579224 415.979919,549.960632 410.475372,551.298706 C403.426117,553.012268 398.875366,549.348022 398.656097,541.937988 C397.990967,519.463440 397.611664,496.985260 397.757507,474.000000z`}),(0,B.jsx)(`path`,{d:`M360.751953,742.683472 C369.855377,737.399231 378.604431,732.231812 387.436768,727.210754 C392.079071,724.571716 393.099060,725.095703 393.129089,730.151917 C393.225952,746.481079 393.161377,762.811157 393.234253,779.140564 C393.249176,782.487732 391.916534,784.739136 389.028870,786.463684 C375.157532,794.748108 361.371002,803.174438 347.520050,811.493286 C342.855103,814.294983 341.771393,813.685059 341.755859,808.231934 C341.708893,791.735596 341.799683,775.238708 341.697449,758.742920 C341.676544,755.373047 342.740387,753.120422 345.787476,751.470825 C350.764130,748.776489 355.560028,745.748291 360.751953,742.683472z`}),(0,B.jsx)(`path`,{d:`M332.093964,801.947632 C331.760712,805.977661 332.959869,809.695801 331.200684,812.930603 C329.162689,813.653503 328.033783,812.451416 326.800446,811.701782 C312.860718,803.229004 298.958557,794.694031 284.984558,786.278320 C282.253204,784.633362 281.025085,782.475037 281.029907,779.344238 C281.055298,762.871399 280.980652,746.398376 281.035919,729.925659 C281.051880,725.171509 282.218719,724.492859 286.357208,726.917419 C300.289673,735.079773 314.118530,743.419373 328.069000,751.550537 C331.505981,753.553772 332.097595,756.473267 332.086121,759.991394 C332.041107,773.813232 332.083099,787.635437 332.093964,801.947632z`}),(0,B.jsx)(`path`,{d:`M510.988220,736.939758 C518.181946,732.855774 525.055542,728.951355 532.303040,724.834534 C534.077637,729.453430 533.824402,733.483521 533.840332,737.327759 C533.898804,751.442505 533.563293,765.558472 533.452698,779.674561 C533.431580,782.369751 532.768982,784.459229 530.290649,785.950684 C515.610229,794.786133 500.976410,803.699219 486.330658,812.592346 C485.462372,813.119568 484.611511,813.630737 483.538574,813.190186 C482.480682,812.616028 482.462708,811.586121 482.465576,810.590271 C482.514679,793.450134 482.679840,776.309204 482.555359,759.170349 C482.527588,755.348999 483.802521,753.029785 487.089142,751.158264 C495.036560,746.632812 502.819031,741.817627 510.988220,736.939758z`}),(0,B.jsx)(`path`,{d:`M462.988831,809.092651 C450.594604,801.522034 438.564270,794.058777 426.406189,786.809814 C423.033508,784.798950 421.524933,782.387817 421.570007,778.363953 C421.749023,762.372559 421.628937,746.377991 421.662231,730.384644 C421.665588,728.776306 421.216278,727.029419 422.706512,725.421326 C426.142639,725.317139 428.693085,727.741577 431.440002,729.350708 C443.796448,736.588623 455.969757,744.139587 468.339905,751.353455 C471.329254,753.096680 472.447418,755.132324 472.450867,758.535339 C472.467255,774.686218 472.713593,790.836792 472.852478,806.987732 C472.869385,808.955505 473.408234,811.332886 471.643188,812.614197 C469.608276,814.091431 468.016998,811.878967 466.311554,811.064453 C465.264130,810.564331 464.303833,809.881714 462.988831,809.092651z`}),(0,B.jsx)(`path`,{d:`M334.049652,472.364777 C329.851746,485.123169 319.751007,492.206665 307.625488,491.249023 C296.145966,490.342407 287.243134,481.918701 285.131378,469.965515 C283.584503,461.209595 288.805450,450.791870 297.853424,445.880554 C301.209595,444.058777 302.159424,441.887573 302.135468,438.374908 C302.010559,420.073547 302.020477,401.771027 302.043915,383.468994 C302.054291,375.385590 302.498322,375.000183 310.468628,374.890930 C322.029694,374.732452 322.159515,374.735016 321.932068,386.275970 C321.565033,404.901001 322.669952,423.539703 321.378479,442.153137 C321.253815,443.949432 321.665100,445.332520 323.276001,446.411011 C332.435516,452.543060 335.539978,461.295593 334.049652,472.364777 M301.286713,468.201569 C301.926910,471.882355 303.459656,474.829193 307.487854,475.707001 C312.580322,476.816681 317.530975,473.739471 318.528381,468.851685 C319.463409,464.269745 315.974487,459.568787 311.069092,458.801056 C305.804382,457.977020 302.192810,461.147827 301.286713,468.201569z`}),(0,B.jsx)(`path`,{d:`M402.333496,659.057800 C402.332642,675.136841 402.332642,690.726379 402.332642,705.881348 C399.778137,707.423340 398.410583,706.140991 397.041565,705.347717 C383.367462,697.424133 369.746063,689.409241 356.041962,681.538269 C352.951447,679.763184 351.633270,677.467224 351.671326,673.870972 C351.840515,657.896790 351.783417,641.920349 351.886963,625.945251 C351.916473,621.395630 352.969971,620.721191 356.851105,622.948120 C371.131256,631.141846 385.334198,639.470032 399.580200,647.723511 C404.234619,650.420044 401.673492,654.889648 402.333496,659.057800z`}),(0,B.jsx)(`path`,{d:`M429.495911,639.469910 C440.424438,633.205566 451.039642,627.129272 461.337219,621.234802 C463.939026,623.247498 463.296173,625.226074 463.301849,626.944702 C463.353546,642.591858 463.294312,658.239319 463.358154,673.886414 C463.370422,676.894836 462.928711,679.292053 459.952606,680.990112 C445.789825,689.070984 431.719910,697.314636 417.616730,705.499939 C416.476288,706.161865 415.356293,706.897827 413.973480,706.661255 C412.098877,705.236328 412.683075,703.254761 412.679016,701.529236 C412.642059,685.715454 412.765411,669.900696 412.627319,654.088074 C412.595612,650.458801 413.762421,648.235840 417.062408,646.611572 C421.233002,644.558838 425.153961,641.999084 429.495911,639.469910z`}),(0,B.jsx)(`path`,{d:`M376.128784,623.927246 C370.444305,620.567993 365.071198,617.399170 360.017731,614.418884 C360.361847,612.379517 361.224030,611.862549 362.099670,611.362976 C375.693115,603.607910 389.289429,595.857849 402.879791,588.097290 C405.850555,586.400940 408.783264,586.144592 411.868347,587.905029 C425.316833,595.579468 438.797577,603.197327 452.254578,610.856812 C453.384918,611.500183 454.665497,612.089172 454.776520,613.716125 C454.316376,615.348572 452.802216,615.852478 451.535400,616.583313 C438.554993,624.071289 425.504456,631.440308 412.610260,639.073486 C408.987427,641.218201 405.997528,641.120789 402.448486,639.004456 C393.870270,633.889221 385.120667,629.061340 376.128784,623.927246z`}),(0,B.jsx)(`path`,{d:`M242.299408,438.279297 C252.006012,431.762848 256.521606,423.593109 255.230011,411.674988 C254.124954,401.477997 255.108200,391.064331 254.958374,380.749542 C254.894836,376.375488 256.324188,374.182953 261.038269,374.608673 C264.174500,374.891907 267.360840,374.764954 270.517426,374.638702 C273.965332,374.500732 275.282196,376.118652 275.269684,379.441071 C275.208832,395.582062 275.260773,411.723480 275.189850,427.864380 C275.174652,431.323761 273.830261,434.303436 271.218719,436.704590 C255.913254,450.777130 240.649780,464.895386 225.328384,478.950531 C222.506638,481.539032 219.517548,483.925323 217.617462,487.362701 C217.149307,488.209595 216.453644,489.032227 215.664200,489.580261 C213.626511,490.994812 202.953079,488.164825 200.974960,485.431274 C198.439163,481.927155 199.473038,478.288910 202.061020,475.385132 C205.150391,471.918823 208.638962,468.793976 212.077835,465.656250 C222.031769,456.574066 232.047455,447.559570 242.299408,438.279297z`}),(0,B.jsx)(`path`,{d:`M570.742676,461.278748 C561.963379,453.334656 553.505554,445.564453 544.928284,437.928406 C541.193726,434.603699 539.515381,430.755615 539.582947,425.652100 C539.783386,410.507263 539.721375,395.355774 539.501526,380.210632 C539.443237,376.195526 540.513245,374.481873 544.786621,374.568481 C561.698853,374.911438 559.023621,372.368805 559.200256,388.668945 C559.321045,399.820587 559.307190,410.975037 559.205200,422.126862 C559.178650,425.035919 560.154236,427.028046 562.351257,428.991577 C578.359253,443.298340 594.240356,457.747131 610.160095,472.152710 C611.891785,473.719696 613.585938,475.318970 614.633911,477.464844 C616.886536,482.077789 615.586426,485.446991 610.811646,487.347382 C608.648010,488.208557 606.497803,489.106934 604.313538,489.912445 C602.230042,490.680786 600.327332,490.332275 598.937378,488.514526 C590.982117,478.110687 580.327515,470.503998 570.742676,461.278748z`}),(0,B.jsx)(`path`,{d:`M510.884399,726.950562 C501.595795,732.536011 492.540253,737.804871 483.671234,743.370911 C479.665771,745.884583 476.244019,745.942749 472.145966,743.440186 C459.377014,735.642700 446.422150,728.149597 433.537201,720.542114 C432.261719,719.789001 430.851013,719.196472 430.273254,717.820374 C430.332611,715.982300 431.756744,715.550171 432.850616,714.911316 C446.346527,707.030090 459.875153,699.204834 473.359283,691.303589 C476.171722,689.655579 478.815643,689.226013 481.782227,690.968445 C495.401306,698.967834 509.068542,706.885254 522.708679,714.848816 C523.705750,715.430969 524.729614,716.054199 525.050781,718.083313 C521.179993,721.707764 515.692810,723.508545 510.884399,726.950562z`}),(0,B.jsx)(`path`,{d:`M324.203491,696.145752 C333.136627,688.303589 341.200531,689.493774 350.293427,696.006470 C359.593140,702.667236 369.971863,707.818481 379.852081,713.674683 C381.518341,714.662292 383.572815,715.268738 384.283936,717.379883 C383.937531,719.392090 382.201355,719.964783 380.829590,720.776306 C368.081451,728.317749 355.281097,735.770935 342.541473,743.326660 C339.322388,745.235779 336.181396,746.163269 332.705566,744.086853 C319.129486,735.976318 305.539307,727.889282 291.976074,719.757385 C291.164337,719.270691 290.542145,718.467957 288.922760,716.973267 C300.905212,709.897705 312.395447,703.112732 324.203491,696.145752z`}),(0,B.jsx)(`path`,{d:`M512.233826,378.381226 C512.297852,398.654144 512.391785,418.463837 512.277649,438.272278 C512.256714,441.891632 513.409912,443.966949 516.724182,445.658112 C526.928101,450.864990 531.905396,460.905609 529.860474,471.209717 C527.713806,482.026276 518.785034,490.092407 507.716095,491.214630 C497.467255,492.253693 487.039459,486.051971 482.787994,476.389221 C478.463409,466.560303 480.865051,455.472931 489.336761,448.361389 C492.073517,446.063995 492.974487,443.789825 492.934479,440.295929 C492.705811,420.322388 492.810242,400.345245 492.641724,380.370697 C492.607269,376.283234 494.140503,374.551086 498.222900,374.794891 C501.375824,374.983185 504.546661,374.856812 507.708984,374.906128 C509.835632,374.939270 511.721954,375.390259 512.233826,378.381226 M508.578430,475.418884 C512.508789,473.681152 514.549866,470.555817 514.241516,466.373993 C513.978394,462.805420 511.836823,460.386047 508.280029,459.166016 C504.668549,457.927277 501.737152,458.888092 499.220062,461.432556 C496.393768,464.289673 496.455627,467.846588 497.841187,471.180756 C499.667908,475.576477 503.488800,476.386444 508.578430,475.418884z`})]})}function br(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`rect`,{x:`4`,y:`5`,width:`16`,height:`14`,rx:`2.5`}),(0,B.jsx)(`path`,{d:`M8 9h8`}),(0,B.jsx)(`path`,{d:`M8 13h5`}),(0,B.jsx)(`path`,{d:`M8 17h7`})]})}function xr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`path`,{d:`M9 18h6`}),(0,B.jsx)(`path`,{d:`M10 22h4`}),(0,B.jsx)(`path`,{d:`M12 2a7 7 0 0 0-4 12.74V16a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-1.26A7 7 0 0 0 12 2z`})]})}function Sr(e){return(0,B.jsxs)(Qn,{strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[(0,B.jsx)(`rect`,{width:`16`,height:`16`,x:`4`,y:`4`,rx:`2`}),(0,B.jsx)(`rect`,{width:`6`,height:`6`,x:`9`,y:`9`}),(0,B.jsx)(`path`,{d:`M15 2v2`}),(0,B.jsx)(`path`,{d:`M15 20v2`}),(0,B.jsx)(`path`,{d:`M2 15h2`}),(0,B.jsx)(`path`,{d:`M2 9h2`}),(0,B.jsx)(`path`,{d:`M20 15h2`}),(0,B.jsx)(`path`,{d:`M20 9h2`}),(0,B.jsx)(`path`,{d:`M9 2v2`}),(0,B.jsx)(`path`,{d:`M9 20v2`})]})}function Cr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`}),(0,B.jsx)(`polyline`,{points:`16 17 21 12 16 7`}),(0,B.jsx)(`line`,{x1:`21`,y1:`12`,x2:`9`,y2:`12`})]})}function wr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`path`,{d:`M6 3h9l3 3v15H6z`}),(0,B.jsx)(`path`,{d:`M14 3v4h4`}),(0,B.jsx)(`path`,{d:`M9 11h6`}),(0,B.jsx)(`path`,{d:`M9 15h6`}),(0,B.jsx)(`path`,{d:`M9 19h3`})]})}function Tr(e){return(0,B.jsxs)(Qn,{strokeWidth:`1.8`,...e,children:[(0,B.jsx)(`path`,{d:`M4 7h16`}),(0,B.jsx)(`path`,{d:`M4 12h16`}),(0,B.jsx)(`path`,{d:`M4 17h16`})]})}function Er(e){return(0,B.jsx)(Qn,{strokeWidth:`2.4`,strokeLinecap:`round`,...e,children:(0,B.jsx)(`path`,{d:`M5 12h14`})})}function Dr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`ellipse`,{cx:`12`,cy:`6`,rx:`6.5`,ry:`2.5`}),(0,B.jsx)(`path`,{d:`M5.5 6v6c0 1.4 2.9 2.5 6.5 2.5s6.5-1.1 6.5-2.5V6`}),(0,B.jsx)(`path`,{d:`M5.5 12v6c0 1.4 2.9 2.5 6.5 2.5s6.5-1.1 6.5-2.5v-6`})]})}function Or(e){return(0,B.jsxs)(Qn,{strokeWidth:`1.8`,...e,children:[(0,B.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,B.jsx)(`path`,{d:`M9 3v18`})]})}function kr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`path`,{d:`M9 3v6`}),(0,B.jsx)(`path`,{d:`M15 15v6`}),(0,B.jsx)(`path`,{d:`M15 3v2`}),(0,B.jsx)(`path`,{d:`M9 19v2`}),(0,B.jsx)(`path`,{d:`M8 8h2a3 3 0 1 1 0 6H8a3 3 0 1 1 0-6Z`}),(0,B.jsx)(`path`,{d:`M14 10h2a3 3 0 1 1 0 6h-2a3 3 0 1 1 0-6Z`})]})}function Ar(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`path`,{d:`M12 3 5 6v5c0 4.5 3 8.4 7 10 4-1.6 7-5.5 7-10V6l-7-3Z`}),(0,B.jsx)(`path`,{d:`M9 10h6`}),(0,B.jsx)(`path`,{d:`M9 13h4`})]})}function jr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8`}),(0,B.jsx)(`path`,{d:`M12 7v5l3 2`})]})}function Mr(e){return(0,B.jsxs)(Qn,{strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[(0,B.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,B.jsx)(`path`,{d:`m20 20-3.5-3.5`})]})}function Nr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`rect`,{x:`4`,y:`11`,width:`16`,height:`9`,rx:`2`}),(0,B.jsx)(`path`,{d:`M8 11V7a4 4 0 0 1 8 0v4`}),(0,B.jsx)(`circle`,{cx:`12`,cy:`15.5`,r:`1.2`,fill:`currentColor`,stroke:`none`})]})}function Pr(e){return(0,B.jsxs)(Qn,{strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[(0,B.jsx)(`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`}),(0,B.jsx)(`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`}),(0,B.jsx)(`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`}),(0,B.jsx)(`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`})]})}function Fr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`rect`,{x:`4`,y:`5`,width:`16`,height:`12`,rx:`2.5`}),(0,B.jsx)(`path`,{d:`M8 19h8`}),(0,B.jsx)(`path`,{d:`M9 9h6`}),(0,B.jsx)(`path`,{d:`M9 13h4`})]})}function Ir(e){return(0,B.jsxs)(Qn,{strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[(0,B.jsx)(`circle`,{cx:`18`,cy:`5`,r:`3`}),(0,B.jsx)(`circle`,{cx:`6`,cy:`12`,r:`3`}),(0,B.jsx)(`circle`,{cx:`18`,cy:`19`,r:`3`}),(0,B.jsx)(`path`,{d:`M8.6 10.6l6.8-4.2`}),(0,B.jsx)(`path`,{d:`M8.6 13.4l6.8 4.2`})]})}function Lr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`path`,{d:`M4 19V5`}),(0,B.jsx)(`path`,{d:`M4 19h16`}),(0,B.jsx)(`rect`,{x:`7`,y:`12`,width:`3`,height:`7`}),(0,B.jsx)(`rect`,{x:`12`,y:`8`,width:`3`,height:`11`}),(0,B.jsx)(`rect`,{x:`17`,y:`14`,width:`3`,height:`5`})]})}function Rr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`path`,{d:`m5 7 4 5-4 5`}),(0,B.jsx)(`path`,{d:`M13 17h6`})]})}function zr({filled:e=!1,...t}){return(0,B.jsxs)(Qn,{fill:e?`currentColor`:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,...t,children:[(0,B.jsx)(`path`,{d:`M17 14V2`}),(0,B.jsx)(`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`})]})}function Br({filled:e=!1,...t}){return(0,B.jsxs)(Qn,{fill:e?`currentColor`:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,...t,children:[(0,B.jsx)(`path`,{d:`M7 10v12`}),(0,B.jsx)(`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`})]})}function Vr(e){return(0,B.jsxs)(Qn,{...e,children:[(0,B.jsx)(`path`,{d:`m14.7 6.3 3 3`}),(0,B.jsx)(`path`,{d:`m11.5 9.5 6.2 6.2`}),(0,B.jsx)(`path`,{d:`m3 21 6.2-6.2`}),(0,B.jsx)(`path`,{d:`M7.8 16.2 5 19l-2-2 2.8-2.8`}),(0,B.jsx)(`path`,{d:`M14 4a4 4 0 0 0-4 5l-6 6 3 3 6-6a4 4 0 0 0 5-4Z`})]})}function Hr(e){return(0,B.jsxs)(Qn,{strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[(0,B.jsx)(`path`,{d:`M3 6h18`}),(0,B.jsx)(`path`,{d:`M8 6V4h8v2`}),(0,B.jsx)(`path`,{d:`M19 6l-1 14H6L5 6`}),(0,B.jsx)(`path`,{d:`M10 11v5`}),(0,B.jsx)(`path`,{d:`M14 11v5`})]})}function Ur(){let e=Zn(),[t,n]=(0,R.useState)(e.token);return(0,B.jsx)(`div`,{className:`login-shell`,children:(0,B.jsxs)(`div`,{className:`login-card`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`HybridClaw Admin`}),(0,B.jsx)(`h1`,{children:`Enter API token.`}),(0,B.jsxs)(`p`,{className:`supporting-text`,children:[`This instance has `,(0,B.jsx)(`code`,{children:`WEB_API_TOKEN`}),` enabled. Enter it once and the console will keep it in local storage, the same way`,(0,B.jsx)(`code`,{children:` /chat`}),` already does.`]}),(0,B.jsxs)(`form`,{className:`stack-form`,onSubmit:async n=>{n.preventDefault(),await e.login(t)},children:[(0,B.jsxs)(`label`,{className:`field`,children:[(0,B.jsx)(`span`,{children:`Token`}),(0,B.jsx)(`input`,{autoComplete:`off`,spellCheck:!1,type:`password`,value:t,onChange:e=>n(e.target.value),placeholder:`Paste WEB_API_TOKEN`})]}),e.error?(0,B.jsx)(`p`,{className:`error-banner`,children:e.error}):null,(0,B.jsx)(`button`,{className:`primary-button`,type:`submit`,children:e.status===`checking`?`Checking...`:`Continue`})]})]})})}function Wr(e){return e===`/chat`||e.startsWith(`/chat/`)?`HybridClaw Chat`:e===`/agents`||e.startsWith(`/agents/`)?`HybridClaw Agents`:e===`/admin`||e.startsWith(`/admin/`)?`HybridClaw Admin`:`HybridClaw`}var Gr=[{label:`Overview`,items:[{to:`/admin`,label:`Dashboard`,icon:fr},{to:`/admin/statistics`,label:`Statistics`,icon:Lr},{to:`/admin/approvals`,label:`Approvals`,icon:Ar},{to:`/admin/audit`,label:`Audit`,icon:nr},{to:`/admin/jobs`,label:`Jobs`,icon:br},{to:`/admin/harness-evolution`,label:`Harness Evolution`,icon:vr},{to:`/admin/distill`,label:`Distill`,icon:gr}]},{label:`A2A`,items:[{to:`/admin/a2a-inbox`,label:`Inbox`,icon:ir},{to:`/admin/a2a-trust`,label:`Trust`,icon:Ar}]},{label:`Runtime`,items:[{to:`/admin/terminal`,label:`Terminal`,icon:Rr},{to:`/admin/gateway`,label:`Gateway`,icon:_r},{to:`/admin/logs`,label:`Logs`,icon:wr},{to:`/admin/fleet-topology`,label:`Fleet`,icon:Pr},{to:`/admin/sessions`,label:`Sessions`,icon:Fr},{to:`/admin/channels`,label:`Channels`,icon:rr},{to:`/admin/email`,label:`Email`,icon:mr,requiresEmail:!0},{to:`/admin/models`,label:`Models`,icon:Dr},{to:`/admin/scheduler`,label:`Scheduler`,icon:jr},{to:`/admin/connectors`,label:`Connectors`,icon:kr},{to:`/admin/mcp`,label:`MCP`,icon:ur}]},{label:`Configuration`,items:[{to:`/admin/agents`,label:`Agent Files`,icon:hr},{to:`/admin/agent-scoreboard`,label:`Agents`,icon:er},{to:`/admin/skills`,label:`Skills`,icon:xr},{to:`/admin/plugins`,label:`Plugins`,icon:kr},{to:`/admin/output-guard`,label:`Output Guard`,icon:Ar},{to:`/admin/tools`,label:`Tools`,icon:Vr},{to:`/admin/secrets`,label:`Secrets`,icon:Nr},{to:`/admin/tokens`,label:`API Tokens`,icon:Nr},{to:`/admin/config`,label:`Config`,icon:dr}]}],Kr=Gr.flatMap(e=>e.items.map(({to:e,label:t})=>({to:e,label:t}))).concat([{to:`/agents`,label:`Agents`}]);function qr(e){return e.startsWith(`/admin/skills/`)?{to:`/admin/skills`,label:`Skill`}:e===`/admin/teams`?{to:`/admin/teams`,label:`App Setup`}:Kr.find(t=>t.to===e)??Kr[0]}function V(...e){return e.filter(Boolean).join(` `)}var Jr=k();function Yr(e,t,n){(0,R.useEffect)(()=>{if(!t)return;let r=e.current;if(!r||typeof r.getAnimations!=`function`){n();return}let i=r.getAnimations();if(i.length===0){n();return}let a=!1;return Promise.all(i.map(e=>e.finished)).then(()=>{a||n()},()=>{a||n()}),()=>{a=!0}},[t,e,n])}function Xr(e,t){let n=(0,R.useRef)(e);(0,R.useEffect)(()=>{n.current=e},[e]),(0,R.useEffect)(()=>{if(!t)return;function e(e){if(e.key!==`Escape`)return;let t=e.target;t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.isContentEditable||(e.stopPropagation(),n.current())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t])}function Zr({onFocus:e}){return(0,B.jsx)(`span`,{tabIndex:0,"aria-hidden":`true`,style:{position:`fixed`,outline:`none`,opacity:0,pointerEvents:`none`},onFocus:e})}var Qr=`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`;function $r(e){return Array.from(e.querySelectorAll(Qr))}function ei(e,t,n){(0,R.useEffect)(()=>{if(!t)return;let r=e.current;if(!r)return;let i=document.activeElement,a=requestAnimationFrame(()=>{(n?.current??$r(r)[0])?.focus({preventScroll:!0})});function o(e){if(e.key!==`Tab`||!r)return;let t=$r(r);if(!t.length){e.preventDefault();return}let n=t[0],i=t[t.length-1],a=document.activeElement;e.shiftKey?(a===n||!r.contains(a))&&(e.preventDefault(),i.focus({preventScroll:!0})):(a===i||!r.contains(a))&&(e.preventDefault(),n.focus({preventScroll:!0}))}return document.addEventListener(`keydown`,o),()=>{cancelAnimationFrame(a),document.removeEventListener(`keydown`,o),i?.focus({preventScroll:!0})}},[t,e,n])}var ti=new WeakMap;function ni(e){let t=(ti.get(e)??0)+1;ti.set(e,t),t===1&&(e.inert=!0)}function ri(e){let t=(ti.get(e)??1)-1;t<=0?(ti.delete(e),e.inert=!1):ti.set(e,t)}function ii(e,t){(0,R.useEffect)(()=>{if(!t)return;let n=e.current;if(!n)return;let r=[];for(let e of document.body.children)e===n||e.contains(n)||(ni(e),r.push(e));return()=>{for(let e of r)ri(e)}},[t,e])}var ai=0;function oi(e){(0,R.useEffect)(()=>{if(e){if(ai++===0){let e=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow=`hidden`,e>0&&(document.body.style.paddingRight=`${e}px`)}return()=>{--ai===0&&(document.body.style.overflow=``,document.body.style.paddingRight=``)}}},[e])}var si={backdrop:`_backdrop_18ebo_1`,dialogFadeIn:`_dialogFadeIn_18ebo_1`,viewport:`_viewport_18ebo_9`,content:`_content_18ebo_19`,dialogSlideIn:`_dialogSlideIn_18ebo_1`,sm:`_sm_18ebo_36`,lg:`_lg_18ebo_40`,header:`_header_18ebo_44`,title:`_title_18ebo_49`,description:`_description_18ebo_57`,footer:`_footer_18ebo_63`,exiting:`_exiting_18ebo_82`,dialogFadeOut:`_dialogFadeOut_18ebo_1`,dialogSlideOut:`_dialogSlideOut_18ebo_1`,overlay:`_overlay_18ebo_118`,overlayVisible:`_overlayVisible_18ebo_131`,drawer:`_drawer_18ebo_114`,left:`_left_18ebo_151`,right:`_right_18ebo_162`,top:`_top_18ebo_173`,bottom:`_bottom_18ebo_184`,drawerOpen:`_drawerOpen_18ebo_114`,srOnly:`_srOnly_18ebo_201 _srOnly_jfnet_1`},ci=(0,R.createContext)(null);function li(){let e=(0,R.useContext)(ci);if(!e)throw Error(`Dialog components must be used within <Dialog>.`);return e}function ui(e){let t=(0,R.useId)(),n=(0,R.useId)();return(0,B.jsx)(ci.Provider,{value:{open:e.open,onOpenChange:e.onOpenChange,titleId:t,descriptionId:n,isDrawer:e.isDrawer??!1},children:e.children})}function di({children:e,className:t,size:n,initialFocus:r,preventCloseOnOutsideClick:i,role:a,side:o=`right`,...s}){let c=li(),l=(0,R.useRef)(null),u=(0,R.useRef)(null),d=(0,R.useRef)(null),{open:f,onOpenChange:p,titleId:m,descriptionId:h,isDrawer:g}=c,[_,v]=(0,R.useState)(!1),y=(0,R.useRef)(f);(0,R.useEffect)(()=>{!g&&y.current&&!f&&v(!0),y.current=f},[f,g]);let b=(0,R.useCallback)(()=>v(!1),[]);Yr(u,!g&&_,b);let x=g?d:u;oi(f),ei(x,f,r),Xr(()=>p(!1),f),ii(l,f);let S=(0,R.useCallback)(()=>{Array.from(u.current?.querySelectorAll(`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)??[])[0]?.focus({preventScroll:!0})},[]),C=(0,R.useCallback)(()=>{let e=Array.from(u.current?.querySelectorAll(`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)??[]);e[e.length-1]?.focus({preventScroll:!0})},[]);if((0,R.useEffect)(()=>{},[f,m]),typeof document>`u`)return null;if(g)return(0,Jr.createPortal)((0,B.jsxs)(`div`,{ref:l,children:[(0,B.jsx)(`div`,{"data-sheet":`overlay`,className:V(si.overlay,f&&si.overlayVisible),"aria-hidden":`true`,onClick:()=>!i&&p(!1)}),(0,B.jsx)(`section`,{...s,ref:d,role:a??`dialog`,"aria-modal":f?`true`:void 0,"aria-hidden":f?void 0:!0,inert:!f,"aria-labelledby":m,"aria-describedby":h,"data-sheet":`content`,"data-side":o,"data-state":f?`open`:`closed`,className:V(si.drawer,si[o],f&&si.drawerOpen,t),children:e})]}),document.body);if(!f&&!_)return null;let w=n===`sm`?si.sm:n===`lg`?si.lg:void 0;return(0,Jr.createPortal)((0,B.jsxs)(`div`,{ref:l,children:[(0,B.jsx)(`div`,{className:V(si.backdrop,_&&si.exiting),"aria-hidden":`true`,onClick:()=>!_&&!i&&p(!1)}),(0,B.jsxs)(`div`,{className:si.viewport,children:[(0,B.jsx)(Zr,{onFocus:C}),(0,B.jsx)(`div`,{...s,ref:u,role:a??`dialog`,"aria-modal":`true`,"aria-labelledby":m,"aria-describedby":h,"data-state":_?`closed`:`open`,className:V(si.content,w,_&&si.exiting,t),children:e}),(0,B.jsx)(Zr,{onFocus:S})]})]}),document.body)}function fi(e){return(0,B.jsx)(`div`,{className:V(e.visuallyHidden?si.srOnly:si.header,e.className),children:e.children})}function pi(e){let{titleId:t}=li();return(0,B.jsx)(`h3`,{id:t,className:V(si.title,e.className),children:e.children})}function mi(e){let{descriptionId:t}=li();return(0,B.jsx)(`p`,{id:t,className:V(si.description,e.className),children:e.children})}function hi(e){return(0,B.jsx)(`div`,{className:V(si.footer,e.className),children:e.children})}function gi(e){let{onOpenChange:t}=li(),{children:n,className:r,onClick:i,...a}=e;return(0,B.jsx)(`button`,{...a,type:`button`,className:r,onClick:e=>{i?.(e),t(!1)},children:n})}var _i=new Set,vi=te(),yi=ne(),bi=null,xi=!1,Si=Ci();function Ci(){return{theme:vi,resolved:re(vi,yi)}}function wi(){Si=Ci(),ie(Si.resolved);for(let e of _i)e()}function Ti(e){yi=e.matches?`dark`:`light`,wi()}function Ei(e){e.key===`hybridclaw-theme`&&(vi=te(),wi())}function Di(){xi||typeof window>`u`||(xi=!0,vi=te(),yi=ne(),Si=Ci(),ie(Si.resolved),bi=window.matchMedia(`(prefers-color-scheme: dark)`),bi.addEventListener(`change`,Ti),window.addEventListener(`storage`,Ei))}function Oi(){return Si}function ki(e){vi=e,typeof window<`u`&&window.localStorage.setItem(L,e),wi()}function Ai(e){return Di(),_i.add(e),()=>_i.delete(e)}function ji(){return(0,R.useSyncExternalStore)(Ai,Oi,Oi)}var Mi={content:`_content_y9cp1_1`},Ni=(0,R.createContext)(null);function Pi(e){let t=(0,R.useContext)(Ni);if(!t)throw Error(`${e} must be used within <Popover>`);return t}function Fi({children:e,open:t,defaultOpen:n=!1,onOpenChange:r}){let[i,a]=(0,R.useState)(n),[o,s]=(0,R.useState)(null),[c,l]=(0,R.useState)(null),u=(0,R.useId)(),d=t!==void 0,f=d?t:i,p=(0,R.useCallback)(e=>{d||a(e),r?.(e)},[d,r]),m=(0,R.useCallback)(()=>p(!f),[f,p]),h=(0,R.useMemo)(()=>({open:f,setOpen:p,toggle:m,triggerEl:o,setTriggerEl:s,contentEl:c,setContentEl:l,contentId:u}),[f,p,m,o,c,u]);return(0,B.jsx)(Ni.Provider,{value:h,children:e})}function Ii({children:e,className:t,...n}){return(0,B.jsx)(`div`,{ref:Pi(`PopoverAnchor`).setTriggerEl,className:t,...n,children:e})}function Li({align:e=`start`,side:t=`bottom`,sideOffset:n=4,focusOnOpen:r=`first-button`,closeOnEscape:i=!0,closeOnOutsideClick:a=!0,className:o,style:s,children:c,ref:l,...u}){let d=Pi(`PopoverContent`),f=(0,R.useRef)(null),[p,m]=(0,R.useState)(null),{setContentEl:h}=d,g=(0,R.useCallback)(e=>{f.current=e,h(e),typeof l==`function`?l(e):l&&(l.current=e)},[h,l]);if((0,R.useLayoutEffect)(()=>{let r=f.current;if(!d.open||!d.triggerEl||!r)return;let i=0,a=()=>{if(!d.triggerEl||!r)return;let i=d.triggerEl.getBoundingClientRect(),a=r.getBoundingClientRect(),o=window.innerWidth,s=window.innerHeight,c=i.left;e===`end`?c=i.right-a.width:e===`center`&&(c=i.left+(i.width-a.width)/2);let l=t===`top`?i.top-a.height-n:i.bottom+n;if(c+a.width>o-8&&(c=o-a.width-8),c<8&&(c=8),t===`bottom`&&l+a.height>s-8){let e=i.top-a.height-n;e>=8&&(l=e)}t===`top`&&l<8&&(l=8),m({x:c,y:l,minWidth:i.width})},o=()=>{i||=window.requestAnimationFrame(()=>{i=0,a()})};a();let s=typeof ResizeObserver>`u`?null:new ResizeObserver(o);return s?.observe(d.triggerEl),s?.observe(r),window.addEventListener(`resize`,a),window.addEventListener(`scroll`,a,!0),()=>{i&&window.cancelAnimationFrame(i),s?.disconnect(),window.removeEventListener(`resize`,a),window.removeEventListener(`scroll`,a,!0)}},[d.open,d.triggerEl,e,t,n]),(0,R.useEffect)(()=>{let e=f.current;if(!d.open||!e||r===`none`)return;let t=window.setTimeout(()=>{r===`first-button`?e.querySelector(`button:not(:disabled)`)?.focus():r(e)},0);return()=>window.clearTimeout(t)},[d.open,r]),(0,R.useEffect)(()=>{if(!d.open||!a)return;let e=f.current,t=d.triggerEl;if(!e||!t)return;let n=n=>{let r=n.target;t.contains(r)||e.contains(r)||d.setOpen(!1)};return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[d.open,d.triggerEl,d.setOpen,a]),(0,R.useEffect)(()=>{if(!d.open||!i)return;let e=d.triggerEl,t=t=>{t.key===`Escape`&&(d.setOpen(!1),e&&`focus`in e&&e.focus())};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[d.open,d.triggerEl,d.setOpen,i]),!d.open||typeof document>`u`)return null;let _={left:p?.x??0,top:p?.y??0,minWidth:p?.minWidth,visibility:p?`visible`:`hidden`};return(0,Jr.createPortal)((0,B.jsx)(`div`,{ref:g,id:d.contentId,"data-state":`open`,className:V(Mi.content,o),style:{..._,...s},...u,children:c}),document.body)}var Ri={trigger:`_trigger_sn70v_1`,content:`_content_sn70v_17`,item:`_item_sn70v_29`};function zi({children:e,open:t,defaultOpen:n,onOpenChange:r}){return(0,B.jsx)(Fi,{open:t,defaultOpen:n,onOpenChange:r,children:e})}function Bi({children:e,className:t=``,"aria-label":n,title:r}){let i=Pi(`DropdownTrigger`);return(0,B.jsx)(`button`,{ref:i.setTriggerEl,type:`button`,className:V(Ri.trigger,t),"aria-haspopup":`menu`,"aria-expanded":i.open,"aria-controls":i.contentId,"aria-label":n,title:r,"data-state":i.open?`open`:`closed`,onClick:i.toggle,onKeyDown:e=>{(e.key===`Enter`||e.key===` `||e.key===`ArrowDown`)&&(e.preventDefault(),i.setOpen(!0))},children:e})}function Vi({children:e,className:t=``,align:n=`start`,sideOffset:r=4}){return(0,B.jsx)(Li,{role:`menu`,align:n,sideOffset:r,focusOnOpen:`first-button`,className:V(Ri.content,t),children:e})}function Hi({children:e,className:t=``,active:n=!1,onSelect:r}){let i=Pi(`DropdownItem`);return(0,B.jsx)(`button`,{type:`button`,role:`menuitem`,className:V(Ri.item,t),"data-active":n?`true`:`false`,onClick:()=>{r?.(),i.setOpen(!1)},children:e})}var Ui=()=>(0,B.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:[(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`5`}),(0,B.jsx)(`path`,{d:`M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42`})]}),Wi=()=>(0,B.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z`})}),Gi=()=>(0,B.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:[(0,B.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`,ry:`2`}),(0,B.jsx)(`path`,{d:`M8 21h8M12 17v4`})]});function Ki({theme:e}){return e===`light`?(0,B.jsx)(Ui,{}):e===`dark`?(0,B.jsx)(Wi,{}):(0,B.jsx)(Gi,{})}var qi=[{value:`light`,label:`Light`},{value:`dark`,label:`Dark`},{value:`system`,label:`System`}];function Ji(e){let{theme:t,resolved:n}=ji(),r=qi.find(e=>e.value===t)?.label??t;return(0,B.jsxs)(zi,{children:[(0,B.jsxs)(Bi,{className:`theme-toggle-trigger`,"aria-label":`Theme: ${t} (${n})`,title:`Change theme`,children:[(0,B.jsx)(Ki,{theme:t}),(0,B.jsx)(`span`,{className:e.labelClassName,children:r})]}),(0,B.jsx)(Vi,{className:`theme-toggle-menu`,align:`end`,children:qi.map(e=>(0,B.jsxs)(Hi,{className:`theme-toggle-option`,active:t===e.value,onSelect:()=>ki(e.value),children:[(0,B.jsx)(Ki,{theme:e.value}),(0,B.jsx)(`span`,{children:e.label})]},e.value))})]})}var Yi={layout:`_layout_1qte4_1`,root:`_root_1qte4_10`,header:`_header_1qte4_36`,footer:`_footer_1qte4_37`,content:`_content_1qte4_49`,inset:`_inset_1qte4_65`,trigger:`_trigger_1qte4_73`,group:`_group_1qte4_104`,groupContent:`_groupContent_1qte4_105`,eyebrow:`_eyebrow_1qte4_114`,groupLabel:`_groupLabel_1qte4_123`,menu:`_menu_1qte4_141`,menuItem:`_menuItem_1qte4_146`,menuButton:`_menuButton_1qte4_150`,menuButtonActive:`_menuButtonActive_1qte4_176`,headerRow:`_headerRow_1qte4_182`,sidebarToggle:`_sidebarToggle_1qte4_189`,brand:`_brand_1qte4_202`,brandTitle:`_brandTitle_1qte4_208`,brandText:`_brandText_1qte4_215`,brandMark:`_brandMark_1qte4_229`,menuIcon:`_menuIcon_1qte4_230`,icon:`_icon_1qte4_231`,footerMeta:`_footerMeta_1qte4_266`,footerValue:`_footerValue_1qte4_271`,footerBlock:`_footerBlock_1qte4_279`,footerDivider:`_footerDivider_1qte4_286`,footerActions:`_footerActions_1qte4_292`,footerMenu:`_footerMenu_1qte4_293`,footerAction:`_footerAction_1qte4_292`,footerButton:`_footerButton_1qte4_308`,themeToggleLabel:`_themeToggleLabel_1qte4_345`},Xi=1080,Zi=`b`,Qi=(0,R.createContext)(null);function $i(){let e=(0,R.useContext)(Qi);if(!e)throw Error(`Sidebar components must be used within SidebarProvider.`);return e}function ea(){return typeof window>`u`?!1:window.innerWidth<Xi}var ta=`hybridclaw_sidebar_state`;function na(e,t){if(!t||typeof window>`u`)return e;let n=localStorage.getItem(t);return n===`true`?!0:n===`false`?!1:e}function ra(e){let t=e.storageKey??ta,[n,r]=(0,R.useState)(()=>na(e.defaultOpen??!0,t)),i=(0,R.useCallback)(e=>{r(n=>{let r=typeof e==`function`?e(n):e;if(r===n)return n;if(t)try{localStorage.setItem(t,String(r))}catch{}return r})},[t]),[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(ea);(0,R.useEffect)(()=>{if(typeof window>`u`)return;let e=ea();function t(){let t=ea();t!==e&&(e=t,c(t),t||o(!1))}function n(e){if(e.key.toLowerCase()!==Zi||!(e.metaKey||e.ctrlKey))return;let t=e.target;t instanceof HTMLElement&&(t.isContentEditable||t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`)||(e.preventDefault(),ea()?o(e=>!e):i(e=>!e))}return t(),window.addEventListener(`resize`,t),window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`resize`,t),window.removeEventListener(`keydown`,n)}},[i]);let l=(0,R.useMemo)(()=>({state:n?`expanded`:`collapsed`,open:n,setOpen:i,openMobile:a,setOpenMobile:o,isMobile:s,toggleSidebar(){s?o(e=>!e):i(e=>!e)}}),[s,n,a,i]);return(0,B.jsx)(Qi.Provider,{value:l,children:(0,B.jsx)(`div`,{className:Yi.layout,style:e.style,children:e.children})})}function ia(){return $i()}function aa({side:e=`left`,collapsible:t=`icon`,children:n}){let r=$i();if(r.isMobile)return(0,B.jsx)(ui,{open:r.openMobile,onOpenChange:r.setOpenMobile,isDrawer:!0,children:(0,B.jsxs)(di,{side:e,"data-sidebar":`sidebar`,"data-mobile":`true`,style:{"--sheet-width":`var(--sidebar-width-mobile)`},children:[(0,B.jsxs)(fi,{visuallyHidden:!0,children:[(0,B.jsx)(pi,{children:`Navigation`}),(0,B.jsx)(mi,{children:`Sidebar navigation panel.`})]}),n]})});if(t===`none`)return(0,B.jsx)(`aside`,{className:Yi.root,"data-side":e,"data-state":`expanded`,children:n});let i=r.open?`expanded`:`collapsed`;return(0,B.jsx)(`aside`,{className:Yi.root,"data-hc-sidebar-root":``,"data-side":e,"data-state":i,children:n})}function oa(e){return(0,B.jsx)(`div`,{className:Yi.header,"data-hc-sidebar-header":``,children:e.children})}function sa(e){return(0,B.jsx)(`div`,{className:Yi.content,children:e.children})}function ca(e){return(0,B.jsx)(`div`,{className:Yi.footer,children:e.children})}function la(e){let{className:t,children:n,...r}=e;return(0,B.jsx)(`main`,{...r,className:V(Yi.inset,t),"data-hc-main-panel":``,children:n})}function ua(e){let{className:t,children:n,...r}=e,i=$i(),a=i.isMobile?i.openMobile?`Close sidebar`:`Open sidebar`:i.open?`Collapse sidebar`:`Expand sidebar`;return(0,B.jsx)(`button`,{...r,type:e.type??`button`,className:V(Yi.trigger,t),"aria-label":e[`aria-label`]??a,"aria-expanded":i.isMobile?i.openMobile:i.open,onClick:t=>{e.onClick?.(t),t.defaultPrevented||i.toggleSidebar()},children:n??(0,B.jsx)(Or,{})})}function da(e){let{isMobile:t}=$i();return t?(0,B.jsx)(ua,{className:e.className}):null}function fa(e){return(0,B.jsx)(`section`,{className:Yi.group,children:e.children})}function pa(e){return(0,B.jsx)(`p`,{className:Yi.groupLabel,children:e.children})}function ma(e){return(0,B.jsx)(`div`,{className:Yi.groupContent,children:e.children})}function ha(e){return(0,B.jsx)(`nav`,{className:Yi.menu,"aria-label":e.ariaLabel,children:e.children})}function ga(e){return(0,B.jsx)(`div`,{className:Yi.menuItem,children:e.children})}function _a(e){return(0,B.jsx)(`div`,{className:Yi.footerActions,children:e.children})}function va(e){return(0,B.jsx)(`div`,{className:Yi.footerMenu,children:e.children})}function ya(e){return(0,B.jsx)(`div`,{className:Yi.footerAction,children:e.children})}function ba(e,t=e){return{"--sidebar-width":e,"--sidebar-width-icon":`4rem`,"--sidebar-width-mobile":t}}function xa(e){return(0,B.jsxs)(aa,{collapsible:`icon`,children:[(0,B.jsx)(oa,{children:(0,B.jsxs)(`div`,{className:Yi.headerRow,children:[(0,B.jsx)(Sa,{subtitle:`Admin console`}),(0,B.jsx)(ua,{className:Yi.sidebarToggle})]})}),(0,B.jsx)(sa,{children:e.groups.map(e=>(0,B.jsxs)(fa,{children:[(0,B.jsx)(pa,{children:e.label}),(0,B.jsx)(ma,{children:(0,B.jsx)(ha,{ariaLabel:e.label,children:e.items.map(e=>(0,B.jsx)(ga,{children:(0,B.jsx)(Ca,{item:e})},e.to))})})]},e.label))}),(0,B.jsxs)(ca,{children:[(0,B.jsxs)(`div`,{className:Yi.footerBlock,children:[(0,B.jsx)(wa,{version:e.version}),(0,B.jsx)(_a,{children:(0,B.jsx)(va,{children:(0,B.jsx)(ya,{children:(0,B.jsx)(Ji,{labelClassName:Yi.themeToggleLabel})})})})]}),e.showLogout?(0,B.jsx)(Ta,{onLogout:e.onLogout}):null]})]})}function Sa(e){return(0,B.jsx)(`div`,{className:Yi.brand,children:(0,B.jsxs)(`div`,{className:Yi.brandTitle,children:[(0,B.jsx)(`span`,{className:Yi.brandMark,"aria-hidden":`true`,children:(0,B.jsx)(yr,{})}),(0,B.jsxs)(`div`,{className:Yi.brandText,children:[(0,B.jsx)(`h1`,{children:`HybridClaw`}),e.subtitle?(0,B.jsx)(`span`,{className:Yi.eyebrow,children:e.subtitle}):null]})]})})}function Ca(e){let{isMobile:t,setOpenMobile:n}=ia();return(0,B.jsxs)(D,{to:e.item.to,title:e.item.label,activeProps:{className:V(Yi.menuButton,Yi.menuButtonActive)},inactiveProps:{className:Yi.menuButton},activeOptions:{exact:!0},onClick:()=>{t&&n(!1)},children:[(0,B.jsx)(`span`,{className:Yi.menuIcon,"aria-hidden":`true`,children:(0,B.jsx)(e.item.icon,{})}),(0,B.jsx)(`span`,{children:e.item.label})]})}function wa(e){return e.version?(0,B.jsx)(`div`,{className:Yi.footerMeta,children:(0,B.jsxs)(`span`,{className:Yi.footerValue,children:[`v`,e.version]})}):null}function Ta(e){let[t,n]=(0,R.useState)(!1);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:Yi.footerDivider}),(0,B.jsx)(_a,{children:(0,B.jsx)(va,{children:(0,B.jsx)(ya,{children:(0,B.jsxs)(`button`,{className:Yi.footerButton,type:`button`,onClick:()=>n(!0),children:[(0,B.jsx)(`span`,{className:Yi.icon,"aria-hidden":`true`,children:(0,B.jsx)(Cr,{})}),`Forget token`]})})})}),(0,B.jsx)(ui,{open:t,onOpenChange:n,children:(0,B.jsxs)(di,{size:`sm`,role:`alertdialog`,children:[(0,B.jsxs)(fi,{children:[(0,B.jsx)(pi,{children:`Forget token?`}),(0,B.jsx)(mi,{children:`You will be logged out and will need to enter your token again to access the admin console.`})]}),(0,B.jsxs)(hi,{children:[(0,B.jsx)(gi,{className:`ghost-button`,children:`Cancel`}),(0,B.jsx)(gi,{className:`danger-button`,onClick:e.onLogout,children:`Forget token`})]})]})})]})}var Ea=[{href:`/chat`,icon:`chat`,label:`Chat`},{href:`/agents`,icon:`agents`,label:`Agents`},{href:`/admin`,icon:`admin`,label:`Admin`},{href:`https://github.com/HybridAIOne/hybridclaw`,image:`/icons/github.svg`,label:`GitHub`},{href:`/docs`,icon:`docs`,label:`Docs`}],Da={admin:$n,agents:tr,chat:ir,docs:pr},Oa=[`/admin`,`/agents`,`/chat`],ka=3e4;function Aa(e){return y({queryKey:[`config`,e],queryFn:()=>Nt(e),staleTime:3e4,refetchInterval:ka,refetchOnWindowFocus:!0}).data?.config.ui?.navigation}function ja(e,t){return e===t||e.startsWith(`${t}/`)}function Ma(e){return/^https?:\/\//iu.test(e)}function Na(e){return Oa.some(t=>e===t||e.startsWith(`${t}/`))}function Pa({item:e}){return e.image?(0,B.jsx)(`img`,{src:e.image,alt:``,"aria-hidden":`true`,decoding:`async`,draggable:!1,referrerPolicy:`no-referrer`}):(0,B.jsx)(e.icon?Da[e.icon]:lr,{})}function Fa(e,t){return t.filter(t=>!Ma(t.href)&&ja(e,t.href)).sort((e,t)=>t.href.length-e.href.length)[0]?.href??null}function Ia(e){let t=I({select:e=>e.location.pathname}),n=e.items??Ea;if(n.length===0)return null;let r=Fa(t,n);return(0,B.jsx)(`nav`,{className:`view-switch`,"aria-label":`Switch view`,children:n.map((e,t)=>{let n=`${e.href}:${e.label}:${t}`,i=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`nav-link-icon`,"aria-hidden":`true`,children:(0,B.jsx)(Pa,{item:e})}),(0,B.jsx)(`span`,{children:e.label})]}),a=Ma(e.href);if(a||!Na(e.href)){let t=e.href===r;return(0,B.jsx)(`a`,{className:t?`view-switch-link active`:`view-switch-link`,href:e.href,"aria-current":t?`page`:void 0,target:a?`_blank`:void 0,rel:a?`noopener noreferrer`:void 0,children:i},n)}return e.href===r?(0,B.jsx)(`span`,{className:`view-switch-link active`,"aria-current":`page`,children:i},n):(0,B.jsx)(D,{className:`view-switch-link`,to:e.href,children:i},n)})})}var La=ba(`15.5rem`,`18rem`),Ra=(0,R.createContext)({emailEnabled:!1});function za(e){let t=Zn(),n=Xn(t),r=I({select:e=>e.location.pathname}),i=y({queryKey:[`status`,t.token],queryFn:()=>je(t.token),initialData:t.gatewayStatus??void 0,enabled:n,staleTime:3e4}),a=Aa(t.token),o=(i.data?.emailEnabled??t.gatewayStatus?.emailEnabled)===!0,s=Gr.map(e=>({...e,items:e.items.filter(e=>!e.requiresEmail||o||r===e.to)})).filter(e=>e.items.length>0),c=qr(r);return(0,B.jsx)(Ra.Provider,{value:{emailEnabled:o},children:(0,B.jsxs)(ra,{style:La,children:[(0,B.jsx)(xa,{groups:s,version:t.gatewayStatus?.version,showLogout:!!t.token,onLogout:t.logout}),(0,B.jsxs)(la,{className:`main-panel`,children:[(0,B.jsxs)(`div`,{className:`topbar`,children:[(0,B.jsx)(`div`,{className:`topbar-title`,children:(0,B.jsxs)(`div`,{className:`topbar-heading`,children:[(0,B.jsx)(da,{}),(0,B.jsx)(`h2`,{children:c.label})]})}),(0,B.jsx)(Ia,{items:a})]}),(0,B.jsx)(`div`,{className:`page-content`,children:e.children})]})]})})}function Ba(){return(0,R.useContext)(Ra)}var Va={skeleton:`_skeleton_z1cth_1`,"skeleton-pulse":`_skeleton-pulse_z1cth_1`},Ha=(0,R.forwardRef)(function({className:e,...t},n){return(0,B.jsx)(`div`,{ref:n,"data-slot":`skeleton`,className:V(Va.skeleton,e),...t})}),Ua=(0,R.createContext)(null);function Wa(){let e=(0,R.useContext)(Ua);if(!e)throw Error(`<ToggleGroupItem> must be used inside <ToggleGroup>`);return e}function Ga(e){let t=e.disabled??!1,n=(0,R.useMemo)(()=>({value:e.value,onValueChange:e.onValueChange,disabled:t}),[e.value,e.onValueChange,t]);return(0,B.jsx)(Ua.Provider,{value:n,children:(0,B.jsx)(`fieldset`,{"aria-label":e.ariaLabel,className:V(`binary-toggle`,e.size===`sm`&&`toggle-group--sm`,e.className),"data-disabled":t||void 0,children:e.children})})}function Ka(e){let t=Wa(),n=e.value===t.value,r=e.activeTone??`is-on`,i=e.disabled??t.disabled;return(0,B.jsx)(`button`,{type:`button`,"aria-pressed":n,"data-state":n?r===`is-off`?`off`:`on`:`off`,className:V(`binary-toggle-button`,n&&`active`,n&&r),disabled:i,"data-disabled":i||void 0,onClick:()=>{!n&&!i&&t.onValueChange(e.value)},children:e.children})}function qa(e,t){let[n,r]=(0,R.useState)(t.initialSort);return{sortedRows:(0,R.useMemo)(()=>{let r=t.sorters[n.key];return r?[...e].sort((e,t)=>{let i=r(e,t);return i===0?0:n.direction===`asc`?i:-i}):[...e]},[t.sorters,e,n]),sortState:n,toggleSort:e=>{r(n=>n.key===e?{key:e,direction:n.direction===`asc`?`desc`:`asc`}:{key:e,direction:t.defaultDirections?.[e]||`asc`})}}}function Ja(e){let t=e.sortState.key===e.sortKey;return(0,B.jsx)(`th`,{"aria-sort":t?e.sortState.direction===`asc`?`ascending`:`descending`:`none`,children:(0,B.jsxs)(`button`,{type:`button`,className:`table-sort-button`,onClick:()=>e.onToggle(e.sortKey),children:[(0,B.jsx)(`span`,{children:e.label}),(0,B.jsx)(`span`,{"aria-hidden":`true`,className:t?`table-sort-indicator is-active is-${e.sortState.direction}`:`table-sort-indicator`})]})})}function Ya(e){return!e.description&&!e.actions?null:(0,B.jsxs)(`div`,{className:`page-header`,children:[e.description?(0,B.jsx)(`div`,{className:`supporting-text page-header-description`,children:e.description}):(0,B.jsx)(`span`,{}),e.actions?(0,B.jsx)(`div`,{className:`header-actions`,children:e.actions}):null]})}function Xa(e){let t=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{children:e.label}),e.loading?(0,B.jsx)(Ha,{className:`metric-card-value-skeleton`}):(0,B.jsx)(`strong`,{children:e.value}),e.loading&&e.detail!==void 0?(0,B.jsx)(Ha,{className:`metric-card-detail-skeleton`}):!e.loading&&e.detail?(0,B.jsx)(`small`,{children:e.detail}):null]});return e.href?(0,B.jsx)(`a`,{className:`metric-card metric-card-link`,href:e.href,children:t}):(0,B.jsx)(`div`,{className:`metric-card`,children:t})}function Za(e){return(0,B.jsx)(Ga,{value:e.value,onValueChange:t=>e.onChange(t),ariaLabel:e.ariaLabel,className:e.className,disabled:e.disabled,size:e.size,children:e.options.map(e=>(0,B.jsx)(Ka,{value:e.value,activeTone:e.activeTone,children:e.label},e.value))})}function Qa(e){let t=e.value?e.trueLabel??`on`:e.falseLabel??`off`,n=!e.value&&e.falseTone===`danger`?` tone-danger`:``;return(0,B.jsxs)(`span`,{className:e.value?`boolean-pill is-on`:`boolean-pill is-off${n}`,children:[(0,B.jsx)(`span`,{className:`boolean-pill-dot`}),t]})}function H(e){return e instanceof Error?e.message||`An unexpected error occurred.`:typeof e==`string`?e:typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`?e.message||`An unexpected error occurred.`:String(e)}function $a(e){return new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}).format(e)}function eo(e){return typeof e==`number`&&Number.isFinite(e)?e:0}function to(e){return`${$a(eo(e.inputTokens))} in / ${$a(eo(e.outputTokens))} out`}function no(e){return`${Math.round(e*100)}%`}function ro(e){return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:e>=1?2:4,maximumFractionDigits:e>=1?2:6}).format(e)}function io(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return`unknown`;let n=Date.now()-t.getTime(),r=6e4,i=60*r,a=24*i;return n<r?`just now`:n<i?`${Math.floor(n/r)}m ago`:n<a?`${Math.floor(n/i)}h ago`:`${Math.floor(n/a)}d ago`}function ao(e){if(!e)return`never`;let t=new Date(e);return Number.isNaN(t.getTime())?`unknown`:t.toLocaleString()}function oo(e){let t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return[t?`${t}d`:null,n?`${n}h`:null,`${r}m`].filter(Boolean).join(` `)}function so(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function co(e){return e.split(/[\n,]/g).map(e=>e.trim()).filter(Boolean)}function lo(e){return(e||[]).join(`, `)}function uo(e){let t=e.latestMessage?.content.replace(/\s+/g,` `).trim();return t?t.length>140?`${t.slice(0,137)}...`:t:`No message content`}function fo(e){return e.participants.length===0?`No participants`:e.participants.length<=2?e.participants.join(` -> `):`${e.participants.slice(0,2).join(` -> `)} +${e.participants.length-2}`}function po(e){return`${e} message${e===1?``:`s`}`}function mo(e){return e===`escalate`||e===`policy.update`?`mailbox-role-pill needs-reply`:`mailbox-role-pill replied`}function ho(e){let{message:t}=e;return(0,B.jsxs)(`article`,{className:`mailbox-message-card user`,children:[(0,B.jsxs)(`div`,{className:`mailbox-message-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:t.senderAgentId}),(0,B.jsxs)(`small`,{children:[`To: `,t.recipientAgentId]}),(0,B.jsx)(`small`,{children:ao(t.createdAt)})]}),(0,B.jsx)(`span`,{children:t.intent})]}),(0,B.jsxs)(`div`,{className:`mailbox-message-metadata`,children:[(0,B.jsx)(`small`,{children:t.id}),t.parentMessageId?(0,B.jsxs)(`small`,{children:[`Parent: `,t.parentMessageId]}):null]}),(0,B.jsx)(`div`,{className:`mailbox-message-body`,children:t.content})]})}function go(){let e=Zn(),[t,n]=(0,R.useState)(null),r=y({queryKey:[`a2a-inbox`,e.token,t],queryFn:()=>$e(e.token,t)}),i=r.data?.threads||[],a=t||r.data?.selectedThreadId||null,o=i.find(e=>e.id===a)||null,s=r.data?.messages||[];return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{}),(0,B.jsxs)(`div`,{className:`mailbox-shell a2a-inbox-shell`,children:[(0,B.jsxs)(`section`,{className:`mailbox-main`,children:[(0,B.jsx)(`div`,{className:`mailbox-column-header`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:`Threads`}),(0,B.jsx)(`small`,{children:r.isLoading&&!r.data?`Loading threads...`:`${i.length} total`})]})}),(0,B.jsx)(`div`,{className:`mailbox-thread-list`,children:r.isLoading&&!r.data?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading A2A threads...`}):r.isError?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(r.error)}):i.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No A2A threads recorded.`}):i.map(e=>{let t=e.latestMessage;return(0,B.jsx)(`div`,{className:[`mailbox-thread-row`,e.id===a?`is-unread`:``].filter(Boolean).join(` `),children:(0,B.jsxs)(`button`,{className:`mailbox-thread-button`,type:`button`,onClick:()=>n(e.id),children:[(0,B.jsxs)(`div`,{className:`mailbox-thread-summary`,children:[(0,B.jsx)(`strong`,{className:`mailbox-thread-sender`,children:e.id}),(0,B.jsx)(`span`,{className:`mailbox-thread-separator`,children:`-`}),(0,B.jsx)(`strong`,{className:`mailbox-thread-subject`,children:t?.intent||`thread`}),(0,B.jsx)(`span`,{className:`mailbox-thread-separator`,children:`-`}),(0,B.jsx)(`span`,{className:`mailbox-thread-preview`,children:uo(e)})]}),(0,B.jsx)(`span`,{className:`mailbox-thread-time`,children:t?.createdAt?io(t.createdAt):`unknown`})]})},e.id)})})]}),(0,B.jsx)(`section`,{className:`mailbox-detail`,children:o?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`mailbox-detail-header`,children:(0,B.jsxs)(`div`,{className:`mailbox-detail-copy`,children:[(0,B.jsxs)(`div`,{className:`mailbox-detail-heading`,children:[(0,B.jsx)(`h3`,{children:o.id}),o.latestMessage?(0,B.jsx)(`span`,{className:mo(o.latestMessage.intent),children:o.latestMessage.intent}):null]}),(0,B.jsxs)(`p`,{className:`supporting-text`,children:[fo(o),` ·`,` `,po(o.messageCount),` ·`,` `,o.ownerCoworkerId?`Owned by ${o.ownerCoworkerId}`:`No owner`]}),o.latestMessage?(0,B.jsxs)(`p`,{className:`supporting-text`,children:[`Last message:`,` `,ao(o.latestMessage.createdAt)]}):null]})}),(0,B.jsx)(`div`,{className:`mailbox-message-list`,children:r.isFetching&&!r.data?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading messages...`}):s.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No messages in this thread.`}):s.map(e=>(0,B.jsx)(ho,{message:e},e.id))})]}):(0,B.jsx)(`div`,{className:`empty-state mailbox-detail-empty`,children:`Select an A2A thread.`})})]})]})}var _o={card:`_card_1739l_1`,header:`_header_1739l_34`,action:`_action_1739l_41`,title:`_title_1739l_45`,description:`_description_1739l_54`,content:`_content_1739l_70`,footer:`_footer_1739l_77`},U=(0,R.forwardRef)(function({variant:e=`default`,interactive:t,className:n,...r},i){return(0,B.jsx)(`div`,{ref:i,"data-slot":`card`,"data-variant":e,"data-interactive":t?``:void 0,tabIndex:t?r.tabIndex??0:r.tabIndex,className:V(_o.card,n),...r})}),W=(0,R.forwardRef)(function({className:e,...t},n){return(0,B.jsx)(`div`,{ref:n,"data-slot":`card-header`,className:V(_o.header,e),...t})}),G=(0,R.forwardRef)(function({className:e,...t},n){return(0,B.jsx)(`h4`,{ref:n,"data-slot":`card-title`,className:V(_o.title,e),...t})}),vo=(0,R.forwardRef)(function({className:e,...t},n){return(0,B.jsx)(`p`,{ref:n,"data-slot":`card-description`,className:V(_o.description,e),...t})}),yo=(0,R.forwardRef)(function({className:e,...t},n){return(0,B.jsx)(`div`,{ref:n,"data-slot":`card-action`,className:V(_o.action,e),...t})}),K=(0,R.forwardRef)(function({className:e,...t},n){return(0,B.jsx)(`div`,{ref:n,"data-slot":`card-content`,className:V(_o.content,e),...t})});(0,R.forwardRef)(function({className:e,...t},n){return(0,B.jsx)(`div`,{ref:n,"data-slot":`card-footer`,className:V(_o.footer,e),...t})});function bo(e){let t=(0,R.useRef)(e);return(0,R.useLayoutEffect)(()=>{t.current=e}),(0,R.useCallback)((...e)=>t.current(...e),[])}var xo=(0,R.createContext)(null);function So(){return(0,R.useContext)(xo)}var Co=(0,R.createContext)(null);function wo(){return(0,R.useContext)(Co)}var To=(0,R.createContext)(null),Eo=(0,R.createContext)(null),Do=(0,R.createContext)(null);function Oo(){return(0,R.useContext)(To)}function ko(){return(0,R.useContext)(Do)}var Ao={label:`_label_g5ybj_1`};function jo({className:e,...t}){return(0,B.jsx)(`label`,{"data-slot":`label`,className:V(Ao.label,e),...t})}var Mo=(0,R.createContext)({id:void 0,labelId:void 0,descriptionId:void 0,errorId:void 0,invalid:void 0,disabled:void 0,required:void 0,error:null,setError:()=>{},touched:!1,setTouched:()=>{}});function No(){return(0,R.useContext)(Mo)}function Po(e){let t=No(),n=Fo(t.descriptionId,t.invalid?t.errorId:void 0,e[`aria-describedby`]),r=e.required??t.required;return{...e,id:e.id??t.id,disabled:e.disabled??t.disabled,required:r,"aria-invalid":e[`aria-invalid`]??t.invalid,"aria-required":e[`aria-required`]??(r?!0:void 0),"aria-describedby":n}}function Fo(...e){let t=e.filter(e=>!!e);return t.length===0?void 0:t.join(` `)}var Io={fieldSet:`_fieldSet_ykv3y_3`,legend:`_legend_ykv3y_10`,group:`_group_ykv3y_30`,field:`_field_ykv3y_3`,orientationVertical:`_orientationVertical_ykv3y_58`,orientationHorizontal:`_orientationHorizontal_ykv3y_66`,orientationResponsive:`_orientationResponsive_ykv3y_81`,content:`_content_ykv3y_104`,label:`_label_ykv3y_114`,title:`_title_ykv3y_126`,description:`_description_ykv3y_139`,error:`_error_ykv3y_159`,errorList:`_errorList_ykv3y_166`,separator:`_separator_ykv3y_176`,separatorLine:`_separatorLine_ykv3y_187`,separatorLabel:`_separatorLabel_ykv3y_194`},Lo=e=>e==null||typeof e==`string`&&e.trim()===``?`Required.`:null;function Ro(e){return e===void 0?Lo:t=>t==null||typeof t==`string`&&t.trim()===``?e:null}function zo(e,t){return n=>typeof n==`string`?(e.lastIndex=0,e.test(n)?null:t):null}function Bo(...e){let t=e.filter(e=>typeof e==`function`);return e=>{for(let n of t){let t=n(e);if(t)return t}return null}}var Vo={vertical:Io.orientationVertical,horizontal:Io.orientationHorizontal,responsive:Io.orientationResponsive};function Ho({className:e,...t}){return(0,B.jsx)(`fieldset`,{"data-slot":`field-set`,className:V(Io.fieldSet,e),...t})}function Uo({className:e,variant:t=`legend`,...n}){return(0,B.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:V(Io.legend,e),...n})}function Wo({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`field-group`,className:V(Io.group,e),...t})}function q({className:e,orientation:t=`vertical`,invalid:n,disabled:r,required:i,controlId:a,onErrorChange:o,error:s,touched:c,validate:l,onBlur:u,onChange:d,...f}){let p=wo(),m=(0,R.useId)(),h=a??p?.id??m,g=i??p?.required,_=r??p?.disabled,v=l??p?.validate,[y,b]=(0,R.useState)(null),[x,S]=(0,R.useState)(!1),C=bo(o??Go),w=s!==void 0,T=c??x,E=(0,R.useCallback)(e=>{w||b(t=>t===e?t:e)},[w]),D=w?s:y??p?.error??null,O=Oo();(0,R.useEffect)(()=>{O&&O.registerError(h,D)},[O,h,D]),(0,R.useEffect)(()=>{if(O)return()=>O.registerError(h,null)},[O,h]),(0,R.useEffect)(()=>{if(!(!O||w))return O.registerErrorSetter(h,e=>{e!==null&&S(!0),E(e)})},[O,h,w,E]),(0,R.useEffect)(()=>{C(D)},[D,C]);let k=ko(),A=k?.submitAttempted??!1,j=k?.resetSeq??0,M=(0,R.useRef)(j);M.current!==j&&(M.current=j,S(!1),b(null));let N=bo(v??Ko);(0,R.useEffect)(()=>{if(!(v===void 0||!O))return O.registerValidator(h,()=>{let e=N();return E(e),e})},[O,h,v,N,E]);let P;P=n===void 0?(w||T||A)&&D!==null?!0:void 0:n;let F=(0,R.useMemo)(()=>({id:h,labelId:`${h}-label`,descriptionId:`${h}-description`,errorId:`${h}-error`,invalid:P,disabled:_,required:g,error:D,setError:E,touched:T,setTouched:S}),[h,P,_,g,D,E,T]);return(0,B.jsx)(Mo.Provider,{value:F,children:(0,B.jsx)(`div`,{"data-slot":`field`,"data-orientation":t,"data-invalid":P||void 0,"data-disabled":_||void 0,className:V(Io.field,Vo[t],e),onBlur:e=>{S(!0),u?.(e)},onChange:e=>{S(!0),d?.(e)},...f})})}function Go(){}function Ko(){return null}function qo({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`field-content`,className:V(Io.content,e),...t})}function J({className:e,htmlFor:t,id:n,...r}){let i=No();return(0,B.jsx)(jo,{"data-slot":`field-label`,id:n??i.labelId,htmlFor:t??i.id,className:V(Io.label,e),...r})}function Jo({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`field-title`,className:V(Io.title,e),...t})}function Yo({className:e,id:t,...n}){let r=No();return(0,B.jsx)(`p`,{"data-slot":`field-description`,id:t??r.descriptionId,className:V(Io.description,e),...n})}function Xo(e,t,n){if(e)return e;if(t?.length){let e=[...new Map(t.map(e=>[e?.message,e])).values()].filter(e=>!!e?.message);return e.length===0?n:e.length===1?e[0]?.message:(0,B.jsx)(`ul`,{className:Io.errorList,children:e.map(e=>(0,B.jsx)(`li`,{children:e.message},e.message))})}return n}function Zo({className:e,children:t,errors:n,id:r,...i}){let a=No(),o=Xo(t,n,a.error);return!o||!a.invalid?null:(0,B.jsx)(`div`,{...i,role:`alert`,"data-slot":`field-error`,id:r??a.errorId,className:V(Io.error,e),children:o})}var Qo={input:`_input_19no1_1`,sizeDefault:`_sizeDefault_19no1_68`,sizeSm:`_sizeSm_19no1_73`},$o={default:Qo.sizeDefault,sm:Qo.sizeSm};function Y({className:e,type:t=`text`,size:n=`default`,...r}){return(0,B.jsx)(`input`,{...Po(r),type:t,"data-slot":`input`,"data-size":n,className:V(Qo.input,$o[n],e)})}var es={textarea:`_textarea_1euii_1`,autoSize:`_autoSize_1euii_49`};function ts({className:e,autoSize:t=!1,...n}){return(0,B.jsx)(`textarea`,{...Po(n),"data-slot":`textarea`,"data-auto-size":t?``:void 0,className:V(es.textarea,t&&es.autoSize,e)})}function ns(e){return e.length>18?`${e.slice(0,12)}...${e.slice(-6)}`:e}function rs(e){return e.status===`revoked`?(0,B.jsx)(Qa,{value:!1,falseLabel:`revoked`,falseTone:`danger`}):(0,B.jsx)(Qa,{value:!0,trueLabel:`trusted`})}function is(){let e=Zn(),t=o(),[n,r]=(0,R.useState)(null),[i,a]=(0,R.useState)(``),[s,c]=(0,R.useState)(``),[l,u]=(0,R.useState)(``),[d,f]=(0,R.useState)(``),[p,m]=(0,R.useState)(``),[h,_]=(0,R.useState)(``),[v,b]=(0,R.useState)(``),[x,S]=(0,R.useState)(``),[C,w]=(0,R.useState)(``),[T,E]=(0,R.useState)(``),[D,O]=(0,R.useState)(``),[k,A]=(0,R.useState)(!0),[j,M]=(0,R.useState)(null),[N,P]=(0,R.useState)(null),[F,I]=(0,R.useState)(``),ee=y({queryKey:[`a2a-trust`,e.token],queryFn:()=>Be(e.token)}),L=g({mutationFn:t=>tt(e.token,{peerId:t,reason:i}),onSuccess:n=>{t.setQueryData([`a2a-trust`,e.token],n)}}),te=g({mutationFn:()=>{let t=h.trim()?JSON.parse(h):void 0;return nt(e.token,{peerId:s,agentCardUrl:l||void 0,deliveryUrl:d||void 0,publicKeyFingerprint:p||void 0,publicKeyJwk:t,reason:v||void 0})},onSuccess:n=>{t.setQueryData([`a2a-trust`,e.token],n)}}),ne=g({mutationFn:t=>rt(e.token,t),onSuccess:n=>{t.setQueryData([`a2a-trust`,e.token],n),r(n.peers[0]?.peerId||null)}}),re=g({mutationFn:()=>it(e.token,{peerUrl:x||void 0,canonicalId:C||void 0,canonicalInstanceId:T||void 0,reason:D||void 0,notifyPeer:k}),onSuccess:n=>{t.setQueryData([`a2a-trust`,e.token],n),P(n),r(n.proposal.peerId)}}),ie=g({mutationFn:()=>at(e.token,{peerUrl:x||void 0,canonicalId:C||void 0,canonicalInstanceId:T||void 0}),onSuccess:e=>{M(e),P(null)}}),ae=g({mutationFn:t=>ot(e.token,t,F),onSuccess:n=>{t.setQueryData([`a2a-trust`,e.token],n)}}),oe=g({mutationFn:t=>st(e.token,t,F),onSuccess:n=>{t.setQueryData([`a2a-trust`,e.token],n)}}),se=ee.data?.peers||[],ce=ee.data?.pairingRequests||[],le=se.find(e=>e.peerId===n)||se[0]||null;function ue(e){c(e.peerId),u(e.agentCardUrl),f(e.deliveryUrl),m(e.publicKeyFingerprint),_(e.publicKeyJwk?JSON.stringify(e.publicKeyJwk,null,2):``),b(``)}function de(){M(null),P(null)}return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Local identity`})}),(0,B.jsx)(K,{children:ee.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading identity...`}):ee.data?(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Instance`}),(0,B.jsx)(`strong`,{children:ee.data.identity.instanceId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Public key`}),(0,B.jsx)(`strong`,{children:ns(ee.data.identity.publicKeyFingerprint)})]})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Identity unavailable.`})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Add peer instance`}),(0,B.jsx)(vo,{children:`Fetch a peer Agent Card, pin its public key, and notify the remote operator.`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Peer URL`}),(0,B.jsx)(Y,{placeholder:`https://peer.example.com`,value:x,onChange:e=>{S(e.target.value),de()}})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Canonical agent id`}),(0,B.jsx)(Y,{placeholder:`agent@user@instance`,value:C,onChange:e=>{w(e.target.value),de()}})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Canonical instance id`}),(0,B.jsx)(Y,{placeholder:`instance-prod`,value:T,onChange:e=>{E(e.target.value),de()}})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Reason`}),(0,B.jsx)(Y,{value:D,onChange:e=>O(e.target.value)})]}),(0,B.jsxs)(`label`,{className:`inline-checkbox`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:k,onChange:e=>A(e.target.checked)}),(0,B.jsx)(`span`,{children:`Send peer-side approval prompt`})]}),(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:!x.trim()&&!C.trim()&&!T.trim()||ie.isPending,onClick:()=>ie.mutate(),children:`Fetch peer`}),j?(0,B.jsx)(`div`,{className:`info-row`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:j.proposal.peerId}),(0,B.jsx)(`small`,{children:j.proposal.agentCardUrl}),(0,B.jsx)(`small`,{children:j.proposal.deliveryUrl}),(0,B.jsx)(`small`,{children:j.proposal.publicKeyFingerprint})]})}):null,(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:!j||re.isPending||ie.isPending,onClick:()=>re.mutate(),children:`Trust peer`}),N?(0,B.jsx)(`small`,{className:`row-status-note`,children:`Trusted ${N.proposal.peerId} (${ns(N.proposal.publicKeyFingerprint)}); peer prompt ${N.remoteNotification.status}.`}):null,re.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:re.error instanceof Error?re.error.message:`Pairing failed.`}):null,ie.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:ie.error instanceof Error?ie.error.message:`Pairing preview failed.`}):null]})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Incoming pairing requests`}),(0,B.jsx)(vo,{children:`${ce.length} request${ce.length===1?``:`s`}`})]}),(0,B.jsx)(K,{children:ce.length?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Decision reason`}),(0,B.jsx)(Y,{value:F,onChange:e=>I(e.target.value)})]}),(0,B.jsx)(`div`,{className:`list-stack`,children:ce.map(e=>(0,B.jsxs)(`div`,{className:`info-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.peerId}),(0,B.jsx)(`small`,{children:`${e.status} - ${ns(e.publicKeyFingerprint)}`}),e.pairingId?(0,B.jsx)(`small`,{children:`Pairing ${e.pairingId}`}):null]}),(0,B.jsxs)(`div`,{className:`row-actions`,children:[(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:e.status!==`pending`||ae.isPending,onClick:()=>ae.mutate(e.requestId),children:`Approve`}),(0,B.jsx)(`button`,{className:`danger-button`,type:`button`,disabled:e.status!==`pending`||oe.isPending,onClick:()=>oe.mutate(e.requestId),children:`Decline`})]})]},e.requestId))}),ae.error||oe.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:(ae.error||oe.error)instanceof Error?(ae.error||oe.error)?.message:`Pairing decision failed.`}):null]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No incoming pairing requests.`})})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Trusted peers`}),(0,B.jsx)(vo,{children:`${se.length} peer${se.length===1?``:`s`}`})]}),(0,B.jsx)(K,{children:ee.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading peers...`}):se.length?(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:se.map(e=>(0,B.jsxs)(`button`,{className:e.peerId===le?.peerId?`selectable-row active`:`selectable-row`,type:`button`,onClick:()=>r(e.peerId),children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.peerId}),(0,B.jsx)(`small`,{children:ns(e.publicKeyFingerprint)})]}),rs(e)]},e.peerId))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No A2A peer keys cached.`})})]}),(0,B.jsxs)(`div`,{className:`sticky-detail`,children:[(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Peer detail`})}),(0,B.jsx)(K,{children:le?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Peer`}),(0,B.jsx)(`strong`,{children:le.peerId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Status`}),(0,B.jsx)(`strong`,{children:le.status})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Trusted`}),(0,B.jsx)(`strong`,{children:ao(le.trustedAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Last seen`}),(0,B.jsx)(`strong`,{children:io(le.lastSeenAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Agent Card`}),(0,B.jsx)(`strong`,{children:le.agentCardUrl})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Delivery URL`}),(0,B.jsx)(`strong`,{children:le.deliveryUrl})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Fingerprint`}),(0,B.jsx)(`strong`,{children:le.publicKeyFingerprint})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Mismatch`}),(0,B.jsx)(`strong`,{children:le.lastMismatchAt||`none`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Revocation reason`}),(0,B.jsx)(Y,{value:i,onChange:e=>a(e.target.value)})]}),(0,B.jsx)(`button`,{className:`danger-button`,type:`button`,disabled:le.status===`revoked`||L.isPending,onClick:()=>L.mutate(le.peerId),children:`Revoke`}),(0,B.jsx)(`button`,{className:`danger-button`,type:`button`,disabled:ne.isPending,onClick:()=>ne.mutate(le.peerId),children:`Delete`}),(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,onClick:()=>ue(le),children:`Use in override`}),L.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:L.error instanceof Error?L.error.message:`Revocation failed.`}):null,ne.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:ne.error instanceof Error?ne.error.message:`Delete failed.`}):null]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Select a peer.`})})]}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Operator override`})}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Peer`}),(0,B.jsx)(Y,{value:s,onChange:e=>c(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Agent Card`}),(0,B.jsx)(Y,{value:l,onChange:e=>u(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Delivery URL`}),(0,B.jsx)(Y,{value:d,onChange:e=>f(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Fingerprint`}),(0,B.jsx)(Y,{value:p,onChange:e=>m(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Public JWK`}),(0,B.jsx)(ts,{rows:5,value:h,onChange:e=>_(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Reason`}),(0,B.jsx)(Y,{value:v,onChange:e=>b(e.target.value)})]}),(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:!s.trim()||te.isPending,onClick:()=>te.mutate(),children:`Trust`}),te.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:te.error instanceof Error?te.error.message:`Trust update failed.`}):null]})})]})]})]})]})}function as(e){return String(e||``).trim().toLowerCase()}function X(e,t){return as(e).localeCompare(as(t))}function os(e,t){return(e??0)-(t??0)}function ss(e,t){return Number(e)-Number(t)}function cs(e,t){let n=Date.parse(String(e||``)),r=Date.parse(String(t||``));return(Number.isNaN(n)?0:n)-(Number.isNaN(r)?0:r)}function ls(e){let t=e.best_skills[0];return t?`${t.skill_name} (${t.score}/100)`:`No observed skill runs`}var us={agent:(e,t)=>X(e.display_name,t.display_name)||X(e.agent_id,t.agent_id),score:(e,t)=>os(e.avg_score,t.avg_score)||X(e.display_name,t.display_name),runs:(e,t)=>os(e.total_executions,t.total_executions)||X(e.display_name,t.display_name),quality:(e,t)=>os(e.avg_quality_score,t.avg_quality_score)||X(e.display_name,t.display_name),reliability:(e,t)=>os(e.avg_reliability_score,t.avg_reliability_score)||X(e.display_name,t.display_name),timing:(e,t)=>os(e.avg_timing_score,t.avg_timing_score)||X(e.display_name,t.display_name),anomalies:(e,t)=>os(e.weekly_anomalies_flagged,t.weekly_anomalies_flagged)||X(e.display_name,t.display_name),skill:(e,t)=>X(ls(e),ls(t))||X(e.display_name,t.display_name),recent:(e,t)=>X(e.last_observed_at||``,t.last_observed_at||``)||X(e.display_name,t.display_name)},ds={score:`desc`,runs:`desc`,quality:`desc`,reliability:`desc`,timing:`desc`,anomalies:`desc`,recent:`desc`};function fs(){let e=Zn(),t=y({queryKey:[`agent-scoreboard`,e.token],queryFn:()=>Rn(e.token)}),n=t.data?.agents||[],r=t.data?.observed_skill_count??0,i=[...n].sort((e,t)=>t.avg_score-e.avg_score)[0],{sortedRows:a,sortState:o,toggleSort:s}=qa(n,{initialSort:{key:`score`,direction:`desc`},sorters:us,defaultDirections:ds});return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{description:`Review agent skill track records, top strengths, and generated CV paths.`}),(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Xa,{label:`Observed agents`,value:String(n.length),detail:`with recorded skill runs`,loading:!t.data}),(0,B.jsx)(Xa,{label:`Observed skills`,value:String(r),detail:`across agent runs`,loading:!t.data}),(0,B.jsx)(Xa,{label:`Best average score`,value:i?`${i.avg_score}/100`:`0/100`,detail:i?.display_name||`No runs yet`,loading:!t.data}),(0,B.jsx)(Xa,{label:`Total runs`,value:String(n.reduce((e,t)=>e+t.total_executions,0)),detail:`skill executions`,loading:!t.data})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Agent scoreboard`}),(0,B.jsx)(vo,{children:`${a.length} agent${a.length===1?``:`s`} visible`})]}),(0,B.jsx)(K,{children:t.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading agent scoreboard...`}):a.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No agent skill runs recorded yet.`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Ja,{label:`Agent`,sortKey:`agent`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Score`,sortKey:`score`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Runs`,sortKey:`runs`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Quality`,sortKey:`quality`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Reliability`,sortKey:`reliability`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Timing`,sortKey:`timing`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Best at`,sortKey:`skill`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Anomalies`,sortKey:`anomalies`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Recent`,sortKey:`recent`,sortState:o,onToggle:s}),(0,B.jsx)(`th`,{children:`CV`})]})}),(0,B.jsx)(`tbody`,{children:a.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.display_name}),(0,B.jsx)(`div`,{className:`supporting-text`,children:e.agent_id})]}),(0,B.jsxs)(`td`,{children:[e.avg_score,`/100`]}),(0,B.jsx)(`td`,{children:e.total_executions}),(0,B.jsxs)(`td`,{children:[e.avg_quality_score,`/100`]}),(0,B.jsxs)(`td`,{children:[e.avg_reliability_score,`/100`]}),(0,B.jsxs)(`td`,{children:[e.avg_timing_score,`/100`]}),(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:ls(e)}),e.best_skills[0]?(0,B.jsxs)(`div`,{className:`supporting-text`,children:[`Q `,e.best_skills[0].quality_score,` · R`,` `,e.best_skills[0].reliability_score,` · T`,` `,e.best_skills[0].timing_score]}):null]}),(0,B.jsxs)(`td`,{children:[e.weekly_anomalies_flagged,(0,B.jsxs)(`div`,{className:`supporting-text`,children:[e.weekly_anomalies_confirmed_normal,` confirmed normal`]})]}),(0,B.jsx)(`td`,{children:e.last_observed_at?io(e.last_observed_at):`No recent runs`}),(0,B.jsx)(`td`,{children:(0,B.jsx)(`a`,{href:`/admin/agents?agent=${encodeURIComponent(e.agent_id)}&file=CV.md`,children:`CV.md`})})]},e.agent_id))})]})})})]})]})}var ps={button:`_button_kxq2k_1`,default:`_default_kxq2k_50`,ghost:`_ghost_kxq2k_60`,outline:`_outline_kxq2k_70`,danger:`_danger_kxq2k_80`,sizeDefault:`_sizeDefault_kxq2k_92`,sizeSm:`_sizeSm_kxq2k_97`,sizeIcon:`_sizeIcon_kxq2k_103`},ms={default:ps.default,ghost:ps.ghost,outline:ps.outline,danger:ps.danger},hs={default:ps.sizeDefault,sm:ps.sizeSm,icon:ps.sizeIcon},Z=(0,R.forwardRef)(function({variant:e=`default`,size:t=`default`,loading:n=!1,disabled:r,className:i,onClick:a,type:o,render:s,children:c,...l},u){let d=r||n,f=e=>{if(d){e.preventDefault();return}a?.(e)},p=V(ps.button,ms[e],hs[t],i),m={"data-disabled":d?``:void 0,"data-loading":n?``:void 0};if(s&&(0,R.isValidElement)(s)){let e=s.props;return(0,R.cloneElement)(s,{...l,ref:u,className:V(p,e.className),"aria-disabled":d||void 0,"aria-busy":n||void 0,onClick:f,children:c??e.children,...m})}return(0,B.jsx)(`button`,{ref:u,type:o??`button`,className:p,disabled:r,"aria-disabled":n||void 0,"aria-busy":n||void 0,onClick:f,...m,...l,children:c})}),gs={wrapper:`_wrapper_1gpbx_1`,select:`_select_1gpbx_12`,chevron:`_chevron_1gpbx_55`,option:`_option_1gpbx_66`,optgroup:`_optgroup_1gpbx_71`,sizeDefault:`_sizeDefault_1gpbx_78`,sizeSm:`_sizeSm_1gpbx_83`},_s={default:gs.sizeDefault,sm:gs.sizeSm};function vs({className:e,size:t=`default`,children:n,...r}){let i=Po(r);return(0,B.jsxs)(`div`,{className:gs.wrapper,"data-slot":`native-select-wrapper`,children:[(0,B.jsx)(`select`,{...i,"data-slot":`native-select`,"data-size":t,className:V(gs.select,_s[t],e),children:n}),(0,B.jsx)(or,{"aria-hidden":`true`,className:gs.chevron,"data-slot":`native-select-icon`})]})}function Q({className:e,...t}){return(0,B.jsx)(`option`,{...t,"data-slot":`native-select-option`,className:V(gs.option,e)})}function ys({className:e,...t}){return(0,B.jsx)(`optgroup`,{...t,"data-slot":`native-select-optgroup`,className:V(gs.optgroup,e)})}var bs={viewport:`_viewport_ct6pf_1`,toast:`_toast_ct6pf_18`,toastSlideIn:`_toastSlideIn_ct6pf_1`,exiting:`_exiting_ct6pf_34`,toastSlideOut:`_toastSlideOut_ct6pf_1`,body:`_body_ct6pf_38`,title:`_title_ct6pf_45`,description:`_description_ct6pf_52`,success:`_success_ct6pf_59`,error:`_error_ct6pf_68`,info:`_info_ct6pf_77`,actions:`_actions_ct6pf_86`,actionButton:`_actionButton_ct6pf_93`,closeButton:`_closeButton_ct6pf_108`},xs=(0,R.createContext)(null);function Ss(){let e=(0,R.useContext)(xs);if(!e)throw Error(`useToast must be used within <ToastProvider>.`);return e}var Cs=0;function ws(e){return Math.max(0,e)}function Ts(e){let t=e.limit??3,[n,r]=(0,R.useState)([]),i=(0,R.useRef)(null),[a,o]=(0,R.useState)(!1);(0,R.useEffect)(()=>{function e(){o(!0)}function t(){o(!1)}return window.addEventListener(`blur`,e),window.addEventListener(`focus`,t),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`focus`,t)}},[]);let s=(0,R.useCallback)(e=>{r(t=>t.filter(t=>t.id!==e))},[]),c=(0,R.useCallback)(e=>{r(t=>t.map(t=>t.id===e?{...t,exiting:!0}:t))},[]),l=(0,R.useCallback)(e=>{let n=`toast-${++Cs}`,i={id:n,title:e.title,description:e.description,type:e.type??`default`,duration:ws(e.duration??5e3),action:e.action,pinned:e.pinned??!1,exiting:!1};return r(e=>{let n=[...e,i];if(n.length>t){let e=n.length-t;return n.map(t=>e>0&&!t.exiting&&!t.pinned?(--e,{...t,exiting:!0}):t)}return n}),n},[t]),u=(0,R.useCallback)((e,t)=>{r(n=>n.map(n=>{if(n.id!==e)return n;let r={...n,...t};return t.duration!==void 0&&(r.duration=ws(t.duration)),r}))},[]),d=(0,R.useCallback)((e,t)=>l({title:e,description:t,type:`success`}),[l]),f=(0,R.useCallback)((e,t)=>l({title:e,description:t,type:`error`,duration:0}),[l]),p=(0,R.useCallback)((e,t)=>l({title:e,description:t,type:`info`}),[l]);(0,R.useEffect)(()=>{function e(e){if(e.key===`F8`){i.current?.focus({preventScroll:!0});return}e.key===`Escape`&&(!i.current||!i.current.contains(document.activeElement)||r(e=>{let t;for(let n=e.length-1;n>=0;n--)if(!e[n].exiting){t=e[n];break}return t?e.map(e=>e.id===t.id?{...e,exiting:!0}:e):e}))}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]);let m=(0,R.useMemo)(()=>({add:l,success:d,error:f,info:p,update:u,dismiss:c}),[l,d,f,p,u,c]);return(0,B.jsxs)(xs.Provider,{value:m,children:[e.children,typeof document<`u`&&(0,Jr.createPortal)((0,B.jsx)(Es,{ref:i,toasts:n,windowBlurred:a,onDismiss:c,onRemove:s}),document.body)]})}var Es=(0,R.forwardRef)(function(e,t){return(0,B.jsx)(`div`,{ref:t,className:bs.viewport,tabIndex:-1,children:e.toasts.map(t=>(0,B.jsx)(Ds,{toast:t,windowBlurred:e.windowBlurred,onDismiss:e.onDismiss,onRemove:e.onRemove},t.id))})});function Ds(e){let{toast:t,windowBlurred:n,onDismiss:r,onRemove:i}=e,a=(0,R.useRef)(null),[o,s]=(0,R.useState)(!1),[c,l]=(0,R.useState)(!1),u=(0,R.useRef)(t.duration),d=(0,R.useRef)(0),f=o||c||n;(0,R.useEffect)(()=>{if(t.duration<=0||t.exiting||f)return;d.current=Date.now();let e=setTimeout(()=>r(t.id),u.current);return()=>{clearTimeout(e),u.current-=Date.now()-d.current,u.current<0&&(u.current=0)}},[t.id,t.duration,t.exiting,f,r]);let p=(0,R.useCallback)(()=>i(t.id),[i,t.id]);return Yr(a,t.exiting,p),(0,B.jsxs)(`div`,{ref:a,className:V(bs.toast,t.type===`success`&&bs.success,t.type===`error`&&bs.error,t.type===`info`&&bs.info,t.exiting&&bs.exiting),"data-type":t.type,role:t.type===`error`?`alert`:`status`,"aria-live":t.type===`error`?`assertive`:`polite`,"aria-atomic":`true`,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onFocus:()=>l(!0),onBlur:()=>l(!1),children:[(0,B.jsxs)(`div`,{className:bs.body,children:[(0,B.jsx)(`p`,{className:bs.title,children:t.title}),t.description?(0,B.jsx)(`p`,{className:bs.description,children:t.description}):null]}),(0,B.jsxs)(`div`,{className:bs.actions,children:[t.action?(0,B.jsx)(`button`,{type:`button`,className:bs.actionButton,onClick:()=>{try{t.action?.onClick()}catch(e){console.error(`Toast action callback failed:`,e)}r(t.id)},children:t.action.label}):null,(0,B.jsx)(`button`,{type:`button`,className:bs.closeButton,"aria-label":`Dismiss`,onClick:()=>r(t.id),children:`×`})]})]})}function Os(e){return e&&(e.markdownFiles.find(e=>e.exists)?.name||e.markdownFiles[0]?.name)||null}function ks(e,t){return!e||!t?null:`${e}:${t}`}function As(e){return e.displayName||e.name}function js(e){return Array.isArray(e)?e.length>0?e.join(`, `):`none`:e||`none`}function Ms(e){let t=[];for(let n of e.added)t.push(`+ ${n.id}`);for(let n of e.removed)t.push(`- ${n.id}`);for(let n of e.changed)for(let e of n.fields)t.push(`~ ${n.agentId}.${e.field}: ${js(e.before)} -> ${js(e.after)}`);return t.length>0?t.join(`
3
+ `):`No field changes recorded.`}var Ns=10;function Ps(){let e=Zn(),t=o(),n=Ss(),r=new URLSearchParams(window.location.search),[i,a]=(0,R.useState)(r.get(`agent`)),[s,c]=(0,R.useState)(r.get(`file`)),[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)(null),[p,m]=(0,R.useState)(Ns),[h,_]=(0,R.useState)(Ns),[v,b]=(0,R.useState)(``),x=(0,R.useRef)(null),S=(0,R.useRef)(``),C=y({queryKey:[`admin-agents`,e.token],queryFn:()=>mt(e.token)}),w=C.data?.find(e=>e.id===i)||C.data?.[0]||null;(0,R.useEffect)(()=>{w&&w.id!==i&&a(w.id)},[w,i]),(0,R.useEffect)(()=>{if(!C.data)return;if(!w){s!==null&&(c(null),u(null));return}let e=w.markdownFiles.find(e=>e.name===s)?.name||Os(w);e!==s&&(c(e),u(null),m(Ns))},[C.data,w,s]);let T=w?.markdownFiles.find(e=>e.name===s)||null,E=ks(w?.id,s),D=y({queryKey:[`admin-agent-markdown`,e.token,w?.id||``,s||``],queryFn:()=>bt(e.token,{agentId:w?.id||``,fileName:s||``}),enabled:!!(w?.id&&s),refetchOnWindowFocus:!1}),O=D.data?.file.name===s?D.data.file:T,k=w?.markdownFiles.filter(e=>!e.readOnly),A=w?.markdownFiles.filter(e=>e.readOnly),j=!!O?.readOnly,M=O?As(O):s,N=y({queryKey:[`admin-agent-markdown-revision`,e.token,w?.id||``,s||``,l||``],queryFn:()=>St(e.token,{agentId:w?.id||``,fileName:s||``,revisionId:l||``}),enabled:!!(w?.id&&s&&l),refetchOnWindowFocus:!1}),P=y({queryKey:[`admin-team-structure`,e.token],queryFn:()=>_t(e.token),refetchOnWindowFocus:!1}),F=y({queryKey:[`admin-team-structure-revision`,e.token,d||0],queryFn:()=>vt(e.token,d||0),enabled:!!d,refetchOnWindowFocus:!1});(0,R.useEffect)(()=>{if(!E){x.current=null,S.current=``,b(``);return}if(!D.data)return;let e=D.data.file.content;(x.current!==E||v===S.current)&&(x.current=E,S.current=e,b(e))},[v,D.data,E]);let I=g({mutationFn:async()=>{if(!w||!s)throw Error(`Select an agent and markdown file first.`);return xt(e.token,{agentId:w.id,fileName:s,content:v})},onSuccess:r=>{let i=ks(r.agent.id,r.file.name);t.setQueryData([`admin-agent-markdown`,e.token,r.agent.id,r.file.name],r),t.invalidateQueries({queryKey:[`admin-agents`,e.token]}),x.current=i,S.current=r.file.content,b(r.file.content),n.success(`Saved ${r.file.name} for ${r.agent.name||r.agent.id}.`)},onError:e=>{n.error(`Save failed`,H(e))}}),ee=g({mutationFn:async()=>{if(!w||!s||!l)throw Error(`Select a version to restore first.`);return Ct(e.token,{agentId:w.id,fileName:s,revisionId:l})},onSuccess:r=>{let i=ks(r.agent.id,r.file.name);t.setQueryData([`admin-agent-markdown`,e.token,r.agent.id,r.file.name],r),t.invalidateQueries({queryKey:[`admin-agents`,e.token]}),x.current=i,S.current=r.file.content,b(r.file.content),n.success(`Restored ${r.file.name} from version history.`)},onError:e=>{n.error(`Restore failed`,H(e))}}),L=g({mutationFn:async()=>{if(!d)throw Error(`Select a team revision to restore first.`);return yt(e.token,d)},onSuccess:r=>{t.setQueryData([`admin-team-structure`,e.token],r),t.invalidateQueries({queryKey:[`admin-agents`,e.token]}),f(null),n.success(`Restored team structure from revision history.`)},onError:e=>{n.error(`Team restore failed`,H(e))}}),te=D.data?v!==D.data.file.content:!1,ne=D.data?.file.revisions||[],re=ne.slice(0,p),ie=Math.max(0,ne.length-p),ae=P.data?.revisions||[],oe=ae.slice(0,h),se=Math.max(0,ae.length-h);return(0,B.jsx)(`div`,{className:`page-stack`,children:(0,B.jsx)(U,{variant:`muted`,children:C.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading agents...`}):C.data?.length?w?s?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Agent`}),(0,B.jsx)(vs,{value:w.id,onChange:e=>{a(e.target.value),u(null)},children:C.data.map(e=>(0,B.jsx)(Q,{value:e.id,children:e.name||e.id},e.id))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Markdown file`}),(0,B.jsxs)(vs,{value:s,onChange:e=>{c(e.target.value),u(null),m(Ns)},children:[k?.map(e=>(0,B.jsx)(Q,{value:e.name,children:As(e)},e.name)),A?.length?(0,B.jsx)(ys,{label:`Shared memory`,children:A.map(e=>(0,B.jsx)(Q,{value:e.name,children:As(e)},e.name))}):null]})]})]}),T?(0,B.jsx)(`div`,{className:`agent-file-meta`,children:(0,B.jsx)(`p`,{className:`supporting-text agent-file-meta-line`,children:O?.exists?O.readOnly?`${O.cloudPath||O.path} · read-only cloud memory cache`:O.updatedAt?`Last updated ${io(O.updatedAt)} · ${ao(O.updatedAt)} · ${O.path}`:O.path:O?.readOnly?`Shared memory has not synced to this agent yet`:`File not created yet`})}):null,D.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading markdown file...`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{className:`field textarea-field`,children:[(0,B.jsx)(`span`,{className:`agent-file-editor-title`,children:M}),(0,B.jsx)(ts,{className:`code-editor`,rows:28,readOnly:j,value:v,onChange:e=>b(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{type:`button`,loading:I.isPending,disabled:j||I.isPending||!D.data||!te,onClick:()=>I.mutate(),children:I.isPending?`Saving...`:`Save Markdown`}),(0,B.jsx)(Z,{variant:`ghost`,type:`button`,disabled:!D.data||I.isPending||!te||j,onClick:()=>{let e=D.data?.file.content||``;E&&(x.current=E),S.current=e,b(e)},children:`Reset to Disk`}),(0,B.jsx)(`p`,{className:`supporting-text`,children:j?O?.exists?`Read-only cloud memory cache.`:`Waiting for cloud memory sync.`:te?`Unsaved changes.`:T?.exists?`Disk copy loaded.`:`Saving will create this file in the agent workspace.`})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Versions`}),(0,B.jsx)(vo,{children:`${D.data?.file.revisions.length||0} saved revision${D.data?.file.revisions.length===1?``:`s`}`})]}),(0,B.jsx)(K,{children:D.data?.file.revisions.length?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:re.map(e=>(0,B.jsx)(`button`,{className:e.id===l?`selectable-row active`:`selectable-row`,type:`button`,onClick:()=>u(e.id),children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:ao(e.createdAt)}),(0,B.jsxs)(`small`,{children:[io(e.createdAt),` ·`,` `,e.source,` · `,e.sizeBytes,` `,`bytes`]})]})},e.id))}),ie>0?(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsxs)(Z,{variant:`outline`,size:`sm`,type:`button`,onClick:()=>m(e=>Math.min(e+Ns,ne.length)),children:[`Show`,` `,Math.min(Ns,ie),` `,`more`]})}):null]}):(0,B.jsx)(`div`,{className:`empty-state`,children:j?`Shared memory files are read-only and do not have local revisions.`:`Revisions appear here after the file changes.`})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Version Preview`})}),(0,B.jsx)(K,{children:l?N.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading version...`}):N.data?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsx)(`span`,{children:ao(N.data.revision.createdAt)}),(0,B.jsxs)(`p`,{children:[N.data.revision.sha256.slice(0,16),` `,`· `,N.data.revision.source]})]}),(0,B.jsxs)(`label`,{className:`field textarea-field`,children:[(0,B.jsx)(`span`,{children:`Saved content`}),(0,B.jsx)(ts,{className:`code-editor`,rows:14,readOnly:!0,value:N.data.revision.content})]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{type:`button`,loading:ee.isPending,disabled:ee.isPending,onClick:()=>ee.mutate(),children:ee.isPending?`Restoring...`:`Restore Version`}),(0,B.jsx)(Z,{variant:`ghost`,type:`button`,onClick:()=>b(N.data?.revision.content||``),children:`Copy to Editor`})]})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Version details are unavailable.`}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Select a saved version to preview or restore it.`})})]})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Team Revisions`}),(0,B.jsx)(vo,{children:`${P.data?.revisions.length||0} saved revision${P.data?.revisions.length===1?``:`s`}`})]}),(0,B.jsx)(K,{children:P.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading team revisions...`}):P.data?.revisions.length?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:oe.map(e=>(0,B.jsx)(`button`,{className:e.id===d?`selectable-row active`:`selectable-row`,type:`button`,onClick:()=>f(e.id),children:(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`strong`,{children:[`#`,e.id,` ·`,` `,ao(e.createdAt)]}),(0,B.jsxs)(`small`,{children:[io(e.createdAt),` ·`,` `,e.changeCount,` change`,e.changeCount===1?``:`s`,` ·`,` `,e.route]})]})},e.id))}),se>0?(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsxs)(Z,{variant:`outline`,size:`sm`,type:`button`,onClick:()=>_(e=>Math.min(e+Ns,ae.length)),children:[`Show`,` `,Math.min(Ns,se),` `,`more`]})}):null]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Team revisions appear here after org-chart changes.`})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Team Diff`})}),(0,B.jsx)(K,{children:d?F.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading team revision...`}):F.data?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsxs)(`span`,{children:[`Revision #`,F.data.revision.id]}),(0,B.jsxs)(`p`,{children:[F.data.revision.md5.slice(0,16),` `,`· `,F.data.revision.source]})]}),(0,B.jsxs)(`label`,{className:`field textarea-field`,children:[(0,B.jsx)(`span`,{children:`Diff`}),(0,B.jsx)(ts,{className:`code-editor`,rows:10,readOnly:!0,value:Ms(F.data.revision.diff)})]}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{type:`button`,loading:L.isPending,disabled:L.isPending,onClick:()=>L.mutate(),children:L.isPending?`Restoring...`:`Restore Team`})})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Team revision details are unavailable.`}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Select a team revision to inspect its diff.`})})]})]})]})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`This agent does not expose editable markdown files.`}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Select an agent to edit its files.`}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No agents are registered yet.`})})})}function Fs(e){console.error(`Navigation failed:`,e)}var Is=[{key:`all`,label:`All`},{key:`active`,label:`Active`},{key:`idle`,label:`Idle`},{key:`stopped`,label:`Stopped`}];function Ls(e){return e.model||`Inherited default`}function Rs(e){return e.sessionCount?`${e.sessionCount} total · ${e.activeSessions} active · ${e.idleSessions} idle · ${e.stoppedSessions} stopped`:`No persisted sessions`}function zs(e){return`Chatbot ${e.chatbotId?.trim()||`none`} · RAG ${e.enableRag==null?`inherit`:e.enableRag?`on`:`off`}`}function Bs(e){return e.channelName&&e.channelName!==e.channelId?`${e.channelName} · ${e.channelId}`:e.channelId||`unknown`}function Vs(e){return`is-${e}`}function Hs(e){return(0,B.jsxs)(`span`,{className:`agents-status-badge ${Vs(e.status)}`,children:[(0,B.jsx)(`span`,{className:`agents-status-badge-dot`,"aria-hidden":`true`}),e.status]})}function Us(e){let t=e.toLowerCase();return e.startsWith(`$`)?`is-command`:t.includes(`error`)||t.includes(`failed`)?`is-error`:t.includes(`idle`)||t.includes(`waiting`)?`is-warning`:t.includes(`healthy`)||t.includes(`success`)?`is-success`:``}function Ws(e,t){let n=new Map;return t.map(t=>{let r=(n.get(t)??0)+1;return n.set(t,r),{key:`${e}-${r}-${t}`,line:t}})}function Gs(e){let t=(0,R.useMemo)(()=>Ws(e.sessionId,e.output),[e.sessionId,e.output]);return(0,B.jsxs)(`div`,{className:`agents-terminal`,children:[(0,B.jsxs)(`div`,{className:`agents-terminal-top`,children:[(0,B.jsx)(`span`,{className:`agents-terminal-dot is-red`}),(0,B.jsx)(`span`,{className:`agents-terminal-dot is-yellow`}),(0,B.jsx)(`span`,{className:`agents-terminal-dot is-green`}),(0,B.jsx)(`span`,{className:`agents-terminal-label`,children:e.title})]}),(0,B.jsx)(`div`,{className:`agents-session-output`,children:t.map(({key:e,line:t})=>(0,B.jsx)(`span`,{className:`agents-terminal-line ${Us(t)}`,children:t},e))})]})}var Ks=(0,R.memo)(Gs,(e,t)=>e.sessionId===t.sessionId&&e.title===t.title&&e.output.length===t.output.length&&e.output.every((e,n)=>e===t.output[n]));function qs(){let e=Zn(),t=j(),n=Aa(e.token),[r,i]=(0,R.useState)(`all`),[a,o]=(0,R.useState)(new Set),s=y({queryKey:[`agents-overview`,e.token],queryFn:()=>ft(e.token),refetchInterval:15e3}),c=s.data,l=(0,R.useMemo)(()=>{let e=c?.sessions||[];return r===`all`?e:e.filter(e=>e.status===r)},[r,c?.sessions]);function u(e){o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}if(s.isLoading&&!c)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading agents...`});if(s.isError&&!c)return(0,B.jsx)(`div`,{className:`empty-state error`,children:`Agent overview unavailable.`});if(!c)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Agent overview unavailable.`});let d=c.totals.sessions,f={all:d.all,active:d.active,idle:d.idle,stopped:d.stopped};return(0,B.jsxs)(`div`,{className:`page-stack agents-dashboard`,children:[(0,B.jsxs)(`header`,{className:`agents-page-header`,children:[(0,B.jsxs)(`div`,{className:`agents-title-row`,children:[(0,B.jsx)(`h1`,{children:`Agents`}),(0,B.jsxs)(`button`,{className:s.isFetching?`agents-refresh-chip is-spinning`:`agents-refresh-chip`,type:`button`,onClick:()=>void s.refetch(),children:[(0,B.jsx)(`span`,{className:`agents-refresh-spinner`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:c?`Last refresh ${ao(c.generatedAt)}`:`Loading agents`})]}),c?(0,B.jsxs)(`span`,{className:`agents-uptime-chip`,children:[`uptime `,oo(c.uptime)]}):null]}),(0,B.jsx)(Ia,{items:n})]}),(0,B.jsxs)(`div`,{className:`agents-stats-row`,children:[(0,B.jsxs)(`div`,{className:`agents-stat-card`,children:[(0,B.jsx)(`span`,{className:`agents-metric-accent is-green`,children:`A`}),(0,B.jsx)(`span`,{children:`Agents`}),(0,B.jsx)(`strong`,{children:c.totals.agents.all}),(0,B.jsxs)(`small`,{children:[c.totals.agents.active,` active`]})]}),(0,B.jsxs)(`div`,{className:`agents-stat-card`,children:[(0,B.jsx)(`span`,{className:`agents-metric-accent is-blue`,children:`S`}),(0,B.jsx)(`span`,{children:`Sessions Live`}),(0,B.jsx)(`strong`,{children:d.running}),(0,B.jsxs)(`small`,{children:[d.all,` total`]})]}),(0,B.jsxs)(`div`,{className:`agents-stat-card`,children:[(0,B.jsx)(`span`,{className:`agents-metric-accent is-gold`,children:`T`}),(0,B.jsx)(`span`,{children:`Tokens Used`}),(0,B.jsx)(`strong`,{children:$a(d.totalTokens)}),(0,B.jsx)(`small`,{children:to({inputTokens:d.totalInputTokens,outputTokens:d.totalOutputTokens})})]}),(0,B.jsxs)(`div`,{className:`agents-stat-card`,children:[(0,B.jsx)(`span`,{className:`agents-metric-accent is-slate`,children:`$`}),(0,B.jsx)(`span`,{children:`Total Cost`}),(0,B.jsx)(`strong`,{children:ro(d.totalCostUsd)}),(0,B.jsxs)(`small`,{children:[`Ralph `,c.ralph?.enabled?`enabled`:`disabled`]})]})]}),(0,B.jsxs)(`section`,{className:`agents-dashboard-panel`,children:[(0,B.jsx)(`div`,{className:`agents-section-head`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{children:`Registered Agents`}),(0,B.jsxs)(`p`,{children:[c.agents.length.toString(),` workspace`,c.agents.length===1?``:`s`,` aggregated across every bound session.`]})]})}),(0,B.jsx)(`div`,{children:c.agents.length?(0,B.jsx)(`div`,{className:`agents-overview-grid`,children:c.agents.map(e=>(0,B.jsxs)(`article`,{className:`agents-overview-card ${Vs(e.status)}`,children:[(0,B.jsxs)(`div`,{className:`agents-overview-card-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{children:e.name||e.id}),(0,B.jsx)(`p`,{children:Rs(e)}),e.recentSessionId?(0,B.jsx)(`div`,{className:`agents-tag-row`,children:(0,B.jsxs)(`span`,{className:`agents-tag`,children:[`Recent `,e.recentSessionId]})}):null]}),(0,B.jsx)(Hs,{status:e.status})]}),(0,B.jsxs)(`div`,{className:`agents-meta-grid`,children:[(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Default Model`}),(0,B.jsx)(`strong`,{children:Ls(e)})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Session Models`}),(0,B.jsx)(`strong`,{children:e.effectiveModels.length?e.effectiveModels.join(`, `):`none`})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Workspace`}),(0,B.jsx)(`strong`,{children:e.workspacePath})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Token I/O`}),(0,B.jsx)(`strong`,{children:to({inputTokens:e.inputTokens,outputTokens:e.outputTokens})})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Cost`}),(0,B.jsx)(`strong`,{children:ro(e.costUsd)})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Chatbot / RAG`}),(0,B.jsx)(`strong`,{children:zs(e)})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Last Active`}),(0,B.jsx)(`strong`,{children:ao(e.lastActive)})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Messages / Tools`}),(0,B.jsxs)(`strong`,{children:[e.messageCount,` msgs / `,e.toolCalls,` calls`]})]})]})]},e.id))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No agents found.`})})]}),(0,B.jsxs)(`section`,{className:`agents-dashboard-panel`,children:[(0,B.jsx)(`div`,{className:`agents-section-head`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{children:`Sessions`}),(0,B.jsxs)(`p`,{children:[l.length,` visible of `,d.all,` persisted per-channel and per-client sessions.`]})]})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`agents-filter-row`,role:`tablist`,"aria-label":`Session filters`,children:Is.map(e=>(0,B.jsxs)(`button`,{className:r===e.key?`agents-filter-pill is-active`:`agents-filter-pill`,type:`button`,role:`tab`,"aria-selected":r===e.key,onClick:()=>i(e.key),children:[e.label,(0,B.jsx)(`span`,{className:`agents-filter-count`,children:f[e.key]})]},e.key))}),l.length?(0,B.jsx)(`div`,{className:`agents-session-list`,children:l.map(e=>{let n=a.has(e.id),r=e.output.length?e.output:[`No recent activity captured for this session yet.`];return(0,B.jsxs)(`article`,{className:`agents-session-card ${Vs(e.status)}`,children:[(0,B.jsxs)(`div`,{className:`agents-overview-card-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{children:e.name}),(0,B.jsx)(`p`,{children:e.task}),e.fullAutoEnabled?(0,B.jsx)(`span`,{className:`agents-fullauto-badge`,children:`Full auto`}):null]}),(0,B.jsx)(Hs,{status:e.status})]}),(e.lastQuestion||e.lastAnswer)&&(0,B.jsxs)(`div`,{className:`agents-preview`,children:[e.lastQuestion?(0,B.jsxs)(`p`,{children:[(0,B.jsx)(`span`,{children:`Q`}),e.lastQuestion]}):null,e.lastAnswer?(0,B.jsxs)(`p`,{children:[(0,B.jsx)(`span`,{children:`A`}),e.lastAnswer]}):null]}),(0,B.jsxs)(`div`,{className:`agents-meta-grid`,children:[(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Model`}),(0,B.jsx)(`strong`,{children:e.model})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Agent`}),(0,B.jsx)(`strong`,{children:e.agentId})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Session ID`}),(0,B.jsx)(`strong`,{children:e.sessionId})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Channel`}),(0,B.jsx)(`strong`,{children:Bs(e)})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Runtime`}),(0,B.jsxs)(`strong`,{children:[e.runtimeMinutes,`m`]})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Token I/O`}),(0,B.jsx)(`strong`,{children:to({inputTokens:e.inputTokens,outputTokens:e.outputTokens})})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Cost`}),(0,B.jsx)(`strong`,{children:ro(e.costUsd)})]}),(0,B.jsxs)(`div`,{className:`agents-meta-block`,children:[(0,B.jsx)(`span`,{children:`Last Active`}),(0,B.jsx)(`strong`,{children:io(e.lastActive)})]})]}),n?(0,B.jsx)(Ks,{sessionId:e.id,title:e.previewTitle,output:r}):null,(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,onClick:()=>{t({to:`/admin/sessions`,search:{sessionId:e.id}}).catch(Fs)},children:`Open Session`}),(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,onClick:()=>u(e.id),children:n?`Hide Output`:`Show Output`})]})]},e.id)})}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No sessions match this filter.`})]})]})]})}function Js(e){let t=Zn(),n=o(),r=Ss(),[i,a]=(0,R.useState)(``),s=g({mutationFn:e=>yn(t.token,e),onSuccess:()=>{a(``),n.invalidateQueries({queryKey:[`admin-approvals`,t.token]}),n.invalidateQueries({queryKey:[`jobs-context`,t.token]}),e.onResumed?.(),r.success(`Blocked session resumed.`)},onError:e=>{r.error(`Failed to resume blocked session`,H(e))}});function c(t){if(t.kind===`code`&&!t.value.trim()){r.error(`Code required`,`Enter the operator-provided code first.`);return}s.mutate({sessionId:e.session.sessionId,response:t})}return(0,B.jsxs)(`div`,{className:`button-row`,children:[e.session.expectedReturnKinds.includes(`code`)?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`input`,{"aria-label":`Code for ${e.session.sessionId}`,value:i,disabled:s.isPending,placeholder:`Code`,onChange:e=>a(e.target.value)}),(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:s.isPending,onClick:()=>c({kind:`code`,value:i.trim()}),children:`Resume`})]}):null,e.session.expectedReturnKinds.includes(`approved`)?(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:s.isPending,onClick:()=>c({kind:`approved`}),children:`Approved`}):null,e.session.expectedReturnKinds.includes(`scanned`)?(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:s.isPending,onClick:()=>c({kind:`scanned`}),children:`Scanned`}):null,e.session.expectedReturnKinds.includes(`declined`)?(0,B.jsx)(`button`,{className:`danger-button`,type:`button`,disabled:s.isPending,onClick:()=>c({kind:`declined`}),children:`Decline`}):null,e.session.expectedReturnKinds.includes(`timeout`)?(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,disabled:s.isPending,onClick:()=>c({kind:`timeout`}),children:`Timeout`}):null]})}function Ys(e){let t=[`once`];return e.allowSession&&t.push(`session`),e.allowAgent&&t.push(`agent`),e.allowAll&&t.push(`all`),t.join(`, `)}function Xs(e){return e.comment&&e.managedByPreset?`${e.comment} · preset:${e.managedByPreset}`:e.comment?e.comment:e.managedByPreset?`preset:${e.managedByPreset}`:``}function Zs(e){return{action:`allow`,host:``,port:`*`,methods:`*`,paths:`/**`,agent:e||`*`,comment:``}}function Qs(e){return{action:e.action,host:e.host,port:String(e.port),methods:e.methods.join(`, `),paths:e.paths.join(`, `),agent:e.agent,comment:e.comment||``}}function $s(e,t){let n=e.split(`,`).map(e=>e.trim()).filter(Boolean);return n.length>0?n:t}function ec(e){let t=e.trim();if(!t||t===`*`)return`*`;if(!/^\d+$/.test(t))throw Error("Port must be `*` or a whole number from 1 to 65535.");let n=Number(t);if(!Number.isSafeInteger(n)||n<=0||n>65535)throw Error("Port must be `*` or a whole number from 1 to 65535.");return n}function tc(e){let t=e.host.trim();if(!t)throw Error(`Host is required.`);let n=e.agent.trim()||`*`,r=e.comment.trim();return{action:e.action,host:t,port:ec(e.port),methods:$s(e.methods,[`*`]),paths:$s(e.paths,[`/**`]),agent:n,...r?{comment:r}:{}}}function nc(){let e=Zn(),t=o(),n=Ss(),[r,i]=(0,R.useState)(``),[a,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(null),[u,d]=(0,R.useState)(null),[f,p]=(0,R.useState)(null),[m,h]=(0,R.useState)(()=>Zs(`main`)),_=y({queryKey:[`admin-approvals`,e.token,r],queryFn:()=>vn(e.token,r?{agentId:r}:void 0)}),v=r||_.data?.selectedAgentId||`main`,b=_.data?.agents||[];(0,R.useEffect)(()=>{l(null),d(null),h(Zs(v))},[v]);function x(){l(null),d(null),h(Zs(v))}function S(){l(`create`),d(null),h(Zs(v))}let C=g({mutationFn:t=>bn(e.token,{agentId:v,...t.index==null?{}:{index:t.index},rule:t.rule}),onSuccess:(r,i)=>{x(),t.invalidateQueries({queryKey:[`admin-approvals`,e.token]}),n.success(i.index==null?`Policy rule added.`:`Rule #${i.index} updated.`)},onError:(e,t)=>{n.error(t.index==null?`Failed to add rule`:`Failed to update rule`,H(e))}}),w=g({mutationFn:t=>wn(e.token,{agentId:v,index:t}),onSuccess:(r,i)=>{u===i&&x(),t.invalidateQueries({queryKey:[`admin-approvals`,e.token]}),n.success(`Rule #${i} deleted.`)},onError:(e,t)=>{n.error(`Failed to delete rule #${t}`,H(e))}}),T=g({mutationFn:t=>Cn(e.token,{agentId:v,presetName:t}),onSuccess:(r,i)=>{t.invalidateQueries({queryKey:[`admin-approvals`,e.token]}),n.success(`Template '${i}' applied.`)},onError:e=>{n.error(`Failed to apply template`,H(e))}}),E=g({mutationFn:t=>xn(e.token,{agentId:v,defaultAction:t}),onSuccess:(r,i)=>{t.invalidateQueries({queryKey:[`admin-approvals`,e.token]}),n.success(`Default policy set to ${i}.`)},onError:e=>{n.error(`Failed to update default policy`,H(e))}}),D=g({mutationFn:t=>Sn(e.token,{agentId:v,mode:t}),onSuccess:(r,i)=>{t.invalidateQueries({queryKey:[`admin-approvals`,e.token]}),n.success(`LAN HTTP access set to ${i}.`)},onError:e=>{n.error(`Failed to update LAN HTTP access`,H(e))}});function O(e){e.preventDefault();try{C.mutate({index:u,rule:tc(m)})}catch(e){n.error(`Invalid policy rule`,H(e))}}function k(e){l(`edit`),d(e.index),h(Qs(e))}function A(e){p(e)}let j=_.data?.policy.rules||[],M=(_.data?.availablePresets||[]).filter(e=>!_.data?.policy.presets.includes(e.name)).sort((e,t)=>e.name.localeCompare(t.name)),N=C.isPending||w.isPending||E.isPending||D.isPending||T.isPending,P=c!==null,F=E.isPending&&E.variables?E.variables:_.data?.policy.defaultAction||`deny`,I=D.isPending&&D.variables?D.variables:_.data?.policy.lanHttpAccess?.mode||`off`;return(0,R.useEffect)(()=>{s(e=>e&&M.some(t=>t.name===e)?e:M[0]?.name||``)},[M]),(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{actions:(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Policy agent`}),(0,B.jsx)(vs,{value:v,disabled:_.isLoading&&b.length===0,onChange:e=>i(e.target.value),children:b.length?b.map(e=>(0,B.jsx)(Q,{value:e.id,children:e.name?`${e.name} (${e.id})`:e.id},e.id)):(0,B.jsx)(Q,{value:v,children:`Loading agents...`})})]})}),(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Xa,{label:`Pending approvals`,value:String(_.data?.pending.length??0),loading:!_.data}),(0,B.jsx)(Xa,{label:`Blocked sessions`,value:String(_.data?.suspendedSessions.length??0),loading:!_.data}),(0,B.jsx)(Xa,{label:`Policy rules`,value:String(j.length),loading:!_.data}),(0,B.jsx)(Xa,{label:`Applied presets`,value:String(_.data?.policy.presets.length??0),loading:!_.data}),(0,B.jsxs)(`div`,{className:`metric-card`,children:[(0,B.jsx)(`span`,{children:`Default policy`}),(0,B.jsx)(`div`,{className:`field`,children:(0,B.jsxs)(vs,{value:F,disabled:!_.data||N,onChange:e=>E.mutate(e.target.value===`allow`?`allow`:`deny`),children:[(0,B.jsx)(Q,{value:`deny`,children:`deny`}),(0,B.jsx)(Q,{value:`allow`,children:`allow`})]})})]}),(0,B.jsxs)(`div`,{className:`metric-card`,children:[(0,B.jsx)(`span`,{children:`LAN HTTP access`}),(0,B.jsx)(`div`,{className:`field`,children:(0,B.jsxs)(`select`,{"aria-label":`LAN HTTP access`,value:I,disabled:!_.data||N,onChange:e=>{let t=e.target.value;if(t===`custom`){S();return}D.mutate(t)},children:[(0,B.jsx)(`option`,{value:`off`,children:`Off`}),(0,B.jsx)(`option`,{value:`read-only`,children:`Read-only LAN`}),(0,B.jsx)(`option`,{value:`read-write`,children:`Read-write LAN`}),(0,B.jsx)(`option`,{value:`custom`,children:`Custom`})]})})]})]}),(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Policy`})}),(0,B.jsx)(K,{children:_.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading policy...`}):_.data?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[j.length?(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{className:`policy-rules-table`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`#`}),(0,B.jsx)(`th`,{children:`Action`}),(0,B.jsx)(`th`,{children:`Host`}),(0,B.jsx)(`th`,{children:`Port`}),(0,B.jsx)(`th`,{children:`Methods`}),(0,B.jsx)(`th`,{children:`Paths`}),(0,B.jsx)(`th`,{children:`Agent`}),(0,B.jsx)(`th`,{children:`Comment`}),(0,B.jsx)(`th`,{children:`Actions`})]})}),(0,B.jsx)(`tbody`,{children:j.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:e.index}),(0,B.jsx)(`td`,{children:(0,B.jsx)(`strong`,{children:e.action.toUpperCase()})}),(0,B.jsx)(`td`,{children:e.host}),(0,B.jsx)(`td`,{children:String(e.port)}),(0,B.jsx)(`td`,{children:e.methods.join(`, `)}),(0,B.jsx)(`td`,{children:e.paths.join(`, `)}),(0,B.jsx)(`td`,{children:e.agent}),(0,B.jsx)(`td`,{children:Xs(e)}),(0,B.jsx)(`td`,{children:(0,B.jsxs)(`div`,{className:`policy-table-actions`,children:[(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,disabled:N,onClick:()=>k(e),children:`Edit`}),(0,B.jsx)(`button`,{className:`danger-button`,type:`button`,disabled:N,onClick:()=>A(e),children:`Delete`})]})})]},`${e.index}:${e.host}:${e.agent}`))})]})}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No policy rules found.`}),(0,B.jsxs)(`div`,{className:`policy-action-row`,children:[(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:N,onClick:S,children:`New rule`}),(0,B.jsxs)(`div`,{className:`policy-template-actions`,children:[(0,B.jsxs)(`label`,{className:`policy-template-inline`,children:[(0,B.jsx)(`span`,{children:`Template:`}),(0,B.jsx)(vs,{value:a,disabled:N||M.length===0,onChange:e=>s(e.target.value),children:M.length>0?M.map(e=>(0,B.jsx)(Q,{value:e.name,children:e.name},e.name)):(0,B.jsx)(Q,{value:``,children:`No templates available`})})]}),(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,disabled:N||!a,onClick:()=>T.mutate(a),children:`Add template`})]})]}),P?(0,B.jsxs)(`form`,{className:`config-section detail-stack`,onSubmit:O,children:[(0,B.jsx)(`strong`,{children:c===`edit`&&u!=null?`Edit rule #${u}`:`Add rule`}),(0,B.jsxs)(`div`,{className:`field-grid policy-editor-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Action`}),(0,B.jsxs)(vs,{value:m.action,disabled:N,onChange:e=>h(t=>({...t,action:e.target.value===`deny`?`deny`:`allow`})),children:[(0,B.jsx)(Q,{value:`allow`,children:`allow`}),(0,B.jsx)(Q,{value:`deny`,children:`deny`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Host`}),(0,B.jsx)(Y,{value:m.host,disabled:N,placeholder:`example.com`,onChange:e=>h(t=>({...t,host:e.target.value}))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Port`}),(0,B.jsx)(Y,{value:m.port,disabled:N,placeholder:`*`,onChange:e=>h(t=>({...t,port:e.target.value}))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Methods`}),(0,B.jsx)(Y,{value:m.methods,disabled:N,placeholder:`*`,onChange:e=>h(t=>({...t,methods:e.target.value}))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Paths`}),(0,B.jsx)(Y,{value:m.paths,disabled:N,placeholder:`/**`,onChange:e=>h(t=>({...t,paths:e.target.value}))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Agent`}),(0,B.jsx)(Y,{value:m.agent,disabled:N,placeholder:`*`,onChange:e=>h(t=>({...t,agent:e.target.value}))})]}),(0,B.jsxs)(`label`,{className:`field policy-comment-field`,children:[(0,B.jsx)(`span`,{children:`Comment`}),(0,B.jsx)(ts,{rows:2,value:m.comment,disabled:N,placeholder:`Optional note`,onChange:e=>h(t=>({...t,comment:e.target.value}))})]})]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(`button`,{className:`primary-button`,type:`submit`,disabled:N,children:C.isPending?(0,B.jsxs)(`span`,{className:`button-with-spinner`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`button-spinner`}),c===`edit`?`Saving...`:`Adding...`]}):c===`edit`?`Save changes`:`Save`}),(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,disabled:N,onClick:x,children:`Cancel`})]})]}):null]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Policy state is unavailable.`})})]}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Blocked sessions`})}),(0,B.jsx)(K,{children:_.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading blocked sessions...`}):_.data?.suspendedSessions.length?(0,B.jsx)(`div`,{className:`list-stack`,children:_.data.suspendedSessions.map(e=>(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Status`}),(0,B.jsx)(`strong`,{children:e.blockedLabel})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Modality`}),(0,B.jsx)(`strong`,{children:e.modality})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Agent`}),(0,B.jsx)(`strong`,{children:e.agentId||`unknown`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Host`}),(0,B.jsx)(`strong`,{children:e.context.host||`unknown`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Created`}),(0,B.jsx)(`strong`,{title:ao(e.createdAt),children:io(e.createdAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Expires`}),(0,B.jsx)(`strong`,{title:ao(e.expiresAt),children:io(e.expiresAt)})]})]}),(0,B.jsx)(`p`,{className:`supporting-text`,children:e.prompt}),(0,B.jsx)(Js,{session:e})]},e.sessionId))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No blocked sessions right now.`})})]}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Pending approvals`})}),(0,B.jsx)(K,{children:_.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading pending approvals...`}):_.data?.pending.length?(0,B.jsx)(`div`,{className:`list-stack`,children:_.data.pending.map(e=>(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Approval`}),(0,B.jsx)(`strong`,{children:e.actionKey||e.approvalId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Agent`}),(0,B.jsx)(`strong`,{children:e.agentId||`unknown`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Session`}),(0,B.jsx)(`strong`,{children:e.sessionId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Trust scopes`}),(0,B.jsx)(`strong`,{children:Ys({allowSession:e.allowSession,allowAgent:e.allowAgent,allowAll:e.allowAll})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Created`}),(0,B.jsx)(`strong`,{title:ao(e.createdAt),children:io(e.createdAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Expires`}),(0,B.jsx)(`strong`,{title:ao(e.expiresAt),children:io(e.expiresAt)})]})]}),(0,B.jsx)(`p`,{className:`supporting-text`,children:e.prompt})]},e.approvalId))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No pending approvals right now.`})})]})]}),(0,B.jsx)(ui,{open:f!==null,onOpenChange:e=>{e||p(null)},children:(0,B.jsxs)(di,{size:`sm`,role:`alertdialog`,children:[(0,B.jsxs)(fi,{children:[(0,B.jsx)(pi,{children:`Delete policy rule?`}),(0,B.jsx)(mi,{children:f?`This will remove rule #${f.index} for ${f.host}.`:`This will remove the selected policy rule.`})]}),(0,B.jsxs)(hi,{children:[(0,B.jsx)(gi,{className:`ghost-button`,children:`Cancel`}),(0,B.jsx)(gi,{className:`danger-button`,onClick:()=>{f&&w.mutate(f.index)},children:`Delete`})]})]})})]})}var rc={page:`_page_rr4vj_1`,toolbar:`_toolbar_rr4vj_8`,searchRow:`_searchRow_rr4vj_16`,searchWrap:`_searchWrap_rr4vj_23`,searchIcon:`_searchIcon_rr4vj_31`,searchInput:`_searchInput_rr4vj_41`,shortcutHint:`_shortcutHint_rr4vj_47`,timeRange:`_timeRange_rr4vj_64`,meta:`_meta_rr4vj_106`,chipRow:`_chipRow_rr4vj_117`,categoryChip:`_categoryChip_rr4vj_128`,activeRow:`_activeRow_rr4vj_211`,activeChip:`_activeChip_rr4vj_224`,activeChipRemove:`_activeChipRemove_rr4vj_242`,clearAll:`_clearAll_rr4vj_263`,tableWrap:`_tableWrap_rr4vj_284`,table:`_table_rr4vj_284`,colTime:`_colTime_rr4vj_344`,colEvent:`_colEvent_rr4vj_349`,colSession:`_colSession_rr4vj_353`,colSeq:`_colSeq_rr4vj_359`,colId:`_colId_rr4vj_360`,colRun:`_colRun_rr4vj_368`,mono:`_mono_rr4vj_378`,eventPill:`_eventPill_rr4vj_382`,empty:`_empty_rr4vj_442`,loadMoreRow:`_loadMoreRow_rr4vj_449`,loadMore:`_loadMore_rr4vj_449`,sheet:`_sheet_rr4vj_485`,sheetHeader:`_sheetHeader_rr4vj_492`,sheetHeaderMain:`_sheetHeaderMain_rr4vj_501`,sheetHeaderId:`_sheetHeaderId_rr4vj_508`,sheetClose:`_sheetClose_rr4vj_514`,sheetBody:`_sheetBody_rr4vj_538`,sheetMeta:`_sheetMeta_rr4vj_547`,payloadSection:`_payloadSection_rr4vj_571`,payloadHeader:`_payloadHeader_rr4vj_578`,payloadBlock:`_payloadBlock_rr4vj_589`},ic=[`session`,`turn`,`onboarding`,`model`,`tool`,`autonomy`,`authorization`,`approval`,`a2a`],ac=new Set(ic),oc=[{value:`all`,label:`All`},{value:`1h`,label:`1h`},{value:`24h`,label:`24h`},{value:`7d`,label:`7d`}],sc=new Set(oc.map(e=>e.value)),cc={"1h":3600*1e3,"24h":1440*60*1e3,"7d":10080*60*1e3};function lc(e){let t=e.split(`.`,1)[0]??``;return ac.has(t)?t:`default`}function uc(e,t=Date.now()){if(e!==`all`)return new Date(t-cc[e]).toISOString()}function dc(e){return e&&sc.has(e)?e:`all`}var fc={session:`session`,type:`type`,event:`type`};function pc(e){let t=[],n=``,r=!1;for(let i of e){if(i===`"`){r=!r,n+=i;continue}if(!r&&/\s/.test(i)){n&&=(t.push(n),``);continue}n+=i}return n&&t.push(n),t}function mc(e){return e.length>=2&&e.startsWith(`"`)&&e.endsWith(`"`)?e.slice(1,-1):e.startsWith(`"`)?e.slice(1):e.endsWith(`"`)?e.slice(0,-1):e}function hc(e){let t=e.indexOf(`:`);if(t>0){let n=fc[e.slice(0,t).toLowerCase()];if(n)return{kind:`field`,key:n,value:mc(e.slice(t+1)),raw:e}}return{kind:`text`,value:mc(e),raw:e}}function gc(e){let t=pc(e).map(hc),n=``,r=``,i=[];for(let e of t)e.kind===`field`?e.key===`session`?n=e.value:r=e.value:e.value&&i.push(e.value);return{sessionId:n,eventType:r,query:i.join(` `)}}function _c(e,t){return pc(e).map(hc).filter(e=>!(e.kind===`field`&&e.key===t)).map(e=>e.raw).join(` `)}function vc(e,t,n){let r=n.trim(),i=_c(e,t);if(!r)return i;let a=`${t}:${/\s/.test(r)?`"${r}"`:r}`;return i?`${i} ${a}`:a}var yc=200;function bc(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function xc(e){if(!e)return null;let t=lc(e);return t==="default"?null:t}function Sc(){let e=Zn(),t=j(),n=ee({strict:!1}),r=n.q??``,i=dc(n.range),[a,o]=(0,R.useState)(r),[s,c]=(0,R.useState)(i),[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)(!1),p=(0,R.useRef)(null),m=(0,R.useRef)(null),g=(0,R.useRef)(n.q),_=(0,R.useRef)(n.range),v=(0,R.useMemo)(()=>gc(a),[a]),{query:y,sessionId:b,eventType:S}=(0,R.useDeferredValue)(v);(0,R.useEffect)(()=>{let e=a.trim()||void 0,n=s===`all`?void 0:s;e===g.current&&n===_.current||(g.current=e,_.current=n,t({to:`/admin/audit`,search:{q:e,range:n},replace:!0}).catch(Fs))},[t,a,s]),(0,R.useEffect)(()=>{n.q!==g.current&&(g.current=n.q,o(n.q??``)),n.range!==_.current&&(_.current=n.range,c(dc(n.range)))},[n.q,n.range]),(0,R.useEffect)(()=>{function e(e){if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target,n=t?.tagName;n===`INPUT`||n===`TEXTAREA`||t?.isContentEditable||(e.preventDefault(),p.current?.focus(),p.current?.select())}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let[C,w]=(0,R.useState)(()=>Date.now()),T=(0,R.useRef)(0);(0,R.useEffect)(()=>{if(s===`all`)return;w(Date.now());let e=window.setInterval(()=>{T.current>1||w(Date.now())},3e4);return()=>window.clearInterval(e)},[s]);let E=(0,R.useMemo)(()=>uc(s,C),[s,C]),D=x({queryKey:[`audit`,e.token,y,b,S,E],initialPageParam:void 0,queryFn:({pageParam:t})=>_n(e.token,{query:y,sessionId:b,eventType:S,since:E,cursor:t,limit:yc}),getNextPageParam:e=>e.nextCursor??void 0,placeholderData:h}),O=(0,R.useRef)(D);O.current=D,T.current=D.data?.pages.length??0,(0,R.useEffect)(()=>{let e=m.current;if(!e||!D.hasNextPage)return;let t=new IntersectionObserver(([e])=>{let t=O.current;e?.isIntersecting&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},{rootMargin:`400px`});return t.observe(e),()=>t.disconnect()},[D.hasNextPage]);let k=(0,R.useMemo)(()=>D.data?.pages.flatMap(e=>e.entries)??[],[D.data]),A=D.data?.pages[0]?.total??k.length,M=(0,R.useMemo)(()=>xc(v.eventType),[v.eventType]),N=!!(v.query||v.sessionId||v.eventType||s!==`all`);function P(e){u(e),f(!0)}function F(e,t){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),P(t))}let I=(0,R.useCallback)(e=>{o(t=>e===null||xc(gc(t).eventType)===e?_c(t,`type`):vc(t,`type`,e))},[]);function L(){o(e=>_c(e,`session`))}function te(){o(e=>_c(e,`type`))}function ne(){o(``),c(`all`)}return(0,B.jsxs)(`div`,{className:rc.page,children:[(0,B.jsxs)(`div`,{className:rc.toolbar,children:[(0,B.jsxs)(`div`,{className:rc.searchRow,children:[(0,B.jsxs)(`div`,{className:rc.searchWrap,children:[(0,B.jsx)(Mr,{className:rc.searchIcon,"aria-hidden":`true`}),(0,B.jsx)(Y,{ref:p,className:rc.searchInput,value:a,onChange:e=>o(e.target.value),placeholder:`Search payloads… try session:web type:tool`,"aria-label":`Audit search`,spellCheck:!1,autoComplete:`off`}),(0,B.jsx)(`span`,{className:rc.shortcutHint,"data-hidden":a?`true`:void 0,"aria-hidden":`true`,children:`/`})]}),(0,B.jsx)(`div`,{className:rc.timeRange,role:`toolbar`,"aria-label":`Time range`,children:oc.map(e=>{let t=s===e.value;return(0,B.jsx)(`button`,{type:`button`,"aria-pressed":t,"data-active":t||void 0,onClick:()=>c(e.value),children:e.label},e.value)})}),(0,B.jsx)(`div`,{className:rc.meta,"aria-live":`polite`,children:D.isLoading?`Loading…`:`${A} event${A===1?``:`s`}`})]}),(0,B.jsxs)(`div`,{className:rc.chipRow,role:`toolbar`,"aria-label":`Event category`,children:[(0,B.jsx)(`button`,{type:`button`,className:rc.categoryChip,"data-category":`all`,"aria-pressed":M===null,"data-active":M===null||void 0,onClick:()=>I(null),children:`all`}),ic.map(e=>{let t=M===e;return(0,B.jsx)(`button`,{type:`button`,className:rc.categoryChip,"data-category":e,"aria-pressed":t,"data-active":t||void 0,onClick:()=>I(e),children:e},e)})]}),(0,B.jsxs)(`div`,{className:rc.activeRow,"data-empty":N?void 0:`true`,children:[v.sessionId?(0,B.jsxs)(`span`,{className:rc.activeChip,children:[(0,B.jsx)(`strong`,{children:`session:`}),v.sessionId,(0,B.jsx)(`button`,{type:`button`,className:rc.activeChipRemove,"aria-label":`Remove session filter ${v.sessionId}`,onClick:L,children:`×`})]}):null,v.eventType?(0,B.jsxs)(`span`,{className:rc.activeChip,children:[(0,B.jsx)(`strong`,{children:`type:`}),v.eventType,(0,B.jsx)(`button`,{type:`button`,className:rc.activeChipRemove,"aria-label":`Remove event type filter ${v.eventType}`,onClick:te,children:`×`})]}):null,s===`all`?null:(0,B.jsxs)(`span`,{className:rc.activeChip,children:[(0,B.jsx)(`strong`,{children:`last:`}),s,(0,B.jsx)(`button`,{type:`button`,className:rc.activeChipRemove,"aria-label":`Reset time range`,onClick:()=>c(`all`),children:`×`})]}),N?(0,B.jsx)(`button`,{type:`button`,className:rc.clearAll,onClick:ne,children:`Clear all`}):null]})]}),(0,B.jsxs)(`div`,{className:rc.tableWrap,children:[(0,B.jsxs)(`table`,{className:rc.table,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{scope:`col`,children:`Time`}),(0,B.jsx)(`th`,{scope:`col`,children:`Event`}),(0,B.jsx)(`th`,{scope:`col`,children:`Session`}),(0,B.jsx)(`th`,{scope:`col`,"data-col":`run`,children:`Run`}),(0,B.jsx)(`th`,{scope:`col`,className:rc.colSeq,children:`Seq`}),(0,B.jsx)(`th`,{scope:`col`,className:rc.colId,children:`ID`})]})}),(0,B.jsx)(`tbody`,{children:k.map(e=>{let t=lc(e.eventType);return(0,B.jsxs)(`tr`,{role:`button`,tabIndex:0,"data-selected":e.id===l?.id||void 0,"aria-label":`Inspect audit event ${e.id} (${e.eventType})`,onClick:()=>P(e),onKeyDown:t=>F(t,e),children:[(0,B.jsx)(`td`,{className:rc.colTime,title:ao(e.timestamp),children:io(e.timestamp)}),(0,B.jsx)(`td`,{className:rc.colEvent,children:(0,B.jsx)(`span`,{className:rc.eventPill,"data-category":t,children:e.eventType})}),(0,B.jsx)(`td`,{className:rc.colSession,title:e.sessionId,children:(0,B.jsx)(`span`,{className:rc.mono,children:e.sessionId})}),(0,B.jsx)(`td`,{className:rc.colRun,title:e.runId,children:e.runId}),(0,B.jsx)(`td`,{className:rc.colSeq,children:e.seq}),(0,B.jsxs)(`td`,{className:rc.colId,children:[`#`,e.id]})]},e.id)})})]}),k.length===0?(0,B.jsx)(`div`,{className:rc.empty,children:D.isLoading?`Loading audit entries…`:`No audit entries match these filters.`}):null,D.hasNextPage?(0,B.jsx)(`div`,{ref:m,className:rc.loadMoreRow,children:(0,B.jsx)(`button`,{type:`button`,className:rc.loadMore,onClick:()=>{D.fetchNextPage()},disabled:D.isFetchingNextPage,children:D.isFetchingNextPage?`Loading…`:`Load more`})}):null]}),(0,B.jsx)(ui,{open:d,onOpenChange:f,isDrawer:!0,children:(0,B.jsxs)(di,{side:`right`,className:rc.sheet,children:[(0,B.jsx)(fi,{children:(0,B.jsx)(pi,{children:l?`Audit event #${l.id} (${l.eventType})`:`Audit event`})}),l?(0,B.jsx)(Cc,{entry:l,onClose:()=>f(!1)}):null]})})]})}function Cc({entry:e,onClose:t}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:rc.sheetHeader,children:[(0,B.jsxs)(`div`,{className:rc.sheetHeaderMain,children:[(0,B.jsx)(`span`,{className:rc.eventPill,"data-category":lc(e.eventType),children:e.eventType}),(0,B.jsxs)(`span`,{className:rc.sheetHeaderId,children:[`#`,e.id,` · `,ao(e.timestamp)]})]}),(0,B.jsx)(`button`,{type:`button`,className:rc.sheetClose,"aria-label":`Close inspector`,onClick:t,children:`×`})]}),(0,B.jsxs)(`div`,{className:rc.sheetBody,children:[(0,B.jsxs)(`dl`,{className:rc.sheetMeta,children:[(0,B.jsx)(`dt`,{children:`Session`}),(0,B.jsx)(`dd`,{children:e.sessionId}),(0,B.jsx)(`dt`,{children:`Run ID`}),(0,B.jsx)(`dd`,{children:e.runId}),(0,B.jsx)(`dt`,{children:`Parent run`}),(0,B.jsx)(`dd`,{children:e.parentRunId||`—`}),(0,B.jsx)(`dt`,{children:`Seq`}),(0,B.jsx)(`dd`,{children:e.seq}),(0,B.jsx)(`dt`,{children:`Timestamp`}),(0,B.jsx)(`dd`,{children:ao(e.timestamp)})]}),(0,B.jsxs)(`section`,{className:rc.payloadSection,children:[(0,B.jsx)(`div`,{className:rc.payloadHeader,children:(0,B.jsx)(`span`,{children:`Payload`})}),(0,B.jsx)(`pre`,{className:rc.payloadBlock,children:bc(e.payload)})]})]})]})}function wc(e){switch(e.kind){case`discord`:case`discord_webhook`:return(0,B.jsx)(`span`,{className:`channel-logo`,"aria-hidden":`true`,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 32 32`,"aria-hidden":`true`,focusable:`false`,children:[(0,B.jsx)(`rect`,{x:`3`,y:`3`,width:`26`,height:`26`,rx:`9`,fill:`#5865F2`}),(0,B.jsx)(`path`,{fill:`#FFFFFF`,d:`M10.6 21.7c1.5 1 3.3 1.7 5.1 1.9l.6-1.1c1 .2 2 .2 3 0l.6 1.1c1.9-.2 3.6-.9 5.1-1.9.3-3.2-.4-6.2-2-8.9a11.4 11.4 0 0 0-4.1-1.8l-.5 1a12.2 12.2 0 0 0-3.5 0l-.5-1a11.4 11.4 0 0 0-4.1 1.8c-1.6 2.7-2.3 5.7-2 8.9Z`}),(0,B.jsx)(`circle`,{cx:`13.6`,cy:`16.9`,r:`1.25`,fill:`#5865F2`}),(0,B.jsx)(`circle`,{cx:`18.4`,cy:`16.9`,r:`1.25`,fill:`#5865F2`})]})});case`whatsapp`:return(0,B.jsx)(`span`,{className:`channel-logo`,"aria-hidden":`true`,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 32 32`,"aria-hidden":`true`,focusable:`false`,children:[(0,B.jsx)(`circle`,{cx:`16`,cy:`16`,r:`13`,fill:`#25D366`}),(0,B.jsx)(`path`,{fill:`#FFFFFF`,d:`M16 8.1a7.5 7.5 0 0 0-6.4 11.5l-.8 3 3.1-.8A7.5 7.5 0 1 0 16 8.1Zm0 13.3a5.8 5.8 0 0 1-3-.8l-.4-.2-1.8.5.5-1.7-.3-.4a5.8 5.8 0 1 1 5 2.6Z`}),(0,B.jsx)(`path`,{fill:`#25D366`,d:`M13.2 12.3c-.2 0-.4.1-.5.4-.3.4-.7 1-.7 1.8s.7 1.7.8 1.8c.1.1 1.5 2.3 3.6 3.2 1.8.8 2.2.7 2.6.6.4-.1 1.2-.5 1.4-1 .1-.5.1-.8.1-.9 0-.1-.2-.2-.5-.3l-1.4-.7c-.2-.1-.4-.1-.5.1l-.6.8c-.1.1-.3.2-.5.1-.3-.1-1-.4-1.9-1.2-.8-.7-1.2-1.5-1.4-1.7-.1-.3 0-.4.1-.5l.4-.5c.1-.1.1-.3.2-.4s0-.3 0-.4l-.6-1.5c-.1-.3-.3-.4-.5-.4Z`})]})});case`telegram`:return(0,B.jsx)(`span`,{className:`channel-logo`,"aria-hidden":`true`,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 32 32`,"aria-hidden":`true`,focusable:`false`,children:[(0,B.jsx)(`circle`,{cx:`16`,cy:`16`,r:`13`,fill:`#27A7E7`}),(0,B.jsx)(`path`,{fill:`#FFFFFF`,d:`m23.4 10.2-2.3 11c-.2 1-.8 1.3-1.6.8l-3.5-2.6-1.7 1.6c-.2.2-.4.4-.7.4l.3-3.7 6.8-6.1c.3-.3-.1-.4-.4-.2l-8.4 5.3-3.6-1.1c-.8-.2-.8-.8.2-1.2l14-5.4c.7-.3 1.2.2 1 .9Z`})]})});case`threema`:return(0,B.jsx)(`span`,{className:`channel-logo`,"aria-hidden":`true`,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 32 32`,"aria-hidden":`true`,focusable:`false`,children:[(0,B.jsx)(`rect`,{x:`3`,y:`3`,width:`26`,height:`26`,rx:`8`,fill:`#F4C430`}),(0,B.jsx)(`path`,{fill:`#111827`,d:`M10 13.6h2.2v-1.5c0-2.3 1.7-4.1 3.8-4.1s3.8 1.8 3.8 4.1v1.5H22c.7 0 1.2.5 1.2 1.2v7.9c0 .7-.5 1.2-1.2 1.2H10c-.7 0-1.2-.5-1.2-1.2v-7.9c0-.7.5-1.2 1.2-1.2Zm4.1 0h3.8v-1.5c0-1.2-.8-2.1-1.9-2.1s-1.9.9-1.9 2.1v1.5Z`})]})});case`signal`:return(0,B.jsx)(`span`,{className:`channel-logo channel-logo-compact`,"aria-hidden":`true`,children:(0,B.jsx)(`svg`,{viewBox:`0 0 128 128`,"aria-hidden":`true`,focusable:`false`,children:(0,B.jsx)(`path`,{fill:`#3A76F0`,d:`M48.64,1.87l1.44,5.82A57.84,57.84,0,0,0,34,14.34L30.92,9.2A63.76,63.76,0,0,1,48.64,1.87Zm30.72,0L77.92,7.69A57.84,57.84,0,0,1,94,14.34l3.1-5.14A63.76,63.76,0,0,0,79.36,1.87ZM9.2,30.92A63.76,63.76,0,0,0,1.87,48.64l5.82,1.44A57.84,57.84,0,0,1,14.34,34ZM6,64a57.9,57.9,0,0,1,.65-8.69l-5.93-.9a64.23,64.23,0,0,0,0,19.18l5.93-.9A57.9,57.9,0,0,1,6,64Zm91.08,54.8L94,113.66a57.84,57.84,0,0,1-16.06,6.65l1.44,5.82A63.76,63.76,0,0,0,97.08,118.8ZM122,64a57.9,57.9,0,0,1-.65,8.69l5.93.9a64.23,64.23,0,0,0,0-19.18l-5.93.9A57.9,57.9,0,0,1,122,64Zm4.13,15.36-5.82-1.44A57.84,57.84,0,0,1,113.66,94l5.14,3.1A63.76,63.76,0,0,0,126.13,79.36Zm-53.44,42a58.41,58.41,0,0,1-17.38,0l-.9,5.93a64.23,64.23,0,0,0,19.18,0Zm38-22.95A58.21,58.21,0,0,1,98.4,110.69l3.56,4.83A64.1,64.1,0,0,0,115.52,102ZM98.4,17.31A58.21,58.21,0,0,1,110.69,29.6L115.52,26A64.1,64.1,0,0,0,102,12.48ZM17.31,29.6A58.21,58.21,0,0,1,29.6,17.31L26,12.48A64.1,64.1,0,0,0,12.48,26ZM118.8,30.92,113.66,34a57.84,57.84,0,0,1,6.65,16.06l5.82-1.44A63.76,63.76,0,0,0,118.8,30.92ZM55.31,6.65a58.41,58.41,0,0,1,17.38,0l.9-5.93a64.23,64.23,0,0,0-19.18,0ZM20.39,117.11,8,120l2.89-12.39-5.84-1.37L2.16,118.63a6,6,0,0,0,7.21,7.21L21.75,123ZM6.3,100.89l5.84,1.36,2-8.59A57.75,57.75,0,0,1,7.69,77.92L1.87,79.36a63.52,63.52,0,0,0,5.9,15.21Zm28,13-8.59,2,1.36,5.84,6.32-1.47a63.52,63.52,0,0,0,15.21,5.9l1.44-5.82A57.75,57.75,0,0,1,34.34,113.85ZM64,12A52,52,0,0,0,20,91.67L15,113l21.33-5A52,52,0,1,0,64,12Z`})})});case`voice`:return(0,B.jsx)(`span`,{className:`channel-logo`,"aria-hidden":`true`,children:(0,B.jsx)(`svg`,{viewBox:`0 0 100 30`,"aria-hidden":`true`,focusable:`false`,fill:`#F22F46`,children:(0,B.jsx)(`path`,{d:`M14.4 11.3c0 1.7-1.4 3.1-3.1 3.1S8.2 13 8.2 11.3s1.4-3.1 3.1-3.1 3.1 1.4 3.1 3.1zm-3.1 4.3c-1.7 0-3.1 1.4-3.1 3.1s1.4 3.1 3.1 3.1 3.1-1.4 3.1-3.1-1.4-3.1-3.1-3.1zM30 15c0 8.3-6.7 15-15 15S0 23.3 0 15 6.7 0 15 0s15 6.7 15 15zm-4 0c0-6.1-4.9-11-11-11S4 8.9 4 15s4.9 11 11 11 11-4.9 11-11zm-7.3.6c-1.7 0-3.1 1.4-3.1 3.1s1.4 3.1 3.1 3.1 3.1-1.4 3.1-3.1-1.4-3.1-3.1-3.1zm0-7.4c-1.7 0-3.1 1.4-3.1 3.1s1.4 3.1 3.1 3.1 3.1-1.4 3.1-3.1-1.4-3.1-3.1-3.1zm51.6-2.3c.1 0 .2.1.3.2v3.2c0 .2-.2.3-.3.3H65c-.2 0-.3-.2-.3-.3V6.2c0-.2.2-.3.3-.3h5.3zm-.1 4.5H60c-.1 0-.3.1-.3.3l-1.3 5-.1.3-1.6-5.3c0-.1-.2-.3-.3-.3h-4c-.1 0-.3.1-.3.3l-1.5 5-.1.3-.1-.3-.6-2.5-.6-2.5c0-.1-.2-.3-.3-.3h-8V6.1c0-.1-.2-.3-.4-.2l-5 1.6c-.2 0-.3.1-.3.3v2.7h-1.3c-.1 0-.3.1-.3.3v3.8c0 .1.1.3.3.3h1.3v4.7c0 3.3 1.8 4.8 5.1 4.8 1.4 0 2.7-.3 3.6-.8v-4c0-.2-.2-.3-.3-.2-.5.2-1 .3-1.4.3-.9 0-1.4-.4-1.4-1.4v-3.4h2.9c.1 0 .3-.1.3-.3v-3.2L47.8 24c0 .1.2.3.3.3h4.2c.1 0 .3-.1.3-.3l1.8-5.6.9 2.9.8 2.7c0 .1.2.3.3.3h4.2c.1 0 .3-.1.3-.3l3.8-12.6V24c0 .1.1.3.3.3h5.1c.1 0 .3-.1.3-.3V10.7c0-.1-.1-.3-.2-.3zm6.7-4.5h-5.1c-.1 0-.3.1-.3.3v17.7c0 .1.1.3.3.3h5.1c.1 0 .3-.1.3-.3V6.1c0-.1-.1-.2-.3-.2zm6.8 0h-5.3c-.1 0-.3.1-.3.3v3.1c0 .1.1.3.3.3h5.3c.1 0 .3-.1.3-.3V6.1c0-.1-.1-.2-.3-.2zm-.1 4.5h-5.1c-.1 0-.3.1-.3.3v13.1c0 .1.1.3.3.3h5.1c.1 0 .3-.1.3-.3V10.7c0-.1-.1-.3-.3-.3zm16.1 6.8c0 3.8-3.2 7.1-7.7 7.1-4.4 0-7.6-3.3-7.6-7.1s3.2-7.1 7.7-7.1c4.4 0 7.6 3.3 7.6 7.1zm-5.4.1c0-1.4-1-2.5-2.2-2.4-1.3 0-2.2 1.1-2.2 2.4s1 2.4 2.2 2.4c1.3 0 2.2-1.1 2.2-2.4z`})})});case`email`:return(0,B.jsx)(`span`,{className:`channel-logo`,"aria-hidden":`true`,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 32 32`,"aria-hidden":`true`,focusable:`false`,children:[(0,B.jsx)(`rect`,{x:`3`,y:`5`,width:`26`,height:`22`,rx:`6`,fill:`#2563EB`}),(0,B.jsx)(`path`,{fill:`#FFFFFF`,d:`M8 10.5h16v11H8z`}),(0,B.jsx)(`path`,{d:`m8.8 11.6 7.2 5.2 7.2-5.2`,fill:`none`,stroke:`#2563EB`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,B.jsx)(`path`,{d:`m8.8 20.8 5.5-4.6m8.9 4.6-5.5-4.6`,fill:`none`,stroke:`#93C5FD`,strokeWidth:`1.4`,strokeLinecap:`round`})]})});case`slack`:case`slack_webhook`:return(0,B.jsx)(`span`,{className:`channel-logo channel-logo-compact`,"aria-hidden":`true`,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 127 127`,"aria-hidden":`true`,focusable:`false`,children:[(0,B.jsx)(`path`,{fill:`#E01E5A`,d:`M27.2 80c0 7.3-5.9 13.2-13.2 13.2C6.7 93.2.8 87.3.8 80c0-7.3 5.9-13.2 13.2-13.2h13.2V80zm6.6 0c0-7.3 5.9-13.2 13.2-13.2 7.3 0 13.2 5.9 13.2 13.2v33c0 7.3-5.9 13.2-13.2 13.2-7.3 0-13.2-5.9-13.2-13.2V80z`}),(0,B.jsx)(`path`,{fill:`#36C5F0`,d:`M47 27c-7.3 0-13.2-5.9-13.2-13.2C33.8 6.5 39.7.6 47 .6c7.3 0 13.2 5.9 13.2 13.2V27H47zm0 6.7c7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2H13.9C6.6 60.1.7 54.2.7 46.9c0-7.3 5.9-13.2 13.2-13.2H47z`}),(0,B.jsx)(`path`,{fill:`#2EB67D`,d:`M99.9 46.9c0-7.3 5.9-13.2 13.2-13.2 7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2H99.9V46.9zm-6.6 0c0 7.3-5.9 13.2-13.2 13.2-7.3 0-13.2-5.9-13.2-13.2V13.8C66.9 6.5 72.8.6 80.1.6c7.3 0 13.2 5.9 13.2 13.2v33.1z`}),(0,B.jsx)(`path`,{fill:`#ECB22E`,d:`M80.1 99.8c7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2-7.3 0-13.2-5.9-13.2-13.2V99.8h13.2zm0-6.6c-7.3 0-13.2-5.9-13.2-13.2 0-7.3 5.9-13.2 13.2-13.2h33.1c7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2H80.1z`})]})});case`msteams`:return(0,B.jsx)(`span`,{className:`channel-logo`,"aria-hidden":`true`,children:(0,B.jsxs)(`svg`,{viewBox:`4 4 36 38`,"aria-hidden":`true`,focusable:`false`,fill:`none`,children:[(0,B.jsx)(`path`,{fill:`url(#teams-logo-a)`,d:`M21.9999 20h12c3.3137 0 6 2.6863 6 6v10c0 3.3137-2.6863 6-6 6s-6-2.6863-6-6V26c0-3.3137-2.6863-6-6-6`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-b)`,d:`M7.99988 24c0-3.3137 2.68632-6 6.00002-6h8c3.3137 0 6 2.6863 6 6v12c0 3.3137 2.6863 6 6 6l-16.0001-.0001c-5.5228 0-9.99992-4.4771-9.99992-10z`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-c)`,fillOpacity:`.7`,d:`M7.99988 24c0-3.3137 2.68632-6 6.00002-6h8c3.3137 0 6 2.6863 6 6v12c0 3.3137 2.6863 6 6 6l-16.0001-.0001c-5.5228 0-9.99992-4.4771-9.99992-10z`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-d)`,fillOpacity:`.7`,d:`M7.99988 24c0-3.3137 2.68632-6 6.00002-6h8c3.3137 0 6 2.6863 6 6v12c0 3.3137 2.6863 6 6 6l-16.0001-.0001c-5.5228 0-9.99992-4.4771-9.99992-10z`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-e)`,d:`M32.9999 18c2.7614 0 5-2.2386 5-5s-2.2386-5-5-5-5 2.2386-5 5 2.2386 5 5 5`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-f)`,fillOpacity:`.46`,d:`M32.9999 18c2.7614 0 5-2.2386 5-5s-2.2386-5-5-5-5 2.2386-5 5 2.2386 5 5 5`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-g)`,fillOpacity:`.4`,d:`M32.9999 18c2.7614 0 5-2.2386 5-5s-2.2386-5-5-5-5 2.2386-5 5 2.2386 5 5 5`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-h)`,d:`M17.9999 16c3.3137 0 6-2.6863 6-6 0-3.31371-2.6863-6-6-6s-6 2.68629-6 6c0 3.3137 2.6863 6 6 6`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-i)`,fillOpacity:`.6`,d:`M17.9999 16c3.3137 0 6-2.6863 6-6 0-3.31371-2.6863-6-6-6s-6 2.68629-6 6c0 3.3137 2.6863 6 6 6`}),(0,B.jsx)(`path`,{fill:`url(#teams-logo-j)`,fillOpacity:`.5`,d:`M17.9999 16c3.3137 0 6-2.6863 6-6 0-3.31371-2.6863-6-6-6s-6 2.68629-6 6c0 3.3137 2.6863 6 6 6`}),(0,B.jsx)(`rect`,{width:`16`,height:`16`,x:`4`,y:`23`,fill:`url(#teams-logo-k)`,rx:`3.25`}),(0,B.jsx)(`rect`,{width:`16`,height:`16`,x:`4`,y:`23`,fill:`url(#teams-logo-l)`,fillOpacity:`.7`,rx:`3.25`}),(0,B.jsx)(`path`,{fill:`#fff`,d:`M15.4792 28.1054h-2.4471v7.466h-2.0648v-7.466H8.52014v-1.6768h6.95906z`}),(0,B.jsxs)(`defs`,{children:[(0,B.jsxs)(`radialGradient`,{id:`teams-logo-a`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`matrix(13.4784 0 0 33.2694 39.7967 22.1739)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{stopColor:`#a98aff`}),(0,B.jsx)(`stop`,{offset:`.14`,stopColor:`#8c75ff`}),(0,B.jsx)(`stop`,{offset:`.565`,stopColor:`#5f50e2`}),(0,B.jsx)(`stop`,{offset:`.9`,stopColor:`#3c2cb8`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-b`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`rotate(68.1539 -7.71566095 14.71355834)scale(32.752 33.1231)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{stopColor:`#85c2ff`}),(0,B.jsx)(`stop`,{offset:`.69`,stopColor:`#7588ff`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#6459fe`})]}),(0,B.jsxs)(`linearGradient`,{id:`teams-logo-c`,x1:`20.5936`,x2:`20.5936`,y1:`18`,y2:`42`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`.801159`,stopColor:`#6864f6`,stopOpacity:`0`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#5149de`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-d`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`rotate(113.326 8.09285255 17.64474501)scale(19.2186 15.4273)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{stopColor:`#bd96ff`}),(0,B.jsx)(`stop`,{offset:`.686685`,stopColor:`#bd96ff`,stopOpacity:`0`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-e`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`matrix(0 -10 12.6216 0 32.9999 11.5714)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`.268201`,stopColor:`#6868f7`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#3923b1`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-f`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`rotate(40.0516 -.03068196 44.8729095)scale(7.14629 10.3363)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`.270711`,stopColor:`#a1d3ff`}),(0,B.jsx)(`stop`,{offset:`.813393`,stopColor:`#a1d3ff`,stopOpacity:`0`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-g`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`rotate(-41.6581 32.11799918 -43.41948423)scale(8.51275 20.8824)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{stopColor:`#e3acfd`}),(0,B.jsx)(`stop`,{offset:`.816041`,stopColor:`#9fa2ff`,stopOpacity:`0`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-h`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`matrix(0 -12 15.146 0 17.9999 8.28571)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`.268201`,stopColor:`#8282ff`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#3923b1`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-i`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`rotate(40.0516 -3.15465147 21.41641466)scale(8.57554 12.4035)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`.270711`,stopColor:`#a1d3ff`}),(0,B.jsx)(`stop`,{offset:`.813393`,stopColor:`#a1d3ff`,stopOpacity:`0`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-j`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`rotate(-41.6581 20.38180375 -26.51566158)scale(10.2153 25.0589)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{stopColor:`#e3acfd`}),(0,B.jsx)(`stop`,{offset:`.816041`,stopColor:`#9fa2ff`,stopOpacity:`0`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-k`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`rotate(45 -25.76345597 16.32842712)scale(22.6274)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`.046875`,stopColor:`#688eff`}),(0,B.jsx)(`stop`,{offset:`.946875`,stopColor:`#230f94`})]}),(0,B.jsxs)(`radialGradient`,{id:`teams-logo-l`,cx:`0`,cy:`0`,r:`1`,gradientTransform:`matrix(0 11.2 -13.0702 0 12 32.6)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`.570647`,stopColor:`#6965f6`,stopOpacity:`0`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#8f8fff`})]})]})]})});case`imessage`:return(0,B.jsx)(`span`,{className:`channel-logo`,"aria-hidden":`true`,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 32 32`,"aria-hidden":`true`,focusable:`false`,children:[(0,B.jsx)(`path`,{fill:`#34C759`,d:`M16 4.5c6.4 0 11.5 4.2 11.5 9.5 0 5.2-5.1 9.5-11.5 9.5-1 0-2-.1-2.9-.3L7.4 27l1.8-4.2C6.3 21 4.5 17.8 4.5 14c0-5.3 5.1-9.5 11.5-9.5Z`}),(0,B.jsx)(`path`,{fill:`#FFFFFF`,d:`M10.7 12.2h10.6c.6 0 1 .4 1 1s-.4 1-1 1H10.7c-.6 0-1-.4-1-1s.4-1 1-1Zm0 4.6h7.8c.6 0 1 .4 1 1s-.4 1-1 1h-7.8c-.6 0-1-.4-1-1s.4-1 1-1Z`})]})})}}function Tc(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!=`object`||typeof t!=`object`)return!1;if(e instanceof Date||t instanceof Date)return!(e instanceof Date)||!(t instanceof Date)?!1:e.getTime()===t.getTime();let n=Array.isArray(e),r=Array.isArray(t);if(n!==r)return!1;if(n&&r){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!Tc(e[n],t[n]))return!1;return!0}let i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(let n of i)if(!Object.hasOwn(t,n)||!Tc(e[n],t[n]))return!1;return!0}var Ec=new Set([`__proto__`,`prototype`,`constructor`]);function Dc(e){return Ec.has(e)}function Oc(e,t){if(e==null)return;let n=t.split(`.`),r=e;for(let e of n){if(typeof r!=`object`||!r||Dc(e))return;r=r[e]}return r}function kc(e,t,n){if(!t)throw Error(`setPath requires a non-empty path.`);let r=t.split(`.`);if(r.some(Dc))throw Error(`setPath rejected an unsafe path segment in "${t}".`);return jc(e,r,0,n)}function Ac(e){return Array.isArray(e)?[...e]:{...e}}function jc(e,t,n,r){let i=t[n],a=n===t.length-1,o=typeof e==`object`&&!!e;if(a){if(o&&e[i]===r)return e;let t=o?Ac(e):{};return t[i]=r,t}let s=o?e[i]:void 0,c=jc(s,t,n+1,r);if(o&&c===s)return e;let l=o?Ac(e):{};return l[i]=c,l}function Mc(e){let{source:t}=e,n=e.equals??Tc,[r,i]=(0,R.useState)(()=>t??null),a=(0,R.useRef)(t);(0,R.useEffect)(()=>{if(t===void 0)return;let e=a.current;if(a.current=t,r===null){i(t);return}e!==void 0&&!n(e,t)&&n(r,e)&&i(t)},[t,r,n]);let o=(0,R.useMemo)(()=>r===null||t===void 0?!1:!n(r,t),[r,t,n]),s=(0,R.useCallback)(()=>{t!==void 0&&i(t)},[t]),c=(0,R.useCallback)(e=>{i(e)},[]);return{draft:r,setDraft:i,setField:(0,R.useCallback)((e,t)=>{i(n=>n===null?n:kc(n,e,t))},[]),isDirty:o,discard:s,commit:c}}function $(e){let{form:t,name:n,rules:r,required:i,disabled:a,render:o,children:s}=e,c=So(),l=t??c;if(!l)throw Error("FormField requires either a `form` prop or to be nested inside <Form>.");let u=(0,R.useId)(),d=(0,R.useMemo)(()=>{let e=[];if(i&&e.push(Ro()),r)for(let t of r)typeof t==`function`&&e.push(t);return Bo(...e)},[i,r]),f=Oc(l.draft,n),p=d(f),m=(0,R.useCallback)(e=>{l.setField(n,Nc(e))},[l,n]),h=(0,R.useCallback)(()=>d(Oc(l.draft,n)),[l,n,d]),g=(0,R.useMemo)(()=>({name:n,value:f,id:u,onChange:m,"aria-required":i?!0:void 0,disabled:a}),[n,f,u,m,i,a]),_=(0,R.useMemo)(()=>({error:p,invalid:p!==null}),[p]),v=(0,R.useMemo)(()=>({name:n,id:u,error:p,validate:h,required:i,disabled:a}),[n,u,p,h,i,a]),y=o?.({field:g,fieldState:_})??(typeof s==`function`?s({field:g,fieldState:_}):s);return(0,B.jsx)(Co.Provider,{value:v,children:y})}function Nc(e){if(typeof e!=`object`||!e)return e;let t=e;if(!t.target||typeof t.target!=`object`)return e;let n=t.target;return n.type===`checkbox`?n.checked??!1:`value`in n?n.value:e}function Pc(e){let[t,n]=(0,R.useState)(()=>new Map),[r,i]=(0,R.useState)(0),a=(0,R.useRef)(new Map),o=(0,R.useRef)(new Map),s=(0,R.useRef)(t);s.current=t;let c=(0,R.useCallback)((e,t)=>{n(n=>{if(t===null){if(!n.has(e))return n;let t=new Map(n);return t.delete(e),t}if(n.get(e)===t)return n;let r=new Map(n);return r.set(e,t),r})},[]),l=(0,R.useCallback)((e,t)=>(a.current.set(e,t),()=>{a.current.get(e)===t&&a.current.delete(e)}),[]),u=(0,R.useCallback)((e,t)=>(o.current.set(e,t),()=>{o.current.get(e)===t&&o.current.delete(e)}),[]),d=(0,R.useCallback)(()=>{let e=new Map(s.current);for(let[t,n]of a.current){let r=n();r===null?e.delete(t):e.set(t,r),c(t,r)}return e},[c]),f=(0,R.useCallback)(e=>{for(let[t,n]of Object.entries(e)){let e=o.current.get(t);e?e(n):c(t,n)}},[c]),p=(0,R.useCallback)(()=>{for(let e of o.current.values())e(null);n(e=>e.size===0?e:new Map)},[]),m=(0,R.useCallback)(()=>{n(e=>e.size===0?e:new Map),i(e=>e+1)},[]),h=(0,R.useMemo)(()=>({registerError:c,registerValidator:l,registerErrorSetter:u,validateAll:d,setErrors:f,clearErrors:p,reset:m,resetSeq:r,errors:t,isValid:t.size===0}),[c,l,u,d,f,p,m,r,t]),g=Mc({source:e?.source,equals:e?.equals});return e?{...h,...g}:h}function Fc({form:e,onSubmit:t,children:n,noValidate:r=!0,...i}){let[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(!1),l=(0,R.useRef)(e.validateAll);l.current=e.validateAll;let u=(0,R.useRef)(t);u.current=t;let d=(0,R.useRef)(!1),f=(0,R.useRef)(e.resetSeq);f.current!==e.resetSeq&&(f.current=e.resetSeq,a&&o(!1));let p=(0,R.useCallback)(e=>{if(e.preventDefault(),d.current)return;o(!0);let t=l.current();if(t.size>0){let e=Lc(t);if(e){let t=document.getElementById(e);t&&typeof t.focus==`function`&&t.focus()}return}let n=u.current?.();if(!Ic(n))return;d.current=!0,c(!0);let r=()=>{d.current=!1,c(!1)};n.then(r,r)},[]),m=(0,R.useMemo)(()=>({registerError:e.registerError,registerValidator:e.registerValidator,registerErrorSetter:e.registerErrorSetter}),[e.registerError,e.registerValidator,e.registerErrorSetter]),h=(0,R.useMemo)(()=>({isValid:e.isValid,errors:e.errors}),[e.isValid,e.errors]),g=(0,R.useMemo)(()=>({submitAttempted:a,resetSeq:e.resetSeq,isSubmitting:s}),[a,e.resetSeq,s]),_=(0,R.useMemo)(()=>{if(!(`setField`in e&&`draft`in e))return null;let t=e;return{draft:t.draft,setField:t.setField}},[e]);return(0,B.jsx)(xo.Provider,{value:_,children:(0,B.jsx)(To.Provider,{value:m,children:(0,B.jsx)(Eo.Provider,{value:h,children:(0,B.jsx)(Do.Provider,{value:g,children:(0,B.jsx)(`form`,{noValidate:r,...i,onSubmit:p,children:n})})})})})}function Ic(e){return typeof e==`object`&&!!e&&typeof e.then==`function`}function Lc(e){if(e.size===0)return;if(typeof document>`u`)return e.keys().next().value;let t=null;for(let n of e.keys()){let e=document.getElementById(n);e&&(t===null||(t.el.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)!==0)&&(t={id:n,el:e})}return t?.id??e.keys().next().value}function Rc({value:e,onValueChange:t,onErrorChange:n,integer:r,min:i,max:a,step:o,emptyValue:s,requiredMessage:c=`Required.`,...l}){let[u,d]=(0,R.useState)(()=>String(e)),f=(0,R.useRef)(u);f.current=u;let p=No(),m=bo(e=>{p.setError(e),n?.(e)});(0,R.useEffect)(()=>{let t=f.current;t.trim()===``&&s!==void 0&&e===s||Number(t)!==e&&(d(String(e)),m(null))},[e,s,m]);let h=e=>{if(e.trim()===``)return s===void 0?{error:c}:{value:s,error:null};let t=Number(e);return Number.isFinite(t)?r&&!Number.isInteger(t)?{error:`Enter a whole number.`}:i!==void 0&&t<i?{error:`Must be ≥ ${i}.`}:a!==void 0&&t>a?{error:`Must be ≤ ${a}.`}:{value:t,error:null}:{error:`Enter a valid number.`}};return(0,B.jsx)(Y,{...l,type:r?`number`:`text`,inputMode:r?`numeric`:`decimal`,min:i,max:a,step:r?o:void 0,value:u,onBlur:t=>{if(!r){let t=Number(u);Number.isFinite(t)||(d(String(e)),m(null))}l.onBlur?.(t)},onChange:e=>{let n=e.target.value;d(n);let r=h(n);m(r.error),r.error===null&&r.value!==void 0&&t(r.value)}})}var zc={root:`_root_tqjv2_1`,thumb:`_thumb_tqjv2_40`,sizeDefault:`_sizeDefault_tqjv2_50`,sizeSm:`_sizeSm_tqjv2_65`},Bc={default:zc.sizeDefault,sm:zc.sizeSm};function Vc({checked:e,onCheckedChange:t,disabled:n,size:r=`default`,className:i,onClick:a,name:o,value:s=`on`,required:c,...l}){let{required:u,...d}=Po({disabled:n,required:c,...l}),f=No(),p=e?`checked`:`unchecked`,m=d.disabled,h=n=>{m||(a?.(n),!n.defaultPrevented&&(f.setTouched(!0),t?.(!e)))};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{...d,type:`button`,role:`switch`,"aria-checked":e,"data-slot":`switch`,"data-state":p,"data-size":r,className:V(zc.root,Bc[r],i),onClick:h,children:(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`switch-thumb`,"data-state":p,className:zc.thumb})}),o&&e&&!m?(0,B.jsx)(`input`,{type:`hidden`,name:o,value:s}):null]})}function Hc(e){let t=o();return g({mutationFn:async t=>{try{return await e.mutationFn(t)}catch(e){throw e instanceof Error?e:Error(String(e),{cause:e})}},onSuccess:(n,r)=>{e.onSuccess?.(n,r);for(let n of e.invalidates??[])t.invalidateQueries({queryKey:n})},onError:(t,n)=>{e.onError?.(t,n)}})}var Uc=`hybridclaw_session`,Wc=new Set;function Gc(){try{return localStorage.getItem(Uc)??``}catch{return``}}function Kc(e){if(Gc()!==e){try{e?localStorage.setItem(Uc,e):localStorage.removeItem(Uc)}catch{}for(let e of Wc)e()}}var qc=`main`;function Jc(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}function Yc(){return`sess_${new Date().toISOString().slice(0,19).replace(/[-:]/g,``).replace(`T`,`_`)}_${Jc(4)}`}function Xc(){let e=`hybridclaw_user_id`,t=localStorage.getItem(e);if(t)return t;let n=`web-user-${Jc(4)}`;return localStorage.setItem(e,n),n}function Zc(e){Kc(e)}var Qc=0;function $c(){return Qc+=1,`local-${Qc}-${Date.now()}`}async function el(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}function tl(e){if(!e)return``;if(e.summary)return e.summary;let t=[];return e.intent&&t.push(`Approval needed for: ${e.intent}`),e.reason&&t.push(`Why: ${e.reason}`),t.push(`Approval ID: ${e.approvalId}`),t.join(`
4
+ `)}var nl={once:`/approve yes`,session:`/approve session`,agent:`/approve agent`,all:`/approve all`,deny:`/approve no`};function rl(e,t){let n=nl[e],r=t.trim();return/\s/.test(r)?null:r?`${n} ${r}`:n}function il(e){return(e.name??``).trim()||`clipboard${{"application/pdf":`.pdf`,"image/gif":`.gif`,"image/jpeg":`.jpg`,"image/png":`.png`,"image/webp":`.webp`,"text/plain":`.txt`}[(e.type??``).trim().toLowerCase()]??``}`}function al(e){let t=il(e);return e.name===t?e:new File([e],t,{type:e.type||`application/octet-stream`,lastModified:Number.isFinite(e.lastModified)?e.lastModified:Date.now()})}function ol(e){if(!e)return[];let t=[];for(let n of Array.from(e.files))t.push(al(n));if(t.length>0)return t;let n=new Set;for(let r of Array.from(e.items)){if(r.kind!==`file`)continue;let e=r.getAsFile();if(!e)continue;let i=al(e),a=`${i.name}:${i.size}:${i.type}:${i.lastModified}`;n.has(a)||(n.add(a),t.push(i))}return t}function sl(e){return Object.keys(e).length}function cl(e){return sl(e.discord.guilds)}function ll(e){return Object.values(e.discord.guilds).reduce((e,t)=>e+sl(t.channels),0)}function ul(e){return sl(e.msteams.teams)}function dl(e){return Object.values(e.msteams.teams).reduce((e,t)=>e+sl(t.channels),0)}function fl(e,t){let n=cl(e),r=ll(e),i=e.discord.commandsOnly||e.discord.groupPolicy!==`disabled`,a=t.discordTokenConfigured===!0,o=i&&a,s=o?`active`:o||a||n>0||r>0?`configured`:`available`;return{kind:`discord`,label:`Discord`,summary:`${so(n,`guild default`)} · ${so(r,`explicit override`)}`,statusTone:s,statusLabel:s===`active`?`active`:s===`configured`?`configured`:`available`}}function pl(e,t){let n=t.whatsappLinked===!0,r=e.whatsapp.dmPolicy!==`disabled`||e.whatsapp.groupPolicy!==`disabled`,i=n?r?`Linked device · groups ${e.whatsapp.groupPolicy}`:`Linked device available but transport is off`:r?`Link device to enable WhatsApp`:`WhatsApp transport is off`,a=n?r?`active`:`configured`:`available`;return{kind:`whatsapp`,label:`WhatsApp`,summary:i,statusTone:a,statusLabel:a===`active`?`active`:a===`configured`?`configured`:`available`}}function ml(e,t){let n=t.telegramTokenConfigured===!0,r=e.telegram.dmPolicy!==`disabled`||e.telegram.groupPolicy!==`disabled`,i=e.telegram.enabled&&n&&r,a=i||e.telegram.enabled||n||e.telegram.allowFrom.length>0||e.telegram.groupAllowFrom.length>0,o=i?`active`:a?`configured`:`available`;return{kind:`telegram`,label:`Telegram`,summary:`DM ${e.telegram.dmPolicy} · groups ${e.telegram.groupPolicy}`,statusTone:o,statusLabel:o===`active`?`active`:o===`configured`?`configured`:`available`}}function hl(e,t){let n=t.signalDaemonUrlConfigured===!0,r=t.signalAccountConfigured===!0,i=t.signalCliAvailable===!0,a=e.signal.dmPolicy!==`disabled`||e.signal.groupPolicy!==`disabled`,o=e.signal.enabled&&n&&r&&a,s=o||e.signal.enabled||n||r||i||e.signal.allowFrom.length>0||e.signal.groupAllowFrom.length>0,c=o?`active`:s?`configured`:`available`;return{kind:`signal`,label:`Signal`,summary:`DM ${e.signal.dmPolicy} · groups ${e.signal.groupPolicy}${i?` · QR ready`:``}`,statusTone:c,statusLabel:c===`active`?`active`:c===`configured`?`configured`:`available`}}function gl(e,t){let n=t.threemaSecretConfigured===!0,r=e.threema.enabled&&!!e.threema.identity&&n&&e.threema.dmPolicy!==`disabled`,i=r||e.threema.enabled||!!e.threema.identity||n||e.threema.allowFrom.length>0,a=r?`active`:i?`configured`:`available`;return{kind:`threema`,label:`Threema`,summary:e.threema.identity?`Gateway ${e.threema.identity} · DM ${e.threema.dmPolicy}`:`No Gateway identity configured yet`,statusTone:a,statusLabel:a===`active`?`active`:a===`configured`?`configured`:`available`}}function _l(e,t){let n=t.slackBotTokenConfigured===!0,r=t.slackAppTokenConfigured===!0,i=e.slack.enabled&&n&&r,a=i||e.slack.enabled||n||r||e.slack.allowFrom.length>0||e.slack.groupAllowFrom.length>0,o=i?`active`:a?`configured`:`available`;return{kind:`slack`,label:`Slack`,summary:`DM ${e.slack.dmPolicy} · channels ${e.slack.groupPolicy}`,statusTone:o,statusLabel:o===`active`?`active`:o===`configured`?`configured`:`available`}}function vl(e,t){let n=Object.keys(e.slackWebhook.webhooks).length,r=e.slackWebhook.enabled&&t.slackWebhookDefaultConfigured===!0,i=r||e.slackWebhook.enabled||n>0,a=r?`active`:i?`configured`:`available`;return{kind:`slack_webhook`,label:`Slack Incoming Webhook`,summary:n>0?`${so(n,`webhook target`)} · outbound only`:`No webhook targets configured yet`,statusTone:a,statusLabel:a===`active`?`active`:a===`configured`?`configured`:`available`}}function yl(e,t){let n=Object.keys(e.discordWebhook.webhooks).length,r=e.discordWebhook.enabled&&t.discordWebhookDefaultConfigured===!0,i=r||e.discordWebhook.enabled||n>0,a=r?`active`:i?`configured`:`available`;return{kind:`discord_webhook`,label:`Discord Incoming Webhook`,summary:n>0?`${so(n,`webhook target`)} · outbound only`:`No webhook targets configured yet`,statusTone:a,statusLabel:a===`active`?`active`:a===`configured`?`configured`:`available`}}function bl(e,t){let n=t.voiceAuthTokenConfigured===!0,r=e.voice.twilio.accountSid.trim(),i=e.voice.twilio.fromNumber.trim(),a=e.voice.enabled&&!!r&&!!i&&n,o=a||e.voice.enabled||!!r||!!i||n,s=a?`active`:o?`configured`:`available`;return{kind:`voice`,label:`Voice`,summary:`Twilio · webhook ${e.voice.webhookPath}`,statusTone:s,statusLabel:s===`active`?`active`:s===`configured`?`configured`:`available`}}function xl(e,t){let n=t.emailPasswordConfigured===!0,r=String(e.email.address||``).trim(),i=Array.isArray(e.email.accounts)?e.email.accounts:[],a=i.filter(e=>e.address||e.agentId),o=r.length>0&&a.some(e=>{let t=String(e.agentId||``).trim(),n=String(e.address||``).trim();return!t||t===`main`||n.toLowerCase()===r.toLowerCase()}),s=a.length+(r&&!o?1:0),c=i.some(e=>{let t=e.password;return(typeof t==`string`?t.trim().length>0:!!t?.id)&&!!e.agentId&&!!e.address&&!!e.imapHost&&!!e.smtpHost}),l=e.email.enabled&&(c||n&&!!e.email.address&&!!e.email.imapHost&&!!e.email.smtpHost),u=l||a.length>0||!!e.email.address||!!e.email.imapHost||!!e.email.smtpHost||e.email.allowFrom.length>0,d=l?`active`:u?`configured`:`available`;return{kind:`email`,label:`Email`,summary:s>0?`${s} mailbox${s===1?``:`es`}`:e.email.address||`No mailbox address configured yet`,statusTone:d,statusLabel:d===`active`?`active`:d===`configured`?`configured`:`available`}}function Sl(e){let t=ul(e),n=dl(e),r=e.msteams.enabled&&!!e.msteams.appId&&!!e.msteams.tenantId,i=r||e.msteams.enabled||!!e.msteams.appId||!!e.msteams.tenantId||t>0||n>0,a=r?`active`:i?`configured`:`available`;return{kind:`msteams`,label:`Microsoft Teams`,summary:`${so(t,`team default`)} · ${so(n,`channel override`)}`,statusTone:a,statusLabel:a===`active`?`active`:a===`configured`?`configured`:`available`}}function Cl(e,t){let n=e.imessage.backend===`bluebubbles`,r=t.imessagePasswordConfigured===!0,i=(n?e.imessage.enabled&&r&&e.imessage.serverUrl&&e.imessage.webhookPath:e.imessage.enabled&&e.imessage.cliPath&&e.imessage.dbPath)?`active`:`available`;return{kind:`imessage`,label:`iMessage`,summary:`${n?`Remote`:`Local`} backend · DM ${e.imessage.dmPolicy}`,statusTone:i,statusLabel:i===`active`?`active`:`available`}}function wl(e){switch(e.statusTone){case`active`:return 2;case`configured`:return 1;default:return 0}}function Tl(e,t={}){return[fl(e,t),yl(e,t),_l(e,t),vl(e,t),ml(e,t),hl(e,t),gl(e,t),bl(e,t),pl(e,t),xl(e,t),Sl(e),Cl(e,t)].sort((e,t)=>{let n=wl(t)-wl(e);return n===0?e.label.localeCompare(t.label):n})}function El(e){return e.discord.commandsOnly||e.discord.groupPolicy!==`disabled`}function Dl(e){return e.whatsapp.dmPolicy!==`disabled`||e.whatsapp.groupPolicy!==`disabled`}function Ol(e){return e.telegram.dmPolicy!==`disabled`||e.telegram.groupPolicy!==`disabled`}function kl(e){return(0,B.jsxs)(`label`,{className:`field textarea-field`,children:[(0,B.jsx)(`span`,{children:e.label}),(0,B.jsx)(ts,{rows:e.rows??3,value:lo(e.value),onChange:t=>e.onChange(co(t.target.value)),placeholder:e.placeholder})]})}var Al=`*`;function jl(e){return e.trim()||null}function Ml(e){let t=[];for(let n of e)!n||t.includes(n)||t.push(n);return t}function Nl(e){let[t,n]=(0,R.useState)(``),r=Ml(e.value),i=jl(t),a=i!==null,o=()=>{if(!i||i===Al&&!r.includes(Al)&&!window.confirm(`Adding * allows every sender for this allowlist. Continue?`))return;let t=Ml([...r,i]);e.onChange(t),e.onAdd?.(t),n(``)},s=t=>{e.onChange(r.filter(e=>e!==t))};return(0,B.jsxs)(q,{className:`allow-list-field`,children:[(0,B.jsx)(J,{children:e.label}),(0,B.jsxs)(`div`,{className:`allow-list-add-row`,children:[(0,B.jsx)(Y,{value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},placeholder:e.placeholder}),(0,B.jsx)(Z,{type:`button`,variant:`ghost`,disabled:!a,onClick:o,children:`Add`})]}),r.length>0?(0,B.jsx)(`ul`,{className:`allow-list-items`,children:r.map(e=>(0,B.jsxs)(`li`,{className:e===Al?`allow-list-item allow-list-item-wildcard`:`allow-list-item`,children:[(0,B.jsxs)(`div`,{className:`allow-list-entry-main`,children:[(0,B.jsx)(`span`,{className:`allow-list-entry-value`,children:e}),e===Al?(0,B.jsx)(`span`,{className:`allow-list-warning-label`,children:`all senders`}):null]}),(0,B.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Remove ${e}`,onClick:()=>s(e),children:(0,B.jsx)(Hr,{width:15,height:15})})]},e))}):(0,B.jsx)(`p`,{className:`muted-copy`,children:`No allowed senders configured.`})]})}function Pl(e){return Array.isArray(e.email.accounts)?e.email.accounts:[]}function Fl(e){return{agentId:``,imapHost:e.imapHost,imapPort:e.imapPort,imapSecure:e.imapSecure,smtpHost:e.smtpHost,smtpPort:e.smtpPort,smtpSecure:e.smtpSecure,address:``,password:``,pollIntervalMs:e.pollIntervalMs,folders:[...e.folders],allowFrom:[...e.allowFrom],mediaMaxMb:e.mediaMaxMb}}function Il(e){let t=e.password;return t&&typeof t==`object`&&t.source===`store`?t.id:``}function Ll(e,t){let n={...e};return t?n.password={source:`store`,id:t}:delete n.password,n}function Rl(e){return e.name?`${e.name} (${e.id})`:e.id}function zl(e){let t=e.find(e=>e.id===qc);return t?Rl(t):`Main Agent (${qc})`}function Bl(e){return e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,`_`).replace(/^_+|_+$/g,``)||`AGENT`}function Vl(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36).toUpperCase().padStart(6,`0`)}function Hl(e,t){return`${Bl(e.agentId||t)}_${Vl(`${e.agentId||``}\n${t}\n${e.address||``}`)}_EMAIL_PASSWORD`}function Ul(e,t){let n=t.find(t=>t.id===e.agentId);return String(n?.chatbotId||e.agentId||``).trim()}function Wl(){return`mailbox-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function Gl(e){return(0,B.jsx)($,{name:`channelInstructions.${e.kind}`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Channel instructions`}),(0,B.jsx)(ts,{rows:4,...e,placeholder:`Optional extra instructions for this channel only.`})]})})}function Kl(e){let[t,n]=(0,R.useState)(!1),[r,i]=(0,R.useState)(``),[a,o]=(0,R.useState)(!1),s=e.source!==null||a||e.configured||String(e.configValue||``).trim().length>0?`Change ${e.secretLabel}`:`Set ${e.secretLabel}`,c=Ss(),l=g({mutationFn:async t=>Gt(e.token,e.secretName,t),onSuccess:()=>{o(!0),e.onSecretSaved(),n(!1),i(``),c.success(`${e.label} updated in encrypted runtime secrets.`)},onError:e=>{c.error(`Save failed`,H(e))}});return(0,B.jsxs)(q,{className:`managed-secret-field`,children:[(0,B.jsx)(Jo,{children:e.label}),t?null:(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{className:`managed-secret-action`,variant:`ghost`,type:`button`,onClick:()=>{l.reset(),n(!0),i(``)},children:s})}),t?(0,B.jsxs)(`div`,{className:`managed-secret-editor`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`New ${e.secretLabel}`}),(0,B.jsx)(Y,{type:`password`,value:r,autoComplete:`new-password`,onChange:e=>i(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{type:`button`,loading:l.isPending,disabled:!r.trim()||l.isPending,onClick:()=>l.mutate(r),children:l.isPending?`Saving...`:`Save ${e.secretLabel}`}),(0,B.jsx)(Z,{variant:`ghost`,type:`button`,disabled:l.isPending,onClick:()=>{l.reset(),n(!1),i(``)},children:`Cancel`})]})]}):null]})}function ql(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:El(e.draft),onCheckedChange:t=>{let n=e.draft.discord,r=t&&n.groupPolicy===`disabled`&&!n.commandsOnly?`open`:t?n.groupPolicy:`disabled`,i=t?n.commandsOnly:!1;e.form.setField(`discord.groupPolicy`,r),e.form.setField(`discord.commandsOnly`,i)}}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Enabled`})})]}),(0,B.jsx)(Kl,{label:`Bot token`,secretName:`DISCORD_TOKEN`,secretLabel:`token`,configured:e.tokenConfigured,source:e.tokenSource,token:e.token,onSecretSaved:e.onSecretSaved}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`discord.prefix`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Prefix`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)($,{name:`discord.groupPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Group policy`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),(0,B.jsx)($,{name:`discord.commandsOnly`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Commands only`})})]})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`discord.commandMode`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Command mode`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`public`,children:`public`}),(0,B.jsx)(Q,{value:`restricted`,children:`restricted`})]})]})}),(0,B.jsx)($,{name:`discord.sendPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Send policy`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),(0,B.jsx)($,{name:`discord.commandAllowedUserIds`,render:({field:e})=>(0,B.jsx)(kl,{label:`Allowed command user IDs`,value:e.value,rows:3,placeholder:`comma or newline separated`,onChange:e.onChange})}),(0,B.jsx)($,{name:`discord.sendAllowedChannelIds`,render:({field:e})=>(0,B.jsx)(kl,{label:`Allowed outbound channel IDs`,value:e.value,rows:3,placeholder:`comma or newline separated`,onChange:e.onChange})}),(0,B.jsx)($,{name:`discord.freeResponseChannels`,render:({field:e})=>(0,B.jsx)(kl,{label:`Free response channel IDs`,value:e.value,rows:3,placeholder:`comma or newline separated`,onChange:e.onChange})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`discord.typingMode`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Typing mode`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`instant`,children:`instant`}),(0,B.jsx)(Q,{value:`thinking`,children:`thinking`}),(0,B.jsx)(Q,{value:`streaming`,children:`streaming`}),(0,B.jsx)(Q,{value:`never`,children:`never`})]})]})}),(0,B.jsx)($,{name:`discord.ackReaction`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Ack reaction`}),(0,B.jsx)(Y,{...e,placeholder:`👀`})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`discord.ackReactionScope`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Ack reaction scope`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`all`,children:`all`}),(0,B.jsx)(Q,{value:`group-mentions`,children:`group-mentions`}),(0,B.jsx)(Q,{value:`direct`,children:`direct`}),(0,B.jsx)(Q,{value:`off`,children:`off`})]})]})}),(0,B.jsx)($,{name:`discord.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`discord.debounceMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Debounce ms`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`discord.maxLinesPerMessage`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Max lines per message`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`discord.rateLimitPerUser`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Rate limit per user`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`discord.maxConcurrentPerChannel`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Max concurrent per channel`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)($,{name:`discord.removeAckAfterReply`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Remove ack after reply`})})]})}),(0,B.jsx)(Gl,{kind:`discord`}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`Discord guild defaults and explicit per-channel overrides stay intact. This page edits the transport defaults that apply across the space.`})]})}function Jl(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:Dl(e.draft),onCheckedChange:t=>{let n=e.draft.whatsapp,r=t&&n.dmPolicy===`disabled`?`pairing`:t?n.dmPolicy:`disabled`,i=t?n.groupPolicy:`disabled`;e.form.setField(`whatsapp.dmPolicy`,r),e.form.setField(`whatsapp.groupPolicy`,i)}}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Enabled`})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`whatsapp.dmPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`DM policy`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`pairing`,children:`pairing`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})}),(0,B.jsx)($,{name:`whatsapp.groupPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Group policy`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),Dl(e.draft)&&!e.linked?(0,B.jsxs)(`div`,{className:`field whatsapp-pairing-field`,children:[(0,B.jsx)(`span`,{children:`Pairing QR`}),e.pairingQrText?(0,B.jsx)(`pre`,{className:`whatsapp-pairing-qr`,role:`img`,"aria-label":`WhatsApp pairing QR`,children:e.pairingQrText}):(0,B.jsx)(`p`,{className:`muted-copy`,children:e.pairingError||`Waiting for a fresh QR from the gateway.`})]}):null,(0,B.jsx)($,{name:`whatsapp.allowFrom`,render:({field:e})=>(0,B.jsx)(Nl,{label:`Allowed DM senders`,value:e.value,placeholder:`+14155551212 or *`,onChange:e.onChange})}),(0,B.jsx)($,{name:`whatsapp.groupAllowFrom`,render:({field:e})=>(0,B.jsx)(Nl,{label:`Allowed group senders`,value:e.value,placeholder:`+14155551212 or *`,onChange:e.onChange})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`whatsapp.debounceMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Debounce ms`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`whatsapp.ackReaction`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Ack reaction`}),(0,B.jsx)(Y,{...e})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`whatsapp.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`whatsapp.mediaMaxMb`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Media max MB`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)($,{name:`whatsapp.sendReadReceipts`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Send read receipts`})})]})}),(0,B.jsx)(Gl,{kind:`whatsapp`})]})}function Yl(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`telegram.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)(Kl,{label:`Bot token`,secretName:`TELEGRAM_BOT_TOKEN`,secretLabel:`token`,configValue:e.draft.telegram.botToken,configured:e.tokenConfigured,source:e.tokenSource,token:e.token,onSecretSaved:e.onSecretSaved}),(0,B.jsx)($,{name:`telegram.pollIntervalMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Poll interval ms`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`telegram.dmPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`DM policy`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})}),(0,B.jsx)($,{name:`telegram.groupPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Group policy`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),(0,B.jsx)($,{name:`telegram.requireMention`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Require mention in groups`})})]})}),(0,B.jsx)($,{name:`telegram.allowFrom`,render:({field:e})=>(0,B.jsx)(Nl,{label:`Allowed DM senders`,value:e.value,placeholder:`numeric user id, @username, or *`,onChange:e.onChange})}),(0,B.jsx)($,{name:`telegram.groupAllowFrom`,render:({field:e})=>(0,B.jsx)(Nl,{label:`Allowed group senders`,value:e.value,placeholder:`numeric user id, @username, or *`,onChange:e.onChange})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`telegram.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`telegram.mediaMaxMb`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Media max MB`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`Telegram inbound handling stays off until DM or group policy is opened or allowlisted.`}),Ol(e.draft)?null:(0,B.jsx)(`p`,{className:`muted-copy`,children:`This page edits transport-level Telegram settings. Discord and Teams remain the only transports with per-channel override bindings.`}),(0,B.jsx)(Gl,{kind:`telegram`})]})}function Xl(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`threema.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`threema.identity`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Gateway identity`}),(0,B.jsx)(Y,{...e,placeholder:`*HYBRID1`})]})}),(0,B.jsx)(Kl,{label:`Gateway secret`,secretName:`THREEMA_GATEWAY_SECRET`,secretLabel:`secret`,configValue:e.draft.threema.secret,configured:e.secretConfigured,source:e.secretSource,token:e.token,onSecretSaved:e.onSecretSaved})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`threema.apiBaseUrl`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`API base URL`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)($,{name:`threema.dmPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`DM policy`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),(0,B.jsx)($,{name:`threema.allowFrom`,render:({field:e})=>(0,B.jsx)(Nl,{label:`Allowed senders`,value:e.value,placeholder:`threema:ABCDEFGH, threema:phone:41791234567, or *`,onChange:e.onChange})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`threema.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`threema.outboundDelayMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Outbound delay ms`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`Threema Gateway Basic mode supports outbound text only. Inbound chat history, typing, and attachments are not available.`}),(0,B.jsx)(Gl,{kind:`threema`})]})}function Zl(e){let t=o(),n=Ss(),[r,i]=(0,R.useState)(`signal-cli`),[a,s]=(0,R.useState)(`HybridClaw`),c=y({queryKey:[`signal-link`,e.token],queryFn:()=>Ut(e.token),refetchInterval:e=>{let t=e.state.data?.status;return t===`starting`||t===`qr`?2e3:!1}}).data,l=g({mutationFn:()=>Ht(e.token,{cliPath:r,deviceName:a}),onSuccess:r=>{t.setQueryData([`signal-link`,e.token],r),n.success(`Signal linked-device QR started.`),t.invalidateQueries({queryKey:[`status`,e.token]})},onError:e=>{n.error(`Signal link failed`,H(e))}});return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`signal.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`signal-cli path`}),(0,B.jsx)(Y,{value:r,onChange:e=>i(e.target.value),placeholder:`signal-cli`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Device name`}),(0,B.jsx)(Y,{value:a,onChange:e=>s(e.target.value),placeholder:`HybridClaw`})]})]}),(0,B.jsxs)(`div`,{className:`field whatsapp-pairing-field`,children:[(0,B.jsx)(`span`,{children:`Linked-device QR`}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{type:`button`,variant:`ghost`,loading:l.isPending,disabled:!e.cliAvailable||l.isPending||c?.status===`starting`||c?.status===`qr`,onClick:()=>l.mutate(),children:l.isPending?`Starting...`:`Start QR link`})}),e.cliAvailable?c?.pairingQrText?(0,B.jsx)(`pre`,{className:`whatsapp-pairing-qr`,role:`img`,"aria-label":`Signal linked-device QR`,children:c.pairingQrText}):c?.status===`starting`?(0,B.jsx)(`p`,{className:`muted-copy`,children:`Waiting for signal-cli to print a QR.`}):c?.status===`complete`?(0,B.jsx)(`p`,{className:`muted-copy`,children:`Linked-device flow completed. Start the daemon and save the account below.`}):c?.status===`error`?(0,B.jsx)(`p`,{className:`muted-copy`,children:c.error||`Signal linked-device setup failed.`}):(0,B.jsxs)(`p`,{className:`muted-copy`,children:["Starts `signal-cli link -n HybridClaw` on the gateway host",e.cliVersion?` (${e.cliVersion})`:``,`.`]}):(0,B.jsxs)(`p`,{className:`muted-copy`,children:[`signal-cli is not available on this gateway host. Install signal-cli, use a bundled cloud amd64 gateway image, or configure an external daemon/sidecar.`,e.cliError?` ${e.cliError}`:``]})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`signal.daemonUrl`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Daemon URL`}),(0,B.jsx)(Y,{...e,placeholder:`http://127.0.0.1:8080`})]})}),(0,B.jsx)($,{name:`signal.account`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Account`}),(0,B.jsx)(Y,{...e,placeholder:`+14155550123`})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`signal.dmPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`DM policy`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})}),(0,B.jsx)($,{name:`signal.groupPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Group policy`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),(0,B.jsx)($,{name:`signal.allowFrom`,render:({field:e})=>(0,B.jsx)(Nl,{label:`Allowed DM senders`,value:e.value,placeholder:`+14155551212, Signal UUID, or *`,onChange:e.onChange})}),(0,B.jsx)($,{name:`signal.groupAllowFrom`,render:({field:e})=>(0,B.jsx)(Nl,{label:`Allowed group senders`,value:e.value,placeholder:`+14155551212, Signal UUID, or *`,onChange:e.onChange})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`signal.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`signal.reconnectIntervalMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Reconnect interval ms`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`signal.outboundDelayMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Outbound delay ms`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`After scanning the QR in Signal mobile, start the daemon and save the daemon URL here. Groups stay disabled by default; start with one allowlisted DM sender.`}),(0,B.jsx)(Gl,{kind:`signal`})]})}function Ql(e){let[t,n]=(0,R.useState)(!1),[r,i]=(0,R.useState)(null),a=Ss(),o=Pl(e.draft),[s,c]=(0,R.useState)(()=>o.map(()=>Wl()));(0,R.useEffect)(()=>{c(e=>e.length===o.length?e:e.length>o.length?e.slice(0,o.length):[...e,...Array.from({length:o.length-e.length},Wl)])},[o.length]);function l(t){e.form.setField(`email.accounts`,t)}function u(e,t){l(o.map((n,r)=>r===e?t(n):n))}function d(){c(e=>[...e,Wl()]),l([...o,Fl(e.draft.email)])}function f(e){c(t=>t.filter((t,n)=>n!==e)),l(o.filter((t,n)=>n!==e))}function p(t){let n={...e.draft,email:{...e.draft.email,allowFrom:t}};e.form.setDraft(n),e.onAutoSave(n)}async function m(){n(!0);try{let t=await Rt(e.token),n=t?.handles;if(!Array.isArray(n)||n.length===0){a.info(`No HybridAI agent handles found.`);return}let r=t?.credentials;if(!r){let e=n.map(e=>`${e.handle} (${e.status})`).join(`, `);a.info(`Handles found: ${e}. Could not retrieve mailbox credentials.`);return}if(r.email&&e.form.setField(`email.address`,r.email),r.imap_host&&e.form.setField(`email.imapHost`,r.imap_host),r.imap_port!=null&&e.form.setField(`email.imapPort`,r.imap_port),r.smtp_host&&e.form.setField(`email.smtpHost`,r.smtp_host),r.smtp_port!=null&&e.form.setField(`email.smtpPort`,r.smtp_port),r.password)try{await Gt(e.token,`EMAIL_PASSWORD`,r.password),e.onSecretSaved()}catch(e){a.error(`Password could not be saved`,H(e)),a.info(`Email fields were populated, but password was not saved.`);return}let i=t.handleId||`HybridAI`;a.success(`Email config loaded from ${i}.`)}catch(e){a.error(`Failed to fetch email config`,H(e))}finally{n(!1)}}async function h(t){let n=o[t];if(!n)return;let r=Ul(n,e.agents);if(!r){a.info(`Select an agent before fetching a HybridAI mailbox.`);return}i(t);try{let i=await Rt(e.token,{handleId:r}),o=i?.credentials;if(!o){a.info(`Could not retrieve mailbox credentials for ${i?.handleId||r}.`);return}let s=Hl(n,i.handleId||r);if(o.password)try{await Gt(e.token,s,o.password),e.onSecretSaved()}catch(e){a.error(`Password could not be saved`,H(e)),a.info(`Mailbox credentials were not applied because the password was not saved.`);return}u(t,e=>({...e,...o.email?{address:o.email}:{},...o.imap_host?{imapHost:o.imap_host}:{},...o.imap_port==null?{}:{imapPort:o.imap_port},...o.smtp_host?{smtpHost:o.smtp_host}:{},...o.smtp_port==null?{}:{smtpPort:o.smtp_port},...o.password?{password:{source:`store`,id:s}}:{}})),a.success(`Mailbox config loaded from ${i.handleId||r}.`)}catch(e){a.error(`Failed to fetch mailbox config`,H(e))}finally{i(null)}}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`email.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),e.hybridaiApiKeyConfigured?(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{type:`button`,variant:`ghost`,loading:t,disabled:t,onClick:m,children:t?`Fetching…`:`Fetch HybridAI Agent Email`})}):null,(0,B.jsx)(`div`,{className:`email-account-section-header`,children:(0,B.jsxs)(`div`,{className:`email-account-section-copy`,children:[(0,B.jsxs)(`h4`,{children:[`Default agent mailbox:`,(0,B.jsx)(`span`,{className:`email-default-agent-target`,children:zl(e.agents)})]}),(0,B.jsx)(`p`,{children:`Inbound target; outbound fallback for agents without an additional mailbox.`})]})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`email.address`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Default mailbox address`}),(0,B.jsx)(Y,{...e,placeholder:`bot@example.com`})]})}),(0,B.jsx)(Kl,{label:`Default mailbox password`,secretName:`EMAIL_PASSWORD`,secretLabel:`password`,configValue:e.draft.email.password,configured:e.passwordConfigured,source:e.passwordSource,token:e.token,onSecretSaved:e.onSecretSaved})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`email.imapHost`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`IMAP host`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)($,{name:`email.smtpHost`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`SMTP host`}),(0,B.jsx)(Y,{...e})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`email.imapPort`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`IMAP port`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`email.smtpPort`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`SMTP port`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`email.imapSecure`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`IMAP secure`})})]})}),(0,B.jsx)($,{name:`email.smtpSecure`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`SMTP secure`})})]})})]}),(0,B.jsx)($,{name:`email.folders`,render:({field:e})=>(0,B.jsx)(kl,{label:`Folders`,value:e.value,rows:3,placeholder:`INBOX, Support`,onChange:e.onChange})}),(0,B.jsx)($,{name:`email.allowFrom`,render:({field:e})=>(0,B.jsx)(Nl,{label:`Allowed senders`,value:e.value,placeholder:`name@example.com, *@example.com`,onChange:e.onChange,onAdd:p})}),(0,B.jsxs)(`details`,{className:`channel-advanced-settings`,children:[(0,B.jsx)(`summary`,{children:`Advanced settings`}),(0,B.jsxs)(`div`,{className:`channel-advanced-settings-body`,children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`email.pollIntervalMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Poll interval ms`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`email.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)($,{name:`email.mediaMaxMb`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Media max MB`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)(Gl,{kind:`email`})]})]}),(0,B.jsxs)(`div`,{className:`email-account-section`,children:[(0,B.jsxs)(`div`,{className:`email-account-section-header`,children:[(0,B.jsx)(`h4`,{children:`Additional agent mailboxes`}),(0,B.jsx)(Z,{type:`button`,variant:`ghost`,onClick:d,children:`Add additional mailbox`})]}),o.length===0?(0,B.jsx)(`div`,{className:`empty-state email-account-empty`,children:`No additional agent mailboxes configured.`}):(0,B.jsx)(`div`,{className:`email-account-list`,children:o.map((t,n)=>{let i=s[n]||`${t.agentId}:${t.address}:${t.imapHost}:${t.smtpHost}`,a=e.agents.some(e=>e.id===t.agentId),o=Ul(t,e.agents),c=r===n;return(0,B.jsxs)(`div`,{className:`email-account-row`,children:[(0,B.jsxs)(`div`,{className:`email-account-row-header`,children:[(0,B.jsx)(`strong`,{children:t.address||`Mailbox ${n+1}`}),(0,B.jsxs)(`div`,{className:`email-account-row-actions`,children:[e.hybridaiApiKeyConfigured?(0,B.jsx)(Z,{type:`button`,variant:`ghost`,loading:c,disabled:r!==null||!o,title:o?`Fetch HybridAI mailbox for ${o}`:`Select an agent before fetching a HybridAI mailbox`,onClick:()=>h(n),children:`Fetch HybridAI mailbox`}):null,(0,B.jsx)(Z,{"aria-label":`Remove mailbox ${n+1}`,title:`Remove mailbox ${n+1}`,className:`email-account-remove`,type:`button`,variant:`ghost`,size:`icon`,onClick:()=>f(n),children:(0,B.jsx)(Hr,{width:`16`,height:`16`})})]})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Agent`}),e.agents.length>0?(0,B.jsxs)(vs,{value:t.agentId,onChange:e=>u(n,t=>({...t,agentId:e.target.value})),children:[(0,B.jsx)(Q,{value:``,children:`Select agent`}),e.agents.map(e=>(0,B.jsx)(Q,{value:e.id,children:Rl(e)},e.id)),t.agentId&&!a?(0,B.jsx)(Q,{value:t.agentId,children:t.agentId}):null]}):(0,B.jsx)(Y,{value:t.agentId,placeholder:`sales`,onChange:e=>u(n,t=>({...t,agentId:e.target.value}))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Mailbox address`}),(0,B.jsx)(Y,{type:`email`,value:t.address,placeholder:`sales@example.com`,onChange:e=>u(n,t=>({...t,address:e.target.value}))})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Password SecretRef id`}),(0,B.jsx)(Y,{value:Il(t),placeholder:`SALES_EMAIL_PASSWORD`,onChange:e=>u(n,t=>Ll(t,e.target.value.trim()))})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Mailbox IMAP host`}),(0,B.jsx)(Y,{value:t.imapHost,onChange:e=>u(n,t=>({...t,imapHost:e.target.value}))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Mailbox SMTP host`}),(0,B.jsx)(Y,{value:t.smtpHost,onChange:e=>u(n,t=>({...t,smtpHost:e.target.value}))})]})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Mailbox IMAP port`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:t.imapPort,onValueChange:e=>u(n,t=>({...t,imapPort:e}))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Mailbox SMTP port`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:t.smtpPort,onValueChange:e=>u(n,t=>({...t,smtpPort:e}))})]})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:t.imapSecure,onCheckedChange:e=>u(n,t=>({...t,imapSecure:e}))}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Mailbox IMAP secure`})})]}),(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:t.smtpSecure,onCheckedChange:e=>u(n,t=>({...t,smtpSecure:e}))}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Mailbox SMTP secure`})})]})]}),(0,B.jsx)(kl,{label:`Mailbox folders`,value:t.folders,rows:2,placeholder:`INBOX, Support`,onChange:e=>u(n,t=>({...t,folders:e}))}),(0,B.jsx)(Nl,{label:`Mailbox allowed senders`,value:t.allowFrom,placeholder:`name@example.com, *@example.com`,onChange:e=>u(n,t=>({...t,allowFrom:e}))}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Mailbox poll interval ms`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:t.pollIntervalMs,onValueChange:e=>u(n,t=>({...t,pollIntervalMs:e}))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Mailbox media max MB`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:t.mediaMaxMb,onValueChange:e=>u(n,t=>({...t,mediaMaxMb:e}))})]})]})]},i)})})]})]})}function $l(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`voice.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`voice.twilio.accountSid`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Twilio account SID`}),(0,B.jsx)(Y,{...e,placeholder:`AC...`})]})}),(0,B.jsx)($,{name:`voice.twilio.fromNumber`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`From number`}),(0,B.jsx)(Y,{...e,placeholder:`+14155550123`})]})})]}),(0,B.jsx)(Kl,{label:`Twilio auth token`,secretName:`TWILIO_AUTH_TOKEN`,secretLabel:`token`,configValue:e.draft.voice.twilio.authToken,configured:e.authTokenConfigured,source:e.authTokenSource,token:e.token,onSecretSaved:e.onSecretSaved}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`voice.webhookPath`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Webhook path`}),(0,B.jsx)(Y,{...e,placeholder:`/voice`})]})}),(0,B.jsx)($,{name:`voice.maxConcurrentCalls`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Max concurrent calls`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`voice.relay.ttsProvider`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`TTS provider`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`default`,children:`default`}),(0,B.jsx)(Q,{value:`google`,children:`google`}),(0,B.jsx)(Q,{value:`amazon`,children:`amazon`})]})]})}),(0,B.jsx)($,{name:`voice.relay.voice`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Voice`}),(0,B.jsx)(Y,{...e,placeholder:`en-US-Journey-D`})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`voice.relay.transcriptionProvider`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Transcription provider`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`default`,children:`default`}),(0,B.jsx)(Q,{value:`deepgram`,children:`deepgram`}),(0,B.jsx)(Q,{value:`google`,children:`google`})]})]})}),(0,B.jsx)($,{name:`voice.relay.language`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Language`}),(0,B.jsx)(Y,{...e,placeholder:`en-US`})]})})]}),(0,B.jsx)($,{name:`voice.relay.interruptible`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Interruptible`})})]})}),(0,B.jsx)($,{name:`voice.relay.welcomeGreeting`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Welcome greeting`}),(0,B.jsx)(ts,{rows:3,...e})]})}),(0,B.jsx)(Gl,{kind:`voice`}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`Voice uses Twilio ConversationRelay. Expose the configured webhook path over public HTTPS and WSS so Twilio can reach both the webhook and the relay socket.`})]})}function eu(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`msteams.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`Paste values from Microsoft Entra Admin Center. Use the app registration's Application (client) ID and Directory (tenant) ID.`}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`msteams.appId`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`App ID`}),(0,B.jsx)(Yo,{children:`Application (client) ID from the Entra app registration.`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)($,{name:`msteams.tenantId`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Tenant ID`}),(0,B.jsx)(Yo,{children:`Directory (tenant) ID from the same Entra tenant.`}),(0,B.jsx)(Y,{...e})]})})]}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{variant:`outline`,render:(0,B.jsx)(`a`,{href:`/admin/teams`,children:`App Setup`})})}),(0,B.jsxs)(`details`,{className:`channel-advanced-settings`,children:[(0,B.jsx)(`summary`,{children:`Teams app setup instructions`}),(0,B.jsx)(`div`,{className:`channel-advanced-settings-body`,children:(0,B.jsxs)(`ol`,{className:`channel-setup-list`,children:[(0,B.jsx)(`li`,{children:`Open App Setup and check Public origin. Cloud deployments should already show a public HTTPS origin. Local installs need a public HTTPS tunnel or reverse proxy first, then App Setup should stop showing localhost.`}),(0,B.jsx)(`li`,{children:`In Microsoft Entra Admin Center, create or open the app registration for HybridClaw. Copy its Application (client) ID and Directory (tenant) ID.`}),(0,B.jsx)(`li`,{children:`Paste those two values here in Microsoft Teams settings, then save channel settings. This lets App Setup detect the tenant and derive the correct Teams SSO values.`}),(0,B.jsx)(`li`,{children:"In App Setup, copy the App ID URI and Browser redirect URI. In Entra, add the App ID URI under Expose an API, add an `access_as_user` scope, and add the Browser redirect URI under Authentication."}),(0,B.jsx)(`li`,{children:"In Entra's Authorized client applications, add the Teams desktop and mobile client ID plus the Teams web client ID from App Setup, and authorize them for the `access_as_user` scope."}),(0,B.jsx)(`li`,{children:`Back in App Setup, enable tab SSO. Save the SSO app ID, usually the same Application (client) ID, and the App ID URI. Use Test to confirm required values are present.`}),(0,B.jsx)(`li`,{children:`Download the org app package from App Setup and upload it in the Teams admin center app catalog so users can install the HybridClaw Teams app.`}),(0,B.jsx)(`li`,{children:`After the org app is available in Teams, use Apps, Share, Add to Teams for individual HybridClaw apps.`})]})})]}),(0,B.jsxs)(`details`,{className:`channel-advanced-settings`,children:[(0,B.jsx)(`summary`,{children:`Advanced delivery settings`}),(0,B.jsxs)(`div`,{className:`channel-advanced-settings-body`,children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`msteams.webhook.path`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Webhook path`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)($,{name:`msteams.webhook.port`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Webhook port`}),(0,B.jsx)(Rc,{integer:!0,min:0,max:65535,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`msteams.dmPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`DM policy`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})}),(0,B.jsx)($,{name:`msteams.groupPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Group policy`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`msteams.requireMention`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Require mention`})})]})}),(0,B.jsx)($,{name:`msteams.replyStyle`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Reply style`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`thread`,children:`thread`}),(0,B.jsx)(Q,{value:`top-level`,children:`top-level`})]})]})})]}),(0,B.jsx)($,{name:`msteams.allowFrom`,render:({field:e})=>(0,B.jsx)(Nl,{label:`Allowed AAD object IDs`,value:e.value,placeholder:`AAD object ID or *`,onChange:e.onChange})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`msteams.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`msteams.mediaMaxMb`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Media max MB`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)(Gl,{kind:`msteams`})]})]})]})}function tu(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`slack.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsx)(Kl,{label:`Bot token`,secretName:`SLACK_BOT_TOKEN`,secretLabel:`token`,configured:e.botTokenConfigured,source:e.botTokenSource,token:e.token,onSecretSaved:e.onSecretSaved}),(0,B.jsx)(Kl,{label:`App token`,secretName:`SLACK_APP_TOKEN`,secretLabel:`token`,configured:e.appTokenConfigured,source:e.appTokenSource,token:e.token,onSecretSaved:e.onSecretSaved}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`slack.dmPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`DM policy`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})}),(0,B.jsx)($,{name:`slack.groupPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Group policy`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`slack.requireMention`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Require mention`})})]})}),(0,B.jsx)($,{name:`slack.replyStyle`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Reply style`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`thread`,children:`thread`}),(0,B.jsx)(Q,{value:`top-level`,children:`top-level`})]})]})})]}),(0,B.jsx)($,{name:`slack.allowFrom`,render:({field:e})=>(0,B.jsx)(Nl,{label:`Allowed DM Slack user IDs`,value:e.value,placeholder:`Slack user ID or *`,onChange:e.onChange})}),(0,B.jsx)($,{name:`slack.groupAllowFrom`,render:({field:e})=>(0,B.jsx)(Nl,{label:`Allowed channel Slack user IDs`,value:e.value,placeholder:`Slack user ID or *`,onChange:e.onChange})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`slack.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`slack.mediaMaxMb`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Media max MB`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`Slack runs through Socket Mode. HybridClaw needs both a bot token and an app token before the gateway can connect.`}),(0,B.jsx)(Gl,{kind:`slack`})]})}function nu(e){let t=Ss(),n=Object.keys(e.draft.slackWebhook.webhooks).sort(),[r,i]=(0,R.useState)(n[0]||`default`),[a,o]=(0,R.useState)(``),[s,c]=(0,R.useState)(``),[l,u]=(0,R.useState)(``),[d,f]=(0,R.useState)(``),p=e.draft.slackWebhook.webhooks[r],m=g({mutationFn:async()=>Bt(e.token,{target:r,webhookUrl:a.trim()||void 0,defaultUsername:s,defaultIconEmoji:l,defaultIconUrl:d}),onSuccess:n=>{e.onConfigSaved(n.config),o(``),t.success(`Slack webhook target saved.`)},onError:e=>{t.error(`Save failed`,H(e))}});return(0,R.useEffect)(()=>{let t=e.draft.slackWebhook.webhooks[r];c(t?.defaultUsername||``),u(t?.defaultIconEmoji||``),f(t?.defaultIconUrl||``)},[e.draft.slackWebhook.webhooks,r]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`slackWebhook.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsxs)(`div`,{className:`field`,children:[(0,B.jsx)(`span`,{children:`Webhook targets`}),(0,B.jsx)(`div`,{className:`readonly-value`,children:n.length>0?n.join(`, `):`none`})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Target`}),(0,B.jsx)(Y,{list:`slack-webhook-targets`,value:r,onChange:e=>i(e.target.value)}),(0,B.jsx)(`datalist`,{id:`slack-webhook-targets`,children:n.map(e=>(0,B.jsx)(Q,{value:e},e))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Webhook URL`}),(0,B.jsx)(Y,{type:`password`,autoComplete:`off`,placeholder:p?`leave blank to keep current URL`:`required`,value:a,onChange:e=>o(e.target.value)})]})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Username`}),(0,B.jsx)(Y,{value:s,onChange:e=>c(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Icon emoji`}),(0,B.jsx)(Y,{value:l,onChange:e=>u(e.target.value)})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Icon URL`}),(0,B.jsx)(Y,{value:d,onChange:e=>f(e.target.value)})]}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(`button`,{className:`secondary-button`,type:`button`,disabled:m.isPending,onClick:()=>m.mutate(),children:m.isPending?`Saving...`:`Save webhook target`})}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`Webhook URLs are stored as encrypted runtime secrets and are never shown after save.`}),(0,B.jsx)(Gl,{kind:`slack_webhook`})]})}function ru(e){let t=Ss(),n=Object.keys(e.draft.discordWebhook.webhooks).sort(),[r,i]=(0,R.useState)(n[0]||`default`),[a,o]=(0,R.useState)(``),[s,c]=(0,R.useState)(``),[l,u]=(0,R.useState)(``),d=e.draft.discordWebhook.webhooks[r],f=g({mutationFn:async()=>Vt(e.token,{target:r,webhookUrl:a.trim()||void 0,defaultUsername:s,defaultAvatarUrl:l}),onSuccess:n=>{e.onConfigSaved(n.config),o(``),t.success(`Discord webhook target saved.`)},onError:e=>{t.error(`Save failed`,H(e))}});return(0,R.useEffect)(()=>{let t=e.draft.discordWebhook.webhooks[r];c(t?.defaultUsername||``),u(t?.defaultAvatarUrl||``)},[e.draft.discordWebhook.webhooks,r]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`discordWebhook.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsxs)(`div`,{className:`field`,children:[(0,B.jsx)(`span`,{children:`Webhook targets`}),(0,B.jsx)(`div`,{className:`readonly-value`,children:n.length>0?n.join(`, `):`none`})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Target`}),(0,B.jsx)(Y,{list:`discord-webhook-targets`,value:r,onChange:e=>i(e.target.value)}),(0,B.jsx)(`datalist`,{id:`discord-webhook-targets`,children:n.map(e=>(0,B.jsx)(Q,{value:e},e))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Webhook URL`}),(0,B.jsx)(Y,{type:`password`,autoComplete:`off`,placeholder:d?`leave blank to keep current URL`:`required`,value:a,onChange:e=>o(e.target.value)})]})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Username`}),(0,B.jsx)(Y,{value:s,onChange:e=>c(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Avatar URL`}),(0,B.jsx)(Y,{value:l,onChange:e=>u(e.target.value)})]})]}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(`button`,{className:`secondary-button`,type:`button`,disabled:f.isPending,onClick:()=>f.mutate(),children:f.isPending?`Saving...`:`Save webhook target`})}),(0,B.jsx)(`p`,{className:`muted-copy`,children:`Webhook URLs are stored as encrypted runtime secrets and are never shown after save.`}),(0,B.jsx)(Gl,{kind:`discord_webhook`})]})}function iu(e){let t=e.draft.imessage.backend===`bluebubbles`;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)($,{name:`imessage.enabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Enabled`})})]})}),(0,B.jsx)($,{name:`imessage.backend`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Backend`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`local`,children:`local`}),(0,B.jsx)(Q,{value:`bluebubbles`,children:`remote`})]})]})}),t?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`imessage.serverUrl`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Server URL`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)(Kl,{label:`Password`,secretName:`IMESSAGE_PASSWORD`,secretLabel:`password`,configValue:e.draft.imessage.password,configured:e.passwordConfigured,source:e.passwordSource,token:e.token,onSecretSaved:e.onSecretSaved})]}),(0,B.jsx)($,{name:`imessage.webhookPath`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Webhook path`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)($,{name:`imessage.allowPrivateNetwork`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Allow private network`})})]})})]}):(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`imessage.cliPath`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`CLI path`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)($,{name:`imessage.dbPath`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Database path`}),(0,B.jsx)(Y,{...e})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`imessage.dmPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`DM policy`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})}),(0,B.jsx)($,{name:`imessage.groupPolicy`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Group policy`}),(0,B.jsxs)(vs,{value:e.value,onChange:e.onChange,children:[(0,B.jsx)(Q,{value:`open`,children:`open`}),(0,B.jsx)(Q,{value:`allowlist`,children:`allowlist`}),(0,B.jsx)(Q,{value:`disabled`,children:`disabled`})]})]})})]}),(0,B.jsx)($,{name:`imessage.allowFrom`,render:({field:e})=>(0,B.jsx)(Nl,{label:`Allowed DM senders`,value:e.value,placeholder:`phone, email, or chat:id`,onChange:e.onChange})}),(0,B.jsx)($,{name:`imessage.groupAllowFrom`,render:({field:e})=>(0,B.jsx)(Nl,{label:`Allowed group senders`,value:e.value,placeholder:`phone, email, or chat:id`,onChange:e.onChange})}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`imessage.pollIntervalMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:t?`Webhook / poll interval ms`:`Poll interval ms`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`imessage.debounceMs`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Debounce ms`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsx)($,{name:`imessage.textChunkLimit`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Text chunk limit`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})}),(0,B.jsx)($,{name:`imessage.mediaMaxMb`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Media max MB`}),(0,B.jsx)(Rc,{integer:!0,min:0,value:e.value,onValueChange:e.onChange})]})})]}),(0,B.jsx)(Gl,{kind:`imessage`})]})}function au(e,t,n,r,i,a,o,s,c,l,u,d){switch(e){case`discord`:return(0,B.jsx)(ql,{draft:t,form:n,tokenConfigured:i.discord.configured,tokenSource:i.discord.source,token:r,onSecretSaved:d});case`whatsapp`:return(0,B.jsx)(Jl,{draft:t,form:n,linked:o.linked,pairingQrText:o.pairingQrText,pairingError:o.pairingError});case`slack`:return(0,B.jsx)(tu,{draft:t,form:n,botTokenConfigured:i.slack.botConfigured,botTokenSource:i.slack.botSource,appTokenConfigured:i.slack.appConfigured,appTokenSource:i.slack.appSource,token:r,onSecretSaved:d});case`slack_webhook`:return(0,B.jsx)(nu,{draft:t,onConfigSaved:l,token:r,form:n});case`discord_webhook`:return(0,B.jsx)(ru,{draft:t,onConfigSaved:l,token:r,form:n});case`telegram`:return(0,B.jsx)(Yl,{draft:t,form:n,tokenConfigured:i.telegram.configured,tokenSource:i.telegram.source,token:r,onSecretSaved:d});case`signal`:return(0,B.jsx)(Zl,{draft:t,form:n,token:r,cliAvailable:s.cliAvailable,cliVersion:s.cliVersion,cliError:s.cliError});case`threema`:return(0,B.jsx)(Xl,{draft:t,form:n,secretConfigured:i.threema.configured,secretSource:i.threema.source,token:r,onSecretSaved:d});case`voice`:return(0,B.jsx)($l,{draft:t,form:n,authTokenConfigured:i.voice.configured,authTokenSource:i.voice.source,token:r,onSecretSaved:d});case`email`:return(0,B.jsx)(Ql,{draft:t,form:n,passwordConfigured:i.email.configured,passwordSource:i.email.source,hybridaiApiKeyConfigured:a,agents:c,token:r,onAutoSave:u,onSecretSaved:d});case`msteams`:return(0,B.jsx)(eu,{draft:t,form:n});case`imessage`:return(0,B.jsx)(iu,{draft:t,form:n,passwordConfigured:i.imessage.configured,passwordSource:i.imessage.source,token:r,onSecretSaved:d})}}function ou(){let e=Zn(),t=o(),n=Ss(),[r,i]=(0,R.useState)(null),a=y({queryKey:[`config`,e.token],queryFn:()=>Nt(e.token)}),s=y({queryKey:[`status`,e.token],queryFn:()=>je(e.token),initialData:e.gatewayStatus,refetchInterval:3e3}),c=y({queryKey:[`admin-agents`,e.token],queryFn:()=>mt(e.token),enabled:r===`email`}),l=Pc({source:a.data?.config}),{draft:u,isDirty:d,commit:f}=l,p=Hc({mutationFn:t=>zt(e.token,t),onSuccess:r=>{t.setQueryData([`config`,e.token],r),f(r.config),n.success(`Channel settings saved.`)},onError:e=>{n.error(`Save failed`,e.message)},invalidates:[[`status`,e.token],[`overview`]]}),m=u?Tl(u,{discordTokenConfigured:s.data?.discord?.tokenConfigured,discordWebhookDefaultConfigured:s.data?.discordWebhook?.defaultTargetConfigured,slackBotTokenConfigured:s.data?.slack?.botTokenConfigured,slackAppTokenConfigured:s.data?.slack?.appTokenConfigured,slackWebhookDefaultConfigured:s.data?.slackWebhook?.defaultTargetConfigured,telegramTokenConfigured:s.data?.telegram?.tokenConfigured,threemaSecretConfigured:s.data?.threema?.secretConfigured,signalDaemonUrlConfigured:s.data?.signal?.daemonUrlConfigured,signalAccountConfigured:s.data?.signal?.accountConfigured,signalCliAvailable:s.data?.signal?.cliAvailable,voiceAuthTokenConfigured:s.data?.voice?.authTokenConfigured,whatsappLinked:s.data?.whatsapp?.linked,emailPasswordConfigured:s.data?.email?.passwordConfigured,imessagePasswordConfigured:s.data?.imessage?.passwordConfigured}):[];(0,R.useEffect)(()=>{let e=m[0];e&&i(t=>{let n=window.location.hash.replace(/^#/,``),r=m.find(e=>e.kind===n);return r?r.kind:t&&m.some(e=>e.kind===t)?t:e.kind})},[m]),(0,R.useEffect)(()=>{let e=window.location.hash.replace(/^#/,``);!r||r!==e||window.setTimeout(()=>{let e=document.getElementById(r);typeof e?.scrollIntoView==`function`&&e.scrollIntoView({block:`start`})},0)},[r]);let h=p.reset;if((0,R.useEffect)(()=>{d&&h()},[d,h]),a.isLoading&&!u)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading channel settings...`});if(!u)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Channel settings are unavailable.`});let g=m.find(e=>e.kind===r)??m[0]??null,_={discord:{configured:s.data?.discord?.tokenConfigured??!1,source:s.data?.discord?.tokenSource??null},slack:{botConfigured:s.data?.slack?.botTokenConfigured??!1,botSource:s.data?.slack?.botTokenSource??null,appConfigured:s.data?.slack?.appTokenConfigured??!1,appSource:s.data?.slack?.appTokenSource??null},telegram:{configured:s.data?.telegram?.tokenConfigured??!1,source:s.data?.telegram?.tokenSource??null},threema:{configured:s.data?.threema?.secretConfigured??!1,source:s.data?.threema?.secretSource??null},voice:{configured:s.data?.voice?.authTokenConfigured??!1,source:s.data?.voice?.authTokenSource??null},email:{configured:s.data?.email?.passwordConfigured??!1,source:s.data?.email?.passwordSource??null},imessage:{configured:s.data?.imessage?.passwordConfigured??!1,source:s.data?.imessage?.passwordSource??null}},v={linked:s.data?.whatsapp?.linked??!1,pairingQrText:s.data?.whatsapp?.pairingQrText??null,pairingError:s.data?.whatsapp?.pairingError??null},b={cliAvailable:s.data?.signal?.cliAvailable??!1,cliVersion:s.data?.signal?.cliVersion??null,cliError:s.data?.signal?.cliError??null},x=s.data?.hybridai?.apiKeyConfigured??!1;return(0,B.jsx)(`div`,{className:`page-stack`,children:(0,B.jsxs)(`div`,{className:`two-column-grid channels-layout`,children:[(0,B.jsx)(U,{children:(0,B.jsx)(`div`,{className:`list-stack selectable-list channel-catalog`,children:m.map(e=>(0,B.jsxs)(`button`,{className:e.kind===g?.kind?`selectable-row active channel-selectable-row`:`selectable-row channel-selectable-row`,type:`button`,onClick:()=>i(e.kind),children:[(0,B.jsxs)(`div`,{className:`channel-row-main`,children:[(0,B.jsx)(wc,{kind:e.kind}),(0,B.jsxs)(`div`,{className:`channel-row-copy`,children:[(0,B.jsx)(`strong`,{children:e.label}),(0,B.jsx)(`small`,{children:e.summary})]})]}),(0,B.jsx)(`div`,{className:`row-status-stack`,children:(0,B.jsx)(`span`,{className:`channel-status-badge channel-status-${e.statusTone}`,children:e.statusLabel})})]},e.kind))})}),(0,B.jsx)(Fc,{form:l,onSubmit:()=>p.mutate(u),children:(0,B.jsxs)(U,{id:g?.kind,variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:g?`${g.label} settings`:`Channels`})}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`stack-form`,children:[g?au(g.kind,u,l,e.token,_,x,v,b,c.data||[],n=>{let r={path:a.data?.path||``,config:n};t.setQueryData([`config`,e.token],r),f(n),t.invalidateQueries({queryKey:[`status`,e.token]})},e=>p.mutate(e),()=>{t.invalidateQueries({queryKey:[`status`,e.token]})}):null,(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{type:`submit`,loading:p.isPending,disabled:!d||p.isPending,children:p.isPending?`Saving...`:`Save channel settings`}),(0,B.jsx)(Z,{variant:`ghost`,type:`button`,disabled:!d||!a.data,onClick:()=>{a.data&&(p.reset(),l.discard())},children:`Reset changes`})]})]})})]})})]})})}var su=[`fatal`,`error`,`warn`,`info`,`debug`,`trace`,`silent`];function cu(e){let{isDirty:t,title:n=`Discard unsaved changes?`,description:r=`You have unsaved edits. Leaving this page will discard them.`,keepLabel:i=`Keep editing`,discardLabel:a=`Discard and leave`}=e,o=M({shouldBlockFn:({next:e,current:n})=>t&&e.pathname!==n.pathname,enableBeforeUnload:()=>t,withResolver:!0});return{dialog:(0,B.jsx)(ui,{open:o.status===`blocked`,onOpenChange:e=>{!e&&o.status===`blocked`&&o.reset()},children:(0,B.jsxs)(di,{role:`alertdialog`,size:`sm`,children:[(0,B.jsxs)(fi,{children:[(0,B.jsx)(pi,{children:n}),(0,B.jsx)(mi,{children:r})]}),(0,B.jsxs)(hi,{children:[(0,B.jsx)(Z,{variant:`ghost`,onClick:()=>{o.status===`blocked`&&o.reset()},children:i}),(0,B.jsx)(Z,{variant:`danger`,onClick:()=>{o.status===`blocked`&&o.proceed()},children:a})]})]})})}}function lu(e,t,n){return e.includes(t)?t:n}function uu(e,t){return e.includes(t)}var du={page:`_page_4ys0b_1`,content:`_content_4ys0b_9`,path:`_path_4ys0b_16`,statusInline:`_statusInline_4ys0b_21`,statusDot:`_statusDot_4ys0b_36`,formNote:`_formNote_4ys0b_45`,sectionDescription:`_sectionDescription_4ys0b_61`,sectionCard:`_sectionCard_4ys0b_66`,jsonField:`_jsonField_4ys0b_71`,poolStatusPending:`_poolStatusPending_4ys0b_75`,jsonEditor:`_jsonEditor_4ys0b_80`,navigationList:`_navigationList_4ys0b_85`,navigationRow:`_navigationRow_4ys0b_90`,navigationControl:`_navigationControl_4ys0b_100`,unavailable:`_unavailable_4ys0b_104`};function fu(e){return JSON.stringify(e,null,2)}var pu=`main`,mu=[{value:`local`,label:`Local (Playwright)`},{value:`camofox`,label:`Camoufox (anti-detection)`},{value:`managed-cloud`,label:`Managed cloud (Docker pool)`},{value:`browser-use-cloud`,label:`Browser Use cloud`},{value:`mac-cua`,label:`Mac CUA (native browser)`}],hu=/^\d+(?:\.\d+)?[kKmMgG]?$/,gu=48,_u=`(?:/(?!/).*|https?://.+)`,vu=`Use a local path starting with / or an http(s) URL.`,yu=`(?:|/(?!/).*|https?://.+)`,bu=`Use a local image path starting with / or an http(s) image URL.`,xu={href:``,label:``};function Su(){return{provider:`local`,allowPrivateNetwork:!1,local:{profileDir:``,headed:!1},camofox:{profileDir:``,headed:!1},managedCloud:{endpointUrl:`http://127.0.0.1:8787`,poolTokenRef:void 0,defaultTenantId:``,pricing:{actionUsd:0}},browserUseCloud:{apiKeyRef:void 0,projectId:``,profileId:``,region:``,keepAlive:!1,pricing:{browserUsdPerMinute:0,actionUsd:0}},macCua:{browser:`chrome`,driverCommand:``,driverArgs:[],screenshotMode:`som`}}}function Cu(e){try{let t=new URL(e),n=t.hostname.toLowerCase();return t.protocol===`http:`&&(n===`localhost`||n===`127.0.0.1`||n===`::1`)}catch{return!1}}function wu(e){return e.provider!==`managed-cloud`||!Cu(e.managedCloud.endpointUrl)||e.managedCloud.defaultTenantId.trim()?e:{...e,managedCloud:{...e.managedCloud,defaultTenantId:pu}}}function Tu(e){return wu({...Su(),...e.browser??{},local:{...Su().local,...e.browser?.local??{}},camofox:{...Su().camofox,...e.browser?.camofox??{}},managedCloud:{...Su().managedCloud,...e.browser?.managedCloud??{},pricing:{...Su().managedCloud.pricing,...e.browser?.managedCloud?.pricing??{}}},browserUseCloud:{...Su().browserUseCloud,...e.browser?.browserUseCloud??{},pricing:{...Su().browserUseCloud.pricing,...e.browser?.browserUseCloud?.pricing??{}}},macCua:{...Su().macCua,...e.browser?.macCua??{}}})}function Eu(e){return Array.isArray(e.ui?.navigation)?e.ui.navigation:Ea.map(e=>({...e}))}function Du(e){return e.trim()===``?`Required.`:e.length>gu?`Must be at most ${gu} characters.`:null}function Ou(e){let t=e.trim();if(t===``)return`Required.`;if(t.startsWith(`/`)){if(t.startsWith(`//`))return vu;try{return new URL(t,`http://127.0.0.1`),null}catch{return vu}}try{let e=new URL(t);return e.protocol===`http:`||e.protocol===`https:`?null:vu}catch{return vu}}function ku(e){let t=(e??``).trim();if(t===``)return null;if(t.startsWith(`/`)){if(t.startsWith(`//`))return bu;try{return new URL(t,`http://127.0.0.1`),null}catch{return bu}}try{let e=new URL(t);return e.protocol===`http:`||e.protocol===`https:`?null:bu}catch{return bu}}function Au(e,t){return e&&{...e,browser:t(Tu(e))}}function ju(e,t){return e&&{...e,ui:{...e.ui??{},navigation:t(Eu(e))}}}function Mu(e,t,n){e(e=>Au(e,e=>({...e,[t]:{...e[t],...n}})))}function Nu(e,t,n){e(e=>Au(e,e=>({...e,[t]:{...e[t],pricing:{...e[t].pricing,...n}}})))}function Pu(e){return e?e.status===`online`?`list-status list-status-success`:e.status===`offline`?`list-status list-status-danger`:`list-status list-status-warning`:`list-status`}function Fu(e){return e?e.status===`online`?`status-dot status-dot-success`:e.status===`offline`?`status-dot status-dot-danger`:`status-dot status-dot-warning`:`status-dot`}function Iu(e,t){return t?`checking`:e?e.status===`online`?`online - ${e.healthyNodeCount}/${e.nodeCount} nodes healthy`:`${e.status} - ${e.message}`:`not checked`}function Lu({provider:e,config:t,setDraft:n}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Profile directory`}),(0,B.jsx)(Y,{value:t.profileDir,onChange:t=>Mu(n,e,{profileDir:t.target.value})})]}),(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:t.headed,onCheckedChange:t=>Mu(n,e,{headed:t})}),(0,B.jsxs)(qo,{children:[(0,B.jsx)(J,{children:`Headed browser`}),(0,B.jsx)(Yo,{children:`Show the browser window instead of running headless.`})]})]})]})}function Ru({items:e,setDraft:t}){let n=(0,R.useRef)(0),r=(0,R.useRef)([]),i=e=>{for(;r.current.length<=e;){let e=n.current;n.current+=1,r.current.push(`navigation-row-${e}`)}return r.current[e]},a=(e,n)=>{t(t=>ju(t,t=>t.map((t,r)=>r===e?{...t,...n}:t)))},o=e=>{r.current.splice(e,1),t(t=>ju(t,t=>t.filter((t,n)=>n!==e)))};return(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Navigation links`}),(0,B.jsxs)(Yo,{children:[`Local paths like `,(0,B.jsx)(`code`,{children:`/admin/channels`}),` and HTTP(S) URLs are shown in the top navigation strip. Optional image paths or URLs render as the link icon.`]}),e.length>0?(0,B.jsx)(`div`,{className:du.navigationList,children:e.map((e,t)=>{let n=i(t);return(0,B.jsxs)(`div`,{className:du.navigationRow,children:[(0,B.jsxs)(q,{required:!0,error:Du(e.label),className:du.navigationControl,children:[(0,B.jsx)(Y,{"aria-label":`Navigation item ${t+1} label`,value:e.label,placeholder:`Link text`,maxLength:gu,onChange:e=>a(t,{icon:void 0,label:e.target.value})}),(0,B.jsx)(Zo,{})]}),(0,B.jsxs)(q,{required:!0,error:Ou(e.href),className:du.navigationControl,children:[(0,B.jsx)(Y,{"aria-label":`Navigation item ${t+1} href`,value:e.href,placeholder:`/admin/channels or https://hybridclaw.io`,pattern:_u,title:vu,onChange:e=>a(t,{href:e.target.value,icon:void 0})}),(0,B.jsx)(Zo,{})]}),(0,B.jsxs)(q,{error:ku(e.image),className:du.navigationControl,children:[(0,B.jsx)(Y,{"aria-label":`Navigation item ${t+1} image`,value:e.image??``,placeholder:`/icons/hybridai.png`,pattern:yu,title:bu,onChange:e=>a(t,{image:e.target.value.trim()?e.target.value:void 0})}),(0,B.jsx)(Zo,{})]}),(0,B.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Remove navigation item ${t+1}`,onClick:()=>o(t),children:(0,B.jsx)(Hr,{width:15,height:15})})]},n)})}):(0,B.jsx)(`p`,{className:`muted-copy`,children:`No navigation links configured.`}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{type:`button`,variant:`ghost`,onClick:()=>{let e=n.current;n.current+=1,r.current.push(`navigation-row-${e}`),t(e=>ju(e,e=>[...e,{...xu}]))},children:`Add link`})})]})}function zu(){let e=Zn(),t=Ss(),n=o(),[r,i]=(0,R.useState)(`form`),[a,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(null),u=y({queryKey:[`config`,e.token],queryFn:()=>Nt(e.token)}),d=Pc({source:u.data?.config}),{draft:f,setDraft:p,isDirty:m,discard:h,commit:_}=d,v=(0,R.useMemo)(()=>u.data?fu(u.data.config):``,[u.data]),b=(0,R.useRef)(!1);!b.current&&v!==``&&(b.current=!0,s(v));let x=r===`json`?a!==v:m,S=Hc({mutationFn:t=>zt(e.token,t),onSuccess:r=>{n.setQueryData([`config`,e.token],r),_(r.config),s(fu(r.config)),l(null),t.success(`Runtime config saved.`)},onError:e=>{t.error(`Save failed`,e.message)}}),C=f?Tu(f):Su(),w=u.data?.config.browser?.provider??`local`,T=C.provider!==w,E=C.managedCloud.poolTokenRef?.id??``,O=C.browserUseCloud.apiKeyRef?.id??``,k=y({queryKey:[`browser-pool-health`,e.token,C.provider,C.managedCloud.endpointUrl],queryFn:()=>It(e.token),enabled:!!(f&&r===`form`&&C.provider===`managed-cloud`),refetchInterval:15e3}),A=k.data,j=g({mutationFn:()=>Lt(e.token),onSuccess:e=>{e.ok?t.success(`Browser pool start requested.`,e.message):t.error(`Browser pool did not start`,e.message),e.poolTokenRefId&&Mu(p,`managedCloud`,{poolTokenRef:{source:`store`,id:e.poolTokenRefId}}),u.refetch(),k.refetch()},onError:e=>{t.error(`Browser pool start failed`,H(e))}}),M=(0,R.useCallback)(e=>{s(e);try{JSON.parse(e),l(null)}catch(e){l(H(e))}},[]),{dialog:N}=cu({isDirty:x,description:`You have unsaved edits to the runtime config. Leaving this page will discard them.`});if(u.isLoading&&!f)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading runtime config…`});if(!f||!u.data)return(0,B.jsxs)(`div`,{className:du.unavailable,children:[(0,B.jsx)(`p`,{children:`Runtime config is unavailable.`}),(0,B.jsx)(Z,{variant:`ghost`,onClick:()=>void u.refetch(),disabled:u.isFetching,children:u.isFetching?`Retrying…`:`Retry`})]});let P=C,F=Eu(f),I=e=>{let t=e===`json`?`json`:`form`;if(t!==r){if(t===`form`){try{p(JSON.parse(a)),l(null),i(`form`)}catch(e){l(H(e))}return}s(fu(f)),l(null),i(`json`)}},ee=()=>{h(),u.data&&s(fu(u.data.config)),l(null)},L=()=>{if(r===`json`){try{let e=JSON.parse(a);p(e),l(null),S.mutate(e)}catch(e){l(H(e))}return}S.mutate(f)},te=S.isPending||(r===`json`?!!c:!d.isValid);return(0,B.jsxs)(Fc,{form:d,className:du.page,onSubmit:L,children:[(0,B.jsx)(Ya,{description:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:du.path,children:u.data.path}),x?(0,B.jsxs)(`span`,{className:du.statusInline,children:[(0,B.jsx)(`span`,{className:du.statusDot,"aria-hidden":`true`}),`Unsaved changes`]}):(0,B.jsx)(`span`,{className:du.statusInline,children:`Saved`})]}),actions:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(Ga,{ariaLabel:`Editor view`,value:r,onValueChange:I,size:`sm`,children:[(0,B.jsx)(Ka,{value:`form`,children:`Form`}),(0,B.jsx)(Ka,{value:`json`,children:`JSON`})]}),x?(0,B.jsx)(Z,{variant:`ghost`,onClick:ee,children:`Discard`}):null,x||S.isPending?(0,B.jsx)(Z,{type:`submit`,loading:S.isPending,disabled:te,children:S.isPending?`Saving…`:`Save changes`}):null]})}),(0,B.jsxs)(`p`,{className:du.formNote,children:[`Form covers core runtime fields. For the full schema (channels, deployment, plugins, scheduler…) switch to `,(0,B.jsx)(`strong`,{children:`JSON`}),`.`]}),(0,B.jsx)(`div`,{className:du.content,children:r===`json`?(0,B.jsxs)(q,{className:du.jsonField,invalid:!!c,children:[(0,B.jsx)(J,{children:`config.json`}),(0,B.jsx)(ts,{className:`code-editor ${du.jsonEditor}`,spellCheck:!1,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,value:a,onChange:e=>M(e.target.value)}),(0,B.jsx)(Zo,{children:c})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(U,{className:du.sectionCard,children:(0,B.jsxs)(Ho,{children:[(0,B.jsx)(Uo,{children:`Operations`}),(0,B.jsx)(Yo,{className:du.sectionDescription,children:`Gateway listener and log verbosity.`}),(0,B.jsxs)(Wo,{children:[(0,B.jsx)($,{name:`ops.healthHost`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Health host`}),(0,B.jsx)(Y,{...e}),(0,B.jsxs)(Yo,{children:[`Interface the gateway binds to. Use`,` `,(0,B.jsx)(`code`,{children:`127.0.0.1`}),` for loopback-only.`]})]})}),(0,B.jsx)($,{name:`ops.healthPort`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Health port`}),(0,B.jsx)(Rc,{integer:!0,min:1,max:65535,value:e.value,onValueChange:e.onChange}),(0,B.jsx)(Zo,{})]})}),(0,B.jsx)($,{name:`ops.logLevel`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Log level`}),(0,B.jsx)(vs,{value:e.value,onChange:t=>{let n=t.target.value;uu(su,n)&&e.onChange(n)},children:su.map(e=>(0,B.jsx)(Q,{value:e,children:e},e))})]})}),(0,B.jsx)($,{name:`ops.gatewayBaseUrl`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Gateway public URL`}),(0,B.jsx)(Y,{...e}),(0,B.jsx)(Yo,{children:`Externally reachable URL used for webhooks and public callbacks.`})]})}),(0,B.jsx)($,{name:`ops.gatewayInternalBaseUrl`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Gateway internal URL`}),(0,B.jsx)(Y,{...e}),(0,B.jsx)(Yo,{children:`Local URL used by TUI, containers, and host-side gateway clients.`})]})})]})]})}),(0,B.jsx)(U,{className:du.sectionCard,children:(0,B.jsxs)(Ho,{children:[(0,B.jsx)(Uo,{children:`Navigation`}),(0,B.jsx)(Yo,{className:du.sectionDescription,children:`Top-level links shown in the console navigation strip.`}),(0,B.jsx)(Wo,{children:(0,B.jsx)(Ru,{items:F,setDraft:p})})]})}),(0,B.jsx)(U,{className:du.sectionCard,children:(0,B.jsxs)(Ho,{children:[(0,B.jsx)(Uo,{children:`Security`}),(0,B.jsx)(Yo,{className:du.sectionDescription,children:`Sensitive-content guards applied to agent output.`}),(0,B.jsx)(Wo,{children:(0,B.jsx)($,{name:`security.confidentialRedactionEnabled`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsxs)(qo,{children:[(0,B.jsx)(J,{children:`Confidential leak guard`}),(0,B.jsx)(Yo,{children:`Redact secrets and sensitive patterns before they leave the agent.`})]})]})})})]})}),(0,B.jsx)(U,{className:du.sectionCard,children:(0,B.jsxs)(Ho,{children:[(0,B.jsx)(Uo,{children:`HybridAI`}),(0,B.jsx)(Yo,{className:du.sectionDescription,children:`HybridAI provider defaults.`}),(0,B.jsxs)(Wo,{children:[(0,B.jsx)($,{name:`hybridai.baseUrl`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Base URL`}),(0,B.jsx)(Y,{type:`url`,...e})]})}),(0,B.jsx)($,{name:`hybridai.defaultModel`,render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Default model`}),(0,B.jsx)(Y,{...e})]})}),(0,B.jsx)($,{name:`hybridai.enableRag`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsxs)(qo,{children:[(0,B.jsx)(J,{children:`RAG default`}),(0,B.jsx)(Yo,{children:`Enable retrieval augmentation by default for new conversations.`})]})]})})]})]})}),(0,B.jsx)(U,{className:du.sectionCard,children:(0,B.jsxs)(Ho,{children:[(0,B.jsx)(Uo,{children:`Container`}),(0,B.jsx)(Yo,{className:du.sectionDescription,children:`Sandboxed container runtime for tool execution.`}),(0,B.jsxs)(Wo,{children:[(0,B.jsx)($,{name:`container.memory`,rules:[Ro(),zo(hu,`Use a number with optional k, m, or g suffix.`)],render:({field:e})=>(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Memory`}),(0,B.jsx)(Y,{...e,placeholder:`1024m`}),(0,B.jsxs)(Yo,{children:[`Docker memory limit. e.g. `,(0,B.jsx)(`code`,{children:`512m`}),`,`,` `,(0,B.jsx)(`code`,{children:`1g`}),`, `,(0,B.jsx)(`code`,{children:`2048m`}),`.`]}),(0,B.jsx)(Zo,{})]})}),(0,B.jsx)($,{name:`container.persistBashState`,render:({field:e})=>(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!!e.value,onCheckedChange:e.onChange}),(0,B.jsxs)(qo,{children:[(0,B.jsx)(J,{children:`Persistent bash state`}),(0,B.jsx)(Yo,{children:`Reuse the same shell across tool calls so cwd, env, and aliases survive.`})]})]})})]})]})}),(0,B.jsx)(U,{className:du.sectionCard,children:(0,B.jsxs)(Ho,{children:[(0,B.jsx)(Uo,{children:`Browser`}),(0,B.jsx)(Yo,{className:du.sectionDescription,children:`Browser provider used for agent web tasks.`}),(0,B.jsxs)(Wo,{children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Provider`}),(0,B.jsx)(vs,{value:P.provider,onChange:e=>p(t=>Au(t,t=>({...t,provider:e.target.value}))),children:mu.map(e=>(0,B.jsx)(Q,{value:e.value,children:e.label},e.value))})]}),(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:P.allowPrivateNetwork,onCheckedChange:e=>p(t=>Au(t,t=>({...t,allowPrivateNetwork:e})))}),(0,B.jsxs)(qo,{children:[(0,B.jsx)(J,{children:`Allow private network navigation`}),(0,B.jsx)(Yo,{children:`Allow the browser to navigate to private and loopback network addresses.`})]})]}),P.provider===`local`?(0,B.jsx)(Lu,{provider:`local`,config:P.local,setDraft:p}):null,P.provider===`camofox`?(0,B.jsx)(Lu,{provider:`camofox`,config:P.camofox,setDraft:p}):null,P.provider===`managed-cloud`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Pool status`}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsxs)(`span`,{className:Pu(A),children:[(0,B.jsx)(`span`,{className:Fu(A)}),Iu(A,k.isLoading)]}),(0,B.jsx)(Z,{variant:`ghost`,type:`button`,disabled:k.isFetching,onClick:()=>void k.refetch(),children:k.isFetching?`Checking...`:`Check now`}),(0,B.jsx)(Z,{variant:`ghost`,type:`button`,disabled:j.isPending,onClick:()=>j.mutate(),children:j.isPending?`Starting...`:`Start Docker pool`})]}),T?(0,B.jsxs)(Yo,{className:du.poolStatusPending,children:[`Pending save — status above reflects the previously saved provider (`,w,`). Save changes to refresh.`]}):null]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Pool endpoint URL`}),(0,B.jsx)(Y,{type:`url`,value:P.managedCloud.endpointUrl,onChange:e=>Mu(p,`managedCloud`,{endpointUrl:e.target.value})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Pool token SecretRef id`}),(0,B.jsx)(Y,{value:E,placeholder:`MANAGED_BROWSER_POOL_TOKEN`,onChange:e=>{let t=e.target.value.trim();Mu(p,`managedCloud`,{poolTokenRef:t?{source:`store`,id:t}:void 0})}})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Default tenant id (optional)`}),(0,B.jsx)(Y,{value:P.managedCloud.defaultTenantId,placeholder:`Uses agent id when blank`,onChange:e=>Mu(p,`managedCloud`,{defaultTenantId:e.target.value})})]}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(D,{to:`/admin/approvals`,className:`ghost-button`,children:`Manage network policy`})}),(0,B.jsxs)(q,{controlId:`managed-cloud-action-usd`,children:[(0,B.jsx)(J,{children:`Action price USD`}),(0,B.jsx)(Rc,{id:`managed-cloud-action-usd`,min:0,emptyValue:0,value:P.managedCloud.pricing.actionUsd,onValueChange:e=>Nu(p,`managedCloud`,{actionUsd:e})}),(0,B.jsx)(Zo,{})]})]}):null,P.provider===`browser-use-cloud`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`API key SecretRef id`}),(0,B.jsx)(Y,{value:O,onChange:e=>{let t=e.target.value.trim();Mu(p,`browserUseCloud`,{apiKeyRef:t?{source:`store`,id:t}:void 0})}})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Project id`}),(0,B.jsx)(Y,{value:P.browserUseCloud.projectId,onChange:e=>Mu(p,`browserUseCloud`,{projectId:e.target.value})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Profile id`}),(0,B.jsx)(Y,{value:P.browserUseCloud.profileId,onChange:e=>Mu(p,`browserUseCloud`,{profileId:e.target.value})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Region`}),(0,B.jsx)(Y,{value:P.browserUseCloud.region,onChange:e=>Mu(p,`browserUseCloud`,{region:e.target.value})})]}),(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:P.browserUseCloud.keepAlive,onCheckedChange:e=>Mu(p,`browserUseCloud`,{keepAlive:e})}),(0,B.jsxs)(qo,{children:[(0,B.jsx)(J,{children:`Keep alive`}),(0,B.jsx)(Yo,{children:`Keep the cloud browser session alive between calls instead of tearing it down.`})]})]}),(0,B.jsxs)(q,{controlId:`browser-use-browser-usd`,children:[(0,B.jsx)(J,{children:`Browser price USD/min`}),(0,B.jsx)(Rc,{id:`browser-use-browser-usd`,min:0,emptyValue:0,value:P.browserUseCloud.pricing.browserUsdPerMinute,onValueChange:e=>Nu(p,`browserUseCloud`,{browserUsdPerMinute:e})}),(0,B.jsx)(Zo,{})]}),(0,B.jsxs)(q,{controlId:`browser-use-action-usd`,children:[(0,B.jsx)(J,{children:`Action price USD`}),(0,B.jsx)(Rc,{id:`browser-use-action-usd`,min:0,emptyValue:0,value:P.browserUseCloud.pricing.actionUsd,onValueChange:e=>Nu(p,`browserUseCloud`,{actionUsd:e})}),(0,B.jsx)(Zo,{})]})]}):null,P.provider===`mac-cua`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Native browser`}),(0,B.jsxs)(vs,{value:P.macCua.browser,onChange:e=>p(t=>Au(t,t=>({...t,macCua:{...t.macCua,browser:e.target.value}}))),children:[(0,B.jsx)(Q,{value:`safari`,children:`safari`}),(0,B.jsx)(Q,{value:`chrome`,children:`chrome`}),(0,B.jsx)(Q,{value:`firefox`,children:`firefox`}),(0,B.jsx)(Q,{value:`brave`,children:`brave`}),(0,B.jsx)(Q,{value:`arc`,children:`arc`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Driver command`}),(0,B.jsx)(Y,{value:P.macCua.driverCommand,placeholder:`cua-driver`,onChange:e=>p(t=>Au(t,t=>({...t,macCua:{...t.macCua,driverCommand:e.target.value}})))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Driver args`}),(0,B.jsx)(Y,{value:P.macCua.driverArgs.join(` `),placeholder:`mcp --no-daemon-relaunch`,onChange:e=>p(t=>Au(t,t=>({...t,macCua:{...t.macCua,driverArgs:e.target.value.split(/\s+/u).map(e=>e.trim()).filter(Boolean)}})))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Screenshot mode`}),(0,B.jsxs)(vs,{value:P.macCua.screenshotMode,onChange:e=>p(t=>Au(t,t=>({...t,macCua:{...t.macCua,screenshotMode:e.target.value}}))),children:[(0,B.jsx)(Q,{value:`som`,children:`som`}),(0,B.jsx)(Q,{value:`vision`,children:`vision`}),(0,B.jsx)(Q,{value:`ax`,children:`ax`})]})]})]}):null]})]})})]})}),N]})}var Bu=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%20role='img'%20aria-label='LM%20Studio'%3e%3cdefs%3e%3clinearGradient%20id='lmstudio-bg'%20x1='84'%20y1='37'%20x2='426'%20y2='473'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%236f7df1'/%3e%3cstop%20offset='0.53'%20stop-color='%235c3de1'/%3e%3cstop%20offset='1'%20stop-color='%234c0fcb'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20width='512'%20height='512'%20rx='108'%20fill='url(%23lmstudio-bg)'/%3e%3cg%20opacity='.72'%20fill='%23b5a9f3'%3e%3crect%20x='68'%20y='91'%20width='290'%20height='43'%20rx='21.5'/%3e%3crect%20x='156'%20y='150'%20width='290'%20height='43'%20rx='21.5'/%3e%3crect%20x='105'%20y='208'%20width='290'%20height='43'%20rx='21.5'/%3e%3crect%20x='40'%20y='269'%20width='291'%20height='43'%20rx='21.5'/%3e%3crect%20x='105'%20y='327'%20width='290'%20height='43'%20rx='21.5'/%3e%3crect%20x='245'%20y='385'%20width='214'%20height='43'%20rx='21.5'/%3e%3c/g%3e%3cg%20fill='%23f2f1ff'%20opacity='.95'%3e%3crect%20x='68'%20y='91'%20width='223'%20height='43'%20rx='21.5'/%3e%3crect%20x='156'%20y='150'%20width='223'%20height='43'%20rx='21.5'/%3e%3crect%20x='105'%20y='208'%20width='222'%20height='43'%20rx='21.5'/%3e%3crect%20x='40'%20y='269'%20width='223'%20height='43'%20rx='21.5'/%3e%3crect%20x='105'%20y='327'%20width='222'%20height='43'%20rx='21.5'/%3e%3crect%20x='245'%20y='385'%20width='146'%20height='43'%20rx='21.5'/%3e%3c/g%3e%3cg%20fill='%23fff'%20opacity='.22'%3e%3crect%20x='135'%20y='91'%20width='156'%20height='43'%20rx='21.5'/%3e%3crect%20x='224'%20y='150'%20width='155'%20height='43'%20rx='21.5'/%3e%3crect%20x='173'%20y='208'%20width='154'%20height='43'%20rx='21.5'/%3e%3crect%20x='108'%20y='269'%20width='155'%20height='43'%20rx='21.5'/%3e%3crect%20x='173'%20y='327'%20width='154'%20height='43'%20rx='21.5'/%3e%3crect%20x='312'%20y='385'%20width='79'%20height='43'%20rx='21.5'/%3e%3c/g%3e%3c/svg%3e`;function Vu(e){return(0,B.jsxs)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:`18`,height:`18`,viewBox:`0 0 100 100`,xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,...e,children:[(0,B.jsxs)(`defs`,{children:[(0,B.jsx)(`style`,{children:`
5
5
  .cls-1 {
6
6
  fill: url(#Unbenannter_Verlauf_8);
7
7
  }
@@ -65,16 +65,16 @@ import{n as e,t}from"./rolldown-runtime-Bh1tDfsg.js";import{t as n}from"./vendor
65
65
  .cls-16 {
66
66
  fill: #fdfdfd;
67
67
  }
68
- `}),(0,B.jsxs)(`linearGradient`,{id:`Unbenannter_Verlauf`,"data-name":`Unbenannter Verlauf`,x1:`62.68`,y1:`5028.38`,x2:`63.52`,y2:`5090.47`,gradientTransform:`translate(0 -4996)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`0`,stopColor:`#5be4d0`}),(0,B.jsx)(`stop`,{offset:`.91`,stopColor:`#02a4af`})]}),(0,B.jsxs)(`linearGradient`,{id:`Unbenannter_Verlauf_2`,"data-name":`Unbenannter Verlauf 2`,x1:`36.32`,y1:`5018.17`,x2:`36.05`,y2:`5104.72`,gradientTransform:`translate(0 -4996)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`0`,stopColor:`#39556d`}),(0,B.jsx)(`stop`,{offset:`.45`,stopColor:`#172e3e`})]}),(0,B.jsx)(`clipPath`,{id:`clippath`,children:(0,B.jsx)(`path`,{className:`cls-6`,d:`M48.59,21.94c-.27,1.07-2.63,2.32-3.79,2.03-.12.12.17,2.89.34,3.18.34.6,3.5,1.91,3.43,3.2v28.15c-.79,2.71-1.21,4.65-3.52,6.49-3.23,2.57-4.41,3.29-4.59,4.63-.07.53.04,1.33.94,2.41-3.41-.36-6.06,1.57-6.37,3.71-.25,1.75,1.12,3.23,1.41,3.52-.6.78-.66,1.85-.17,2.68.53.89,1.61,1.33,2.64,1.06,0,1.92.6,2.77,1.09,3.19,1.66,1.42,6.12,1.38,7.62,1.7.17.04.5.12.72.39.21.26.23.57.24.71.04.66.06,3.37.04,7.07-.02.09-.07.2-.16.3-.29.33-.77.27-.82.27-.42,0-.97-.03-1.61-.09-9.48-.93-21.38-9.25-22.38-20.97-.56-6.54,2.51-14.53,9.13-16.87,3.83-1.35,9.02.73,11.15-4.02.67-1.49.79-2.05,1.62-3.53,1.66-2.98-.86-3.21-1.26-4.62-.48-1.68.29-2.63-1.54-4.14-2.91-2.41-6.47-.98-10.08-3.2-12.84-7.88-7.65-25.88,3.73-32.41,1.58-.9,3.98-1.98,5.88-2.52.92-.26,6.29-1.73,6.29-.21v17.88h0ZM39.84,16.17c-3.58.81-1.35,6.98,2.22,4.93,2.72-1.56.91-5.63-2.22-4.93Z`})}),(0,B.jsx)(`clipPath`,{id:`clippath-1`,children:(0,B.jsx)(`path`,{className:`cls-6`,d:`M51.3,3.79c.15-.48,1.05-.43,1.48-.41,12.78.68,25.98,15.26,21.22,28.25-1.16,3.18-4.46,7.04-7.61,8.37-3.14,1.32-6.81.02-9.37,2.55-1.02,1.01-1.08,2.36-1.6,3.55-.7,1.62-1.98,2.42-1.28,4.7.13.42,1.58,3.2,1.9,3.79,2.94,5.37,8.02,2.21,12.58,5.03,5.49,3.39,7.48,9.48,7.08,15.7-.72,11.03-12.65,20.43-23.21,21.23-.35.03-1.45.08-1.45-.38v-7.04c0-1.51,2.33-1.04,3.33-1.28,1.87-.45,7.03-5.48,8.05-7.12,2.33-3.71,2.29-7.97-.55-11.38-3.37-4.04-9.45-3.09-10.5-9.28l-.08-29.2c.44-1.87,2.65-3.97,2.45-5.95-.07-.73-2.44-2.1-2.44-2.71V3.78h0ZM60.96,20.63c2.9-2.93-2.7-6.43-4.04-3.36-1.4,3.19,1.88,5.54,4.04,3.36Z`})}),(0,B.jsxs)(`radialGradient`,{id:`Unbenannter_Verlauf_3`,"data-name":`Unbenannter Verlauf 3`,cx:`52.83`,cy:`5070.22`,fx:`52.83`,fy:`5070.22`,r:`7.54`,gradientTransform:`translate(0 -4996)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`0`,stopColor:`#5be4d0`}),(0,B.jsx)(`stop`,{offset:`.53`,stopColor:`#2ac0bd`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#02a4af`})]}),(0,B.jsxs)(`linearGradient`,{id:`Unbenannter_Verlauf_4`,"data-name":`Unbenannter Verlauf 4`,x1:`20.16`,y1:`5038.91`,x2:`35.48`,y2:`5038.91`,gradientTransform:`translate(0 -4996)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`0`,stopColor:`#20b1e6`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#02a4af`})]}),(0,B.jsxs)(`linearGradient`,{id:`Unbenannter_Verlauf_5`,"data-name":`Unbenannter Verlauf 5`,x1:`19.83`,y1:`2528.13`,x2:`43.54`,y2:`2558.18`,gradientTransform:`translate(0 -2498)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`.12`,stopColor:`#35c5c1`}),(0,B.jsx)(`stop`,{offset:`.34`,stopColor:`#33c3c0`}),(0,B.jsx)(`stop`,{offset:`.42`,stopColor:`#2cbfbd`}),(0,B.jsx)(`stop`,{offset:`.47`,stopColor:`#20b7b9`}),(0,B.jsx)(`stop`,{offset:`.52`,stopColor:`#0facb3`}),(0,B.jsx)(`stop`,{offset:`.55`,stopColor:`#02a4af`})]}),(0,B.jsxs)(`linearGradient`,{id:`Unbenannter_Verlauf_6`,"data-name":`Unbenannter Verlauf 6`,x1:`-27.58`,y1:`-2877.98`,x2:`-16.73`,y2:`-2877.98`,gradientTransform:`translate(-2855.34 111.14) rotate(89.2)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`0`,stopColor:`#20b1e6`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#02a4af`})]}),(0,B.jsxs)(`linearGradient`,{id:`Unbenannter_Verlauf_7`,"data-name":`Unbenannter Verlauf 7`,x1:`91.82`,y1:`5045`,x2:`95.76`,y2:`5045`,gradientTransform:`translate(0 -4996)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`0`,stopColor:`#5be4d0`}),(0,B.jsx)(`stop`,{offset:`.71`,stopColor:`#0babb2`}),(0,B.jsx)(`stop`,{offset:`.8`,stopColor:`#02a4af`})]}),(0,B.jsxs)(`linearGradient`,{id:`Unbenannter_Verlauf_8`,"data-name":`Unbenannter Verlauf 8`,x1:`-5191.49`,y1:`2547.08`,x2:`-5147.38`,y2:`2547.08`,gradientTransform:`translate(-5087.3 -2498) rotate(-180) scale(1 -1)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`0`,stopColor:`#68e2cf`}),(0,B.jsx)(`stop`,{offset:`.27`,stopColor:`#65e0cd`}),(0,B.jsx)(`stop`,{offset:`.46`,stopColor:`#5bdac8`}),(0,B.jsx)(`stop`,{offset:`.63`,stopColor:`#4cd0c1`}),(0,B.jsx)(`stop`,{offset:`.79`,stopColor:`#36c2b6`}),(0,B.jsx)(`stop`,{offset:`.93`,stopColor:`#19b0a8`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#09a6a0`})]})]}),(0,B.jsxs)(`g`,{id:`Figur`,children:[(0,B.jsxs)(`g`,{id:`Figure`,children:[(0,B.jsx)(`path`,{id:`Fill_R`,"data-name":`Fill R`,className:`cls-12`,d:`M51.3,3.79c.15-.48,1.05-.43,1.48-.41,12.78.68,25.98,15.26,21.22,28.25-1.16,3.18-4.46,7.04-7.61,8.37-3.14,1.32-6.81.02-9.37,2.55-1.02,1.01-1.08,2.36-1.6,3.55-.7,1.62-1.98,2.42-1.28,4.7.13.42,1.58,3.2,1.9,3.79,2.94,5.37,8.02,2.21,12.58,5.03,5.49,3.39,7.48,9.48,7.08,15.7-.72,11.03-12.65,20.43-23.21,21.23-.35.03-1.45.08-1.45-.38v-7.04c0-1.51,2.33-1.04,3.33-1.28,1.87-.45,7.03-5.48,8.05-7.12,2.33-3.71,2.29-7.97-.55-11.38-3.37-4.04-9.45-3.09-10.5-9.28l-.08-29.2c.44-1.87,2.65-3.97,2.45-5.95-.07-.73-2.44-2.1-2.44-2.71V3.78h0ZM60.96,20.63c2.9-2.93-2.7-6.43-4.04-3.36-1.4,3.19,1.88,5.54,4.04,3.36Z`}),(0,B.jsx)(`path`,{id:`Fill_L`,"data-name":`Fill L`,className:`cls-15`,d:`M48.59,21.94c-.27,1.07-2.63,2.32-3.79,2.03-.12.12.17,2.89.34,3.18.34.6,3.5,1.91,3.43,3.2v28.15c-.79,2.71-1.21,4.65-3.52,6.49-3.23,2.57-4.41,3.29-4.59,4.63-.07.53.04,1.33.94,2.41-3.41-.36-6.06,1.57-6.37,3.71-.25,1.75,1.12,3.23,1.41,3.52-.6.78-.66,1.85-.17,2.68.53.89,1.61,1.33,2.64,1.06,0,1.92.6,2.77,1.09,3.19,1.66,1.42,6.12,1.38,7.62,1.7.17.04.5.12.72.39.21.26.23.57.24.71.04.66.06,3.37.04,7.07-.02.09-.07.2-.16.3-.29.33-.77.27-.82.27-.42,0-.97-.03-1.61-.09-9.48-.93-21.38-9.25-22.38-20.97-.56-6.54,2.51-14.53,9.13-16.87,3.83-1.35,9.02.73,11.15-4.02.67-1.49.79-2.05,1.62-3.53,1.66-2.98-.86-3.21-1.26-4.62-.48-1.68.29-2.63-1.54-4.14-2.91-2.41-6.47-.98-10.08-3.2-12.84-7.88-7.65-25.88,3.73-32.41,1.58-.9,3.98-1.98,5.88-2.52.92-.26,6.29-1.73,6.29-.21v17.88h0ZM39.84,16.17c-3.58.81-1.35,6.98,2.22,4.93,2.72-1.56.91-5.63-2.22-4.93Z`}),(0,B.jsx)(`g`,{id:`Shadow_L`,"data-name":`Shadow L`,children:(0,B.jsx)(`g`,{className:`cls-14`,children:(0,B.jsx)(`path`,{className:`cls-4`,d:`M33.96,40.53c1.09.13,6.42.89,9.44,5.42.96,1.44,1.43,2.88,1.67,4.01-4.13,2.33-8.25,4.65-12.38,6.98,4.72,1.87,9.51,1.24,12.16-1.58,2.35-2.5,2.19-5.86,2.2-6.71.04-8.77-13.59-14.58-13.59-14.58,0,0-10.86-4.94-8.19-11.91.24-.63.21-1.38.21-1.38,0,0-.71,4.49-1.33,8.47,1.68,2.85,3.36,5.7,5.03,8.55,1.59.91,3.18,1.82,4.77,2.73h0Z`})})}),(0,B.jsx)(`g`,{id:`Shadow_R`,"data-name":`Shadow R`,children:(0,B.jsx)(`g`,{className:`cls-9`,children:(0,B.jsx)(`path`,{className:`cls-13`,d:`M58.7,49.36c2.31,2.67,4.63,5.35,6.94,8.02-4.11,1.28-8.2.53-10.6-2.02-2.35-2.49-2.19-5.81-2.2-6.71-.04-8.77,13.59-14.58,13.59-14.58,0,0,10.86-4.94,8.19-11.91-.23-.6-.37-1.3-.21-1.38.6-.3,7.63,6.79,5.78,12.68-1.12,3.57-5.3,6.04-10.22,6.64-3.76,3.08-7.52,6.17-11.28,9.25Z`})})})]}),(0,B.jsxs)(`g`,{id:`Hand`,children:[(0,B.jsx)(`path`,{className:`cls-2`,d:`M53.42,82.51c.76.02,1.28.69,1.18,1.3-.08.51-.6.93-1.22.91-3.61-.02-7.23-.05-10.84-.07-.58-.11-.99-.63-.94-1.19.04-.49.42-.92.93-1.01,3.63.02,7.26.04,10.89.07h0Z`}),(0,B.jsx)(`path`,{className:`cls-3`,d:`M58.98,69.91c.58.53,2.13,1.97,2.51,4.31.18,1.08.03,2.26-.54,3.7-.15.38-1.26,2.39-1.4,2.39-.62.02-.82-1.22-2.04-2.85-1.01-1.34-1.61-1.48-3.1-2.87-.88-.82-2.08-2.09-3.3-3.96l-5.58-.03c-.96-.04-1.57-.87-1.43-1.53.11-.52.67-.96,1.36-.97l11.13.28c.61.25,1.5.71,2.39,1.52h0Z`}),(0,B.jsx)(`path`,{className:`cls-2`,d:`M57,79.92c-.78-1.51-1.85-2.04-4.42-3.73-3.49-2.29-3.5-2.63-4.77-2.96-.48-.13-.34-.04-4.3-.13-2.96-.07-4.54-.15-4.97.68-.25.48,0,.98-.48,1.48-.38.39-.79.35-1.02.8-.19.37-.08.76-.05.86.19.64.98,1.1,1.95,1.11,3.89.07,7.78.13,11.68.19.38-.02.7.28.69.65,0,.35-.31.64-.68.63-1.13,0-2.26-.02-3.39-.02-2.76-.01-5.53-.02-8.29-.03-.09.03-.94.36-.96.87-.01.45.64.78.93.93,2.1,1.07,5.93.04,8.32.06.32,0,5.81.04,6.13.04,1.02.72,1.93.91,2.45.97.57.07,1.25.14,1.57-.24.47-.57-.19-1.81-.37-2.16h0ZM48.24,75.4c-1.37,0-2.74,0-4.12.01l-3.64-.02c-.19,0-.32-.16-.3-.31.02-.13.15-.24.31-.23,1.21,0,2.43,0,3.64,0,1.37,0,2.74.02,4.12.03.21-.02.35.14.35.28,0,.13-.17.27-.36.24h0Z`})]}),(0,B.jsxs)(`g`,{id:`Eyes`,children:[(0,B.jsx)(`path`,{className:`cls-16`,d:`M39.84,16.17c3.13-.71,4.94,3.37,2.22,4.93-3.58,2.05-5.81-4.12-2.22-4.93Z`}),(0,B.jsx)(`path`,{className:`cls-16`,d:`M60.96,20.63c-2.16,2.19-5.44-.17-4.04-3.36,1.34-3.07,6.95.43,4.04,3.36Z`})]})]}),(0,B.jsxs)(`g`,{id:`BG_L`,"data-name":`BG L`,children:[(0,B.jsx)(`path`,{className:`cls-10`,d:`M5.05,64.53c-1.61-1.06-.57-4.78,2.09-3.58,2.48,1.12.32,5.16-2.09,3.58Z`}),(0,B.jsx)(`path`,{className:`cls-11`,d:`M20.16,39.38v-2.58c5.1,4.08,10.21,8.16,15.31,12.24h-3.25c-4.02-3.22-8.04-6.44-12.06-9.66Z`}),(0,B.jsx)(`path`,{className:`cls-2`,d:`M17.89,56.05c-2.59,2.18-5.17,4.36-7.76,6.54.05.27.08.7-.02,1.19-.2.98-.81,1.57-1.07,1.83-.13.14-1.85,1.83-4,1.23-1.8-.5-2.99-2.35-2.87-4.2.15-2.18,2.09-3.76,4.04-3.86,1.7-.09,2.91.98,3.19,1.23,2.77-2.22,5.53-4.43,8.3-6.65h21.9c.72,0,1.31.56,1.36,1.23.06.73-.52,1.41-1.3,1.46-3.65,0-7.31,0-10.96,0-3.25,3.28-6.5,6.55-9.75,9.82-.13,3.95-.27,7.89-.4,11.84.44.25,1.75,1.07,2.17,2.6.65,2.39-1.14,5.59-3.72,5.69-2.26.08-4.45-2.25-4.19-4.69.17-1.65,1.43-3.09,3.19-3.65l.24-12.11c2.92-3.17,5.84-6.34,8.76-9.51h-7.1,0ZM5.05,64.53c2.41,1.58,4.57-2.45,2.09-3.58-2.66-1.21-3.7,2.52-2.09,3.58ZM16.28,80.1c-1.44.43-1.7,2.45-.08,3.22,2.95,1.4,3.26-4.18.08-3.22Z`}),(0,B.jsx)(`path`,{className:`cls-8`,d:`M17.97,29.24c.05,1.83.1,3.66.15,5.5,5.56,4.59,11.12,9.17,16.68,13.76h-4.36c-5.13-4.19-10.25-8.39-15.38-12.58-.07-2.27-.14-4.54-.21-6.82-3.39-.35-5.84-3.22-5.71-6.27.16-3.47,3.59-5.71,6.7-5.63,3.28.08,6.43,2.73,6.46,6.12.02,2.52-1.7,4.91-4.33,5.93Z`}),(0,B.jsx)(`path`,{className:`cls-16`,d:`M5.18,47.04c2.03-.37,3.3,2.64,1.25,3.71-2.41,1.27-4.13-3.18-1.25-3.71Z`}),(0,B.jsx)(`path`,{className:`cls-16`,d:`M15.61,25.92c-1.79-.9-2.87-2.25-2.69-3.43.01-.09.18-1.12.97-1.36.56-.17,1.25.13,1.71.75.53-.67,1.31-.97,1.93-.75.64.22.93.92.99,1.35.18,1.18-.98,2.57-2.91,3.44h0Z`}),(0,B.jsx)(`path`,{className:`cls-16`,d:`M16.28,80.1c3.18-.96,2.87,4.62-.08,3.22-1.62-.77-1.36-2.79.08-3.22Z`}),(0,B.jsx)(`path`,{className:`cls-7`,d:`M10.65,50.98c-.02.16-.05.37-.13.61-.6,1.82-3.13,3.02-5.22,2.86-2.54-.2-5.43-2.42-5.3-5.65.12-2.86,2.55-5.2,5.43-5.19,2.62,0,4.93,1.96,5.37,4.64,10.64.08,21.28.16,31.92.24.78.01,1.39.66,1.38,1.39-.01.66-.54,1.25-1.25,1.33-10.74-.08-21.48-.15-32.21-.23h0ZM5.18,47.04c-2.88.53-1.16,4.98,1.25,3.71,2.04-1.07.78-4.09-1.25-3.71Z`}),(0,B.jsx)(`path`,{className:`cls-2`,d:`M24.68,90.27c-2.31,2.31-4.99-1.55-2.7-3.45,2.34-1.95,4.48,1.67,2.7,3.45Z`}),(0,B.jsx)(`path`,{className:`cls-2`,d:`M8.92,36.85c-2.31,2.31-4.99-1.55-2.7-3.45,2.34-1.95,4.48,1.67,2.7,3.45Z`}),(0,B.jsx)(`path`,{className:`cls-2`,d:`M93.04,36.85c-2.31,2.31-4.99-1.55-2.7-3.45,2.34-1.95,4.48,1.67,2.7,3.45Z`})]}),(0,B.jsxs)(`g`,{id:`BG_R`,"data-name":`BG R`,children:[(0,B.jsx)(`path`,{className:`cls-2`,d:`M70.71,48.64c3.42-3.83,6.83-7.66,10.25-11.49v-10.47c-.42-.21-1.21-.67-1.71-1.58-.95-1.7-.59-4.39,1.28-5.48,1.07-.63,2.5-.71,3.56-.2,1.97.95,2.81,3.61,1.84,5.47-.7,1.34-2.1,1.79-2.46,1.89.02,3.68.04,7.35.05,11.03-3.17,3.61-6.34,7.22-9.51,10.83h-3.29,0ZM81.19,24.35c1.24,1.54,4.18-.34,2.74-2.34-1.61-2.23-4.23.49-2.74,2.34Z`}),(0,B.jsx)(`path`,{className:`cls-10`,d:`M94.51,61.48c1.8,1.96-1.05,4.65-2.9,2.77-1.71-1.74,1.07-4.77,2.9-2.77Z`}),(0,B.jsx)(`path`,{className:`cls-16`,d:`M92.51,50.49c-2.29-2.28,1.74-5.2,3.11-2.43,1.08,2.19-1.56,3.98-3.11,2.43Z`}),(0,B.jsx)(`path`,{className:`cls-2`,d:`M73.93,55.93c1.42,1.47,2.85,2.95,4.29,4.43,1.56,1.6,3.12,3.19,4.68,4.76,0,2.1.02,4.2.02,6.3.01,2.08.02,4.16.03,6.24.06.63-.06.83-.18.89-.22.11-.43-.24-.9-.26-.54-.02-.8.44-1.07.32-.14-.06-.27-.26-.25-.88-.05-1.99-.09-3.98-.13-5.99-.04-1.96-.07-3.9-.1-5.85-1.53-1.59-2.8-2.83-3.67-3.64-.56-.53-1.08-1.05-2.44-2.42-1-1-2.34-2.36-3.97-4.01.68-.5,1.06-.52,1.3-.41.35.15.41.59.68.59.3,0,.37-.54.73-.63.18-.05.49,0,1,.57h0Z`}),(0,B.jsx)(`path`,{className:`cls-2`,d:`M77.99,86.94c1.03.87.95,3.54-.66,3.92-5.13,1.21-2.91-6.93.66-3.92Z`}),(0,B.jsx)(`path`,{className:`cls-5`,d:`M92.51,50.49c1.56,1.55,4.19-.25,3.11-2.43-1.37-2.76-5.4.16-3.11,2.43Z`}),(0,B.jsx)(`path`,{className:`cls-10`,d:`M80.69,78.19c1.59-.78,3.23.18,3.44.31,1.25.75,1.65,1.95,1.71,2.17.07.23.31,1.57-.18,2.82-1.11,2.83-5.22,2.7-6.59.31-.73-1.27-.44-2.93.03-3.89.19-.39.61-1.25,1.58-1.72h0Z`}),(0,B.jsx)(`path`,{id:`_55`,"data-name":` 55`,className:`cls-16`,d:`M82,80.14c3.18-.96,2.87,4.62-.08,3.22-1.62-.77-1.36-2.79.08-3.22Z`}),(0,B.jsx)(`path`,{className:`cls-1`,d:`M89.38,51.26c.02.09.05.22.09.37.59,1.79,3.12,3.02,5.22,2.86,2.54-.2,5.43-2.42,5.3-5.65-.12-2.82-2.51-5.23-5.43-5.19-2.73.03-5.06,2.19-5.3,4.99-10.7-.05-21.41-.11-32.11-.16-.76.08-1.31.74-1.27,1.45.04.64.56,1.19,1.24,1.27,10.75.02,21.5.05,32.25.07h0Z`}),(0,B.jsx)(`path`,{className:`cls-16`,d:`M93.95,47.08c2.03-.37,3.3,2.64,1.25,3.71-2.41,1.27-4.13-3.18-1.25-3.71Z`}),(0,B.jsx)(`path`,{className:`cls-10`,d:`M71.28,56.05c-3.42.01-6.85.02-10.27.03-.72-.23-1.15-.92-1.04-1.58.08-.52.49-.95,1.03-1.11h19.58c2.42,1.96,4.84,3.91,7.26,5.87.33.23.67.49,1.02.76.25.2.49.39.71.58-.19.98-.38,1.96-.56,2.94-.41-.4-.82-.79-1.22-1.19-.66-.63-1.5-1.44-1.6-1.54-1.22-1.16-5.23-4.29-5.93-4.83-2.13.02-4.26.03-6.39.05-.86,0-1.72,0-2.58.01h0Z`}),(0,B.jsx)(`path`,{className:`cls-2`,d:`M89.55,60.57c.25-.33.88-1.14,1.96-1.58,1.69-.69,3.78-.17,4.86,1.32,2.92,4.03-2,8.77-6.09,5.82-.33-.24-.79-.74-1.04-1.19-.2-.37-.57-.92-.64-1.65-.14-1.27.61-2.26.95-2.71h0ZM94.51,61.48c-1.83-2-4.62,1.03-2.9,2.77,1.85,1.88,4.7-.81,2.9-2.77Z`})]})]})}function Fu({children:e,viewBox:t=`0 0 24 24`,...n}){return(0,B.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:`18`,height:`18`,viewBox:t,xmlns:`http://www.w3.org/2000/svg`,...n,children:e})}function Iu(e){return(0,B.jsx)(Fu,{viewBox:`0 0 24 24`,...e,children:(0,B.jsx)(`path`,{fill:`#D97757`,d:`M13.83 4h-3.43l5.93 16h3.43L13.83 4ZM6.78 4 .85 20h3.5l1.21-3.4h6.16L12.93 20h3.5L10.5 4H6.78Zm-.06 9.46 2.06-5.78 2.06 5.78H6.72Z`})})}function Lu(e){return(0,B.jsx)(Fu,{viewBox:`0 0 20 20`,...e,children:(0,B.jsx)(`path`,{fill:`currentColor`,d:`M11.248 18.25q-.825 0-1.568-.314a4.3 4.3 0 0 1-1.32-.874 4 4 0 0 1-1.304.214 4 4 0 0 1-2.046-.544 4.27 4.27 0 0 1-1.518-1.485 4 4 0 0 1-.56-2.095q0-.48.131-1.04A4.4 4.4 0 0 1 2.04 10.71a4.07 4.07 0 0 1 .017-3.4 4.2 4.2 0 0 1 1.056-1.418 3.8 3.8 0 0 1 1.6-.842 3.9 3.9 0 0 1 .76-1.683q.593-.759 1.451-1.188a4.04 4.04 0 0 1 1.832-.429q.825 0 1.567.313.742.314 1.32.875a4 4 0 0 1 1.304-.215q1.106 0 2.046.545a4.14 4.14 0 0 1 1.501 1.485q.578.941.578 2.095 0 .48-.132 1.04.66.61 1.023 1.419.363.792.363 1.666 0 .892-.38 1.717a4.3 4.3 0 0 1-1.072 1.435 3.8 3.8 0 0 1-1.584.825 3.8 3.8 0 0 1-.775 1.683 4.06 4.06 0 0 1-1.436 1.188 4.04 4.04 0 0 1-1.832.429m-4.076-2.062q.825 0 1.435-.347l3.103-1.782a.36.36 0 0 0 .164-.313v-1.42L7.881 14.62a.67.67 0 0 1-.726 0l-3.118-1.798a.5.5 0 0 1-.017.115v.198q0 .841.396 1.551.413.693 1.139 1.089a3.2 3.2 0 0 0 1.617.412m.165-2.69a.4.4 0 0 0 .181.05q.083 0 .165-.05l1.238-.71-3.977-2.31a.7.7 0 0 1-.363-.643v-3.58q-.825.362-1.32 1.122a2.9 2.9 0 0 0-.495 1.65q0 .809.413 1.55.412.743 1.072 1.123zm3.91 3.663q.875 0 1.585-.396a2.96 2.96 0 0 0 1.534-2.64v-3.564a.32.32 0 0 0-.165-.297l-1.254-.726v4.604a.7.7 0 0 1-.363.643l-3.119 1.799a3 3 0 0 0 1.783.577m.627-6.039V8.878L10.01 7.822 8.129 8.878v2.244l1.881 1.056zM7.057 5.859a.7.7 0 0 1 .363-.644l3.119-1.798a3 3 0 0 0-1.782-.578q-.874 0-1.584.396A2.96 2.96 0 0 0 6.05 4.324a3.07 3.07 0 0 0-.396 1.551v3.547q0 .199.165.314l1.237.726zm8.383 7.887q.825-.364 1.303-1.123.495-.758.495-1.65a3.15 3.15 0 0 0-.412-1.55q-.413-.743-1.073-1.123l-3.086-1.782q-.099-.065-.181-.049a.3.3 0 0 0-.165.05l-1.238.692 3.993 2.327a.6.6 0 0 1 .264.264.64.64 0 0 1 .1.363zm-3.317-8.382a.63.63 0 0 1 .726 0l3.135 1.831v-.297q0-.792-.396-1.501a2.86 2.86 0 0 0-1.105-1.155q-.71-.43-1.65-.43-.825 0-1.436.347L8.294 5.941a.36.36 0 0 0-.165.314v1.418z`})})}function Ru(e){return(0,B.jsxs)(Fu,{viewBox:`0 0 24 24`,...e,children:[(0,B.jsx)(`defs`,{children:(0,B.jsxs)(`linearGradient`,{id:`gemini-grad`,x1:`0`,y1:`0`,x2:`24`,y2:`24`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`0`,stopColor:`#1C7DFF`}),(0,B.jsx)(`stop`,{offset:`0.52`,stopColor:`#1C69FF`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#F0DCD6`})]})}),(0,B.jsx)(`path`,{fill:`url(#gemini-grad)`,d:`M12 24a14.34 14.34 0 0 0-2.26-3.78A14.27 14.27 0 0 0 5.95 17 14.34 14.34 0 0 0 0 12a14.27 14.27 0 0 0 5.95-3.18A14.27 14.27 0 0 0 9.74 5 14.34 14.34 0 0 0 12 0a14.34 14.34 0 0 0 2.26 3.78A14.27 14.27 0 0 0 18.05 7 14.27 14.27 0 0 0 24 12a14.34 14.34 0 0 0-5.95 3.18A14.27 14.27 0 0 0 14.26 19 14.34 14.34 0 0 0 12 24Z`})]})}function zu(e){return(0,B.jsxs)(Fu,{viewBox:`0 0 48 48`,...e,children:[(0,B.jsx)(`path`,{fill:`#FFC107`,d:`M43.611 20.083H42V20H24v8h11.303c-1.649 4.657-6.08 8-11.303 8-6.627 0-12-5.373-12-12s5.373-12 12-12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 12.955 4 4 12.955 4 24s8.955 20 20 20 20-8.955 20-20c0-1.341-.138-2.65-.389-3.917Z`}),(0,B.jsx)(`path`,{fill:`#FF3D00`,d:`m6.306 14.691 6.571 4.819C14.655 15.108 18.961 12 24 12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 16.318 4 9.656 8.337 6.306 14.691Z`}),(0,B.jsx)(`path`,{fill:`#4CAF50`,d:`M24 44c5.166 0 9.86-1.977 13.409-5.192l-6.19-5.238C29.211 35.091 26.715 36 24 36c-5.202 0-9.619-3.317-11.283-7.946l-6.522 5.025C9.505 39.556 16.227 44 24 44Z`}),(0,B.jsx)(`path`,{fill:`#1976D2`,d:`M43.611 20.083H42V20H24v8h11.303a12.04 12.04 0 0 1-4.087 5.571l.003-.002 6.19 5.238C36.971 39.205 44 34 44 24c0-1.341-.138-2.65-.389-3.917Z`})]})}function Bu(e){return(0,B.jsx)(Fu,{viewBox:`0 0 24 24`,...e,children:(0,B.jsx)(`path`,{fill:`currentColor`,d:`M12 .5C5.65.5.5 5.65.5 12c0 5.09 3.29 9.39 7.86 10.91.57.11.78-.25.78-.56v-2.13c-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.68-1.28-1.68-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.03 1.75 2.69 1.25 3.34.95.1-.74.4-1.25.73-1.53-2.55-.29-5.23-1.28-5.23-5.68 0-1.26.45-2.28 1.18-3.08-.12-.29-.51-1.46.11-3.04 0 0 .96-.31 3.16 1.17A10.8 10.8 0 0 1 12 6.07c.98 0 1.95.13 2.87.38 2.2-1.48 3.16-1.17 3.16-1.17.62 1.58.23 2.75.11 3.04.74.8 1.18 1.82 1.18 3.08 0 4.42-2.69 5.38-5.25 5.67.41.36.78 1.06.78 2.14v3.14c0 .31.21.67.79.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z`})})}function Vu(e){return(0,B.jsx)(Fu,{viewBox:`0 0 24 24`,...e,children:(0,B.jsx)(`path`,{fill:`#4D6BFE`,d:`M22.92 5.5a.5.5 0 0 0-.78-.42l-.95.65a.6.6 0 0 1-.69-.02 8.93 8.93 0 0 0-3.16-1.43c-.35-.08-.46-.5-.2-.74.27-.25.13-.7-.23-.76a8.94 8.94 0 0 0-3.4-.04 8.84 8.84 0 0 0-7.13 7.4 8.7 8.7 0 0 0 .15 3.59c.21.86.55 1.66.99 2.4a.6.6 0 0 1-.06.7l-.85.94a.5.5 0 0 0 .35.83l1.39.06a.6.6 0 0 1 .56.5 8.84 8.84 0 0 0 8.74 7.34 8.84 8.84 0 0 0 5.93-2.27.5.5 0 0 0-.34-.86l-1.18-.05a.6.6 0 0 1-.55-.5 8.84 8.84 0 0 0-3.59-5.65.6.6 0 0 1-.13-.85 8.84 8.84 0 0 0 1.85-4.7.6.6 0 0 1 .39-.5l1.74-.62a.5.5 0 0 0 .31-.62l-.06-.18ZM14.6 9a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Z`})})}function Hu(e){return(0,B.jsxs)(Fu,{viewBox:`0 0 256 256`,...e,children:[(0,B.jsx)(`path`,{fill:`#000`,d:`M186 28h42v42h-42zM28 28h42v42H28zM28 70h42v42H28zM28 112h42v42H28zM28 154h42v42H28zM28 196h42v42H28z`}),(0,B.jsx)(`path`,{fill:`#F7D046`,d:`M186 28h42v42h-42z`}),(0,B.jsx)(`path`,{fill:`#F2A73B`,d:`M70 70h42v42H70zM186 70h42v42h-42z`}),(0,B.jsx)(`path`,{fill:`#EE792F`,d:`M112 112h42v42h-42zM70 112h42v42H70zM186 112h42v42h-42z`}),(0,B.jsx)(`path`,{fill:`#EB5829`,d:`M70 154h42v42H70zM186 154h42v42h-42z`}),(0,B.jsx)(`path`,{fill:`#EA3326`,d:`M70 196h42v42H70zM186 196h42v42h-42z`})]})}function Uu(e){return(0,B.jsx)(Fu,{viewBox:`0 0 24 24`,...e,children:(0,B.jsx)(`path`,{fill:`#0866FF`,d:`M5.31 8.78c.85-1.32 1.99-2.32 3.27-2.32 1.46 0 2.45.69 4.32 3.41 2 2.92 2.46 3.6 3.46 3.6.96 0 1.62-.91 1.62-2.55 0-1.83-.89-3.31-2.36-3.31-.79 0-1.6.31-2.45 1.18l-1.18-1.6C12.97 6.18 14.31 5 16.32 5c2.96 0 4.68 2.75 4.68 5.65 0 3.16-1.81 4.91-4.18 4.91-1.79 0-2.95-.71-4.4-2.83l-1.93-2.86c-.71-1.07-1.16-1.43-1.86-1.43-.94 0-1.61 1.03-1.61 2.5 0 1.49.5 2.36 1.55 2.36.61 0 1.13-.16 1.69-.6l.99 1.69c-.96.74-2 1.18-3.08 1.18C5.42 15.57 3 13.78 3 10.27 3 7.18 4.84 5 7.27 5c1.48 0 2.6.69 3.4 1.95l-1.36 1.83c-.66-.85-1.34-1.27-2.1-1.27-1.16 0-2.06 1.16-2.06 2.84 0 1.62.78 2.61 1.84 2.61.62 0 1.06-.21 1.41-.49Z`})})}function Wu(e){return(0,B.jsxs)(Fu,{viewBox:`0 0 466.04 516.93`,...e,children:[(0,B.jsx)(`path`,{fill:`currentColor`,d:`M.12 182.71h104.01l234.02 334.21H234.14L.12 182.71Z`}),(0,B.jsx)(`path`,{fill:`currentColor`,d:`M0 516.92h104.08l52-74.25-52.04-74.33L0 516.92Z`}),(0,B.jsx)(`path`,{fill:`currentColor`,d:`M466.04 0H361.96L182.1 256.86l52.05 74.32L466.04 0Z`}),(0,B.jsx)(`path`,{fill:`currentColor`,d:`M380.78 516.92h85.26V37.16L380.78 158.92v358Z`})]})}function Gu(e){return(0,B.jsxs)(Fu,{viewBox:`0 0 24 24`,...e,children:[(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,fill:`#FFD21E`}),(0,B.jsx)(`circle`,{cx:`8.5`,cy:`10.5`,r:`1.4`,fill:`#3A3B45`}),(0,B.jsx)(`circle`,{cx:`15.5`,cy:`10.5`,r:`1.4`,fill:`#3A3B45`}),(0,B.jsx)(`path`,{fill:`#3A3B45`,d:`M8 14.5a4 4 0 0 0 8 0c0-.6-.5-1-1.1-1H9.1c-.6 0-1.1.4-1.1 1Z`})]})}function Ku(e){return(0,B.jsx)(Fu,{viewBox:`0 0 24 24`,...e,children:(0,B.jsx)(`path`,{fill:`currentColor`,d:`M16.778 1.844v1.919q-.569-.026-1.138-.032q-.708-.008-1.415.037c-1.93.126-4.023.728-6.149 2.237-2.911 2.066-2.731 1.95-4.14 2.75-.396.223-1.342.574-2.185.798-.841.225-1.753.333-1.751.333v4.229s.768.108 1.61.333c.842.224 1.789.575 2.185.799 1.41.798 1.228.683 4.14 2.75 2.126 1.509 4.22 2.11 6.148 2.236.88.058 1.716.041 2.555.005v1.918l7.222-4.168-7.222-4.17v2.176c-.86.038-1.611.065-2.278.021-1.364-.09-2.417-.357-3.979-1.465-2.244-1.593-2.866-2.027-3.68-2.508.889-.518 1.449-.906 3.822-2.59 1.56-1.109 2.614-1.377 3.978-1.466.667-.044 1.418-.017 2.278.02v2.176L24 6.014Z`})})}function qu(e){return(0,B.jsxs)(Fu,{viewBox:`0 0 24 24`,...e,children:[(0,B.jsx)(`rect`,{x:`2`,y:`2`,width:`9.5`,height:`9.5`,fill:`#F25022`}),(0,B.jsx)(`rect`,{x:`12.5`,y:`2`,width:`9.5`,height:`9.5`,fill:`#7FBA00`}),(0,B.jsx)(`rect`,{x:`2`,y:`12.5`,width:`9.5`,height:`9.5`,fill:`#00A4EF`}),(0,B.jsx)(`rect`,{x:`12.5`,y:`12.5`,width:`9.5`,height:`9.5`,fill:`#FFB900`})]})}function Ju(e){return(0,B.jsx)(Fu,{viewBox:`0 0 17 25`,...e,children:(0,B.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M4.405.102c.216.097.411.256.588.466.295.348.544.845.734 1.435.191.593.315 1.25.362 1.909a4.311 4.311 0 0 1 2.049-.723l.051-.004c.87-.08 1.73.099 2.48.539.101.06.2.125.297.193.05-.647.172-1.289.36-1.868.19-.591.439-1.088.733-1.437.164-.202.365-.361.589-.466.257-.113.53-.134.796-.047.401.129.745.418 1.016.837.248.383.434.874.561 1.463.23 1.061.27 2.458.115 4.142l.053.045.026.022c.757.654 1.284 1.587 1.563 2.67.435 1.69.216 3.585-.534 4.646l-.018.023.002.004c.417.865.67 1.78.724 2.726l.002.034c.064 1.21-.2 2.428-.814 3.625l-.007.011.01.028c.472 1.314.62 2.638.438 3.961l-.006.044a.705.705 0 0 1-.263.48.61.61 0 0 1-.484.129.647.647 0 0 1-.424-.294.816.816 0 0 1-.116-.549c.167-1.174.01-2.351-.48-3.549a.79.79 0 0 1 .04-.708l.004-.007c.604-1.05.854-2.079.8-3.091-.046-.885-.325-1.754-.8-2.583a.797.797 0 0 1-.091-.545.75.75 0 0 1 .272-.462l.009-.007c.243-.181.467-.642.58-1.273.125-.745.092-1.514-.095-2.243-.205-.795-.58-1.459-1.105-1.912-.595-.516-1.383-.765-2.38-.693a.605.605 0 0 1-.632-.422c-.314-.756-.772-1.297-1.343-1.632a3.184 3.184 0 0 0-1.772-.377c-1.245.113-2.343.91-2.67 1.916a.695.695 0 0 1-.61.483c-1.067.002-1.893.286-2.497.799-.522.443-.878 1.062-1.066 1.804a5.095 5.095 0 0 0-.068 2.143c.112.634.331 1.159.582 1.442l.008.008a.797.797 0 0 1 .109.892c-.36.707-.629 1.76-.673 2.773-.05 1.157.186 2.161.719 2.882l.016.021a.793.793 0 0 1 .095.784c-.576 1.405-.753 2.559-.562 3.468a.763.763 0 0 1-.49.871.616.616 0 0 1-.485-.086.724.724 0 0 1-.295-.446c-.243-1.157-.078-2.482.473-3.975l.014-.04-.008-.013a5.125 5.125 0 0 1-.598-1.488l-.005-.022a6.376 6.376 0 0 1-.177-2.028c.044-1.034.278-2.093.622-2.943l.012-.03-.002-.002c-.293-.475-.51-1.083-.63-1.756l-.005-.027a6.282 6.282 0 0 1 .093-2.829c.262-1.04.777-1.933 1.536-2.578.06-.051.123-.102.186-.15-.159-1.697-.119-3.102.112-4.171.127-.588.314-1.079.562-1.462.27-.418.614-.707 1.015-.838.266-.086.54-.066.797.049Zm4.116 10.329c.936 0 1.8.356 2.446.972.63.599 1.005 1.403 1.005 2.205 0 1.008-.406 1.795-1.133 2.297-.62.426-1.451.633-2.403.633-1.009 0-1.871-.294-2.493-.834-.617-.534-.963-1.284-.963-2.096 0-.804.398-1.61 1.056-2.212.668-.61 1.55-.965 2.485-.965Zm0 1.019a2.88 2.88 0 0 0-1.916.738c-.461.421-.722.949-.722 1.421 0 .486.21.942.61 1.288.455.395 1.124.623 1.943.623.799 0 1.473-.167 1.932-.484.463-.318.7-.78.7-1.428 0-.481-.246-1.012-.683-1.427a2.722 2.722 0 0 0-1.864-.731Zm.662 1.375.004.004a.409.409 0 0 1-.056.557l-.292.261v.507a.39.39 0 0 1-.376.424.39.39 0 0 1-.376-.424v-.523l-.271-.247a.407.407 0 0 1-.052-.557.356.356 0 0 1 .494-.058l.211.195.22-.197a.355.355 0 0 1 .49.058Zm-5.04-2.181c.478 0 .867.443.867.99a.93.93 0 0 1-.868.989.93.93 0 0 1-.867-.988.93.93 0 0 1 .868-.991Zm8.706 0c.48 0 .868.443.868.99a.93.93 0 0 1-.868.989.93.93 0 0 1-.867-.988.93.93 0 0 1 .867-.991ZM3.94 1.477l-.003.002a.685.685 0 0 0-.285.271l-.005.007c-.138.214-.258.53-.348.945-.17.786-.216 1.853-.124 3.161.43-.145.899-.236 1.404-.269l.01-.001.019-.039c.046-.093.095-.183.148-.271.123-.876.022-1.923-.253-2.778-.134-.413-.297-.738-.453-.923a.583.583 0 0 0-.107-.102l-.003-.003Zm9.174.045-.002.002a.577.577 0 0 0-.107.102c-.156.185-.32.511-.453.925-.29.902-.387 2.018-.23 2.922l.058.111.008.016h.03c.497 0 .99.081 1.466.241.086-1.278.038-2.322-.128-3.094-.09-.414-.21-.73-.349-.945l-.004-.007a.69.69 0 0 0-.285-.271l-.004-.002Z`})})}function Yu({letter:e,fill:t=`currentColor`,color:n=`#fff`,...r}){return(0,B.jsxs)(Fu,{viewBox:`0 0 24 24`,...r,children:[(0,B.jsx)(`rect`,{width:`24`,height:`24`,rx:`6`,fill:t}),(0,B.jsx)(`text`,{x:`12`,y:`16.5`,textAnchor:`middle`,fontFamily:`system-ui, -apple-system, sans-serif`,fontSize:`13`,fontWeight:`700`,fill:n,children:e})]})}function Xu(e){return(0,B.jsx)(Lu,{...e})}function Zu(e){return(0,B.jsx)(Yu,{letter:`Z`,fill:`#1F6FEB`,...e})}function Qu(e){return(0,B.jsx)(Yu,{letter:`K`,fill:`#0F172A`,...e})}function $u(e){return(0,B.jsx)(Yu,{letter:`M`,fill:`#7C3AED`,...e})}function ed(e){return(0,B.jsx)(Yu,{letter:`Q`,fill:`#FF6A00`,...e})}function td(e){return(0,B.jsx)(Yu,{letter:`Mi`,fill:`#FF6900`,...e})}function nd(e){return(0,B.jsx)(Yu,{letter:`K`,fill:`#10B981`,...e})}function rd({width:e=18,height:t=18,className:n,style:r}){return(0,B.jsx)(`img`,{"aria-hidden":`true`,src:Nu,width:e,height:t,className:n,style:r,alt:``,draggable:!1,decoding:`async`})}function id(e){return(0,B.jsx)(Yu,{letter:`L`,fill:`#475569`,...e})}function ad(e){return(0,B.jsxs)(Fu,{viewBox:`0 0 96 96`,...e,children:[(0,B.jsx)(`path`,{fill:`currentColor`,opacity:`0.28`,d:`M42.22 28.47v55.31L14.57 28.47Z`}),(0,B.jsx)(`path`,{fill:`currentColor`,opacity:`0.28`,d:`M42.22 83.78h21.73L82.61 13.39 57.03 26.85Z`}),(0,B.jsx)(`path`,{fill:`currentColor`,d:`M41.05 27.29v55.31L13.39 27.29Z`}),(0,B.jsx)(`path`,{fill:`currentColor`,d:`M41.05 82.6h21.73l18.65-70.38-25.57 13.46Z`})]})}function od(e){return(0,B.jsx)(Yu,{letter:`Q`,fill:`#FF6A00`,...e})}var sd={connectorGrid:`_connectorGrid_q6k9d_1`,connectorCard:`_connectorCard_q6k9d_10`,connectorCardDisabled:`_connectorCardDisabled_q6k9d_19`,connectorHead:`_connectorHead_q6k9d_23`,connectorText:`_connectorText_q6k9d_30`,connectorMark:`_connectorMark_q6k9d_34`,connectorMarkHybridai:`_connectorMarkHybridai_q6k9d_51`,connectorMarkGithub:`_connectorMarkGithub_q6k9d_56`,connectorMarkGoogle:`_connectorMarkGoogle_q6k9d_62`,connectorMarkMicrosoft365:`_connectorMarkMicrosoft365_q6k9d_67`,connectorTitleRow:`_connectorTitleRow_q6k9d_72`,connectorTitle:`_connectorTitle_q6k9d_72`,connectorDescription:`_connectorDescription_q6k9d_94`,connectorActions:`_connectorActions_q6k9d_105`,dialogForm:`_dialogForm_q6k9d_115`,microsoftDialog:`_microsoftDialog_q6k9d_120`,oauthBridge:`_oauthBridge_q6k9d_125`,oauthBridgeMark:`_oauthBridgeMark_q6k9d_132`,oauthBridgeMarkHybridClaw:`_oauthBridgeMarkHybridClaw_q6k9d_147`,oauthBridgeLine:`_oauthBridgeLine_q6k9d_153`,microsoftCopy:`_microsoftCopy_q6k9d_159`,microsoftSetup:`_microsoftSetup_q6k9d_172`,pendingLink:`_pendingLink_q6k9d_188`},cd=2e3,ld=5*6e4,ud=new Set([`github`,`microsoft365`]);function dd(e){return new Promise(t=>setTimeout(t,e))}function fd(e){return e.state===`connected`?`connected`:e.state===`needs_setup`?`setup`:`not connected`}function pd(e){return e.state===`connected`}function md(e){return ud.has(e.id)}function hd(e){return V(sd.connectorMark,e.id===`hybridai`&&sd.connectorMarkHybridai,e.id===`github`&&sd.connectorMarkGithub,e.id===`google`&&sd.connectorMarkGoogle,e.id===`microsoft365`&&sd.connectorMarkMicrosoft365)}function gd({connector:e}){return e.id===`hybridai`?(0,B.jsx)(Pu,{width:24,height:24}):e.id===`github`?(0,B.jsx)(Bu,{width:24,height:24}):e.id===`google`?(0,B.jsx)(zu,{width:24,height:24}):(0,B.jsx)(qu,{width:24,height:24})}function _d(e){return{account:e.account||``,clientId:``,clientSecret:``,scopes:e.scopes.join(` `)}}function vd(e){return e===`google`}function yd(e){return e===`github`||e===`microsoft365`}function bd(e){return e===`github`?`GitHub`:`Microsoft 365`}function xd(e){return e.id===`google`&&!!e.account&&e.clientConfigured&&e.clientSecretConfigured}function Sd(e,t){return{provider:e,account:t.account,clientId:t.clientId,clientSecret:t.clientSecret,scopes:t.scopes}}function Cd(){let e=Gn(),t=hs(),n=o(),[r,i]=(0,R.useState)(!1),[a,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(null),[u,d]=(0,R.useState)(()=>{if(typeof window>`u`)return new Set;let e=new URLSearchParams(window.location.search).get(`connected`);return yd(e)?new Set([e]):new Set}),[f,p]=(0,R.useState)({account:``,clientId:``,clientSecret:``,scopes:``}),[m,h]=(0,R.useState)(null),_=y({queryKey:[`admin`,`connectors`,e.token],queryFn:()=>en(e.token),retry:!1}),v=t=>n.setQueryData([`admin`,`connectors`,e.token],t),b=g({mutationFn:()=>tn(e.token,a),onSuccess:e=>{v(e),s(``),i(!1),t.success(`HybridAI connected.`)},onError:e=>{t.error(`HybridAI connection failed`,H(e))}}),x=g({mutationFn:async t=>{let n=await nn(e.token,t);if(yd(n.provider))return window.open(n.authorizationUrl,`_self`),bd(n.provider);h(n.authorizationUrl),window.open(n.authorizationUrl,`_blank`,`noopener`);let r=Date.now()+Math.max(cd,Math.min(ld,n.expiresAt-Date.now()));for(;Date.now()<r;){await dd(cd);let t=await en(e.token);v(t);let r=t.connectors.find(e=>e.id===n.provider);if(r?.state===`connected`)return r.name}throw Error(`Timed out waiting for authorization. Complete the login in the opened tab and try again.`)},onSuccess:e=>{h(null),l(null),t.success(`${e} connected.`)},onError:e=>{h(null),t.error(`OAuth connection failed`,H(e))}}),S=g({mutationFn:t=>rn(e.token,t),onSuccess:e=>{v(e),t.success(`Connector credentials cleared.`)},onError:e=>{t.error(`Disconnect failed`,H(e))}}),C=g({mutationFn:t=>an(e.token,t),onSuccess:r=>{if(r.ok){t.success(`${r.name} test passed.`,r.message),n.invalidateQueries({queryKey:[`admin`,`connectors`,e.token]});return}t.error(`${r.name} test failed.`,r.message)},onError:e=>{t.error(`Connector test failed`,H(e))}}),w=_.data?.connectors||[],T=w.find(e=>e.id===c)||null,E=c===`google`&&!f.account.trim(),D=c===`google`&&!T?.clientConfigured&&!f.clientId.trim(),O=c===`google`&&!T?.clientSecretConfigured&&!f.clientSecret.trim(),k=x.isPending||!c||E||D||O;(0,R.useEffect)(()=>{let e=new URLSearchParams(window.location.search),n=e.get(`connected`),r=e.get(`connect_error`);if(!yd(n)&&!r)return;yd(n)?(d(e=>{let t=new Set(e);return t.add(n),t}),t.success(`${bd(n)} connected.`)):t.error(`Connector connection failed.`);let i=new URL(window.location.href);i.searchParams.delete(`connected`),i.searchParams.delete(`connect_error`),window.history.replaceState(null,``,`${i.pathname}${i.search}`)},[t]);let A=e=>{if(!e.loginUrl){t.error(`${e.name} connection is not available.`);return}let n=new URL(e.loginUrl);n.searchParams.delete(`connect`),n.searchParams.delete(`return_to`),n.hash=e.id,window.open(n.toString(),`_self`)},j=e=>{if(vd(e.id)){if(xd(e)){x.mutate({provider:`google`});return}p(_d(e)),l(e.id)}};return _.isPending?(0,B.jsx)(`div`,{className:`page-stack`,children:(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading connectors...`})}):_.isError?(0,B.jsx)(`div`,{className:`page-stack`,children:(0,B.jsxs)(`div`,{className:`empty-state`,children:[`Failed to load connectors: `,H(_.error)]})}):(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(`div`,{className:sd.connectorGrid,children:w.map(e=>{let t=md(e),n=pd(e)||t&&u.has(e.id);return(0,B.jsxs)(U,{className:sd.connectorCard,children:[(0,B.jsx)(W,{children:(0,B.jsxs)(`div`,{className:sd.connectorHead,children:[(0,B.jsx)(`span`,{className:hd(e),children:(0,B.jsx)(gd,{connector:e})}),(0,B.jsxs)(`div`,{className:sd.connectorText,children:[(0,B.jsxs)(`div`,{className:sd.connectorTitleRow,children:[(0,B.jsx)(G,{className:sd.connectorTitle,children:e.name}),(0,B.jsx)(Ga,{value:n,trueLabel:`connected`,falseLabel:fd(e),falseTone:e.state===`needs_setup`?`danger`:`default`})]}),(0,B.jsx)(`p`,{className:sd.connectorDescription,children:e.description})]})]})}),(0,B.jsxs)(`div`,{className:sd.connectorActions,children:[e.id===`hybridai`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Z,{type:`button`,size:`sm`,onClick:()=>{e.loginUrl&&window.open(e.loginUrl,`_blank`,`noopener`),i(!0)},children:e.state===`connected`?`Rotate key`:`Connect`}),e.state===`connected`?(0,B.jsx)(Z,{type:`button`,size:`sm`,variant:`ghost`,loading:S.isPending,disabled:S.isPending,onClick:()=>S.mutate(e.id),children:`Disconnect`}):null]}):t?(0,B.jsx)(Z,{type:`button`,size:`sm`,loading:x.isPending&&x.variables?.provider===e.id,disabled:x.isPending,"aria-label":`${n?`Manage`:`Connect`} ${e.name}`,onClick:()=>{if(n){A(e);return}x.mutate({provider:e.id})},children:n?`Manage`:`Connect`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Z,{type:`button`,size:`sm`,loading:x.isPending&&x.variables?.provider===e.id,disabled:x.isPending,onClick:()=>j(e),children:e.state===`connected`?`Reconnect`:`Connect`}),e.state===`connected`?(0,B.jsx)(Z,{type:`button`,size:`sm`,variant:`ghost`,loading:S.isPending,disabled:S.isPending,onClick:()=>S.mutate(e.id),children:`Disconnect`}):null]}),(0,B.jsx)(Z,{type:`button`,size:`sm`,variant:`outline`,loading:C.isPending&&C.variables===e.id,disabled:C.isPending,"aria-label":`Test ${e.name}`,onClick:()=>C.mutate(e.id),children:`Test`})]})]},e.id)})}),(0,B.jsx)(ri,{open:r,onOpenChange:i,children:(0,B.jsxs)(ii,{size:`default`,children:[(0,B.jsxs)(ai,{children:[(0,B.jsx)(oi,{children:`HybridAI API Key`}),(0,B.jsx)(si,{children:`Paste the key from HybridAI.`})]}),(0,B.jsx)(`div`,{className:sd.dialogForm,children:(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`API key`}),(0,B.jsx)(Y,{type:`password`,autoComplete:`off`,value:a,onChange:e=>s(e.target.value),placeholder:`hai-...`})]})}),(0,B.jsxs)(ci,{children:[(0,B.jsx)(li,{className:`ghost-button`,children:`Cancel`}),(0,B.jsx)(Z,{type:`button`,loading:b.isPending,disabled:!a.trim()||b.isPending,onClick:()=>b.mutate(),children:`Save key`})]})]})}),(0,B.jsx)(ri,{open:c!==null,onOpenChange:e=>{!e&&!x.isPending&&(l(null),h(null))},children:(0,B.jsxs)(ii,{size:`lg`,preventCloseOnOutsideClick:x.isPending,children:[(0,B.jsxs)(ai,{children:[(0,B.jsx)(oi,{children:T?`Connect ${T.name}`:`Connect`}),(0,B.jsx)(si,{children:x.isPending?`Waiting for authorization in the browser.`:`Leave stored app credentials blank to reuse them.`})]}),(0,B.jsxs)(`div`,{className:sd.dialogForm,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Google account`}),(0,B.jsx)(Y,{value:f.account,onChange:e=>p(t=>({...t,account:e.target.value})),placeholder:`user@example.com`})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Client ID`}),(0,B.jsx)(Y,{value:f.clientId,onChange:e=>p(t=>({...t,clientId:e.target.value})),placeholder:T?.clientConfigured?`stored client id`:`client id`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Client secret`}),(0,B.jsx)(Y,{type:`password`,autoComplete:`off`,value:f.clientSecret,onChange:e=>p(t=>({...t,clientSecret:e.target.value})),placeholder:T?.clientSecretConfigured?`stored secret`:`client secret`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Scopes`}),(0,B.jsx)(Jo,{rows:4,value:f.scopes,onChange:e=>p(t=>({...t,scopes:e.target.value}))})]}),m&&x.isPending?(0,B.jsx)(`a`,{className:sd.pendingLink,href:m,target:`_blank`,rel:`noreferrer`,children:`Open authorization page`}):null]}),(0,B.jsxs)(ci,{children:[(0,B.jsx)(li,{className:`ghost-button`,disabled:x.isPending,children:`Cancel`}),(0,B.jsx)(Z,{type:`button`,loading:x.isPending,disabled:k,onClick:()=>{c&&x.mutate(Sd(c,f))},children:x.isPending?`Waiting...`:`Connect`})]})]})})]})}var wd={panel:`_panel_1yt98_11`,panelHeader:`_panelHeader_1yt98_18`,panelTitle:`_panelTitle_1yt98_26`,row:`_row_1yt98_33`,rowWarning:`_rowWarning_1yt98_50`,rowDown:`_rowDown_1yt98_59`,rowTop:`_rowTop_1yt98_68`,nameGroup:`_nameGroup_1yt98_75`,dot:`_dot_1yt98_82`,dotHealthy:`_dotHealthy_1yt98_89`,dotWarning:`_dotWarning_1yt98_93`,pulse:`_pulse_1yt98_1`,dotDown:`_dotDown_1yt98_98`,dotInactive:`_dotInactive_1yt98_103`,name:`_name_1yt98_75`,badge:`_badge_1yt98_118`,badgeRemote:`_badgeRemote_1yt98_130`,badgeLocal:`_badgeLocal_1yt98_136`,meta:`_meta_1yt98_142`,detail:`_detail_1yt98_149`,modelCount:`_modelCount_1yt98_156`,loginBtn:`_loginBtn_1yt98_163`,inactiveFooter:`_inactiveFooter_1yt98_189`,inactiveDot:`_inactiveDot_1yt98_199`,inactiveNames:`_inactiveNames_1yt98_207`,panelEmpty:`_panelEmpty_1yt98_213`},Td=new Set([`ollama`,`lmstudio`,`llamacpp`,`vllm`]);function Ed(e,t){return t.loginRequired?`warning`:t.reachable?`healthy`:t.kind===`local`||Td.has(e)?`inactive`:`down`}function Dd(e,t){return t.kind===`local`||Td.has(e)}var Od={healthy:wd.dotHealthy,warning:wd.dotWarning,down:wd.dotDown,inactive:wd.dotInactive};function kd({name:e,provider:t,onLogin:n}){let r=Ed(e,t),i=Dd(e,t),a=t.modelCount??0,o=t.detail?t.detail:t.reachable?`${t.latencyMs??0}ms`:t.error||`unreachable`;return(0,B.jsx)(`div`,{className:[wd.row,r===`warning`?wd.rowWarning:``,r===`down`?wd.rowDown:``].filter(Boolean).join(` `),children:(0,B.jsxs)(`div`,{className:wd.rowTop,children:[(0,B.jsxs)(`div`,{className:wd.nameGroup,children:[(0,B.jsx)(`span`,{className:`${wd.dot} ${Od[r]}`}),(0,B.jsx)(`span`,{className:wd.name,children:e}),(0,B.jsx)(`span`,{className:`${wd.badge} ${i?wd.badgeLocal:wd.badgeRemote}`,children:i?`local`:`remote`})]}),(0,B.jsxs)(`div`,{className:wd.meta,children:[(0,B.jsx)(`span`,{className:wd.detail,children:o}),(0,B.jsxs)(`span`,{className:wd.modelCount,children:[a,` `,a===1?`model`:`models`]}),t.loginRequired&&(0,B.jsx)(`button`,{type:`button`,className:wd.loginBtn,onClick:n,children:`Log in →`})]})]})})}function Ad({title:e,entries:t,onLogin:n}){let r=t.filter(([e,t])=>Ed(e,t)!==`inactive`),i=t.filter(([e,t])=>Ed(e,t)===`inactive`);return(0,B.jsxs)(`section`,{className:wd.panel,children:[(0,B.jsx)(`div`,{className:wd.panelHeader,children:(0,B.jsx)(`span`,{className:wd.panelTitle,children:e})}),t.length===0?(0,B.jsx)(`p`,{className:wd.panelEmpty,children:`No provider health data available.`}):(0,B.jsxs)(B.Fragment,{children:[r.map(([e,t])=>(0,B.jsx)(kd,{name:e,provider:t,onLogin:n},e)),i.length>0&&(0,B.jsxs)(`div`,{className:wd.inactiveFooter,children:[(0,B.jsx)(`span`,{className:wd.inactiveDot}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`span`,{className:wd.inactiveNames,children:i.map(([e])=>e).join(` · `)}),` `,`not running locally`]})]})]})]})}var jd={root:`_root_akr74_1`,empty:`_empty_akr74_7`,summary:`_summary_akr74_13`,ribbon:`_ribbon_akr74_26`,metric:`_metric_akr74_35`,metricLabel:`_metricLabel_akr74_42`,metricValue:`_metricValue_akr74_48`,chart:`_chart_akr74_58`,chartCanvas:`_chartCanvas_akr74_64`,chartSvg:`_chartSvg_akr74_69`,area:`_area_akr74_76`,line:`_line_akr74_81`,pointTarget:`_pointTarget_akr74_90`,point:`_point_akr74_90`,crosshair:`_crosshair_akr74_105`,tooltip:`_tooltip_akr74_112`,tooltipLabel:`_tooltipLabel_akr74_138`,tooltipValue:`_tooltipValue_akr74_142`,axis:`_axis_akr74_148`,topModels:`_topModels_akr74_156`,topModelRow:`_topModelRow_akr74_166`,topModelName:`_topModelName_akr74_174`,topModelDetail:`_topModelDetail_akr74_181`,topModelCost:`_topModelCost_akr74_189`};function Md(e){return e===0?`$0`:new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}var Nd=600,Pd=100;function Fd(e){let{daily:t,monthly:n,topModels:r}=e.usage,i=n.callCount>0||n.totalTokens>0,a=t.callCount>0||t.totalTokens>0;if(!i&&!a)return(0,B.jsx)(`p`,{className:jd.empty,children:`No usage has been recorded yet this month.`});let o=n,s=r.length>1;return(0,B.jsxs)(`div`,{className:jd.root,children:[(0,B.jsxs)(`p`,{className:jd.summary,children:[(0,B.jsx)(`strong`,{children:Ka(o.totalTokens)}),` tokens this month · `,Ka(t.totalTokens),` today`]}),(0,B.jsxs)(`div`,{className:jd.ribbon,children:[(0,B.jsx)(Id,{label:`Input`,value:Ka(o.totalInputTokens??0)}),(0,B.jsx)(Id,{label:`Output`,value:Ka(o.totalOutputTokens??0)}),(0,B.jsx)(Id,{label:`Calls`,value:Ka(o.callCount)}),(0,B.jsx)(Id,{label:`Spent`,value:Md(o.totalCostUsd)})]}),(0,B.jsx)(Ld,{trend:e.trend,formatTrendDate:e.formatTrendDate}),s?(0,B.jsx)(`ul`,{className:jd.topModels,children:r.map(e=>(0,B.jsxs)(`li`,{className:jd.topModelRow,children:[(0,B.jsx)(`span`,{className:jd.topModelName,children:e.model}),(0,B.jsxs)(`span`,{className:jd.topModelDetail,children:[Ja({inputTokens:e.totalInputTokens??0,outputTokens:e.totalOutputTokens??0}),` `,`· `,eo(e.callCount,`call`)]}),(0,B.jsx)(`span`,{className:jd.topModelCost,children:Md(e.totalCostUsd)})]},e.model))}):null]})}function Id(e){return(0,B.jsxs)(`div`,{className:jd.metric,children:[(0,B.jsx)(`span`,{className:jd.metricLabel,children:e.label}),(0,B.jsx)(`span`,{className:jd.metricValue,children:e.value})]})}function Ld(e){let[t,n]=(0,R.useState)(null),r=e.trend,i=(0,R.useMemo)(()=>{if(!r||r.length<2)return null;let t=Math.max(0,...r.map(e=>e.totalTokens)),n=Nd/(r.length-1),i=r.map((r,i)=>{let a=t>0?Math.sqrt(r.totalTokens/t):0;return{index:i,label:e.formatTrendDate(r.date),value:r.totalTokens,x:i*n,y:Pd-a*Pd}}),a=Rd(i);return{points:i,linePath:a,areaPath:`${a} L${Nd},${Pd} L0,${Pd} Z`,peak:i.reduce((e,t)=>t.value>(e?.value??-1)?t:e,null)}},[r,e.formatTrendDate]);if(!i)return null;let{points:a,linePath:o,areaPath:s,peak:c}=i,l=c&&c.value>0?`peak ${Ka(c.value)} on ${c.label}`:null;function u(e){let t=e.currentTarget.getBoundingClientRect();if(t.width===0)return;let r=(e.clientX-t.left)/t.width,i=Math.min(Math.max(Math.floor(Math.min(Math.max(r,0),.9999)*a.length),0),a.length-1),o=a[i];o&&n({index:i,point:o})}function d(){n(null)}let f=t?t.point.x/Nd*100:0,p=t?f>80?`end`:f<18?`start`:`center`:`center`;return(0,B.jsxs)(`div`,{className:jd.chart,children:[(0,B.jsxs)(`div`,{className:jd.chartCanvas,children:[(0,B.jsxs)(`svg`,{viewBox:`0 0 ${Nd} ${Pd}`,preserveAspectRatio:`none`,className:jd.chartSvg,role:`img`,"aria-label":`Tokens per day, last 30 days`,onPointerMove:u,onPointerLeave:d,children:[(0,B.jsx)(`path`,{d:s,className:jd.area}),(0,B.jsx)(`path`,{d:o,className:jd.line,vectorEffect:`non-scaling-stroke`}),a.map(e=>{let t=`${e.label}: ${Ka(e.value)} tokens`;return(0,B.jsxs)(`g`,{className:jd.pointTarget,tabIndex:0,"aria-label":t,children:[(0,B.jsx)(`title`,{children:t}),(0,B.jsx)(`circle`,{cx:e.x,cy:e.y,r:5,className:jd.point})]},e.index)}),t?(0,B.jsx)(`line`,{x1:t.point.x,x2:t.point.x,y1:0,y2:Pd,className:jd.crosshair,vectorEffect:`non-scaling-stroke`}):null]}),t?(0,B.jsxs)(`div`,{className:jd.tooltip,"data-align":p,style:{left:`${f}%`},role:`status`,"aria-live":`polite`,children:[(0,B.jsx)(`span`,{className:jd.tooltipLabel,children:t.point.label}),(0,B.jsxs)(`span`,{className:jd.tooltipValue,children:[Ka(t.point.value),` tokens`]})]}):null]}),(0,B.jsxs)(`div`,{className:jd.axis,"aria-hidden":`true`,children:[(0,B.jsxs)(`span`,{children:[a.length-1,`d ago`]}),l?(0,B.jsx)(`span`,{className:jd.axisPeak,children:l}):null,(0,B.jsx)(`span`,{children:`today`})]})]})}function Rd(e){if(e.length===0)return``;if(e.length===1)return`M${e[0].x.toFixed(2)},${e[0].y.toFixed(2)}`;let t=e=>e.toFixed(2),n=[`M${t(e[0].x)},${t(e[0].y)}`];for(let r=0;r<e.length-1;r+=1){let i=e[Math.max(r-1,0)],a=e[r],o=e[r+1],s=e[Math.min(r+2,e.length-1)],c=a.x+(o.x-i.x)/6,l=a.y+(o.y-i.y)/6,u=o.x-(s.x-a.x)/6,d=o.y-(s.y-a.y)/6;n.push(`C${t(c)},${t(l)} ${t(u)},${t(d)} ${t(o.x)},${t(o.y)}`)}return n.join(` `)}function zd(e){let t=hs(),n=(0,R.useRef)(e),r=(0,R.useRef)(null);(0,R.useEffect)(()=>{let i=n.current;if(n.current=e,i!==e){if(i===`open`&&e===`error`){r.current=t.add({title:`Live updates paused`,description:`Showing snapshot — retrying.`,type:`info`,duration:0,pinned:!0});return}e===`open`&&r.current&&(t.dismiss(r.current),r.current=null,t.success(`Live updates restored`))}},[e,t]),(0,R.useEffect)(()=>()=>{r.current&&=(t.dismiss(r.current),null)},[t])}function Bd(e){let t=e.trim(),[n,r]=(0,R.useState)({connection:`connecting`,overview:null,status:null,lastEventAt:null});return(0,R.useEffect)(()=>{let e=new EventSource(Ae(t));return r(e=>({...e,connection:`connecting`})),e.addEventListener(`open`,()=>{r(e=>({...e,connection:`open`}))}),e.addEventListener(`overview`,e=>{let t=JSON.parse(e.data);r(e=>({...e,connection:`open`,overview:t,lastEventAt:Date.now()}))}),e.addEventListener(`status`,e=>{let t=JSON.parse(e.data);r(e=>({...e,connection:`open`,status:t,lastEventAt:Date.now()}))}),e.addEventListener(`error`,()=>{r(e=>({...e,connection:`error`}))}),()=>{e.close()}},[t]),n}var Vd={session:(e,t)=>X(e.id,t.id)||X(e.channelId,t.channelId),model:(e,t)=>X(e.effectiveModel,t.effectiveModel)||X(e.id,t.id),messages:(e,t)=>$o(e.messageCount,t.messageCount)||X(e.id,t.id),tasks:(e,t)=>$o(e.taskCount,t.taskCount)||X(e.id,t.id),lastActive:(e,t)=>ts(e.lastActive,t.lastActive)||X(e.id,t.id)},Hd={messages:`desc`,tasks:`desc`,lastActive:`desc`},Ud={manual:{label:`Manual URL`,managed:!1,usesConfiguredPublicUrl:!0,requiresPublicUrl:!1},ngrok:{label:`ngrok`,managed:!0,usesConfiguredPublicUrl:!1,requiresPublicUrl:!1},tailscale:{label:`Tailscale Funnel`,managed:!0,usesConfiguredPublicUrl:!1,requiresPublicUrl:!1},cloudflare:{label:`Cloudflare Tunnel`,managed:!0,usesConfiguredPublicUrl:!0,requiresPublicUrl:!0},ssh:{label:`SSH tunnel`,managed:!1,usesConfiguredPublicUrl:!0,requiresPublicUrl:!1}},Wd=Object.entries(Ud).map(([e,t])=>({value:e,label:t.label})),Gd=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,timeZone:`UTC`});function Kd(e){let[t,n,r]=e.split(`-`).map(Number);return!t||!n||!r?e:Gd.format(new Date(Date.UTC(t,n-1,r)))}function qd(e){return e===`healthy`?`list-status list-status-success`:e===`reconnecting`?`list-status list-status-warning`:`list-status list-status-danger`}function Jd(e){return e===`healthy`?`status-dot status-dot-success`:e===`reconnecting`?`status-dot status-dot-warning`:`status-dot status-dot-danger`}function Yd(e){return Object.hasOwn(Ud,e)}function Xd(e){return e&&Yd(e)?e:`manual`}function Zd(e){let t=e.trim();if(!t)return``;try{return new URL(t).toString().replace(/\/$/,``)}catch{return t}}function Qd(e){return{provider:Xd(e.provider),publicUrl:e.publicUrl||``}}function $d(e){return Ud[e].managed}function ef(e){return Ud[e].usesConfiguredPublicUrl}function tf(e,t){return e.provider===t.provider&&Zd(e.publicUrl)===Zd(t.publicUrl)}function nf(e){let t=Ud[e.provider];if(!t.usesConfiguredPublicUrl)return null;let n=e.publicUrl.trim();if(!n)return t.requiresPublicUrl?`Public URL is required for Cloudflare Tunnel.`:null;let r;try{r=new URL(n)}catch{return`Public URL must be a valid URL.`}return r.protocol!==`https:`&&r.protocol!==`http:`?`Public URL must use http:// or https://.`:null}function rf(e){if(!ef(e.provider))return!1;try{return new URL(e.publicUrl.trim()).protocol===`http:`}catch{return!1}}function af(e){let{tunnel:t}=e,n=t.publicUrl||`not configured`,r=e.reconnectPending||e.stopPending||!t.reconnectSupported,i=t.lastError?.trim()||null,a=e.reconnectError?.trim()||null,o=e.stopError?.trim()||null,s=e.reconnectError&&a!==i?e.reconnectError:null,c=e.stopError&&o!==i&&o!==a?e.stopError:null,l=e.savedConfigDraft?!tf(e.configDraft,e.savedConfigDraft):!1,u=ef(e.configDraft.provider),d=$d(e.configDraft.provider),f=nf(e.configDraft),p=rf(e.configDraft)?`Public tunnel URL uses HTTP. HTTPS is recommended.`:null,m=!e.configLoaded||e.configPending||e.configSavePending,h=m||!l||!!f,g=Xd(t.provider)===e.configDraft.provider,_=!l&&g&&t.state===`up`,v=!l&&g&&(t.state===`starting`||t.state===`reconnecting`),y=e.configStartPending||e.reconnectPending,b=y||e.stopPending||v,x=e.stopPending?`Stopping`:y||v?`Starting`:_?`Stop`:l?`Save & start`:`Start`,S=m||e.reconnectPending||e.stopPending||!!f,C=m||e.reconnectPending||e.stopPending,w=_?C:S,T=_||e.stopPending?`danger`:`default`,E=_?e.onStop:e.onSaveConfigAndStart;return(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Public tunnel`})}),(0,B.jsxs)(K,{children:[(0,B.jsxs)(`div`,{className:`tunnel-panel-grid`,children:[(0,B.jsxs)(`div`,{className:`tunnel-url-stack`,children:[(0,B.jsx)(`span`,{children:`Public URL`}),t.publicUrl?(0,B.jsx)(`a`,{href:t.publicUrl,target:`_blank`,rel:`noreferrer`,children:n}):(0,B.jsx)(`strong`,{children:n})]}),(0,B.jsx)(`div`,{className:`tunnel-action-stack`,children:(0,B.jsxs)(Z,{type:`button`,className:`tunnel-action-button`,onClick:e.onReconnect,loading:e.reconnectPending,disabled:r,children:[e.reconnectPending?(0,B.jsx)(`span`,{className:`button-spinner`,"aria-hidden":`true`}):null,e.reconnectPending?`Reconnecting`:`Reconnect`]})})]}),(0,B.jsxs)(`div`,{className:`tunnel-config-grid`,children:[(0,B.jsxs)(`label`,{className:`tunnel-control`,children:[(0,B.jsx)(`span`,{children:`Provider`}),(0,B.jsx)(ds,{value:e.configDraft.provider,disabled:e.configPending||e.configSavePending,onChange:t=>e.onConfigDraftChange({...e.configDraft,provider:Xd(t.target.value)}),children:Wd.map(e=>(0,B.jsx)(Q,{value:e.value,children:e.label},e.value))})]}),u?(0,B.jsxs)(`label`,{className:`tunnel-control`,children:[(0,B.jsx)(`span`,{children:`Public URL`}),(0,B.jsx)(Y,{value:e.configDraft.publicUrl,placeholder:`https://example.ngrok-free.dev`,disabled:e.configPending||e.configSavePending,onChange:t=>e.onConfigDraftChange({...e.configDraft,publicUrl:t.target.value})})]}):null,(0,B.jsxs)(`div`,{className:`tunnel-config-actions`,children:[(0,B.jsx)(Z,{type:`button`,variant:`outline`,onClick:e.onSaveConfig,loading:e.configSavePending&&!e.configStartPending,disabled:h,children:`Save`}),d?(0,B.jsxs)(Z,{type:`button`,className:`tunnel-action-button`,variant:T,onClick:E,loading:b,disabled:w,children:[b?(0,B.jsx)(`span`,{className:`button-spinner`,"aria-hidden":`true`}):null,x]}):null]})]}),f?(0,B.jsx)(`p`,{className:`supporting-text tunnel-error`,children:f}):null,p?(0,B.jsx)(`p`,{className:`supporting-text tunnel-warning`,children:p}):null,(0,B.jsxs)(`div`,{className:`tunnel-detail-grid`,children:[(0,B.jsxs)(`div`,{className:`tunnel-detail`,children:[(0,B.jsx)(`span`,{children:`Provider`}),(0,B.jsx)(`strong`,{children:t.provider||`none`})]}),(0,B.jsxs)(`div`,{className:`tunnel-detail`,children:[(0,B.jsx)(`span`,{children:`Status`}),(0,B.jsxs)(`strong`,{className:qd(t.health),children:[(0,B.jsx)(`span`,{className:Jd(t.health)}),t.health]})]}),(0,B.jsxs)(`div`,{className:`tunnel-detail`,children:[(0,B.jsx)(`span`,{children:`Last checked`}),(0,B.jsx)(`strong`,{children:Qa(t.lastCheckedAt)})]}),(0,B.jsxs)(`div`,{className:`tunnel-detail`,children:[(0,B.jsx)(`span`,{children:`Next reconnect`}),(0,B.jsx)(`strong`,{children:Qa(t.nextReconnectAt)})]})]}),t.lastError?(0,B.jsx)(`p`,{className:`supporting-text tunnel-error`,children:t.lastError}):null,s?(0,B.jsx)(`p`,{className:`supporting-text tunnel-error`,children:s}):null,c?(0,B.jsx)(`p`,{className:`supporting-text tunnel-error`,children:c}):null,e.configSaveError?(0,B.jsx)(`p`,{className:`supporting-text tunnel-error`,children:e.configSaveError}):null]})]})}function of(){let e=Gn(),t=j(),n=o(),r=Bd(e.token);zd(r.connection);let i=y({queryKey:[`overview`,e.token],queryFn:()=>Ne(e.token),refetchInterval:3e4}),a=y({queryKey:[`usage-trend`,e.token,30],queryFn:()=>Re(e.token,30),staleTime:6e4}),s=y({queryKey:[`tunnel-config`,e.token],queryFn:()=>Pe(e.token),staleTime:3e4}),c=(0,R.useMemo)(()=>s.data?Qd(s.data.config):null,[s.data]),[l,u]=(0,R.useState)(null),d=g({mutationFn:()=>Ie(e.token),onSuccess:t=>{n.setQueryData([`overview`,e.token],e=>e&&{...e,tunnel:t})}}),f=g({mutationFn:()=>Le(e.token),onSuccess:t=>{n.setQueryData([`overview`,e.token],e=>e&&{...e,tunnel:t})}}),p=g({mutationFn:async t=>({payload:await Fe(e.token,{provider:t.draft.provider,publicUrl:ef(t.draft.provider)?Zd(t.draft.publicUrl):``}),tunnel:t.start&&$d(t.draft.provider)?await Ie(e.token):null}),onSuccess:({payload:t,tunnel:r})=>{if(n.setQueryData([`tunnel-config`,e.token],t),u(null),r){n.setQueryData([`overview`,e.token],e=>e&&{...e,tunnel:r});return}n.invalidateQueries({queryKey:[`overview`,e.token]})}}),m=r.overview||i.data,h=r.status||m?.status||e.gatewayStatus,_=p.isPending&&p.variables?.start===!0,v=l??c??{provider:Xd(m?.tunnel.provider),publicUrl:m?.tunnel.publicUrl??``},{sortedRows:b,sortState:x,toggleSort:S}=Ba(m?.recentSessions||[],{initialSort:{key:`lastActive`,direction:`desc`},sorters:Vd,defaultDirections:Hd});if(i.isLoading&&!m)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading overview...`});if(i.isError&&!m)return(0,B.jsx)(`div`,{className:`empty-state error`,children:H(i.error)});if(!m||!h)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Gateway overview unavailable.`});let C=h.scheduler?.jobs.length||0,w=Object.entries(h.providerHealth||h.localBackends||{});return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{}),(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Ua,{label:`Gateway sessions`,value:String(h.sessions),detail:`${m.recentSessions.length} recent sessions surfaced`}),(0,B.jsx)(Ua,{label:`Active sandboxes`,value:String(h.activeContainers),detail:h.sandbox?.mode||`container`}),(0,B.jsx)(Ua,{label:`Uptime`,value:$a(h.uptime),detail:`version ${h.version}`}),(0,B.jsx)(Ua,{label:`Scheduler`,value:String(C),detail:`registered jobs`})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Usage rollup`})}),(0,B.jsx)(K,{children:(0,B.jsx)(Fd,{usage:m.usage,trend:a.data?.trend??null,formatTrendDate:Kd})})]}),(0,B.jsx)(Ad,{title:`Backend health`,entries:w,onLogin:()=>void t({to:`/admin/config`})})]}),(0,B.jsx)(af,{tunnel:m.tunnel,configLoaded:!!s.data,configPending:s.isLoading,configDraft:v,savedConfigDraft:c,configSavePending:p.isPending,configStartPending:_,configSaveError:p.isError?H(p.error):null,reconnectPending:d.isPending,reconnectError:d.isError?H(d.error):null,stopPending:f.isPending,stopError:f.isError?H(f.error):null,onConfigDraftChange:u,onSaveConfig:()=>p.mutate({draft:v,start:!1}),onSaveConfigAndStart:()=>p.mutate({draft:v,start:!0}),onReconnect:()=>d.mutate(),onStop:()=>f.mutate()}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Recent sessions`})}),(0,B.jsx)(K,{children:(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Va,{label:`Session`,sortKey:`session`,sortState:x,onToggle:S}),(0,B.jsx)(Va,{label:`Model`,sortKey:`model`,sortState:x,onToggle:S}),(0,B.jsx)(Va,{label:`Messages`,sortKey:`messages`,sortState:x,onToggle:S}),(0,B.jsx)(Va,{label:`Tasks`,sortKey:`tasks`,sortState:x,onToggle:S}),(0,B.jsx)(Va,{label:`Last active`,sortKey:`lastActive`,sortState:x,onToggle:S})]})}),(0,B.jsx)(`tbody`,{children:b.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.id}),(0,B.jsx)(`small`,{children:e.channelId})]}),(0,B.jsx)(`td`,{children:e.effectiveModel}),(0,B.jsx)(`td`,{children:e.messageCount}),(0,B.jsx)(`td`,{children:e.taskCount}),(0,B.jsx)(`td`,{children:Za(e.lastActive)})]},e.id))})]})})})]})]})}var sf={root:`_root_1rfzi_1`,indicator:`_indicator_1rfzi_46`,icon:`_icon_1rfzi_54`};function cf({checked:e,onCheckedChange:t,disabled:n,className:r,onClick:i,name:a,value:o=`on`,required:s,...c}){let{required:l,...u}=Do({disabled:n,required:s,...c}),d=Eo(),f=u.disabled,p=e===`indeterminate`?`indeterminate`:e?`checked`:`unchecked`,m=e===`indeterminate`?`mixed`:e,h=n=>{f||(i?.(n),!n.defaultPrevented&&(d.setTouched(!0),t?.(e!==!0)))},g=e===`indeterminate`?br:e?$n:null;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{...u,type:`button`,role:`checkbox`,"aria-checked":m,"data-slot":`checkbox`,"data-state":p,className:V(sf.root,r),onClick:h,children:(0,B.jsx)(`span`,{"aria-hidden":`true`,className:sf.indicator,children:g?(0,B.jsx)(g,{className:sf.icon}):null})}),a&&e===!0&&!f?(0,B.jsx)(`input`,{type:`hidden`,name:a,value:o}):null]})}var lf=[`ingest`,`analyse`,`build`,`merge`,`correct`],uf=[`auto`,`slack-export`,`email-mbox`,`transcript`,`chat-jsonl`,`markdown`,`text`,`interview`];function df(e){return`${e.agentId}:${e.alias}`}function ff(e){return e?e.status.replace(/-/g,` `):`no run`}function pf(e){return e?e.status===`completed`?`status-dot status-dot-success`:e.status===`failed`?`status-dot status-dot-danger`:e.status===`awaiting-extraction`?`status-dot status-dot-warning`:`status-dot`:`status-dot`}function mf(e){if(!Number.isFinite(e)||e<0)return`0 B`;if(e<1024)return`${e} B`;let t=e/1024;if(t<1024)return`${t.toFixed(t>=10?0:1)} KiB`;let n=t/1024;return`${n.toFixed(n>=10?0:1)} MiB`}function hf(e,t){return to(e).map(e=>({path:e,kind:t}))}function gf(e){let t=new Set,n=[];for(let r of e?.runs||[])for(let e of r.sources){let r=`${e.kind}:${e.path}`;t.has(r)||(t.add(r),n.push(e))}return n}function _f(e){return e.replace(/\\/g,`/`).replace(/\/+$/g,``).split(`/`).filter(Boolean).at(-1)||e||`source`}function vf({label:e=`Server path`,path:t}){return(0,B.jsxs)(`details`,{className:`distill-inline-path`,children:[(0,B.jsx)(`summary`,{children:e}),(0,B.jsx)(`code`,{className:`path-text`,children:t})]})}function yf({title:e,artifact:t,path:n}){return(0,B.jsxs)(`details`,{className:`distill-embed`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(`span`,{children:e}),(0,B.jsx)(`small`,{children:t.available?`${mf(t.byteLength)}${t.truncated?` preview`:``}`:t.error||`Not available`})]}),n?(0,B.jsx)(`code`,{className:`path-text`,children:n}):null,t.available?(0,B.jsx)(`pre`,{children:t.content||`(empty)`}):(0,B.jsx)(`div`,{className:`empty-state`,children:t.error||`Not available.`})]})}function bf({subject:e}){return(0,B.jsxs)(`details`,{className:`distill-embed`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(`span`,{children:`Storage Paths`}),(0,B.jsx)(`small`,{children:`server metadata`})]}),(0,B.jsxs)(`div`,{className:`summary-block distill-path-summary`,children:[(0,B.jsx)(`span`,{children:`Workspace`}),(0,B.jsx)(`strong`,{className:`path-text`,children:e.paths.workspacePath}),(0,B.jsx)(`span`,{children:`Uploaded files`}),(0,B.jsx)(`strong`,{className:`path-text`,children:e.paths.uploadsPath}),(0,B.jsx)(`span`,{children:`Corpus index`}),(0,B.jsx)(`strong`,{className:`path-text`,children:e.paths.corpusDocumentsPath})]})]})}function xf(e){return{agentId:e?.agentId||``,alias:e?.alias||``,displayName:e?.profile.displayName||``,role:e?.profile.role||``,relationship:e?.profile.relationship||``,tags:e?.profile.personalityTags.join(`, `)||``,matchAliases:e?.profile.matchAliases.join(`, `)||``,realPerson:e?.profile.realPerson??!0}}function Sf(e){let t=e.flatMap(e=>e.runs);return{runs:t,awaitingExtraction:t.filter(e=>e.status===`awaiting-extraction`).length,openReviews:e.reduce((e,t)=>e+t.openReviews,0),consentReady:e.filter(e=>e.consent.valid).length}}function Cf({run:e}){return e?(0,B.jsxs)(`div`,{className:`list-stack distill-run-panel`,children:[(0,B.jsxs)(`div`,{className:`key-value-grid distill-run-metrics`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Run`}),(0,B.jsx)(`strong`,{children:e.runId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Status`}),(0,B.jsx)(`strong`,{children:ff(e)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Updated`}),(0,B.jsx)(`strong`,{children:Qa(e.updatedAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Documents`}),(0,B.jsx)(`strong`,{children:e.stats.documentsTotal})]})]}),(0,B.jsx)(`div`,{className:`table-shell distill-stage-table`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Stage`}),(0,B.jsx)(`th`,{children:`Status`}),(0,B.jsx)(`th`,{children:`Detail`})]})}),(0,B.jsx)(`tbody`,{children:lf.map(t=>{let n=e.stages[t];return(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:t}),(0,B.jsx)(`td`,{children:n.status}),(0,B.jsx)(`td`,{children:n.detail||``})]},t)})})]})}),(0,B.jsxs)(`div`,{className:`distill-embed-list`,children:[(0,B.jsx)(yf,{title:`Report`,artifact:e.artifacts.report,path:e.reportPath}),e.status===`awaiting-extraction`||e.artifacts.packetMarkdown.available?(0,B.jsx)(yf,{title:`Analysis Packet`,artifact:e.artifacts.packetMarkdown,path:e.packetMarkdownPath}):null,e.status===`awaiting-extraction`||e.artifacts.extraction.available?(0,B.jsx)(yf,{title:`Extraction`,artifact:e.artifacts.extraction,path:e.extractionPath}):null]})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No distillation run yet.`})}function wf({sources:e,emptyLabel:t}){return e.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:t}):(0,B.jsx)(`ul`,{className:`distill-data-list`,children:e.map(e=>(0,B.jsx)(`li`,{className:`distill-data-row`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:_f(e.path)}),(0,B.jsx)(`small`,{children:e.kind}),(0,B.jsx)(vf,{path:e.path})]})},`${e.kind}:${e.path}`))})}function Tf({uploads:e}){return e.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No queued uploads.`}):(0,B.jsx)(`ul`,{className:`distill-data-list`,children:e.map(e=>(0,B.jsx)(`li`,{className:`distill-data-row`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`strong`,{children:[e.filename,` · `,e.source.kind,` ·`,` `,mf(e.sizeBytes)]}),(0,B.jsx)(vf,{path:e.path}),(0,B.jsx)(yf,{title:`Preview`,artifact:e.preview})]})},`${e.source.kind}:${e.path}`))})}function Ef({subject:e,documents:t,deletingDocumentId:n,downloadingDocumentId:r,onDelete:i,onDownload:a}){return t.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No corpus documents ingested yet.`}):(0,B.jsx)(`ul`,{className:`distill-data-list`,children:t.map(t=>(0,B.jsxs)(`li`,{className:`distill-data-row`,children:[(0,B.jsxs)(`div`,{className:`distill-data-row-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:t.id}),(0,B.jsxs)(`small`,{children:[t.source,` · `,t.wordCount,` words ·`,` `,t.holdout?`holdout`:`analysis`,` · `,t.author]}),(0,B.jsx)(vf,{label:`Original source`,path:t.origin})]}),(0,B.jsxs)(`div`,{className:`distill-row-actions`,children:[(0,B.jsx)(Z,{variant:`outline`,size:`sm`,loading:r===t.id,"aria-label":`Download ${t.id}`,onClick:()=>a(e,t),children:`Download`}),(0,B.jsx)(Z,{variant:`danger`,size:`sm`,loading:n===t.id,"aria-label":`Delete ${t.id}`,onClick:()=>i(e,t),children:`Delete`})]})]}),(0,B.jsx)(`div`,{children:(0,B.jsx)(yf,{title:`Content Preview`,artifact:t.contentPreview})})]},t.id))})}function Df({subject:e,queuedUploads:t,deletingDocumentId:n,downloadingDocumentId:r,onDeleteCorpusDocument:i,onDownloadCorpusDocument:a}){if(!e)return(0,B.jsx)(`div`,{className:`empty-state`,children:`No subject selected.`});let o=gf(e);return(0,B.jsxs)(`div`,{className:`list-stack`,children:[(0,B.jsx)(bf,{subject:e}),t.length>0?(0,B.jsxs)(`section`,{className:`distill-data-section`,children:[(0,B.jsx)(`h5`,{children:`Queued Uploads`}),(0,B.jsx)(Tf,{uploads:t})]}):null,(0,B.jsxs)(`section`,{className:`distill-data-section`,children:[(0,B.jsx)(`h5`,{children:`Run Sources`}),(0,B.jsx)(`p`,{className:`distill-section-note`,children:`Server paths are provenance only. Use corpus previews and downloads below for cloud-accessible content.`}),(0,B.jsx)(wf,{sources:o,emptyLabel:`No sources attached to a run yet.`})]}),(0,B.jsxs)(`section`,{className:`distill-data-section`,children:[(0,B.jsx)(`h5`,{children:`Corpus Documents`}),(0,B.jsx)(Ef,{subject:e,documents:e.corpus,deletingDocumentId:n,downloadingDocumentId:r,onDelete:i,onDownload:a})]})]})}function Of(){let e=Gn(),t=hs(),n=o(),[r,i]=(0,R.useState)(!1),[a,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(xf(null)),[u,d]=(0,R.useState)(`auto`),[f,p]=(0,R.useState)([]),[m,h]=(0,R.useState)([]),[_,v]=(0,R.useState)(null),[b,x]=(0,R.useState)(``),[S,C]=(0,R.useState)(`0.1`),[w,T]=(0,R.useState)({grantedBy:``,method:`written`,statement:``}),E=y({queryKey:[`admin`,`distill`,e.token],queryFn:()=>He(e.token)}),D=E.data?.subjects||[];(0,R.useEffect)(()=>{!r&&!a&&D.length>0&&s(df(D[0]))},[r,a,D]);let O=(0,R.useMemo)(()=>r?null:D.find(e=>df(e)===a)||null,[r,a,D]);(0,R.useEffect)(()=>{l(xf(O)),O&&T(e=>({...e,grantedBy:e.grantedBy||O.profile.displayName}))},[O]);let k=E.data?.sourceKinds||uf,A=Sf(D),j=()=>n.invalidateQueries({queryKey:[`admin`,`distill`]}),M=()=>{i(!0),s(``),l(xf(null)),T({grantedBy:``,method:`written`,statement:``}),p([]),h([]),x(``)},N=g({mutationFn:()=>Ue(e.token,{agentId:c.agentId||void 0,alias:c.alias,displayName:c.displayName||void 0,role:c.role||void 0,relationship:c.relationship||void 0,realPerson:c.realPerson,personalityTags:to(c.tags),matchAliases:to(c.matchAliases)}),onSuccess:async e=>{i(!1),s(df(e.subject)),t.success(`Subject saved`),await j()},onError:e=>t.error(`Subject save failed`,H(e))}),P=g({mutationFn:()=>We(e.token,{agentId:c.agentId||void 0,alias:c.alias,subjectName:c.displayName||void 0,grantedBy:w.grantedBy,method:w.method,statement:w.statement}),onSuccess:async e=>{i(!1),s(df(e.subject)),t.success(`Consent recorded`),await j()},onError:e=>t.error(`Consent record failed`,H(e))}),F=g({mutationFn:()=>Ge(e.token,{agentId:c.agentId||void 0,alias:c.alias}),onSuccess:async e=>{i(!1),s(df(e.subject)),t.success(`Agent registered`),await j()},onError:e=>t.error(`Agent registration failed`,H(e))}),I=g({mutationFn:async()=>{let t=[];for(let n of f)t.push(await qe(e.token,n,{alias:c.alias,agentId:c.agentId||void 0,kind:u}));return t},onSuccess:e=>{h(t=>[...t,...e]),p([]),t.success(`Source upload complete`)},onError:e=>t.error(`Upload failed`,H(e))}),ee=g({mutationFn:t=>Ke(e.token,{agentId:c.agentId||void 0,alias:c.alias,displayName:c.displayName||void 0,role:c.role||void 0,relationship:c.relationship||void 0,realPerson:c.realPerson,personalityTags:to(c.tags),matchAliases:to(c.matchAliases),sources:t?[]:[...m.map(e=>e.source),...hf(b,u)],resumeRunId:t,holdoutRatio:Number(S),kind:u}),onSuccess:async e=>{i(!1),s(df(e.subject)),h([]),x(``),t.success(`Run ${ff(e.run)}`),await j()},onError:e=>t.error(`Distillation failed`,H(e))}),L=g({mutationFn:({subject:t,document:n})=>Xe(e.token,{agentId:t.agentId,alias:t.alias,documentId:n.id}),onSuccess:async e=>{i(!1),s(df(e.subject)),t.success(`Corpus document deleted`),await j()},onError:e=>t.error(`Delete failed`,H(e))}),te=async(n,r)=>{if(!_){v(r.id);try{let t=await Ye(e.token,{agentId:n.agentId,alias:n.alias,documentId:r.id}),i=URL.createObjectURL(t),a=window.document.createElement(`a`);a.href=i,a.download=`${r.id}.txt`,a.rel=`noopener noreferrer`,window.document.body.appendChild(a),a.click(),a.remove(),window.setTimeout(()=>URL.revokeObjectURL(i),0)}catch(e){t.error(`Download failed`,H(e))}finally{v(null)}}},ne=(e,t)=>{window.confirm(`Delete ${t.id} from the distillation corpus? The original source file is not deleted.`)&&L.mutate({subject:e,document:t})};if(E.isLoading)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading distillation workspace...`});if(E.isError)return(0,B.jsx)(`div`,{className:`empty-state error`,children:H(E.error)});let re=c.alias.trim()&&(m.length>0||to(b).length>0),ie=O?.latestRun||null;return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{description:`Human distillation intake, consent, source upload, and run control.`,actions:(0,B.jsx)(Z,{variant:`outline`,onClick:()=>void E.refetch(),loading:E.isFetching,children:`Refresh`})}),(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Ua,{label:`Subjects`,value:String(D.length)}),(0,B.jsx)(Ua,{label:`Runs`,value:String(A.runs.length)}),(0,B.jsx)(Ua,{label:`Awaiting Extraction`,value:String(A.awaitingExtraction)}),(0,B.jsx)(Ua,{label:`Open Reviews`,value:String(A.openReviews)})]}),(0,B.jsxs)(`div`,{className:`two-column-grid distill-layout`,children:[(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:r?`New Subject`:`Subject`}),(0,B.jsx)(uo,{children:r?`Create a persona target and authorship aliases.`:`Persona target and authorship aliases.`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`stack-form`,children:[D.length>0?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Existing subject`}),(0,B.jsx)(Bo,{children:(0,B.jsxs)(ds,{value:a,onChange:e=>{i(!1),s(e.target.value)},children:[r?(0,B.jsx)(Q,{value:``,disabled:!0,children:`New subject draft`}):null,D.map(e=>(0,B.jsxs)(Q,{value:df(e),children:[e.profile.displayName,` (`,e.agentId,`/`,e.alias,`)`]},df(e)))]})})]}):null,(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Alias`}),(0,B.jsx)(Bo,{children:(0,B.jsx)(Y,{value:c.alias,onChange:e=>l(t=>({...t,alias:e.target.value}))})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Agent`}),(0,B.jsx)(Bo,{children:(0,B.jsx)(Y,{placeholder:`defaults to alias`,value:c.agentId,onChange:e=>l(t=>({...t,agentId:e.target.value}))})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Name`}),(0,B.jsx)(Bo,{children:(0,B.jsx)(Y,{value:c.displayName,onChange:e=>l(t=>({...t,displayName:e.target.value}))})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Role`}),(0,B.jsx)(Bo,{children:(0,B.jsx)(Y,{value:c.role,onChange:e=>l(t=>({...t,role:e.target.value}))})})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Match aliases`}),(0,B.jsx)(Bo,{children:(0,B.jsx)(Y,{value:c.matchAliases,onChange:e=>l(t=>({...t,matchAliases:e.target.value}))})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Tags`}),(0,B.jsx)(Bo,{children:(0,B.jsx)(Y,{value:c.tags,onChange:e=>l(t=>({...t,tags:e.target.value}))})})]}),(0,B.jsx)(q,{children:(0,B.jsx)(Bo,{children:(0,B.jsxs)(`label`,{className:`button-row`,children:[(0,B.jsx)(cf,{checked:c.realPerson,onCheckedChange:e=>l(t=>({...t,realPerson:e}))}),(0,B.jsx)(`span`,{children:`Real person`})]})})}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{onClick:()=>N.mutate(),loading:N.isPending,disabled:!c.alias.trim(),children:r?`Create Subject`:`Save Subject`}),O&&!O.registeredAgent?(0,B.jsx)(Z,{variant:`outline`,onClick:()=>F.mutate(),loading:F.isPending,disabled:!c.alias.trim(),children:`Register Agent`}):null,O?.registeredAgent?(0,B.jsx)(Ga,{value:!0,trueLabel:`Agent registered`}):null,O?(0,B.jsx)(Ga,{value:O.consent.valid,trueLabel:`Consent valid`,falseLabel:`Consent needed`,falseTone:`danger`}):null]})]})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Consent`}),(0,B.jsx)(uo,{children:`Recorded artefact for real-person distillation.`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`stack-form`,children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Granted by`}),(0,B.jsx)(Bo,{children:(0,B.jsx)(Y,{value:w.grantedBy,onChange:e=>T(t=>({...t,grantedBy:e.target.value}))})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Method`}),(0,B.jsx)(Bo,{children:(0,B.jsx)(Y,{value:w.method,onChange:e=>T(t=>({...t,method:e.target.value}))})})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Statement`}),(0,B.jsx)(Bo,{children:(0,B.jsx)(Jo,{value:w.statement,onChange:e=>T(t=>({...t,statement:e.target.value}))})})]}),(0,B.jsx)(Z,{onClick:()=>P.mutate(),loading:P.isPending,disabled:!c.alias.trim()||!w.grantedBy.trim()||!w.method.trim()||!w.statement.trim(),children:`Record Consent`})]})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Sources`}),(0,B.jsx)(uo,{children:`Uploaded files and host paths for the next run.`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`stack-form`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Kind`}),(0,B.jsx)(Bo,{children:(0,B.jsx)(ds,{value:u,onChange:e=>d(e.target.value),children:k.map(e=>(0,B.jsx)(Q,{value:e,children:e},e))})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Files`}),(0,B.jsx)(Bo,{children:(0,B.jsx)(Y,{type:`file`,multiple:!0,onChange:e=>p(Array.from(e.target.files||[]))})})]}),(0,B.jsx)(Z,{variant:`outline`,onClick:()=>I.mutate(),loading:I.isPending,disabled:!c.alias.trim()||f.length===0,children:`Upload Files`}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Host paths`}),(0,B.jsx)(Bo,{children:(0,B.jsx)(Jo,{value:b,onChange:e=>x(e.target.value)})})]}),m.length>0?(0,B.jsx)(Tf,{uploads:m}):null]})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Run`}),(0,B.jsx)(uo,{children:`Pipeline execution and resume.`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`stack-form`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Holdout ratio`}),(0,B.jsx)(Ho,{children:`Reserves part of the corpus for later fidelity checks. 10% means one in ten documents is kept out of the distillation packet.`}),(0,B.jsx)(Bo,{children:(0,B.jsx)(Y,{type:`number`,min:`0`,max:`0.5`,step:`0.05`,value:S,onChange:e=>C(e.target.value)})})]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{onClick:()=>ee.mutate(void 0),loading:ee.isPending,disabled:!re,children:`Start Distill`}),(0,B.jsx)(Z,{variant:`outline`,onClick:()=>ie?ee.mutate(ie.runId):void 0,loading:ee.isPending,disabled:!ie,children:`Resume Latest`})]})]})})]})]}),(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Subjects`}),(0,B.jsxs)(uo,{children:[A.consentReady,` with valid consent.`]}),(0,B.jsx)(fo,{children:(0,B.jsx)(Z,{variant:`outline`,size:`sm`,onClick:M,children:`New`})})]}),(0,B.jsx)(K,{children:D.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No distillation subjects.`}):(0,B.jsx)(`div`,{className:`list-stack`,children:D.map(e=>(0,B.jsxs)(`button`,{className:`list-row`,type:`button`,onClick:()=>{i(!1),s(df(e))},children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.profile.displayName}),(0,B.jsxs)(`small`,{children:[e.agentId,`/`,e.alias,` ·`,` `,e.corpusDocuments,` docs · `,e.runs.length,` `,`runs ·`,` `,e.registeredAgent?`registered`:`unregistered`]})]}),(0,B.jsxs)(`span`,{className:`status-pill`,children:[(0,B.jsx)(`span`,{className:pf(e.latestRun)}),ff(e.latestRun)]})]},df(e)))})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Latest Run`}),(0,B.jsx)(uo,{children:O?.profile.displayName||`No subject selected`})]}),(0,B.jsx)(K,{children:(0,B.jsx)(Cf,{run:ie})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Source Data`}),(0,B.jsx)(uo,{children:`Uploaded files, source paths, and ingested corpus records.`})]}),(0,B.jsx)(K,{children:(0,B.jsx)(Df,{subject:O,queuedUploads:m,deletingDocumentId:L.isPending&&L.variables?.document.id||null,downloadingDocumentId:_,onDeleteCorpusDocument:ne,onDownloadCorpusDocument:(e,t)=>{te(e,t)}})})]})]})]})]})}var kf=40,Af=72,jf=1e4,Mf=new Intl.NumberFormat;function Nf(e){let t=String(e.specialUse||``).toLowerCase(),n=e.name.toLowerCase();return t===`\\drafts`||n.includes(`draft`)}function Pf(e){return e.unseen>0?String(e.unseen):Nf(e)&&e.total>0?String(e.total):null}function Ff(e){let t=String(e.specialUse||``).toLowerCase(),n=e.name.toLowerCase();return t===`\\inbox`||n===`inbox`?(0,B.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M4.25 5.5h11.5v9.25H12l-2 2-2-2H4.25V5.5Z`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinejoin:`round`})}):n.includes(`later`)||n.includes(`snooze`)||n.includes(`zur`)?(0,B.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:[(0,B.jsx)(`circle`,{cx:`10`,cy:`10`,r:`6.25`,stroke:`currentColor`,strokeWidth:`1.8`}),(0,B.jsx)(`path`,{d:`M10 6.75V10l2.25 1.75`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})]}):t===`\\flagged`||n.includes(`important`)||n.includes(`priority`)||n.includes(`star`)?(0,B.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`m6 5.25 6.5 4.75L6 14.75h8.25`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})}):t===`\\sent`||n.includes(`sent`)?(0,B.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M4.5 10 15.75 4.75l-2.75 10.5-3.5-3-2.75 2V10Z`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})}):Nf(e)?(0,B.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:[(0,B.jsx)(`path`,{d:`M6 3.75h5.5l2.5 2.5v10H6v-12.5Z`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinejoin:`round`}),(0,B.jsx)(`path`,{d:`M11.5 3.75v2.5H14`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinejoin:`round`})]}):t===`\\junk`||n.includes(`spam`)||n.includes(`junk`)?(0,B.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:[(0,B.jsx)(`path`,{d:`M8 3.75h4l4.25 4.25v4L12 16.25H8L3.75 12V8L8 3.75Z`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinejoin:`round`}),(0,B.jsx)(`path`,{d:`M10 7.25v3.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`}),(0,B.jsx)(`circle`,{cx:`10`,cy:`13.2`,r:`0.95`,fill:`currentColor`})]}):t===`\\trash`||n.includes(`trash`)||n.includes(`bin`)?(0,B.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M6.5 6.25h7l-.65 9H7.15l-.65-9Zm1.75 0V4.75h3.5v1.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})}):t===`\\archive`||n.includes(`archive`)?(0,B.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:[(0,B.jsx)(`path`,{d:`M4.25 5h11.5v3H4.25V5Zm.5 3h10.5v7.25H4.75V8Z`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinejoin:`round`}),(0,B.jsx)(`path`,{d:`M8 10.5h4`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`})]}):(0,B.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M3.75 6.5h4.5l1.5 1.75h6.5v6.75H3.75V6.5Z`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinejoin:`round`})})}function If(e){return`${e.folder}:${e.uid}`}function Lf(e){return e<0}function Rf(e){return e.fromName?.trim()||e.fromAddress?.trim()||`Unknown`}function zf(e){let t=String(e.preview||``).replace(/\s+/g,` `).trim();return t?t.length<=Af?t:`${t.slice(0,Af-1).trimEnd()}…`:`No preview available.`}function Bf(e){if(!e)return`Unknown`;let t=new Date(e);if(Number.isNaN(t.getTime()))return`Unknown`;let n=new Date;if(t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate())return t.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`});let r=t.getFullYear()===n.getFullYear();return t.toLocaleDateString([],{day:`numeric`,month:`short`,...r?{}:{year:`numeric`}})}function Vf(e){let t=e.metadata;if(!t)return[];let n=[];return t.agentId&&n.push(`Agent: ${t.agentId}`),t.model&&n.push(`Model: ${t.model}`),t.provider&&n.push(`Provider: ${t.provider}`),t.totalTokens!==null&&n.push(`Tokens: ${Mf.format(t.totalTokens)}${t.tokenSource===`estimated`?` estimated`:``}`),n}function Hf(e){let t=Vf(e);return t.length===0?null:(0,B.jsx)(`div`,{className:`mailbox-message-metadata`,children:t.map(t=>(0,B.jsx)(`small`,{children:t},`${e.uid}:${t}`))})}function Uf(){return(0,B.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M6.5 6.25h7l-.65 9H7.15l-.65-9Zm1.75 0V4.75h3.5v1.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Wf(e,t){let n=t.trim().toLowerCase();return n?[e.fromName||``,e.fromAddress||``,e.subject,e.preview||``].join(` `).toLowerCase().includes(n):!0}function Gf(){let e=Gn(),t=j(),n=Na(),r=o(),i=hs(),[a,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(null),[u,d]=(0,R.useState)(0),[f,p]=(0,R.useState)(null),[m,h]=(0,R.useState)(null),_=(0,R.useDeferredValue)(a),v=y({queryKey:[`admin-email-mailbox`,e.token],queryFn:()=>Et(e.token),enabled:n.emailEnabled,refetchInterval:jf}),b=v.data?.enabled??n.emailEnabled,x=v.data?.folders||[];(0,R.useEffect)(()=>{let e=v.data?.defaultFolder||v.data?.folders[0]?.path||null;if(!e){c!==null&&(l(null),d(0));return}x.some(e=>e.path===c)||(l(e),d(0))},[x,v.data?.defaultFolder,v.data?.folders[0]?.path,c]);let S=y({queryKey:[`admin-email-folder`,e.token,c,u,kf],queryFn:()=>Dt(e.token,{folder:c||``,limit:kf,offset:u}),enabled:b&&!!c,refetchInterval:jf});(0,R.useEffect)(()=>{let e=S.data;!e||S.isLoading||u>0&&e.messages.length===0&&d(Math.max(0,u-kf))},[S.data,S.isLoading,u]);let C=(S.data?.messages||[]).filter(e=>Wf(e,_)),w=f&&C.find(e=>If(e)===f)||null;(0,R.useEffect)(()=>{f!==null&&(C.some(e=>If(e)===f)||p(null))},[C,f]);let T=y({queryKey:[`admin-email-message`,e.token,w?.folder,w?.uid],queryFn:()=>Ot(e.token,{folder:w?.folder||``,uid:w?.uid||0}),enabled:b&&!!w,refetchInterval:jf}),E=g({mutationFn:t=>kt(e.token,t),onMutate:e=>{h(If(e))},onSuccess:async(t,n)=>{f===If(n)&&p(null),await Promise.all([r.invalidateQueries({queryKey:[`admin-email-mailbox`,e.token]}),r.invalidateQueries({queryKey:[`admin-email-folder`,e.token,n.folder]}),r.invalidateQueries({queryKey:[`admin-email-message`,e.token,n.folder,n.uid]})])},onError:e=>{i.error(`Delete failed`,H(e))},onSettled:()=>{h(null)}});function D(e){E.reset(),E.mutate(e)}if(v.isLoading&&!v.data)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Connecting to IMAP mailbox...`});if(v.isError&&!v.data)return(0,B.jsx)(`div`,{className:`empty-state error`,children:H(v.error)});if(!b)return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{description:`Enable the email channel to surface a mailbox view here.`,actions:(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,onClick:()=>{t({to:`/admin/channels`}).catch(Os)},children:`Open channel settings`})}),(0,B.jsx)(`div`,{className:`empty-state`,children:"Email is currently disabled. Turn on the email channel first, then return to `/admin/email`."})]});let O=x.find(e=>e.path===c)||x[0]||null,k=S.data?.messages.length||0,A=k>0?(S.data?.offset||0)+1:0,M=k>0?(S.data?.offset||0)+k:0,N=T.data?.message||null,P=T.data?.thread||[],F=w!==null;return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{actions:(0,B.jsx)(`input`,{className:`compact-search`,value:a,onChange:e=>s(e.target.value),placeholder:`Search sender, subject, preview`})}),(0,B.jsxs)(`div`,{className:`mailbox-shell`,children:[(0,B.jsx)(`aside`,{className:`mailbox-sidebar`,children:(0,B.jsx)(`div`,{className:`mailbox-sidebar-section`,children:(0,B.jsx)(`div`,{className:`mailbox-folder-list`,children:x.map(e=>{let t=Pf(e);return(0,B.jsx)(`button`,{className:[`mailbox-folder-button`,c===e.path?`active`:``,t?`is-emphasized`:``].filter(Boolean).join(` `),type:`button`,onClick:()=>{l(e.path),d(0),p(null)},children:(0,B.jsxs)(`span`,{className:`mailbox-folder-row`,children:[(0,B.jsxs)(`span`,{className:`mailbox-folder-title`,children:[(0,B.jsx)(`span`,{className:`mailbox-folder-symbol`,"aria-hidden":`true`,children:Ff(e)}),(0,B.jsx)(`span`,{className:`mailbox-folder-label`,children:e.name})]}),t?(0,B.jsx)(`strong`,{children:t}):null]})},e.path)})})})}),(0,B.jsx)(`section`,{className:`mailbox-main`,children:F?(0,B.jsxs)(`section`,{className:`mailbox-detail`,children:[(0,B.jsxs)(`div`,{className:`mailbox-detail-toolbar`,children:[(0,B.jsxs)(`div`,{className:`mailbox-detail-toolbar-main`,children:[(0,B.jsx)(`button`,{type:`button`,className:`mailbox-back-button`,"aria-label":`Back to message list`,onClick:()=>p(null),children:(0,B.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M11.75 4.75 6.5 10l5.25 5.25`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),(0,B.jsxs)(`div`,{className:`mailbox-detail-toolbar-copy`,children:[(0,B.jsx)(`strong`,{children:O?.name||`Mailbox`}),(0,B.jsx)(`small`,{children:w.receivedAt?Za(w.receivedAt):`Selected message`})]})]}),(0,B.jsxs)(`button`,{type:`button`,className:`ghost-button mailbox-detail-delete`,disabled:m===If(w)||Lf(w.uid),onClick:()=>D({folder:w.folder,uid:w.uid}),children:[(0,B.jsx)(`span`,{className:`mailbox-detail-delete-icon`,children:Uf()}),(0,B.jsx)(`span`,{children:`Delete`})]})]}),T.isLoading&&!T.data?(0,B.jsx)(`div`,{className:`empty-state mailbox-detail-empty`,children:`Loading message...`}):T.isError?(0,B.jsx)(`div`,{className:`empty-state error mailbox-detail-empty`,children:H(T.error)}):N?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`mailbox-detail-header`,children:(0,B.jsxs)(`div`,{className:`mailbox-detail-copy`,children:[(0,B.jsxs)(`div`,{className:`mailbox-detail-heading`,children:[(0,B.jsx)(`h3`,{children:N.subject}),N.seen?null:(0,B.jsx)(`span`,{className:`mailbox-role-pill needs-reply`,children:`Unread`}),N.answered?(0,B.jsx)(`span`,{className:`mailbox-role-pill replied`,children:`Answered`}):null]}),(0,B.jsxs)(`p`,{className:`supporting-text`,children:[Rf(w),N.fromAddress?` · ${N.fromAddress}`:``,N.receivedAt?` · ${Qa(N.receivedAt)}`:``]}),(0,B.jsxs)(`p`,{className:`supporting-text`,children:[`To:`,` `,N.to.length>0?N.to.map(e=>e.name?.trim()||e.address?.trim()||`Unknown`).join(`, `):`No recipients`]}),N.cc.length>0?(0,B.jsxs)(`p`,{className:`supporting-text`,children:[`Cc:`,` `,N.cc.map(e=>e.name?.trim()||e.address?.trim()||`Unknown`).join(`, `)]}):null]})}),(0,B.jsx)(`div`,{className:`mailbox-message-list`,children:P.map(e=>(0,B.jsxs)(`article`,{className:e.uid===N.uid?`mailbox-message-card user is-selected`:`mailbox-message-card user`,children:[(0,B.jsx)(`div`,{className:`mailbox-message-header`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.fromName||e.fromAddress||`Unknown`}),(0,B.jsxs)(`small`,{children:[e.fromAddress?e.fromAddress:`Unknown sender`,e.receivedAt?` · ${Qa(e.receivedAt)}`:``]}),(0,B.jsxs)(`small`,{children:[`To:`,` `,e.to.length>0?e.to.map(e=>e.name?.trim()||e.address?.trim()||`Unknown`).join(`, `):`No recipients`]}),e.cc.length>0?(0,B.jsxs)(`small`,{children:[`Cc:`,` `,e.cc.map(e=>e.name?.trim()||e.address?.trim()||`Unknown`).join(`, `)]}):null]})}),Hf(e),e.attachments.length>0?(0,B.jsx)(`div`,{className:`mailbox-tag-list`,children:e.attachments.map(t=>(0,B.jsx)(`span`,{className:`meta-chip`,children:t.filename||`attachment`},`${e.uid}:${t.filename||`attachment`}:${t.size||0}`))}):null,(0,B.jsx)(`div`,{className:`mailbox-message-body`,children:e.text||`(empty message)`})]},`${e.folder}:${e.uid}`))})]}):(0,B.jsx)(`div`,{className:`empty-state mailbox-detail-empty`,children:`This message is no longer available in the selected folder.`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`mailbox-column-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:O?.name||`Mailbox`}),(0,B.jsx)(`small`,{children:S.isLoading&&!S.data?`Loading messages...`:`${C.length} shown on this page`})]}),(0,B.jsxs)(`div`,{className:`mailbox-column-actions`,children:[O?(0,B.jsx)(`span`,{className:`meta-chip`,children:O.unseen>0?`${O.unseen} unread`:`${O.total} total`}):null,(0,B.jsxs)(`div`,{className:`mailbox-pagination`,children:[(0,B.jsx)(`small`,{children:k>0?`${A}-${M}`:`0`}),(0,B.jsx)(`button`,{type:`button`,className:`ghost-button mailbox-page-button`,disabled:S.isFetching||S.data?.previousOffset===null,onClick:()=>d(S.data?.previousOffset||0),children:`Previous`}),(0,B.jsx)(`button`,{type:`button`,className:`ghost-button mailbox-page-button`,disabled:S.isFetching||S.data?.nextOffset===null,onClick:()=>d(S.data?.nextOffset||0),children:`Next`})]})]})]}),(0,B.jsx)(`div`,{className:`mailbox-thread-list`,children:S.isLoading&&!S.data?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading live IMAP messages...`}):S.isError?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(S.error)}):C.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No IMAP messages match this folder and search.`}):C.map(e=>(0,B.jsxs)(`div`,{className:[`mailbox-thread-row`,e.seen?``:`is-unread`].filter(Boolean).join(` `),children:[(0,B.jsxs)(`button`,{className:`mailbox-thread-button`,type:`button`,onClick:()=>p(If(e)),children:[(0,B.jsxs)(`div`,{className:`mailbox-thread-summary`,children:[(0,B.jsx)(`strong`,{className:`mailbox-thread-sender`,children:Rf(e)}),(0,B.jsx)(`span`,{className:`mailbox-thread-separator`,children:`-`}),(0,B.jsx)(`strong`,{className:`mailbox-thread-subject`,children:e.subject}),(0,B.jsx)(`span`,{className:`mailbox-thread-separator`,children:`-`}),(0,B.jsx)(`span`,{className:`mailbox-thread-preview`,children:zf(e)})]}),(0,B.jsx)(`span`,{className:`mailbox-thread-time`,children:Bf(e.receivedAt)})]}),(0,B.jsx)(`button`,{type:`button`,className:`mailbox-icon-button mailbox-thread-delete`,"aria-label":`Delete ${e.subject}`,disabled:m===If(e)||Lf(e.uid),onClick:()=>D({folder:e.folder,uid:e.uid}),children:Uf()})]},If(e)))})]})})]})]})}function Kf(e){return e.length>18?`${e.slice(0,12)}...${e.slice(-6)}`:e}function qf(e){return e===`online`?(0,B.jsx)(Ga,{value:!0,trueLabel:`online`}):e===`revoked`?(0,B.jsx)(Ga,{value:!1,falseLabel:`revoked`,falseTone:`danger`}):(0,B.jsx)(Ga,{value:!1,falseLabel:e})}function Jf(e){return typeof e==`number`&&Number.isFinite(e)?`${Math.round(e)}ms`:`unknown`}function Yf(){let e=Gn(),t=o(),[n,r]=(0,R.useState)(``),[i,a]=(0,R.useState)(``),[s,c]=(0,R.useState)(``),[l,u]=(0,R.useState)(``),[d,f]=(0,R.useState)(``),[p,m]=(0,R.useState)(``),h=y({queryKey:[`fleet-topology`,e.token],queryFn:()=>Ve(e.token)}),_=g({mutationFn:()=>{let t=d.trim()?JSON.parse(d):void 0;return Ze(e.token,{peerId:n,agentCardUrl:i||void 0,deliveryUrl:s||void 0,publicKeyFingerprint:l||void 0,publicKeyJwk:t,reason:p||void 0})},onSuccess:n=>{t.setQueryData([`fleet-topology`,e.token],n),r(``),a(``),c(``),u(``),f(``),m(``)}}),v=g({mutationFn:t=>Qe(e.token,t.peerId),onSuccess:n=>{t.setQueryData([`fleet-topology`,e.token],n)}}),b=h.data,x=b?.instances||[],S=n.trim()&&(l.trim()||d.trim());function C(e){r(e.peerId),a(e.agentCardUrl),c(e.deliveryUrl),u(e.publicKeyFingerprint),f(``),m(``)}return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{actions:(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,disabled:h.isFetching,onClick:()=>void h.refetch(),children:`Refresh`})}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`HQ instance`}),(0,B.jsx)(uo,{children:b?.hq.instanceId||`unavailable`})]}),(0,B.jsx)(K,{children:b?(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Status`}),(0,B.jsx)(`strong`,{children:`local`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Version`}),(0,B.jsx)(`strong`,{children:b.hq.version})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Latency`}),(0,B.jsx)(`strong`,{children:Jf(b.hq.latencyMs)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Public key`}),(0,B.jsx)(`strong`,{children:Kf(b.hq.publicKeyFingerprint)})]})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:h.isLoading?`Loading fleet topology...`:`Fleet topology unavailable.`})})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Child instances`}),(0,B.jsx)(uo,{children:`${x.length} instance${x.length===1?``:`s`}`})]}),(0,B.jsxs)(K,{children:[h.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading instances...`}):x.length?(0,B.jsx)(`div`,{className:`list-stack`,children:x.map(e=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{className:`list-row-main`,children:[(0,B.jsx)(`strong`,{children:e.peerId}),(0,B.jsxs)(`small`,{children:[e.version||`version unknown`,` ·`,` `,Jf(e.latencyMs),` · last seen`,` `,Za(e.lastSeenAt)]}),e.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:e.error}):null]}),(0,B.jsxs)(`div`,{className:`row-actions`,children:[qf(e.status),(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,onClick:()=>C(e),children:`Edit`}),(0,B.jsx)(`button`,{className:`danger-button`,type:`button`,disabled:v.isPending,onClick:()=>v.mutate(e),children:`Remove`})]})]},e.peerId))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No child instances configured.`}),v.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:v.error instanceof Error?v.error.message:`Remove failed.`}):null]})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Add instance`}),(0,B.jsx)(uo,{children:`A2A trust ledger`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Instance`}),(0,B.jsx)(Y,{value:n,onChange:e=>r(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Agent Card`}),(0,B.jsx)(Y,{value:i,onChange:e=>a(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Delivery URL`}),(0,B.jsx)(Y,{value:s,onChange:e=>c(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Fingerprint`}),(0,B.jsx)(Y,{value:l,onChange:e=>u(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Public JWK`}),(0,B.jsx)(Jo,{rows:5,value:d,onChange:e=>f(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Reason`}),(0,B.jsx)(Y,{value:p,onChange:e=>m(e.target.value)})]}),(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:!S||_.isPending,onClick:()=>_.mutate(),children:`Trust instance`}),_.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:_.error instanceof Error?_.error.message:`Trust update failed.`}):null,h.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:h.error instanceof Error?h.error.message:`Fleet topology load failed.`}):null]})})]})]}),x.length?(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Instance detail`})}),(0,B.jsx)(K,{children:(0,B.jsx)(`div`,{className:`list-stack`,children:x.map(e=>(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Instance`}),(0,B.jsx)(`strong`,{children:e.peerId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Status`}),(0,B.jsx)(`strong`,{children:e.status})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Agent Card`}),(0,B.jsx)(`strong`,{children:e.agentCardUrl||`not configured`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Delivery URL`}),(0,B.jsx)(`strong`,{children:e.deliveryUrl||`not configured`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Trusted`}),(0,B.jsx)(`strong`,{children:Qa(e.trustedAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Updated`}),(0,B.jsx)(`strong`,{children:Qa(e.updatedAt)})]})]},e.peerId))})})]}):null]})}var Xf=`HYBRIDAI_API_KEY`,Zf=`https://hybridai.one`;function Qf(e){return e.name?`${e.name} (${e.id})`:e.id}function $f(e){return`${e.name} (${e.id})${e.model?` - ${e.model}`:``}`}function ep(e){return JSON.stringify({id:e.id,chatbotId:e.chatbotId,proxy:e.proxy||null})}function tp(e){let t=e.trim();if(!t)throw Error(`HybridAI base URL is required.`);let n;try{n=new URL(t)}catch{throw Error(`HybridAI base URL must be a valid HTTPS URL.`)}if(n.protocol!==`https:`)throw Error(`HybridAI base URL must use HTTPS.`);return n.pathname=n.pathname.replace(/\/+$/g,``),n.username=``,n.password=``,n.search=``,n.hash=``,n.toString().replace(/\/+$/g,``)}function np(e){try{return tp(e)===Zf}catch{return!1}}function rp(){let e=Gn(),t=hs(),n=o(),r=Bd(e.token);zd(r.connection);let[i,a]=(0,R.useState)(!1),[s,c]=(0,R.useState)(``),[l,u]=(0,R.useState)(!1),[d,f]=(0,R.useState)(Zf),[p,m]=(0,R.useState)(``),[h,_]=(0,R.useState)(Xf),[v,b]=(0,R.useState)(`channel`),x=(0,R.useRef)(``),S=r.status||e.gatewayStatus,C=Object.entries(S?.providerHealth||S?.localBackends||{}),w=S?.scheduler?.jobs||[],T=y({queryKey:[`admin-agents`,e.token],queryFn:()=>pt(e.token),refetchOnWindowFocus:!1}),E=np(d),D=y({queryKey:[`admin-hybridai-bots`,e.token],queryFn:()=>mt(e.token,Zf),enabled:l&&E,refetchOnWindowFocus:!1}),O=g({mutationFn:()=>st(e.token),onSuccess:()=>{t.success(`Gateway reloaded.`)},onError:e=>{t.error(`Gateway reload failed`,H(e))}}),k=j(),A=T.data||[],M=A.find(e=>e.id===s)||A.find(e=>e.id===S?.defaultAgentId)||A[0]||null;(0,R.useEffect)(()=>{if(A.length===0)return;let e=A.find(e=>e.id===s)||A.find(e=>e.id===S?.defaultAgentId)||A[0];if(!e)return;let t=ep(e);if(e.id!==s&&c(e.id),x.current===t)return;x.current=t;let n=e.proxy||null;u(!!n),f(n?.baseUrl||Zf),m(n?.chatbotId||e.chatbotId||``),_(n?.apiKey.id||Xf),b(n?.conversationScope||`channel`)},[A,s,S?.defaultAgentId]);let N=D.data||[],P=p&&!N.some(e=>e.id===p)?[{id:p,name:p},...N]:N;(0,R.useEffect)(()=>{if(!l||!E||p)return;let e=N[0]?.id;e&&m(e)},[N,E,p,l]);let F=g({mutationFn:async()=>{if(!M)throw Error(`Select an agent first.`);let t=h.trim(),n=l?{kind:`hybridai`,baseUrl:tp(d),chatbotId:p.trim(),apiKey:{source:`store`,id:t},conversationScope:v}:null;return ht(e.token,M.id,{proxy:n})},onSuccess:r=>{n.setQueryData([`admin-agents`,e.token],e=>e?.map(e=>e.id===r.id?r:e)||[r]),t.success(`Saved proxy mode for ${r.name||r.id}.`)},onError:e=>{t.error(`Proxy mode update failed`,H(e))}});if(!S)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Gateway status is unavailable.`});let I=O.isPending,ee=S.sandbox?.mode===`host`?null:S.sandbox?.warning||null;return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{actions:(0,B.jsx)(`button`,{type:`button`,className:`primary-button`,disabled:I,onClick:()=>a(!0),"aria-busy":I,children:I?(0,B.jsxs)(`span`,{className:`button-with-spinner`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`button-spinner`}),`Reloading Gateway`]}):`Reload Gateway`})}),(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Ua,{label:`Uptime`,value:$a(S.uptime)}),(0,B.jsx)(Ua,{label:`Sessions`,value:String(S.sessions)}),(0,B.jsx)(Ua,{label:`Providers`,value:String(C.length)}),(0,B.jsx)(Ua,{label:`Scheduler jobs`,value:String(w.length)})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Runtime`})}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Version`}),(0,B.jsx)(`strong`,{children:S.version})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`PID`}),(0,B.jsx)(`strong`,{children:S.pid??`n/a`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Timestamp`}),(0,B.jsx)(`strong`,{children:Qa(S.timestamp)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Default model`}),(0,B.jsx)(`strong`,{children:S.defaultModel})]})]})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Services`})}),(0,B.jsxs)(K,{children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Sandbox mode`}),(0,B.jsx)(`strong`,{children:S.sandbox?.mode||`unknown`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Sandbox sessions`}),(0,B.jsx)(`strong`,{children:S.sandbox?.activeSessions??S.activeContainers})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Web API auth`}),(0,B.jsx)(Ga,{value:S.webAuthConfigured,trueLabel:`on`,falseLabel:`off`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`RAG default`}),(0,B.jsx)(Ga,{value:S.ragDefault,trueLabel:`on`,falseLabel:`off`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Observability`}),(0,B.jsx)(Ga,{value:!!(S.observability?.enabled&&S.observability?.running),trueLabel:`active`,falseLabel:`inactive`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Last observability success`}),(0,B.jsx)(`strong`,{children:Qa(S.observability?.lastSuccessAt||null)})]})]}),ee?(0,B.jsx)(`p`,{className:`error-banner`,children:ee}):null,S.codex?.reloginRequired?(0,B.jsx)(`p`,{className:`error-banner`,children:`Codex login is required again.`}):null,S.observability?.lastError?(0,B.jsx)(`p`,{className:`error-banner`,children:S.observability.lastError}):null]})]})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsx)(Ad,{title:`Provider health`,entries:C,onLogin:()=>void k({to:`/admin/config`})}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Agent proxy mode`})}),(0,B.jsx)(K,{children:T.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading agents...`}):A.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No agents are registered.`}):(0,B.jsxs)(`div`,{className:`list-stack`,children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Agent`}),(0,B.jsx)(ds,{value:M?.id||``,onChange:e=>c(e.target.value),children:A.map(e=>(0,B.jsx)(Q,{value:e.id,children:Qf(e)},e.id))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Proxy mode`}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Pc,{checked:l,onCheckedChange:u}),(0,B.jsx)(Ga,{value:l,trueLabel:`on`,falseLabel:`off`})]})]}),l?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`HybridAI base URL`}),(0,B.jsx)(Y,{type:`url`,value:d,placeholder:Zf,onChange:e=>f(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Chatbot id`}),E?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(ds,{value:p,disabled:D.isLoading&&P.length===0,onChange:e=>m(e.target.value),children:[p?null:(0,B.jsx)(Q,{value:``,disabled:!0,children:D.isLoading?`Loading bots...`:`Select bot`}),P.map(e=>(0,B.jsx)(Q,{value:e.id,children:$f(e)},e.id))]}),D.isError?(0,B.jsx)(`p`,{className:`error-banner`,children:H(D.error)}):null]}):(0,B.jsx)(Y,{value:p,onChange:e=>m(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`API key SecretRef id`}),(0,B.jsx)(Y,{value:h,placeholder:Xf,onChange:e=>_(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Conversation scope`}),(0,B.jsxs)(ds,{value:v,onChange:e=>b(e.target.value),children:[(0,B.jsx)(Q,{value:`channel`,children:`channel`}),(0,B.jsx)(Q,{value:`user`,children:`user`})]})]})]}):null]}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{loading:F.isPending,disabled:!M,onClick:()=>F.mutate(),children:`Save Proxy Mode`})})]})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Scheduler snapshot`})}),(0,B.jsx)(K,{children:w.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No scheduler jobs are registered.`}):(0,B.jsx)(`div`,{className:`list-stack`,children:w.slice(0,8).map(e=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.name}),(0,B.jsx)(`small`,{children:e.nextRunAt?`next ${Qa(e.nextRunAt)}`:`no next run scheduled`})]}),(0,B.jsxs)(`div`,{className:`row-status-stack`,children:[(0,B.jsx)(Ga,{value:e.enabled&&!e.disabled,trueLabel:`active`,falseLabel:`inactive`}),(0,B.jsx)(`small`,{children:e.lastStatus||`ready`})]})]},e.id))})})]})]}),(0,B.jsx)(ri,{open:i,onOpenChange:a,children:(0,B.jsxs)(ii,{size:`sm`,role:`alertdialog`,children:[(0,B.jsxs)(ai,{children:[(0,B.jsx)(oi,{children:`Reload Gateway?`}),(0,B.jsx)(si,{children:`This reloads runtime config and refreshes secrets without restarting the workspace container.`})]}),(0,B.jsxs)(ci,{children:[(0,B.jsx)(li,{className:`ghost-button`,children:`Cancel`}),(0,B.jsx)(li,{className:`primary-button`,onClick:()=>O.mutate(),children:`Reload`})]})]})})]})}var ip=new Intl.NumberFormat(`en-US`,{maximumFractionDigits:3});function ap(e){return ip.format(e)}function op(e){return`$${e.toFixed(4)}`}function sp(e){return Object.entries(e.editsPerSurface).filter(([,e])=>e>0).map(([e,t])=>`${e}: ${t}`).join(`, `)||`none`}function cp(e){if(e.length===0)return``;let t=Math.max(1,e.length-1);return e.map((e,n)=>{let r=12+n/t*296,i=84-Math.max(0,Math.min(1,e.metrics.passAt1))*72;return`${r.toFixed(1)},${i.toFixed(1)}`}).join(` `)}function lp({rounds:e}){let t=cp(e);return t?(0,B.jsxs)(`svg`,{"aria-label":`pass@1 trajectory`,role:`img`,viewBox:`0 0 320 96`,style:{width:`100%`,height:120,marginBottom:16},children:[(0,B.jsx)(`title`,{children:`pass@1 trajectory`}),(0,B.jsx)(`line`,{x1:`12`,y1:`84`,x2:`308`,y2:`84`,stroke:`var(--border)`}),(0,B.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`84`,stroke:`var(--border)`}),(0,B.jsx)(`polyline`,{fill:`none`,points:t,stroke:`var(--accent)`,strokeWidth:`2.5`}),t.split(` `).map((t,n)=>{let[r,i]=t.split(`,`);return(0,B.jsx)(`circle`,{cx:r,cy:i,fill:`var(--accent)`,r:`3`},`${e[n]?.round}-${t}`)})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No trajectory yet.`})}function up(){let e=Gn(),[t,n]=(0,R.useState)(``),[r,i]=(0,R.useState)(``),[a,o]=(0,R.useState)(null),[s,c]=(0,R.useState)(``),l=y({queryKey:[`harness-evolution-runs`,e.token,r],queryFn:()=>Nn(e.token,r),enabled:!!r}),u=a||l.data?.runs[0]||null,d=y({queryKey:[`harness-evolution-run`,e.token,r,u?.summaryPath],queryFn:()=>Pn(e.token,r,u?.summaryPath||``),enabled:!!(r&&u?.summaryPath)}),f=s||d.data?.run.rounds[0]?.manifestPath||``,p=y({queryKey:[`harness-evolution-manifest`,e.token,r,f],queryFn:()=>Fn(e.token,r,f),enabled:!!(r&&f)}),m=d.data?.run,h=p.data?.manifest.entries||[],g=(0,R.useMemo)(()=>m?.rounds.reduce((e,t)=>e+t.metrics.rolloutCount,0)||0,[m]);return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{title:`Harness Evolution`,description:`R10a run telemetry, attribution, and F12 manifests.`,actions:(0,B.jsxs)(`form`,{className:`header-actions`,onSubmit:e=>{e.preventDefault(),o(null),c(``),i(t.trim())},children:[(0,B.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),placeholder:`/path/to/target`,style:{minWidth:320}}),(0,B.jsx)(`button`,{type:`submit`,children:`Load`})]})}),r?l.isError?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(l.error)}):l.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading harness evolution runs...`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Ua,{label:`Runs`,value:String(l.data?.runs.length||0),detail:r}),(0,B.jsx)(Ua,{label:`Best pass@1`,value:ap(m?.bestPassAt1||0),detail:m?.bestRound?`round ${m.bestRound}`:`none`}),(0,B.jsx)(Ua,{label:`Rollouts`,value:String(g),detail:`${m?.rounds.length||0} rounds`}),(0,B.jsx)(Ua,{label:`Cost`,value:op(m?.costGate.totalCostUsd||0),detail:m?.costGate.budgetUsd==null?`no budget`:`${m.costGate.ok?`within`:`over`} budget`}),(0,B.jsx)(Ua,{label:`Seed delta`,value:String(m?.seedDelta.changedSurfaceCount||0),detail:m?.seedDelta.mode===`in_place`?`in-place coworker`:`fresh seed`})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Runs`})}),(0,B.jsx)(K,{children:(0,B.jsx)(`div`,{className:`table-wrap`,children:(0,B.jsxs)(`table`,{className:`data-table`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Run`}),(0,B.jsx)(`th`,{children:`Suite`}),(0,B.jsx)(`th`,{children:`Rounds`}),(0,B.jsx)(`th`,{children:`Best`})]})}),(0,B.jsx)(`tbody`,{children:(l.data?.runs||[]).map(e=>(0,B.jsxs)(`tr`,{onClick:()=>{o(e),c(``)},children:[(0,B.jsx)(`td`,{children:e.runId}),(0,B.jsx)(`td`,{children:e.suiteName}),(0,B.jsx)(`td`,{children:e.roundCount}),(0,B.jsx)(`td`,{children:ap(e.bestPassAt1)})]},e.summaryPath))})]})})})]}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Rounds`})}),(0,B.jsx)(K,{children:d.isError?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(d.error)}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(lp,{rounds:m?.rounds||[]}),(0,B.jsx)(`div`,{className:`table-wrap`,children:(0,B.jsxs)(`table`,{className:`data-table`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Round`}),(0,B.jsx)(`th`,{children:`pass@1`}),(0,B.jsx)(`th`,{children:`Succ/Mtok`}),(0,B.jsx)(`th`,{children:`Attribution`}),(0,B.jsx)(`th`,{children:`Edits`}),(0,B.jsx)(`th`,{children:`Evolve`})]})}),(0,B.jsx)(`tbody`,{children:(m?.rounds||[]).map(e=>(0,B.jsxs)(`tr`,{onClick:()=>c(e.manifestPath),children:[(0,B.jsx)(`td`,{children:e.round}),(0,B.jsx)(`td`,{children:ap(e.metrics.passAt1)}),(0,B.jsx)(`td`,{children:ap(e.metrics.succPerMtok)}),(0,B.jsx)(`td`,{children:ap(e.attributionScore)}),(0,B.jsx)(`td`,{children:sp(e)}),(0,B.jsx)(`td`,{children:e.evolveAgent.source})]},e.round))})]})})]})})]})]}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`F12 Manifest`})}),(0,B.jsx)(K,{children:p.isError?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(p.error)}):h.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No manifest entries.`}):(0,B.jsx)(dp,{entries:h})})]})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Enter a target coworker workspace.`})]})}function dp({entries:e}){return(0,B.jsx)(`div`,{className:`table-wrap`,children:(0,B.jsxs)(`table`,{className:`data-table`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Surface`}),(0,B.jsx)(`th`,{children:`Path`}),(0,B.jsx)(`th`,{children:`Prediction`}),(0,B.jsx)(`th`,{children:`Verifier`}),(0,B.jsx)(`th`,{children:`Status`})]})}),(0,B.jsx)(`tbody`,{children:e.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:e.surface}),(0,B.jsx)(`td`,{children:e.path}),(0,B.jsx)(`td`,{children:e.prediction}),(0,B.jsx)(`td`,{children:e.verifier}),(0,B.jsx)(`td`,{children:e.rolledBackAt?`rolled back`:e.confirmed===!1?`disconfirmed`:e.confirmed?`confirmed`:`pending`})]},e.id))})]})})}function fp(e){return e.percent>=100?`hard`:e.percent>=80?`warn`:`neutral`}function pp(e,t){return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:t,maximumFractionDigits:e>=10?0:2}).format(e)}function mp(e){let t=Math.abs(e),n=t>=1e6?{divisor:1e6,suffix:`m`}:t>=1e3?{divisor:1e3,suffix:`k`}:null;if(!n)return Math.round(e).toLocaleString(`en-US`);let r=e/n.divisor;return`${Number.isInteger(r)?r.toFixed(0):r.toFixed(1)}${n.suffix}`}function hp(e,t){return e.unit===`tokens`?mp(t):pp(t,e.currency)}function gp(e){return e.budget?(0,B.jsxs)(`span`,{className:`agent-budget-chip`,"data-tone":fp(e.budget),title:`${Math.floor(e.budget.percent)}% used`,children:[hp(e.budget,e.budget.used),` /`,` `,hp(e.budget,e.budget.cap),e.budget.unit===`tokens`?` tokens`:``]}):null}var _p=[{id:`backlog`,title:`Backlog`},{id:`in_progress`,title:`In Progress`},{id:`review`,title:`Review`},{id:`done`,title:`Done`},{id:`cancelled`,title:`Cancelled`}];function vp(e,t){let n=String(e||``).replace(/\s+/g,` `).trim();return n?n.length>t?`${n.slice(0,t-3).trimEnd()}...`:n:``}function yp(e){return e.sessionId?e.sessionId:e.source===`job`?`scheduler:${e.id}`:null}function bp(e,t){return e.boardStatus?e.boardStatus:t?.status===`active`?`in_progress`:e.lastStatus===`success`&&(e.schedule.kind===`at`||e.schedule.kind===`one_shot`||!e.nextRunAt)?`done`:e.lastStatus===`success`?`review`:`backlog`}function xp(e){return e===`in_progress`?`progress`:e===`review`?`review`:e===`done`?`success`:e===`cancelled`?`danger`:`default`}function Sp(e){return e.column===`in_progress`?`in_progress`:e.column===`in_review`?`review`:e.column===`done`?`done`:`backlog`}function Cp(e){return e.kind===`card`?e.card.edges:[]}function wp(e){return e.kind===`blocked_by`?`Blocked by ${e.toCardId}`:e.kind===`blocks`?`Blocks ${e.toCardId}`:`Related ${e.toCardId}`}function Tp(e,t){return Ep(e)?`paused`:t===`in_progress`?`running`:t===`review`&&e.lastStatus===`error`?`failed`:t===`backlog`||t===`cancelled`?`queued`:`ready`}function Ep(e){return e.source===`task`?e.disabled:!e.enabled||e.disabled}function Dp(e){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;return t}function Op(e){if(!e||e===`unassigned`)return{backgroundColor:`#eef2f7`,color:`#64748b`};let t=Dp(e)%360;return{backgroundColor:`hsla(${t}, 72%, 92%, 1)`,color:`hsl(${t}, 64%, 36%)`}}function kp(e){let{item:t}=e,n=Cp(t),r=(0,R.useMemo)(()=>Op(t.agentKey),[t.agentKey]);return(0,B.jsx)(`div`,{className:[`jobs-card-shell`,e.selected?`active`:``,e.draggable?`draggable`:``].filter(Boolean).join(` `),children:(0,B.jsx)(`button`,{className:`jobs-card-button`,type:`button`,draggable:e.draggable,onClick:e.onSelect,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragOver:e.onDragOver,onDragLeave:e.onDragLeave,onDrop:e.onDrop,children:(0,B.jsxs)(`article`,{className:`jobs-card tone-${t.tone}`,children:[(0,B.jsx)(`div`,{className:`jobs-card-top`,children:(0,B.jsx)(`strong`,{children:vp(t.kind===`job`?t.job.name:t.kind===`card`?t.card.title:t.suspendedSession.blockedLabel,24)})}),(0,B.jsx)(`p`,{children:t.summary}),(0,B.jsx)(`small`,{children:t.stateLabel}),t.kind===`card`&&(t.card.blocked||n.length>0)?(0,B.jsxs)(`div`,{className:`jobs-card-edge-row`,children:[t.card.blocked?(0,B.jsx)(`span`,{className:`jobs-edge-chip blocked`,children:`Blocked`}):null,n.slice(0,3).map(e=>(0,B.jsx)(`span`,{className:`jobs-edge-chip`,children:wp(e)},e.id)),n.length>3?(0,B.jsxs)(`span`,{className:`jobs-edge-chip`,children:[`+`,n.length-3]}):null]}):null,(0,B.jsxs)(`div`,{className:`jobs-card-agent-row`,children:[(0,B.jsx)(`span`,{className:`jobs-card-pill`,style:r,children:t.agentLabel}),(0,B.jsx)(gp,{budget:e.budget})]})]})})})}function Ap(e,t){return(e||[]).map(e=>e.id===t.id&&e.source===`job`?t:e)}function jp(e){let t=[],n=(n,r)=>{let i=String(r||``).trim();i&&t.push({key:`${e.key}:${n.toLowerCase().replace(/\s+/g,`-`)}`,label:n,value:i})},r=(e,t)=>{String(t||``).trim()&&n(e,Qa(t||null))};return e.kind===`blocked`?(r(`Created`,e.suspendedSession.createdAt),r(`Expires`,e.suspendedSession.expiresAt),t):e.kind===`card`?(n(`Card ID`,e.card.id),n(`Source`,e.card.source),n(`Parent`,e.card.parent),r(`Created`,e.card.createdAt),r(`Updated`,e.card.updatedAt),t):(r(`Created`,e.job.createdAt||e.session?.startedAt||null),r(`Last run`,e.job.lastRun),n(`Last status`,e.job.lastStatus?e.job.lastStatus===`success`?`Success`:`Error`:null),n(`Next run`,e.job.schedule.kind!==`at`&&e.job.schedule.kind!==`one_shot`?e.job.nextRunAt:null),n(`Consecutive errors`,e.job.consecutiveErrors>0?String(e.job.consecutiveErrors):null),n(`Retries after failure`,e.job.schedule.kind===`one_shot`&&e.job.maxRetries!=null?String(e.job.maxRetries):null),r(`Session started`,e.session?.startedAt||null),r(`Session last active`,e.session?.lastActive||null),t)}function Mp(e){if(e.kind===`blocked`||e.kind===`card`)return[];let t=e.session?.output&&e.session.output.length>0?e.session.output:e.session?.lastAnswer?[e.session.lastAnswer]:e.job.action.kind===`system_event`&&e.job.lastStatus===`success`?[e.job.action.message]:[``],n=new Set,r=[];for(let e of t){let t=String(e||``).trim();!t||n.has(t)||(n.add(t),r.push(t))}return r}function Np(e,t){return`${e}:${t.trim().slice(0,48).replace(/\s+/g,`-`)}`}function Pp(e){let{item:t}=e,n=j(),r=t.kind===`card`?null:t.kind===`blocked`?t.suspendedSession.sessionId:yp(t.job),i=t.kind===`job`?t.job.id:null,a=Cp(t),o=(0,R.useMemo)(()=>Mp(e.item),[e.item]),[s,c]=(0,R.useState)(null),[l,u]=(0,R.useState)(null),d=e.item.kind===`job`&&e.item.job.source===`job`;function f(t){if(e.item.kind!==`job`)return;let n=e.item.job;n.source===`job`&&(e.onUpdate({...n,source:`job`,...t}),u(null))}async function p(e,t){try{await navigator.clipboard.writeText(t),c(e),window.setTimeout(()=>{c(t=>t===e?null:t)},1600)}catch{c(null)}}return(0,B.jsxs)(`aside`,{className:`jobs-detail`,children:[(0,B.jsxs)(`div`,{className:`jobs-detail-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`eyebrow`,children:`Job`}),(0,B.jsx)(`h4`,{children:e.item.kind===`job`?e.item.job.name:e.item.kind===`card`?e.item.card.title:e.item.suspendedSession.blockedLabel})]}),e.item.kind===`card`?null:(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,onClick:()=>{if(i){n({to:`/admin/scheduler`,search:{jobId:i}}).catch(Os);return}n({to:`/admin/approvals`}).catch(Os)},children:`Edit`})]}),(0,B.jsxs)(`div`,{className:`jobs-detail-stack`,children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Status`}),(0,B.jsx)(`strong`,{children:e.item.stateLabel})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Lane`}),d&&l===`lane`?(0,B.jsx)(`select`,{className:`jobs-inline-select`,value:e.item.kind===`job`&&e.item.job.boardStatus||e.item.column,onBlur:()=>u(null),onChange:e=>f({boardStatus:e.target.value}),children:_p.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.title},e.id))}):(0,B.jsx)(`button`,{className:`jobs-inline-trigger`,type:`button`,disabled:!d||e.savePending,onClick:()=>u(`lane`),children:_p.find(t=>t.id===e.item.column)?.title||e.item.column})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Agent`}),d&&l===`agent`?(0,B.jsxs)(`select`,{className:`jobs-inline-select`,value:e.item.kind===`job`&&e.item.job.agentId||``,onBlur:()=>u(null),onChange:e=>f({agentId:e.target.value||null}),children:[(0,B.jsx)(`option`,{value:``,children:`Unassigned`}),e.agents.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.name?.trim()?`${e.name} (${e.id})`:e.id},e.id))]}):(0,B.jsx)(`button`,{className:`jobs-inline-trigger`,type:`button`,disabled:!d||e.savePending,onClick:()=>u(`agent`),children:e.item.agentLabel})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Type`}),(0,B.jsx)(`strong`,{children:e.item.kind===`blocked`?`blocked`:e.item.kind===`card`?`card`:e.item.job.source===`task`?`task`:`job`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Session`}),(0,B.jsx)(`strong`,{children:r||`n/a`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Channel`}),(0,B.jsx)(`strong`,{children:e.item.kind===`blocked`?e.item.suspendedSession.context.host||`n/a`:e.item.kind===`card`?e.item.card.source:e.item.job.channelId||e.item.job.delivery.to||`n/a`})]}),e.item.kind===`job`&&e.item.job.schedule.kind!==`at`&&e.item.job.schedule.kind!==`one_shot`?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Next run`}),(0,B.jsx)(`strong`,{children:Qa(e.item.job.nextRunAt)})]}):null]}),(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsx)(`span`,{children:`Description`}),(0,B.jsx)(`p`,{children:e.item.kind===`blocked`?e.item.suspendedSession.prompt:e.item.kind===`card`?e.item.card.body||e.item.summary:e.item.job.description||e.item.summary})]}),e.item.kind===`card`?(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsx)(`span`,{children:`Dependencies`}),a.length?(0,B.jsx)(`div`,{className:`jobs-runtime-list`,children:a.map(e=>(0,B.jsxs)(`div`,{className:`jobs-runtime-row`,children:[(0,B.jsx)(`strong`,{children:wp(e)}),(0,B.jsx)(`small`,{children:e.kind})]},e.id))}):(0,B.jsx)(`p`,{children:`No dependencies recorded for this card.`})]}):null,(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsx)(`span`,{children:`Message`}),(0,B.jsx)(`p`,{children:e.item.kind===`blocked`?e.item.suspendedSession.prompt:e.item.kind===`card`?e.item.card.status||`No status recorded.`:e.item.job.action.message||`No action message.`})]}),e.item.kind===`blocked`?(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsxs)(`div`,{className:`summary-block-header`,children:[(0,B.jsx)(`span`,{children:`Resume`}),(0,B.jsx)(`strong`,{children:e.item.suspendedSession.modality})]}),(0,B.jsx)(`p`,{className:`supporting-text`,children:e.item.suspendedSession.prompt}),(0,B.jsx)(Vs,{session:e.item.suspendedSession})]}):null,(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsxs)(`div`,{className:`summary-block-header`,children:[(0,B.jsx)(`span`,{children:`Outputs`}),o.length?(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,onClick:()=>p(`all`,o.join(`
68
+ `}),(0,B.jsxs)(`linearGradient`,{id:`Unbenannter_Verlauf`,"data-name":`Unbenannter Verlauf`,x1:`62.68`,y1:`5028.38`,x2:`63.52`,y2:`5090.47`,gradientTransform:`translate(0 -4996)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`0`,stopColor:`#5be4d0`}),(0,B.jsx)(`stop`,{offset:`.91`,stopColor:`#02a4af`})]}),(0,B.jsxs)(`linearGradient`,{id:`Unbenannter_Verlauf_2`,"data-name":`Unbenannter Verlauf 2`,x1:`36.32`,y1:`5018.17`,x2:`36.05`,y2:`5104.72`,gradientTransform:`translate(0 -4996)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`0`,stopColor:`#39556d`}),(0,B.jsx)(`stop`,{offset:`.45`,stopColor:`#172e3e`})]}),(0,B.jsx)(`clipPath`,{id:`clippath`,children:(0,B.jsx)(`path`,{className:`cls-6`,d:`M48.59,21.94c-.27,1.07-2.63,2.32-3.79,2.03-.12.12.17,2.89.34,3.18.34.6,3.5,1.91,3.43,3.2v28.15c-.79,2.71-1.21,4.65-3.52,6.49-3.23,2.57-4.41,3.29-4.59,4.63-.07.53.04,1.33.94,2.41-3.41-.36-6.06,1.57-6.37,3.71-.25,1.75,1.12,3.23,1.41,3.52-.6.78-.66,1.85-.17,2.68.53.89,1.61,1.33,2.64,1.06,0,1.92.6,2.77,1.09,3.19,1.66,1.42,6.12,1.38,7.62,1.7.17.04.5.12.72.39.21.26.23.57.24.71.04.66.06,3.37.04,7.07-.02.09-.07.2-.16.3-.29.33-.77.27-.82.27-.42,0-.97-.03-1.61-.09-9.48-.93-21.38-9.25-22.38-20.97-.56-6.54,2.51-14.53,9.13-16.87,3.83-1.35,9.02.73,11.15-4.02.67-1.49.79-2.05,1.62-3.53,1.66-2.98-.86-3.21-1.26-4.62-.48-1.68.29-2.63-1.54-4.14-2.91-2.41-6.47-.98-10.08-3.2-12.84-7.88-7.65-25.88,3.73-32.41,1.58-.9,3.98-1.98,5.88-2.52.92-.26,6.29-1.73,6.29-.21v17.88h0ZM39.84,16.17c-3.58.81-1.35,6.98,2.22,4.93,2.72-1.56.91-5.63-2.22-4.93Z`})}),(0,B.jsx)(`clipPath`,{id:`clippath-1`,children:(0,B.jsx)(`path`,{className:`cls-6`,d:`M51.3,3.79c.15-.48,1.05-.43,1.48-.41,12.78.68,25.98,15.26,21.22,28.25-1.16,3.18-4.46,7.04-7.61,8.37-3.14,1.32-6.81.02-9.37,2.55-1.02,1.01-1.08,2.36-1.6,3.55-.7,1.62-1.98,2.42-1.28,4.7.13.42,1.58,3.2,1.9,3.79,2.94,5.37,8.02,2.21,12.58,5.03,5.49,3.39,7.48,9.48,7.08,15.7-.72,11.03-12.65,20.43-23.21,21.23-.35.03-1.45.08-1.45-.38v-7.04c0-1.51,2.33-1.04,3.33-1.28,1.87-.45,7.03-5.48,8.05-7.12,2.33-3.71,2.29-7.97-.55-11.38-3.37-4.04-9.45-3.09-10.5-9.28l-.08-29.2c.44-1.87,2.65-3.97,2.45-5.95-.07-.73-2.44-2.1-2.44-2.71V3.78h0ZM60.96,20.63c2.9-2.93-2.7-6.43-4.04-3.36-1.4,3.19,1.88,5.54,4.04,3.36Z`})}),(0,B.jsxs)(`radialGradient`,{id:`Unbenannter_Verlauf_3`,"data-name":`Unbenannter Verlauf 3`,cx:`52.83`,cy:`5070.22`,fx:`52.83`,fy:`5070.22`,r:`7.54`,gradientTransform:`translate(0 -4996)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`0`,stopColor:`#5be4d0`}),(0,B.jsx)(`stop`,{offset:`.53`,stopColor:`#2ac0bd`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#02a4af`})]}),(0,B.jsxs)(`linearGradient`,{id:`Unbenannter_Verlauf_4`,"data-name":`Unbenannter Verlauf 4`,x1:`20.16`,y1:`5038.91`,x2:`35.48`,y2:`5038.91`,gradientTransform:`translate(0 -4996)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`0`,stopColor:`#20b1e6`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#02a4af`})]}),(0,B.jsxs)(`linearGradient`,{id:`Unbenannter_Verlauf_5`,"data-name":`Unbenannter Verlauf 5`,x1:`19.83`,y1:`2528.13`,x2:`43.54`,y2:`2558.18`,gradientTransform:`translate(0 -2498)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`.12`,stopColor:`#35c5c1`}),(0,B.jsx)(`stop`,{offset:`.34`,stopColor:`#33c3c0`}),(0,B.jsx)(`stop`,{offset:`.42`,stopColor:`#2cbfbd`}),(0,B.jsx)(`stop`,{offset:`.47`,stopColor:`#20b7b9`}),(0,B.jsx)(`stop`,{offset:`.52`,stopColor:`#0facb3`}),(0,B.jsx)(`stop`,{offset:`.55`,stopColor:`#02a4af`})]}),(0,B.jsxs)(`linearGradient`,{id:`Unbenannter_Verlauf_6`,"data-name":`Unbenannter Verlauf 6`,x1:`-27.58`,y1:`-2877.98`,x2:`-16.73`,y2:`-2877.98`,gradientTransform:`translate(-2855.34 111.14) rotate(89.2)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`0`,stopColor:`#20b1e6`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#02a4af`})]}),(0,B.jsxs)(`linearGradient`,{id:`Unbenannter_Verlauf_7`,"data-name":`Unbenannter Verlauf 7`,x1:`91.82`,y1:`5045`,x2:`95.76`,y2:`5045`,gradientTransform:`translate(0 -4996)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`0`,stopColor:`#5be4d0`}),(0,B.jsx)(`stop`,{offset:`.71`,stopColor:`#0babb2`}),(0,B.jsx)(`stop`,{offset:`.8`,stopColor:`#02a4af`})]}),(0,B.jsxs)(`linearGradient`,{id:`Unbenannter_Verlauf_8`,"data-name":`Unbenannter Verlauf 8`,x1:`-5191.49`,y1:`2547.08`,x2:`-5147.38`,y2:`2547.08`,gradientTransform:`translate(-5087.3 -2498) rotate(-180) scale(1 -1)`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`0`,stopColor:`#68e2cf`}),(0,B.jsx)(`stop`,{offset:`.27`,stopColor:`#65e0cd`}),(0,B.jsx)(`stop`,{offset:`.46`,stopColor:`#5bdac8`}),(0,B.jsx)(`stop`,{offset:`.63`,stopColor:`#4cd0c1`}),(0,B.jsx)(`stop`,{offset:`.79`,stopColor:`#36c2b6`}),(0,B.jsx)(`stop`,{offset:`.93`,stopColor:`#19b0a8`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#09a6a0`})]})]}),(0,B.jsxs)(`g`,{id:`Figur`,children:[(0,B.jsxs)(`g`,{id:`Figure`,children:[(0,B.jsx)(`path`,{id:`Fill_R`,"data-name":`Fill R`,className:`cls-12`,d:`M51.3,3.79c.15-.48,1.05-.43,1.48-.41,12.78.68,25.98,15.26,21.22,28.25-1.16,3.18-4.46,7.04-7.61,8.37-3.14,1.32-6.81.02-9.37,2.55-1.02,1.01-1.08,2.36-1.6,3.55-.7,1.62-1.98,2.42-1.28,4.7.13.42,1.58,3.2,1.9,3.79,2.94,5.37,8.02,2.21,12.58,5.03,5.49,3.39,7.48,9.48,7.08,15.7-.72,11.03-12.65,20.43-23.21,21.23-.35.03-1.45.08-1.45-.38v-7.04c0-1.51,2.33-1.04,3.33-1.28,1.87-.45,7.03-5.48,8.05-7.12,2.33-3.71,2.29-7.97-.55-11.38-3.37-4.04-9.45-3.09-10.5-9.28l-.08-29.2c.44-1.87,2.65-3.97,2.45-5.95-.07-.73-2.44-2.1-2.44-2.71V3.78h0ZM60.96,20.63c2.9-2.93-2.7-6.43-4.04-3.36-1.4,3.19,1.88,5.54,4.04,3.36Z`}),(0,B.jsx)(`path`,{id:`Fill_L`,"data-name":`Fill L`,className:`cls-15`,d:`M48.59,21.94c-.27,1.07-2.63,2.32-3.79,2.03-.12.12.17,2.89.34,3.18.34.6,3.5,1.91,3.43,3.2v28.15c-.79,2.71-1.21,4.65-3.52,6.49-3.23,2.57-4.41,3.29-4.59,4.63-.07.53.04,1.33.94,2.41-3.41-.36-6.06,1.57-6.37,3.71-.25,1.75,1.12,3.23,1.41,3.52-.6.78-.66,1.85-.17,2.68.53.89,1.61,1.33,2.64,1.06,0,1.92.6,2.77,1.09,3.19,1.66,1.42,6.12,1.38,7.62,1.7.17.04.5.12.72.39.21.26.23.57.24.71.04.66.06,3.37.04,7.07-.02.09-.07.2-.16.3-.29.33-.77.27-.82.27-.42,0-.97-.03-1.61-.09-9.48-.93-21.38-9.25-22.38-20.97-.56-6.54,2.51-14.53,9.13-16.87,3.83-1.35,9.02.73,11.15-4.02.67-1.49.79-2.05,1.62-3.53,1.66-2.98-.86-3.21-1.26-4.62-.48-1.68.29-2.63-1.54-4.14-2.91-2.41-6.47-.98-10.08-3.2-12.84-7.88-7.65-25.88,3.73-32.41,1.58-.9,3.98-1.98,5.88-2.52.92-.26,6.29-1.73,6.29-.21v17.88h0ZM39.84,16.17c-3.58.81-1.35,6.98,2.22,4.93,2.72-1.56.91-5.63-2.22-4.93Z`}),(0,B.jsx)(`g`,{id:`Shadow_L`,"data-name":`Shadow L`,children:(0,B.jsx)(`g`,{className:`cls-14`,children:(0,B.jsx)(`path`,{className:`cls-4`,d:`M33.96,40.53c1.09.13,6.42.89,9.44,5.42.96,1.44,1.43,2.88,1.67,4.01-4.13,2.33-8.25,4.65-12.38,6.98,4.72,1.87,9.51,1.24,12.16-1.58,2.35-2.5,2.19-5.86,2.2-6.71.04-8.77-13.59-14.58-13.59-14.58,0,0-10.86-4.94-8.19-11.91.24-.63.21-1.38.21-1.38,0,0-.71,4.49-1.33,8.47,1.68,2.85,3.36,5.7,5.03,8.55,1.59.91,3.18,1.82,4.77,2.73h0Z`})})}),(0,B.jsx)(`g`,{id:`Shadow_R`,"data-name":`Shadow R`,children:(0,B.jsx)(`g`,{className:`cls-9`,children:(0,B.jsx)(`path`,{className:`cls-13`,d:`M58.7,49.36c2.31,2.67,4.63,5.35,6.94,8.02-4.11,1.28-8.2.53-10.6-2.02-2.35-2.49-2.19-5.81-2.2-6.71-.04-8.77,13.59-14.58,13.59-14.58,0,0,10.86-4.94,8.19-11.91-.23-.6-.37-1.3-.21-1.38.6-.3,7.63,6.79,5.78,12.68-1.12,3.57-5.3,6.04-10.22,6.64-3.76,3.08-7.52,6.17-11.28,9.25Z`})})})]}),(0,B.jsxs)(`g`,{id:`Hand`,children:[(0,B.jsx)(`path`,{className:`cls-2`,d:`M53.42,82.51c.76.02,1.28.69,1.18,1.3-.08.51-.6.93-1.22.91-3.61-.02-7.23-.05-10.84-.07-.58-.11-.99-.63-.94-1.19.04-.49.42-.92.93-1.01,3.63.02,7.26.04,10.89.07h0Z`}),(0,B.jsx)(`path`,{className:`cls-3`,d:`M58.98,69.91c.58.53,2.13,1.97,2.51,4.31.18,1.08.03,2.26-.54,3.7-.15.38-1.26,2.39-1.4,2.39-.62.02-.82-1.22-2.04-2.85-1.01-1.34-1.61-1.48-3.1-2.87-.88-.82-2.08-2.09-3.3-3.96l-5.58-.03c-.96-.04-1.57-.87-1.43-1.53.11-.52.67-.96,1.36-.97l11.13.28c.61.25,1.5.71,2.39,1.52h0Z`}),(0,B.jsx)(`path`,{className:`cls-2`,d:`M57,79.92c-.78-1.51-1.85-2.04-4.42-3.73-3.49-2.29-3.5-2.63-4.77-2.96-.48-.13-.34-.04-4.3-.13-2.96-.07-4.54-.15-4.97.68-.25.48,0,.98-.48,1.48-.38.39-.79.35-1.02.8-.19.37-.08.76-.05.86.19.64.98,1.1,1.95,1.11,3.89.07,7.78.13,11.68.19.38-.02.7.28.69.65,0,.35-.31.64-.68.63-1.13,0-2.26-.02-3.39-.02-2.76-.01-5.53-.02-8.29-.03-.09.03-.94.36-.96.87-.01.45.64.78.93.93,2.1,1.07,5.93.04,8.32.06.32,0,5.81.04,6.13.04,1.02.72,1.93.91,2.45.97.57.07,1.25.14,1.57-.24.47-.57-.19-1.81-.37-2.16h0ZM48.24,75.4c-1.37,0-2.74,0-4.12.01l-3.64-.02c-.19,0-.32-.16-.3-.31.02-.13.15-.24.31-.23,1.21,0,2.43,0,3.64,0,1.37,0,2.74.02,4.12.03.21-.02.35.14.35.28,0,.13-.17.27-.36.24h0Z`})]}),(0,B.jsxs)(`g`,{id:`Eyes`,children:[(0,B.jsx)(`path`,{className:`cls-16`,d:`M39.84,16.17c3.13-.71,4.94,3.37,2.22,4.93-3.58,2.05-5.81-4.12-2.22-4.93Z`}),(0,B.jsx)(`path`,{className:`cls-16`,d:`M60.96,20.63c-2.16,2.19-5.44-.17-4.04-3.36,1.34-3.07,6.95.43,4.04,3.36Z`})]})]}),(0,B.jsxs)(`g`,{id:`BG_L`,"data-name":`BG L`,children:[(0,B.jsx)(`path`,{className:`cls-10`,d:`M5.05,64.53c-1.61-1.06-.57-4.78,2.09-3.58,2.48,1.12.32,5.16-2.09,3.58Z`}),(0,B.jsx)(`path`,{className:`cls-11`,d:`M20.16,39.38v-2.58c5.1,4.08,10.21,8.16,15.31,12.24h-3.25c-4.02-3.22-8.04-6.44-12.06-9.66Z`}),(0,B.jsx)(`path`,{className:`cls-2`,d:`M17.89,56.05c-2.59,2.18-5.17,4.36-7.76,6.54.05.27.08.7-.02,1.19-.2.98-.81,1.57-1.07,1.83-.13.14-1.85,1.83-4,1.23-1.8-.5-2.99-2.35-2.87-4.2.15-2.18,2.09-3.76,4.04-3.86,1.7-.09,2.91.98,3.19,1.23,2.77-2.22,5.53-4.43,8.3-6.65h21.9c.72,0,1.31.56,1.36,1.23.06.73-.52,1.41-1.3,1.46-3.65,0-7.31,0-10.96,0-3.25,3.28-6.5,6.55-9.75,9.82-.13,3.95-.27,7.89-.4,11.84.44.25,1.75,1.07,2.17,2.6.65,2.39-1.14,5.59-3.72,5.69-2.26.08-4.45-2.25-4.19-4.69.17-1.65,1.43-3.09,3.19-3.65l.24-12.11c2.92-3.17,5.84-6.34,8.76-9.51h-7.1,0ZM5.05,64.53c2.41,1.58,4.57-2.45,2.09-3.58-2.66-1.21-3.7,2.52-2.09,3.58ZM16.28,80.1c-1.44.43-1.7,2.45-.08,3.22,2.95,1.4,3.26-4.18.08-3.22Z`}),(0,B.jsx)(`path`,{className:`cls-8`,d:`M17.97,29.24c.05,1.83.1,3.66.15,5.5,5.56,4.59,11.12,9.17,16.68,13.76h-4.36c-5.13-4.19-10.25-8.39-15.38-12.58-.07-2.27-.14-4.54-.21-6.82-3.39-.35-5.84-3.22-5.71-6.27.16-3.47,3.59-5.71,6.7-5.63,3.28.08,6.43,2.73,6.46,6.12.02,2.52-1.7,4.91-4.33,5.93Z`}),(0,B.jsx)(`path`,{className:`cls-16`,d:`M5.18,47.04c2.03-.37,3.3,2.64,1.25,3.71-2.41,1.27-4.13-3.18-1.25-3.71Z`}),(0,B.jsx)(`path`,{className:`cls-16`,d:`M15.61,25.92c-1.79-.9-2.87-2.25-2.69-3.43.01-.09.18-1.12.97-1.36.56-.17,1.25.13,1.71.75.53-.67,1.31-.97,1.93-.75.64.22.93.92.99,1.35.18,1.18-.98,2.57-2.91,3.44h0Z`}),(0,B.jsx)(`path`,{className:`cls-16`,d:`M16.28,80.1c3.18-.96,2.87,4.62-.08,3.22-1.62-.77-1.36-2.79.08-3.22Z`}),(0,B.jsx)(`path`,{className:`cls-7`,d:`M10.65,50.98c-.02.16-.05.37-.13.61-.6,1.82-3.13,3.02-5.22,2.86-2.54-.2-5.43-2.42-5.3-5.65.12-2.86,2.55-5.2,5.43-5.19,2.62,0,4.93,1.96,5.37,4.64,10.64.08,21.28.16,31.92.24.78.01,1.39.66,1.38,1.39-.01.66-.54,1.25-1.25,1.33-10.74-.08-21.48-.15-32.21-.23h0ZM5.18,47.04c-2.88.53-1.16,4.98,1.25,3.71,2.04-1.07.78-4.09-1.25-3.71Z`}),(0,B.jsx)(`path`,{className:`cls-2`,d:`M24.68,90.27c-2.31,2.31-4.99-1.55-2.7-3.45,2.34-1.95,4.48,1.67,2.7,3.45Z`}),(0,B.jsx)(`path`,{className:`cls-2`,d:`M8.92,36.85c-2.31,2.31-4.99-1.55-2.7-3.45,2.34-1.95,4.48,1.67,2.7,3.45Z`}),(0,B.jsx)(`path`,{className:`cls-2`,d:`M93.04,36.85c-2.31,2.31-4.99-1.55-2.7-3.45,2.34-1.95,4.48,1.67,2.7,3.45Z`})]}),(0,B.jsxs)(`g`,{id:`BG_R`,"data-name":`BG R`,children:[(0,B.jsx)(`path`,{className:`cls-2`,d:`M70.71,48.64c3.42-3.83,6.83-7.66,10.25-11.49v-10.47c-.42-.21-1.21-.67-1.71-1.58-.95-1.7-.59-4.39,1.28-5.48,1.07-.63,2.5-.71,3.56-.2,1.97.95,2.81,3.61,1.84,5.47-.7,1.34-2.1,1.79-2.46,1.89.02,3.68.04,7.35.05,11.03-3.17,3.61-6.34,7.22-9.51,10.83h-3.29,0ZM81.19,24.35c1.24,1.54,4.18-.34,2.74-2.34-1.61-2.23-4.23.49-2.74,2.34Z`}),(0,B.jsx)(`path`,{className:`cls-10`,d:`M94.51,61.48c1.8,1.96-1.05,4.65-2.9,2.77-1.71-1.74,1.07-4.77,2.9-2.77Z`}),(0,B.jsx)(`path`,{className:`cls-16`,d:`M92.51,50.49c-2.29-2.28,1.74-5.2,3.11-2.43,1.08,2.19-1.56,3.98-3.11,2.43Z`}),(0,B.jsx)(`path`,{className:`cls-2`,d:`M73.93,55.93c1.42,1.47,2.85,2.95,4.29,4.43,1.56,1.6,3.12,3.19,4.68,4.76,0,2.1.02,4.2.02,6.3.01,2.08.02,4.16.03,6.24.06.63-.06.83-.18.89-.22.11-.43-.24-.9-.26-.54-.02-.8.44-1.07.32-.14-.06-.27-.26-.25-.88-.05-1.99-.09-3.98-.13-5.99-.04-1.96-.07-3.9-.1-5.85-1.53-1.59-2.8-2.83-3.67-3.64-.56-.53-1.08-1.05-2.44-2.42-1-1-2.34-2.36-3.97-4.01.68-.5,1.06-.52,1.3-.41.35.15.41.59.68.59.3,0,.37-.54.73-.63.18-.05.49,0,1,.57h0Z`}),(0,B.jsx)(`path`,{className:`cls-2`,d:`M77.99,86.94c1.03.87.95,3.54-.66,3.92-5.13,1.21-2.91-6.93.66-3.92Z`}),(0,B.jsx)(`path`,{className:`cls-5`,d:`M92.51,50.49c1.56,1.55,4.19-.25,3.11-2.43-1.37-2.76-5.4.16-3.11,2.43Z`}),(0,B.jsx)(`path`,{className:`cls-10`,d:`M80.69,78.19c1.59-.78,3.23.18,3.44.31,1.25.75,1.65,1.95,1.71,2.17.07.23.31,1.57-.18,2.82-1.11,2.83-5.22,2.7-6.59.31-.73-1.27-.44-2.93.03-3.89.19-.39.61-1.25,1.58-1.72h0Z`}),(0,B.jsx)(`path`,{id:`_55`,"data-name":` 55`,className:`cls-16`,d:`M82,80.14c3.18-.96,2.87,4.62-.08,3.22-1.62-.77-1.36-2.79.08-3.22Z`}),(0,B.jsx)(`path`,{className:`cls-1`,d:`M89.38,51.26c.02.09.05.22.09.37.59,1.79,3.12,3.02,5.22,2.86,2.54-.2,5.43-2.42,5.3-5.65-.12-2.82-2.51-5.23-5.43-5.19-2.73.03-5.06,2.19-5.3,4.99-10.7-.05-21.41-.11-32.11-.16-.76.08-1.31.74-1.27,1.45.04.64.56,1.19,1.24,1.27,10.75.02,21.5.05,32.25.07h0Z`}),(0,B.jsx)(`path`,{className:`cls-16`,d:`M93.95,47.08c2.03-.37,3.3,2.64,1.25,3.71-2.41,1.27-4.13-3.18-1.25-3.71Z`}),(0,B.jsx)(`path`,{className:`cls-10`,d:`M71.28,56.05c-3.42.01-6.85.02-10.27.03-.72-.23-1.15-.92-1.04-1.58.08-.52.49-.95,1.03-1.11h19.58c2.42,1.96,4.84,3.91,7.26,5.87.33.23.67.49,1.02.76.25.2.49.39.71.58-.19.98-.38,1.96-.56,2.94-.41-.4-.82-.79-1.22-1.19-.66-.63-1.5-1.44-1.6-1.54-1.22-1.16-5.23-4.29-5.93-4.83-2.13.02-4.26.03-6.39.05-.86,0-1.72,0-2.58.01h0Z`}),(0,B.jsx)(`path`,{className:`cls-2`,d:`M89.55,60.57c.25-.33.88-1.14,1.96-1.58,1.69-.69,3.78-.17,4.86,1.32,2.92,4.03-2,8.77-6.09,5.82-.33-.24-.79-.74-1.04-1.19-.2-.37-.57-.92-.64-1.65-.14-1.27.61-2.26.95-2.71h0ZM94.51,61.48c-1.83-2-4.62,1.03-2.9,2.77,1.85,1.88,4.7-.81,2.9-2.77Z`})]})]})}function Hu({children:e,viewBox:t=`0 0 24 24`,...n}){return(0,B.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:`18`,height:`18`,viewBox:t,xmlns:`http://www.w3.org/2000/svg`,...n,children:e})}function Uu(e){return(0,B.jsx)(Hu,{viewBox:`0 0 24 24`,...e,children:(0,B.jsx)(`path`,{fill:`#D97757`,d:`M13.83 4h-3.43l5.93 16h3.43L13.83 4ZM6.78 4 .85 20h3.5l1.21-3.4h6.16L12.93 20h3.5L10.5 4H6.78Zm-.06 9.46 2.06-5.78 2.06 5.78H6.72Z`})})}function Wu(e){return(0,B.jsx)(Hu,{viewBox:`0 0 20 20`,...e,children:(0,B.jsx)(`path`,{fill:`currentColor`,d:`M11.248 18.25q-.825 0-1.568-.314a4.3 4.3 0 0 1-1.32-.874 4 4 0 0 1-1.304.214 4 4 0 0 1-2.046-.544 4.27 4.27 0 0 1-1.518-1.485 4 4 0 0 1-.56-2.095q0-.48.131-1.04A4.4 4.4 0 0 1 2.04 10.71a4.07 4.07 0 0 1 .017-3.4 4.2 4.2 0 0 1 1.056-1.418 3.8 3.8 0 0 1 1.6-.842 3.9 3.9 0 0 1 .76-1.683q.593-.759 1.451-1.188a4.04 4.04 0 0 1 1.832-.429q.825 0 1.567.313.742.314 1.32.875a4 4 0 0 1 1.304-.215q1.106 0 2.046.545a4.14 4.14 0 0 1 1.501 1.485q.578.941.578 2.095 0 .48-.132 1.04.66.61 1.023 1.419.363.792.363 1.666 0 .892-.38 1.717a4.3 4.3 0 0 1-1.072 1.435 3.8 3.8 0 0 1-1.584.825 3.8 3.8 0 0 1-.775 1.683 4.06 4.06 0 0 1-1.436 1.188 4.04 4.04 0 0 1-1.832.429m-4.076-2.062q.825 0 1.435-.347l3.103-1.782a.36.36 0 0 0 .164-.313v-1.42L7.881 14.62a.67.67 0 0 1-.726 0l-3.118-1.798a.5.5 0 0 1-.017.115v.198q0 .841.396 1.551.413.693 1.139 1.089a3.2 3.2 0 0 0 1.617.412m.165-2.69a.4.4 0 0 0 .181.05q.083 0 .165-.05l1.238-.71-3.977-2.31a.7.7 0 0 1-.363-.643v-3.58q-.825.362-1.32 1.122a2.9 2.9 0 0 0-.495 1.65q0 .809.413 1.55.412.743 1.072 1.123zm3.91 3.663q.875 0 1.585-.396a2.96 2.96 0 0 0 1.534-2.64v-3.564a.32.32 0 0 0-.165-.297l-1.254-.726v4.604a.7.7 0 0 1-.363.643l-3.119 1.799a3 3 0 0 0 1.783.577m.627-6.039V8.878L10.01 7.822 8.129 8.878v2.244l1.881 1.056zM7.057 5.859a.7.7 0 0 1 .363-.644l3.119-1.798a3 3 0 0 0-1.782-.578q-.874 0-1.584.396A2.96 2.96 0 0 0 6.05 4.324a3.07 3.07 0 0 0-.396 1.551v3.547q0 .199.165.314l1.237.726zm8.383 7.887q.825-.364 1.303-1.123.495-.758.495-1.65a3.15 3.15 0 0 0-.412-1.55q-.413-.743-1.073-1.123l-3.086-1.782q-.099-.065-.181-.049a.3.3 0 0 0-.165.05l-1.238.692 3.993 2.327a.6.6 0 0 1 .264.264.64.64 0 0 1 .1.363zm-3.317-8.382a.63.63 0 0 1 .726 0l3.135 1.831v-.297q0-.792-.396-1.501a2.86 2.86 0 0 0-1.105-1.155q-.71-.43-1.65-.43-.825 0-1.436.347L8.294 5.941a.36.36 0 0 0-.165.314v1.418z`})})}function Gu(e){return(0,B.jsxs)(Hu,{viewBox:`0 0 24 24`,...e,children:[(0,B.jsx)(`defs`,{children:(0,B.jsxs)(`linearGradient`,{id:`gemini-grad`,x1:`0`,y1:`0`,x2:`24`,y2:`24`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{offset:`0`,stopColor:`#1C7DFF`}),(0,B.jsx)(`stop`,{offset:`0.52`,stopColor:`#1C69FF`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#F0DCD6`})]})}),(0,B.jsx)(`path`,{fill:`url(#gemini-grad)`,d:`M12 24a14.34 14.34 0 0 0-2.26-3.78A14.27 14.27 0 0 0 5.95 17 14.34 14.34 0 0 0 0 12a14.27 14.27 0 0 0 5.95-3.18A14.27 14.27 0 0 0 9.74 5 14.34 14.34 0 0 0 12 0a14.34 14.34 0 0 0 2.26 3.78A14.27 14.27 0 0 0 18.05 7 14.27 14.27 0 0 0 24 12a14.34 14.34 0 0 0-5.95 3.18A14.27 14.27 0 0 0 14.26 19 14.34 14.34 0 0 0 12 24Z`})]})}function Ku(e){return(0,B.jsxs)(Hu,{viewBox:`0 0 48 48`,...e,children:[(0,B.jsx)(`path`,{fill:`#FFC107`,d:`M43.611 20.083H42V20H24v8h11.303c-1.649 4.657-6.08 8-11.303 8-6.627 0-12-5.373-12-12s5.373-12 12-12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 12.955 4 4 12.955 4 24s8.955 20 20 20 20-8.955 20-20c0-1.341-.138-2.65-.389-3.917Z`}),(0,B.jsx)(`path`,{fill:`#FF3D00`,d:`m6.306 14.691 6.571 4.819C14.655 15.108 18.961 12 24 12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 16.318 4 9.656 8.337 6.306 14.691Z`}),(0,B.jsx)(`path`,{fill:`#4CAF50`,d:`M24 44c5.166 0 9.86-1.977 13.409-5.192l-6.19-5.238C29.211 35.091 26.715 36 24 36c-5.202 0-9.619-3.317-11.283-7.946l-6.522 5.025C9.505 39.556 16.227 44 24 44Z`}),(0,B.jsx)(`path`,{fill:`#1976D2`,d:`M43.611 20.083H42V20H24v8h11.303a12.04 12.04 0 0 1-4.087 5.571l.003-.002 6.19 5.238C36.971 39.205 44 34 44 24c0-1.341-.138-2.65-.389-3.917Z`})]})}function qu(e){return(0,B.jsx)(Hu,{viewBox:`0 0 24 24`,...e,children:(0,B.jsx)(`path`,{fill:`currentColor`,d:`M12 .5C5.65.5.5 5.65.5 12c0 5.09 3.29 9.39 7.86 10.91.57.11.78-.25.78-.56v-2.13c-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.68-1.28-1.68-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.03 1.75 2.69 1.25 3.34.95.1-.74.4-1.25.73-1.53-2.55-.29-5.23-1.28-5.23-5.68 0-1.26.45-2.28 1.18-3.08-.12-.29-.51-1.46.11-3.04 0 0 .96-.31 3.16 1.17A10.8 10.8 0 0 1 12 6.07c.98 0 1.95.13 2.87.38 2.2-1.48 3.16-1.17 3.16-1.17.62 1.58.23 2.75.11 3.04.74.8 1.18 1.82 1.18 3.08 0 4.42-2.69 5.38-5.25 5.67.41.36.78 1.06.78 2.14v3.14c0 .31.21.67.79.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z`})})}function Ju(e){return(0,B.jsx)(Hu,{viewBox:`0 0 24 24`,...e,children:(0,B.jsx)(`path`,{fill:`#4D6BFE`,d:`M22.92 5.5a.5.5 0 0 0-.78-.42l-.95.65a.6.6 0 0 1-.69-.02 8.93 8.93 0 0 0-3.16-1.43c-.35-.08-.46-.5-.2-.74.27-.25.13-.7-.23-.76a8.94 8.94 0 0 0-3.4-.04 8.84 8.84 0 0 0-7.13 7.4 8.7 8.7 0 0 0 .15 3.59c.21.86.55 1.66.99 2.4a.6.6 0 0 1-.06.7l-.85.94a.5.5 0 0 0 .35.83l1.39.06a.6.6 0 0 1 .56.5 8.84 8.84 0 0 0 8.74 7.34 8.84 8.84 0 0 0 5.93-2.27.5.5 0 0 0-.34-.86l-1.18-.05a.6.6 0 0 1-.55-.5 8.84 8.84 0 0 0-3.59-5.65.6.6 0 0 1-.13-.85 8.84 8.84 0 0 0 1.85-4.7.6.6 0 0 1 .39-.5l1.74-.62a.5.5 0 0 0 .31-.62l-.06-.18ZM14.6 9a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Z`})})}function Yu(e){return(0,B.jsxs)(Hu,{viewBox:`0 0 256 256`,...e,children:[(0,B.jsx)(`path`,{fill:`#000`,d:`M186 28h42v42h-42zM28 28h42v42H28zM28 70h42v42H28zM28 112h42v42H28zM28 154h42v42H28zM28 196h42v42H28z`}),(0,B.jsx)(`path`,{fill:`#F7D046`,d:`M186 28h42v42h-42z`}),(0,B.jsx)(`path`,{fill:`#F2A73B`,d:`M70 70h42v42H70zM186 70h42v42h-42z`}),(0,B.jsx)(`path`,{fill:`#EE792F`,d:`M112 112h42v42h-42zM70 112h42v42H70zM186 112h42v42h-42z`}),(0,B.jsx)(`path`,{fill:`#EB5829`,d:`M70 154h42v42H70zM186 154h42v42h-42z`}),(0,B.jsx)(`path`,{fill:`#EA3326`,d:`M70 196h42v42H70zM186 196h42v42h-42z`})]})}function Xu(e){return(0,B.jsx)(Hu,{viewBox:`0 0 24 24`,...e,children:(0,B.jsx)(`path`,{fill:`#0866FF`,d:`M5.31 8.78c.85-1.32 1.99-2.32 3.27-2.32 1.46 0 2.45.69 4.32 3.41 2 2.92 2.46 3.6 3.46 3.6.96 0 1.62-.91 1.62-2.55 0-1.83-.89-3.31-2.36-3.31-.79 0-1.6.31-2.45 1.18l-1.18-1.6C12.97 6.18 14.31 5 16.32 5c2.96 0 4.68 2.75 4.68 5.65 0 3.16-1.81 4.91-4.18 4.91-1.79 0-2.95-.71-4.4-2.83l-1.93-2.86c-.71-1.07-1.16-1.43-1.86-1.43-.94 0-1.61 1.03-1.61 2.5 0 1.49.5 2.36 1.55 2.36.61 0 1.13-.16 1.69-.6l.99 1.69c-.96.74-2 1.18-3.08 1.18C5.42 15.57 3 13.78 3 10.27 3 7.18 4.84 5 7.27 5c1.48 0 2.6.69 3.4 1.95l-1.36 1.83c-.66-.85-1.34-1.27-2.1-1.27-1.16 0-2.06 1.16-2.06 2.84 0 1.62.78 2.61 1.84 2.61.62 0 1.06-.21 1.41-.49Z`})})}function Zu(e){return(0,B.jsxs)(Hu,{viewBox:`0 0 466.04 516.93`,...e,children:[(0,B.jsx)(`path`,{fill:`currentColor`,d:`M.12 182.71h104.01l234.02 334.21H234.14L.12 182.71Z`}),(0,B.jsx)(`path`,{fill:`currentColor`,d:`M0 516.92h104.08l52-74.25-52.04-74.33L0 516.92Z`}),(0,B.jsx)(`path`,{fill:`currentColor`,d:`M466.04 0H361.96L182.1 256.86l52.05 74.32L466.04 0Z`}),(0,B.jsx)(`path`,{fill:`currentColor`,d:`M380.78 516.92h85.26V37.16L380.78 158.92v358Z`})]})}function Qu(e){return(0,B.jsxs)(Hu,{viewBox:`0 0 24 24`,...e,children:[(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,fill:`#FFD21E`}),(0,B.jsx)(`circle`,{cx:`8.5`,cy:`10.5`,r:`1.4`,fill:`#3A3B45`}),(0,B.jsx)(`circle`,{cx:`15.5`,cy:`10.5`,r:`1.4`,fill:`#3A3B45`}),(0,B.jsx)(`path`,{fill:`#3A3B45`,d:`M8 14.5a4 4 0 0 0 8 0c0-.6-.5-1-1.1-1H9.1c-.6 0-1.1.4-1.1 1Z`})]})}function $u(e){return(0,B.jsx)(Hu,{viewBox:`0 0 24 24`,...e,children:(0,B.jsx)(`path`,{fill:`currentColor`,d:`M16.778 1.844v1.919q-.569-.026-1.138-.032q-.708-.008-1.415.037c-1.93.126-4.023.728-6.149 2.237-2.911 2.066-2.731 1.95-4.14 2.75-.396.223-1.342.574-2.185.798-.841.225-1.753.333-1.751.333v4.229s.768.108 1.61.333c.842.224 1.789.575 2.185.799 1.41.798 1.228.683 4.14 2.75 2.126 1.509 4.22 2.11 6.148 2.236.88.058 1.716.041 2.555.005v1.918l7.222-4.168-7.222-4.17v2.176c-.86.038-1.611.065-2.278.021-1.364-.09-2.417-.357-3.979-1.465-2.244-1.593-2.866-2.027-3.68-2.508.889-.518 1.449-.906 3.822-2.59 1.56-1.109 2.614-1.377 3.978-1.466.667-.044 1.418-.017 2.278.02v2.176L24 6.014Z`})})}function ed(e){return(0,B.jsxs)(Hu,{viewBox:`0 0 24 24`,...e,children:[(0,B.jsx)(`rect`,{x:`2`,y:`2`,width:`9.5`,height:`9.5`,fill:`#F25022`}),(0,B.jsx)(`rect`,{x:`12.5`,y:`2`,width:`9.5`,height:`9.5`,fill:`#7FBA00`}),(0,B.jsx)(`rect`,{x:`2`,y:`12.5`,width:`9.5`,height:`9.5`,fill:`#00A4EF`}),(0,B.jsx)(`rect`,{x:`12.5`,y:`12.5`,width:`9.5`,height:`9.5`,fill:`#FFB900`})]})}function td(e){return(0,B.jsx)(Hu,{viewBox:`0 0 17 25`,...e,children:(0,B.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M4.405.102c.216.097.411.256.588.466.295.348.544.845.734 1.435.191.593.315 1.25.362 1.909a4.311 4.311 0 0 1 2.049-.723l.051-.004c.87-.08 1.73.099 2.48.539.101.06.2.125.297.193.05-.647.172-1.289.36-1.868.19-.591.439-1.088.733-1.437.164-.202.365-.361.589-.466.257-.113.53-.134.796-.047.401.129.745.418 1.016.837.248.383.434.874.561 1.463.23 1.061.27 2.458.115 4.142l.053.045.026.022c.757.654 1.284 1.587 1.563 2.67.435 1.69.216 3.585-.534 4.646l-.018.023.002.004c.417.865.67 1.78.724 2.726l.002.034c.064 1.21-.2 2.428-.814 3.625l-.007.011.01.028c.472 1.314.62 2.638.438 3.961l-.006.044a.705.705 0 0 1-.263.48.61.61 0 0 1-.484.129.647.647 0 0 1-.424-.294.816.816 0 0 1-.116-.549c.167-1.174.01-2.351-.48-3.549a.79.79 0 0 1 .04-.708l.004-.007c.604-1.05.854-2.079.8-3.091-.046-.885-.325-1.754-.8-2.583a.797.797 0 0 1-.091-.545.75.75 0 0 1 .272-.462l.009-.007c.243-.181.467-.642.58-1.273.125-.745.092-1.514-.095-2.243-.205-.795-.58-1.459-1.105-1.912-.595-.516-1.383-.765-2.38-.693a.605.605 0 0 1-.632-.422c-.314-.756-.772-1.297-1.343-1.632a3.184 3.184 0 0 0-1.772-.377c-1.245.113-2.343.91-2.67 1.916a.695.695 0 0 1-.61.483c-1.067.002-1.893.286-2.497.799-.522.443-.878 1.062-1.066 1.804a5.095 5.095 0 0 0-.068 2.143c.112.634.331 1.159.582 1.442l.008.008a.797.797 0 0 1 .109.892c-.36.707-.629 1.76-.673 2.773-.05 1.157.186 2.161.719 2.882l.016.021a.793.793 0 0 1 .095.784c-.576 1.405-.753 2.559-.562 3.468a.763.763 0 0 1-.49.871.616.616 0 0 1-.485-.086.724.724 0 0 1-.295-.446c-.243-1.157-.078-2.482.473-3.975l.014-.04-.008-.013a5.125 5.125 0 0 1-.598-1.488l-.005-.022a6.376 6.376 0 0 1-.177-2.028c.044-1.034.278-2.093.622-2.943l.012-.03-.002-.002c-.293-.475-.51-1.083-.63-1.756l-.005-.027a6.282 6.282 0 0 1 .093-2.829c.262-1.04.777-1.933 1.536-2.578.06-.051.123-.102.186-.15-.159-1.697-.119-3.102.112-4.171.127-.588.314-1.079.562-1.462.27-.418.614-.707 1.015-.838.266-.086.54-.066.797.049Zm4.116 10.329c.936 0 1.8.356 2.446.972.63.599 1.005 1.403 1.005 2.205 0 1.008-.406 1.795-1.133 2.297-.62.426-1.451.633-2.403.633-1.009 0-1.871-.294-2.493-.834-.617-.534-.963-1.284-.963-2.096 0-.804.398-1.61 1.056-2.212.668-.61 1.55-.965 2.485-.965Zm0 1.019a2.88 2.88 0 0 0-1.916.738c-.461.421-.722.949-.722 1.421 0 .486.21.942.61 1.288.455.395 1.124.623 1.943.623.799 0 1.473-.167 1.932-.484.463-.318.7-.78.7-1.428 0-.481-.246-1.012-.683-1.427a2.722 2.722 0 0 0-1.864-.731Zm.662 1.375.004.004a.409.409 0 0 1-.056.557l-.292.261v.507a.39.39 0 0 1-.376.424.39.39 0 0 1-.376-.424v-.523l-.271-.247a.407.407 0 0 1-.052-.557.356.356 0 0 1 .494-.058l.211.195.22-.197a.355.355 0 0 1 .49.058Zm-5.04-2.181c.478 0 .867.443.867.99a.93.93 0 0 1-.868.989.93.93 0 0 1-.867-.988.93.93 0 0 1 .868-.991Zm8.706 0c.48 0 .868.443.868.99a.93.93 0 0 1-.868.989.93.93 0 0 1-.867-.988.93.93 0 0 1 .867-.991ZM3.94 1.477l-.003.002a.685.685 0 0 0-.285.271l-.005.007c-.138.214-.258.53-.348.945-.17.786-.216 1.853-.124 3.161.43-.145.899-.236 1.404-.269l.01-.001.019-.039c.046-.093.095-.183.148-.271.123-.876.022-1.923-.253-2.778-.134-.413-.297-.738-.453-.923a.583.583 0 0 0-.107-.102l-.003-.003Zm9.174.045-.002.002a.577.577 0 0 0-.107.102c-.156.185-.32.511-.453.925-.29.902-.387 2.018-.23 2.922l.058.111.008.016h.03c.497 0 .99.081 1.466.241.086-1.278.038-2.322-.128-3.094-.09-.414-.21-.73-.349-.945l-.004-.007a.69.69 0 0 0-.285-.271l-.004-.002Z`})})}function nd({letter:e,fill:t=`currentColor`,color:n=`#fff`,...r}){return(0,B.jsxs)(Hu,{viewBox:`0 0 24 24`,...r,children:[(0,B.jsx)(`rect`,{width:`24`,height:`24`,rx:`6`,fill:t}),(0,B.jsx)(`text`,{x:`12`,y:`16.5`,textAnchor:`middle`,fontFamily:`system-ui, -apple-system, sans-serif`,fontSize:`13`,fontWeight:`700`,fill:n,children:e})]})}function rd(e){return(0,B.jsx)(Wu,{...e})}function id(e){return(0,B.jsx)(nd,{letter:`Z`,fill:`#1F6FEB`,...e})}function ad(e){return(0,B.jsx)(nd,{letter:`K`,fill:`#0F172A`,...e})}function od(e){return(0,B.jsx)(nd,{letter:`M`,fill:`#7C3AED`,...e})}function sd(e){return(0,B.jsx)(nd,{letter:`Q`,fill:`#FF6A00`,...e})}function cd(e){return(0,B.jsx)(nd,{letter:`Mi`,fill:`#FF6900`,...e})}function ld(e){return(0,B.jsx)(nd,{letter:`K`,fill:`#10B981`,...e})}function ud({width:e=18,height:t=18,className:n,style:r}){return(0,B.jsx)(`img`,{"aria-hidden":`true`,src:Bu,width:e,height:t,className:n,style:r,alt:``,draggable:!1,decoding:`async`})}function dd(e){return(0,B.jsx)(nd,{letter:`L`,fill:`#475569`,...e})}function fd(e){return(0,B.jsxs)(Hu,{viewBox:`0 0 96 96`,...e,children:[(0,B.jsx)(`path`,{fill:`currentColor`,opacity:`0.28`,d:`M42.22 28.47v55.31L14.57 28.47Z`}),(0,B.jsx)(`path`,{fill:`currentColor`,opacity:`0.28`,d:`M42.22 83.78h21.73L82.61 13.39 57.03 26.85Z`}),(0,B.jsx)(`path`,{fill:`currentColor`,d:`M41.05 27.29v55.31L13.39 27.29Z`}),(0,B.jsx)(`path`,{fill:`currentColor`,d:`M41.05 82.6h21.73l18.65-70.38-25.57 13.46Z`})]})}function pd(e){return(0,B.jsx)(nd,{letter:`Q`,fill:`#FF6A00`,...e})}var md={connectorGrid:`_connectorGrid_q6k9d_1`,connectorCard:`_connectorCard_q6k9d_10`,connectorCardDisabled:`_connectorCardDisabled_q6k9d_19`,connectorHead:`_connectorHead_q6k9d_23`,connectorText:`_connectorText_q6k9d_30`,connectorMark:`_connectorMark_q6k9d_34`,connectorMarkHybridai:`_connectorMarkHybridai_q6k9d_51`,connectorMarkGithub:`_connectorMarkGithub_q6k9d_56`,connectorMarkGoogle:`_connectorMarkGoogle_q6k9d_62`,connectorMarkMicrosoft365:`_connectorMarkMicrosoft365_q6k9d_67`,connectorTitleRow:`_connectorTitleRow_q6k9d_72`,connectorTitle:`_connectorTitle_q6k9d_72`,connectorDescription:`_connectorDescription_q6k9d_94`,connectorActions:`_connectorActions_q6k9d_105`,dialogForm:`_dialogForm_q6k9d_115`,microsoftDialog:`_microsoftDialog_q6k9d_120`,oauthBridge:`_oauthBridge_q6k9d_125`,oauthBridgeMark:`_oauthBridgeMark_q6k9d_132`,oauthBridgeMarkHybridClaw:`_oauthBridgeMarkHybridClaw_q6k9d_147`,oauthBridgeLine:`_oauthBridgeLine_q6k9d_153`,microsoftCopy:`_microsoftCopy_q6k9d_159`,microsoftSetup:`_microsoftSetup_q6k9d_172`,pendingLink:`_pendingLink_q6k9d_188`},hd=2e3,gd=5*6e4,_d=new Set([`github`,`microsoft365`]);function vd(e){return new Promise(t=>setTimeout(t,e))}function yd(e){return e.state===`connected`?`connected`:e.state===`needs_setup`?`setup`:`not connected`}function bd(e){return e.state===`connected`}function xd(e){return _d.has(e.id)}function Sd(e){return V(md.connectorMark,e.id===`hybridai`&&md.connectorMarkHybridai,e.id===`github`&&md.connectorMarkGithub,e.id===`google`&&md.connectorMarkGoogle,e.id===`microsoft365`&&md.connectorMarkMicrosoft365)}function Cd({connector:e}){return e.id===`hybridai`?(0,B.jsx)(Vu,{width:24,height:24}):e.id===`github`?(0,B.jsx)(qu,{width:24,height:24}):e.id===`google`?(0,B.jsx)(Ku,{width:24,height:24}):(0,B.jsx)(ed,{width:24,height:24})}function wd(e){return{account:e.account||``,clientId:``,clientSecret:``,scopes:e.scopes.join(` `)}}function Td(e){return e===`google`}function Ed(e){return e===`github`||e===`microsoft365`}function Dd(e){return e===`github`?`GitHub`:`Microsoft 365`}function Od(e){return e.id===`google`&&!!e.account&&e.clientConfigured&&e.clientSecretConfigured}function kd(e,t){return{provider:e,account:t.account,clientId:t.clientId,clientSecret:t.clientSecret,scopes:t.scopes}}function Ad(){let e=Zn(),t=Ss(),n=o(),[r,i]=(0,R.useState)(!1),[a,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(null),[u,d]=(0,R.useState)(()=>{if(typeof window>`u`)return new Set;let e=new URLSearchParams(window.location.search).get(`connected`);return Ed(e)?new Set([e]):new Set}),[f,p]=(0,R.useState)({account:``,clientId:``,clientSecret:``,scopes:``}),[m,h]=(0,R.useState)(null),_=y({queryKey:[`admin`,`connectors`,e.token],queryFn:()=>sn(e.token),retry:!1}),v=t=>n.setQueryData([`admin`,`connectors`,e.token],t),b=g({mutationFn:()=>cn(e.token,a),onSuccess:e=>{v(e),s(``),i(!1),t.success(`HybridAI connected.`)},onError:e=>{t.error(`HybridAI connection failed`,H(e))}}),x=g({mutationFn:async t=>{let n=await ln(e.token,t);if(Ed(n.provider))return window.open(n.authorizationUrl,`_self`),Dd(n.provider);h(n.authorizationUrl),window.open(n.authorizationUrl,`_blank`,`noopener`);let r=Date.now()+Math.max(hd,Math.min(gd,n.expiresAt-Date.now()));for(;Date.now()<r;){await vd(hd);let t=await sn(e.token);v(t);let r=t.connectors.find(e=>e.id===n.provider);if(r?.state===`connected`)return r.name}throw Error(`Timed out waiting for authorization. Complete the login in the opened tab and try again.`)},onSuccess:e=>{h(null),l(null),t.success(`${e} connected.`)},onError:e=>{h(null),t.error(`OAuth connection failed`,H(e))}}),S=g({mutationFn:t=>un(e.token,t),onSuccess:e=>{v(e),t.success(`Connector credentials cleared.`)},onError:e=>{t.error(`Disconnect failed`,H(e))}}),C=g({mutationFn:t=>dn(e.token,t),onSuccess:r=>{if(r.ok){t.success(`${r.name} test passed.`,r.message),n.invalidateQueries({queryKey:[`admin`,`connectors`,e.token]});return}t.error(`${r.name} test failed.`,r.message)},onError:e=>{t.error(`Connector test failed`,H(e))}}),w=_.data?.connectors||[],T=w.find(e=>e.id===c)||null,E=c===`google`&&!f.account.trim(),D=c===`google`&&!T?.clientConfigured&&!f.clientId.trim(),O=c===`google`&&!T?.clientSecretConfigured&&!f.clientSecret.trim(),k=x.isPending||!c||E||D||O;(0,R.useEffect)(()=>{let e=new URLSearchParams(window.location.search),n=e.get(`connected`),r=e.get(`connect_error`);if(!Ed(n)&&!r)return;Ed(n)?(d(e=>{let t=new Set(e);return t.add(n),t}),t.success(`${Dd(n)} connected.`)):t.error(`Connector connection failed.`);let i=new URL(window.location.href);i.searchParams.delete(`connected`),i.searchParams.delete(`connect_error`),window.history.replaceState(null,``,`${i.pathname}${i.search}`)},[t]);let A=e=>{if(!e.loginUrl){t.error(`${e.name} connection is not available.`);return}let n=new URL(e.loginUrl);n.searchParams.delete(`connect`),n.searchParams.delete(`return_to`),n.hash=e.id,window.open(n.toString(),`_self`)},j=e=>{if(Td(e.id)){if(Od(e)){x.mutate({provider:`google`});return}p(wd(e)),l(e.id)}};return _.isPending?(0,B.jsx)(`div`,{className:`page-stack`,children:(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading connectors...`})}):_.isError?(0,B.jsx)(`div`,{className:`page-stack`,children:(0,B.jsxs)(`div`,{className:`empty-state`,children:[`Failed to load connectors: `,H(_.error)]})}):(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(`div`,{className:md.connectorGrid,children:w.map(e=>{let t=xd(e),n=bd(e)||t&&u.has(e.id);return(0,B.jsxs)(U,{className:md.connectorCard,children:[(0,B.jsx)(W,{children:(0,B.jsxs)(`div`,{className:md.connectorHead,children:[(0,B.jsx)(`span`,{className:Sd(e),children:(0,B.jsx)(Cd,{connector:e})}),(0,B.jsxs)(`div`,{className:md.connectorText,children:[(0,B.jsxs)(`div`,{className:md.connectorTitleRow,children:[(0,B.jsx)(G,{className:md.connectorTitle,children:e.name}),(0,B.jsx)(Qa,{value:n,trueLabel:`connected`,falseLabel:yd(e),falseTone:e.state===`needs_setup`?`danger`:`default`})]}),(0,B.jsx)(`p`,{className:md.connectorDescription,children:e.description})]})]})}),(0,B.jsxs)(`div`,{className:md.connectorActions,children:[e.id===`hybridai`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Z,{type:`button`,size:`sm`,onClick:()=>{e.loginUrl&&window.open(e.loginUrl,`_blank`,`noopener`),i(!0)},children:e.state===`connected`?`Rotate key`:`Connect`}),e.state===`connected`?(0,B.jsx)(Z,{type:`button`,size:`sm`,variant:`ghost`,loading:S.isPending,disabled:S.isPending,onClick:()=>S.mutate(e.id),children:`Disconnect`}):null]}):t?(0,B.jsx)(Z,{type:`button`,size:`sm`,loading:x.isPending&&x.variables?.provider===e.id,disabled:x.isPending,"aria-label":`${n?`Manage`:`Connect`} ${e.name}`,onClick:()=>{if(n){A(e);return}x.mutate({provider:e.id})},children:n?`Manage`:`Connect`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Z,{type:`button`,size:`sm`,loading:x.isPending&&x.variables?.provider===e.id,disabled:x.isPending,onClick:()=>j(e),children:e.state===`connected`?`Reconnect`:`Connect`}),e.state===`connected`?(0,B.jsx)(Z,{type:`button`,size:`sm`,variant:`ghost`,loading:S.isPending,disabled:S.isPending,onClick:()=>S.mutate(e.id),children:`Disconnect`}):null]}),(0,B.jsx)(Z,{type:`button`,size:`sm`,variant:`outline`,loading:C.isPending&&C.variables===e.id,disabled:C.isPending,"aria-label":`Test ${e.name}`,onClick:()=>C.mutate(e.id),children:`Test`})]})]},e.id)})}),(0,B.jsx)(ui,{open:r,onOpenChange:i,children:(0,B.jsxs)(di,{size:`default`,children:[(0,B.jsxs)(fi,{children:[(0,B.jsx)(pi,{children:`HybridAI API Key`}),(0,B.jsx)(mi,{children:`Paste the key from HybridAI.`})]}),(0,B.jsx)(`div`,{className:md.dialogForm,children:(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`API key`}),(0,B.jsx)(Y,{type:`password`,autoComplete:`off`,value:a,onChange:e=>s(e.target.value),placeholder:`hai-...`})]})}),(0,B.jsxs)(hi,{children:[(0,B.jsx)(gi,{className:`ghost-button`,children:`Cancel`}),(0,B.jsx)(Z,{type:`button`,loading:b.isPending,disabled:!a.trim()||b.isPending,onClick:()=>b.mutate(),children:`Save key`})]})]})}),(0,B.jsx)(ui,{open:c!==null,onOpenChange:e=>{!e&&!x.isPending&&(l(null),h(null))},children:(0,B.jsxs)(di,{size:`lg`,preventCloseOnOutsideClick:x.isPending,children:[(0,B.jsxs)(fi,{children:[(0,B.jsx)(pi,{children:T?`Connect ${T.name}`:`Connect`}),(0,B.jsx)(mi,{children:x.isPending?`Waiting for authorization in the browser.`:`Leave stored app credentials blank to reuse them.`})]}),(0,B.jsxs)(`div`,{className:md.dialogForm,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Google account`}),(0,B.jsx)(Y,{value:f.account,onChange:e=>p(t=>({...t,account:e.target.value})),placeholder:`user@example.com`})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Client ID`}),(0,B.jsx)(Y,{value:f.clientId,onChange:e=>p(t=>({...t,clientId:e.target.value})),placeholder:T?.clientConfigured?`stored client id`:`client id`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Client secret`}),(0,B.jsx)(Y,{type:`password`,autoComplete:`off`,value:f.clientSecret,onChange:e=>p(t=>({...t,clientSecret:e.target.value})),placeholder:T?.clientSecretConfigured?`stored secret`:`client secret`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Scopes`}),(0,B.jsx)(ts,{rows:4,value:f.scopes,onChange:e=>p(t=>({...t,scopes:e.target.value}))})]}),m&&x.isPending?(0,B.jsx)(`a`,{className:md.pendingLink,href:m,target:`_blank`,rel:`noreferrer`,children:`Open authorization page`}):null]}),(0,B.jsxs)(hi,{children:[(0,B.jsx)(gi,{className:`ghost-button`,disabled:x.isPending,children:`Cancel`}),(0,B.jsx)(Z,{type:`button`,loading:x.isPending,disabled:k,onClick:()=>{c&&x.mutate(kd(c,f))},children:x.isPending?`Waiting...`:`Connect`})]})]})})]})}var jd={panel:`_panel_1yt98_11`,panelHeader:`_panelHeader_1yt98_18`,panelTitle:`_panelTitle_1yt98_26`,row:`_row_1yt98_33`,rowWarning:`_rowWarning_1yt98_50`,rowDown:`_rowDown_1yt98_59`,rowTop:`_rowTop_1yt98_68`,nameGroup:`_nameGroup_1yt98_75`,dot:`_dot_1yt98_82`,dotHealthy:`_dotHealthy_1yt98_89`,dotWarning:`_dotWarning_1yt98_93`,pulse:`_pulse_1yt98_1`,dotDown:`_dotDown_1yt98_98`,dotInactive:`_dotInactive_1yt98_103`,name:`_name_1yt98_75`,badge:`_badge_1yt98_118`,badgeRemote:`_badgeRemote_1yt98_130`,badgeLocal:`_badgeLocal_1yt98_136`,meta:`_meta_1yt98_142`,detail:`_detail_1yt98_149`,modelCount:`_modelCount_1yt98_156`,loginBtn:`_loginBtn_1yt98_163`,inactiveFooter:`_inactiveFooter_1yt98_189`,inactiveDot:`_inactiveDot_1yt98_199`,inactiveNames:`_inactiveNames_1yt98_207`,panelEmpty:`_panelEmpty_1yt98_213`},Md=new Set([`ollama`,`lmstudio`,`llamacpp`,`vllm`]);function Nd(e,t){return t.loginRequired?`warning`:t.reachable?`healthy`:t.kind===`local`||Md.has(e)?`inactive`:`down`}function Pd(e,t){return t.kind===`local`||Md.has(e)}var Fd={healthy:jd.dotHealthy,warning:jd.dotWarning,down:jd.dotDown,inactive:jd.dotInactive};function Id({name:e,provider:t,onLogin:n}){let r=Nd(e,t),i=Pd(e,t),a=t.modelCount??0,o=t.detail?t.detail:t.reachable?`${t.latencyMs??0}ms`:t.error||`unreachable`;return(0,B.jsx)(`div`,{className:[jd.row,r===`warning`?jd.rowWarning:``,r===`down`?jd.rowDown:``].filter(Boolean).join(` `),children:(0,B.jsxs)(`div`,{className:jd.rowTop,children:[(0,B.jsxs)(`div`,{className:jd.nameGroup,children:[(0,B.jsx)(`span`,{className:`${jd.dot} ${Fd[r]}`}),(0,B.jsx)(`span`,{className:jd.name,children:e}),(0,B.jsx)(`span`,{className:`${jd.badge} ${i?jd.badgeLocal:jd.badgeRemote}`,children:i?`local`:`remote`})]}),(0,B.jsxs)(`div`,{className:jd.meta,children:[(0,B.jsx)(`span`,{className:jd.detail,children:o}),(0,B.jsxs)(`span`,{className:jd.modelCount,children:[a,` `,a===1?`model`:`models`]}),t.loginRequired&&(0,B.jsx)(`button`,{type:`button`,className:jd.loginBtn,onClick:n,children:`Log in →`})]})]})})}function Ld({title:e,entries:t,onLogin:n}){let r=t.filter(([e,t])=>Nd(e,t)!==`inactive`),i=t.filter(([e,t])=>Nd(e,t)===`inactive`);return(0,B.jsxs)(`section`,{className:jd.panel,children:[(0,B.jsx)(`div`,{className:jd.panelHeader,children:(0,B.jsx)(`span`,{className:jd.panelTitle,children:e})}),t.length===0?(0,B.jsx)(`p`,{className:jd.panelEmpty,children:`No provider health data available.`}):(0,B.jsxs)(B.Fragment,{children:[r.map(([e,t])=>(0,B.jsx)(Id,{name:e,provider:t,onLogin:n},e)),i.length>0&&(0,B.jsxs)(`div`,{className:jd.inactiveFooter,children:[(0,B.jsx)(`span`,{className:jd.inactiveDot}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`span`,{className:jd.inactiveNames,children:i.map(([e])=>e).join(` · `)}),` `,`not running locally`]})]})]})]})}var Rd={root:`_root_akr74_1`,empty:`_empty_akr74_7`,summary:`_summary_akr74_13`,ribbon:`_ribbon_akr74_26`,metric:`_metric_akr74_35`,metricLabel:`_metricLabel_akr74_42`,metricValue:`_metricValue_akr74_48`,chart:`_chart_akr74_58`,chartCanvas:`_chartCanvas_akr74_64`,chartSvg:`_chartSvg_akr74_69`,area:`_area_akr74_76`,line:`_line_akr74_81`,pointTarget:`_pointTarget_akr74_90`,point:`_point_akr74_90`,crosshair:`_crosshair_akr74_105`,tooltip:`_tooltip_akr74_112`,tooltipLabel:`_tooltipLabel_akr74_138`,tooltipValue:`_tooltipValue_akr74_142`,axis:`_axis_akr74_148`,topModels:`_topModels_akr74_156`,topModelRow:`_topModelRow_akr74_166`,topModelName:`_topModelName_akr74_174`,topModelDetail:`_topModelDetail_akr74_181`,topModelCost:`_topModelCost_akr74_189`};function zd(e){return e===0?`$0`:new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}var Bd=600,Vd=100;function Hd(e){let{daily:t,monthly:n,topModels:r}=e.usage,i=n.callCount>0||n.totalTokens>0,a=t.callCount>0||t.totalTokens>0;if(!i&&!a)return(0,B.jsx)(`p`,{className:Rd.empty,children:`No usage has been recorded yet this month.`});let o=n,s=r.length>1;return(0,B.jsxs)(`div`,{className:Rd.root,children:[(0,B.jsxs)(`p`,{className:Rd.summary,children:[(0,B.jsx)(`strong`,{children:$a(o.totalTokens)}),` tokens this month · `,$a(t.totalTokens),` today`]}),(0,B.jsxs)(`div`,{className:Rd.ribbon,children:[(0,B.jsx)(Ud,{label:`Input`,value:$a(o.totalInputTokens??0)}),(0,B.jsx)(Ud,{label:`Output`,value:$a(o.totalOutputTokens??0)}),(0,B.jsx)(Ud,{label:`Calls`,value:$a(o.callCount)}),(0,B.jsx)(Ud,{label:`Spent`,value:zd(o.totalCostUsd)})]}),(0,B.jsx)(Wd,{trend:e.trend,formatTrendDate:e.formatTrendDate}),s?(0,B.jsx)(`ul`,{className:Rd.topModels,children:r.map(e=>(0,B.jsxs)(`li`,{className:Rd.topModelRow,children:[(0,B.jsx)(`span`,{className:Rd.topModelName,children:e.model}),(0,B.jsxs)(`span`,{className:Rd.topModelDetail,children:[to({inputTokens:e.totalInputTokens??0,outputTokens:e.totalOutputTokens??0}),` `,`· `,so(e.callCount,`call`)]}),(0,B.jsx)(`span`,{className:Rd.topModelCost,children:zd(e.totalCostUsd)})]},e.model))}):null]})}function Ud(e){return(0,B.jsxs)(`div`,{className:Rd.metric,children:[(0,B.jsx)(`span`,{className:Rd.metricLabel,children:e.label}),(0,B.jsx)(`span`,{className:Rd.metricValue,children:e.value})]})}function Wd(e){let[t,n]=(0,R.useState)(null),r=e.trend,i=(0,R.useMemo)(()=>{if(!r||r.length<2)return null;let t=Math.max(0,...r.map(e=>e.totalTokens)),n=Bd/(r.length-1),i=r.map((r,i)=>{let a=t>0?Math.sqrt(r.totalTokens/t):0;return{index:i,label:e.formatTrendDate(r.date),value:r.totalTokens,x:i*n,y:Vd-a*Vd}}),a=Gd(i);return{points:i,linePath:a,areaPath:`${a} L${Bd},${Vd} L0,${Vd} Z`,peak:i.reduce((e,t)=>t.value>(e?.value??-1)?t:e,null)}},[r,e.formatTrendDate]);if(!i)return null;let{points:a,linePath:o,areaPath:s,peak:c}=i,l=c&&c.value>0?`peak ${$a(c.value)} on ${c.label}`:null;function u(e){let t=e.currentTarget.getBoundingClientRect();if(t.width===0)return;let r=(e.clientX-t.left)/t.width,i=Math.min(Math.max(Math.floor(Math.min(Math.max(r,0),.9999)*a.length),0),a.length-1),o=a[i];o&&n({index:i,point:o})}function d(){n(null)}let f=t?t.point.x/Bd*100:0,p=t?f>80?`end`:f<18?`start`:`center`:`center`;return(0,B.jsxs)(`div`,{className:Rd.chart,children:[(0,B.jsxs)(`div`,{className:Rd.chartCanvas,children:[(0,B.jsxs)(`svg`,{viewBox:`0 0 ${Bd} ${Vd}`,preserveAspectRatio:`none`,className:Rd.chartSvg,role:`img`,"aria-label":`Tokens per day, last 30 days`,onPointerMove:u,onPointerLeave:d,children:[(0,B.jsx)(`path`,{d:s,className:Rd.area}),(0,B.jsx)(`path`,{d:o,className:Rd.line,vectorEffect:`non-scaling-stroke`}),a.map(e=>{let t=`${e.label}: ${$a(e.value)} tokens`;return(0,B.jsxs)(`g`,{className:Rd.pointTarget,tabIndex:0,"aria-label":t,children:[(0,B.jsx)(`title`,{children:t}),(0,B.jsx)(`circle`,{cx:e.x,cy:e.y,r:5,className:Rd.point})]},e.index)}),t?(0,B.jsx)(`line`,{x1:t.point.x,x2:t.point.x,y1:0,y2:Vd,className:Rd.crosshair,vectorEffect:`non-scaling-stroke`}):null]}),t?(0,B.jsxs)(`div`,{className:Rd.tooltip,"data-align":p,style:{left:`${f}%`},role:`status`,"aria-live":`polite`,children:[(0,B.jsx)(`span`,{className:Rd.tooltipLabel,children:t.point.label}),(0,B.jsxs)(`span`,{className:Rd.tooltipValue,children:[$a(t.point.value),` tokens`]})]}):null]}),(0,B.jsxs)(`div`,{className:Rd.axis,"aria-hidden":`true`,children:[(0,B.jsxs)(`span`,{children:[a.length-1,`d ago`]}),l?(0,B.jsx)(`span`,{className:Rd.axisPeak,children:l}):null,(0,B.jsx)(`span`,{children:`today`})]})]})}function Gd(e){if(e.length===0)return``;if(e.length===1)return`M${e[0].x.toFixed(2)},${e[0].y.toFixed(2)}`;let t=e=>e.toFixed(2),n=[`M${t(e[0].x)},${t(e[0].y)}`];for(let r=0;r<e.length-1;r+=1){let i=e[Math.max(r-1,0)],a=e[r],o=e[r+1],s=e[Math.min(r+2,e.length-1)],c=a.x+(o.x-i.x)/6,l=a.y+(o.y-i.y)/6,u=o.x-(s.x-a.x)/6,d=o.y-(s.y-a.y)/6;n.push(`C${t(c)},${t(l)} ${t(u)},${t(d)} ${t(o.x)},${t(o.y)}`)}return n.join(` `)}function Kd(e){let t=Ss(),n=(0,R.useRef)(e),r=(0,R.useRef)(null);(0,R.useEffect)(()=>{let i=n.current;if(n.current=e,i!==e){if(i===`open`&&e===`error`){r.current=t.add({title:`Live updates paused`,description:`Showing snapshot — retrying.`,type:`info`,duration:0,pinned:!0});return}e===`open`&&r.current&&(t.dismiss(r.current),r.current=null,t.success(`Live updates restored`))}},[e,t]),(0,R.useEffect)(()=>()=>{r.current&&=(t.dismiss(r.current),null)},[t])}function qd(e){let t=e.trim(),[n,r]=(0,R.useState)({connection:`connecting`,overview:null,status:null,lastEventAt:null});return(0,R.useEffect)(()=>{let e=new EventSource(Ae(t));return r(e=>({...e,connection:`connecting`})),e.addEventListener(`open`,()=>{r(e=>({...e,connection:`open`}))}),e.addEventListener(`overview`,e=>{let t=JSON.parse(e.data);r(e=>({...e,connection:`open`,overview:t,lastEventAt:Date.now()}))}),e.addEventListener(`status`,e=>{let t=JSON.parse(e.data);r(e=>({...e,connection:`open`,status:t,lastEventAt:Date.now()}))}),e.addEventListener(`error`,()=>{r(e=>({...e,connection:`error`}))}),()=>{e.close()}},[t]),n}var Jd={session:(e,t)=>X(e.id,t.id)||X(e.channelId,t.channelId),model:(e,t)=>X(e.effectiveModel,t.effectiveModel)||X(e.id,t.id),messages:(e,t)=>os(e.messageCount,t.messageCount)||X(e.id,t.id),tasks:(e,t)=>os(e.taskCount,t.taskCount)||X(e.id,t.id),lastActive:(e,t)=>cs(e.lastActive,t.lastActive)||X(e.id,t.id)},Yd={messages:`desc`,tasks:`desc`,lastActive:`desc`},Xd={manual:{label:`Manual URL`,managed:!1,usesConfiguredPublicUrl:!0,requiresPublicUrl:!1},ngrok:{label:`ngrok`,managed:!0,usesConfiguredPublicUrl:!1,requiresPublicUrl:!1},tailscale:{label:`Tailscale Funnel`,managed:!0,usesConfiguredPublicUrl:!1,requiresPublicUrl:!1},cloudflare:{label:`Cloudflare Tunnel`,managed:!0,usesConfiguredPublicUrl:!0,requiresPublicUrl:!0},ssh:{label:`SSH tunnel`,managed:!1,usesConfiguredPublicUrl:!0,requiresPublicUrl:!1}},Zd=Object.entries(Xd).map(([e,t])=>({value:e,label:t.label})),Qd=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,timeZone:`UTC`});function $d(e){let[t,n,r]=e.split(`-`).map(Number);return!t||!n||!r?e:Qd.format(new Date(Date.UTC(t,n-1,r)))}function ef(e){return e===`healthy`?`list-status list-status-success`:e===`reconnecting`?`list-status list-status-warning`:`list-status list-status-danger`}function tf(e){return e===`healthy`?`status-dot status-dot-success`:e===`reconnecting`?`status-dot status-dot-warning`:`status-dot status-dot-danger`}function nf(e){return Object.hasOwn(Xd,e)}function rf(e){return e&&nf(e)?e:`manual`}function af(e){let t=e.trim();if(!t)return``;try{return new URL(t).toString().replace(/\/$/,``)}catch{return t}}function of(e){return{provider:rf(e.provider),publicUrl:e.publicUrl||``}}function sf(e){return Xd[e].managed}function cf(e){return Xd[e].usesConfiguredPublicUrl}function lf(e,t){return e.provider===t.provider&&af(e.publicUrl)===af(t.publicUrl)}function uf(e){let t=Xd[e.provider];if(!t.usesConfiguredPublicUrl)return null;let n=e.publicUrl.trim();if(!n)return t.requiresPublicUrl?`Public URL is required for Cloudflare Tunnel.`:null;let r;try{r=new URL(n)}catch{return`Public URL must be a valid URL.`}return r.protocol!==`https:`&&r.protocol!==`http:`?`Public URL must use http:// or https://.`:null}function df(e){if(!cf(e.provider))return!1;try{return new URL(e.publicUrl.trim()).protocol===`http:`}catch{return!1}}function ff(e){let{tunnel:t}=e,n=t.publicUrl||`not configured`,r=e.reconnectPending||e.stopPending||!t.reconnectSupported,i=t.lastError?.trim()||null,a=e.reconnectError?.trim()||null,o=e.stopError?.trim()||null,s=e.reconnectError&&a!==i?e.reconnectError:null,c=e.stopError&&o!==i&&o!==a?e.stopError:null,l=e.savedConfigDraft?!lf(e.configDraft,e.savedConfigDraft):!1,u=cf(e.configDraft.provider),d=sf(e.configDraft.provider),f=uf(e.configDraft),p=df(e.configDraft)?`Public tunnel URL uses HTTP. HTTPS is recommended.`:null,m=!e.configLoaded||e.configPending||e.configSavePending,h=m||!l||!!f,g=rf(t.provider)===e.configDraft.provider,_=!l&&g&&t.state===`up`,v=!l&&g&&(t.state===`starting`||t.state===`reconnecting`),y=e.configStartPending||e.reconnectPending,b=y||e.stopPending||v,x=e.stopPending?`Stopping`:y||v?`Starting`:_?`Stop`:l?`Save & start`:`Start`,S=m||e.reconnectPending||e.stopPending||!!f,C=m||e.reconnectPending||e.stopPending,w=_?C:S,T=_||e.stopPending?`danger`:`default`,E=_?e.onStop:e.onSaveConfigAndStart;return(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Public tunnel`})}),(0,B.jsxs)(K,{children:[(0,B.jsxs)(`div`,{className:`tunnel-panel-grid`,children:[(0,B.jsxs)(`div`,{className:`tunnel-url-stack`,children:[(0,B.jsx)(`span`,{children:`Public URL`}),t.publicUrl?(0,B.jsx)(`a`,{href:t.publicUrl,target:`_blank`,rel:`noreferrer`,children:n}):(0,B.jsx)(`strong`,{children:n})]}),(0,B.jsx)(`div`,{className:`tunnel-action-stack`,children:(0,B.jsxs)(Z,{type:`button`,className:`tunnel-action-button`,onClick:e.onReconnect,loading:e.reconnectPending,disabled:r,children:[e.reconnectPending?(0,B.jsx)(`span`,{className:`button-spinner`,"aria-hidden":`true`}):null,e.reconnectPending?`Reconnecting`:`Reconnect`]})})]}),(0,B.jsxs)(`div`,{className:`tunnel-config-grid`,children:[(0,B.jsxs)(`label`,{className:`tunnel-control`,children:[(0,B.jsx)(`span`,{children:`Provider`}),(0,B.jsx)(vs,{value:e.configDraft.provider,disabled:e.configPending||e.configSavePending,onChange:t=>e.onConfigDraftChange({...e.configDraft,provider:rf(t.target.value)}),children:Zd.map(e=>(0,B.jsx)(Q,{value:e.value,children:e.label},e.value))})]}),u?(0,B.jsxs)(`label`,{className:`tunnel-control`,children:[(0,B.jsx)(`span`,{children:`Public URL`}),(0,B.jsx)(Y,{value:e.configDraft.publicUrl,placeholder:`https://example.ngrok-free.dev`,disabled:e.configPending||e.configSavePending,onChange:t=>e.onConfigDraftChange({...e.configDraft,publicUrl:t.target.value})})]}):null,(0,B.jsxs)(`div`,{className:`tunnel-config-actions`,children:[(0,B.jsx)(Z,{type:`button`,variant:`outline`,onClick:e.onSaveConfig,loading:e.configSavePending&&!e.configStartPending,disabled:h,children:`Save`}),d?(0,B.jsxs)(Z,{type:`button`,className:`tunnel-action-button`,variant:T,onClick:E,loading:b,disabled:w,children:[b?(0,B.jsx)(`span`,{className:`button-spinner`,"aria-hidden":`true`}):null,x]}):null]})]}),f?(0,B.jsx)(`p`,{className:`supporting-text tunnel-error`,children:f}):null,p?(0,B.jsx)(`p`,{className:`supporting-text tunnel-warning`,children:p}):null,(0,B.jsxs)(`div`,{className:`tunnel-detail-grid`,children:[(0,B.jsxs)(`div`,{className:`tunnel-detail`,children:[(0,B.jsx)(`span`,{children:`Provider`}),(0,B.jsx)(`strong`,{children:t.provider||`none`})]}),(0,B.jsxs)(`div`,{className:`tunnel-detail`,children:[(0,B.jsx)(`span`,{children:`Status`}),(0,B.jsxs)(`strong`,{className:ef(t.health),children:[(0,B.jsx)(`span`,{className:tf(t.health)}),t.health]})]}),(0,B.jsxs)(`div`,{className:`tunnel-detail`,children:[(0,B.jsx)(`span`,{children:`Last checked`}),(0,B.jsx)(`strong`,{children:ao(t.lastCheckedAt)})]}),(0,B.jsxs)(`div`,{className:`tunnel-detail`,children:[(0,B.jsx)(`span`,{children:`Next reconnect`}),(0,B.jsx)(`strong`,{children:ao(t.nextReconnectAt)})]})]}),t.lastError?(0,B.jsx)(`p`,{className:`supporting-text tunnel-error`,children:t.lastError}):null,s?(0,B.jsx)(`p`,{className:`supporting-text tunnel-error`,children:s}):null,c?(0,B.jsx)(`p`,{className:`supporting-text tunnel-error`,children:c}):null,e.configSaveError?(0,B.jsx)(`p`,{className:`supporting-text tunnel-error`,children:e.configSaveError}):null]})]})}function pf(){let e=Zn(),t=j(),n=o(),r=qd(e.token);Kd(r.connection);let i=y({queryKey:[`overview`,e.token],queryFn:()=>Ne(e.token),refetchInterval:3e4}),a=y({queryKey:[`usage-trend`,e.token,30],queryFn:()=>Re(e.token,30),staleTime:6e4}),s=y({queryKey:[`tunnel-config`,e.token],queryFn:()=>Pe(e.token),staleTime:3e4}),c=(0,R.useMemo)(()=>s.data?of(s.data.config):null,[s.data]),[l,u]=(0,R.useState)(null),d=g({mutationFn:()=>Ie(e.token),onSuccess:t=>{n.setQueryData([`overview`,e.token],e=>e&&{...e,tunnel:t})}}),f=g({mutationFn:()=>Le(e.token),onSuccess:t=>{n.setQueryData([`overview`,e.token],e=>e&&{...e,tunnel:t})}}),p=g({mutationFn:async t=>({payload:await Fe(e.token,{provider:t.draft.provider,publicUrl:cf(t.draft.provider)?af(t.draft.publicUrl):``}),tunnel:t.start&&sf(t.draft.provider)?await Ie(e.token):null}),onSuccess:({payload:t,tunnel:r})=>{if(n.setQueryData([`tunnel-config`,e.token],t),u(null),r){n.setQueryData([`overview`,e.token],e=>e&&{...e,tunnel:r});return}n.invalidateQueries({queryKey:[`overview`,e.token]})}}),m=r.overview||i.data,h=r.status||m?.status||e.gatewayStatus,_=p.isPending&&p.variables?.start===!0,v=l??c??{provider:rf(m?.tunnel.provider),publicUrl:m?.tunnel.publicUrl??``},{sortedRows:b,sortState:x,toggleSort:S}=qa(m?.recentSessions||[],{initialSort:{key:`lastActive`,direction:`desc`},sorters:Jd,defaultDirections:Yd});if(i.isLoading&&!m)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading overview...`});if(i.isError&&!m)return(0,B.jsx)(`div`,{className:`empty-state error`,children:H(i.error)});if(!m||!h)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Gateway overview unavailable.`});let C=h.scheduler?.jobs.length||0,w=Object.entries(h.providerHealth||h.localBackends||{});return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{}),(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Xa,{label:`Gateway sessions`,value:String(h.sessions),detail:`${m.recentSessions.length} recent sessions surfaced`}),(0,B.jsx)(Xa,{label:`Active sandboxes`,value:String(h.activeContainers),detail:h.sandbox?.mode||`container`}),(0,B.jsx)(Xa,{label:`Uptime`,value:oo(h.uptime),detail:`version ${h.version}`}),(0,B.jsx)(Xa,{label:`Scheduler`,value:String(C),detail:`registered jobs`})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Usage rollup`})}),(0,B.jsx)(K,{children:(0,B.jsx)(Hd,{usage:m.usage,trend:a.data?.trend??null,formatTrendDate:$d})})]}),(0,B.jsx)(Ld,{title:`Backend health`,entries:w,onLogin:()=>void t({to:`/admin/config`})})]}),(0,B.jsx)(ff,{tunnel:m.tunnel,configLoaded:!!s.data,configPending:s.isLoading,configDraft:v,savedConfigDraft:c,configSavePending:p.isPending,configStartPending:_,configSaveError:p.isError?H(p.error):null,reconnectPending:d.isPending,reconnectError:d.isError?H(d.error):null,stopPending:f.isPending,stopError:f.isError?H(f.error):null,onConfigDraftChange:u,onSaveConfig:()=>p.mutate({draft:v,start:!1}),onSaveConfigAndStart:()=>p.mutate({draft:v,start:!0}),onReconnect:()=>d.mutate(),onStop:()=>f.mutate()}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Recent sessions`})}),(0,B.jsx)(K,{children:(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Ja,{label:`Session`,sortKey:`session`,sortState:x,onToggle:S}),(0,B.jsx)(Ja,{label:`Model`,sortKey:`model`,sortState:x,onToggle:S}),(0,B.jsx)(Ja,{label:`Messages`,sortKey:`messages`,sortState:x,onToggle:S}),(0,B.jsx)(Ja,{label:`Tasks`,sortKey:`tasks`,sortState:x,onToggle:S}),(0,B.jsx)(Ja,{label:`Last active`,sortKey:`lastActive`,sortState:x,onToggle:S})]})}),(0,B.jsx)(`tbody`,{children:b.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.id}),(0,B.jsx)(`small`,{children:e.channelId})]}),(0,B.jsx)(`td`,{children:e.effectiveModel}),(0,B.jsx)(`td`,{children:e.messageCount}),(0,B.jsx)(`td`,{children:e.taskCount}),(0,B.jsx)(`td`,{children:io(e.lastActive)})]},e.id))})]})})})]})]})}var mf={root:`_root_1rfzi_1`,indicator:`_indicator_1rfzi_46`,icon:`_icon_1rfzi_54`};function hf({checked:e,onCheckedChange:t,disabled:n,className:r,onClick:i,name:a,value:o=`on`,required:s,...c}){let{required:l,...u}=Po({disabled:n,required:s,...c}),d=No(),f=u.disabled,p=e===`indeterminate`?`indeterminate`:e?`checked`:`unchecked`,m=e===`indeterminate`?`mixed`:e,h=n=>{f||(i?.(n),!n.defaultPrevented&&(d.setTouched(!0),t?.(e!==!0)))},g=e===`indeterminate`?Er:e?ar:null;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{...u,type:`button`,role:`checkbox`,"aria-checked":m,"data-slot":`checkbox`,"data-state":p,className:V(mf.root,r),onClick:h,children:(0,B.jsx)(`span`,{"aria-hidden":`true`,className:mf.indicator,children:g?(0,B.jsx)(g,{className:mf.icon}):null})}),a&&e===!0&&!f?(0,B.jsx)(`input`,{type:`hidden`,name:a,value:o}):null]})}var gf=[`ingest`,`analyse`,`build`,`merge`,`correct`],_f=[`auto`,`slack-export`,`email-mbox`,`transcript`,`chat-jsonl`,`markdown`,`text`,`interview`];function vf(e){return`${e.agentId}:${e.alias}`}function yf(e){return e?e.status.replace(/-/g,` `):`no run`}function bf(e){return e?e.status===`completed`?`status-dot status-dot-success`:e.status===`failed`?`status-dot status-dot-danger`:e.status===`awaiting-extraction`?`status-dot status-dot-warning`:`status-dot`:`status-dot`}function xf(e){if(!Number.isFinite(e)||e<0)return`0 B`;if(e<1024)return`${e} B`;let t=e/1024;if(t<1024)return`${t.toFixed(t>=10?0:1)} KiB`;let n=t/1024;return`${n.toFixed(n>=10?0:1)} MiB`}function Sf(e,t){return co(e).map(e=>({path:e,kind:t}))}function Cf(e){let t=new Set,n=[];for(let r of e?.runs||[])for(let e of r.sources){let r=`${e.kind}:${e.path}`;t.has(r)||(t.add(r),n.push(e))}return n}function wf(e){return e.replace(/\\/g,`/`).replace(/\/+$/g,``).split(`/`).filter(Boolean).at(-1)||e||`source`}function Tf({label:e=`Server path`,path:t}){return(0,B.jsxs)(`details`,{className:`distill-inline-path`,children:[(0,B.jsx)(`summary`,{children:e}),(0,B.jsx)(`code`,{className:`path-text`,children:t})]})}function Ef({title:e,artifact:t,path:n}){return(0,B.jsxs)(`details`,{className:`distill-embed`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(`span`,{children:e}),(0,B.jsx)(`small`,{children:t.available?`${xf(t.byteLength)}${t.truncated?` preview`:``}`:t.error||`Not available`})]}),n?(0,B.jsx)(`code`,{className:`path-text`,children:n}):null,t.available?(0,B.jsx)(`pre`,{children:t.content||`(empty)`}):(0,B.jsx)(`div`,{className:`empty-state`,children:t.error||`Not available.`})]})}function Df({subject:e}){return(0,B.jsxs)(`details`,{className:`distill-embed`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(`span`,{children:`Storage Paths`}),(0,B.jsx)(`small`,{children:`server metadata`})]}),(0,B.jsxs)(`div`,{className:`summary-block distill-path-summary`,children:[(0,B.jsx)(`span`,{children:`Workspace`}),(0,B.jsx)(`strong`,{className:`path-text`,children:e.paths.workspacePath}),(0,B.jsx)(`span`,{children:`Uploaded files`}),(0,B.jsx)(`strong`,{className:`path-text`,children:e.paths.uploadsPath}),(0,B.jsx)(`span`,{children:`Corpus index`}),(0,B.jsx)(`strong`,{className:`path-text`,children:e.paths.corpusDocumentsPath})]})]})}function Of(e){return{agentId:e?.agentId||``,alias:e?.alias||``,displayName:e?.profile.displayName||``,role:e?.profile.role||``,relationship:e?.profile.relationship||``,tags:e?.profile.personalityTags.join(`, `)||``,matchAliases:e?.profile.matchAliases.join(`, `)||``,realPerson:e?.profile.realPerson??!0}}function kf(e){let t=e.flatMap(e=>e.runs);return{runs:t,awaitingExtraction:t.filter(e=>e.status===`awaiting-extraction`).length,openReviews:e.reduce((e,t)=>e+t.openReviews,0),consentReady:e.filter(e=>e.consent.valid).length}}function Af({run:e}){return e?(0,B.jsxs)(`div`,{className:`list-stack distill-run-panel`,children:[(0,B.jsxs)(`div`,{className:`key-value-grid distill-run-metrics`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Run`}),(0,B.jsx)(`strong`,{children:e.runId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Status`}),(0,B.jsx)(`strong`,{children:yf(e)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Updated`}),(0,B.jsx)(`strong`,{children:ao(e.updatedAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Documents`}),(0,B.jsx)(`strong`,{children:e.stats.documentsTotal})]})]}),(0,B.jsx)(`div`,{className:`table-shell distill-stage-table`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Stage`}),(0,B.jsx)(`th`,{children:`Status`}),(0,B.jsx)(`th`,{children:`Detail`})]})}),(0,B.jsx)(`tbody`,{children:gf.map(t=>{let n=e.stages[t];return(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:t}),(0,B.jsx)(`td`,{children:n.status}),(0,B.jsx)(`td`,{children:n.detail||``})]},t)})})]})}),(0,B.jsxs)(`div`,{className:`distill-embed-list`,children:[(0,B.jsx)(Ef,{title:`Report`,artifact:e.artifacts.report,path:e.reportPath}),e.status===`awaiting-extraction`||e.artifacts.packetMarkdown.available?(0,B.jsx)(Ef,{title:`Analysis Packet`,artifact:e.artifacts.packetMarkdown,path:e.packetMarkdownPath}):null,e.status===`awaiting-extraction`||e.artifacts.extraction.available?(0,B.jsx)(Ef,{title:`Extraction`,artifact:e.artifacts.extraction,path:e.extractionPath}):null]})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No distillation run yet.`})}function jf({sources:e,emptyLabel:t}){return e.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:t}):(0,B.jsx)(`ul`,{className:`distill-data-list`,children:e.map(e=>(0,B.jsx)(`li`,{className:`distill-data-row`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:wf(e.path)}),(0,B.jsx)(`small`,{children:e.kind}),(0,B.jsx)(Tf,{path:e.path})]})},`${e.kind}:${e.path}`))})}function Mf({uploads:e}){return e.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No queued uploads.`}):(0,B.jsx)(`ul`,{className:`distill-data-list`,children:e.map(e=>(0,B.jsx)(`li`,{className:`distill-data-row`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`strong`,{children:[e.filename,` · `,e.source.kind,` ·`,` `,xf(e.sizeBytes)]}),(0,B.jsx)(Tf,{path:e.path}),(0,B.jsx)(Ef,{title:`Preview`,artifact:e.preview})]})},`${e.source.kind}:${e.path}`))})}function Nf({subject:e,documents:t,deletingDocumentId:n,downloadingDocumentId:r,onDelete:i,onDownload:a}){return t.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No corpus documents ingested yet.`}):(0,B.jsx)(`ul`,{className:`distill-data-list`,children:t.map(t=>(0,B.jsxs)(`li`,{className:`distill-data-row`,children:[(0,B.jsxs)(`div`,{className:`distill-data-row-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:t.id}),(0,B.jsxs)(`small`,{children:[t.source,` · `,t.wordCount,` words ·`,` `,t.holdout?`holdout`:`analysis`,` · `,t.author]}),(0,B.jsx)(Tf,{label:`Original source`,path:t.origin})]}),(0,B.jsxs)(`div`,{className:`distill-row-actions`,children:[(0,B.jsx)(Z,{variant:`outline`,size:`sm`,loading:r===t.id,"aria-label":`Download ${t.id}`,onClick:()=>a(e,t),children:`Download`}),(0,B.jsx)(Z,{variant:`danger`,size:`sm`,loading:n===t.id,"aria-label":`Delete ${t.id}`,onClick:()=>i(e,t),children:`Delete`})]})]}),(0,B.jsx)(`div`,{children:(0,B.jsx)(Ef,{title:`Content Preview`,artifact:t.contentPreview})})]},t.id))})}function Pf({subject:e,queuedUploads:t,deletingDocumentId:n,downloadingDocumentId:r,onDeleteCorpusDocument:i,onDownloadCorpusDocument:a}){if(!e)return(0,B.jsx)(`div`,{className:`empty-state`,children:`No subject selected.`});let o=Cf(e);return(0,B.jsxs)(`div`,{className:`list-stack`,children:[(0,B.jsx)(Df,{subject:e}),t.length>0?(0,B.jsxs)(`section`,{className:`distill-data-section`,children:[(0,B.jsx)(`h5`,{children:`Queued Uploads`}),(0,B.jsx)(Mf,{uploads:t})]}):null,(0,B.jsxs)(`section`,{className:`distill-data-section`,children:[(0,B.jsx)(`h5`,{children:`Run Sources`}),(0,B.jsx)(`p`,{className:`distill-section-note`,children:`Server paths are provenance only. Use corpus previews and downloads below for cloud-accessible content.`}),(0,B.jsx)(jf,{sources:o,emptyLabel:`No sources attached to a run yet.`})]}),(0,B.jsxs)(`section`,{className:`distill-data-section`,children:[(0,B.jsx)(`h5`,{children:`Corpus Documents`}),(0,B.jsx)(Nf,{subject:e,documents:e.corpus,deletingDocumentId:n,downloadingDocumentId:r,onDelete:i,onDownload:a})]})]})}function Ff(){let e=Zn(),t=Ss(),n=o(),[r,i]=(0,R.useState)(!1),[a,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(Of(null)),[u,d]=(0,R.useState)(`auto`),[f,p]=(0,R.useState)([]),[m,h]=(0,R.useState)([]),[_,v]=(0,R.useState)(null),[b,x]=(0,R.useState)(``),[S,C]=(0,R.useState)(`0.1`),[w,T]=(0,R.useState)({grantedBy:``,method:`written`,statement:``}),E=y({queryKey:[`admin`,`distill`,e.token],queryFn:()=>He(e.token)}),D=E.data?.subjects||[];(0,R.useEffect)(()=>{!r&&!a&&D.length>0&&s(vf(D[0]))},[r,a,D]);let O=(0,R.useMemo)(()=>r?null:D.find(e=>vf(e)===a)||null,[r,a,D]);(0,R.useEffect)(()=>{l(Of(O)),O&&T(e=>({...e,grantedBy:e.grantedBy||O.profile.displayName}))},[O]);let k=E.data?.sourceKinds||_f,A=kf(D),j=()=>n.invalidateQueries({queryKey:[`admin`,`distill`]}),M=()=>{i(!0),s(``),l(Of(null)),T({grantedBy:``,method:`written`,statement:``}),p([]),h([]),x(``)},N=g({mutationFn:()=>Ue(e.token,{agentId:c.agentId||void 0,alias:c.alias,displayName:c.displayName||void 0,role:c.role||void 0,relationship:c.relationship||void 0,realPerson:c.realPerson,personalityTags:co(c.tags),matchAliases:co(c.matchAliases)}),onSuccess:async e=>{i(!1),s(vf(e.subject)),t.success(`Subject saved`),await j()},onError:e=>t.error(`Subject save failed`,H(e))}),P=g({mutationFn:()=>We(e.token,{agentId:c.agentId||void 0,alias:c.alias,subjectName:c.displayName||void 0,grantedBy:w.grantedBy,method:w.method,statement:w.statement}),onSuccess:async e=>{i(!1),s(vf(e.subject)),t.success(`Consent recorded`),await j()},onError:e=>t.error(`Consent record failed`,H(e))}),F=g({mutationFn:()=>Ge(e.token,{agentId:c.agentId||void 0,alias:c.alias}),onSuccess:async e=>{i(!1),s(vf(e.subject)),t.success(`Agent registered`),await j()},onError:e=>t.error(`Agent registration failed`,H(e))}),I=g({mutationFn:async()=>{let t=[];for(let n of f)t.push(await qe(e.token,n,{alias:c.alias,agentId:c.agentId||void 0,kind:u}));return t},onSuccess:e=>{h(t=>[...t,...e]),p([]),t.success(`Source upload complete`)},onError:e=>t.error(`Upload failed`,H(e))}),ee=g({mutationFn:t=>Ke(e.token,{agentId:c.agentId||void 0,alias:c.alias,displayName:c.displayName||void 0,role:c.role||void 0,relationship:c.relationship||void 0,realPerson:c.realPerson,personalityTags:co(c.tags),matchAliases:co(c.matchAliases),sources:t?[]:[...m.map(e=>e.source),...Sf(b,u)],resumeRunId:t,holdoutRatio:Number(S),kind:u}),onSuccess:async e=>{i(!1),s(vf(e.subject)),h([]),x(``),t.success(`Run ${yf(e.run)}`),await j()},onError:e=>t.error(`Distillation failed`,H(e))}),L=g({mutationFn:({subject:t,document:n})=>Xe(e.token,{agentId:t.agentId,alias:t.alias,documentId:n.id}),onSuccess:async e=>{i(!1),s(vf(e.subject)),t.success(`Corpus document deleted`),await j()},onError:e=>t.error(`Delete failed`,H(e))}),te=async(n,r)=>{if(!_){v(r.id);try{let t=await Ye(e.token,{agentId:n.agentId,alias:n.alias,documentId:r.id}),i=URL.createObjectURL(t),a=window.document.createElement(`a`);a.href=i,a.download=`${r.id}.txt`,a.rel=`noopener noreferrer`,window.document.body.appendChild(a),a.click(),a.remove(),window.setTimeout(()=>URL.revokeObjectURL(i),0)}catch(e){t.error(`Download failed`,H(e))}finally{v(null)}}},ne=(e,t)=>{window.confirm(`Delete ${t.id} from the distillation corpus? The original source file is not deleted.`)&&L.mutate({subject:e,document:t})};if(E.isLoading)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading distillation workspace...`});if(E.isError)return(0,B.jsx)(`div`,{className:`empty-state error`,children:H(E.error)});let re=c.alias.trim()&&(m.length>0||co(b).length>0),ie=O?.latestRun||null;return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{description:`Human distillation intake, consent, source upload, and run control.`,actions:(0,B.jsx)(Z,{variant:`outline`,onClick:()=>void E.refetch(),loading:E.isFetching,children:`Refresh`})}),(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Xa,{label:`Subjects`,value:String(D.length)}),(0,B.jsx)(Xa,{label:`Runs`,value:String(A.runs.length)}),(0,B.jsx)(Xa,{label:`Awaiting Extraction`,value:String(A.awaitingExtraction)}),(0,B.jsx)(Xa,{label:`Open Reviews`,value:String(A.openReviews)})]}),(0,B.jsxs)(`div`,{className:`two-column-grid distill-layout`,children:[(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:r?`New Subject`:`Subject`}),(0,B.jsx)(vo,{children:r?`Create a persona target and authorship aliases.`:`Persona target and authorship aliases.`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`stack-form`,children:[D.length>0?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Existing subject`}),(0,B.jsx)(qo,{children:(0,B.jsxs)(vs,{value:a,onChange:e=>{i(!1),s(e.target.value)},children:[r?(0,B.jsx)(Q,{value:``,disabled:!0,children:`New subject draft`}):null,D.map(e=>(0,B.jsxs)(Q,{value:vf(e),children:[e.profile.displayName,` (`,e.agentId,`/`,e.alias,`)`]},vf(e)))]})})]}):null,(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Alias`}),(0,B.jsx)(qo,{children:(0,B.jsx)(Y,{value:c.alias,onChange:e=>l(t=>({...t,alias:e.target.value}))})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Agent`}),(0,B.jsx)(qo,{children:(0,B.jsx)(Y,{placeholder:`defaults to alias`,value:c.agentId,onChange:e=>l(t=>({...t,agentId:e.target.value}))})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Name`}),(0,B.jsx)(qo,{children:(0,B.jsx)(Y,{value:c.displayName,onChange:e=>l(t=>({...t,displayName:e.target.value}))})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Role`}),(0,B.jsx)(qo,{children:(0,B.jsx)(Y,{value:c.role,onChange:e=>l(t=>({...t,role:e.target.value}))})})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Match aliases`}),(0,B.jsx)(qo,{children:(0,B.jsx)(Y,{value:c.matchAliases,onChange:e=>l(t=>({...t,matchAliases:e.target.value}))})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Tags`}),(0,B.jsx)(qo,{children:(0,B.jsx)(Y,{value:c.tags,onChange:e=>l(t=>({...t,tags:e.target.value}))})})]}),(0,B.jsx)(q,{children:(0,B.jsx)(qo,{children:(0,B.jsxs)(`label`,{className:`button-row`,children:[(0,B.jsx)(hf,{checked:c.realPerson,onCheckedChange:e=>l(t=>({...t,realPerson:e}))}),(0,B.jsx)(`span`,{children:`Real person`})]})})}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{onClick:()=>N.mutate(),loading:N.isPending,disabled:!c.alias.trim(),children:r?`Create Subject`:`Save Subject`}),O&&!O.registeredAgent?(0,B.jsx)(Z,{variant:`outline`,onClick:()=>F.mutate(),loading:F.isPending,disabled:!c.alias.trim(),children:`Register Agent`}):null,O?.registeredAgent?(0,B.jsx)(Qa,{value:!0,trueLabel:`Agent registered`}):null,O?(0,B.jsx)(Qa,{value:O.consent.valid,trueLabel:`Consent valid`,falseLabel:`Consent needed`,falseTone:`danger`}):null]})]})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Consent`}),(0,B.jsx)(vo,{children:`Recorded artefact for real-person distillation.`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`stack-form`,children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Granted by`}),(0,B.jsx)(qo,{children:(0,B.jsx)(Y,{value:w.grantedBy,onChange:e=>T(t=>({...t,grantedBy:e.target.value}))})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Method`}),(0,B.jsx)(qo,{children:(0,B.jsx)(Y,{value:w.method,onChange:e=>T(t=>({...t,method:e.target.value}))})})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Statement`}),(0,B.jsx)(qo,{children:(0,B.jsx)(ts,{value:w.statement,onChange:e=>T(t=>({...t,statement:e.target.value}))})})]}),(0,B.jsx)(Z,{onClick:()=>P.mutate(),loading:P.isPending,disabled:!c.alias.trim()||!w.grantedBy.trim()||!w.method.trim()||!w.statement.trim(),children:`Record Consent`})]})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Sources`}),(0,B.jsx)(vo,{children:`Uploaded files and host paths for the next run.`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`stack-form`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Kind`}),(0,B.jsx)(qo,{children:(0,B.jsx)(vs,{value:u,onChange:e=>d(e.target.value),children:k.map(e=>(0,B.jsx)(Q,{value:e,children:e},e))})})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Files`}),(0,B.jsx)(qo,{children:(0,B.jsx)(Y,{type:`file`,multiple:!0,onChange:e=>p(Array.from(e.target.files||[]))})})]}),(0,B.jsx)(Z,{variant:`outline`,onClick:()=>I.mutate(),loading:I.isPending,disabled:!c.alias.trim()||f.length===0,children:`Upload Files`}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Host paths`}),(0,B.jsx)(qo,{children:(0,B.jsx)(ts,{value:b,onChange:e=>x(e.target.value)})})]}),m.length>0?(0,B.jsx)(Mf,{uploads:m}):null]})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Run`}),(0,B.jsx)(vo,{children:`Pipeline execution and resume.`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`stack-form`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Holdout ratio`}),(0,B.jsx)(Yo,{children:`Reserves part of the corpus for later fidelity checks. 10% means one in ten documents is kept out of the distillation packet.`}),(0,B.jsx)(qo,{children:(0,B.jsx)(Y,{type:`number`,min:`0`,max:`0.5`,step:`0.05`,value:S,onChange:e=>C(e.target.value)})})]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{onClick:()=>ee.mutate(void 0),loading:ee.isPending,disabled:!re,children:`Start Distill`}),(0,B.jsx)(Z,{variant:`outline`,onClick:()=>ie?ee.mutate(ie.runId):void 0,loading:ee.isPending,disabled:!ie,children:`Resume Latest`})]})]})})]})]}),(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Subjects`}),(0,B.jsxs)(vo,{children:[A.consentReady,` with valid consent.`]}),(0,B.jsx)(yo,{children:(0,B.jsx)(Z,{variant:`outline`,size:`sm`,onClick:M,children:`New`})})]}),(0,B.jsx)(K,{children:D.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No distillation subjects.`}):(0,B.jsx)(`div`,{className:`list-stack`,children:D.map(e=>(0,B.jsxs)(`button`,{className:`list-row`,type:`button`,onClick:()=>{i(!1),s(vf(e))},children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.profile.displayName}),(0,B.jsxs)(`small`,{children:[e.agentId,`/`,e.alias,` ·`,` `,e.corpusDocuments,` docs · `,e.runs.length,` `,`runs ·`,` `,e.registeredAgent?`registered`:`unregistered`]})]}),(0,B.jsxs)(`span`,{className:`status-pill`,children:[(0,B.jsx)(`span`,{className:bf(e.latestRun)}),yf(e.latestRun)]})]},vf(e)))})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Latest Run`}),(0,B.jsx)(vo,{children:O?.profile.displayName||`No subject selected`})]}),(0,B.jsx)(K,{children:(0,B.jsx)(Af,{run:ie})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Source Data`}),(0,B.jsx)(vo,{children:`Uploaded files, source paths, and ingested corpus records.`})]}),(0,B.jsx)(K,{children:(0,B.jsx)(Pf,{subject:O,queuedUploads:m,deletingDocumentId:L.isPending&&L.variables?.document.id||null,downloadingDocumentId:_,onDeleteCorpusDocument:ne,onDownloadCorpusDocument:(e,t)=>{te(e,t)}})})]})]})]})]})}var If=40,Lf=72,Rf=1e4,zf=new Intl.NumberFormat;function Bf(e){let t=String(e.specialUse||``).toLowerCase(),n=e.name.toLowerCase();return t===`\\drafts`||n.includes(`draft`)}function Vf(e){return e.unseen>0?String(e.unseen):Bf(e)&&e.total>0?String(e.total):null}function Hf(e){let t=String(e.specialUse||``).toLowerCase(),n=e.name.toLowerCase();return t===`\\inbox`||n===`inbox`?(0,B.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M4.25 5.5h11.5v9.25H12l-2 2-2-2H4.25V5.5Z`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinejoin:`round`})}):n.includes(`later`)||n.includes(`snooze`)||n.includes(`zur`)?(0,B.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:[(0,B.jsx)(`circle`,{cx:`10`,cy:`10`,r:`6.25`,stroke:`currentColor`,strokeWidth:`1.8`}),(0,B.jsx)(`path`,{d:`M10 6.75V10l2.25 1.75`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})]}):t===`\\flagged`||n.includes(`important`)||n.includes(`priority`)||n.includes(`star`)?(0,B.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`m6 5.25 6.5 4.75L6 14.75h8.25`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})}):t===`\\sent`||n.includes(`sent`)?(0,B.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M4.5 10 15.75 4.75l-2.75 10.5-3.5-3-2.75 2V10Z`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})}):Bf(e)?(0,B.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:[(0,B.jsx)(`path`,{d:`M6 3.75h5.5l2.5 2.5v10H6v-12.5Z`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinejoin:`round`}),(0,B.jsx)(`path`,{d:`M11.5 3.75v2.5H14`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinejoin:`round`})]}):t===`\\junk`||n.includes(`spam`)||n.includes(`junk`)?(0,B.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:[(0,B.jsx)(`path`,{d:`M8 3.75h4l4.25 4.25v4L12 16.25H8L3.75 12V8L8 3.75Z`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinejoin:`round`}),(0,B.jsx)(`path`,{d:`M10 7.25v3.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`}),(0,B.jsx)(`circle`,{cx:`10`,cy:`13.2`,r:`0.95`,fill:`currentColor`})]}):t===`\\trash`||n.includes(`trash`)||n.includes(`bin`)?(0,B.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M6.5 6.25h7l-.65 9H7.15l-.65-9Zm1.75 0V4.75h3.5v1.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})}):t===`\\archive`||n.includes(`archive`)?(0,B.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:[(0,B.jsx)(`path`,{d:`M4.25 5h11.5v3H4.25V5Zm.5 3h10.5v7.25H4.75V8Z`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinejoin:`round`}),(0,B.jsx)(`path`,{d:`M8 10.5h4`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`})]}):(0,B.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M3.75 6.5h4.5l1.5 1.75h6.5v6.75H3.75V6.5Z`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinejoin:`round`})})}function Uf(e){return`${e.folder}:${e.uid}`}function Wf(e){return e<0}function Gf(e){return e.fromName?.trim()||e.fromAddress?.trim()||`Unknown`}function Kf(e){let t=String(e.preview||``).replace(/\s+/g,` `).trim();return t?t.length<=Lf?t:`${t.slice(0,Lf-1).trimEnd()}…`:`No preview available.`}function qf(e){if(!e)return`Unknown`;let t=new Date(e);if(Number.isNaN(t.getTime()))return`Unknown`;let n=new Date;if(t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate())return t.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`});let r=t.getFullYear()===n.getFullYear();return t.toLocaleDateString([],{day:`numeric`,month:`short`,...r?{}:{year:`numeric`}})}function Jf(e){let t=e.metadata;if(!t)return[];let n=[];return t.agentId&&n.push(`Agent: ${t.agentId}`),t.model&&n.push(`Model: ${t.model}`),t.provider&&n.push(`Provider: ${t.provider}`),t.totalTokens!==null&&n.push(`Tokens: ${zf.format(t.totalTokens)}${t.tokenSource===`estimated`?` estimated`:``}`),n}function Yf(e){let t=Jf(e);return t.length===0?null:(0,B.jsx)(`div`,{className:`mailbox-message-metadata`,children:t.map(t=>(0,B.jsx)(`small`,{children:t},`${e.uid}:${t}`))})}function Xf(){return(0,B.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M6.5 6.25h7l-.65 9H7.15l-.65-9Zm1.75 0V4.75h3.5v1.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Zf(e,t){let n=t.trim().toLowerCase();return n?[e.fromName||``,e.fromAddress||``,e.subject,e.preview||``].join(` `).toLowerCase().includes(n):!0}function Qf(){let e=Zn(),t=j(),n=Ba(),r=o(),i=Ss(),[a,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(null),[u,d]=(0,R.useState)(0),[f,p]=(0,R.useState)(null),[m,h]=(0,R.useState)(null),_=(0,R.useDeferredValue)(a),v=y({queryKey:[`admin-email-mailbox`,e.token],queryFn:()=>Dt(e.token),enabled:n.emailEnabled,refetchInterval:Rf}),b=v.data?.enabled??n.emailEnabled,x=v.data?.folders||[];(0,R.useEffect)(()=>{let e=v.data?.defaultFolder||v.data?.folders[0]?.path||null;if(!e){c!==null&&(l(null),d(0));return}x.some(e=>e.path===c)||(l(e),d(0))},[x,v.data?.defaultFolder,v.data?.folders[0]?.path,c]);let S=y({queryKey:[`admin-email-folder`,e.token,c,u,If],queryFn:()=>Ot(e.token,{folder:c||``,limit:If,offset:u}),enabled:b&&!!c,refetchInterval:Rf});(0,R.useEffect)(()=>{let e=S.data;!e||S.isLoading||u>0&&e.messages.length===0&&d(Math.max(0,u-If))},[S.data,S.isLoading,u]);let C=(S.data?.messages||[]).filter(e=>Zf(e,_)),w=f&&C.find(e=>Uf(e)===f)||null;(0,R.useEffect)(()=>{f!==null&&(C.some(e=>Uf(e)===f)||p(null))},[C,f]);let T=y({queryKey:[`admin-email-message`,e.token,w?.folder,w?.uid],queryFn:()=>kt(e.token,{folder:w?.folder||``,uid:w?.uid||0}),enabled:b&&!!w,refetchInterval:Rf}),E=g({mutationFn:t=>At(e.token,t),onMutate:e=>{h(Uf(e))},onSuccess:async(t,n)=>{f===Uf(n)&&p(null),await Promise.all([r.invalidateQueries({queryKey:[`admin-email-mailbox`,e.token]}),r.invalidateQueries({queryKey:[`admin-email-folder`,e.token,n.folder]}),r.invalidateQueries({queryKey:[`admin-email-message`,e.token,n.folder,n.uid]})])},onError:e=>{i.error(`Delete failed`,H(e))},onSettled:()=>{h(null)}});function D(e){E.reset(),E.mutate(e)}if(v.isLoading&&!v.data)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Connecting to IMAP mailbox...`});if(v.isError&&!v.data)return(0,B.jsx)(`div`,{className:`empty-state error`,children:H(v.error)});if(!b)return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{description:`Enable the email channel to surface a mailbox view here.`,actions:(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,onClick:()=>{t({to:`/admin/channels`}).catch(Fs)},children:`Open channel settings`})}),(0,B.jsx)(`div`,{className:`empty-state`,children:"Email is currently disabled. Turn on the email channel first, then return to `/admin/email`."})]});let O=x.find(e=>e.path===c)||x[0]||null,k=S.data?.messages.length||0,A=k>0?(S.data?.offset||0)+1:0,M=k>0?(S.data?.offset||0)+k:0,N=T.data?.message||null,P=T.data?.thread||[],F=w!==null;return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{actions:(0,B.jsx)(`input`,{className:`compact-search`,value:a,onChange:e=>s(e.target.value),placeholder:`Search sender, subject, preview`})}),(0,B.jsxs)(`div`,{className:`mailbox-shell`,children:[(0,B.jsx)(`aside`,{className:`mailbox-sidebar`,children:(0,B.jsx)(`div`,{className:`mailbox-sidebar-section`,children:(0,B.jsx)(`div`,{className:`mailbox-folder-list`,children:x.map(e=>{let t=Vf(e);return(0,B.jsx)(`button`,{className:[`mailbox-folder-button`,c===e.path?`active`:``,t?`is-emphasized`:``].filter(Boolean).join(` `),type:`button`,onClick:()=>{l(e.path),d(0),p(null)},children:(0,B.jsxs)(`span`,{className:`mailbox-folder-row`,children:[(0,B.jsxs)(`span`,{className:`mailbox-folder-title`,children:[(0,B.jsx)(`span`,{className:`mailbox-folder-symbol`,"aria-hidden":`true`,children:Hf(e)}),(0,B.jsx)(`span`,{className:`mailbox-folder-label`,children:e.name})]}),t?(0,B.jsx)(`strong`,{children:t}):null]})},e.path)})})})}),(0,B.jsx)(`section`,{className:`mailbox-main`,children:F?(0,B.jsxs)(`section`,{className:`mailbox-detail`,children:[(0,B.jsxs)(`div`,{className:`mailbox-detail-toolbar`,children:[(0,B.jsxs)(`div`,{className:`mailbox-detail-toolbar-main`,children:[(0,B.jsx)(`button`,{type:`button`,className:`mailbox-back-button`,"aria-label":`Back to message list`,onClick:()=>p(null),children:(0,B.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M11.75 4.75 6.5 10l5.25 5.25`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),(0,B.jsxs)(`div`,{className:`mailbox-detail-toolbar-copy`,children:[(0,B.jsx)(`strong`,{children:O?.name||`Mailbox`}),(0,B.jsx)(`small`,{children:w.receivedAt?io(w.receivedAt):`Selected message`})]})]}),(0,B.jsxs)(`button`,{type:`button`,className:`ghost-button mailbox-detail-delete`,disabled:m===Uf(w)||Wf(w.uid),onClick:()=>D({folder:w.folder,uid:w.uid}),children:[(0,B.jsx)(`span`,{className:`mailbox-detail-delete-icon`,children:Xf()}),(0,B.jsx)(`span`,{children:`Delete`})]})]}),T.isLoading&&!T.data?(0,B.jsx)(`div`,{className:`empty-state mailbox-detail-empty`,children:`Loading message...`}):T.isError?(0,B.jsx)(`div`,{className:`empty-state error mailbox-detail-empty`,children:H(T.error)}):N?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`mailbox-detail-header`,children:(0,B.jsxs)(`div`,{className:`mailbox-detail-copy`,children:[(0,B.jsxs)(`div`,{className:`mailbox-detail-heading`,children:[(0,B.jsx)(`h3`,{children:N.subject}),N.seen?null:(0,B.jsx)(`span`,{className:`mailbox-role-pill needs-reply`,children:`Unread`}),N.answered?(0,B.jsx)(`span`,{className:`mailbox-role-pill replied`,children:`Answered`}):null]}),(0,B.jsxs)(`p`,{className:`supporting-text`,children:[Gf(w),N.fromAddress?` · ${N.fromAddress}`:``,N.receivedAt?` · ${ao(N.receivedAt)}`:``]}),(0,B.jsxs)(`p`,{className:`supporting-text`,children:[`To:`,` `,N.to.length>0?N.to.map(e=>e.name?.trim()||e.address?.trim()||`Unknown`).join(`, `):`No recipients`]}),N.cc.length>0?(0,B.jsxs)(`p`,{className:`supporting-text`,children:[`Cc:`,` `,N.cc.map(e=>e.name?.trim()||e.address?.trim()||`Unknown`).join(`, `)]}):null]})}),(0,B.jsx)(`div`,{className:`mailbox-message-list`,children:P.map(e=>(0,B.jsxs)(`article`,{className:e.uid===N.uid?`mailbox-message-card user is-selected`:`mailbox-message-card user`,children:[(0,B.jsx)(`div`,{className:`mailbox-message-header`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.fromName||e.fromAddress||`Unknown`}),(0,B.jsxs)(`small`,{children:[e.fromAddress?e.fromAddress:`Unknown sender`,e.receivedAt?` · ${ao(e.receivedAt)}`:``]}),(0,B.jsxs)(`small`,{children:[`To:`,` `,e.to.length>0?e.to.map(e=>e.name?.trim()||e.address?.trim()||`Unknown`).join(`, `):`No recipients`]}),e.cc.length>0?(0,B.jsxs)(`small`,{children:[`Cc:`,` `,e.cc.map(e=>e.name?.trim()||e.address?.trim()||`Unknown`).join(`, `)]}):null]})}),Yf(e),e.attachments.length>0?(0,B.jsx)(`div`,{className:`mailbox-tag-list`,children:e.attachments.map(t=>(0,B.jsx)(`span`,{className:`meta-chip`,children:t.filename||`attachment`},`${e.uid}:${t.filename||`attachment`}:${t.size||0}`))}):null,(0,B.jsx)(`div`,{className:`mailbox-message-body`,children:e.text||`(empty message)`})]},`${e.folder}:${e.uid}`))})]}):(0,B.jsx)(`div`,{className:`empty-state mailbox-detail-empty`,children:`This message is no longer available in the selected folder.`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`mailbox-column-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:O?.name||`Mailbox`}),(0,B.jsx)(`small`,{children:S.isLoading&&!S.data?`Loading messages...`:`${C.length} shown on this page`})]}),(0,B.jsxs)(`div`,{className:`mailbox-column-actions`,children:[O?(0,B.jsx)(`span`,{className:`meta-chip`,children:O.unseen>0?`${O.unseen} unread`:`${O.total} total`}):null,(0,B.jsxs)(`div`,{className:`mailbox-pagination`,children:[(0,B.jsx)(`small`,{children:k>0?`${A}-${M}`:`0`}),(0,B.jsx)(`button`,{type:`button`,className:`ghost-button mailbox-page-button`,disabled:S.isFetching||S.data?.previousOffset===null,onClick:()=>d(S.data?.previousOffset||0),children:`Previous`}),(0,B.jsx)(`button`,{type:`button`,className:`ghost-button mailbox-page-button`,disabled:S.isFetching||S.data?.nextOffset===null,onClick:()=>d(S.data?.nextOffset||0),children:`Next`})]})]})]}),(0,B.jsx)(`div`,{className:`mailbox-thread-list`,children:S.isLoading&&!S.data?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading live IMAP messages...`}):S.isError?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(S.error)}):C.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No IMAP messages match this folder and search.`}):C.map(e=>(0,B.jsxs)(`div`,{className:[`mailbox-thread-row`,e.seen?``:`is-unread`].filter(Boolean).join(` `),children:[(0,B.jsxs)(`button`,{className:`mailbox-thread-button`,type:`button`,onClick:()=>p(Uf(e)),children:[(0,B.jsxs)(`div`,{className:`mailbox-thread-summary`,children:[(0,B.jsx)(`strong`,{className:`mailbox-thread-sender`,children:Gf(e)}),(0,B.jsx)(`span`,{className:`mailbox-thread-separator`,children:`-`}),(0,B.jsx)(`strong`,{className:`mailbox-thread-subject`,children:e.subject}),(0,B.jsx)(`span`,{className:`mailbox-thread-separator`,children:`-`}),(0,B.jsx)(`span`,{className:`mailbox-thread-preview`,children:Kf(e)})]}),(0,B.jsx)(`span`,{className:`mailbox-thread-time`,children:qf(e.receivedAt)})]}),(0,B.jsx)(`button`,{type:`button`,className:`mailbox-icon-button mailbox-thread-delete`,"aria-label":`Delete ${e.subject}`,disabled:m===Uf(e)||Wf(e.uid),onClick:()=>D({folder:e.folder,uid:e.uid}),children:Xf()})]},Uf(e)))})]})})]})]})}function $f(e){return e.length>18?`${e.slice(0,12)}...${e.slice(-6)}`:e}function ep(e){return e===`online`?(0,B.jsx)(Qa,{value:!0,trueLabel:`online`}):e===`revoked`?(0,B.jsx)(Qa,{value:!1,falseLabel:`revoked`,falseTone:`danger`}):(0,B.jsx)(Qa,{value:!1,falseLabel:e})}function tp(e){return typeof e==`number`&&Number.isFinite(e)?`${Math.round(e)}ms`:`unknown`}function np(){let e=Zn(),t=o(),[n,r]=(0,R.useState)(``),[i,a]=(0,R.useState)(``),[s,c]=(0,R.useState)(``),[l,u]=(0,R.useState)(``),[d,f]=(0,R.useState)(``),[p,m]=(0,R.useState)(``),h=y({queryKey:[`fleet-topology`,e.token],queryFn:()=>Ve(e.token)}),_=g({mutationFn:()=>{let t=d.trim()?JSON.parse(d):void 0;return Ze(e.token,{peerId:n,agentCardUrl:i||void 0,deliveryUrl:s||void 0,publicKeyFingerprint:l||void 0,publicKeyJwk:t,reason:p||void 0})},onSuccess:n=>{t.setQueryData([`fleet-topology`,e.token],n),r(``),a(``),c(``),u(``),f(``),m(``)}}),v=g({mutationFn:t=>Qe(e.token,t.peerId),onSuccess:n=>{t.setQueryData([`fleet-topology`,e.token],n)}}),b=h.data,x=b?.instances||[],S=n.trim()&&(l.trim()||d.trim());function C(e){r(e.peerId),a(e.agentCardUrl),c(e.deliveryUrl),u(e.publicKeyFingerprint),f(``),m(``)}return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{actions:(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,disabled:h.isFetching,onClick:()=>void h.refetch(),children:`Refresh`})}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`HQ instance`}),(0,B.jsx)(vo,{children:b?.hq.instanceId||`unavailable`})]}),(0,B.jsx)(K,{children:b?(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Status`}),(0,B.jsx)(`strong`,{children:`local`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Version`}),(0,B.jsx)(`strong`,{children:b.hq.version})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Latency`}),(0,B.jsx)(`strong`,{children:tp(b.hq.latencyMs)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Public key`}),(0,B.jsx)(`strong`,{children:$f(b.hq.publicKeyFingerprint)})]})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:h.isLoading?`Loading fleet topology...`:`Fleet topology unavailable.`})})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Child instances`}),(0,B.jsx)(vo,{children:`${x.length} instance${x.length===1?``:`s`}`})]}),(0,B.jsxs)(K,{children:[h.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading instances...`}):x.length?(0,B.jsx)(`div`,{className:`list-stack`,children:x.map(e=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{className:`list-row-main`,children:[(0,B.jsx)(`strong`,{children:e.peerId}),(0,B.jsxs)(`small`,{children:[e.version||`version unknown`,` ·`,` `,tp(e.latencyMs),` · last seen`,` `,io(e.lastSeenAt)]}),e.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:e.error}):null]}),(0,B.jsxs)(`div`,{className:`row-actions`,children:[ep(e.status),(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,onClick:()=>C(e),children:`Edit`}),(0,B.jsx)(`button`,{className:`danger-button`,type:`button`,disabled:v.isPending,onClick:()=>v.mutate(e),children:`Remove`})]})]},e.peerId))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No child instances configured.`}),v.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:v.error instanceof Error?v.error.message:`Remove failed.`}):null]})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Add instance`}),(0,B.jsx)(vo,{children:`A2A trust ledger`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Instance`}),(0,B.jsx)(Y,{value:n,onChange:e=>r(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Agent Card`}),(0,B.jsx)(Y,{value:i,onChange:e=>a(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Delivery URL`}),(0,B.jsx)(Y,{value:s,onChange:e=>c(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Fingerprint`}),(0,B.jsx)(Y,{value:l,onChange:e=>u(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Public JWK`}),(0,B.jsx)(ts,{rows:5,value:d,onChange:e=>f(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Reason`}),(0,B.jsx)(Y,{value:p,onChange:e=>m(e.target.value)})]}),(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:!S||_.isPending,onClick:()=>_.mutate(),children:`Trust instance`}),_.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:_.error instanceof Error?_.error.message:`Trust update failed.`}):null,h.error?(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:h.error instanceof Error?h.error.message:`Fleet topology load failed.`}):null]})})]})]}),x.length?(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Instance detail`})}),(0,B.jsx)(K,{children:(0,B.jsx)(`div`,{className:`list-stack`,children:x.map(e=>(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Instance`}),(0,B.jsx)(`strong`,{children:e.peerId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Status`}),(0,B.jsx)(`strong`,{children:e.status})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Agent Card`}),(0,B.jsx)(`strong`,{children:e.agentCardUrl||`not configured`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Delivery URL`}),(0,B.jsx)(`strong`,{children:e.deliveryUrl||`not configured`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Trusted`}),(0,B.jsx)(`strong`,{children:ao(e.trustedAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Updated`}),(0,B.jsx)(`strong`,{children:ao(e.updatedAt)})]})]},e.peerId))})})]}):null]})}var rp=`HYBRIDAI_API_KEY`,ip=`https://hybridai.one`;function ap(e){return e.name?`${e.name} (${e.id})`:e.id}function op(e){return`${e.name} (${e.id})${e.model?` - ${e.model}`:``}`}function sp(e){return JSON.stringify({id:e.id,chatbotId:e.chatbotId,proxy:e.proxy||null})}function cp(e){let t=e.trim();if(!t)throw Error(`HybridAI base URL is required.`);let n;try{n=new URL(t)}catch{throw Error(`HybridAI base URL must be a valid HTTPS URL.`)}if(n.protocol!==`https:`)throw Error(`HybridAI base URL must use HTTPS.`);return n.pathname=n.pathname.replace(/\/+$/g,``),n.username=``,n.password=``,n.search=``,n.hash=``,n.toString().replace(/\/+$/g,``)}function lp(e){try{return cp(e)===ip}catch{return!1}}function up(){let e=Zn(),t=Ss(),n=o(),r=qd(e.token);Kd(r.connection);let[i,a]=(0,R.useState)(!1),[s,c]=(0,R.useState)(``),[l,u]=(0,R.useState)(!1),[d,f]=(0,R.useState)(ip),[p,m]=(0,R.useState)(``),[h,_]=(0,R.useState)(rp),[v,b]=(0,R.useState)(`channel`),x=(0,R.useRef)(``),S=r.status||e.gatewayStatus,C=Object.entries(S?.providerHealth||S?.localBackends||{}),w=S?.scheduler?.jobs||[],T=y({queryKey:[`admin-agents`,e.token],queryFn:()=>mt(e.token),refetchOnWindowFocus:!1}),E=lp(d),D=y({queryKey:[`admin-hybridai-bots`,e.token],queryFn:()=>ht(e.token,ip),enabled:l&&E,refetchOnWindowFocus:!1}),O=g({mutationFn:()=>ct(e.token),onSuccess:()=>{t.success(`Gateway reloaded.`)},onError:e=>{t.error(`Gateway reload failed`,H(e))}}),k=j(),A=T.data||[],M=A.find(e=>e.id===s)||A.find(e=>e.id===S?.defaultAgentId)||A[0]||null;(0,R.useEffect)(()=>{if(A.length===0)return;let e=A.find(e=>e.id===s)||A.find(e=>e.id===S?.defaultAgentId)||A[0];if(!e)return;let t=sp(e);if(e.id!==s&&c(e.id),x.current===t)return;x.current=t;let n=e.proxy||null;u(!!n),f(n?.baseUrl||ip),m(n?.chatbotId||e.chatbotId||``),_(n?.apiKey.id||rp),b(n?.conversationScope||`channel`)},[A,s,S?.defaultAgentId]);let N=D.data||[],P=p&&!N.some(e=>e.id===p)?[{id:p,name:p},...N]:N;(0,R.useEffect)(()=>{if(!l||!E||p)return;let e=N[0]?.id;e&&m(e)},[N,E,p,l]);let F=g({mutationFn:async()=>{if(!M)throw Error(`Select an agent first.`);let t=h.trim(),n=l?{kind:`hybridai`,baseUrl:cp(d),chatbotId:p.trim(),apiKey:{source:`store`,id:t},conversationScope:v}:null;return gt(e.token,M.id,{proxy:n})},onSuccess:r=>{n.setQueryData([`admin-agents`,e.token],e=>e?.map(e=>e.id===r.id?r:e)||[r]),t.success(`Saved proxy mode for ${r.name||r.id}.`)},onError:e=>{t.error(`Proxy mode update failed`,H(e))}});if(!S)return(0,B.jsx)(`div`,{className:`empty-state`,children:`Gateway status is unavailable.`});let I=O.isPending,ee=S.sandbox?.mode===`host`?null:S.sandbox?.warning||null;return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{actions:(0,B.jsx)(`button`,{type:`button`,className:`primary-button`,disabled:I,onClick:()=>a(!0),"aria-busy":I,children:I?(0,B.jsxs)(`span`,{className:`button-with-spinner`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`button-spinner`}),`Reloading Gateway`]}):`Reload Gateway`})}),(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Xa,{label:`Uptime`,value:oo(S.uptime)}),(0,B.jsx)(Xa,{label:`Sessions`,value:String(S.sessions)}),(0,B.jsx)(Xa,{label:`Providers`,value:String(C.length)}),(0,B.jsx)(Xa,{label:`Scheduler jobs`,value:String(w.length)})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Runtime`})}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Version`}),(0,B.jsx)(`strong`,{children:S.version})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`PID`}),(0,B.jsx)(`strong`,{children:S.pid??`n/a`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Timestamp`}),(0,B.jsx)(`strong`,{children:ao(S.timestamp)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Default model`}),(0,B.jsx)(`strong`,{children:S.defaultModel})]})]})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Services`})}),(0,B.jsxs)(K,{children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Sandbox mode`}),(0,B.jsx)(`strong`,{children:S.sandbox?.mode||`unknown`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Sandbox sessions`}),(0,B.jsx)(`strong`,{children:S.sandbox?.activeSessions??S.activeContainers})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Web API auth`}),(0,B.jsx)(Qa,{value:S.webAuthConfigured,trueLabel:`on`,falseLabel:`off`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`RAG default`}),(0,B.jsx)(Qa,{value:S.ragDefault,trueLabel:`on`,falseLabel:`off`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Observability`}),(0,B.jsx)(Qa,{value:!!(S.observability?.enabled&&S.observability?.running),trueLabel:`active`,falseLabel:`inactive`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Last observability success`}),(0,B.jsx)(`strong`,{children:ao(S.observability?.lastSuccessAt||null)})]})]}),ee?(0,B.jsx)(`p`,{className:`error-banner`,children:ee}):null,S.codex?.reloginRequired?(0,B.jsx)(`p`,{className:`error-banner`,children:`Codex login is required again.`}):null,S.observability?.lastError?(0,B.jsx)(`p`,{className:`error-banner`,children:S.observability.lastError}):null]})]})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsx)(Ld,{title:`Provider health`,entries:C,onLogin:()=>void k({to:`/admin/config`})}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Agent proxy mode`})}),(0,B.jsx)(K,{children:T.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading agents...`}):A.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No agents are registered.`}):(0,B.jsxs)(`div`,{className:`list-stack`,children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Agent`}),(0,B.jsx)(vs,{value:M?.id||``,onChange:e=>c(e.target.value),children:A.map(e=>(0,B.jsx)(Q,{value:e.id,children:ap(e)},e.id))})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Proxy mode`}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Vc,{checked:l,onCheckedChange:u}),(0,B.jsx)(Qa,{value:l,trueLabel:`on`,falseLabel:`off`})]})]}),l?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`HybridAI base URL`}),(0,B.jsx)(Y,{type:`url`,value:d,placeholder:ip,onChange:e=>f(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Chatbot id`}),E?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(vs,{value:p,disabled:D.isLoading&&P.length===0,onChange:e=>m(e.target.value),children:[p?null:(0,B.jsx)(Q,{value:``,disabled:!0,children:D.isLoading?`Loading bots...`:`Select bot`}),P.map(e=>(0,B.jsx)(Q,{value:e.id,children:op(e)},e.id))]}),D.isError?(0,B.jsx)(`p`,{className:`error-banner`,children:H(D.error)}):null]}):(0,B.jsx)(Y,{value:p,onChange:e=>m(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`API key SecretRef id`}),(0,B.jsx)(Y,{value:h,placeholder:rp,onChange:e=>_(e.target.value)})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Conversation scope`}),(0,B.jsxs)(vs,{value:v,onChange:e=>b(e.target.value),children:[(0,B.jsx)(Q,{value:`channel`,children:`channel`}),(0,B.jsx)(Q,{value:`user`,children:`user`})]})]})]}):null]}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{loading:F.isPending,disabled:!M,onClick:()=>F.mutate(),children:`Save Proxy Mode`})})]})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Scheduler snapshot`})}),(0,B.jsx)(K,{children:w.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No scheduler jobs are registered.`}):(0,B.jsx)(`div`,{className:`list-stack`,children:w.slice(0,8).map(e=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.name}),(0,B.jsx)(`small`,{children:e.nextRunAt?`next ${ao(e.nextRunAt)}`:`no next run scheduled`})]}),(0,B.jsxs)(`div`,{className:`row-status-stack`,children:[(0,B.jsx)(Qa,{value:e.enabled&&!e.disabled,trueLabel:`active`,falseLabel:`inactive`}),(0,B.jsx)(`small`,{children:e.lastStatus||`ready`})]})]},e.id))})})]})]}),(0,B.jsx)(ui,{open:i,onOpenChange:a,children:(0,B.jsxs)(di,{size:`sm`,role:`alertdialog`,children:[(0,B.jsxs)(fi,{children:[(0,B.jsx)(pi,{children:`Reload Gateway?`}),(0,B.jsx)(mi,{children:`This reloads runtime config and refreshes secrets without restarting the workspace container.`})]}),(0,B.jsxs)(hi,{children:[(0,B.jsx)(gi,{className:`ghost-button`,children:`Cancel`}),(0,B.jsx)(gi,{className:`primary-button`,onClick:()=>O.mutate(),children:`Reload`})]})]})})]})}var dp=new Intl.NumberFormat(`en-US`,{maximumFractionDigits:3});function fp(e){return dp.format(e)}function pp(e){return`$${e.toFixed(4)}`}function mp(e){return Object.entries(e.editsPerSurface).filter(([,e])=>e>0).map(([e,t])=>`${e}: ${t}`).join(`, `)||`none`}function hp(e){if(e.length===0)return``;let t=Math.max(1,e.length-1);return e.map((e,n)=>{let r=12+n/t*296,i=84-Math.max(0,Math.min(1,e.metrics.passAt1))*72;return`${r.toFixed(1)},${i.toFixed(1)}`}).join(` `)}function gp({rounds:e}){let t=hp(e);return t?(0,B.jsxs)(`svg`,{"aria-label":`pass@1 trajectory`,role:`img`,viewBox:`0 0 320 96`,style:{width:`100%`,height:120,marginBottom:16},children:[(0,B.jsx)(`title`,{children:`pass@1 trajectory`}),(0,B.jsx)(`line`,{x1:`12`,y1:`84`,x2:`308`,y2:`84`,stroke:`var(--border)`}),(0,B.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`84`,stroke:`var(--border)`}),(0,B.jsx)(`polyline`,{fill:`none`,points:t,stroke:`var(--accent)`,strokeWidth:`2.5`}),t.split(` `).map((t,n)=>{let[r,i]=t.split(`,`);return(0,B.jsx)(`circle`,{cx:r,cy:i,fill:`var(--accent)`,r:`3`},`${e[n]?.round}-${t}`)})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No trajectory yet.`})}function _p(){let e=Zn(),[t,n]=(0,R.useState)(``),[r,i]=(0,R.useState)(``),[a,o]=(0,R.useState)(null),[s,c]=(0,R.useState)(``),l=y({queryKey:[`harness-evolution-runs`,e.token,r],queryFn:()=>zn(e.token,r),enabled:!!r}),u=a||l.data?.runs[0]||null,d=y({queryKey:[`harness-evolution-run`,e.token,r,u?.summaryPath],queryFn:()=>Bn(e.token,r,u?.summaryPath||``),enabled:!!(r&&u?.summaryPath)}),f=s||d.data?.run.rounds[0]?.manifestPath||``,p=y({queryKey:[`harness-evolution-manifest`,e.token,r,f],queryFn:()=>Vn(e.token,r,f),enabled:!!(r&&f)}),m=d.data?.run,h=p.data?.manifest.entries||[],g=(0,R.useMemo)(()=>m?.rounds.reduce((e,t)=>e+t.metrics.rolloutCount,0)||0,[m]);return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{title:`Harness Evolution`,description:`R10a run telemetry, attribution, and F12 manifests.`,actions:(0,B.jsxs)(`form`,{className:`header-actions`,onSubmit:e=>{e.preventDefault(),o(null),c(``),i(t.trim())},children:[(0,B.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),placeholder:`/path/to/target`,style:{minWidth:320}}),(0,B.jsx)(`button`,{type:`submit`,children:`Load`})]})}),r?l.isError?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(l.error)}):l.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading harness evolution runs...`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Xa,{label:`Runs`,value:String(l.data?.runs.length||0),detail:r}),(0,B.jsx)(Xa,{label:`Best pass@1`,value:fp(m?.bestPassAt1||0),detail:m?.bestRound?`round ${m.bestRound}`:`none`}),(0,B.jsx)(Xa,{label:`Rollouts`,value:String(g),detail:`${m?.rounds.length||0} rounds`}),(0,B.jsx)(Xa,{label:`Cost`,value:pp(m?.costGate.totalCostUsd||0),detail:m?.costGate.budgetUsd==null?`no budget`:`${m.costGate.ok?`within`:`over`} budget`}),(0,B.jsx)(Xa,{label:`Seed delta`,value:String(m?.seedDelta.changedSurfaceCount||0),detail:m?.seedDelta.mode===`in_place`?`in-place coworker`:`fresh seed`})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Runs`})}),(0,B.jsx)(K,{children:(0,B.jsx)(`div`,{className:`table-wrap`,children:(0,B.jsxs)(`table`,{className:`data-table`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Run`}),(0,B.jsx)(`th`,{children:`Suite`}),(0,B.jsx)(`th`,{children:`Rounds`}),(0,B.jsx)(`th`,{children:`Best`})]})}),(0,B.jsx)(`tbody`,{children:(l.data?.runs||[]).map(e=>(0,B.jsxs)(`tr`,{onClick:()=>{o(e),c(``)},children:[(0,B.jsx)(`td`,{children:e.runId}),(0,B.jsx)(`td`,{children:e.suiteName}),(0,B.jsx)(`td`,{children:e.roundCount}),(0,B.jsx)(`td`,{children:fp(e.bestPassAt1)})]},e.summaryPath))})]})})})]}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Rounds`})}),(0,B.jsx)(K,{children:d.isError?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(d.error)}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(gp,{rounds:m?.rounds||[]}),(0,B.jsx)(`div`,{className:`table-wrap`,children:(0,B.jsxs)(`table`,{className:`data-table`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Round`}),(0,B.jsx)(`th`,{children:`pass@1`}),(0,B.jsx)(`th`,{children:`Succ/Mtok`}),(0,B.jsx)(`th`,{children:`Attribution`}),(0,B.jsx)(`th`,{children:`Edits`}),(0,B.jsx)(`th`,{children:`Evolve`})]})}),(0,B.jsx)(`tbody`,{children:(m?.rounds||[]).map(e=>(0,B.jsxs)(`tr`,{onClick:()=>c(e.manifestPath),children:[(0,B.jsx)(`td`,{children:e.round}),(0,B.jsx)(`td`,{children:fp(e.metrics.passAt1)}),(0,B.jsx)(`td`,{children:fp(e.metrics.succPerMtok)}),(0,B.jsx)(`td`,{children:fp(e.attributionScore)}),(0,B.jsx)(`td`,{children:mp(e)}),(0,B.jsx)(`td`,{children:e.evolveAgent.source})]},e.round))})]})})]})})]})]}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`F12 Manifest`})}),(0,B.jsx)(K,{children:p.isError?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(p.error)}):h.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No manifest entries.`}):(0,B.jsx)(vp,{entries:h})})]})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Enter a target coworker workspace.`})]})}function vp({entries:e}){return(0,B.jsx)(`div`,{className:`table-wrap`,children:(0,B.jsxs)(`table`,{className:`data-table`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Surface`}),(0,B.jsx)(`th`,{children:`Path`}),(0,B.jsx)(`th`,{children:`Prediction`}),(0,B.jsx)(`th`,{children:`Verifier`}),(0,B.jsx)(`th`,{children:`Status`})]})}),(0,B.jsx)(`tbody`,{children:e.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:e.surface}),(0,B.jsx)(`td`,{children:e.path}),(0,B.jsx)(`td`,{children:e.prediction}),(0,B.jsx)(`td`,{children:e.verifier}),(0,B.jsx)(`td`,{children:e.rolledBackAt?`rolled back`:e.confirmed===!1?`disconfirmed`:e.confirmed?`confirmed`:`pending`})]},e.id))})]})})}function yp(e){return e.percent>=100?`hard`:e.percent>=80?`warn`:`neutral`}function bp(e,t){return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:t,maximumFractionDigits:e>=10?0:2}).format(e)}function xp(e){let t=Math.abs(e),n=t>=1e6?{divisor:1e6,suffix:`m`}:t>=1e3?{divisor:1e3,suffix:`k`}:null;if(!n)return Math.round(e).toLocaleString(`en-US`);let r=e/n.divisor;return`${Number.isInteger(r)?r.toFixed(0):r.toFixed(1)}${n.suffix}`}function Sp(e,t){return e.unit===`tokens`?xp(t):bp(t,e.currency)}function Cp(e){return e.budget?(0,B.jsxs)(`span`,{className:`agent-budget-chip`,"data-tone":yp(e.budget),title:`${Math.floor(e.budget.percent)}% used`,children:[Sp(e.budget,e.budget.used),` /`,` `,Sp(e.budget,e.budget.cap),e.budget.unit===`tokens`?` tokens`:``]}):null}var wp=[{id:`backlog`,title:`Backlog`},{id:`in_progress`,title:`In Progress`},{id:`review`,title:`Review`},{id:`done`,title:`Done`},{id:`cancelled`,title:`Cancelled`}];function Tp(e,t){let n=String(e||``).replace(/\s+/g,` `).trim();return n?n.length>t?`${n.slice(0,t-3).trimEnd()}...`:n:``}function Ep(e){return e.sessionId?e.sessionId:e.source===`job`?`scheduler:${e.id}`:null}function Dp(e,t){return e.boardStatus?e.boardStatus:t?.status===`active`?`in_progress`:e.lastStatus===`success`&&(e.schedule.kind===`at`||e.schedule.kind===`one_shot`||!e.nextRunAt)?`done`:e.lastStatus===`success`?`review`:`backlog`}function Op(e){return e===`in_progress`?`progress`:e===`review`?`review`:e===`done`?`success`:e===`cancelled`?`danger`:`default`}function kp(e){return e.column===`in_progress`?`in_progress`:e.column===`in_review`?`review`:e.column===`done`?`done`:`backlog`}function Ap(e){return e.kind===`card`?e.card.edges:[]}function jp(e){return e.kind===`blocked_by`?`Blocked by ${e.toCardId}`:e.kind===`blocks`?`Blocks ${e.toCardId}`:`Related ${e.toCardId}`}function Mp(e,t){return Np(e)?`paused`:t===`in_progress`?`running`:t===`review`&&e.lastStatus===`error`?`failed`:t===`backlog`||t===`cancelled`?`queued`:`ready`}function Np(e){return e.source===`task`?e.disabled:!e.enabled||e.disabled}function Pp(e){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;return t}function Fp(e){if(!e||e===`unassigned`)return{backgroundColor:`#eef2f7`,color:`#64748b`};let t=Pp(e)%360;return{backgroundColor:`hsla(${t}, 72%, 92%, 1)`,color:`hsl(${t}, 64%, 36%)`}}function Ip(e){let{item:t}=e,n=Ap(t),r=(0,R.useMemo)(()=>Fp(t.agentKey),[t.agentKey]);return(0,B.jsx)(`div`,{className:[`jobs-card-shell`,e.selected?`active`:``,e.draggable?`draggable`:``].filter(Boolean).join(` `),children:(0,B.jsx)(`button`,{className:`jobs-card-button`,type:`button`,draggable:e.draggable,onClick:e.onSelect,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragOver:e.onDragOver,onDragLeave:e.onDragLeave,onDrop:e.onDrop,children:(0,B.jsxs)(`article`,{className:`jobs-card tone-${t.tone}`,children:[(0,B.jsx)(`div`,{className:`jobs-card-top`,children:(0,B.jsx)(`strong`,{children:Tp(t.kind===`job`?t.job.name:t.kind===`card`?t.card.title:t.suspendedSession.blockedLabel,24)})}),(0,B.jsx)(`p`,{children:t.summary}),(0,B.jsx)(`small`,{children:t.stateLabel}),t.kind===`card`&&(t.card.blocked||n.length>0)?(0,B.jsxs)(`div`,{className:`jobs-card-edge-row`,children:[t.card.blocked?(0,B.jsx)(`span`,{className:`jobs-edge-chip blocked`,children:`Blocked`}):null,n.slice(0,3).map(e=>(0,B.jsx)(`span`,{className:`jobs-edge-chip`,children:jp(e)},e.id)),n.length>3?(0,B.jsxs)(`span`,{className:`jobs-edge-chip`,children:[`+`,n.length-3]}):null]}):null,(0,B.jsxs)(`div`,{className:`jobs-card-agent-row`,children:[(0,B.jsx)(`span`,{className:`jobs-card-pill`,style:r,children:t.agentLabel}),(0,B.jsx)(Cp,{budget:e.budget})]})]})})})}function Lp(e,t){return(e||[]).map(e=>e.id===t.id&&e.source===`job`?t:e)}function Rp(e){let t=[],n=(n,r)=>{let i=String(r||``).trim();i&&t.push({key:`${e.key}:${n.toLowerCase().replace(/\s+/g,`-`)}`,label:n,value:i})},r=(e,t)=>{String(t||``).trim()&&n(e,ao(t||null))};return e.kind===`blocked`?(r(`Created`,e.suspendedSession.createdAt),r(`Expires`,e.suspendedSession.expiresAt),t):e.kind===`card`?(n(`Card ID`,e.card.id),n(`Source`,e.card.source),n(`Parent`,e.card.parent),r(`Created`,e.card.createdAt),r(`Updated`,e.card.updatedAt),t):(r(`Created`,e.job.createdAt||e.session?.startedAt||null),r(`Last run`,e.job.lastRun),n(`Last status`,e.job.lastStatus?e.job.lastStatus===`success`?`Success`:`Error`:null),n(`Next run`,e.job.schedule.kind!==`at`&&e.job.schedule.kind!==`one_shot`?e.job.nextRunAt:null),n(`Consecutive errors`,e.job.consecutiveErrors>0?String(e.job.consecutiveErrors):null),n(`Retries after failure`,e.job.schedule.kind===`one_shot`&&e.job.maxRetries!=null?String(e.job.maxRetries):null),r(`Session started`,e.session?.startedAt||null),r(`Session last active`,e.session?.lastActive||null),t)}function zp(e){if(e.kind===`blocked`||e.kind===`card`)return[];let t=e.session?.output&&e.session.output.length>0?e.session.output:e.session?.lastAnswer?[e.session.lastAnswer]:e.job.action.kind===`system_event`&&e.job.lastStatus===`success`?[e.job.action.message]:[``],n=new Set,r=[];for(let e of t){let t=String(e||``).trim();!t||n.has(t)||(n.add(t),r.push(t))}return r}function Bp(e,t){return`${e}:${t.trim().slice(0,48).replace(/\s+/g,`-`)}`}function Vp(e){let{item:t}=e,n=j(),r=t.kind===`card`?null:t.kind===`blocked`?t.suspendedSession.sessionId:Ep(t.job),i=t.kind===`job`?t.job.id:null,a=Ap(t),o=(0,R.useMemo)(()=>zp(e.item),[e.item]),[s,c]=(0,R.useState)(null),[l,u]=(0,R.useState)(null),d=e.item.kind===`job`&&e.item.job.source===`job`;function f(t){if(e.item.kind!==`job`)return;let n=e.item.job;n.source===`job`&&(e.onUpdate({...n,source:`job`,...t}),u(null))}async function p(e,t){try{await navigator.clipboard.writeText(t),c(e),window.setTimeout(()=>{c(t=>t===e?null:t)},1600)}catch{c(null)}}return(0,B.jsxs)(`aside`,{className:`jobs-detail`,children:[(0,B.jsxs)(`div`,{className:`jobs-detail-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`eyebrow`,children:`Job`}),(0,B.jsx)(`h4`,{children:e.item.kind===`job`?e.item.job.name:e.item.kind===`card`?e.item.card.title:e.item.suspendedSession.blockedLabel})]}),e.item.kind===`card`?null:(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,onClick:()=>{if(i){n({to:`/admin/scheduler`,search:{jobId:i}}).catch(Fs);return}n({to:`/admin/approvals`}).catch(Fs)},children:`Edit`})]}),(0,B.jsxs)(`div`,{className:`jobs-detail-stack`,children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Status`}),(0,B.jsx)(`strong`,{children:e.item.stateLabel})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Lane`}),d&&l===`lane`?(0,B.jsx)(`select`,{className:`jobs-inline-select`,value:e.item.kind===`job`&&e.item.job.boardStatus||e.item.column,onBlur:()=>u(null),onChange:e=>f({boardStatus:e.target.value}),children:wp.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.title},e.id))}):(0,B.jsx)(`button`,{className:`jobs-inline-trigger`,type:`button`,disabled:!d||e.savePending,onClick:()=>u(`lane`),children:wp.find(t=>t.id===e.item.column)?.title||e.item.column})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Agent`}),d&&l===`agent`?(0,B.jsxs)(`select`,{className:`jobs-inline-select`,value:e.item.kind===`job`&&e.item.job.agentId||``,onBlur:()=>u(null),onChange:e=>f({agentId:e.target.value||null}),children:[(0,B.jsx)(`option`,{value:``,children:`Unassigned`}),e.agents.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.name?.trim()?`${e.name} (${e.id})`:e.id},e.id))]}):(0,B.jsx)(`button`,{className:`jobs-inline-trigger`,type:`button`,disabled:!d||e.savePending,onClick:()=>u(`agent`),children:e.item.agentLabel})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Type`}),(0,B.jsx)(`strong`,{children:e.item.kind===`blocked`?`blocked`:e.item.kind===`card`?`card`:e.item.job.source===`task`?`task`:`job`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Session`}),(0,B.jsx)(`strong`,{children:r||`n/a`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Channel`}),(0,B.jsx)(`strong`,{children:e.item.kind===`blocked`?e.item.suspendedSession.context.host||`n/a`:e.item.kind===`card`?e.item.card.source:e.item.job.channelId||e.item.job.delivery.to||`n/a`})]}),e.item.kind===`job`&&e.item.job.schedule.kind!==`at`&&e.item.job.schedule.kind!==`one_shot`?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Next run`}),(0,B.jsx)(`strong`,{children:ao(e.item.job.nextRunAt)})]}):null]}),(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsx)(`span`,{children:`Description`}),(0,B.jsx)(`p`,{children:e.item.kind===`blocked`?e.item.suspendedSession.prompt:e.item.kind===`card`?e.item.card.body||e.item.summary:e.item.job.description||e.item.summary})]}),e.item.kind===`card`?(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsx)(`span`,{children:`Dependencies`}),a.length?(0,B.jsx)(`div`,{className:`jobs-runtime-list`,children:a.map(e=>(0,B.jsxs)(`div`,{className:`jobs-runtime-row`,children:[(0,B.jsx)(`strong`,{children:jp(e)}),(0,B.jsx)(`small`,{children:e.kind})]},e.id))}):(0,B.jsx)(`p`,{children:`No dependencies recorded for this card.`})]}):null,(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsx)(`span`,{children:`Message`}),(0,B.jsx)(`p`,{children:e.item.kind===`blocked`?e.item.suspendedSession.prompt:e.item.kind===`card`?e.item.card.status||`No status recorded.`:e.item.job.action.message||`No action message.`})]}),e.item.kind===`blocked`?(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsxs)(`div`,{className:`summary-block-header`,children:[(0,B.jsx)(`span`,{children:`Resume`}),(0,B.jsx)(`strong`,{children:e.item.suspendedSession.modality})]}),(0,B.jsx)(`p`,{className:`supporting-text`,children:e.item.suspendedSession.prompt}),(0,B.jsx)(Js,{session:e.item.suspendedSession})]}):null,(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsxs)(`div`,{className:`summary-block-header`,children:[(0,B.jsx)(`span`,{children:`Outputs`}),o.length?(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,onClick:()=>p(`all`,o.join(`
69
69
 
70
- `)),children:s===`all`?`Copied`:`Copy all`}):null]}),o.length?(0,B.jsx)(`div`,{className:`jobs-output-list`,children:o.map(t=>(0,B.jsxs)(`div`,{className:`jobs-output-card`,children:[(0,B.jsxs)(`div`,{className:`jobs-output-actions`,children:[(0,B.jsx)(`small`,{children:`Output`}),(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,onClick:()=>p(Np(`copy`,t),t),children:s===Np(`copy`,t)?`Copied`:`Copy`})]}),(0,B.jsx)(`pre`,{className:`jobs-output-pre`,children:t})]},Np(e.item.key,t)))}):(0,B.jsx)(`p`,{children:`No outputs captured for this job yet.`})]}),(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsx)(`span`,{children:`Runtime`}),e.runtime.length?(0,B.jsx)(`div`,{className:`jobs-runtime-list`,children:e.runtime.map(e=>(0,B.jsxs)(`div`,{className:`jobs-runtime-row`,children:[(0,B.jsx)(`strong`,{children:e.label}),(0,B.jsx)(`small`,{children:e.value})]},e.key))}):(0,B.jsx)(`p`,{children:`No runtime details recorded yet.`})]})]})]})}function Fp(){let e=Gn(),t=j(),n=o(),r=hs(),[i,a]=(0,R.useState)(``),[s,c]=(0,R.useState)(null),[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)(null),[p,m]=(0,R.useState)(null),h=(0,R.useDeferredValue)(i),_=y({queryKey:[`scheduler`,e.token],queryFn:()=>Jt(e.token),refetchInterval:15e3}),v=y({queryKey:[`jobs-context`,e.token],queryFn:()=>Ct(e.token),refetchInterval:15e3}),b=g({mutationFn:t=>Yt(e.token,t),onMutate:async t=>{await n.cancelQueries({queryKey:[`scheduler`,e.token]});let r=n.getQueryData([`scheduler`,e.token]);return n.setQueryData([`scheduler`,e.token],r&&{...r,jobs:Ap(r.jobs,t)}),{previous:r}},onError:(t,i,a)=>{a?.previous&&n.setQueryData([`scheduler`,e.token],a.previous),r.error(`Save failed`,H(t))},onSuccess:t=>{n.setQueryData([`scheduler`,e.token],t)}}),x=g({mutationFn:t=>Qt(e.token,{jobId:t.jobId,beforeJobId:t.beforeJobId,boardStatus:t.boardStatus}),onSuccess:t=>{n.setQueryData([`scheduler`,e.token],t)},onError:e=>{r.error(`Move failed`,H(e))}}),S=(0,R.useMemo)(()=>new Map((v.data?.sessions||[]).map(e=>[e.sessionId,e])),[v.data?.sessions]),C=(0,R.useMemo)(()=>new Map((v.data?.agents||[]).map(e=>[e.id,e])),[v.data?.agents]),w=(0,R.useMemo)(()=>{let e=(_.data?.jobs||[]).map(e=>{let t=S.get(yp(e)||``)||null,n=e.agentId||t?.agentId||`unassigned`,r=(C.get(n)||null)?.name||e.agentId||t?.agentId||(n===`unassigned`?`Unassigned`:n),i=bp(e,t),a=vp(e.description,28)||vp(e.action.message,36)||vp(e.channelId,24)||`No summary`;return{key:e.id,kind:`job`,job:e,session:t,agentKey:n,agentLabel:r,column:i,tone:xp(i),stateLabel:Tp(e,i),summary:a,searchIndex:[e.id,e.name,a,e.action.message,e.description||``,r,e.channelId||``,e.delivery.to].join(` `).toLowerCase()}}),t=(v.data?.suspendedSessions||[]).map(e=>{let t=`blocked:${e.sessionId}`,n=e.agentId||`unassigned`,r=(C.get(n)||null)?.name||e.agentId||(n===`unassigned`?`Unassigned`:n);return{key:t,kind:`blocked`,suspendedSession:e,session:null,agentKey:n,agentLabel:r,column:`review`,tone:`danger`,stateLabel:e.blockedLabel,summary:vp(e.context.host,24)||vp(e.prompt,32)||`Needs operator`,searchIndex:[t,e.blockedLabel,e.prompt,e.context.host||``,e.modality,r].join(` `).toLowerCase()}}),n=(v.data?.cards||[]).map(e=>{let t=e.owner.type===`agent`?e.owner.id:`unassigned`,n=(C.get(t)||null)?.name||(e.owner.type===`agent`?e.owner.id:`User ${e.owner.id}`),r=Sp(e),i=vp(e.body,36)||vp(e.status,28)||vp(e.source,24)||`No summary`;return{key:`card:${e.id}`,kind:`card`,card:e,session:null,agentKey:t,agentLabel:n,column:r,tone:e.blocked?`danger`:xp(r),stateLabel:e.blocked?`blocked`:e.status||`ready`,summary:i,searchIndex:[e.id,e.title,e.body,e.status,e.source,e.parent||``,n,...e.edges.flatMap(e=>[e.kind,e.fromCardId,e.toCardId])].join(` `).toLowerCase()}});return[...t,...n,...e]},[C,v.data?.cards,v.data?.suspendedSessions,_.data?.jobs,S]),T=(0,R.useMemo)(()=>{let e=h.trim().toLowerCase();return e?w.filter(t=>t.searchIndex.includes(e)):w},[w,h]),E=(0,R.useMemo)(()=>new Map(w.map(e=>[e.key,e])),[w]),D=(0,R.useMemo)(()=>Array.from(new Set(w.map(e=>e.agentKey).filter(e=>e&&e!==`unassigned`))).sort((e,t)=>e.localeCompare(t)),[w]),O=(0,R.useMemo)(()=>[...D].sort((e,t)=>e.localeCompare(t)).join(`\0`),[D]),k=y({queryKey:[`board-budget-summaries`,e.token,O],queryFn:()=>wt(e.token,D),enabled:D.length>0,staleTime:3e4}),A=(0,R.useMemo)(()=>new Map((k.data?.budgets||[]).map(e=>[e.agentId,e])),[k.data?.budgets]),M=(0,R.useMemo)(()=>new Set(T.map(e=>e.key)),[T]),N=(0,R.useMemo)(()=>_p.map(e=>({...e,items:T.filter(t=>t.column===e.id)})),[T]),P=(0,R.useMemo)(()=>s&&E.get(s)||null,[E,s]);(0,R.useEffect)(()=>{s!==null&&(!P||!M.has(s))&&c(null)},[P,s,M]);let F=(0,R.useMemo)(()=>P?jp(P):[],[P]),I=(0,R.useMemo)(()=>w.find(e=>e.key===l)||null,[w,l]);function ee(e,t=null){if(!(!I||I.kind!==`job`||I.job.source!==`job`)){if(t===I.job.id){u(null),f(null),m(null);return}x.mutate({jobId:I.job.id,beforeJobId:t,boardStatus:e}),u(null),f(null),m(null)}}return _.isLoading&&!_.data?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading jobs board...`}):_.isError&&!_.data?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(_.error)}):(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{actions:(0,B.jsxs)(`div`,{className:`header-actions`,children:[(0,B.jsx)(`input`,{className:`compact-search jobs-header-search`,value:i,onChange:e=>a(e.target.value),placeholder:`Search jobs`}),(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,onClick:()=>{t({to:`/admin/scheduler`,search:{jobId:void 0}}).catch(Os)},children:`New Job`})]})}),v.isError?(0,B.jsx)(`p`,{className:`error-banner`,children:H(v.error)}):null,(0,B.jsxs)(`section`,{className:P?`jobs-board-layout has-detail`:`jobs-board-layout`,children:[(0,B.jsx)(`div`,{className:`jobs-columns`,children:N.map(e=>(0,B.jsxs)(`fieldset`,{"aria-label":`${e.title} jobs`,className:p===e.id?`jobs-column jobs-column-${e.id} drop-target`:`jobs-column jobs-column-${e.id}`,onDragOver:t=>{!I||I.kind!==`job`||I.job.source!==`job`||(t.preventDefault(),p!==e.id&&m(e.id))},onDragLeave:t=>{t.currentTarget.contains(t.relatedTarget)||p===e.id&&m(null)},onDrop:t=>{t.preventDefault(),ee(e.id,null)},children:[(0,B.jsxs)(`div`,{className:`jobs-column-header`,children:[(0,B.jsx)(`strong`,{children:e.title}),(0,B.jsx)(`span`,{children:e.items.length})]}),(0,B.jsx)(`div`,{className:`jobs-column-body`,children:e.items.length?e.items.map(t=>(0,B.jsx)(`div`,{className:[`jobs-card-frame`,d===t.key?`drop-target`:``,t.key===l?`dragging`:``].filter(Boolean).join(` `),children:(0,B.jsx)(kp,{item:t,budget:A.get(t.agentKey)||null,selected:t.key===P?.key,draggable:t.kind===`job`&&t.job.source===`job`,onSelect:()=>c(e=>e===t.key?null:t.key),onDragStart:e=>{t.kind!==`job`||t.job.source!==`job`||(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t.key),u(t.key))},onDragEnd:()=>{u(null),f(null),m(null)},onDragOver:n=>{!I||I.kind!==`job`||I.job.source!==`job`||t.kind!==`job`||t.job.source!==`job`||(n.preventDefault(),n.stopPropagation(),d!==t.key&&f(t.key),p!==e.id&&m(e.id))},onDragLeave:e=>{let n=e.relatedTarget;n instanceof Node&&e.currentTarget.contains(n)||d===t.key&&f(null)},onDrop:n=>{t.kind!==`job`||t.job.source!==`job`||(n.preventDefault(),n.stopPropagation(),ee(e.id,t.job.id))}})},t.key)):(0,B.jsx)(`div`,{className:`jobs-column-empty`,children:`No jobs`})})]},e.id))}),P?(0,B.jsx)(Pp,{item:P,runtime:F,agents:v.data?.agents||[],savePending:b.isPending,onUpdate:e=>b.mutate(e)}):null]})]})}var Ip=128*1024,Lp=3e4,Rp=[{value:`off`,label:`Off`,activeTone:`is-off`},{value:`on`,label:`On`},{value:`debug`,label:`Debug`}],zp={off:{logLevel:`silent`,logRequests:!1,debugModelResponses:!1},on:{logLevel:`info`,logRequests:!1,debugModelResponses:!1},debug:{logLevel:`debug`,logRequests:!0,debugModelResponses:!0}};function Bp(e){if(e==null)return`missing`;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`],n=e/1024;for(let e of t){if(n<1024||e===t.at(-1))return`${n.toFixed(n>=10?0:1)} ${e}`;n/=1024}return`${e} B`}function Vp(e){return e.exists?e.readable?`readable`:`unreadable`:`missing`}function Hp(e,t){let n=t?.effectiveLevel??e?.ops.logLevel;return n===zp.off.logLevel?`off`:n===zp.debug.logLevel||t?.logRequests.effective===!0||t?.debugModelResponses.effective===!0||e?.ops.logRequests===!0||e?.ops.debugModelResponses===!0?`debug`:`on`}function Up(e,t){return t?t.forcedLevel?`Current mode: ${e} (forced by runtime)`:t.logRequests.envEnabled||t.debugModelResponses.envEnabled?`Current mode: ${e} (enabled by runtime flag)`:`Current mode: ${e}`:`Current mode: ${e}`}function Wp(e,t){let n=zp[t];return{...e,ops:{...e.ops,...n}}}function Gp(){let e=Gn(),t=o(),n=hs(),[r,i]=(0,R.useState)(null),a=(0,R.useRef)(null),s=y({queryKey:[`admin-logs`,e.token,r],queryFn:()=>ze(e.token,{fileId:r,tailBytes:Ip}),placeholderData:e=>e,refetchOnWindowFocus:!1}),c=y({queryKey:[`config`,e.token],queryFn:()=>Mt(e.token),refetchOnWindowFocus:!1,staleTime:Lp}),l=s.data?.logging,u=Hp(c.data?.config??null,l),d=g({mutationFn:async t=>{let n=c.data?.config;if(!n)throw Error(`Runtime config has not loaded yet.`);let r=await It(e.token,Wp(n,t)),i=await st(e.token);if(i.status!==`ok`)throw Error(i.message||`Gateway reload failed.`);return r},onSuccess:r=>{t.setQueryData([`config`,e.token],r),n.success(`Logging mode saved.`),s.refetch()},onError:e=>{n.error(`Logging mode update failed`,H(e))}}),f=s.data?.files||[],p=s.data?.selected,m=(0,R.useMemo)(()=>{let e=p?.fileId||r;return f.find(t=>t.id===e)||f.find(e=>e.readable)||f[0]||null},[f,p?.fileId,r]);return(0,R.useEffect)(()=>{!m||m.id===r||i(m.id)},[m,r]),(0,R.useEffect)(()=>{let e=a.current;!e||!p||(e.scrollTop=e.scrollHeight)},[p]),(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{description:`Gateway runtime log files`,actions:(0,B.jsx)(Z,{type:`button`,variant:`outline`,disabled:s.isFetching,onClick:()=>void s.refetch(),children:`Refresh`})}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Logging`}),(0,B.jsx)(uo,{children:c.data?Up(u,l):c.isError?`Runtime config unavailable.`:`Loading runtime config...`})]}),(0,B.jsx)(K,{children:(0,B.jsx)(Wa,{ariaLabel:`Logging mode`,value:u,options:Rp,disabled:!c.data||c.isFetching||d.isPending,onChange:e=>d.mutate(e)})})]}),(0,B.jsxs)(`div`,{className:`two-column-grid logs-layout`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Files`}),(0,B.jsx)(uo,{children:`${f.length} configured log${f.length===1?``:`s`}`})]}),(0,B.jsx)(K,{children:s.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading log files...`}):f.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No log files are configured.`}):(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:f.map(e=>(0,B.jsxs)(`button`,{className:e.id===m?.id?`selectable-row active`:`selectable-row`,type:`button`,onClick:()=>i(e.id),children:[(0,B.jsx)(`div`,{className:`session-row-main`,children:(0,B.jsx)(`strong`,{children:e.label})}),(0,B.jsx)(`span`,{className:`session-row-time`,children:Vp(e)})]},e.id))})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:m?.label||`Log tail`}),(0,B.jsx)(uo,{children:m?.description||`Select a log file.`})]}),(0,B.jsx)(K,{children:m?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Status`}),(0,B.jsx)(`strong`,{children:(0,B.jsx)(Ga,{value:m.readable,trueLabel:`readable`,falseLabel:Vp(m),falseTone:m.exists?`danger`:void 0})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Size`}),(0,B.jsx)(`strong`,{children:Bp(m.sizeBytes)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Modified`}),(0,B.jsx)(`strong`,{children:m.mtime?Qa(m.mtime):`missing`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Path`}),(0,B.jsx)(`strong`,{children:m.path})]})]}),m.error?(0,B.jsx)(`div`,{className:`empty-state error`,children:m.error}):p?(0,B.jsxs)(B.Fragment,{children:[p.truncated?(0,B.jsxs)(`p`,{className:`muted-copy`,children:[`Showing the last `,Bp(p.tailBytes),`.`]}):null,(0,B.jsx)(`pre`,{className:`log-viewer`,ref:a,children:p.content||`(empty log file)`})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`This log file is not available yet.`})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Select a log file.`})})]})]})]})}var Kp=2e3,qp=3*6e4;function Jp(e){return!e||Object.keys(e).length===0?``:JSON.stringify(e,null,2)}function Yp(e){return e?.auth===`oauth`?`oauth`:e?.headers&&Object.keys(e.headers).length>0?`headers`:`none`}function Xp(e){return{originalName:e?.name||null,name:e?.name||``,transport:e?.config.transport||`http`,enabled:e?.enabled??!0,command:e?.config.command||``,args:(e?.config.args||[]).join(`
71
- `),cwd:e?.config.cwd||``,url:e?.config.url||``,envJson:Jp(e?.config.env),authMode:e?Yp(e.config):`oauth`,headersJson:Jp(e?.config.headers)}}function Zp(e,t){let n=e.trim();if(!n)return;let r;try{r=JSON.parse(n)}catch(e){throw Error(`${t}: ${e instanceof Error?e.message:String(e)}`)}if(!r||typeof r!=`object`||Array.isArray(r))throw Error(`${t} must be a JSON object.`);return Object.fromEntries(Object.entries(r).map(([e,t])=>[e,String(t??``)]).filter(([e])=>e.trim()))}function Qp(e){return{name:e.name.trim(),config:{transport:e.transport,...e.enabled?{}:{enabled:!1},...e.transport===`stdio`?{command:e.command.trim(),args:e.args.split(`
72
- `).map(e=>e.trim()).filter(Boolean),...e.cwd.trim()?{cwd:e.cwd.trim()}:{},...e.envJson.trim()?{env:Zp(e.envJson,`Environment JSON`)}:{}}:{url:e.url.trim(),...e.authMode===`oauth`?{auth:`oauth`}:{},...e.authMode===`headers`&&e.headersJson.trim()?{headers:Zp(e.headersJson,`Headers JSON`)}:{}}}}}function $p(e){return e.state===`connected`?{label:`connected`,connected:!0}:e.state===`expired`?{label:`expired`,connected:!1}:{label:`login required`,connected:!1}}function em(e){return new Promise(t=>setTimeout(t,e))}function tm(){let e=Gn(),t=o(),n=hs(),[r,i]=(0,R.useState)(null),[a,s]=(0,R.useState)(Xp()),[c,l]=(0,R.useState)(null),u=(0,R.useRef)(!1),d=y({queryKey:[`mcp`,e.token],queryFn:()=>$t(e.token)}),f=g({mutationFn:()=>on(e.token,Qp(a)),onSuccess:r=>{t.setQueryData([`mcp`,e.token],r),i(a.name.trim()),s(Xp(r.servers.find(e=>e.name===a.name.trim()))),n.success(`Saved MCP server ${a.name.trim()}.`)},onError:e=>{n.error(`Save failed`,H(e))}}),p=g({mutationFn:()=>sn(e.token,a.name.trim()),onSuccess:r=>{t.setQueryData([`mcp`,e.token],r),i(null),s(Xp()),n.success(`MCP server deleted.`)},onError:e=>{n.error(`Delete failed`,H(e))}}),m=g({mutationFn:async()=>{u.current=!1;let n=Qp(a),r=await on(e.token,n);t.setQueryData([`mcp`,e.token],r);let i=await cn(e.token,n.name);l(i.authorizationUrl),window.open(i.authorizationUrl,`_blank`,`noopener`);let o=Date.now()+Math.max(Kp,Math.min(qp,i.expiresAt-Date.now()));for(;Date.now()<o;){if(u.current)throw Error(`Authorization cancelled.`);if(await em(Kp),(await ln(e.token,n.name)).auth.state===`connected`)return n.name}throw Error(`Timed out waiting for authorization. Complete the login in the opened tab and try again.`)},onSuccess:async r=>{l(null),await t.invalidateQueries({queryKey:[`mcp`,e.token]}),i(r),n.success(`Connected to ${r} via OAuth.`)},onError:e=>{l(null),n.error(`OAuth connection failed`,H(e))}}),h=g({mutationFn:()=>un(e.token,a.name.trim()),onSuccess:r=>{t.setQueryData([`mcp`,e.token],r),n.success(`OAuth credentials cleared.`)},onError:e=>{n.error(`Disconnect failed`,H(e))}}),_=d.data?.servers.find(e=>e.name===r)||null;(0,R.useEffect)(()=>{if(_){s(Xp(_));return}r||s(Xp())},[r,_]),(0,R.useEffect)(()=>()=>{u.current=!0},[]);let v=_?.auth,b=v?.state===`connected`;return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{actions:(0,B.jsx)(Z,{variant:`ghost`,type:`button`,onClick:()=>{i(null),s(Xp())},children:`New server`})}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Servers`}),(0,B.jsx)(uo,{children:`${d.data?.servers.length||0} configured server${d.data?.servers.length===1?``:`s`}`})]}),(0,B.jsx)(K,{children:d.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading MCP servers...`}):d.data?.servers.length?(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:d.data.servers.map(e=>{let t=e.auth.method===`oauth`?$p(e.auth):null;return(0,B.jsxs)(`button`,{className:e.name===r?`selectable-row active`:`selectable-row`,type:`button`,onClick:()=>i(e.name),children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.name}),(0,B.jsx)(`small`,{children:e.summary})]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[t?(0,B.jsx)(Ga,{value:t.connected,trueLabel:`oauth`,falseLabel:t.label,falseTone:`danger`}):null,(0,B.jsx)(Ga,{value:e.enabled,trueLabel:`active`,falseLabel:`inactive`})]})]},e.name)})}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No MCP servers are configured yet. Add a remote server with its URL and connect it with OAuth, or run a local stdio command.`})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:_?`Edit ${_.name}`:`New server`}),(0,B.jsx)(uo,{children:`Changes apply on the next agent turn.`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`stack-form`,children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Name`}),(0,B.jsx)(Y,{value:a.name,onChange:e=>s(t=>({...t,name:e.target.value})),placeholder:`github`}),(0,B.jsx)(Ho,{children:`Lowercase letters, numbers, - and _. Used as the tool prefix.`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Transport`}),(0,B.jsxs)(ds,{value:a.transport,onChange:e=>s(t=>({...t,transport:e.target.value})),children:[(0,B.jsx)(Q,{value:`http`,children:`http — remote server`}),(0,B.jsx)(Q,{value:`sse`,children:`sse — remote server (legacy)`}),(0,B.jsx)(Q,{value:`stdio`,children:`stdio — local command`})]})]})]}),(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:a.enabled,onCheckedChange:e=>s(t=>({...t,enabled:e}))}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Server state`})})]}),a.transport===`stdio`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Command`}),(0,B.jsx)(Y,{value:a.command,onChange:e=>s(t=>({...t,command:e.target.value})),placeholder:`docker`})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Arguments`}),(0,B.jsx)(Jo,{rows:4,value:a.args,onChange:e=>s(t=>({...t,args:e.target.value})),placeholder:`One argument per line`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Working directory`}),(0,B.jsx)(Y,{value:a.cwd,onChange:e=>s(t=>({...t,cwd:e.target.value})),placeholder:`/workspace`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Environment JSON`}),(0,B.jsx)(Jo,{rows:5,value:a.envJson,onChange:e=>s(t=>({...t,envJson:e.target.value})),placeholder:`{"GITHUB_TOKEN":"..."}`})]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`URL`}),(0,B.jsx)(Y,{value:a.url,onChange:e=>s(t=>({...t,url:e.target.value})),placeholder:`https://mcp.example.com/mcp`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Authentication`}),(0,B.jsxs)(ds,{value:a.authMode,onChange:e=>s(t=>({...t,authMode:e.target.value})),children:[(0,B.jsx)(Q,{value:`oauth`,children:`OAuth — log in via browser`}),(0,B.jsx)(Q,{value:`headers`,children:`Custom headers (API key / bearer token)`}),(0,B.jsx)(Q,{value:`none`,children:`None`})]}),(0,B.jsx)(Ho,{children:a.authMode===`oauth`?`The gateway discovers the authorization server, registers a client, and refreshes tokens automatically.`:a.authMode===`headers`?`Headers are sent with every request to the server.`:`Requests are sent without credentials.`})]}),a.authMode===`headers`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Headers JSON`}),(0,B.jsx)(Jo,{rows:5,value:a.headersJson,onChange:e=>s(t=>({...t,headersJson:e.target.value})),placeholder:`{"Authorization":"Bearer ..."}`})]}):null,a.authMode===`oauth`?(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsxs)(Bo,{children:[(0,B.jsx)(J,{children:`OAuth connection`}),(0,B.jsxs)(Ho,{children:[m.isPending?`Waiting for you to approve access in the browser...`:b?`Connected. Tokens refresh automatically.`:v?.state===`expired`?`The session expired. Reconnect to continue.`:`Not connected yet. Saving happens automatically when you connect.`,c&&m.isPending?(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(`a`,{href:c,target:`_blank`,rel:`noreferrer`,children:`Open the login page`}),` `,`if it did not open automatically.`]}):null]})]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{type:`button`,loading:m.isPending,disabled:m.isPending||!a.name.trim()||!a.url.trim(),onClick:()=>m.mutate(),children:m.isPending?`Waiting...`:b?`Reconnect`:`Connect`}),b?(0,B.jsx)(Z,{variant:`ghost`,type:`button`,loading:h.isPending,disabled:h.isPending,onClick:()=>h.mutate(),children:`Disconnect`}):null]})]}):null]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{type:`button`,loading:f.isPending,disabled:f.isPending,onClick:()=>f.mutate(),children:f.isPending?`Saving...`:`Save server`}),_?(0,B.jsx)(Z,{variant:`danger`,type:`button`,loading:p.isPending,disabled:p.isPending,onClick:()=>p.mutate(),children:p.isPending?`Deleting...`:`Delete server`}):null]}),_?(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsx)(`span`,{children:`Summary`}),(0,B.jsx)(`p`,{children:_.summary})]}):null]})})]})]})]})}function nm(e){return e.usageDaily!==null}function rm(e,t){let n=e.usageMonthly?.totalTokens||0,r=t.usageMonthly?.totalTokens||0;if(n!==r)return n-r;let i=e.usageMonthly?.callCount||0,a=t.usageMonthly?.callCount||0;return i===a?e.id.localeCompare(t.id):i-a}var im=[`hybridai`,`codex`,`openrouter`,`mistral`,`huggingface`,`ollama`,`lmstudio`,`llamacpp`,`vllm`];function am(e){if(e.backend)return e.backend;let t=e.id.trim().toLowerCase();return t.startsWith(`openai-codex/`)?`codex`:t.startsWith(`openrouter/`)?`openrouter`:t.startsWith(`mistral/`)?`mistral`:t.startsWith(`huggingface/`)?`huggingface`:null}function om(e,t){let n=im.indexOf(e),r=im.indexOf(t);if(n!==-1||r!==-1){if(n===-1)return 1;if(r===-1)return-1;if(n!==r)return n-r}return e.localeCompare(t)}function sm(e){let t=new Set(Object.keys(e?.providerStatus||{}));for(let n of e?.models||[]){let e=am(n);e&&t.add(e)}return[...t].sort(om).map(t=>({name:t,status:e?.providerStatus?.[t]||null}))}var cm={model:(e,t)=>X(e.id,t.id),backend:(e,t)=>X(e.backend||`remote`,t.backend||`remote`)||X(e.id,t.id),context:(e,t)=>$o(e.contextWindow,t.contextWindow)||X(e.id,t.id),monthlyUsage:rm},lm={context:`desc`,monthlyUsage:`desc`};function um(e){return{defaultModel:e?.defaultModel||``}}function dm(e){return[e.isReasoning?`reasoning`:``,e.thinkingFormat||``,e.family||``].filter(Boolean).join(` · `)}function fm(){let e=Gn(),t=o(),n=hs(),[r,i]=(0,R.useState)(``),[a,s]=(0,R.useState)(um()),c=y({queryKey:[`models`,e.token],queryFn:()=>Kt(e.token)}),l=g({mutationFn:()=>qt(e.token,{defaultModel:a.defaultModel}),onSuccess:r=>{t.setQueryData([`models`,e.token],r),s(um(r)),t.invalidateQueries({queryKey:[`overview`]}),n.success(`Default model is now ${r.defaultModel}.`)},onError:e=>{n.error(`Save failed`,H(e))}});(0,R.useEffect)(()=>{c.data&&s(e=>e.defaultModel?e:um(c.data))},[c.data]);let{sortedRows:u,sortState:d,toggleSort:f}=Ba((c.data?.models||[]).filter(e=>[e.id,e.backend||``,e.family||``,e.parameterSize||``].join(` `).toLowerCase().includes(r.trim().toLowerCase())),{initialSort:{key:`monthlyUsage`,direction:`desc`},sorters:cm,defaultDirections:lm}),p=sm(c.data),m=(c.data?.models||[]).filter(nm);return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{actions:(0,B.jsx)(Y,{className:`compact-search`,value:r,onChange:e=>i(e.target.value),placeholder:`Filter models`})}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Provider status`})}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`list-stack`,children:[p.map(({name:e,status:t})=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e}),(0,B.jsx)(`small`,{children:t?.reachable?`${t.detail||(typeof t.latencyMs==`number`?`${t.latencyMs}ms`:`ready`)} · ${t.modelCount??0} models`:t?t.error||`unreachable`:`Visible in catalog · no live health data`})]}),(0,B.jsxs)(`span`,{className:t?.reachable?`list-status list-status-success`:t?`list-status list-status-danger`:`list-status`,children:[(0,B.jsx)(`span`,{className:t?.reachable?`status-dot status-dot-success`:t?`status-dot status-dot-danger`:`status-dot`}),t?.reachable?`healthy`:t?`down`:`catalog`]})]},e)),p.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No provider health checks available.`}):null]})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Selection`})}),(0,B.jsx)(K,{children:c.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading model catalog...`}):(0,B.jsxs)(`div`,{className:`stack-form`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Default model`}),(0,B.jsxs)(ds,{value:a.defaultModel,onChange:e=>s(t=>({...t,defaultModel:e.target.value})),children:[(0,B.jsx)(Q,{value:``,children:`Select model`}),(c.data?.models||[]).map(e=>(0,B.jsx)(Q,{value:e.id,children:e.id},e.id))]})]}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:l.isPending,onClick:()=>l.mutate(),children:l.isPending?`Saving...`:`Save selection`})})]})})]})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Catalog`}),(0,B.jsx)(uo,{children:`${eo(u.length,`model`)} visible`})]}),(0,B.jsx)(K,{children:c.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading model catalog...`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Va,{label:`Model`,sortKey:`model`,sortState:d,onToggle:f}),(0,B.jsx)(Va,{label:`Backend`,sortKey:`backend`,sortState:d,onToggle:f}),(0,B.jsx)(Va,{label:`Context`,sortKey:`context`,sortState:d,onToggle:f}),(0,B.jsx)(Va,{label:`Monthly usage`,sortKey:`monthlyUsage`,sortState:d,onToggle:f})]})}),(0,B.jsxs)(`tbody`,{children:[u.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.id}),dm(e)?(0,B.jsx)(`small`,{children:dm(e)}):null]}),(0,B.jsx)(`td`,{children:e.backend||`remote`}),(0,B.jsx)(`td`,{children:e.contextWindow?Ka(e.contextWindow):`unknown`}),(0,B.jsx)(`td`,{children:e.usageMonthly?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`strong`,{children:Ka(e.usageMonthly.totalTokens)}),(0,B.jsx)(`small`,{children:Ja({inputTokens:e.usageMonthly.totalInputTokens??0,outputTokens:e.usageMonthly.totalOutputTokens??0})}),(0,B.jsxs)(`small`,{children:[Xa(e.usageMonthly.totalCostUsd),` ·`,` `,eo(e.usageMonthly.callCount,`call`)]})]}):(0,B.jsx)(`small`,{children:`No usage recorded`})})]},e.id)),u.length===0?(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{colSpan:4,children:(0,B.jsx)(`div`,{className:`empty-state`,children:`No models match this filter.`})})}):null]})]})})})]}),m.length>0?(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Recent daily activity`}),(0,B.jsx)(uo,{children:`Updated ${Za(new Date().toISOString())}`})]}),(0,B.jsx)(K,{children:(0,B.jsx)(`div`,{className:`list-stack`,children:m.sort((e,t)=>t.usageDaily.totalTokens-e.usageDaily.totalTokens).slice(0,6).map(e=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.id}),(0,B.jsxs)(`small`,{children:[Ja({inputTokens:e.usageDaily.totalInputTokens??0,outputTokens:e.usageDaily.totalOutputTokens??0}),` `,`· `,eo(e.usageDaily.callCount,`call`),` today`]})]}),(0,B.jsx)(`span`,{children:Xa(e.usageDaily.totalCostUsd??0)})]},`${e.id}-daily`))})})]}):null]})}var pm={root:`_root_16nbt_1`,viewport:`_viewport_16nbt_10`,scrollbar:`_scrollbar_16nbt_29`,thumb:`_thumb_16nbt_55`},mm=(0,R.createContext)(null);function hm(e){let t=(0,R.useContext)(mm);if(!t)throw Error(`${e} must be used within <ScrollArea>`);return t}function gm({className:e,children:t,...n}){let r=(0,R.useRef)(null),i=(0,R.useRef)(null),[a,o]=(0,R.useState)({thumbSize:0,thumbOffset:0,visible:!1}),s=(0,R.useCallback)(()=>{let e=r.current,t=i.current;if(!e||!t){o(e=>e.visible?{...e,visible:!1}:e);return}let{scrollTop:n,scrollHeight:a,clientHeight:s}=e;if(a<=s+1){o(e=>e.visible?{...e,visible:!1}:e);return}let c=t.clientHeight;if(c<=0)return;let l=s/a,u=Math.max(20,c*l),d=a-s,f=c-u,p=d<=0?0:n/d*f;o(e=>e.visible&&e.thumbSize===u&&e.thumbOffset===p?e:{thumbSize:u,thumbOffset:p,visible:!0})},[]),c=(0,R.useCallback)(e=>{r.current=e,requestAnimationFrame(s)},[s]),l=(0,R.useCallback)(e=>{i.current=e,requestAnimationFrame(s)},[s]);(0,R.useLayoutEffect)(()=>{let e=r.current;if(!e)return;s();let t=0,n=()=>{t||=requestAnimationFrame(()=>{t=0,s()})};e.addEventListener(`scroll`,n,{passive:!0});let a=new ResizeObserver(()=>s());return a.observe(e),e.firstElementChild&&a.observe(e.firstElementChild),i.current&&a.observe(i.current),()=>{t&&cancelAnimationFrame(t),e.removeEventListener(`scroll`,n),a.disconnect()}},[s]);let u={viewportRef:r,setViewportEl:c,scrollState:a,registerScrollbarTrack:l};return(0,B.jsx)(mm.Provider,{value:u,children:(0,B.jsx)(`div`,{className:V(pm.root,e),...n,children:t})})}function _m({className:e,children:t,ref:n,...r}){let i=hm(`ScrollAreaViewport`);return(0,B.jsx)(`div`,{ref:e=>{i.setViewportEl(e),typeof n==`function`?n(e):n&&typeof n==`object`&&(n.current=e)},className:V(pm.viewport,e),...r,children:t})}function vm({className:e,children:t,...n}){let r=hm(`ScrollAreaScrollbar`);return(0,B.jsx)(`div`,{ref:r.registerScrollbarTrack,"data-orientation":`vertical`,"data-state":r.scrollState.visible?`visible`:`hidden`,"aria-hidden":`true`,className:V(pm.scrollbar,e),...n,children:t})}function ym({className:e,...t}){let n=hm(`ScrollAreaThumb`),{thumbSize:r,thumbOffset:i}=n.scrollState;return(0,B.jsx)(`div`,{className:V(pm.thumb,e),style:{height:r,transform:`translateY(${i}px)`},onPointerDown:e=>{if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=n.viewportRef.current,i=e.currentTarget.parentElement??null;if(!t||!i)return;let a=e.clientY,o=t.scrollTop,s=i.clientHeight,c=t.scrollHeight-t.clientHeight,l=Math.max(1,s-r),u=e=>{t.scrollTop=o+(e.clientY-a)/l*c},d=()=>{window.removeEventListener(`pointermove`,u),window.removeEventListener(`pointerup`,d),window.removeEventListener(`pointercancel`,d)};window.addEventListener(`pointermove`,u),window.addEventListener(`pointerup`,d),window.addEventListener(`pointercancel`,d)},...t})}var bm={trigger:`_trigger_1fi1d_1`,value:`_value_1fi1d_40`,icon:`_icon_1fi1d_52`,popup:`_popup_1fi1d_66`,"select-in":`_select-in_1fi1d_1`,popupHeader:`_popupHeader_1fi1d_111`,popupBodyPlain:`_popupBodyPlain_1fi1d_117`,popupBody:`_popupBody_1fi1d_117`,popupRail:`_popupRail_1fi1d_131`,listScroll:`_listScroll_1fi1d_151`,list:`_list_1fi1d_151`,group:`_group_1fi1d_168`,groupLabel:`_groupLabel_1fi1d_176`,separator:`_separator_1fi1d_184`,empty:`_empty_1fi1d_190`,item:`_item_1fi1d_197`,itemIndicator:`_itemIndicator_1fi1d_214`,itemText:`_itemText_1fi1d_248`,itemBody:`_itemBody_1fi1d_256`,itemSubtitle:`_itemSubtitle_1fi1d_272`,itemMeta:`_itemMeta_1fi1d_279`},xm=(0,R.createContext)(null);function Sm(e){let t=(0,R.useContext)(xm);if(!t)throw Error(`${e} must be used within <Select>`);return t}function Cm({value:e,defaultValue:t=``,onValueChange:n,open:r,defaultOpen:i,onOpenChange:a,disabled:o=!1,children:s}){let c=e!==void 0,[l,u]=(0,R.useState)(t),d=c?e:l,[f,p]=(0,R.useState)(null),[m,h]=(0,R.useState)(null),g=(0,R.useId)(),_=(0,R.useId)(),v=(0,R.useCallback)(e=>{c||u(e),n?.(e)},[c,n]),y=(0,R.useCallback)(e=>`${_}-item-${Lm(e)}`,[_]),b=(0,R.useMemo)(()=>({value:d,selectValue:v,listEl:f,setListEl:p,listId:g,highlightedValue:m,setHighlightedValue:h,disabled:o,getItemId:y}),[d,v,f,g,m,o,y]);return(0,B.jsx)(Oi,{open:r,defaultOpen:i,onOpenChange:(0,R.useCallback)(e=>{o&&e||(e||h(null),a?.(e))},[o,a]),children:(0,B.jsx)(xm.Provider,{value:b,children:s})})}function wm({children:e,className:t,onClick:n,onKeyDown:r,...i}){let a=Di(`SelectTrigger`),o=Sm(`SelectTrigger`);return(0,B.jsx)(`button`,{ref:a.setTriggerEl,type:`button`,role:`combobox`,"aria-haspopup":`listbox`,"aria-expanded":a.open,"aria-controls":a.open?o.listId:void 0,"aria-disabled":o.disabled||void 0,"data-state":a.open?`open`:`closed`,"data-disabled":o.disabled?``:void 0,disabled:o.disabled,className:V(bm.trigger,t),onClick:e=>{n?.(e),!e.defaultPrevented&&(a.open||o.setHighlightedValue(o.value||null),a.toggle())},onKeyDown:e=>{r?.(e),!e.defaultPrevented&&(e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o.setHighlightedValue(o.value||null),a.setOpen(!0))},...i,children:e})}function Tm({placeholder:e,children:t,className:n,...r}){let i=Sm(`SelectValue`),a=t==null||t===``||i.value===``;return(0,B.jsx)(`span`,{className:V(bm.value,n),"data-placeholder":a?``:void 0,...r,children:a?e:t})}function Em({className:e,children:t,...n}){return(0,B.jsx)(`span`,{"aria-hidden":`true`,className:V(bm.icon,e),...n,children:t??(0,B.jsx)(er,{width:14,height:14})})}var Dm=e=>{let t=e.querySelector(`input`);if(t){t.focus();return}e.querySelector(`[role="listbox"]`)?.focus()};function Om({align:e=`start`,sideOffset:t=6,header:n,rail:r,children:i,className:a,...o}){let s=Di(`SelectContent`),c=Sm(`SelectContent`),l=(0,R.useRef)({buffer:``,timer:0}),u=n!=null&&n!==!1,d=r!=null&&r!==!1;(0,R.useEffect)(()=>{let e=s.contentEl;if(!s.open||!e||!c.highlightedValue)return;let t=c.getItemId(c.highlightedValue);e.querySelector(`#${Rm(t)}`)?.scrollIntoView({block:`nearest`})},[s.open,s.contentEl,c.highlightedValue,c.getItemId]),(0,R.useEffect)(()=>{let e=l.current;return()=>{e.timer&&window.clearTimeout(e.timer)}},[]);let f=(0,R.useCallback)(()=>c.listEl?Array.from(c.listEl.querySelectorAll(`[role="option"]:not([aria-disabled="true"])`)):[],[c.listEl]),p=(0,R.useCallback)(e=>{let t=f();if(t.length===0)return;let n=c.highlightedValue?t.findIndex(e=>e.getAttribute(`data-value`)===c.highlightedValue):-1,r;r=e===`first`?0:e===`last`?t.length-1:n<0?e>0?0:t.length-1:(n+e+t.length)%t.length;let i=t[r],a=i?.getAttribute(`data-value`)??null;c.setHighlightedValue(a),i?.scrollIntoView({block:`nearest`})},[f,c.highlightedValue,c.setHighlightedValue]),m=e=>{let t=l.current;t.buffer+=e.toLowerCase(),t.timer&&window.clearTimeout(t.timer),t.timer=window.setTimeout(()=>{t.buffer=``,t.timer=0},500);let n=f();if(n.length===0)return;let r=c.highlightedValue?n.findIndex(e=>e.getAttribute(`data-value`)===c.highlightedValue):-1,i=[...n.slice(r+1),...n.slice(0,r+1)].find(e=>(e.textContent??``).trim().toLowerCase().startsWith(t.buffer));if(i){let e=i.getAttribute(`data-value`);c.setHighlightedValue(e),i.scrollIntoView({block:`nearest`})}},h=e=>{if(e.key===`Tab`){s.setOpen(!1);return}if(e.key===`ArrowDown`){e.preventDefault(),p(1);return}if(e.key===`ArrowUp`){e.preventDefault(),p(-1);return}if(e.key===`Home`){e.preventDefault(),p(`first`);return}if(e.key===`End`){e.preventDefault(),p(`last`);return}if(e.key===`Enter`){if(c.highlightedValue==null)return;e.preventDefault(),c.selectValue(c.highlightedValue),s.setOpen(!1),s.triggerEl?.focus();return}if(!u&&e.key===` `&&c.highlightedValue!=null){e.preventDefault(),c.selectValue(c.highlightedValue),s.setOpen(!1),s.triggerEl?.focus();return}!u&&e.key.length===1&&!e.ctrlKey&&!e.metaKey&&m(e.key)},g=c.highlightedValue?c.getItemId(c.highlightedValue):void 0;return(0,B.jsxs)(Ai,{align:e,sideOffset:t,focusOnOpen:Dm,className:V(bm.popup,a),onKeyDown:h,...o,children:[u?(0,B.jsx)(`div`,{className:bm.popupHeader,children:n}):null,(0,B.jsxs)(`div`,{className:d?bm.popupBody:bm.popupBodyPlain,children:[d?(0,B.jsx)(`div`,{className:bm.popupRail,children:r}):null,(0,B.jsxs)(gm,{className:bm.listScroll,children:[(0,B.jsx)(_m,{ref:c.setListEl,id:c.listId,role:`listbox`,tabIndex:-1,"aria-activedescendant":g,className:bm.list,children:i}),(0,B.jsx)(vm,{children:(0,B.jsx)(ym,{})})]})]})]})}function km({className:e,children:t,...n}){return(0,B.jsx)(`div`,{role:`group`,className:V(bm.group,e),...n,children:t})}function Am({className:e,children:t,...n}){return(0,B.jsx)(`div`,{className:V(bm.groupLabel,e),...n,children:t})}function jm({className:e,children:t,...n}){return(0,B.jsx)(`div`,{className:V(bm.empty,e),...n,children:t})}function Mm({value:e,disabled:t=!1,textValue:n,children:r,className:i,onClick:a,onPointerEnter:o,...s}){let c=Di(`SelectItem`),l=Sm(`SelectItem`),u=l.value===e,d=l.highlightedValue===e;return(0,B.jsx)(`div`,{id:l.getItemId(e),role:`option`,"aria-selected":u,"aria-disabled":t||void 0,"aria-label":n,"data-value":e,"data-state":u?`checked`:`unchecked`,"data-highlighted":d?``:void 0,"data-disabled":t?``:void 0,className:V(bm.item,i),onClick:n=>{t||(a?.(n),!n.defaultPrevented&&(l.selectValue(e),c.setOpen(!1),c.triggerEl?.focus()))},onPointerEnter:n=>{o?.(n),!n.defaultPrevented&&(t||l.setHighlightedValue(e))},...s,children:r})}function Nm({className:e,children:t,...n}){return(0,B.jsx)(`span`,{className:V(bm.itemText,e),...n,children:t})}function Pm({className:e,children:t,...n}){return(0,B.jsx)(`span`,{className:V(bm.itemBody,e),...n,children:t})}function Fm({className:e,children:t,...n}){return(0,B.jsx)(`span`,{className:V(bm.itemSubtitle,e),...n,children:t})}function Im({className:e,children:t,...n}){return(0,B.jsx)(`span`,{className:V(bm.itemMeta,e),...n,children:t})}function Lm(e){return e.replace(/[^a-zA-Z0-9_-]/g,`_`)}function Rm(e){return typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,`\\$&`)}var zm={chatPage:`_chatPage_dvf42_1`,chatSidebarHeader:`_chatSidebarHeader_dvf42_36`,chatSidebarContent:`_chatSidebarContent_dvf42_44`,newChatButton:`_newChatButton_dvf42_52`,navLinkIcon:`_navLinkIcon_dvf42_82`,appPreviewDialog:`_appPreviewDialog_dvf42_92`,appPreviewHeader:`_appPreviewHeader_dvf42_102`,appPreviewTitle:`_appPreviewTitle_dvf42_111`,appPreviewActions:`_appPreviewActions_dvf42_120`,appPreviewLink:`_appPreviewLink_dvf42_127`,appPreviewFrame:`_appPreviewFrame_dvf42_145`,sidebarLabel:`_sidebarLabel_dvf42_152`,sidebarListHeader:`_sidebarListHeader_dvf42_162`,sidebarScopeToggle:`_sidebarScopeToggle_dvf42_169`,sidebarScopeButton:`_sidebarScopeButton_dvf42_178`,sidebarScopeButtonActive:`_sidebarScopeButtonActive_dvf42_200`,sessionList:`_sessionList_dvf42_213`,sessionItemRow:`_sessionItemRow_dvf42_222`,sessionItem:`_sessionItem_dvf42_222`,sessionItemPending:`_sessionItemPending_dvf42_253`,sessionPulse:`_sessionPulse_dvf42_1`,sessionTitle:`_sessionTitle_dvf42_267`,sessionTime:`_sessionTime_dvf42_276`,sessionSnippet:`_sessionSnippet_dvf42_281`,sessionItemActive:`_sessionItemActive_dvf42_289`,sessionDeleteButton:`_sessionDeleteButton_dvf42_294`,sessionDeleteIcon:`_sessionDeleteIcon_dvf42_330`,sidebarSearchWrap:`_sidebarSearchWrap_dvf42_343`,sidebarSearch:`_sidebarSearch_dvf42_343`,sidebarStatus:`_sidebarStatus_dvf42_367`,chatMobileTrigger:`_chatMobileTrigger_dvf42_386`,chatTopbar:`_chatTopbar_dvf42_391`,mobileQrButton:`_mobileQrButton_dvf42_405`,mobileQrIcon:`_mobileQrIcon_dvf42_429`,mobileQrOverlay:`_mobileQrOverlay_dvf42_441`,mobileQrDialog:`_mobileQrDialog_dvf42_452`,mobileQrHeader:`_mobileQrHeader_dvf42_461`,mobileQrClose:`_mobileQrClose_dvf42_475`,mobileQrImage:`_mobileQrImage_dvf42_488`,mobileQrLink:`_mobileQrLink_dvf42_502`,chatMain:`_chatMain_dvf42_511`,messageArea:`_messageArea_dvf42_523`,messageList:`_messageList_dvf42_536`,sidebarCollapseButton:`_sidebarCollapseButton_dvf42_545`,emptyState:`_emptyState_dvf42_549`,greeting:`_greeting_dvf42_559`,messageBlock:`_messageBlock_dvf42_568`,jumpToLatest:`_jumpToLatest_dvf42_580`,messageBlockUser:`_messageBlockUser_dvf42_616`,messageBlockAssistant:`_messageBlockAssistant_dvf42_620`,messageBlockSystem:`_messageBlockSystem_dvf42_621`,agentLabel:`_agentLabel_dvf42_625`,agentAvatar:`_agentAvatar_dvf42_635`,agentInitial:`_agentInitial_dvf42_642`,bubble:`_bubble_dvf42_655`,bubbleUser:`_bubbleUser_dvf42_666`,userAgentMentionPill:`_userAgentMentionPill_dvf42_673`,userAgentMentionAvatar:`_userAgentMentionAvatar_dvf42_694`,userSkillCommandLink:`_userSkillCommandLink_dvf42_702`,bubbleAssistant:`_bubbleAssistant_dvf42_714`,bubbleApproval:`_bubbleApproval_dvf42_722`,bubbleSystem:`_bubbleSystem_dvf42_736`,bubbleCommand:`_bubbleCommand_dvf42_748`,markdownContent:`_markdownContent_dvf42_775`,codeCopyButton:`_codeCopyButton_dvf42_854`,codeCopyButtonDone:`_codeCopyButtonDone_dvf42_882`,codeBlockLabeled:`_codeBlockLabeled_dvf42_890`,codeLangLabel:`_codeLangLabel_dvf42_894`,messageActions:`_messageActions_dvf42_1054`,actionButton:`_actionButton_dvf42_1060`,actionButtonSelected:`_actionButtonSelected_dvf42_1079`,actionButtonSuccess:`_actionButtonSuccess_dvf42_1084`,branchSwitcher:`_branchSwitcher_dvf42_1088`,branchButton:`_branchButton_dvf42_1097`,approvalCard:`_approvalCard_dvf42_1115`,approvalHeader:`_approvalHeader_dvf42_1122`,approvalTier:`_approvalTier_dvf42_1129`,approvalTitle:`_approvalTitle_dvf42_1147`,approvalIntro:`_approvalIntro_dvf42_1154`,approvalDetails:`_approvalDetails_dvf42_1160`,approvalDetailRow:`_approvalDetailRow_dvf42_1166`,approvalPrimaryActions:`_approvalPrimaryActions_dvf42_1189`,approvalTrustActions:`_approvalTrustActions_dvf42_1190`,approvalAllow:`_approvalAllow_dvf42_1205`,artifactCard:`_artifactCard_dvf42_1211`,artifactCardWithPreview:`_artifactCardWithPreview_dvf42_1225`,artifactHeader:`_artifactHeader_dvf42_1230`,artifactFilename:`_artifactFilename_dvf42_1237`,artifactBadge:`_artifactBadge_dvf42_1247`,artifactDownload:`_artifactDownload_dvf42_1257`,artifactPreview:`_artifactPreview_dvf42_1279`,artifactPdfPreview:`_artifactPdfPreview_dvf42_1291`,artifactVideoPreview:`_artifactVideoPreview_dvf42_1307`,thinking:`_thinking_dvf42_1320`,thinkingDot:`_thinkingDot_dvf42_1327`,thinkingBounce:`_thinkingBounce_dvf42_1`,traceSequence:`_traceSequence_dvf42_1358`,traceBlock:`_traceBlock_dvf42_1367`,traceHeader:`_traceHeader_dvf42_1374`,traceChevron:`_traceChevron_dvf42_1395`,traceChevronOpen:`_traceChevronOpen_dvf42_1404`,traceSummary:`_traceSummary_dvf42_1408`,traceSummaryLive:`_traceSummaryLive_dvf42_1413`,tracePulse:`_tracePulse_dvf42_1`,traceSteps:`_traceSteps_dvf42_1427`,traceStep:`_traceStep_dvf42_1427`,traceStepMarker:`_traceStepMarker_dvf42_1446`,traceDot:`_traceDot_dvf42_1455`,traceDotRunning:`_traceDotRunning_dvf42_1462`,traceStepBody:`_traceStepBody_dvf42_1467`,traceToolLine:`_traceToolLine_dvf42_1475`,traceToolName:`_traceToolName_dvf42_1482`,traceToolPreview:`_traceToolPreview_dvf42_1487`,traceToolDuration:`_traceToolDuration_dvf42_1498`,traceToolResult:`_traceToolResult_dvf42_1505`,traceThinkingText:`_traceThinkingText_dvf42_1514`,traceDraftInterim:`_traceDraftInterim_dvf42_1523`,composerWrapper:`_composerWrapper_dvf42_1540`,composer:`_composer_dvf42_1540`,pendingMediaRow:`_pendingMediaRow_dvf42_1564`,mediaChip:`_mediaChip_dvf42_1571`,mediaChipName:`_mediaChipName_dvf42_1583`,mediaChipRemove:`_mediaChipRemove_dvf42_1589`,composerRow:`_composerRow_dvf42_1608`,composerActions:`_composerActions_dvf42_1615`,composerLeftActions:`_composerLeftActions_dvf42_1622`,composerInputWrap:`_composerInputWrap_dvf42_1629`,composerInputOverlay:`_composerInputOverlay_dvf42_1635`,composerOverlayCaret:`_composerOverlayCaret_dvf42_1648`,composerMentionPill:`_composerMentionPill_dvf42_1661`,composerMentionAvatar:`_composerMentionAvatar_dvf42_1681`,composerInput:`_composerInput_dvf42_1629`,composerInputHasOverlay:`_composerInputHasOverlay_dvf42_1706`,attachButton:`_attachButton_dvf42_1720`,sendButton:`_sendButton_dvf42_1721`,composerPill:`_composerPill_dvf42_1755`,agentSelectPopup:`_agentSelectPopup_dvf42_1795`,agentSelectItem:`_agentSelectItem_dvf42_1801`,remoteAgentGroupLabel:`_remoteAgentGroupLabel_dvf42_1805`,remoteAgentGroupIcon:`_remoteAgentGroupIcon_dvf42_1811`,agentSelectItemText:`_agentSelectItemText_dvf42_1816`,agentSelectAvatar:`_agentSelectAvatar_dvf42_1823`,agentSelectAvatarLoading:`_agentSelectAvatarLoading_dvf42_1824`,composerPillChevron:`_composerPillChevron_dvf42_1839`,stopping:`_stopping_dvf42_1869`,slashSuggestions:`_slashSuggestions_dvf42_1874`,slashSuggestionsScroll:`_slashSuggestionsScroll_dvf42_1882`,slashSuggestionsList:`_slashSuggestionsList_dvf42_1886`,suggestionItem:`_suggestionItem_dvf42_1890`,suggestionItemAgent:`_suggestionItemAgent_dvf42_1905`,suggestionItemActive:`_suggestionItemActive_dvf42_1912`,suggestionItemSub:`_suggestionItemSub_dvf42_1917`,suggestionLabel:`_suggestionLabel_dvf42_1921`,suggestionText:`_suggestionText_dvf42_1931`,suggestionAvatar:`_suggestionAvatar_dvf42_1938`,suggestionAvatarLoading:`_suggestionAvatarLoading_dvf42_1939`,suggestionLabelMono:`_suggestionLabelMono_dvf42_1954`,suggestionMatch:`_suggestionMatch_dvf42_1960`,suggestionDesc:`_suggestionDesc_dvf42_1969`,suggestionEmpty:`_suggestionEmpty_dvf42_1977`,slashLiveRegion:`_slashLiveRegion_dvf42_1983 _srOnly_jfnet_1`,errorBanner:`_errorBanner_dvf42_1999`,errorBannerFadeIn:`_errorBannerFadeIn_dvf42_1`,errorBannerExiting:`_errorBannerExiting_dvf42_2014`,errorBannerFadeOut:`_errorBannerFadeOut_dvf42_1`,editArea:`_editArea_dvf42_2030`,editButtons:`_editButtons_dvf42_2045`},Bm={search:`_search_12ewc_1`,searchInput:`_searchInput_12ewc_17`,rail:`_rail_12ewc_33`,railItem:`_railItem_12ewc_37`,railGlyph:`_railGlyph_12ewc_70`,triggerPill:`_triggerPill_12ewc_90`,triggerLogo:`_triggerLogo_12ewc_105`,itemLogo:`_itemLogo_12ewc_114`},Vm={hybridai:`HybridAI`,codex:`OpenAI Codex`,anthropic:`Anthropic`,openrouter:`OpenRouter`,mistral:`Mistral`,huggingface:`Hugging Face`,gemini:`Gemini`,deepseek:`DeepSeek`,xai:`xAI`,zai:`Z.ai`,kimi:`Kimi`,minimax:`MiniMax`,dashscope:`DashScope`,xiaomi:`Xiaomi`,kilo:`Kilo`,ollama:`Ollama`,lmstudio:`LM Studio`,llamacpp:`llama.cpp`,vllm:`vLLM`},Hm={anthropic:`Anthropic`,google:`Google`,openai:`OpenAI`,mistral:`Mistral`,meta:`Meta`,deepseek:`DeepSeek`,xai:`xAI`},Um={Local:0,HybridAI:1,"OpenAI Codex":2},Wm={Anthropic:1,OpenAI:2,Google:3,Mistral:4,Meta:5};function Gm(e,t){let n=e.toLowerCase();return t[n]?t[n]:e.split(/[-_]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}var Km=new Set([`gpt`,`ai`,`ml`,`vl`,`ui`,`pdf`,`sdk`,`api`]),qm={deepseek:`DeepSeek`,openai:`OpenAI`,hybridai:`HybridAI`},Jm=/^[a-z]\d+$/;function Ym(e){let t=e.toLowerCase();return Km.has(t)?t.toUpperCase():qm[t]?qm[t]:Jm.test(t)?t:t.charAt(0).toUpperCase()+t.slice(1)}function Xm(e){if(!e)return e;let t=e.split(`-`).filter(e=>!/^\d{5,}$/.test(e)),n=[],r=null,i=0;for(;i<t.length;){let e=t[i],a,o=!1;if(/^\d+$/.test(e)){let n=[e];for(;i+1<t.length&&/^\d+$/.test(t[i+1]);)i++,n.push(t[i]);a=n.join(`.`),o=!0}else a=Ym(e),o=/^\d/.test(e);if(o&&r&&Km.has(r)){let e=n.pop()??``;n.push(e?`${e}-${a}`:a)}else n.push(a);r=t[i].toLowerCase(),i++}return n.join(` `)}function Zm(e){return e.provider}function Qm(e){let t=e.split(`/`,1)[0]?.trim().toLowerCase()??``;return t===`openai-codex`?`codex`:t&&Vm[t]?t:`hybridai`}function $m(e){return e===`ollama`?`ollama`:e===`lmstudio`?`lmstudio`:e===`llamacpp`?`llamacpp`:e===`vllm`?`vllm`:null}function eh(e){let t=e.trim();if(!t)return null;let n=Qm(t);return{id:t,provider:n,backend:$m(n),contextWindow:null,isReasoning:!1,family:null,parameterSize:null}}var th={HybridAI:Pu,"OpenAI Codex":Xu,Anthropic:Iu,OpenRouter:Ku,Mistral:Hu,"Hugging Face":Gu,Gemini:Ru,DeepSeek:Vu,xAI:Wu,"Z.ai":Zu,Kimi:Qu,MiniMax:$u,DashScope:ed,Xiaomi:td,Kilo:nd,Ollama:Ju,"LM Studio":rd,"llama.cpp":id,vLLM:ad,Local:gr},nh={Anthropic:Iu,OpenAI:Lu,Google:zu,Mistral:Hu,Meta:Uu,DeepSeek:Vu,xAI:Wu,Alibaba:od,Microsoft:qu};function rh({provider:e,size:t=18}){let n=th[e];return n?(0,B.jsx)(n,{width:t,height:t}):(0,B.jsx)(Or,{width:t,height:t})}function ih({vendor:e,fallbackProvider:t,size:n=18}){let r=e?nh[e]:void 0;return r?(0,B.jsx)(r,{width:n,height:n}):(0,B.jsx)(rh,{provider:t,size:n})}function ah({value:e,onValueChange:t,className:n,placeholder:r=`Search…`,...i}){return(0,B.jsxs)(`div`,{className:V(Bm.search,n),children:[(0,B.jsx)(Er,{width:`14`,height:`14`}),(0,B.jsx)(`input`,{type:`text`,autoComplete:`off`,spellCheck:!1,className:Bm.searchInput,placeholder:r,value:e,onChange:e=>t(e.target.value),...i})]})}function oh({children:e}){return(0,B.jsx)(`div`,{role:`toolbar`,"aria-orientation":`vertical`,className:Bm.rail,children:e})}function sh({active:e=!1,label:t,color:n,icon:r,className:i,...a}){return(0,B.jsx)(`button`,{type:`button`,"aria-pressed":e,"aria-label":t,title:t,"data-active":e?``:void 0,className:V(Bm.railItem,i),...a,children:(0,B.jsx)(`span`,{"aria-hidden":`true`,className:Bm.railGlyph,style:n?{color:n}:void 0,children:r??t.charAt(0).toUpperCase()})})}var ch=[[`claude`,`Anthropic`],[`gpt`,`OpenAI`],[`o1`,`OpenAI`],[`o3`,`OpenAI`],[`o4`,`OpenAI`],[`gemini`,`Google`],[`mistral`,`Mistral`],[`grok`,`xAI`],[`llama`,`Meta`],[`codellama`,`Meta`],[`deepseek`,`DeepSeek`],[`qwen`,`Alibaba`],[`phi`,`Microsoft`]];function lh(e){let t=e.toLowerCase();return ch.find(([e])=>t.startsWith(e))?.[1]??null}function uh(e,t){if(!t.backend||e.length<2)return null;let n=e[0]?.trim();return n?n.toLowerCase()===t.backend?Gm(t.backend,Vm):n:null}function dh(e){let t=e.id,n=t.split(`/`),r=Gm(e.provider,Vm),i,a;return n.length===1?(i=lh(n[0]),a=n[0]):n.length===2?(i=lh(n[1]),a=n[1]):(i=Gm(n[1],Hm),a=n.slice(2).join(`/`)),{id:t,groupLabel:i?`${r} · ${i}`:r,providerRank:Um[r]??50,vendorRank:i?Wm[i]??50:0,routeLabel:uh(n,e),shortName:a,displayName:Xm(a),vendor:i,provider:r,meta:e}}function fh(e,t){return e.providerRank===t.providerRank?e.vendorRank===t.vendorRank?e.groupLabel.localeCompare(t.groupLabel):e.vendorRank-t.vendorRank:e.providerRank-t.providerRank}function ph(e){return!e||e<=0?null:Ka(e)}function mh(e){let t=e.meta.family,n=t&&t!==e.shortName?Xm(t):null,r=[e.routeLabel,e.meta.parameterSize?.trim()||null,n&&n!==e.displayName?n:null,e.vendor].filter(e=>!!e);return r.length===0?null:r.join(` · `)}function hh(e,t){if(!t)return!0;let n=[e.id,e.shortName,e.displayName,e.provider,e.routeLabel??``,e.vendor??``,e.groupLabel].join(` `).toLowerCase();return t.toLowerCase().split(/\s+/).filter(Boolean).every(e=>n.includes(e))}function gh(e){let[t,n]=(0,R.useState)(``),[r,i]=(0,R.useState)(null),a=(0,R.useMemo)(()=>e.models.map(dh),[e.models]),o=(0,R.useMemo)(()=>{let e=new Map;for(let t of a){let n=Zm(t);e.set(n,(e.get(n)??0)+1)}return Array.from(e.entries()).map(([e,t])=>({key:e,count:t})).sort((e,t)=>e.key.localeCompare(t.key))},[a]),s=(0,R.useMemo)(()=>{let e=a.filter(e=>!(!hh(e,t)||r&&Zm(e)!==r)),n=new Map;for(let t of e){let e=n.get(t.groupLabel);e||(e={head:t,items:[]},n.set(t.groupLabel,e)),e.items.push(t)}let i=Array.from(n.values()).sort((e,t)=>fh(e.head,t.head));for(let e of i)e.items.sort((e,t)=>e.shortName.localeCompare(t.shortName)||(e.routeLabel??``).localeCompare(t.routeLabel??``)||e.id.localeCompare(t.id));return i},[a,t,r]),c=e.selectedModelId.trim(),l=eh(c),u=a.find(e=>e.id===c)??(l?dh(l):void 0);return e.models.length===0&&!u?null:(0,B.jsxs)(Cm,{value:u?u.id:``,disabled:e.disabled,onValueChange:t=>{!t||t===c||e.onSwitch(t)},children:[(0,B.jsxs)(wm,{"aria-label":`Switch model`,title:`Switch model`,className:V(zm.composerPill,Bm.triggerPill),children:[u?(0,B.jsx)(`span`,{"aria-hidden":`true`,className:Bm.triggerLogo,children:(0,B.jsx)(ih,{vendor:u.vendor,fallbackProvider:u.provider,size:16})}):null,(0,B.jsx)(Tm,{placeholder:`Select model`,children:u?u.displayName:``}),(0,B.jsx)(Em,{})]}),(0,B.jsx)(Om,{align:`start`,header:(0,B.jsx)(ah,{value:t,onValueChange:n,placeholder:`Search models…`,"aria-label":`Search models`}),rail:(0,B.jsxs)(oh,{children:[(0,B.jsx)(sh,{label:r===null?`All providers`:`Clear filter`,active:r===null,icon:(0,B.jsx)(yr,{width:`16`,height:`16`}),onClick:()=>i(null)}),o.map(({key:e,count:t})=>(0,B.jsx)(sh,{label:`${e} (${t})`,active:r===e,icon:(0,B.jsx)(rh,{provider:e}),onClick:()=>i(t=>t===e?null:e)},e))]}),children:s.length===0?(0,B.jsxs)(jm,{children:[`No models match “`,t,`”.`]}):s.map(e=>(0,B.jsxs)(km,{children:[(0,B.jsx)(Am,{children:e.head.groupLabel}),e.items.map(e=>{let t=ph(e.meta.contextWindow),n=mh(e);return(0,B.jsxs)(Mm,{value:e.id,textValue:`${e.displayName} ${e.groupLabel} ${e.routeLabel??``}`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:Bm.itemLogo,children:(0,B.jsx)(ih,{vendor:e.vendor,fallbackProvider:e.provider,size:18})}),(0,B.jsxs)(Pm,{children:[(0,B.jsx)(Nm,{children:e.displayName}),n?(0,B.jsx)(Fm,{children:n}):null]}),(0,B.jsx)(Im,{children:t?(0,B.jsx)(`span`,{children:t}):null})]},e.id)})]},e.head.groupLabel))})]})}var _h={enabled:!1,mode:`rewrite`,policy:``,doList:[],dontList:[],bannedPhrases:[],bannedPatterns:[],requirePhrases:[],classifier:{provider:`default`,model:``},rewriter:{provider:`default`,model:``}};function vh(e,t){return JSON.stringify(e)===JSON.stringify(t)}function yh(e,t=``){return{provider:e,model:e===`model`?t.trim():``}}function bh(e,t){let n=e?.trim()??``;if(!n)return``;let r=t.find(e=>e.id===n);return r?dh(r).displayName:n}function xh(e){let t=e=>e.map(e=>e.trim()).filter(Boolean);return{...e,policy:e.policy.trim(),doList:t(e.doList),dontList:t(e.dontList),bannedPhrases:t(e.bannedPhrases),bannedPatterns:t(e.bannedPatterns),requirePhrases:t(e.requirePhrases),classifier:yh(e.classifier.provider,e.classifier.model),rewriter:yh(e.rewriter.provider,e.rewriter.model)}}function Sh(e){let t=(0,R.useRef)(0),n=(0,R.useCallback)(n=>{let r={id:`${e.label}-${t.current}`,value:n};return t.current+=1,r},[e.label]),[r,i]=(0,R.useState)(()=>e.values.map(n)),a=t=>{i(t),e.onChange(t.map(e=>e.value))};return(0,R.useEffect)(()=>{i(t=>e.values.map((e,r)=>{if(t[r]?.value===e)return t[r];let i=t[r];return i?{...i,value:e}:n(e)}))},[n,e.values]),(0,B.jsxs)(`div`,{className:`field output-guard-list-field`,children:[(0,B.jsx)(`span`,{children:e.label}),(0,B.jsxs)(`div`,{className:`output-guard-list`,children:[r.map((t,n)=>(0,B.jsxs)(`div`,{className:`output-guard-list-row`,children:[(0,B.jsx)(`input`,{"aria-label":`${e.label} item ${n+1}`,value:t.value,onChange:e=>a(r.map((t,r)=>r===n?{...t,value:e.target.value}:t)),placeholder:e.placeholder}),(0,B.jsx)(`button`,{className:`ghost-button icon-button`,type:`button`,"aria-label":`Remove ${e.label} item ${n+1}`,title:`Remove`,onClick:()=>{a(r.filter((e,t)=>t!==n))},children:(0,B.jsx)(Fr,{width:`16`,height:`16`})})]},t.id)),(0,B.jsx)(`button`,{className:`ghost-button output-guard-add-button`,type:`button`,"aria-label":`Add ${e.label} item`,onClick:()=>{a([...r,n(``)])},children:`Add`})]})]})}function Ch(e){let t=e.value.provider===`model`?e.value.model:``,n=bh(e.activeModelId,e.modelOptions)||e.activeModelFallback;return(0,B.jsxs)(`div`,{className:`field`,children:[(0,B.jsx)(`span`,{children:e.label}),(0,B.jsxs)(`div`,{className:`output-guard-model-source-control has-model-readout ${e.value.provider===`model`?`has-model-select`:``}`,children:[(0,B.jsx)(Wa,{ariaLabel:e.ariaLabel,value:e.value.provider,options:[{value:`default`,label:`default model`},{value:`auxiliary`,label:`aux model`},{value:`model`,label:`other model`}],onChange:t=>{let n=t===`model`?e.value.model||e.defaultOtherModelId:``;e.onChange(yh(t,n))}}),e.value.provider===`model`?(0,B.jsx)(gh,{models:e.modelOptions,selectedModelId:t,disabled:e.modelsLoading,onSwitch:t=>e.onChange(yh(`model`,t))}):(0,B.jsx)(`div`,{className:`output-guard-model-readout`,title:e.activeModelId||n,children:n})]})]})}function wh(e){return e===`compliant`?`compliant`:e===`needs_review`?`needs review`:`non-compliant`}function Th(e){return e.kind===`banned_phrase`?`Contains banned phrase "${e.detail}".`:e.kind===`banned_pattern`?`Matches banned pattern ${e.detail}.`:`Missing required phrase "${e.detail}".`}function Eh(e){let{classifier:t}=e;if(t.status===`evaluated`&&t.verdict){let e=t.severity?`, ${t.severity}`:``,n=t.model?` via ${t.model}`:``;return`Classifier ${t.provider==="default"?`default model`:t.provider===`auxiliary`?`aux model`:`selected model`}${n}: ${wh(t.verdict)}${e}.`}return t.status===`unparseable`?`Classifier response was not parseable; showing rules score.`:e.scoreSource===`classifier`?`Classifier unavailable; failure mode blocks output.`:`Classifier unavailable; showing rules score.`}function Dh(){let e=Gn(),t=hs(),n=o(),[r,i]=(0,R.useState)(_h),[a,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(null),u=y({queryKey:[`output-guard-profile`,e.token],queryFn:()=>On(e.token)}),d=y({queryKey:[`models`,e.token],queryFn:()=>Kt(e.token)});(0,R.useEffect)(()=>{u.data?.profile&&i(u.data.profile)},[u.data?.profile]);let f=u.data?.profile??_h,p=!vh(xh(r),f),m=d.data?.models??[],h=d.data?.defaultModel??``,_=d.data?.auxiliaryModels?.skillsHub.model??null,v=d.data?.auxiliaryModels?.skillsHub.provider??`auto`,b=m.find(e=>e.id!==h)?.id??h;(0,R.useEffect)(()=>{b&&((r.classifier.provider!==`model`||r.classifier.model)&&(r.rewriter.provider!==`model`||r.rewriter.model)||i(e=>{let t=e;return e.classifier.provider===`model`&&!e.classifier.model&&(t={...t,classifier:yh(`model`,b)}),e.rewriter.provider===`model`&&!e.rewriter.model&&(t={...t,rewriter:yh(`model`,b)}),t}))},[b,r.classifier.model,r.classifier.provider,r.rewriter.model,r.rewriter.provider]);let x=g({mutationFn:()=>kn(e.token,xh(r)),onSuccess:r=>{i(r.profile),t.success(r.changed?`Output guard saved.`:`Output guard unchanged.`,r.reloadMessage),n.setQueryData([`output-guard-profile`,e.token],r),n.invalidateQueries({queryKey:[`output-guard-profile`,e.token]})},onError:e=>{t.error(`Save failed`,H(e))}}),S=g({mutationFn:()=>An(e.token,xh(r),a),onSuccess:e=>{l(e)},onError:e=>{t.error(`Preview failed`,H(e))}});return(0,B.jsxs)(`div`,{className:`page-stack output-guard-page`,children:[(0,B.jsx)(Ha,{description:`Operator controls for output policy, rules, classifier, and rewrite behavior.`,actions:(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:!p||x.isPending,onClick:()=>x.mutate(),children:x.isPending?`Saving...`:`Save profile`})}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Profile`}),(0,B.jsx)(uo,{children:`Runtime plugin profile`})]}),(0,B.jsx)(K,{children:u.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading output guard...`}):u.isError?(0,B.jsx)(`div`,{className:`empty-state`,children:H(u.error)}):(0,B.jsxs)(`div`,{className:`stack-form`,children:[(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:r.enabled,onCheckedChange:e=>i(t=>({...t,enabled:e}))}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Enabled`})})]}),(0,B.jsxs)(`div`,{className:`field`,children:[(0,B.jsx)(`span`,{children:`Mode`}),(0,B.jsx)(Wa,{ariaLabel:`Output guard mode`,value:r.mode,options:[{value:`rewrite`,label:`rewrite`},{value:`block`,label:`block`},{value:`flag`,label:`flag`}],onChange:e=>i(t=>({...t,mode:e}))})]}),(0,B.jsx)(Ch,{label:`Classifier`,ariaLabel:`Output guard classifier source`,value:r.classifier,modelOptions:m,defaultOtherModelId:b,activeModelId:r.classifier.provider==="default"?h:_,activeModelFallback:r.classifier.provider==="default"?`No default model`:v===`disabled`?`Aux model disabled`:`Auto routing`,modelsLoading:d.isLoading,onChange:e=>i(t=>({...t,classifier:e}))}),(0,B.jsx)(Ch,{label:`Rewriter`,ariaLabel:`Output guard rewriter source`,value:r.rewriter,modelOptions:m,defaultOtherModelId:b,activeModelId:r.rewriter.provider==="default"?h:_,activeModelFallback:r.rewriter.provider==="default"?`No default model`:v===`disabled`?`Aux model disabled`:`Auto routing`,modelsLoading:d.isLoading,onChange:e=>i(t=>({...t,rewriter:e}))}),(0,B.jsxs)(`label`,{className:`field textarea-field`,children:[(0,B.jsx)(`span`,{children:`Policy`}),(0,B.jsx)(`textarea`,{rows:5,value:r.policy,onChange:e=>i(t=>({...t,policy:e.target.value})),placeholder:`Clear, direct, concrete. No hype.`})]}),(0,B.jsx)(Sh,{label:`Do`,values:r.doList,placeholder:`Use concrete nouns`,onChange:e=>i(t=>({...t,doList:e}))}),(0,B.jsx)(Sh,{label:`Don't`,values:r.dontList,placeholder:`Use hype or vague claims`,onChange:e=>i(t=>({...t,dontList:e}))}),(0,B.jsx)(`small`,{className:`output-guard-list-note`,children:`Do and Don't guide rewrites and classifier context; banned and required rules stay deterministic.`}),(0,B.jsx)(Sh,{label:`Banned phrases`,values:r.bannedPhrases,placeholder:`game changing`,onChange:e=>i(t=>({...t,bannedPhrases:e}))}),(0,B.jsx)(Sh,{label:`Banned patterns`,values:r.bannedPatterns,placeholder:`/\\\\bguarantee[sd]?\\\\b/i`,onChange:e=>i(t=>({...t,bannedPatterns:e}))}),(0,B.jsx)(Sh,{label:`Required phrases`,values:r.requirePhrases,placeholder:`Best regards`,onChange:e=>i(t=>({...t,requirePhrases:e}))})]})})]}),(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Preview`}),(0,B.jsx)(uo,{children:c?`${c.score}/100, ${wh(c.verdict)} (${c.scoreSource})`:`No score yet`})]}),(0,B.jsxs)(K,{children:[(0,B.jsxs)(`label`,{className:`field textarea-field`,children:[(0,B.jsx)(`span`,{children:`Sample output`}),(0,B.jsx)(`textarea`,{rows:9,value:a,onChange:e=>s(e.target.value),placeholder:`Paste assistant output`})]}),(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:!a.trim()||S.isPending,onClick:()=>S.mutate(),children:S.isPending?`Scoring...`:`Score sample`}),c?(0,B.jsxs)(`div`,{className:`output-guard-score-panel`,children:[(0,B.jsx)(`div`,{className:`output-guard-score-bar`,children:(0,B.jsx)(`span`,{style:{width:`${c.score}%`}})}),(0,B.jsx)(`small`,{children:Eh(c)}),c.violations.length>0?(0,B.jsx)(`ul`,{className:`output-guard-reason-list`,children:c.violations.map(e=>{let t=Th(e);return(0,B.jsx)(`li`,{children:t},t)})}):(0,B.jsx)(`small`,{children:`No rule violations detected.`}),c.classifier.reasons.length>0?(0,B.jsx)(`ul`,{className:`output-guard-reason-list`,children:c.classifier.reasons.map(e=>(0,B.jsx)(`li`,{children:e},`classifier-${e}`))}):null]}):null]})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Versions`}),(0,B.jsx)(uo,{children:`${u.data?.revisions.length??0} profile edits`})]}),(0,B.jsx)(K,{children:u.data?.revisions.length?(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:u.data.revisions.map(e=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`strong`,{children:[`Revision `,e.id]}),(0,B.jsx)(`small`,{children:Qa(e.createdAt)}),(0,B.jsx)(`small`,{children:e.actor})]}),(0,B.jsx)(`span`,{className:`list-status`,children:e.source})]},e.id))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No saved profile edits yet.`})})]})]})]})]})}var Oh={plugin:(e,t)=>X(e.name||e.id,t.name||t.id)||X(e.id,t.id),source:(e,t)=>X(e.source,t.source)||X(e.name||e.id,t.name||t.id),enabled:(e,t)=>es(e.enabled,t.enabled)||X(e.name||e.id,t.name||t.id),status:(e,t)=>es(e.status===`loaded`,t.status===`loaded`)||X(e.name||e.id,t.name||t.id),commands:(e,t)=>$o(e.commands.length,t.commands.length)||X(e.name||e.id,t.name||t.id),tools:(e,t)=>$o(e.tools.length,t.tools.length)||X(e.name||e.id,t.name||t.id),hooks:(e,t)=>$o(e.hooks.length,t.hooks.length)||X(e.name||e.id,t.name||t.id)},kh={enabled:`desc`,status:`desc`,commands:`desc`,tools:`desc`,hooks:`desc`};function Ah(e){return e.length>0?e.join(`, `):`none`}function jh(e,t){return t?[e.id,e.name||``,e.description||``,e.source,e.status,e.error||``,...e.commands,...e.tools,...e.hooks].join(` `).toLowerCase().includes(t):!0}function Mh(){let e=Gn(),[t,n]=(0,R.useState)(``),r=(0,R.useDeferredValue)(t).trim().toLowerCase(),i=y({queryKey:[`plugins`,e.token],queryFn:()=>Dn(e.token)}),{sortedRows:a,sortState:o,toggleSort:s}=Ba((i.data?.plugins||[]).filter(e=>jh(e,r)),{initialSort:{key:`plugin`,direction:`asc`},sorters:Oh,defaultDirections:kh}),c=a.filter(e=>e.status===`failed`);return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{description:`Discovery and runtime load status for configured HybridClaw plugins.`,actions:(0,B.jsx)(`input`,{className:`compact-search`,value:t,onChange:e=>n(e.target.value),placeholder:`Filter plugins`})}),(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Ua,{label:`Plugins`,value:String(i.data?.totals.totalPlugins??0),detail:`${i.data?.totals.enabledPlugins??0} enabled`,loading:!i.data}),(0,B.jsx)(Ua,{label:`Load failures`,value:String(i.data?.totals.failedPlugins??0),detail:`runtime initialization errors`,loading:!i.data}),(0,B.jsx)(Ua,{label:`Commands`,value:String(i.data?.totals.commands??0),detail:`plugin-defined commands`,loading:!i.data}),(0,B.jsx)(Ua,{label:`Tools / Hooks`,value:`${i.data?.totals.tools??0} / ${i.data?.totals.hooks??0}`,detail:`registered runtime surfaces`,loading:!i.data})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Registry`}),(0,B.jsx)(uo,{children:`${a.length} plugin${a.length===1?``:`s`} visible`})]}),(0,B.jsx)(K,{children:i.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading plugins...`}):a.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No plugins match this filter.`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Va,{label:`Plugin`,sortKey:`plugin`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Source`,sortKey:`source`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Enabled`,sortKey:`enabled`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Status`,sortKey:`status`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Commands`,sortKey:`commands`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Tools`,sortKey:`tools`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Hooks`,sortKey:`hooks`,sortState:o,onToggle:s})]})}),(0,B.jsx)(`tbody`,{children:a.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.name||e.id}),(0,B.jsxs)(`small`,{children:[e.id,e.version?` · v${e.version}`:``]}),e.description?(0,B.jsx)(`small`,{children:e.description}):null,e.error?(0,B.jsx)(`small`,{children:e.error}):null]}),(0,B.jsx)(`td`,{children:e.source}),(0,B.jsx)(`td`,{children:(0,B.jsx)(Ga,{value:e.enabled,trueLabel:`enabled`,falseLabel:`disabled`})}),(0,B.jsx)(`td`,{children:(0,B.jsx)(Ga,{value:e.status===`loaded`,trueLabel:`loaded`,falseLabel:`failed`})}),(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.commands.length}),(0,B.jsx)(`small`,{children:Ah(e.commands)})]}),(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.tools.length}),(0,B.jsx)(`small`,{children:Ah(e.tools)})]}),(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.hooks.length}),(0,B.jsx)(`small`,{children:Ah(e.hooks)})]})]},e.id))})]})})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Failures`})}),(0,B.jsx)(K,{children:i.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading plugin status...`}):c.length>0?(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:c.map(e=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.name||e.id}),(0,B.jsxs)(`small`,{children:[e.id,e.version?` · v${e.version}`:``]}),(0,B.jsx)(`small`,{children:e.error||`Unknown plugin load error.`})]}),(0,B.jsxs)(`span`,{className:`list-status list-status-danger`,children:[(0,B.jsx)(`span`,{className:`status-dot status-dot-danger`}),`failed`]})]},e.id))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No plugin load failures were reported.`})})]})]})]})}var Nh={anchor:`_anchor_1k3rt_1`,input:`_input_1k3rt_7`,chevron:`_chevron_1k3rt_11`,popover:`_popover_1k3rt_22`,list:`_list_1k3rt_28`,option:`_option_1k3rt_39`,optionLabel:`_optionLabel_1k3rt_60`,optionDescription:`_optionDescription_1k3rt_64`,empty:`_empty_1k3rt_69`},Ph=(e,t)=>{if(!t)return!0;let n=t.toLowerCase();return e.label.toLowerCase().includes(n)||e.value.toLowerCase().includes(n)};function Fh({value:e,onValueChange:t,options:n,placeholder:r,disabled:i,renderOption:a,emptyMessage:o=`No matches.`,filter:s=Ph,allowFreeText:c=!1,popoverAlign:l=`start`,className:u,id:d,onBlur:f}){let p=Do({id:d,disabled:i,"aria-invalid":void 0,"aria-describedby":void 0}),m=(0,R.useId)(),h=`${p.id??m}-listbox`,g=(0,R.useMemo)(()=>n.find(t=>t.value===e)??null,[n,e]),_=g?g.label:c?e:``,[v,y]=(0,R.useState)(!1),[b,x]=(0,R.useState)(_),[S,C]=(0,R.useState)(0),w=(0,R.useRef)(null),T=(0,R.useRef)(!1);(0,R.useEffect)(()=>{v||x(_)},[_,v]);let E=(0,R.useMemo)(()=>v?n.filter(e=>s(e,b.trim())):n,[n,v,b,s]);(0,R.useEffect)(()=>{S>=E.length&&C(0)},[E.length,S]);let D=(0,R.useCallback)((e,n)=>{T.current=!0,e?(t(e.value,e),x(e.label)):c&&t(n??``,null),y(!1)},[c,t]),O=e=>{x(e.target.value),y(!0),C(0)},k=e=>{if(e.key===`ArrowDown`)e.preventDefault(),y(!0),C(e=>Math.min(e+1,Math.max(0,E.length-1)));else if(e.key===`ArrowUp`)e.preventDefault(),y(!0),C(e=>Math.max(e-1,0));else if(e.key===`Enter`){if(!v)return;e.preventDefault();let t=E[S];t&&!t.disabled?D(t):c&&D(null,b)}else if(e.key===`Escape`){if(!v)return;e.preventDefault(),y(!1),x(_)}else if(e.key===`Tab`){if(!v)return;let e=E[S];e&&!e.disabled&&D(e)}},A=()=>{if(y(!1),T.current){T.current=!1,f?.();return}if(c)b!==_&&D(null,b);else{let t=n.find(e=>e.label===b||e.value===b);t?t.value!==e&&D(t):x(_)}f?.()};return(0,B.jsxs)(Oi,{open:v,onOpenChange:y,children:[(0,B.jsxs)(ki,{className:V(Nh.anchor,u),children:[(0,B.jsx)(Y,{...p,ref:w,type:`text`,role:`combobox`,"aria-expanded":v,"aria-controls":v?h:void 0,"aria-autocomplete":`list`,"aria-activedescendant":v&&E[S]?`${h}-option-${S}`:void 0,value:b,placeholder:r,onFocus:()=>y(!0),onChange:O,onKeyDown:k,onBlur:A,className:Nh.input,autoComplete:`off`,spellCheck:!1}),(0,B.jsx)(er,{"aria-hidden":`true`,className:Nh.chevron})]}),(0,B.jsx)(Ai,{align:l,className:Nh.popover,children:(0,B.jsx)(`div`,{role:`listbox`,id:h,className:Nh.list,children:E.length===0?(0,B.jsx)(`div`,{className:Nh.empty,children:o}):E.map((t,n)=>{let r=n===S,i=t.value===e;return(0,B.jsx)(`div`,{id:`${h}-option-${n}`,role:`option`,"aria-selected":i,"aria-disabled":t.disabled||void 0,"data-active":r||void 0,"data-disabled":t.disabled||void 0,tabIndex:-1,className:Nh.option,onMouseDown:e=>{e.preventDefault(),t.disabled||D(t)},onMouseEnter:()=>C(n),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t.disabled||D(t))},children:a?a(t,r):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:Nh.optionLabel,children:t.label}),t.description?(0,B.jsx)(`span`,{className:Nh.optionDescription,children:t.description}):null]})},t.value)})})})]})}function Ih(e){if(e==null)return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;let t=e.trim();if(!t)return null;let n=/^\d{4}-\d{2}-\d{2}$/.test(t)?`${t}T00:00`:t,r=new Date(n);return Number.isNaN(r.getTime())?null:r}function Lh(e,t){if(!e)return``;let n=e.getTimezoneOffset()*6e4,r=new Date(e.getTime()-n).toISOString();return t===`day`?r.slice(0,10):t===`second`?r.slice(0,19):r.slice(0,16)}function Rh({value:e,onValueChange:t,onErrorChange:n,granularity:r=`minute`,min:i,max:a,required:o=!1,...s}){let c=Eo(),l=r===`day`?`date`:`datetime-local`,u=r===`second`?1:void 0,d=(0,R.useMemo)(()=>Ih(i??null),[i]),f=(0,R.useMemo)(()=>Ih(a??null),[a]),p=Lh((0,R.useMemo)(()=>Ih(e),[e]),r),m=(0,R.useCallback)(e=>{c.setError(e),n?.(e)},[c.setError,n]);return(0,B.jsx)(Y,{...s,type:l,step:u,value:p,min:d?Lh(d,r):void 0,max:f?Lh(f,r):void 0,onChange:e=>{let n=e.target.value;if(n.trim()===``){if(o){m(`Required.`);return}m(null),t(null);return}let r=Ih(n);if(!r){m(`Enter a valid date.`);return}if(d&&r<d){m(`Date is earlier than the minimum allowed.`);return}if(f&&r>f){m(`Date is later than the maximum allowed.`);return}m(null),t(r)}})}var zh=[`backlog`,`in_progress`,`review`,`done`,`cancelled`],Bh=[`cron`,`every`,`at`,`one_shot`],Vh=[`agent_turn`,`system_event`],Hh=[`channel`,`last-channel`,`webhook`];function Uh(e){return e?.source===`job`}function Wh(e){return e?.source===`task`}function Gh(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Kh(e){return e.schedule.kind===`one_shot`?`one shot`:e.schedule.kind===`cron`?e.schedule.expr||`invalid cron`:e.schedule.kind===`every`?`every ${e.schedule.everyMs}ms`:Qa(e.schedule.at)}function qh(e){return e.source===`task`?`task #${e.taskId??`n/a`} · ${Kh(e)}`:`${e.id} · ${Kh(e)}`}function Jh(e){return e.disabled?`paused`:e.boardStatus===`review`&&e.lastStatus===`error`?`failed`:e.lastStatus?e.lastStatus:e.enabled?`ready`:`inactive`}function Yh(e){return e?.boardStatus?e.boardStatus:e?!e.enabled||e.disabled?`cancelled`:e.lastStatus===`success`?`done`:e.lastStatus===`error`?`cancelled`:`backlog`:`backlog`}function Xh(e){return{originalId:e?.id||null,id:e?.id||``,name:e?.name||``,description:e?.description||``,agentId:e?.agentId||``,boardStatus:Yh(e),enabled:e?.enabled??!0,scheduleKind:e?.schedule.kind||`cron`,scheduleExpr:e?.schedule.expr||`0 * * * *`,scheduleEveryMs:e?.schedule.everyMs??6e4,scheduleAt:Gh(e?.schedule.at||null),scheduleTz:e?.schedule.tz||``,maxRetries:typeof e?.maxRetries==`number`?e.maxRetries:3,actionKind:e?.action.kind||`agent_turn`,actionMessage:e?.action.message||``,deliveryKind:e?.delivery.kind||`channel`,deliveryChannel:e?.delivery.channel||`tui`,deliveryTo:e?.delivery.to||``,deliveryWebhookUrl:e?.delivery.webhookUrl||``}}function Zh(e){let t=[{value:`tui`,label:`Local TUI`}],n=e.config;if(n){let r=vl(n,{discordTokenConfigured:e.status?.discord?.tokenConfigured,slackBotTokenConfigured:e.status?.slack?.botTokenConfigured,slackAppTokenConfigured:e.status?.slack?.appTokenConfigured,telegramTokenConfigured:e.status?.telegram?.tokenConfigured,whatsappLinked:e.status?.whatsapp?.linked,emailPasswordConfigured:e.status?.email?.passwordConfigured,imessagePasswordConfigured:e.status?.imessage?.passwordConfigured});for(let e of r)e.statusTone===`active`&&t.push({value:e.kind,label:e.label})}let r=e.currentChannel.trim();return r&&!t.some(e=>e.value===r)&&t.push({value:r,label:`${Qh(r)} (current)`}),t}function Qh(e){switch(e){case`discord`:return`Discord`;case`slack`:return`Slack`;case`telegram`:return`Telegram`;case`whatsapp`:return`WhatsApp`;case`email`:return`Email`;case`msteams`:return`Microsoft Teams`;case`imessage`:return`iMessage`;case`tui`:return`Local TUI`;case`web`:return`Local Web`;default:return e}}function $h(e,t){return t?e===`discord`?t.channels.filter(e=>e.transport===`discord`).map(e=>({value:e.channelId,label:`${e.guildId} · ${e.channelId}`})):e===`msteams`?t.channels.filter(e=>e.transport===`msteams`).map(e=>({value:e.channelId,label:`${e.guildId} · ${e.channelId}`})):[]:[]}function eg(e){let t=e.currentValue.trim();return e.channel===`tui`||e.channel===`web`?e.channel:e.options.length===0||e.options.some(e=>e.value===t)?t:e.options[0].value}function tg(e){let t=$h(e.channel,e.channels),n=eg({channel:e.channel,currentValue:e.currentValue,options:t});if(e.channel===`tui`||e.channel===`web`||(e.channel===`discord`||e.channel===`msteams`)&&t.length===1)return{kind:`none`,value:n};if((e.channel===`discord`||e.channel===`msteams`)&&t.length>1)return{kind:`select`,value:n,label:`Channel`,options:t};switch(e.channel){case`discord`:return{kind:`input`,value:n,label:`Channel ID`,placeholder:`123456789012345678`};case`slack`:return{kind:`input`,value:n,label:`Conversation target`,placeholder:`slack:C1234567890`};case`telegram`:return{kind:`input`,value:n,label:`Chat ID`,placeholder:`telegram:-1001234567890`};case`whatsapp`:return{kind:`input`,value:n,label:`Chat JID`,placeholder:`491234567890@s.whatsapp.net`};case`email`:return{kind:`input`,value:n,label:`Recipient`,placeholder:`ops@example.com`};case`imessage`:return{kind:`input`,value:n,label:`Handle`,placeholder:`imessage:ops@example.com`};case`msteams`:return{kind:`input`,value:n,label:`Channel ID`,placeholder:`19:channel-id@thread.tacv2`};default:return{kind:`input`,value:n,label:`Target`,placeholder:e.channel||`target`}}}function ng(e,t){return e.deliveryKind===`channel`?{...e,deliveryTo:t.value}:{...e,deliveryTo:``}}function rg(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,48)}function ig(e){let t=e.id.trim();if(t)return{...e,id:t};let n=rg(e.name)||rg(e.description)||rg(e.actionMessage)||`job-${Date.now().toString(36).slice(-8).toLowerCase()}`;return{...e,id:n}}function ag(e){let t=e.scheduleKind===`at`&&e.scheduleAt?e.scheduleAt.toISOString():null;if(e.scheduleKind===`at`&&!t)throw Error(`Pick a valid "Run at" timestamp.`);return{id:e.id.trim(),source:`job`,name:e.name.trim()||e.id.trim(),description:e.description.trim()||null,agentId:e.agentId.trim()||null,boardStatus:e.boardStatus,maxRetries:e.scheduleKind===`one_shot`?e.maxRetries:null,enabled:e.enabled,schedule:{kind:e.scheduleKind,at:t,everyMs:e.scheduleKind===`every`?e.scheduleEveryMs:null,expr:e.scheduleKind===`cron`&&e.scheduleExpr.trim()||null,tz:e.scheduleKind===`one_shot`?``:e.scheduleTz.trim()},action:{kind:e.actionKind,message:e.actionMessage.trim()},delivery:{kind:e.deliveryKind,channel:e.deliveryChannel.trim()||`tui`,to:e.deliveryKind===`channel`?e.deliveryTo.trim():``,webhookUrl:e.deliveryKind===`webhook`?e.deliveryWebhookUrl.trim():``},lastRun:null,lastStatus:null,nextRunAt:null,disabled:!1,consecutiveErrors:0,createdAt:null,sessionId:null,channelId:null,taskId:null}}function og(e,t,n){n.setQueryData([`scheduler`,t],e)}function sg(e){return(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Task`})}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`stack-form`,children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Task`}),(0,B.jsxs)(`strong`,{children:[`#`,e.job.taskId??`n/a`]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`State`}),(0,B.jsx)(Ga,{value:e.job.enabled&&!e.job.disabled,trueLabel:`active`,falseLabel:`inactive`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Session`}),(0,B.jsx)(`strong`,{children:e.job.sessionId||`n/a`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Channel`}),(0,B.jsx)(`strong`,{children:e.job.channelId||`n/a`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Created`}),(0,B.jsx)(`strong`,{children:Qa(e.job.createdAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Next run`}),(0,B.jsx)(`strong`,{children:Qa(e.job.nextRunAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Last run`}),(0,B.jsx)(`strong`,{children:Qa(e.job.lastRun)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Last status`}),(0,B.jsx)(`strong`,{children:e.job.lastStatus||`n/a`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Message`}),(0,B.jsx)(Jo,{readOnly:!0,rows:6,value:e.job.action.message})]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,disabled:e.pausePending,onClick:e.onPauseToggle,children:e.pausePending?`Updating...`:e.job.disabled?`Resume task`:`Pause task`}),(0,B.jsx)(`button`,{className:`danger-button`,type:`button`,disabled:e.deletePending,onClick:e.onDelete,children:e.deletePending?`Deleting...`:`Delete task`})]})]})})]})}function cg(e){let{draft:t,selectedJob:n}=e;return(0,B.jsx)(Oc,{form:e.form,onSubmit:e.onSave,children:(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Job`})}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`stack-form`,children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`ID`}),(0,B.jsx)(Y,{value:t.id,onChange:t=>e.onDraftChange(e=>({...e,id:t.target.value})),placeholder:`Auto-generated from name if blank`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Name`}),(0,B.jsx)(Y,{value:t.name,onChange:t=>e.onDraftChange(e=>({...e,name:t.target.value})),placeholder:`Nightly research`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Description`}),(0,B.jsx)(Y,{value:t.description,onChange:t=>e.onDraftChange(e=>({...e,description:t.target.value})),placeholder:`Optional`})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Status`}),(0,B.jsxs)(ds,{value:t.boardStatus,onChange:t=>e.onDraftChange(e=>({...e,boardStatus:nu(zh,t.target.value,e.boardStatus)})),children:[(0,B.jsx)(Q,{value:`backlog`,children:`backlog`}),(0,B.jsx)(Q,{value:`in_progress`,children:`in progress`}),(0,B.jsx)(Q,{value:`review`,children:`review`}),(0,B.jsx)(Q,{value:`done`,children:`done`}),(0,B.jsx)(Q,{value:`cancelled`,children:`cancelled`})]})]}),(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:t.enabled,onCheckedChange:t=>e.onDraftChange(e=>({...e,enabled:t}))}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`State`})})]})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Schedule`}),(0,B.jsxs)(ds,{value:t.scheduleKind,onChange:t=>e.onDraftChange(e=>{let n=nu(Bh,t.target.value,e.scheduleKind);return{...e,scheduleKind:n,boardStatus:n===`one_shot`?`backlog`:e.boardStatus}}),children:[(0,B.jsx)(Q,{value:`cron`,children:`cron`}),(0,B.jsx)(Q,{value:`every`,children:`every`}),(0,B.jsx)(Q,{value:`at`,children:`at`}),(0,B.jsx)(Q,{value:`one_shot`,children:`one shot`})]})]}),t.scheduleKind===`one_shot`?null:(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Timezone`}),(0,B.jsx)(Y,{value:t.scheduleTz,onChange:t=>e.onDraftChange(e=>({...e,scheduleTz:t.target.value})),placeholder:`Europe/Berlin`})]})]}),t.scheduleKind===`cron`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Cron`}),(0,B.jsx)(Y,{value:t.scheduleExpr,onChange:t=>e.onDraftChange(e=>({...e,scheduleExpr:t.target.value})),placeholder:`0 * * * *`})]}):null,t.scheduleKind===`every`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Every ms`}),(0,B.jsx)(jc,{integer:!0,min:1,value:t.scheduleEveryMs,onValueChange:t=>e.onDraftChange(e=>({...e,scheduleEveryMs:t})),placeholder:`60000`}),(0,B.jsx)(Wo,{})]}):null,t.scheduleKind===`at`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Run at`}),(0,B.jsx)(Rh,{required:!0,value:t.scheduleAt,onValueChange:t=>e.onDraftChange(e=>({...e,scheduleAt:t}))}),(0,B.jsx)(Wo,{})]}):null,t.scheduleKind===`one_shot`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Retries after failure`}),(0,B.jsx)(jc,{integer:!0,min:0,max:100,value:t.maxRetries,onValueChange:t=>e.onDraftChange(e=>({...e,maxRetries:t})),placeholder:`3`}),(0,B.jsx)(Wo,{})]}):null,(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Action`}),(0,B.jsxs)(ds,{value:t.actionKind,onChange:t=>e.onDraftChange(e=>({...e,actionKind:nu(Vh,t.target.value,e.actionKind)})),children:[(0,B.jsx)(Q,{value:`agent_turn`,children:`agent_turn`}),(0,B.jsx)(Q,{value:`system_event`,children:`system_event`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Delivery`}),(0,B.jsxs)(ds,{value:t.deliveryKind,onChange:t=>e.onDraftChange(e=>({...e,deliveryKind:nu(Hh,t.target.value,e.deliveryKind)})),children:[(0,B.jsx)(Q,{value:`channel`,children:`channel`}),(0,B.jsx)(Q,{value:`last-channel`,children:`last-channel`}),(0,B.jsx)(Q,{value:`webhook`,children:`webhook`})]})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Message`}),(0,B.jsx)(Jo,{rows:4,value:t.actionMessage,onChange:t=>e.onDraftChange(e=>({...e,actionMessage:t.target.value})),placeholder:`Prompt or system-event message`})]}),t.deliveryKind===`channel`?(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Channel type`}),(0,B.jsx)(ds,{value:t.deliveryChannel,onChange:t=>e.onDraftChange(e=>({...e,deliveryChannel:t.target.value,deliveryTo:``})),children:e.channelOptions.map(e=>(0,B.jsx)(Q,{value:e.value,children:e.label},e.value))})]}),e.targetControl.kind===`select`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:e.targetControl.label}),(0,B.jsx)(Fh,{value:e.targetControl.value,onValueChange:t=>e.onDraftChange(e=>({...e,deliveryTo:t})),options:e.targetControl.options})]}):null,e.targetControl.kind===`input`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:e.targetControl.label}),(0,B.jsx)(Y,{value:e.targetControl.value,onChange:t=>e.onDraftChange(e=>({...e,deliveryTo:t.target.value})),placeholder:e.targetControl.placeholder})]}):null]}):null,t.deliveryKind===`webhook`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Webhook URL`}),(0,B.jsx)(Y,{type:`url`,value:t.deliveryWebhookUrl,onChange:t=>e.onDraftChange(e=>({...e,deliveryWebhookUrl:t.target.value})),placeholder:`https://example.test/hook`})]}):null,n?(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Next run`}),(0,B.jsx)(`strong`,{children:Qa(n.nextRunAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Last run`}),(0,B.jsx)(`strong`,{children:Qa(n.lastRun)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Last status`}),(0,B.jsx)(`strong`,{children:n.lastStatus||`n/a`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Errors`}),(0,B.jsx)(`strong`,{children:n.consecutiveErrors})]})]}):null,(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{type:`button`,loading:e.savePending,disabled:e.saveDisabled,onClick:e.onSave,children:e.savePending?`Saving...`:`Save job`}),(0,B.jsx)(Z,{variant:`ghost`,type:`button`,disabled:e.savePending,onClick:e.onCancel,children:`Cancel`}),n?(0,B.jsx)(Z,{variant:`ghost`,type:`button`,disabled:e.pausePending,onClick:e.onPauseToggle,children:e.pausePending?`Updating...`:n.disabled?`Resume job`:`Pause job`}):null,n?(0,B.jsx)(Z,{variant:`danger`,type:`button`,loading:e.deletePending,disabled:e.deletePending,onClick:e.onDelete,children:e.deletePending?`Deleting...`:`Delete job`}):null]})]})})]})})}function lg(){let e=Gn(),t=j(),n=ee({strict:!1}),r=hs(),i=o(),a=n.jobId?.trim()||null,s=(0,R.useCallback)(e=>{t({to:`/admin/scheduler`,replace:!0,search:{jobId:e||void 0}}).catch(Os)},[t]),[c,l]=(0,R.useState)(Xh()),u=Dc(),d=y({queryKey:[`scheduler`,e.token],queryFn:()=>Jt(e.token)}),f=y({queryKey:[`config`,e.token],queryFn:()=>Mt(e.token)}),p=y({queryKey:[`channels`,e.token],queryFn:()=>jt(e.token)}),m=d.data?.jobs.find(e=>e.id===a)||null,h=Uh(m)?m:null,_=Zh({config:f.data?.config,status:e.gatewayStatus,currentChannel:c.deliveryChannel}),v=tg({channel:c.deliveryChannel,currentValue:c.deliveryTo,channels:p.data}),b=Fc({mutationFn:t=>Yt(e.token,ag(t)),onSuccess:n=>{og(n,e.token,i),t({to:`/admin/jobs`}).catch(Os)},onError:e=>{r.error(`Save failed`,e.message)},invalidates:[[`overview`]]}),x=b.isPending||!u.isValid,S=g({mutationFn:()=>{if(!m)throw Error(`Select a scheduler item first.`);return Xt(e.token,m)},onSuccess:t=>{og(t,e.token,i),r.success(`Deleted.`),s(null),l(Xh())},onError:e=>{r.error(`Delete failed`,H(e))}}),C=g({mutationFn:t=>{if(!m)throw Error(`Select a scheduler item first.`);return m.source===`task`?Zt(e.token,{source:`task`,taskId:m.taskId??0,action:t}):Zt(e.token,{source:`job`,jobId:m.id,action:t})},onSuccess:(t,n)=>{if(og(t,e.token,i),r.success(n===`pause`?`Paused.`:`Resumed.`),!m)return;let a=t.jobs.find(e=>e.id===m.id)||null;if(!a){s(null),l(Xh());return}Uh(a)&&l(Xh(a))},onError:e=>{r.error(`Pause/resume failed`,H(e))}});return(0,R.useEffect)(()=>{if(h){l(Xh(h));return}a||l(Xh())},[h,a]),(0,R.useEffect)(()=>{!a||d.isLoading||m||s(null)},[d.isLoading,a,m,s]),(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{actions:(0,B.jsx)(Z,{variant:`ghost`,type:`button`,onClick:()=>{s(null),l(Xh())},children:`New job`})}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Jobs`}),(0,B.jsx)(uo,{children:`${d.data?.jobs.length||0} item${d.data?.jobs.length===1?``:`s`}`})]}),(0,B.jsx)(K,{children:d.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading scheduler items...`}):d.data?.jobs.length?(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:d.data.jobs.map(e=>(0,B.jsxs)(`button`,{className:e.id===a?`selectable-row active`:`selectable-row`,type:`button`,onClick:()=>s(e.id),children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.name}),(0,B.jsx)(`small`,{children:qh(e)})]}),(0,B.jsxs)(`div`,{className:`row-status-stack`,children:[(0,B.jsx)(Ga,{value:e.enabled&&!e.disabled,trueLabel:`active`,falseLabel:`inactive`}),(0,B.jsx)(`small`,{children:Jh(e)})]})]},e.id))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No scheduled work yet.`})})]}),Wh(m)?(0,B.jsx)(sg,{job:m,pausePending:C.isPending,deletePending:S.isPending,onPauseToggle:()=>C.mutate(m.disabled?`resume`:`pause`),onDelete:()=>S.mutate()}):(0,B.jsx)(cg,{draft:c,selectedJob:h,channelOptions:_,targetControl:v,savePending:b.isPending,pausePending:C.isPending,deletePending:S.isPending,saveDisabled:x,onDraftChange:e=>l(t=>e(t)),form:u,onSave:()=>{let e=ig(ng(c,v));l(e),b.mutate(e)},onCancel:()=>{if(h){l(Xh(h));return}s(null),l(Xh()),t({to:`/admin/jobs`}).catch(Os)},onPauseToggle:()=>C.mutate(h?.disabled?`resume`:`pause`),onDelete:()=>S.mutate()})]})]})}var ug={section:`_section_1dqd9_1`,sectionHead:`_sectionHead_1dqd9_7`,sectionTitle:`_sectionTitle_1dqd9_13`,count:`_count_1dqd9_23`,caption:`_caption_1dqd9_30`,name:`_name_1dqd9_36`,fingerprint:`_fingerprint_1dqd9_42`,actionsHead:`_actionsHead_1dqd9_47`,actions:`_actions_1dqd9_47`,overwriteForm:`_overwriteForm_1dqd9_57`,overwriteNote:`_overwriteNote_1dqd9_63`};function dg(e){return e.length===null?`—`:`${e.length} bytes`}function fg(e){return e.fingerprint?`sha256:${e.fingerprint.sha256_prefix}`:`—`}function pg(e){return e?Za(e):`never`}function mg(){let{token:e}=Gn(),t=hs(),n=o(),[r,i]=(0,R.useState)(null),[a,s]=(0,R.useState)(null),[c,l]=(0,R.useState)(``),u=y({queryKey:[`admin`,`secrets`,e],queryFn:()=>Ut(e),retry:!1}),d=(0,R.useCallback)(()=>n.invalidateQueries({queryKey:[`admin`,`secrets`]}),[n]),f=g({mutationFn:t=>Wt(e,t.name,t.value),onSuccess:async(e,n)=>{t.success(n.wasSet?`Rotated ${n.name}.`:`Set ${n.name}.`),i(null),await d()},onError:e=>{t.error(`Overwrite failed: ${H(e)}`)}}),p=g({mutationFn:t=>Gt(e,t),onSuccess:async(e,n)=>{t.success(`Removed ${n}.`),s(null),await d()},onError:e=>{t.error(`Unset failed: ${H(e)}`)}}),m=u.data,h=(0,R.useMemo)(()=>{if(!m)return null;let e=c.trim().toLowerCase(),t=m.secrets.filter(e=>e.state===`set`),n=m.secrets.filter(e=>e.state===`unset`),r=t=>e===``||t.name.toLowerCase().includes(e);return{setAll:t,unsetAll:n,setEntries:t.filter(r),unsetEntries:n.filter(r)}},[m,c]);if(u.isPending)return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{description:`Runtime secret store`}),(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading the runtime secret store…`})]});if(u.isError||!h){let e=u.error instanceof we&&u.error.status===403;return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{description:`Runtime secret store`}),(0,B.jsx)(`div`,{className:`empty-state`,children:e?`You do not have permission to view secret metadata.`:`Failed to load secrets: ${H(u.error)}`})]})}let _=m?.actions.includes(`secret.overwrite`)??!1,v=m?.actions.includes(`secret.unset`)??!1,b=_||v;return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{description:`Runtime credential store. Values are write-only — set or rotate them here; they are never read back to the browser.`,actions:(0,B.jsx)(`input`,{className:`compact-search`,value:c,onChange:e=>l(e.target.value),placeholder:`Filter secrets`,"aria-label":`Filter secrets by name`})}),(0,B.jsxs)(`section`,{className:ug.section,"aria-label":`Set`,children:[(0,B.jsxs)(`div`,{className:ug.sectionHead,children:[(0,B.jsxs)(`h2`,{className:ug.sectionTitle,children:[`Set `,(0,B.jsx)(`span`,{className:ug.count,children:h.setAll.length})]}),(0,B.jsx)(`p`,{className:ug.caption,children:`Stored values, shown only as metadata — length and a SHA-256 fingerprint, never the value itself.`})]}),h.setEntries.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:h.setAll.length===0?`No secrets are currently set.`:`No set secrets match this filter.`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Name`}),(0,B.jsx)(`th`,{children:`Length`}),(0,B.jsx)(`th`,{children:`Fingerprint`}),(0,B.jsx)(`th`,{children:`Last rotated`}),b?(0,B.jsx)(`th`,{className:ug.actionsHead,children:`Actions`}):null]})}),(0,B.jsx)(`tbody`,{children:h.setEntries.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:(0,B.jsx)(`strong`,{className:ug.name,children:e.name})}),(0,B.jsx)(`td`,{children:dg(e)}),(0,B.jsx)(`td`,{children:(0,B.jsx)(`code`,{className:ug.fingerprint,children:fg(e)})}),(0,B.jsx)(`td`,{title:e.last_rotated_at??void 0,children:pg(e.last_rotated_at)}),b?(0,B.jsx)(`td`,{children:(0,B.jsxs)(`div`,{className:ug.actions,children:[_?(0,B.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(e.name),children:`Rotate`}):null,v?(0,B.jsx)(Z,{type:`button`,variant:`danger`,size:`sm`,onClick:()=>s(e.name),children:`Unset`}):null]})}):null]},e.name))})]})})]}),(0,B.jsxs)(`section`,{className:ug.section,"aria-label":`Declared but unset`,children:[(0,B.jsxs)(`div`,{className:ug.sectionHead,children:[(0,B.jsxs)(`h2`,{className:ug.sectionTitle,children:[`Declared but unset`,` `,(0,B.jsx)(`span`,{className:ug.count,children:h.unsetAll.length})]}),(0,B.jsx)(`p`,{className:ug.caption,children:`Referenced by a skill, connector, or provider, with no value yet.`})]}),h.unsetEntries.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:h.unsetAll.length===0?`No declared-but-unset secrets.`:`No declared secrets match this filter.`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Name`}),_?(0,B.jsx)(`th`,{className:ug.actionsHead,children:`Actions`}):null]})}),(0,B.jsx)(`tbody`,{children:h.unsetEntries.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:(0,B.jsx)(`strong`,{className:ug.name,children:e.name})}),_?(0,B.jsx)(`td`,{children:(0,B.jsx)(`div`,{className:ug.actions,children:(0,B.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(e.name),children:`Set`})})}):null]},e.name))})]})})]}),(0,B.jsx)(hg,{name:r,onClose:()=>i(null),pending:f.isPending,onSubmit:e=>{if(!r)return;let t=h.setAll.some(e=>e.name===r);f.mutate({name:r,value:e,wasSet:t})}}),(0,B.jsx)(gg,{name:a,onClose:()=>s(null),pending:p.isPending,onConfirm:()=>{a&&p.mutate(a)}})]})}function hg(e){let t=e.name!==null,n=(0,R.useRef)(null),r=(0,R.useId)(),i=(0,R.useId)();return(0,B.jsx)(ri,{open:t,onOpenChange:t=>{t||(n.current&&(n.current.value=``),e.onClose())},children:(0,B.jsxs)(ii,{role:`dialog`,size:`default`,preventCloseOnOutsideClick:e.pending,children:[(0,B.jsxs)(ai,{children:[(0,B.jsxs)(oi,{children:[`Set value for `,(0,B.jsx)(`code`,{children:e.name})]}),(0,B.jsx)(si,{children:`The new value is sent to the gateway and immediately discarded from this form. There is no way to read the stored value back.`})]}),(0,B.jsxs)(`form`,{className:ug.overwriteForm,onSubmit:t=>{t.preventDefault();let r=n.current;if(!r)return;let i=r.value;i.trim()&&e.onSubmit(i)},children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{htmlFor:r,children:`New value`}),(0,B.jsx)(Y,{id:r,ref:n,type:`password`,autoComplete:`new-password`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,required:!0,"aria-describedby":i,disabled:e.pending}),(0,B.jsx)(`p`,{id:i,className:ug.overwriteNote,children:`Pasted value is not echoed. Once submitted, the value lives only in the runtime secret store; this page cannot show it again.`})]}),(0,B.jsxs)(ci,{children:[(0,B.jsx)(li,{className:`ghost-button`,disabled:e.pending,children:`Cancel`}),(0,B.jsx)(Z,{type:`submit`,disabled:e.pending,children:e.pending?`Saving…`:`Save value`})]})]})]})})}function gg(e){return(0,B.jsx)(ri,{open:e.name!==null,onOpenChange:t=>{t||e.onClose()},children:(0,B.jsxs)(ii,{role:`alertdialog`,size:`default`,preventCloseOnOutsideClick:e.pending,children:[(0,B.jsxs)(ai,{children:[(0,B.jsxs)(oi,{children:[`Unset `,(0,B.jsx)(`code`,{children:e.name}),`?`]}),(0,B.jsx)(si,{children:`The stored value will be removed from the runtime secret store. Skills or connectors that depend on this secret will fail their preflight checks until a new value is set.`})]}),(0,B.jsxs)(ci,{children:[(0,B.jsx)(li,{className:`ghost-button`,disabled:e.pending,children:`Cancel`}),(0,B.jsx)(Z,{type:`button`,variant:`danger`,disabled:e.pending,onClick:e.onConfirm,children:e.pending?`Removing…`:`Unset secret`})]})]})})}function _g(){let e=Gn(),t=o(),n=hs(),r=j(),i=ee({strict:!1}).sessionId?.trim()||null,a=(0,R.useRef)(i),[s,c]=(0,R.useState)(``),[l,u]=(0,R.useState)(()=>i),[d,f]=(0,R.useState)(!1),p=(0,R.useDeferredValue)(s),m=y({queryKey:[`sessions`,e.token],queryFn:()=>Tt(e.token)}),h=g({mutationFn:t=>At(e.token,t),onSuccess:(e,i)=>{t.invalidateQueries({queryKey:[`sessions`]}),t.invalidateQueries({queryKey:[`overview`]}),n.success(`Session deleted`,`Removed ${e.deletedMessages} messages and ${e.deletedTasks} tasks.`),l===i&&(u(null),r({to:`/admin/sessions`,replace:!0,search:{sessionId:void 0}}).catch(Os))},onError:e=>{n.error(`Delete failed`,H(e))}}),_=(m.data||[]).filter(e=>[e.id,e.channelId,e.guildId||``,e.effectiveModel,e.summary||``].join(` `).toLowerCase().includes(p.trim().toLowerCase())),v=_.find(e=>e.id===l)||_[0]||null;(0,R.useEffect)(()=>{v&&v.id!==l&&u(v.id)},[l,v]),(0,R.useEffect)(()=>{i!==a.current&&(a.current=i,i&&i!==l&&u(i))},[i,l]);function b(e){u(e),r({to:`/admin/sessions`,replace:!0,search:{sessionId:e}}).catch(Os)}return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{actions:(0,B.jsx)(`input`,{className:`compact-search`,value:s,onChange:e=>c(e.target.value),placeholder:`Filter by session, channel, model`})}),(0,B.jsxs)(`div`,{className:`two-column-grid sessions-layout`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Session list`}),(0,B.jsx)(uo,{children:`${_.length} result${_.length===1?``:`s`}`})]}),(0,B.jsx)(K,{children:m.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading sessions...`}):_.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No sessions match this filter.`}):(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:_.map(e=>(0,B.jsxs)(`button`,{className:e.id===v?.id?`selectable-row active`:`selectable-row`,type:`button`,onClick:()=>b(e.id),children:[(0,B.jsxs)(`div`,{className:`session-row-main`,children:[(0,B.jsx)(`strong`,{children:e.id}),(0,B.jsxs)(`small`,{className:`session-row-meta`,children:[e.channelId,` · `,e.effectiveModel]})]}),(0,B.jsx)(`span`,{className:`session-row-time`,children:Za(e.lastActive)})]},e.id))})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Inspection`})}),(0,B.jsx)(K,{children:v?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Session`}),(0,B.jsx)(`strong`,{children:v.id})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Channel`}),(0,B.jsx)(`strong`,{children:v.channelId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Guild`}),(0,B.jsx)(`strong`,{children:v.guildId||`direct/web`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Model`}),(0,B.jsx)(`strong`,{children:v.effectiveModel})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Messages`}),(0,B.jsx)(`strong`,{children:v.messageCount})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Scheduled tasks`}),(0,B.jsx)(`strong`,{children:v.taskCount})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`RAG`}),(0,B.jsx)(Ga,{value:v.ragEnabled,trueLabel:`on`,falseLabel:`off`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Last active`}),(0,B.jsx)(`strong`,{children:Za(v.lastActive)})]})]}),(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsx)(`span`,{children:`Summary`}),(0,B.jsx)(`p`,{children:v.summary||`No summary stored for this session.`})]}),(0,B.jsx)(`button`,{className:`danger-button`,type:`button`,disabled:h.isPending,onClick:()=>f(!0),children:h.isPending?`Deleting...`:`Delete session`})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Select a session to inspect it.`})})]})]}),(0,B.jsx)(ri,{open:d,onOpenChange:f,children:(0,B.jsxs)(ii,{size:`sm`,role:`alertdialog`,children:[(0,B.jsxs)(ai,{children:[(0,B.jsx)(oi,{children:`Delete session?`}),(0,B.jsx)(si,{children:`This will permanently remove the session and all associated audit events.`})]}),(0,B.jsxs)(ci,{children:[(0,B.jsx)(li,{className:`ghost-button`,children:`Cancel`}),(0,B.jsx)(li,{className:`danger-button`,onClick:()=>{v&&h.mutate(v.id)},children:`Delete`})]})]})})]})}function vg(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yg=vg();function bg(e){yg=e}var xg={exec:()=>null};function Sg(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(wg.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Cg=(()=>{try{return!0}catch{return!1}})(),wg={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Tg=/^(?:[ \t]*(?:\n|$))+/,Eg=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Dg=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Og=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,kg=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ag=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,jg=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Mg=Sg(jg).replace(/bull/g,Ag).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Ng=Sg(jg).replace(/bull/g,Ag).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Pg=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Fg=/^[^\n]+/,Ig=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Lg=Sg(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Ig).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Rg=Sg(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ag).getRegex(),zg=`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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Bg=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Vg=Sg(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Bg).replace(`tag`,zg).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Hg=Sg(Pg).replace(`hr`,Og).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,zg).getRegex(),Ug={blockquote:Sg(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Hg).getRegex(),code:Eg,def:Lg,fences:Dg,heading:kg,hr:Og,html:Vg,lheading:Mg,list:Rg,newline:Tg,paragraph:Hg,table:xg,text:Fg},Wg=Sg(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Og).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,zg).getRegex(),Gg={...Ug,lheading:Ng,table:Wg,paragraph:Sg(Pg).replace(`hr`,Og).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Wg).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,zg).getRegex()},Kg={...Ug,html:Sg(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Bg).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:xg,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Sg(Pg).replace(`hr`,Og).replace(`heading`,` *#{1,6} *[^
73
- ]`).replace(`lheading`,Mg).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},qg=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Jg=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Yg=/^( {2,}|\\)\n(?!\s*$)/,Xg=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Zg=/[\p{P}\p{S}]/u,Qg=/[\s\p{P}\p{S}]/u,$g=/[^\s\p{P}\p{S}]/u,e_=Sg(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,Qg).getRegex(),t_=/(?!~)[\p{P}\p{S}]/u,n_=/(?!~)[\s\p{P}\p{S}]/u,r_=/(?:[^\s\p{P}\p{S}]|~)/u,i_=/(?![*_])[\p{P}\p{S}]/u,a_=/(?![*_])[\s\p{P}\p{S}]/u,o_=/(?:[^\s\p{P}\p{S}]|[*_])/u,s_=Sg(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Cg?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),c_=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,l_=Sg(c_,`u`).replace(/punct/g,Zg).getRegex(),u_=Sg(c_,`u`).replace(/punct/g,t_).getRegex(),d_=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,f_=Sg(d_,`gu`).replace(/notPunctSpace/g,$g).replace(/punctSpace/g,Qg).replace(/punct/g,Zg).getRegex(),p_=Sg(d_,`gu`).replace(/notPunctSpace/g,r_).replace(/punctSpace/g,n_).replace(/punct/g,t_).getRegex(),m_=Sg(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,$g).replace(/punctSpace/g,Qg).replace(/punct/g,Zg).getRegex(),h_=Sg(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,i_).getRegex(),g_=Sg(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,o_).replace(/punctSpace/g,a_).replace(/punct/g,i_).getRegex(),__=Sg(/\\(punct)/,`gu`).replace(/punct/g,Zg).getRegex(),v_=Sg(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[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])?)+(?![-_])/).getRegex(),y_=Sg(Bg).replace(`(?:-->|$)`,`-->`).getRegex(),b_=Sg(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,y_).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),x_=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,S_=Sg(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,x_).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),C_=Sg(/^!?\[(label)\]\[(ref)\]/).replace(`label`,x_).replace(`ref`,Ig).getRegex(),w_=Sg(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Ig).getRegex(),T_=Sg(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,C_).replace(`nolink`,w_).getRegex(),E_=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,D_={_backpedal:xg,anyPunctuation:__,autolink:v_,blockSkip:s_,br:Yg,code:Jg,del:xg,delLDelim:xg,delRDelim:xg,emStrongLDelim:l_,emStrongRDelimAst:f_,emStrongRDelimUnd:m_,escape:qg,link:S_,nolink:w_,punctuation:e_,reflink:C_,reflinkSearch:T_,tag:b_,text:Xg,url:xg},O_={...D_,link:Sg(/^!?\[(label)\]\((.*?)\)/).replace(`label`,x_).getRegex(),reflink:Sg(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,x_).getRegex()},k_={...D_,emStrongRDelimAst:p_,emStrongLDelim:u_,delLDelim:h_,delRDelim:g_,url:Sg(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,E_).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Sg(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,E_).getRegex()},A_={...k_,br:Sg(Yg).replace(`{2,}`,`*`).getRegex(),text:Sg(k_.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},j_={normal:Ug,gfm:Gg,pedantic:Kg},M_={normal:D_,gfm:k_,breaks:A_,pedantic:O_},N_={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},P_=e=>N_[e];function F_(e,t){if(t){if(wg.escapeTest.test(e))return e.replace(wg.escapeReplace,P_)}else if(wg.escapeTestNoEncode.test(e))return e.replace(wg.escapeReplaceNoEncode,P_);return e}function I_(e){try{e=encodeURI(e).replace(wg.percentDecode,`%`)}catch{return null}return e}function L_(e,t){let n=e.replace(wg.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(wg.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(wg.slashPipe,`|`);return n}function R_(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function z_(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function B_(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function V_(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function H_(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
70
+ `)),children:s===`all`?`Copied`:`Copy all`}):null]}),o.length?(0,B.jsx)(`div`,{className:`jobs-output-list`,children:o.map(t=>(0,B.jsxs)(`div`,{className:`jobs-output-card`,children:[(0,B.jsxs)(`div`,{className:`jobs-output-actions`,children:[(0,B.jsx)(`small`,{children:`Output`}),(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,onClick:()=>p(Bp(`copy`,t),t),children:s===Bp(`copy`,t)?`Copied`:`Copy`})]}),(0,B.jsx)(`pre`,{className:`jobs-output-pre`,children:t})]},Bp(e.item.key,t)))}):(0,B.jsx)(`p`,{children:`No outputs captured for this job yet.`})]}),(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsx)(`span`,{children:`Runtime`}),e.runtime.length?(0,B.jsx)(`div`,{className:`jobs-runtime-list`,children:e.runtime.map(e=>(0,B.jsxs)(`div`,{className:`jobs-runtime-row`,children:[(0,B.jsx)(`strong`,{children:e.label}),(0,B.jsx)(`small`,{children:e.value})]},e.key))}):(0,B.jsx)(`p`,{children:`No runtime details recorded yet.`})]})]})]})}function Hp(){let e=Zn(),t=j(),n=o(),r=Ss(),[i,a]=(0,R.useState)(``),[s,c]=(0,R.useState)(null),[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)(null),[p,m]=(0,R.useState)(null),h=(0,R.useDeferredValue)(i),_=y({queryKey:[`scheduler`,e.token],queryFn:()=>en(e.token),refetchInterval:15e3}),v=y({queryKey:[`jobs-context`,e.token],queryFn:()=>wt(e.token),refetchInterval:15e3}),b=g({mutationFn:t=>tn(e.token,t),onMutate:async t=>{await n.cancelQueries({queryKey:[`scheduler`,e.token]});let r=n.getQueryData([`scheduler`,e.token]);return n.setQueryData([`scheduler`,e.token],r&&{...r,jobs:Lp(r.jobs,t)}),{previous:r}},onError:(t,i,a)=>{a?.previous&&n.setQueryData([`scheduler`,e.token],a.previous),r.error(`Save failed`,H(t))},onSuccess:t=>{n.setQueryData([`scheduler`,e.token],t)}}),x=g({mutationFn:t=>an(e.token,{jobId:t.jobId,beforeJobId:t.beforeJobId,boardStatus:t.boardStatus}),onSuccess:t=>{n.setQueryData([`scheduler`,e.token],t)},onError:e=>{r.error(`Move failed`,H(e))}}),S=(0,R.useMemo)(()=>new Map((v.data?.sessions||[]).map(e=>[e.sessionId,e])),[v.data?.sessions]),C=(0,R.useMemo)(()=>new Map((v.data?.agents||[]).map(e=>[e.id,e])),[v.data?.agents]),w=(0,R.useMemo)(()=>{let e=(_.data?.jobs||[]).map(e=>{let t=S.get(Ep(e)||``)||null,n=e.agentId||t?.agentId||`unassigned`,r=(C.get(n)||null)?.name||e.agentId||t?.agentId||(n===`unassigned`?`Unassigned`:n),i=Dp(e,t),a=Tp(e.description,28)||Tp(e.action.message,36)||Tp(e.channelId,24)||`No summary`;return{key:e.id,kind:`job`,job:e,session:t,agentKey:n,agentLabel:r,column:i,tone:Op(i),stateLabel:Mp(e,i),summary:a,searchIndex:[e.id,e.name,a,e.action.message,e.description||``,r,e.channelId||``,e.delivery.to].join(` `).toLowerCase()}}),t=(v.data?.suspendedSessions||[]).map(e=>{let t=`blocked:${e.sessionId}`,n=e.agentId||`unassigned`,r=(C.get(n)||null)?.name||e.agentId||(n===`unassigned`?`Unassigned`:n);return{key:t,kind:`blocked`,suspendedSession:e,session:null,agentKey:n,agentLabel:r,column:`review`,tone:`danger`,stateLabel:e.blockedLabel,summary:Tp(e.context.host,24)||Tp(e.prompt,32)||`Needs operator`,searchIndex:[t,e.blockedLabel,e.prompt,e.context.host||``,e.modality,r].join(` `).toLowerCase()}}),n=(v.data?.cards||[]).map(e=>{let t=e.owner.type===`agent`?e.owner.id:`unassigned`,n=(C.get(t)||null)?.name||(e.owner.type===`agent`?e.owner.id:`User ${e.owner.id}`),r=kp(e),i=Tp(e.body,36)||Tp(e.status,28)||Tp(e.source,24)||`No summary`;return{key:`card:${e.id}`,kind:`card`,card:e,session:null,agentKey:t,agentLabel:n,column:r,tone:e.blocked?`danger`:Op(r),stateLabel:e.blocked?`blocked`:e.status||`ready`,summary:i,searchIndex:[e.id,e.title,e.body,e.status,e.source,e.parent||``,n,...e.edges.flatMap(e=>[e.kind,e.fromCardId,e.toCardId])].join(` `).toLowerCase()}});return[...t,...n,...e]},[C,v.data?.cards,v.data?.suspendedSessions,_.data?.jobs,S]),T=(0,R.useMemo)(()=>{let e=h.trim().toLowerCase();return e?w.filter(t=>t.searchIndex.includes(e)):w},[w,h]),E=(0,R.useMemo)(()=>new Map(w.map(e=>[e.key,e])),[w]),D=(0,R.useMemo)(()=>Array.from(new Set(w.map(e=>e.agentKey).filter(e=>e&&e!==`unassigned`))).sort((e,t)=>e.localeCompare(t)),[w]),O=(0,R.useMemo)(()=>[...D].sort((e,t)=>e.localeCompare(t)).join(`\0`),[D]),k=y({queryKey:[`board-budget-summaries`,e.token,O],queryFn:()=>Tt(e.token,D),enabled:D.length>0,staleTime:3e4}),A=(0,R.useMemo)(()=>new Map((k.data?.budgets||[]).map(e=>[e.agentId,e])),[k.data?.budgets]),M=(0,R.useMemo)(()=>new Set(T.map(e=>e.key)),[T]),N=(0,R.useMemo)(()=>wp.map(e=>({...e,items:T.filter(t=>t.column===e.id)})),[T]),P=(0,R.useMemo)(()=>s&&E.get(s)||null,[E,s]);(0,R.useEffect)(()=>{s!==null&&(!P||!M.has(s))&&c(null)},[P,s,M]);let F=(0,R.useMemo)(()=>P?Rp(P):[],[P]),I=(0,R.useMemo)(()=>w.find(e=>e.key===l)||null,[w,l]);function ee(e,t=null){if(!(!I||I.kind!==`job`||I.job.source!==`job`)){if(t===I.job.id){u(null),f(null),m(null);return}x.mutate({jobId:I.job.id,beforeJobId:t,boardStatus:e}),u(null),f(null),m(null)}}return _.isLoading&&!_.data?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading jobs board...`}):_.isError&&!_.data?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(_.error)}):(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{actions:(0,B.jsxs)(`div`,{className:`header-actions`,children:[(0,B.jsx)(`input`,{className:`compact-search jobs-header-search`,value:i,onChange:e=>a(e.target.value),placeholder:`Search jobs`}),(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,onClick:()=>{t({to:`/admin/scheduler`,search:{jobId:void 0}}).catch(Fs)},children:`New Job`})]})}),v.isError?(0,B.jsx)(`p`,{className:`error-banner`,children:H(v.error)}):null,(0,B.jsxs)(`section`,{className:P?`jobs-board-layout has-detail`:`jobs-board-layout`,children:[(0,B.jsx)(`div`,{className:`jobs-columns`,children:N.map(e=>(0,B.jsxs)(`fieldset`,{"aria-label":`${e.title} jobs`,className:p===e.id?`jobs-column jobs-column-${e.id} drop-target`:`jobs-column jobs-column-${e.id}`,onDragOver:t=>{!I||I.kind!==`job`||I.job.source!==`job`||(t.preventDefault(),p!==e.id&&m(e.id))},onDragLeave:t=>{t.currentTarget.contains(t.relatedTarget)||p===e.id&&m(null)},onDrop:t=>{t.preventDefault(),ee(e.id,null)},children:[(0,B.jsxs)(`div`,{className:`jobs-column-header`,children:[(0,B.jsx)(`strong`,{children:e.title}),(0,B.jsx)(`span`,{children:e.items.length})]}),(0,B.jsx)(`div`,{className:`jobs-column-body`,children:e.items.length?e.items.map(t=>(0,B.jsx)(`div`,{className:[`jobs-card-frame`,d===t.key?`drop-target`:``,t.key===l?`dragging`:``].filter(Boolean).join(` `),children:(0,B.jsx)(Ip,{item:t,budget:A.get(t.agentKey)||null,selected:t.key===P?.key,draggable:t.kind===`job`&&t.job.source===`job`,onSelect:()=>c(e=>e===t.key?null:t.key),onDragStart:e=>{t.kind!==`job`||t.job.source!==`job`||(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t.key),u(t.key))},onDragEnd:()=>{u(null),f(null),m(null)},onDragOver:n=>{!I||I.kind!==`job`||I.job.source!==`job`||t.kind!==`job`||t.job.source!==`job`||(n.preventDefault(),n.stopPropagation(),d!==t.key&&f(t.key),p!==e.id&&m(e.id))},onDragLeave:e=>{let n=e.relatedTarget;n instanceof Node&&e.currentTarget.contains(n)||d===t.key&&f(null)},onDrop:n=>{t.kind!==`job`||t.job.source!==`job`||(n.preventDefault(),n.stopPropagation(),ee(e.id,t.job.id))}})},t.key)):(0,B.jsx)(`div`,{className:`jobs-column-empty`,children:`No jobs`})})]},e.id))}),P?(0,B.jsx)(Vp,{item:P,runtime:F,agents:v.data?.agents||[],savePending:b.isPending,onUpdate:e=>b.mutate(e)}):null]})]})}var Up=128*1024,Wp=3e4,Gp=[{value:`off`,label:`Off`,activeTone:`is-off`},{value:`on`,label:`On`},{value:`debug`,label:`Debug`}],Kp={off:{logLevel:`silent`,logRequests:!1,debugModelResponses:!1},on:{logLevel:`info`,logRequests:!1,debugModelResponses:!1},debug:{logLevel:`debug`,logRequests:!0,debugModelResponses:!0}};function qp(e){if(e==null)return`missing`;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`],n=e/1024;for(let e of t){if(n<1024||e===t.at(-1))return`${n.toFixed(n>=10?0:1)} ${e}`;n/=1024}return`${e} B`}function Jp(e){return e.exists?e.readable?`readable`:`unreadable`:`missing`}function Yp(e,t){let n=t?.effectiveLevel??e?.ops.logLevel;return n===Kp.off.logLevel?`off`:n===Kp.debug.logLevel||t?.logRequests.effective===!0||t?.debugModelResponses.effective===!0||e?.ops.logRequests===!0||e?.ops.debugModelResponses===!0?`debug`:`on`}function Xp(e,t){return t?t.forcedLevel?`Current mode: ${e} (forced by runtime)`:t.logRequests.envEnabled||t.debugModelResponses.envEnabled?`Current mode: ${e} (enabled by runtime flag)`:`Current mode: ${e}`:`Current mode: ${e}`}function Zp(e,t){let n=Kp[t];return{...e,ops:{...e.ops,...n}}}function Qp(){let e=Zn(),t=o(),n=Ss(),[r,i]=(0,R.useState)(null),a=(0,R.useRef)(null),s=y({queryKey:[`admin-logs`,e.token,r],queryFn:()=>ze(e.token,{fileId:r,tailBytes:Up}),placeholderData:e=>e,refetchOnWindowFocus:!1}),c=y({queryKey:[`config`,e.token],queryFn:()=>Nt(e.token),refetchOnWindowFocus:!1,staleTime:Wp}),l=s.data?.logging,u=Yp(c.data?.config??null,l),d=g({mutationFn:async t=>{let n=c.data?.config;if(!n)throw Error(`Runtime config has not loaded yet.`);let r=await zt(e.token,Zp(n,t)),i=await ct(e.token);if(i.status!==`ok`)throw Error(i.message||`Gateway reload failed.`);return r},onSuccess:r=>{t.setQueryData([`config`,e.token],r),n.success(`Logging mode saved.`),s.refetch()},onError:e=>{n.error(`Logging mode update failed`,H(e))}}),f=s.data?.files||[],p=s.data?.selected,m=(0,R.useMemo)(()=>{let e=p?.fileId||r;return f.find(t=>t.id===e)||f.find(e=>e.readable)||f[0]||null},[f,p?.fileId,r]);return(0,R.useEffect)(()=>{!m||m.id===r||i(m.id)},[m,r]),(0,R.useEffect)(()=>{let e=a.current;!e||!p||(e.scrollTop=e.scrollHeight)},[p]),(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{description:`Gateway runtime log files`,actions:(0,B.jsx)(Z,{type:`button`,variant:`outline`,disabled:s.isFetching,onClick:()=>void s.refetch(),children:`Refresh`})}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Logging`}),(0,B.jsx)(vo,{children:c.data?Xp(u,l):c.isError?`Runtime config unavailable.`:`Loading runtime config...`})]}),(0,B.jsx)(K,{children:(0,B.jsx)(Za,{ariaLabel:`Logging mode`,value:u,options:Gp,disabled:!c.data||c.isFetching||d.isPending,onChange:e=>d.mutate(e)})})]}),(0,B.jsxs)(`div`,{className:`two-column-grid logs-layout`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Files`}),(0,B.jsx)(vo,{children:`${f.length} configured log${f.length===1?``:`s`}`})]}),(0,B.jsx)(K,{children:s.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading log files...`}):f.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No log files are configured.`}):(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:f.map(e=>(0,B.jsxs)(`button`,{className:e.id===m?.id?`selectable-row active`:`selectable-row`,type:`button`,onClick:()=>i(e.id),children:[(0,B.jsx)(`div`,{className:`session-row-main`,children:(0,B.jsx)(`strong`,{children:e.label})}),(0,B.jsx)(`span`,{className:`session-row-time`,children:Jp(e)})]},e.id))})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:m?.label||`Log tail`}),(0,B.jsx)(vo,{children:m?.description||`Select a log file.`})]}),(0,B.jsx)(K,{children:m?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Status`}),(0,B.jsx)(`strong`,{children:(0,B.jsx)(Qa,{value:m.readable,trueLabel:`readable`,falseLabel:Jp(m),falseTone:m.exists?`danger`:void 0})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Size`}),(0,B.jsx)(`strong`,{children:qp(m.sizeBytes)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Modified`}),(0,B.jsx)(`strong`,{children:m.mtime?ao(m.mtime):`missing`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Path`}),(0,B.jsx)(`strong`,{children:m.path})]})]}),m.error?(0,B.jsx)(`div`,{className:`empty-state error`,children:m.error}):p?(0,B.jsxs)(B.Fragment,{children:[p.truncated?(0,B.jsxs)(`p`,{className:`muted-copy`,children:[`Showing the last `,qp(p.tailBytes),`.`]}):null,(0,B.jsx)(`pre`,{className:`log-viewer`,ref:a,children:p.content||`(empty log file)`})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`This log file is not available yet.`})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Select a log file.`})})]})]})]})}var $p=2e3,em=3*6e4;function tm(e){return!e||Object.keys(e).length===0?``:JSON.stringify(e,null,2)}function nm(e){return e?.auth===`oauth`?`oauth`:e?.headers&&Object.keys(e.headers).length>0?`headers`:`none`}function rm(e){return{originalName:e?.name||null,name:e?.name||``,transport:e?.config.transport||`http`,enabled:e?.enabled??!0,command:e?.config.command||``,args:(e?.config.args||[]).join(`
71
+ `),cwd:e?.config.cwd||``,url:e?.config.url||``,envJson:tm(e?.config.env),authMode:e?nm(e.config):`oauth`,headersJson:tm(e?.config.headers)}}function im(e,t){let n=e.trim();if(!n)return;let r;try{r=JSON.parse(n)}catch(e){throw Error(`${t}: ${e instanceof Error?e.message:String(e)}`)}if(!r||typeof r!=`object`||Array.isArray(r))throw Error(`${t} must be a JSON object.`);return Object.fromEntries(Object.entries(r).map(([e,t])=>[e,String(t??``)]).filter(([e])=>e.trim()))}function am(e){return{name:e.name.trim(),config:{transport:e.transport,...e.enabled?{}:{enabled:!1},...e.transport===`stdio`?{command:e.command.trim(),args:e.args.split(`
72
+ `).map(e=>e.trim()).filter(Boolean),...e.cwd.trim()?{cwd:e.cwd.trim()}:{},...e.envJson.trim()?{env:im(e.envJson,`Environment JSON`)}:{}}:{url:e.url.trim(),...e.authMode===`oauth`?{auth:`oauth`}:{},...e.authMode===`headers`&&e.headersJson.trim()?{headers:im(e.headersJson,`Headers JSON`)}:{}}}}}function om(e){return e.state===`connected`?{label:`connected`,connected:!0}:e.state===`expired`?{label:`expired`,connected:!1}:{label:`login required`,connected:!1}}function sm(e){return new Promise(t=>setTimeout(t,e))}function cm(){let e=Zn(),t=o(),n=Ss(),[r,i]=(0,R.useState)(null),[a,s]=(0,R.useState)(rm()),[c,l]=(0,R.useState)(null),u=(0,R.useRef)(!1),d=y({queryKey:[`mcp`,e.token],queryFn:()=>on(e.token)}),f=g({mutationFn:()=>fn(e.token,am(a)),onSuccess:r=>{t.setQueryData([`mcp`,e.token],r),i(a.name.trim()),s(rm(r.servers.find(e=>e.name===a.name.trim()))),n.success(`Saved MCP server ${a.name.trim()}.`)},onError:e=>{n.error(`Save failed`,H(e))}}),p=g({mutationFn:()=>pn(e.token,a.name.trim()),onSuccess:r=>{t.setQueryData([`mcp`,e.token],r),i(null),s(rm()),n.success(`MCP server deleted.`)},onError:e=>{n.error(`Delete failed`,H(e))}}),m=g({mutationFn:async()=>{u.current=!1;let n=am(a),r=await fn(e.token,n);t.setQueryData([`mcp`,e.token],r);let i=await mn(e.token,n.name);l(i.authorizationUrl),window.open(i.authorizationUrl,`_blank`,`noopener`);let o=Date.now()+Math.max($p,Math.min(em,i.expiresAt-Date.now()));for(;Date.now()<o;){if(u.current)throw Error(`Authorization cancelled.`);if(await sm($p),(await hn(e.token,n.name)).auth.state===`connected`)return n.name}throw Error(`Timed out waiting for authorization. Complete the login in the opened tab and try again.`)},onSuccess:async r=>{l(null),await t.invalidateQueries({queryKey:[`mcp`,e.token]}),i(r),n.success(`Connected to ${r} via OAuth.`)},onError:e=>{l(null),n.error(`OAuth connection failed`,H(e))}}),h=g({mutationFn:()=>gn(e.token,a.name.trim()),onSuccess:r=>{t.setQueryData([`mcp`,e.token],r),n.success(`OAuth credentials cleared.`)},onError:e=>{n.error(`Disconnect failed`,H(e))}}),_=d.data?.servers.find(e=>e.name===r)||null;(0,R.useEffect)(()=>{if(_){s(rm(_));return}r||s(rm())},[r,_]),(0,R.useEffect)(()=>()=>{u.current=!0},[]);let v=_?.auth,b=v?.state===`connected`;return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{actions:(0,B.jsx)(Z,{variant:`ghost`,type:`button`,onClick:()=>{i(null),s(rm())},children:`New server`})}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Servers`}),(0,B.jsx)(vo,{children:`${d.data?.servers.length||0} configured server${d.data?.servers.length===1?``:`s`}`})]}),(0,B.jsx)(K,{children:d.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading MCP servers...`}):d.data?.servers.length?(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:d.data.servers.map(e=>{let t=e.auth.method===`oauth`?om(e.auth):null;return(0,B.jsxs)(`button`,{className:e.name===r?`selectable-row active`:`selectable-row`,type:`button`,onClick:()=>i(e.name),children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.name}),(0,B.jsx)(`small`,{children:e.summary})]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[t?(0,B.jsx)(Qa,{value:t.connected,trueLabel:`oauth`,falseLabel:t.label,falseTone:`danger`}):null,(0,B.jsx)(Qa,{value:e.enabled,trueLabel:`active`,falseLabel:`inactive`})]})]},e.name)})}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No MCP servers are configured yet. Add a remote server with its URL and connect it with OAuth, or run a local stdio command.`})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:_?`Edit ${_.name}`:`New server`}),(0,B.jsx)(vo,{children:`Changes apply on the next agent turn.`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`stack-form`,children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Name`}),(0,B.jsx)(Y,{value:a.name,onChange:e=>s(t=>({...t,name:e.target.value})),placeholder:`github`}),(0,B.jsx)(Yo,{children:`Lowercase letters, numbers, - and _. Used as the tool prefix.`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Transport`}),(0,B.jsxs)(vs,{value:a.transport,onChange:e=>s(t=>({...t,transport:e.target.value})),children:[(0,B.jsx)(Q,{value:`http`,children:`http — remote server`}),(0,B.jsx)(Q,{value:`sse`,children:`sse — remote server (legacy)`}),(0,B.jsx)(Q,{value:`stdio`,children:`stdio — local command`})]})]})]}),(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:a.enabled,onCheckedChange:e=>s(t=>({...t,enabled:e}))}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Server state`})})]}),a.transport===`stdio`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Command`}),(0,B.jsx)(Y,{value:a.command,onChange:e=>s(t=>({...t,command:e.target.value})),placeholder:`docker`})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Arguments`}),(0,B.jsx)(ts,{rows:4,value:a.args,onChange:e=>s(t=>({...t,args:e.target.value})),placeholder:`One argument per line`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Working directory`}),(0,B.jsx)(Y,{value:a.cwd,onChange:e=>s(t=>({...t,cwd:e.target.value})),placeholder:`/workspace`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Environment JSON`}),(0,B.jsx)(ts,{rows:5,value:a.envJson,onChange:e=>s(t=>({...t,envJson:e.target.value})),placeholder:`{"GITHUB_TOKEN":"..."}`})]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`URL`}),(0,B.jsx)(Y,{value:a.url,onChange:e=>s(t=>({...t,url:e.target.value})),placeholder:`https://mcp.example.com/mcp`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Authentication`}),(0,B.jsxs)(vs,{value:a.authMode,onChange:e=>s(t=>({...t,authMode:e.target.value})),children:[(0,B.jsx)(Q,{value:`oauth`,children:`OAuth — log in via browser`}),(0,B.jsx)(Q,{value:`headers`,children:`Custom headers (API key / bearer token)`}),(0,B.jsx)(Q,{value:`none`,children:`None`})]}),(0,B.jsx)(Yo,{children:a.authMode===`oauth`?`The gateway discovers the authorization server, registers a client, and refreshes tokens automatically.`:a.authMode===`headers`?`Headers are sent with every request to the server.`:`Requests are sent without credentials.`})]}),a.authMode===`headers`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Headers JSON`}),(0,B.jsx)(ts,{rows:5,value:a.headersJson,onChange:e=>s(t=>({...t,headersJson:e.target.value})),placeholder:`{"Authorization":"Bearer ..."}`})]}):null,a.authMode===`oauth`?(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsxs)(qo,{children:[(0,B.jsx)(J,{children:`OAuth connection`}),(0,B.jsxs)(Yo,{children:[m.isPending?`Waiting for you to approve access in the browser...`:b?`Connected. Tokens refresh automatically.`:v?.state===`expired`?`The session expired. Reconnect to continue.`:`Not connected yet. Saving happens automatically when you connect.`,c&&m.isPending?(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(`a`,{href:c,target:`_blank`,rel:`noreferrer`,children:`Open the login page`}),` `,`if it did not open automatically.`]}):null]})]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{type:`button`,loading:m.isPending,disabled:m.isPending||!a.name.trim()||!a.url.trim(),onClick:()=>m.mutate(),children:m.isPending?`Waiting...`:b?`Reconnect`:`Connect`}),b?(0,B.jsx)(Z,{variant:`ghost`,type:`button`,loading:h.isPending,disabled:h.isPending,onClick:()=>h.mutate(),children:`Disconnect`}):null]})]}):null]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{type:`button`,loading:f.isPending,disabled:f.isPending,onClick:()=>f.mutate(),children:f.isPending?`Saving...`:`Save server`}),_?(0,B.jsx)(Z,{variant:`danger`,type:`button`,loading:p.isPending,disabled:p.isPending,onClick:()=>p.mutate(),children:p.isPending?`Deleting...`:`Delete server`}):null]}),_?(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsx)(`span`,{children:`Summary`}),(0,B.jsx)(`p`,{children:_.summary})]}):null]})})]})]})]})}function lm(e){return e.usageDaily!==null}function um(e,t){let n=e.usageMonthly?.totalTokens||0,r=t.usageMonthly?.totalTokens||0;if(n!==r)return n-r;let i=e.usageMonthly?.callCount||0,a=t.usageMonthly?.callCount||0;return i===a?e.id.localeCompare(t.id):i-a}var dm=[`hybridai`,`codex`,`openrouter`,`mistral`,`huggingface`,`ollama`,`lmstudio`,`llamacpp`,`vllm`];function fm(e){if(e.backend)return e.backend;let t=e.id.trim().toLowerCase();return t.startsWith(`openai-codex/`)?`codex`:t.startsWith(`openrouter/`)?`openrouter`:t.startsWith(`mistral/`)?`mistral`:t.startsWith(`huggingface/`)?`huggingface`:null}function pm(e,t){let n=dm.indexOf(e),r=dm.indexOf(t);if(n!==-1||r!==-1){if(n===-1)return 1;if(r===-1)return-1;if(n!==r)return n-r}return e.localeCompare(t)}function mm(e){let t=new Set(Object.keys(e?.providerStatus||{}));for(let n of e?.models||[]){let e=fm(n);e&&t.add(e)}return[...t].sort(pm).map(t=>({name:t,status:e?.providerStatus?.[t]||null}))}var hm={model:(e,t)=>X(e.id,t.id),backend:(e,t)=>X(e.backend||`remote`,t.backend||`remote`)||X(e.id,t.id),context:(e,t)=>os(e.contextWindow,t.contextWindow)||X(e.id,t.id),monthlyUsage:um},gm={context:`desc`,monthlyUsage:`desc`};function _m(e){return{defaultModel:e?.defaultModel||``}}function vm(e){return[e.isReasoning?`reasoning`:``,e.thinkingFormat||``,e.family||``].filter(Boolean).join(` · `)}function ym(){let e=Zn(),t=o(),n=Ss(),[r,i]=(0,R.useState)(``),[a,s]=(0,R.useState)(_m()),c=y({queryKey:[`models`,e.token],queryFn:()=>Qt(e.token)}),l=g({mutationFn:()=>$t(e.token,{defaultModel:a.defaultModel}),onSuccess:r=>{t.setQueryData([`models`,e.token],r),s(_m(r)),t.invalidateQueries({queryKey:[`overview`]}),n.success(`Default model is now ${r.defaultModel}.`)},onError:e=>{n.error(`Save failed`,H(e))}});(0,R.useEffect)(()=>{c.data&&s(e=>e.defaultModel?e:_m(c.data))},[c.data]);let{sortedRows:u,sortState:d,toggleSort:f}=qa((c.data?.models||[]).filter(e=>[e.id,e.backend||``,e.family||``,e.parameterSize||``].join(` `).toLowerCase().includes(r.trim().toLowerCase())),{initialSort:{key:`monthlyUsage`,direction:`desc`},sorters:hm,defaultDirections:gm}),p=mm(c.data),m=(c.data?.models||[]).filter(lm);return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{actions:(0,B.jsx)(Y,{className:`compact-search`,value:r,onChange:e=>i(e.target.value),placeholder:`Filter models`})}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Provider status`})}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`list-stack`,children:[p.map(({name:e,status:t})=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e}),(0,B.jsx)(`small`,{children:t?.reachable?`${t.detail||(typeof t.latencyMs==`number`?`${t.latencyMs}ms`:`ready`)} · ${t.modelCount??0} models`:t?t.error||`unreachable`:`Visible in catalog · no live health data`})]}),(0,B.jsxs)(`span`,{className:t?.reachable?`list-status list-status-success`:t?`list-status list-status-danger`:`list-status`,children:[(0,B.jsx)(`span`,{className:t?.reachable?`status-dot status-dot-success`:t?`status-dot status-dot-danger`:`status-dot`}),t?.reachable?`healthy`:t?`down`:`catalog`]})]},e)),p.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No provider health checks available.`}):null]})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Selection`})}),(0,B.jsx)(K,{children:c.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading model catalog...`}):(0,B.jsxs)(`div`,{className:`stack-form`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Default model`}),(0,B.jsxs)(vs,{value:a.defaultModel,onChange:e=>s(t=>({...t,defaultModel:e.target.value})),children:[(0,B.jsx)(Q,{value:``,children:`Select model`}),(c.data?.models||[]).map(e=>(0,B.jsx)(Q,{value:e.id,children:e.id},e.id))]})]}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:l.isPending,onClick:()=>l.mutate(),children:l.isPending?`Saving...`:`Save selection`})})]})})]})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Catalog`}),(0,B.jsx)(vo,{children:`${so(u.length,`model`)} visible`})]}),(0,B.jsx)(K,{children:c.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading model catalog...`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Ja,{label:`Model`,sortKey:`model`,sortState:d,onToggle:f}),(0,B.jsx)(Ja,{label:`Backend`,sortKey:`backend`,sortState:d,onToggle:f}),(0,B.jsx)(Ja,{label:`Context`,sortKey:`context`,sortState:d,onToggle:f}),(0,B.jsx)(Ja,{label:`Monthly usage`,sortKey:`monthlyUsage`,sortState:d,onToggle:f})]})}),(0,B.jsxs)(`tbody`,{children:[u.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.id}),vm(e)?(0,B.jsx)(`small`,{children:vm(e)}):null]}),(0,B.jsx)(`td`,{children:e.backend||`remote`}),(0,B.jsx)(`td`,{children:e.contextWindow?$a(e.contextWindow):`unknown`}),(0,B.jsx)(`td`,{children:e.usageMonthly?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`strong`,{children:$a(e.usageMonthly.totalTokens)}),(0,B.jsx)(`small`,{children:to({inputTokens:e.usageMonthly.totalInputTokens??0,outputTokens:e.usageMonthly.totalOutputTokens??0})}),(0,B.jsxs)(`small`,{children:[ro(e.usageMonthly.totalCostUsd),` ·`,` `,so(e.usageMonthly.callCount,`call`)]})]}):(0,B.jsx)(`small`,{children:`No usage recorded`})})]},e.id)),u.length===0?(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{colSpan:4,children:(0,B.jsx)(`div`,{className:`empty-state`,children:`No models match this filter.`})})}):null]})]})})})]}),m.length>0?(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Recent daily activity`}),(0,B.jsx)(vo,{children:`Updated ${io(new Date().toISOString())}`})]}),(0,B.jsx)(K,{children:(0,B.jsx)(`div`,{className:`list-stack`,children:m.sort((e,t)=>t.usageDaily.totalTokens-e.usageDaily.totalTokens).slice(0,6).map(e=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.id}),(0,B.jsxs)(`small`,{children:[to({inputTokens:e.usageDaily.totalInputTokens??0,outputTokens:e.usageDaily.totalOutputTokens??0}),` `,`· `,so(e.usageDaily.callCount,`call`),` today`]})]}),(0,B.jsx)(`span`,{children:ro(e.usageDaily.totalCostUsd??0)})]},`${e.id}-daily`))})})]}):null]})}var bm={root:`_root_16nbt_1`,viewport:`_viewport_16nbt_10`,scrollbar:`_scrollbar_16nbt_29`,thumb:`_thumb_16nbt_55`},xm=(0,R.createContext)(null);function Sm(e){let t=(0,R.useContext)(xm);if(!t)throw Error(`${e} must be used within <ScrollArea>`);return t}function Cm({className:e,children:t,...n}){let r=(0,R.useRef)(null),i=(0,R.useRef)(null),[a,o]=(0,R.useState)({thumbSize:0,thumbOffset:0,visible:!1}),s=(0,R.useCallback)(()=>{let e=r.current,t=i.current;if(!e||!t){o(e=>e.visible?{...e,visible:!1}:e);return}let{scrollTop:n,scrollHeight:a,clientHeight:s}=e;if(a<=s+1){o(e=>e.visible?{...e,visible:!1}:e);return}let c=t.clientHeight;if(c<=0)return;let l=s/a,u=Math.max(20,c*l),d=a-s,f=c-u,p=d<=0?0:n/d*f;o(e=>e.visible&&e.thumbSize===u&&e.thumbOffset===p?e:{thumbSize:u,thumbOffset:p,visible:!0})},[]),c=(0,R.useCallback)(e=>{r.current=e,requestAnimationFrame(s)},[s]),l=(0,R.useCallback)(e=>{i.current=e,requestAnimationFrame(s)},[s]);(0,R.useLayoutEffect)(()=>{let e=r.current;if(!e)return;s();let t=0,n=()=>{t||=requestAnimationFrame(()=>{t=0,s()})};e.addEventListener(`scroll`,n,{passive:!0});let a=new ResizeObserver(()=>s());return a.observe(e),e.firstElementChild&&a.observe(e.firstElementChild),i.current&&a.observe(i.current),()=>{t&&cancelAnimationFrame(t),e.removeEventListener(`scroll`,n),a.disconnect()}},[s]);let u={viewportRef:r,setViewportEl:c,scrollState:a,registerScrollbarTrack:l};return(0,B.jsx)(xm.Provider,{value:u,children:(0,B.jsx)(`div`,{className:V(bm.root,e),...n,children:t})})}function wm({className:e,children:t,ref:n,...r}){let i=Sm(`ScrollAreaViewport`);return(0,B.jsx)(`div`,{ref:e=>{i.setViewportEl(e),typeof n==`function`?n(e):n&&typeof n==`object`&&(n.current=e)},className:V(bm.viewport,e),...r,children:t})}function Tm({className:e,children:t,...n}){let r=Sm(`ScrollAreaScrollbar`);return(0,B.jsx)(`div`,{ref:r.registerScrollbarTrack,"data-orientation":`vertical`,"data-state":r.scrollState.visible?`visible`:`hidden`,"aria-hidden":`true`,className:V(bm.scrollbar,e),...n,children:t})}function Em({className:e,...t}){let n=Sm(`ScrollAreaThumb`),{thumbSize:r,thumbOffset:i}=n.scrollState;return(0,B.jsx)(`div`,{className:V(bm.thumb,e),style:{height:r,transform:`translateY(${i}px)`},onPointerDown:e=>{if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=n.viewportRef.current,i=e.currentTarget.parentElement??null;if(!t||!i)return;let a=e.clientY,o=t.scrollTop,s=i.clientHeight,c=t.scrollHeight-t.clientHeight,l=Math.max(1,s-r),u=e=>{t.scrollTop=o+(e.clientY-a)/l*c},d=()=>{window.removeEventListener(`pointermove`,u),window.removeEventListener(`pointerup`,d),window.removeEventListener(`pointercancel`,d)};window.addEventListener(`pointermove`,u),window.addEventListener(`pointerup`,d),window.addEventListener(`pointercancel`,d)},...t})}var Dm={trigger:`_trigger_1fi1d_1`,value:`_value_1fi1d_40`,icon:`_icon_1fi1d_52`,popup:`_popup_1fi1d_66`,"select-in":`_select-in_1fi1d_1`,popupHeader:`_popupHeader_1fi1d_111`,popupBodyPlain:`_popupBodyPlain_1fi1d_117`,popupBody:`_popupBody_1fi1d_117`,popupRail:`_popupRail_1fi1d_131`,listScroll:`_listScroll_1fi1d_151`,list:`_list_1fi1d_151`,group:`_group_1fi1d_168`,groupLabel:`_groupLabel_1fi1d_176`,separator:`_separator_1fi1d_184`,empty:`_empty_1fi1d_190`,item:`_item_1fi1d_197`,itemIndicator:`_itemIndicator_1fi1d_214`,itemText:`_itemText_1fi1d_248`,itemBody:`_itemBody_1fi1d_256`,itemSubtitle:`_itemSubtitle_1fi1d_272`,itemMeta:`_itemMeta_1fi1d_279`},Om=(0,R.createContext)(null);function km(e){let t=(0,R.useContext)(Om);if(!t)throw Error(`${e} must be used within <Select>`);return t}function Am({value:e,defaultValue:t=``,onValueChange:n,open:r,defaultOpen:i,onOpenChange:a,disabled:o=!1,children:s}){let c=e!==void 0,[l,u]=(0,R.useState)(t),d=c?e:l,[f,p]=(0,R.useState)(null),[m,h]=(0,R.useState)(null),g=(0,R.useId)(),_=(0,R.useId)(),v=(0,R.useCallback)(e=>{c||u(e),n?.(e)},[c,n]),y=(0,R.useCallback)(e=>`${_}-item-${Wm(e)}`,[_]),b=(0,R.useMemo)(()=>({value:d,selectValue:v,listEl:f,setListEl:p,listId:g,highlightedValue:m,setHighlightedValue:h,disabled:o,getItemId:y}),[d,v,f,g,m,o,y]);return(0,B.jsx)(Fi,{open:r,defaultOpen:i,onOpenChange:(0,R.useCallback)(e=>{o&&e||(e||h(null),a?.(e))},[o,a]),children:(0,B.jsx)(Om.Provider,{value:b,children:s})})}function jm({children:e,className:t,onClick:n,onKeyDown:r,...i}){let a=Pi(`SelectTrigger`),o=km(`SelectTrigger`);return(0,B.jsx)(`button`,{ref:a.setTriggerEl,type:`button`,role:`combobox`,"aria-haspopup":`listbox`,"aria-expanded":a.open,"aria-controls":a.open?o.listId:void 0,"aria-disabled":o.disabled||void 0,"data-state":a.open?`open`:`closed`,"data-disabled":o.disabled?``:void 0,disabled:o.disabled,className:V(Dm.trigger,t),onClick:e=>{n?.(e),!e.defaultPrevented&&(a.open||o.setHighlightedValue(o.value||null),a.toggle())},onKeyDown:e=>{r?.(e),!e.defaultPrevented&&(e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o.setHighlightedValue(o.value||null),a.setOpen(!0))},...i,children:e})}function Mm({placeholder:e,children:t,className:n,...r}){let i=km(`SelectValue`),a=t==null||t===``||i.value===``;return(0,B.jsx)(`span`,{className:V(Dm.value,n),"data-placeholder":a?``:void 0,...r,children:a?e:t})}function Nm({className:e,children:t,...n}){return(0,B.jsx)(`span`,{"aria-hidden":`true`,className:V(Dm.icon,e),...n,children:t??(0,B.jsx)(or,{width:14,height:14})})}var Pm=e=>{let t=e.querySelector(`input`);if(t){t.focus();return}e.querySelector(`[role="listbox"]`)?.focus()};function Fm({align:e=`start`,sideOffset:t=6,header:n,rail:r,children:i,className:a,...o}){let s=Pi(`SelectContent`),c=km(`SelectContent`),l=(0,R.useRef)({buffer:``,timer:0}),u=n!=null&&n!==!1,d=r!=null&&r!==!1;(0,R.useEffect)(()=>{let e=s.contentEl;if(!s.open||!e||!c.highlightedValue)return;let t=c.getItemId(c.highlightedValue);e.querySelector(`#${Gm(t)}`)?.scrollIntoView({block:`nearest`})},[s.open,s.contentEl,c.highlightedValue,c.getItemId]),(0,R.useEffect)(()=>{let e=l.current;return()=>{e.timer&&window.clearTimeout(e.timer)}},[]);let f=(0,R.useCallback)(()=>c.listEl?Array.from(c.listEl.querySelectorAll(`[role="option"]:not([aria-disabled="true"])`)):[],[c.listEl]),p=(0,R.useCallback)(e=>{let t=f();if(t.length===0)return;let n=c.highlightedValue?t.findIndex(e=>e.getAttribute(`data-value`)===c.highlightedValue):-1,r;r=e===`first`?0:e===`last`?t.length-1:n<0?e>0?0:t.length-1:(n+e+t.length)%t.length;let i=t[r],a=i?.getAttribute(`data-value`)??null;c.setHighlightedValue(a),i?.scrollIntoView({block:`nearest`})},[f,c.highlightedValue,c.setHighlightedValue]),m=e=>{let t=l.current;t.buffer+=e.toLowerCase(),t.timer&&window.clearTimeout(t.timer),t.timer=window.setTimeout(()=>{t.buffer=``,t.timer=0},500);let n=f();if(n.length===0)return;let r=c.highlightedValue?n.findIndex(e=>e.getAttribute(`data-value`)===c.highlightedValue):-1,i=[...n.slice(r+1),...n.slice(0,r+1)].find(e=>(e.textContent??``).trim().toLowerCase().startsWith(t.buffer));if(i){let e=i.getAttribute(`data-value`);c.setHighlightedValue(e),i.scrollIntoView({block:`nearest`})}},h=e=>{if(e.key===`Tab`){s.setOpen(!1);return}if(e.key===`ArrowDown`){e.preventDefault(),p(1);return}if(e.key===`ArrowUp`){e.preventDefault(),p(-1);return}if(e.key===`Home`){e.preventDefault(),p(`first`);return}if(e.key===`End`){e.preventDefault(),p(`last`);return}if(e.key===`Enter`){if(c.highlightedValue==null)return;e.preventDefault(),c.selectValue(c.highlightedValue),s.setOpen(!1),s.triggerEl?.focus();return}if(!u&&e.key===` `&&c.highlightedValue!=null){e.preventDefault(),c.selectValue(c.highlightedValue),s.setOpen(!1),s.triggerEl?.focus();return}!u&&e.key.length===1&&!e.ctrlKey&&!e.metaKey&&m(e.key)},g=c.highlightedValue?c.getItemId(c.highlightedValue):void 0;return(0,B.jsxs)(Li,{align:e,sideOffset:t,focusOnOpen:Pm,className:V(Dm.popup,a),onKeyDown:h,...o,children:[u?(0,B.jsx)(`div`,{className:Dm.popupHeader,children:n}):null,(0,B.jsxs)(`div`,{className:d?Dm.popupBody:Dm.popupBodyPlain,children:[d?(0,B.jsx)(`div`,{className:Dm.popupRail,children:r}):null,(0,B.jsxs)(Cm,{className:Dm.listScroll,children:[(0,B.jsx)(wm,{ref:c.setListEl,id:c.listId,role:`listbox`,tabIndex:-1,"aria-activedescendant":g,className:Dm.list,children:i}),(0,B.jsx)(Tm,{children:(0,B.jsx)(Em,{})})]})]})]})}function Im({className:e,children:t,...n}){return(0,B.jsx)(`div`,{role:`group`,className:V(Dm.group,e),...n,children:t})}function Lm({className:e,children:t,...n}){return(0,B.jsx)(`div`,{className:V(Dm.groupLabel,e),...n,children:t})}function Rm({className:e,children:t,...n}){return(0,B.jsx)(`div`,{className:V(Dm.empty,e),...n,children:t})}function zm({value:e,disabled:t=!1,textValue:n,children:r,className:i,onClick:a,onPointerEnter:o,...s}){let c=Pi(`SelectItem`),l=km(`SelectItem`),u=l.value===e,d=l.highlightedValue===e;return(0,B.jsx)(`div`,{id:l.getItemId(e),role:`option`,"aria-selected":u,"aria-disabled":t||void 0,"aria-label":n,"data-value":e,"data-state":u?`checked`:`unchecked`,"data-highlighted":d?``:void 0,"data-disabled":t?``:void 0,className:V(Dm.item,i),onClick:n=>{t||(a?.(n),!n.defaultPrevented&&(l.selectValue(e),c.setOpen(!1),c.triggerEl?.focus()))},onPointerEnter:n=>{o?.(n),!n.defaultPrevented&&(t||l.setHighlightedValue(e))},...s,children:r})}function Bm({className:e,children:t,...n}){return(0,B.jsx)(`span`,{className:V(Dm.itemText,e),...n,children:t})}function Vm({className:e,children:t,...n}){return(0,B.jsx)(`span`,{className:V(Dm.itemBody,e),...n,children:t})}function Hm({className:e,children:t,...n}){return(0,B.jsx)(`span`,{className:V(Dm.itemSubtitle,e),...n,children:t})}function Um({className:e,children:t,...n}){return(0,B.jsx)(`span`,{className:V(Dm.itemMeta,e),...n,children:t})}function Wm(e){return e.replace(/[^a-zA-Z0-9_-]/g,`_`)}function Gm(e){return typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,`\\$&`)}var Km={chatPage:`_chatPage_q71kl_1`,chatSidebarHeader:`_chatSidebarHeader_q71kl_36`,chatSidebarContent:`_chatSidebarContent_q71kl_44`,newChatButton:`_newChatButton_q71kl_52`,navLinkIcon:`_navLinkIcon_q71kl_82`,appPreviewDialog:`_appPreviewDialog_q71kl_92`,appPreviewHeader:`_appPreviewHeader_q71kl_102`,appPreviewTitle:`_appPreviewTitle_q71kl_111`,appPreviewActions:`_appPreviewActions_q71kl_120`,appPreviewLink:`_appPreviewLink_q71kl_127`,appPreviewFrame:`_appPreviewFrame_q71kl_145`,sidebarLabel:`_sidebarLabel_q71kl_152`,sidebarListHeader:`_sidebarListHeader_q71kl_162`,sidebarScopeToggle:`_sidebarScopeToggle_q71kl_169`,sidebarScopeButton:`_sidebarScopeButton_q71kl_178`,sidebarScopeButtonActive:`_sidebarScopeButtonActive_q71kl_200`,sessionList:`_sessionList_q71kl_213`,sessionItemRow:`_sessionItemRow_q71kl_222`,sessionItem:`_sessionItem_q71kl_222`,sessionItemPending:`_sessionItemPending_q71kl_253`,sessionPulse:`_sessionPulse_q71kl_1`,sessionTitle:`_sessionTitle_q71kl_267`,sessionTime:`_sessionTime_q71kl_276`,sessionSnippet:`_sessionSnippet_q71kl_281`,sessionItemActive:`_sessionItemActive_q71kl_289`,sessionDeleteButton:`_sessionDeleteButton_q71kl_294`,sessionDeleteIcon:`_sessionDeleteIcon_q71kl_330`,sidebarSearchWrap:`_sidebarSearchWrap_q71kl_343`,sidebarSearch:`_sidebarSearch_q71kl_343`,sidebarStatus:`_sidebarStatus_q71kl_367`,chatMobileTrigger:`_chatMobileTrigger_q71kl_386`,chatTopbar:`_chatTopbar_q71kl_391`,mobileQrButton:`_mobileQrButton_q71kl_405`,mobileQrIcon:`_mobileQrIcon_q71kl_429`,mobileQrOverlay:`_mobileQrOverlay_q71kl_441`,mobileQrDialog:`_mobileQrDialog_q71kl_452`,mobileQrHeader:`_mobileQrHeader_q71kl_461`,mobileQrClose:`_mobileQrClose_q71kl_475`,mobileQrImage:`_mobileQrImage_q71kl_488`,mobileQrLink:`_mobileQrLink_q71kl_502`,chatMain:`_chatMain_q71kl_511`,messageArea:`_messageArea_q71kl_523`,messageList:`_messageList_q71kl_536`,sidebarCollapseButton:`_sidebarCollapseButton_q71kl_545`,emptyState:`_emptyState_q71kl_549`,greeting:`_greeting_q71kl_559`,messageBlock:`_messageBlock_q71kl_568`,jumpToLatest:`_jumpToLatest_q71kl_580`,messageBlockUser:`_messageBlockUser_q71kl_616`,messageBlockAssistant:`_messageBlockAssistant_q71kl_620`,messageBlockSystem:`_messageBlockSystem_q71kl_621`,agentLabel:`_agentLabel_q71kl_625`,agentAvatar:`_agentAvatar_q71kl_635`,agentInitial:`_agentInitial_q71kl_642`,bubble:`_bubble_q71kl_655`,bubbleUser:`_bubbleUser_q71kl_666`,userAgentMentionPill:`_userAgentMentionPill_q71kl_673`,userAgentMentionAvatar:`_userAgentMentionAvatar_q71kl_694`,userSkillCommandLink:`_userSkillCommandLink_q71kl_702`,bubbleAssistant:`_bubbleAssistant_q71kl_714`,bubbleApproval:`_bubbleApproval_q71kl_722`,bubbleSystem:`_bubbleSystem_q71kl_736`,bubbleCommand:`_bubbleCommand_q71kl_748`,bubbleA2AStatus:`_bubbleA2AStatus_q71kl_775`,markdownContent:`_markdownContent_q71kl_790`,codeCopyButton:`_codeCopyButton_q71kl_869`,codeCopyButtonDone:`_codeCopyButtonDone_q71kl_897`,codeBlockLabeled:`_codeBlockLabeled_q71kl_905`,codeLangLabel:`_codeLangLabel_q71kl_909`,messageActions:`_messageActions_q71kl_1069`,actionButton:`_actionButton_q71kl_1075`,actionButtonSelected:`_actionButtonSelected_q71kl_1094`,actionButtonSuccess:`_actionButtonSuccess_q71kl_1099`,branchSwitcher:`_branchSwitcher_q71kl_1103`,branchButton:`_branchButton_q71kl_1112`,approvalCard:`_approvalCard_q71kl_1130`,approvalHeader:`_approvalHeader_q71kl_1137`,approvalTier:`_approvalTier_q71kl_1144`,approvalTitle:`_approvalTitle_q71kl_1162`,approvalIntro:`_approvalIntro_q71kl_1169`,approvalDetails:`_approvalDetails_q71kl_1175`,approvalDetailRow:`_approvalDetailRow_q71kl_1181`,approvalPrimaryActions:`_approvalPrimaryActions_q71kl_1204`,approvalTrustActions:`_approvalTrustActions_q71kl_1205`,approvalAllow:`_approvalAllow_q71kl_1220`,artifactCard:`_artifactCard_q71kl_1226`,artifactCardWithPreview:`_artifactCardWithPreview_q71kl_1240`,artifactHeader:`_artifactHeader_q71kl_1245`,artifactFilename:`_artifactFilename_q71kl_1252`,artifactBadge:`_artifactBadge_q71kl_1262`,artifactDownload:`_artifactDownload_q71kl_1272`,artifactPreview:`_artifactPreview_q71kl_1294`,artifactPdfPreview:`_artifactPdfPreview_q71kl_1306`,artifactVideoPreview:`_artifactVideoPreview_q71kl_1322`,thinking:`_thinking_q71kl_1335`,thinkingDot:`_thinkingDot_q71kl_1342`,thinkingBounce:`_thinkingBounce_q71kl_1`,traceSequence:`_traceSequence_q71kl_1373`,traceBlock:`_traceBlock_q71kl_1382`,traceHeader:`_traceHeader_q71kl_1389`,traceChevron:`_traceChevron_q71kl_1410`,traceChevronOpen:`_traceChevronOpen_q71kl_1419`,traceSummary:`_traceSummary_q71kl_1423`,traceSummaryLive:`_traceSummaryLive_q71kl_1428`,tracePulse:`_tracePulse_q71kl_1`,traceSteps:`_traceSteps_q71kl_1442`,traceStep:`_traceStep_q71kl_1442`,traceStepMarker:`_traceStepMarker_q71kl_1461`,traceDot:`_traceDot_q71kl_1470`,traceDotRunning:`_traceDotRunning_q71kl_1477`,traceStepBody:`_traceStepBody_q71kl_1482`,traceToolLine:`_traceToolLine_q71kl_1490`,traceToolName:`_traceToolName_q71kl_1497`,traceToolPreview:`_traceToolPreview_q71kl_1502`,traceToolDuration:`_traceToolDuration_q71kl_1513`,traceToolResult:`_traceToolResult_q71kl_1520`,traceThinkingText:`_traceThinkingText_q71kl_1529`,traceDraftInterim:`_traceDraftInterim_q71kl_1538`,composerWrapper:`_composerWrapper_q71kl_1555`,composer:`_composer_q71kl_1555`,pendingMediaRow:`_pendingMediaRow_q71kl_1579`,mediaChip:`_mediaChip_q71kl_1586`,mediaChipName:`_mediaChipName_q71kl_1598`,mediaChipRemove:`_mediaChipRemove_q71kl_1604`,composerRow:`_composerRow_q71kl_1623`,composerActions:`_composerActions_q71kl_1630`,composerLeftActions:`_composerLeftActions_q71kl_1637`,composerInputWrap:`_composerInputWrap_q71kl_1644`,composerInputOverlay:`_composerInputOverlay_q71kl_1650`,composerOverlayCaret:`_composerOverlayCaret_q71kl_1663`,composerMentionPill:`_composerMentionPill_q71kl_1676`,composerMentionAvatar:`_composerMentionAvatar_q71kl_1696`,composerInput:`_composerInput_q71kl_1644`,composerInputHasOverlay:`_composerInputHasOverlay_q71kl_1721`,attachButton:`_attachButton_q71kl_1735`,sendButton:`_sendButton_q71kl_1736`,composerPill:`_composerPill_q71kl_1770`,agentSelectPopup:`_agentSelectPopup_q71kl_1810`,agentSelectItem:`_agentSelectItem_q71kl_1816`,remoteAgentGroupLabel:`_remoteAgentGroupLabel_q71kl_1820`,remoteAgentGroupIcon:`_remoteAgentGroupIcon_q71kl_1826`,agentSelectItemText:`_agentSelectItemText_q71kl_1831`,agentSelectAvatar:`_agentSelectAvatar_q71kl_1838`,agentSelectAvatarLoading:`_agentSelectAvatarLoading_q71kl_1839`,composerPillChevron:`_composerPillChevron_q71kl_1854`,stopping:`_stopping_q71kl_1884`,slashSuggestions:`_slashSuggestions_q71kl_1889`,slashSuggestionsScroll:`_slashSuggestionsScroll_q71kl_1897`,slashSuggestionsList:`_slashSuggestionsList_q71kl_1901`,suggestionItem:`_suggestionItem_q71kl_1905`,suggestionItemAgent:`_suggestionItemAgent_q71kl_1920`,suggestionItemActive:`_suggestionItemActive_q71kl_1927`,suggestionItemSub:`_suggestionItemSub_q71kl_1932`,suggestionLabel:`_suggestionLabel_q71kl_1936`,suggestionText:`_suggestionText_q71kl_1946`,suggestionAvatar:`_suggestionAvatar_q71kl_1953`,suggestionAvatarLoading:`_suggestionAvatarLoading_q71kl_1954`,suggestionLabelMono:`_suggestionLabelMono_q71kl_1969`,suggestionMatch:`_suggestionMatch_q71kl_1975`,suggestionDesc:`_suggestionDesc_q71kl_1984`,suggestionEmpty:`_suggestionEmpty_q71kl_1992`,slashLiveRegion:`_slashLiveRegion_q71kl_1998 _srOnly_jfnet_1`,errorBanner:`_errorBanner_q71kl_2014`,errorBannerFadeIn:`_errorBannerFadeIn_q71kl_1`,errorBannerExiting:`_errorBannerExiting_q71kl_2029`,errorBannerFadeOut:`_errorBannerFadeOut_q71kl_1`,editArea:`_editArea_q71kl_2045`,editButtons:`_editButtons_q71kl_2060`,a2aDeliveryChip:`_a2aDeliveryChip_q71kl_2171`,a2aDeliveryChipDelivered:`_a2aDeliveryChipDelivered_q71kl_2184`,a2aDeliveryChipFailed:`_a2aDeliveryChipFailed_q71kl_2190`,a2aDeliveryDot:`_a2aDeliveryDot_q71kl_2196`,a2aDeliveryDotPulse:`_a2aDeliveryDotPulse_q71kl_2204`,a2aDeliveryPulse:`_a2aDeliveryPulse_q71kl_1`,a2aDeliveryDetail:`_a2aDeliveryDetail_q71kl_2218`},qm={search:`_search_12ewc_1`,searchInput:`_searchInput_12ewc_17`,rail:`_rail_12ewc_33`,railItem:`_railItem_12ewc_37`,railGlyph:`_railGlyph_12ewc_70`,triggerPill:`_triggerPill_12ewc_90`,triggerLogo:`_triggerLogo_12ewc_105`,itemLogo:`_itemLogo_12ewc_114`},Jm={hybridai:`HybridAI`,codex:`OpenAI Codex`,anthropic:`Anthropic`,openrouter:`OpenRouter`,mistral:`Mistral`,huggingface:`Hugging Face`,gemini:`Gemini`,deepseek:`DeepSeek`,xai:`xAI`,zai:`Z.ai`,kimi:`Kimi`,minimax:`MiniMax`,dashscope:`DashScope`,xiaomi:`Xiaomi`,kilo:`Kilo`,ollama:`Ollama`,lmstudio:`LM Studio`,llamacpp:`llama.cpp`,vllm:`vLLM`},Ym={anthropic:`Anthropic`,google:`Google`,openai:`OpenAI`,mistral:`Mistral`,meta:`Meta`,deepseek:`DeepSeek`,xai:`xAI`},Xm={Local:0,HybridAI:1,"OpenAI Codex":2},Zm={Anthropic:1,OpenAI:2,Google:3,Mistral:4,Meta:5};function Qm(e,t){let n=e.toLowerCase();return t[n]?t[n]:e.split(/[-_]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}var $m=new Set([`gpt`,`ai`,`ml`,`vl`,`ui`,`pdf`,`sdk`,`api`]),eh={deepseek:`DeepSeek`,openai:`OpenAI`,hybridai:`HybridAI`},th=/^[a-z]\d+$/;function nh(e){let t=e.toLowerCase();return $m.has(t)?t.toUpperCase():eh[t]?eh[t]:th.test(t)?t:t.charAt(0).toUpperCase()+t.slice(1)}function rh(e){if(!e)return e;let t=e.split(`-`).filter(e=>!/^\d{5,}$/.test(e)),n=[],r=null,i=0;for(;i<t.length;){let e=t[i],a,o=!1;if(/^\d+$/.test(e)){let n=[e];for(;i+1<t.length&&/^\d+$/.test(t[i+1]);)i++,n.push(t[i]);a=n.join(`.`),o=!0}else a=nh(e),o=/^\d/.test(e);if(o&&r&&$m.has(r)){let e=n.pop()??``;n.push(e?`${e}-${a}`:a)}else n.push(a);r=t[i].toLowerCase(),i++}return n.join(` `)}function ih(e){return e.provider}function ah(e){let t=e.split(`/`,1)[0]?.trim().toLowerCase()??``;return t===`openai-codex`?`codex`:t&&Jm[t]?t:`hybridai`}function oh(e){return e===`ollama`?`ollama`:e===`lmstudio`?`lmstudio`:e===`llamacpp`?`llamacpp`:e===`vllm`?`vllm`:null}function sh(e){let t=e.trim();if(!t)return null;let n=ah(t);return{id:t,provider:n,backend:oh(n),contextWindow:null,isReasoning:!1,family:null,parameterSize:null}}var ch={HybridAI:Vu,"OpenAI Codex":rd,Anthropic:Uu,OpenRouter:$u,Mistral:Yu,"Hugging Face":Qu,Gemini:Gu,DeepSeek:Ju,xAI:Zu,"Z.ai":id,Kimi:ad,MiniMax:od,DashScope:sd,Xiaomi:cd,Kilo:ld,Ollama:td,"LM Studio":ud,"llama.cpp":dd,vLLM:fd,Local:Sr},lh={Anthropic:Uu,OpenAI:Wu,Google:Ku,Mistral:Yu,Meta:Xu,DeepSeek:Ju,xAI:Zu,Alibaba:pd,Microsoft:ed};function uh({provider:e,size:t=18}){let n=ch[e];return n?(0,B.jsx)(n,{width:t,height:t}):(0,B.jsx)(Pr,{width:t,height:t})}function dh({vendor:e,fallbackProvider:t,size:n=18}){let r=e?lh[e]:void 0;return r?(0,B.jsx)(r,{width:n,height:n}):(0,B.jsx)(uh,{provider:t,size:n})}function fh({value:e,onValueChange:t,className:n,placeholder:r=`Search…`,...i}){return(0,B.jsxs)(`div`,{className:V(qm.search,n),children:[(0,B.jsx)(Mr,{width:`14`,height:`14`}),(0,B.jsx)(`input`,{type:`text`,autoComplete:`off`,spellCheck:!1,className:qm.searchInput,placeholder:r,value:e,onChange:e=>t(e.target.value),...i})]})}function ph({children:e}){return(0,B.jsx)(`div`,{role:`toolbar`,"aria-orientation":`vertical`,className:qm.rail,children:e})}function mh({active:e=!1,label:t,color:n,icon:r,className:i,...a}){return(0,B.jsx)(`button`,{type:`button`,"aria-pressed":e,"aria-label":t,title:t,"data-active":e?``:void 0,className:V(qm.railItem,i),...a,children:(0,B.jsx)(`span`,{"aria-hidden":`true`,className:qm.railGlyph,style:n?{color:n}:void 0,children:r??t.charAt(0).toUpperCase()})})}var hh=[[`claude`,`Anthropic`],[`gpt`,`OpenAI`],[`o1`,`OpenAI`],[`o3`,`OpenAI`],[`o4`,`OpenAI`],[`gemini`,`Google`],[`mistral`,`Mistral`],[`grok`,`xAI`],[`llama`,`Meta`],[`codellama`,`Meta`],[`deepseek`,`DeepSeek`],[`qwen`,`Alibaba`],[`phi`,`Microsoft`]];function gh(e){let t=e.toLowerCase();return hh.find(([e])=>t.startsWith(e))?.[1]??null}function _h(e,t){if(!t.backend||e.length<2)return null;let n=e[0]?.trim();return n?n.toLowerCase()===t.backend?Qm(t.backend,Jm):n:null}function vh(e){let t=e.id,n=t.split(`/`),r=Qm(e.provider,Jm),i,a;return n.length===1?(i=gh(n[0]),a=n[0]):n.length===2?(i=gh(n[1]),a=n[1]):(i=Qm(n[1],Ym),a=n.slice(2).join(`/`)),{id:t,groupLabel:i?`${r} · ${i}`:r,providerRank:Xm[r]??50,vendorRank:i?Zm[i]??50:0,routeLabel:_h(n,e),shortName:a,displayName:rh(a),vendor:i,provider:r,meta:e}}function yh(e,t){return e.providerRank===t.providerRank?e.vendorRank===t.vendorRank?e.groupLabel.localeCompare(t.groupLabel):e.vendorRank-t.vendorRank:e.providerRank-t.providerRank}function bh(e){return!e||e<=0?null:$a(e)}function xh(e){let t=e.meta.family,n=t&&t!==e.shortName?rh(t):null,r=[e.routeLabel,e.meta.parameterSize?.trim()||null,n&&n!==e.displayName?n:null,e.vendor].filter(e=>!!e);return r.length===0?null:r.join(` · `)}function Sh(e,t){if(!t)return!0;let n=[e.id,e.shortName,e.displayName,e.provider,e.routeLabel??``,e.vendor??``,e.groupLabel].join(` `).toLowerCase();return t.toLowerCase().split(/\s+/).filter(Boolean).every(e=>n.includes(e))}function Ch(e){let[t,n]=(0,R.useState)(``),[r,i]=(0,R.useState)(null),a=(0,R.useMemo)(()=>e.models.map(vh),[e.models]),o=(0,R.useMemo)(()=>{let e=new Map;for(let t of a){let n=ih(t);e.set(n,(e.get(n)??0)+1)}return Array.from(e.entries()).map(([e,t])=>({key:e,count:t})).sort((e,t)=>e.key.localeCompare(t.key))},[a]),s=(0,R.useMemo)(()=>{let e=a.filter(e=>!(!Sh(e,t)||r&&ih(e)!==r)),n=new Map;for(let t of e){let e=n.get(t.groupLabel);e||(e={head:t,items:[]},n.set(t.groupLabel,e)),e.items.push(t)}let i=Array.from(n.values()).sort((e,t)=>yh(e.head,t.head));for(let e of i)e.items.sort((e,t)=>e.shortName.localeCompare(t.shortName)||(e.routeLabel??``).localeCompare(t.routeLabel??``)||e.id.localeCompare(t.id));return i},[a,t,r]),c=e.selectedModelId.trim(),l=sh(c),u=a.find(e=>e.id===c)??(l?vh(l):void 0);return e.models.length===0&&!u?null:(0,B.jsxs)(Am,{value:u?u.id:``,disabled:e.disabled,onValueChange:t=>{!t||t===c||e.onSwitch(t)},children:[(0,B.jsxs)(jm,{"aria-label":`Switch model`,title:`Switch model`,className:V(Km.composerPill,qm.triggerPill),children:[u?(0,B.jsx)(`span`,{"aria-hidden":`true`,className:qm.triggerLogo,children:(0,B.jsx)(dh,{vendor:u.vendor,fallbackProvider:u.provider,size:16})}):null,(0,B.jsx)(Mm,{placeholder:`Select model`,children:u?u.displayName:``}),(0,B.jsx)(Nm,{})]}),(0,B.jsx)(Fm,{align:`start`,header:(0,B.jsx)(fh,{value:t,onValueChange:n,placeholder:`Search models…`,"aria-label":`Search models`}),rail:(0,B.jsxs)(ph,{children:[(0,B.jsx)(mh,{label:r===null?`All providers`:`Clear filter`,active:r===null,icon:(0,B.jsx)(Tr,{width:`16`,height:`16`}),onClick:()=>i(null)}),o.map(({key:e,count:t})=>(0,B.jsx)(mh,{label:`${e} (${t})`,active:r===e,icon:(0,B.jsx)(uh,{provider:e}),onClick:()=>i(t=>t===e?null:e)},e))]}),children:s.length===0?(0,B.jsxs)(Rm,{children:[`No models match “`,t,`”.`]}):s.map(e=>(0,B.jsxs)(Im,{children:[(0,B.jsx)(Lm,{children:e.head.groupLabel}),e.items.map(e=>{let t=bh(e.meta.contextWindow),n=xh(e);return(0,B.jsxs)(zm,{value:e.id,textValue:`${e.displayName} ${e.groupLabel} ${e.routeLabel??``}`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:qm.itemLogo,children:(0,B.jsx)(dh,{vendor:e.vendor,fallbackProvider:e.provider,size:18})}),(0,B.jsxs)(Vm,{children:[(0,B.jsx)(Bm,{children:e.displayName}),n?(0,B.jsx)(Hm,{children:n}):null]}),(0,B.jsx)(Um,{children:t?(0,B.jsx)(`span`,{children:t}):null})]},e.id)})]},e.head.groupLabel))})]})}var wh={enabled:!1,mode:`rewrite`,policy:``,doList:[],dontList:[],bannedPhrases:[],bannedPatterns:[],requirePhrases:[],classifier:{provider:`default`,model:``},rewriter:{provider:`default`,model:``}};function Th(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Eh(e,t=``){return{provider:e,model:e===`model`?t.trim():``}}function Dh(e,t){let n=e?.trim()??``;if(!n)return``;let r=t.find(e=>e.id===n);return r?vh(r).displayName:n}function Oh(e){let t=e=>e.map(e=>e.trim()).filter(Boolean);return{...e,policy:e.policy.trim(),doList:t(e.doList),dontList:t(e.dontList),bannedPhrases:t(e.bannedPhrases),bannedPatterns:t(e.bannedPatterns),requirePhrases:t(e.requirePhrases),classifier:Eh(e.classifier.provider,e.classifier.model),rewriter:Eh(e.rewriter.provider,e.rewriter.model)}}function kh(e){let t=(0,R.useRef)(0),n=(0,R.useCallback)(n=>{let r={id:`${e.label}-${t.current}`,value:n};return t.current+=1,r},[e.label]),[r,i]=(0,R.useState)(()=>e.values.map(n)),a=t=>{i(t),e.onChange(t.map(e=>e.value))};return(0,R.useEffect)(()=>{i(t=>e.values.map((e,r)=>{if(t[r]?.value===e)return t[r];let i=t[r];return i?{...i,value:e}:n(e)}))},[n,e.values]),(0,B.jsxs)(`div`,{className:`field output-guard-list-field`,children:[(0,B.jsx)(`span`,{children:e.label}),(0,B.jsxs)(`div`,{className:`output-guard-list`,children:[r.map((t,n)=>(0,B.jsxs)(`div`,{className:`output-guard-list-row`,children:[(0,B.jsx)(`input`,{"aria-label":`${e.label} item ${n+1}`,value:t.value,onChange:e=>a(r.map((t,r)=>r===n?{...t,value:e.target.value}:t)),placeholder:e.placeholder}),(0,B.jsx)(`button`,{className:`ghost-button icon-button`,type:`button`,"aria-label":`Remove ${e.label} item ${n+1}`,title:`Remove`,onClick:()=>{a(r.filter((e,t)=>t!==n))},children:(0,B.jsx)(Hr,{width:`16`,height:`16`})})]},t.id)),(0,B.jsx)(`button`,{className:`ghost-button output-guard-add-button`,type:`button`,"aria-label":`Add ${e.label} item`,onClick:()=>{a([...r,n(``)])},children:`Add`})]})]})}function Ah(e){let t=e.value.provider===`model`?e.value.model:``,n=Dh(e.activeModelId,e.modelOptions)||e.activeModelFallback;return(0,B.jsxs)(`div`,{className:`field`,children:[(0,B.jsx)(`span`,{children:e.label}),(0,B.jsxs)(`div`,{className:`output-guard-model-source-control has-model-readout ${e.value.provider===`model`?`has-model-select`:``}`,children:[(0,B.jsx)(Za,{ariaLabel:e.ariaLabel,value:e.value.provider,options:[{value:`default`,label:`default model`},{value:`auxiliary`,label:`aux model`},{value:`model`,label:`other model`}],onChange:t=>{let n=t===`model`?e.value.model||e.defaultOtherModelId:``;e.onChange(Eh(t,n))}}),e.value.provider===`model`?(0,B.jsx)(Ch,{models:e.modelOptions,selectedModelId:t,disabled:e.modelsLoading,onSwitch:t=>e.onChange(Eh(`model`,t))}):(0,B.jsx)(`div`,{className:`output-guard-model-readout`,title:e.activeModelId||n,children:n})]})]})}function jh(e){return e===`compliant`?`compliant`:e===`needs_review`?`needs review`:`non-compliant`}function Mh(e){return e.kind===`banned_phrase`?`Contains banned phrase "${e.detail}".`:e.kind===`banned_pattern`?`Matches banned pattern ${e.detail}.`:`Missing required phrase "${e.detail}".`}function Nh(e){let{classifier:t}=e;if(t.status===`evaluated`&&t.verdict){let e=t.severity?`, ${t.severity}`:``,n=t.model?` via ${t.model}`:``;return`Classifier ${t.provider==="default"?`default model`:t.provider===`auxiliary`?`aux model`:`selected model`}${n}: ${jh(t.verdict)}${e}.`}return t.status===`unparseable`?`Classifier response was not parseable; showing rules score.`:e.scoreSource===`classifier`?`Classifier unavailable; failure mode blocks output.`:`Classifier unavailable; showing rules score.`}function Ph(){let e=Zn(),t=Ss(),n=o(),[r,i]=(0,R.useState)(wh),[a,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(null),u=y({queryKey:[`output-guard-profile`,e.token],queryFn:()=>Pn(e.token)}),d=y({queryKey:[`models`,e.token],queryFn:()=>Qt(e.token)});(0,R.useEffect)(()=>{u.data?.profile&&i(u.data.profile)},[u.data?.profile]);let f=u.data?.profile??wh,p=!Th(Oh(r),f),m=d.data?.models??[],h=d.data?.defaultModel??``,_=d.data?.auxiliaryModels?.skillsHub.model??null,v=d.data?.auxiliaryModels?.skillsHub.provider??`auto`,b=m.find(e=>e.id!==h)?.id??h;(0,R.useEffect)(()=>{b&&((r.classifier.provider!==`model`||r.classifier.model)&&(r.rewriter.provider!==`model`||r.rewriter.model)||i(e=>{let t=e;return e.classifier.provider===`model`&&!e.classifier.model&&(t={...t,classifier:Eh(`model`,b)}),e.rewriter.provider===`model`&&!e.rewriter.model&&(t={...t,rewriter:Eh(`model`,b)}),t}))},[b,r.classifier.model,r.classifier.provider,r.rewriter.model,r.rewriter.provider]);let x=g({mutationFn:()=>Fn(e.token,Oh(r)),onSuccess:r=>{i(r.profile),t.success(r.changed?`Output guard saved.`:`Output guard unchanged.`,r.reloadMessage),n.setQueryData([`output-guard-profile`,e.token],r),n.invalidateQueries({queryKey:[`output-guard-profile`,e.token]})},onError:e=>{t.error(`Save failed`,H(e))}}),S=g({mutationFn:()=>In(e.token,Oh(r),a),onSuccess:e=>{l(e)},onError:e=>{t.error(`Preview failed`,H(e))}});return(0,B.jsxs)(`div`,{className:`page-stack output-guard-page`,children:[(0,B.jsx)(Ya,{description:`Operator controls for output policy, rules, classifier, and rewrite behavior.`,actions:(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:!p||x.isPending,onClick:()=>x.mutate(),children:x.isPending?`Saving...`:`Save profile`})}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Profile`}),(0,B.jsx)(vo,{children:`Runtime plugin profile`})]}),(0,B.jsx)(K,{children:u.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading output guard...`}):u.isError?(0,B.jsx)(`div`,{className:`empty-state`,children:H(u.error)}):(0,B.jsxs)(`div`,{className:`stack-form`,children:[(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:r.enabled,onCheckedChange:e=>i(t=>({...t,enabled:e}))}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Enabled`})})]}),(0,B.jsxs)(`div`,{className:`field`,children:[(0,B.jsx)(`span`,{children:`Mode`}),(0,B.jsx)(Za,{ariaLabel:`Output guard mode`,value:r.mode,options:[{value:`rewrite`,label:`rewrite`},{value:`block`,label:`block`},{value:`flag`,label:`flag`}],onChange:e=>i(t=>({...t,mode:e}))})]}),(0,B.jsx)(Ah,{label:`Classifier`,ariaLabel:`Output guard classifier source`,value:r.classifier,modelOptions:m,defaultOtherModelId:b,activeModelId:r.classifier.provider==="default"?h:_,activeModelFallback:r.classifier.provider==="default"?`No default model`:v===`disabled`?`Aux model disabled`:`Auto routing`,modelsLoading:d.isLoading,onChange:e=>i(t=>({...t,classifier:e}))}),(0,B.jsx)(Ah,{label:`Rewriter`,ariaLabel:`Output guard rewriter source`,value:r.rewriter,modelOptions:m,defaultOtherModelId:b,activeModelId:r.rewriter.provider==="default"?h:_,activeModelFallback:r.rewriter.provider==="default"?`No default model`:v===`disabled`?`Aux model disabled`:`Auto routing`,modelsLoading:d.isLoading,onChange:e=>i(t=>({...t,rewriter:e}))}),(0,B.jsxs)(`label`,{className:`field textarea-field`,children:[(0,B.jsx)(`span`,{children:`Policy`}),(0,B.jsx)(`textarea`,{rows:5,value:r.policy,onChange:e=>i(t=>({...t,policy:e.target.value})),placeholder:`Clear, direct, concrete. No hype.`})]}),(0,B.jsx)(kh,{label:`Do`,values:r.doList,placeholder:`Use concrete nouns`,onChange:e=>i(t=>({...t,doList:e}))}),(0,B.jsx)(kh,{label:`Don't`,values:r.dontList,placeholder:`Use hype or vague claims`,onChange:e=>i(t=>({...t,dontList:e}))}),(0,B.jsx)(`small`,{className:`output-guard-list-note`,children:`Do and Don't guide rewrites and classifier context; banned and required rules stay deterministic.`}),(0,B.jsx)(kh,{label:`Banned phrases`,values:r.bannedPhrases,placeholder:`game changing`,onChange:e=>i(t=>({...t,bannedPhrases:e}))}),(0,B.jsx)(kh,{label:`Banned patterns`,values:r.bannedPatterns,placeholder:`/\\\\bguarantee[sd]?\\\\b/i`,onChange:e=>i(t=>({...t,bannedPatterns:e}))}),(0,B.jsx)(kh,{label:`Required phrases`,values:r.requirePhrases,placeholder:`Best regards`,onChange:e=>i(t=>({...t,requirePhrases:e}))})]})})]}),(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Preview`}),(0,B.jsx)(vo,{children:c?`${c.score}/100, ${jh(c.verdict)} (${c.scoreSource})`:`No score yet`})]}),(0,B.jsxs)(K,{children:[(0,B.jsxs)(`label`,{className:`field textarea-field`,children:[(0,B.jsx)(`span`,{children:`Sample output`}),(0,B.jsx)(`textarea`,{rows:9,value:a,onChange:e=>s(e.target.value),placeholder:`Paste assistant output`})]}),(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:!a.trim()||S.isPending,onClick:()=>S.mutate(),children:S.isPending?`Scoring...`:`Score sample`}),c?(0,B.jsxs)(`div`,{className:`output-guard-score-panel`,children:[(0,B.jsx)(`div`,{className:`output-guard-score-bar`,children:(0,B.jsx)(`span`,{style:{width:`${c.score}%`}})}),(0,B.jsx)(`small`,{children:Nh(c)}),c.violations.length>0?(0,B.jsx)(`ul`,{className:`output-guard-reason-list`,children:c.violations.map(e=>{let t=Mh(e);return(0,B.jsx)(`li`,{children:t},t)})}):(0,B.jsx)(`small`,{children:`No rule violations detected.`}),c.classifier.reasons.length>0?(0,B.jsx)(`ul`,{className:`output-guard-reason-list`,children:c.classifier.reasons.map(e=>(0,B.jsx)(`li`,{children:e},`classifier-${e}`))}):null]}):null]})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Versions`}),(0,B.jsx)(vo,{children:`${u.data?.revisions.length??0} profile edits`})]}),(0,B.jsx)(K,{children:u.data?.revisions.length?(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:u.data.revisions.map(e=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`strong`,{children:[`Revision `,e.id]}),(0,B.jsx)(`small`,{children:ao(e.createdAt)}),(0,B.jsx)(`small`,{children:e.actor})]}),(0,B.jsx)(`span`,{className:`list-status`,children:e.source})]},e.id))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No saved profile edits yet.`})})]})]})]})]})}var Fh={plugin:(e,t)=>X(e.name||e.id,t.name||t.id)||X(e.id,t.id),source:(e,t)=>X(e.source,t.source)||X(e.name||e.id,t.name||t.id),enabled:(e,t)=>ss(e.enabled,t.enabled)||X(e.name||e.id,t.name||t.id),status:(e,t)=>ss(e.status===`loaded`,t.status===`loaded`)||X(e.name||e.id,t.name||t.id),commands:(e,t)=>os(e.commands.length,t.commands.length)||X(e.name||e.id,t.name||t.id),tools:(e,t)=>os(e.tools.length,t.tools.length)||X(e.name||e.id,t.name||t.id),hooks:(e,t)=>os(e.hooks.length,t.hooks.length)||X(e.name||e.id,t.name||t.id)},Ih={enabled:`desc`,status:`desc`,commands:`desc`,tools:`desc`,hooks:`desc`};function Lh(e){return e.length>0?e.join(`, `):`none`}function Rh(e,t){return t?[e.id,e.name||``,e.description||``,e.source,e.status,e.error||``,...e.commands,...e.tools,...e.hooks].join(` `).toLowerCase().includes(t):!0}function zh(){let e=Zn(),[t,n]=(0,R.useState)(``),r=(0,R.useDeferredValue)(t).trim().toLowerCase(),i=y({queryKey:[`plugins`,e.token],queryFn:()=>Nn(e.token)}),{sortedRows:a,sortState:o,toggleSort:s}=qa((i.data?.plugins||[]).filter(e=>Rh(e,r)),{initialSort:{key:`plugin`,direction:`asc`},sorters:Fh,defaultDirections:Ih}),c=a.filter(e=>e.status===`failed`);return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{description:`Discovery and runtime load status for configured HybridClaw plugins.`,actions:(0,B.jsx)(`input`,{className:`compact-search`,value:t,onChange:e=>n(e.target.value),placeholder:`Filter plugins`})}),(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Xa,{label:`Plugins`,value:String(i.data?.totals.totalPlugins??0),detail:`${i.data?.totals.enabledPlugins??0} enabled`,loading:!i.data}),(0,B.jsx)(Xa,{label:`Load failures`,value:String(i.data?.totals.failedPlugins??0),detail:`runtime initialization errors`,loading:!i.data}),(0,B.jsx)(Xa,{label:`Commands`,value:String(i.data?.totals.commands??0),detail:`plugin-defined commands`,loading:!i.data}),(0,B.jsx)(Xa,{label:`Tools / Hooks`,value:`${i.data?.totals.tools??0} / ${i.data?.totals.hooks??0}`,detail:`registered runtime surfaces`,loading:!i.data})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Registry`}),(0,B.jsx)(vo,{children:`${a.length} plugin${a.length===1?``:`s`} visible`})]}),(0,B.jsx)(K,{children:i.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading plugins...`}):a.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No plugins match this filter.`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Ja,{label:`Plugin`,sortKey:`plugin`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Source`,sortKey:`source`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Enabled`,sortKey:`enabled`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Status`,sortKey:`status`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Commands`,sortKey:`commands`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Tools`,sortKey:`tools`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Hooks`,sortKey:`hooks`,sortState:o,onToggle:s})]})}),(0,B.jsx)(`tbody`,{children:a.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.name||e.id}),(0,B.jsxs)(`small`,{children:[e.id,e.version?` · v${e.version}`:``]}),e.description?(0,B.jsx)(`small`,{children:e.description}):null,e.error?(0,B.jsx)(`small`,{children:e.error}):null]}),(0,B.jsx)(`td`,{children:e.source}),(0,B.jsx)(`td`,{children:(0,B.jsx)(Qa,{value:e.enabled,trueLabel:`enabled`,falseLabel:`disabled`})}),(0,B.jsx)(`td`,{children:(0,B.jsx)(Qa,{value:e.status===`loaded`,trueLabel:`loaded`,falseLabel:`failed`})}),(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.commands.length}),(0,B.jsx)(`small`,{children:Lh(e.commands)})]}),(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.tools.length}),(0,B.jsx)(`small`,{children:Lh(e.tools)})]}),(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.hooks.length}),(0,B.jsx)(`small`,{children:Lh(e.hooks)})]})]},e.id))})]})})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Failures`})}),(0,B.jsx)(K,{children:i.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading plugin status...`}):c.length>0?(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:c.map(e=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.name||e.id}),(0,B.jsxs)(`small`,{children:[e.id,e.version?` · v${e.version}`:``]}),(0,B.jsx)(`small`,{children:e.error||`Unknown plugin load error.`})]}),(0,B.jsxs)(`span`,{className:`list-status list-status-danger`,children:[(0,B.jsx)(`span`,{className:`status-dot status-dot-danger`}),`failed`]})]},e.id))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No plugin load failures were reported.`})})]})]})]})}var Bh={anchor:`_anchor_1k3rt_1`,input:`_input_1k3rt_7`,chevron:`_chevron_1k3rt_11`,popover:`_popover_1k3rt_22`,list:`_list_1k3rt_28`,option:`_option_1k3rt_39`,optionLabel:`_optionLabel_1k3rt_60`,optionDescription:`_optionDescription_1k3rt_64`,empty:`_empty_1k3rt_69`},Vh=(e,t)=>{if(!t)return!0;let n=t.toLowerCase();return e.label.toLowerCase().includes(n)||e.value.toLowerCase().includes(n)};function Hh({value:e,onValueChange:t,options:n,placeholder:r,disabled:i,renderOption:a,emptyMessage:o=`No matches.`,filter:s=Vh,allowFreeText:c=!1,popoverAlign:l=`start`,className:u,id:d,onBlur:f}){let p=Po({id:d,disabled:i,"aria-invalid":void 0,"aria-describedby":void 0}),m=(0,R.useId)(),h=`${p.id??m}-listbox`,g=(0,R.useMemo)(()=>n.find(t=>t.value===e)??null,[n,e]),_=g?g.label:c?e:``,[v,y]=(0,R.useState)(!1),[b,x]=(0,R.useState)(_),[S,C]=(0,R.useState)(0),w=(0,R.useRef)(null),T=(0,R.useRef)(!1);(0,R.useEffect)(()=>{v||x(_)},[_,v]);let E=(0,R.useMemo)(()=>v?n.filter(e=>s(e,b.trim())):n,[n,v,b,s]);(0,R.useEffect)(()=>{S>=E.length&&C(0)},[E.length,S]);let D=(0,R.useCallback)((e,n)=>{T.current=!0,e?(t(e.value,e),x(e.label)):c&&t(n??``,null),y(!1)},[c,t]),O=e=>{x(e.target.value),y(!0),C(0)},k=e=>{if(e.key===`ArrowDown`)e.preventDefault(),y(!0),C(e=>Math.min(e+1,Math.max(0,E.length-1)));else if(e.key===`ArrowUp`)e.preventDefault(),y(!0),C(e=>Math.max(e-1,0));else if(e.key===`Enter`){if(!v)return;e.preventDefault();let t=E[S];t&&!t.disabled?D(t):c&&D(null,b)}else if(e.key===`Escape`){if(!v)return;e.preventDefault(),y(!1),x(_)}else if(e.key===`Tab`){if(!v)return;let e=E[S];e&&!e.disabled&&D(e)}},A=()=>{if(y(!1),T.current){T.current=!1,f?.();return}if(c)b!==_&&D(null,b);else{let t=n.find(e=>e.label===b||e.value===b);t?t.value!==e&&D(t):x(_)}f?.()};return(0,B.jsxs)(Fi,{open:v,onOpenChange:y,children:[(0,B.jsxs)(Ii,{className:V(Bh.anchor,u),children:[(0,B.jsx)(Y,{...p,ref:w,type:`text`,role:`combobox`,"aria-expanded":v,"aria-controls":v?h:void 0,"aria-autocomplete":`list`,"aria-activedescendant":v&&E[S]?`${h}-option-${S}`:void 0,value:b,placeholder:r,onFocus:()=>y(!0),onChange:O,onKeyDown:k,onBlur:A,className:Bh.input,autoComplete:`off`,spellCheck:!1}),(0,B.jsx)(or,{"aria-hidden":`true`,className:Bh.chevron})]}),(0,B.jsx)(Li,{align:l,className:Bh.popover,children:(0,B.jsx)(`div`,{role:`listbox`,id:h,className:Bh.list,children:E.length===0?(0,B.jsx)(`div`,{className:Bh.empty,children:o}):E.map((t,n)=>{let r=n===S,i=t.value===e;return(0,B.jsx)(`div`,{id:`${h}-option-${n}`,role:`option`,"aria-selected":i,"aria-disabled":t.disabled||void 0,"data-active":r||void 0,"data-disabled":t.disabled||void 0,tabIndex:-1,className:Bh.option,onMouseDown:e=>{e.preventDefault(),t.disabled||D(t)},onMouseEnter:()=>C(n),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t.disabled||D(t))},children:a?a(t,r):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:Bh.optionLabel,children:t.label}),t.description?(0,B.jsx)(`span`,{className:Bh.optionDescription,children:t.description}):null]})},t.value)})})})]})}function Uh(e){if(e==null)return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;let t=e.trim();if(!t)return null;let n=/^\d{4}-\d{2}-\d{2}$/.test(t)?`${t}T00:00`:t,r=new Date(n);return Number.isNaN(r.getTime())?null:r}function Wh(e,t){if(!e)return``;let n=e.getTimezoneOffset()*6e4,r=new Date(e.getTime()-n).toISOString();return t===`day`?r.slice(0,10):t===`second`?r.slice(0,19):r.slice(0,16)}function Gh({value:e,onValueChange:t,onErrorChange:n,granularity:r=`minute`,min:i,max:a,required:o=!1,...s}){let c=No(),l=r===`day`?`date`:`datetime-local`,u=r===`second`?1:void 0,d=(0,R.useMemo)(()=>Uh(i??null),[i]),f=(0,R.useMemo)(()=>Uh(a??null),[a]),p=Wh((0,R.useMemo)(()=>Uh(e),[e]),r),m=(0,R.useCallback)(e=>{c.setError(e),n?.(e)},[c.setError,n]);return(0,B.jsx)(Y,{...s,type:l,step:u,value:p,min:d?Wh(d,r):void 0,max:f?Wh(f,r):void 0,onChange:e=>{let n=e.target.value;if(n.trim()===``){if(o){m(`Required.`);return}m(null),t(null);return}let r=Uh(n);if(!r){m(`Enter a valid date.`);return}if(d&&r<d){m(`Date is earlier than the minimum allowed.`);return}if(f&&r>f){m(`Date is later than the maximum allowed.`);return}m(null),t(r)}})}var Kh=[`backlog`,`in_progress`,`review`,`done`,`cancelled`],qh=[`cron`,`every`,`at`,`one_shot`],Jh=[`agent_turn`,`system_event`],Yh=[`channel`,`last-channel`,`webhook`];function Xh(e){return e?.source===`job`}function Zh(e){return e?.source===`task`}function Qh(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function $h(e){return e.schedule.kind===`one_shot`?`one shot`:e.schedule.kind===`cron`?e.schedule.expr||`invalid cron`:e.schedule.kind===`every`?`every ${e.schedule.everyMs}ms`:ao(e.schedule.at)}function eg(e){return e.source===`task`?`task #${e.taskId??`n/a`} · ${$h(e)}`:`${e.id} · ${$h(e)}`}function tg(e){return e.disabled?`paused`:e.boardStatus===`review`&&e.lastStatus===`error`?`failed`:e.lastStatus?e.lastStatus:e.enabled?`ready`:`inactive`}function ng(e){return e?.boardStatus?e.boardStatus:e?!e.enabled||e.disabled?`cancelled`:e.lastStatus===`success`?`done`:e.lastStatus===`error`?`cancelled`:`backlog`:`backlog`}function rg(e){return{originalId:e?.id||null,id:e?.id||``,name:e?.name||``,description:e?.description||``,agentId:e?.agentId||``,boardStatus:ng(e),enabled:e?.enabled??!0,scheduleKind:e?.schedule.kind||`cron`,scheduleExpr:e?.schedule.expr||`0 * * * *`,scheduleEveryMs:e?.schedule.everyMs??6e4,scheduleAt:Qh(e?.schedule.at||null),scheduleTz:e?.schedule.tz||``,maxRetries:typeof e?.maxRetries==`number`?e.maxRetries:3,actionKind:e?.action.kind||`agent_turn`,actionMessage:e?.action.message||``,deliveryKind:e?.delivery.kind||`channel`,deliveryChannel:e?.delivery.channel||`tui`,deliveryTo:e?.delivery.to||``,deliveryWebhookUrl:e?.delivery.webhookUrl||``}}function ig(e){let t=[{value:`tui`,label:`Local TUI`}],n=e.config;if(n){let r=Tl(n,{discordTokenConfigured:e.status?.discord?.tokenConfigured,slackBotTokenConfigured:e.status?.slack?.botTokenConfigured,slackAppTokenConfigured:e.status?.slack?.appTokenConfigured,telegramTokenConfigured:e.status?.telegram?.tokenConfigured,whatsappLinked:e.status?.whatsapp?.linked,emailPasswordConfigured:e.status?.email?.passwordConfigured,imessagePasswordConfigured:e.status?.imessage?.passwordConfigured});for(let e of r)e.statusTone===`active`&&t.push({value:e.kind,label:e.label})}let r=e.currentChannel.trim();return r&&!t.some(e=>e.value===r)&&t.push({value:r,label:`${ag(r)} (current)`}),t}function ag(e){switch(e){case`discord`:return`Discord`;case`slack`:return`Slack`;case`telegram`:return`Telegram`;case`whatsapp`:return`WhatsApp`;case`email`:return`Email`;case`msteams`:return`Microsoft Teams`;case`imessage`:return`iMessage`;case`tui`:return`Local TUI`;case`web`:return`Local Web`;default:return e}}function og(e,t){return t?e===`discord`?t.channels.filter(e=>e.transport===`discord`).map(e=>({value:e.channelId,label:`${e.guildId} · ${e.channelId}`})):e===`msteams`?t.channels.filter(e=>e.transport===`msteams`).map(e=>({value:e.channelId,label:`${e.guildId} · ${e.channelId}`})):[]:[]}function sg(e){let t=e.currentValue.trim();return e.channel===`tui`||e.channel===`web`?e.channel:e.options.length===0||e.options.some(e=>e.value===t)?t:e.options[0].value}function cg(e){let t=og(e.channel,e.channels),n=sg({channel:e.channel,currentValue:e.currentValue,options:t});if(e.channel===`tui`||e.channel===`web`||(e.channel===`discord`||e.channel===`msteams`)&&t.length===1)return{kind:`none`,value:n};if((e.channel===`discord`||e.channel===`msteams`)&&t.length>1)return{kind:`select`,value:n,label:`Channel`,options:t};switch(e.channel){case`discord`:return{kind:`input`,value:n,label:`Channel ID`,placeholder:`123456789012345678`};case`slack`:return{kind:`input`,value:n,label:`Conversation target`,placeholder:`slack:C1234567890`};case`telegram`:return{kind:`input`,value:n,label:`Chat ID`,placeholder:`telegram:-1001234567890`};case`whatsapp`:return{kind:`input`,value:n,label:`Chat JID`,placeholder:`491234567890@s.whatsapp.net`};case`email`:return{kind:`input`,value:n,label:`Recipient`,placeholder:`ops@example.com`};case`imessage`:return{kind:`input`,value:n,label:`Handle`,placeholder:`imessage:ops@example.com`};case`msteams`:return{kind:`input`,value:n,label:`Channel ID`,placeholder:`19:channel-id@thread.tacv2`};default:return{kind:`input`,value:n,label:`Target`,placeholder:e.channel||`target`}}}function lg(e,t){return e.deliveryKind===`channel`?{...e,deliveryTo:t.value}:{...e,deliveryTo:``}}function ug(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,48)}function dg(e){let t=e.id.trim();if(t)return{...e,id:t};let n=ug(e.name)||ug(e.description)||ug(e.actionMessage)||`job-${Date.now().toString(36).slice(-8).toLowerCase()}`;return{...e,id:n}}function fg(e){let t=e.scheduleKind===`at`&&e.scheduleAt?e.scheduleAt.toISOString():null;if(e.scheduleKind===`at`&&!t)throw Error(`Pick a valid "Run at" timestamp.`);return{id:e.id.trim(),source:`job`,name:e.name.trim()||e.id.trim(),description:e.description.trim()||null,agentId:e.agentId.trim()||null,boardStatus:e.boardStatus,maxRetries:e.scheduleKind===`one_shot`?e.maxRetries:null,enabled:e.enabled,schedule:{kind:e.scheduleKind,at:t,everyMs:e.scheduleKind===`every`?e.scheduleEveryMs:null,expr:e.scheduleKind===`cron`&&e.scheduleExpr.trim()||null,tz:e.scheduleKind===`one_shot`?``:e.scheduleTz.trim()},action:{kind:e.actionKind,message:e.actionMessage.trim()},delivery:{kind:e.deliveryKind,channel:e.deliveryChannel.trim()||`tui`,to:e.deliveryKind===`channel`?e.deliveryTo.trim():``,webhookUrl:e.deliveryKind===`webhook`?e.deliveryWebhookUrl.trim():``},lastRun:null,lastStatus:null,nextRunAt:null,disabled:!1,consecutiveErrors:0,createdAt:null,sessionId:null,channelId:null,taskId:null}}function pg(e,t,n){n.setQueryData([`scheduler`,t],e)}function mg(e){return(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Task`})}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`stack-form`,children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Task`}),(0,B.jsxs)(`strong`,{children:[`#`,e.job.taskId??`n/a`]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`State`}),(0,B.jsx)(Qa,{value:e.job.enabled&&!e.job.disabled,trueLabel:`active`,falseLabel:`inactive`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Session`}),(0,B.jsx)(`strong`,{children:e.job.sessionId||`n/a`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Channel`}),(0,B.jsx)(`strong`,{children:e.job.channelId||`n/a`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Created`}),(0,B.jsx)(`strong`,{children:ao(e.job.createdAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Next run`}),(0,B.jsx)(`strong`,{children:ao(e.job.nextRunAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Last run`}),(0,B.jsx)(`strong`,{children:ao(e.job.lastRun)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Last status`}),(0,B.jsx)(`strong`,{children:e.job.lastStatus||`n/a`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Message`}),(0,B.jsx)(ts,{readOnly:!0,rows:6,value:e.job.action.message})]}),(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(`button`,{className:`ghost-button`,type:`button`,disabled:e.pausePending,onClick:e.onPauseToggle,children:e.pausePending?`Updating...`:e.job.disabled?`Resume task`:`Pause task`}),(0,B.jsx)(`button`,{className:`danger-button`,type:`button`,disabled:e.deletePending,onClick:e.onDelete,children:e.deletePending?`Deleting...`:`Delete task`})]})]})})]})}function hg(e){let{draft:t,selectedJob:n}=e;return(0,B.jsx)(Fc,{form:e.form,onSubmit:e.onSave,children:(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Job`})}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`stack-form`,children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`ID`}),(0,B.jsx)(Y,{value:t.id,onChange:t=>e.onDraftChange(e=>({...e,id:t.target.value})),placeholder:`Auto-generated from name if blank`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Name`}),(0,B.jsx)(Y,{value:t.name,onChange:t=>e.onDraftChange(e=>({...e,name:t.target.value})),placeholder:`Nightly research`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Description`}),(0,B.jsx)(Y,{value:t.description,onChange:t=>e.onDraftChange(e=>({...e,description:t.target.value})),placeholder:`Optional`})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Status`}),(0,B.jsxs)(vs,{value:t.boardStatus,onChange:t=>e.onDraftChange(e=>({...e,boardStatus:lu(Kh,t.target.value,e.boardStatus)})),children:[(0,B.jsx)(Q,{value:`backlog`,children:`backlog`}),(0,B.jsx)(Q,{value:`in_progress`,children:`in progress`}),(0,B.jsx)(Q,{value:`review`,children:`review`}),(0,B.jsx)(Q,{value:`done`,children:`done`}),(0,B.jsx)(Q,{value:`cancelled`,children:`cancelled`})]})]}),(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:t.enabled,onCheckedChange:t=>e.onDraftChange(e=>({...e,enabled:t}))}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`State`})})]})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Schedule`}),(0,B.jsxs)(vs,{value:t.scheduleKind,onChange:t=>e.onDraftChange(e=>{let n=lu(qh,t.target.value,e.scheduleKind);return{...e,scheduleKind:n,boardStatus:n===`one_shot`?`backlog`:e.boardStatus}}),children:[(0,B.jsx)(Q,{value:`cron`,children:`cron`}),(0,B.jsx)(Q,{value:`every`,children:`every`}),(0,B.jsx)(Q,{value:`at`,children:`at`}),(0,B.jsx)(Q,{value:`one_shot`,children:`one shot`})]})]}),t.scheduleKind===`one_shot`?null:(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Timezone`}),(0,B.jsx)(Y,{value:t.scheduleTz,onChange:t=>e.onDraftChange(e=>({...e,scheduleTz:t.target.value})),placeholder:`Europe/Berlin`})]})]}),t.scheduleKind===`cron`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Cron`}),(0,B.jsx)(Y,{value:t.scheduleExpr,onChange:t=>e.onDraftChange(e=>({...e,scheduleExpr:t.target.value})),placeholder:`0 * * * *`})]}):null,t.scheduleKind===`every`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Every ms`}),(0,B.jsx)(Rc,{integer:!0,min:1,value:t.scheduleEveryMs,onValueChange:t=>e.onDraftChange(e=>({...e,scheduleEveryMs:t})),placeholder:`60000`}),(0,B.jsx)(Zo,{})]}):null,t.scheduleKind===`at`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Run at`}),(0,B.jsx)(Gh,{required:!0,value:t.scheduleAt,onValueChange:t=>e.onDraftChange(e=>({...e,scheduleAt:t}))}),(0,B.jsx)(Zo,{})]}):null,t.scheduleKind===`one_shot`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Retries after failure`}),(0,B.jsx)(Rc,{integer:!0,min:0,max:100,value:t.maxRetries,onValueChange:t=>e.onDraftChange(e=>({...e,maxRetries:t})),placeholder:`3`}),(0,B.jsx)(Zo,{})]}):null,(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Action`}),(0,B.jsxs)(vs,{value:t.actionKind,onChange:t=>e.onDraftChange(e=>({...e,actionKind:lu(Jh,t.target.value,e.actionKind)})),children:[(0,B.jsx)(Q,{value:`agent_turn`,children:`agent_turn`}),(0,B.jsx)(Q,{value:`system_event`,children:`system_event`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Delivery`}),(0,B.jsxs)(vs,{value:t.deliveryKind,onChange:t=>e.onDraftChange(e=>({...e,deliveryKind:lu(Yh,t.target.value,e.deliveryKind)})),children:[(0,B.jsx)(Q,{value:`channel`,children:`channel`}),(0,B.jsx)(Q,{value:`last-channel`,children:`last-channel`}),(0,B.jsx)(Q,{value:`webhook`,children:`webhook`})]})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Message`}),(0,B.jsx)(ts,{rows:4,value:t.actionMessage,onChange:t=>e.onDraftChange(e=>({...e,actionMessage:t.target.value})),placeholder:`Prompt or system-event message`})]}),t.deliveryKind===`channel`?(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Channel type`}),(0,B.jsx)(vs,{value:t.deliveryChannel,onChange:t=>e.onDraftChange(e=>({...e,deliveryChannel:t.target.value,deliveryTo:``})),children:e.channelOptions.map(e=>(0,B.jsx)(Q,{value:e.value,children:e.label},e.value))})]}),e.targetControl.kind===`select`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:e.targetControl.label}),(0,B.jsx)(Hh,{value:e.targetControl.value,onValueChange:t=>e.onDraftChange(e=>({...e,deliveryTo:t})),options:e.targetControl.options})]}):null,e.targetControl.kind===`input`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:e.targetControl.label}),(0,B.jsx)(Y,{value:e.targetControl.value,onChange:t=>e.onDraftChange(e=>({...e,deliveryTo:t.target.value})),placeholder:e.targetControl.placeholder})]}):null]}):null,t.deliveryKind===`webhook`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Webhook URL`}),(0,B.jsx)(Y,{type:`url`,value:t.deliveryWebhookUrl,onChange:t=>e.onDraftChange(e=>({...e,deliveryWebhookUrl:t.target.value})),placeholder:`https://example.test/hook`})]}):null,n?(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Next run`}),(0,B.jsx)(`strong`,{children:ao(n.nextRunAt)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Last run`}),(0,B.jsx)(`strong`,{children:ao(n.lastRun)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Last status`}),(0,B.jsx)(`strong`,{children:n.lastStatus||`n/a`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Errors`}),(0,B.jsx)(`strong`,{children:n.consecutiveErrors})]})]}):null,(0,B.jsxs)(`div`,{className:`button-row`,children:[(0,B.jsx)(Z,{type:`button`,loading:e.savePending,disabled:e.saveDisabled,onClick:e.onSave,children:e.savePending?`Saving...`:`Save job`}),(0,B.jsx)(Z,{variant:`ghost`,type:`button`,disabled:e.savePending,onClick:e.onCancel,children:`Cancel`}),n?(0,B.jsx)(Z,{variant:`ghost`,type:`button`,disabled:e.pausePending,onClick:e.onPauseToggle,children:e.pausePending?`Updating...`:n.disabled?`Resume job`:`Pause job`}):null,n?(0,B.jsx)(Z,{variant:`danger`,type:`button`,loading:e.deletePending,disabled:e.deletePending,onClick:e.onDelete,children:e.deletePending?`Deleting...`:`Delete job`}):null]})]})})]})})}function gg(){let e=Zn(),t=j(),n=ee({strict:!1}),r=Ss(),i=o(),a=n.jobId?.trim()||null,s=(0,R.useCallback)(e=>{t({to:`/admin/scheduler`,replace:!0,search:{jobId:e||void 0}}).catch(Fs)},[t]),[c,l]=(0,R.useState)(rg()),u=Pc(),d=y({queryKey:[`scheduler`,e.token],queryFn:()=>en(e.token)}),f=y({queryKey:[`config`,e.token],queryFn:()=>Nt(e.token)}),p=y({queryKey:[`channels`,e.token],queryFn:()=>Mt(e.token)}),m=d.data?.jobs.find(e=>e.id===a)||null,h=Xh(m)?m:null,_=ig({config:f.data?.config,status:e.gatewayStatus,currentChannel:c.deliveryChannel}),v=cg({channel:c.deliveryChannel,currentValue:c.deliveryTo,channels:p.data}),b=Hc({mutationFn:t=>tn(e.token,fg(t)),onSuccess:n=>{pg(n,e.token,i),t({to:`/admin/jobs`}).catch(Fs)},onError:e=>{r.error(`Save failed`,e.message)},invalidates:[[`overview`]]}),x=b.isPending||!u.isValid,S=g({mutationFn:()=>{if(!m)throw Error(`Select a scheduler item first.`);return nn(e.token,m)},onSuccess:t=>{pg(t,e.token,i),r.success(`Deleted.`),s(null),l(rg())},onError:e=>{r.error(`Delete failed`,H(e))}}),C=g({mutationFn:t=>{if(!m)throw Error(`Select a scheduler item first.`);return m.source===`task`?rn(e.token,{source:`task`,taskId:m.taskId??0,action:t}):rn(e.token,{source:`job`,jobId:m.id,action:t})},onSuccess:(t,n)=>{if(pg(t,e.token,i),r.success(n===`pause`?`Paused.`:`Resumed.`),!m)return;let a=t.jobs.find(e=>e.id===m.id)||null;if(!a){s(null),l(rg());return}Xh(a)&&l(rg(a))},onError:e=>{r.error(`Pause/resume failed`,H(e))}});return(0,R.useEffect)(()=>{if(h){l(rg(h));return}a||l(rg())},[h,a]),(0,R.useEffect)(()=>{!a||d.isLoading||m||s(null)},[d.isLoading,a,m,s]),(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{actions:(0,B.jsx)(Z,{variant:`ghost`,type:`button`,onClick:()=>{s(null),l(rg())},children:`New job`})}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Jobs`}),(0,B.jsx)(vo,{children:`${d.data?.jobs.length||0} item${d.data?.jobs.length===1?``:`s`}`})]}),(0,B.jsx)(K,{children:d.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading scheduler items...`}):d.data?.jobs.length?(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:d.data.jobs.map(e=>(0,B.jsxs)(`button`,{className:e.id===a?`selectable-row active`:`selectable-row`,type:`button`,onClick:()=>s(e.id),children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.name}),(0,B.jsx)(`small`,{children:eg(e)})]}),(0,B.jsxs)(`div`,{className:`row-status-stack`,children:[(0,B.jsx)(Qa,{value:e.enabled&&!e.disabled,trueLabel:`active`,falseLabel:`inactive`}),(0,B.jsx)(`small`,{children:tg(e)})]})]},e.id))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No scheduled work yet.`})})]}),Zh(m)?(0,B.jsx)(mg,{job:m,pausePending:C.isPending,deletePending:S.isPending,onPauseToggle:()=>C.mutate(m.disabled?`resume`:`pause`),onDelete:()=>S.mutate()}):(0,B.jsx)(hg,{draft:c,selectedJob:h,channelOptions:_,targetControl:v,savePending:b.isPending,pausePending:C.isPending,deletePending:S.isPending,saveDisabled:x,onDraftChange:e=>l(t=>e(t)),form:u,onSave:()=>{let e=dg(lg(c,v));l(e),b.mutate(e)},onCancel:()=>{if(h){l(rg(h));return}s(null),l(rg()),t({to:`/admin/jobs`}).catch(Fs)},onPauseToggle:()=>C.mutate(h?.disabled?`resume`:`pause`),onDelete:()=>S.mutate()})]})]})}var _g={section:`_section_1w0u2_1`,sectionHead:`_sectionHead_1w0u2_7`,sectionTitle:`_sectionTitle_1w0u2_13`,count:`_count_1w0u2_23`,caption:`_caption_1w0u2_30`,name:`_name_1w0u2_36`,fingerprint:`_fingerprint_1w0u2_42`,actionsHead:`_actionsHead_1w0u2_47`,actions:`_actions_1w0u2_47`,overwriteForm:`_overwriteForm_1w0u2_57`,overwriteNote:`_overwriteNote_1w0u2_63`,multiSelectTrigger:`_multiSelectTrigger_1w0u2_70`,multiSelectTriggerText:`_multiSelectTriggerText_1w0u2_104`,selectPlaceholder:`_selectPlaceholder_1w0u2_111`,selectSummary:`_selectSummary_1w0u2_115`,selectChevron:`_selectChevron_1w0u2_119`,multiSelectContent:`_multiSelectContent_1w0u2_131`,actionFilter:`_actionFilter_1w0u2_146`,choiceList:`_choiceList_1w0u2_150`,choiceGroup:`_choiceGroup_1w0u2_159`,choiceGroupLabel:`_choiceGroupLabel_1w0u2_165`,choiceRow:`_choiceRow_1w0u2_173`,choiceInput:`_choiceInput_1w0u2_192`,choiceCheck:`_choiceCheck_1w0u2_214`,choiceIcon:`_choiceIcon_1w0u2_232`,choiceMeta:`_choiceMeta_1w0u2_237`,choiceTitle:`_choiceTitle_1w0u2_244`,choiceDescription:`_choiceDescription_1w0u2_252`,choiceValue:`_choiceValue_1w0u2_260`,choiceEmpty:`_choiceEmpty_1w0u2_271`,choiceFooter:`_choiceFooter_1w0u2_278`,choiceCount:`_choiceCount_1w0u2_288`,tokenValue:`_tokenValue_1w0u2_293`};function vg(e){return e.length===null?`—`:`${e.length} bytes`}function yg(e){return e.fingerprint?`sha256:${e.fingerprint.sha256_prefix}`:`—`}function bg(e){return e?io(e):`never`}function xg(){let{token:e}=Zn(),t=Ss(),n=o(),[r,i]=(0,R.useState)(null),[a,s]=(0,R.useState)(null),[c,l]=(0,R.useState)(``),u=y({queryKey:[`admin`,`secrets`,e],queryFn:()=>Kt(e),retry:!1}),d=(0,R.useCallback)(()=>n.invalidateQueries({queryKey:[`admin`,`secrets`]}),[n]),f=g({mutationFn:t=>qt(e,t.name,t.value),onSuccess:async(e,n)=>{t.success(n.wasSet?`Rotated ${n.name}.`:`Set ${n.name}.`),i(null),await d()},onError:e=>{t.error(`Overwrite failed: ${H(e)}`)}}),p=g({mutationFn:t=>Jt(e,t),onSuccess:async(e,n)=>{t.success(`Removed ${n}.`),s(null),await d()},onError:e=>{t.error(`Unset failed: ${H(e)}`)}}),m=u.data,h=(0,R.useMemo)(()=>{if(!m)return null;let e=c.trim().toLowerCase(),t=m.secrets.filter(e=>e.state===`set`),n=m.secrets.filter(e=>e.state===`unset`),r=t=>e===``||t.name.toLowerCase().includes(e);return{setAll:t,unsetAll:n,setEntries:t.filter(r),unsetEntries:n.filter(r)}},[m,c]);if(u.isPending)return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{description:`Runtime secret store`}),(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading the runtime secret store…`})]});if(u.isError||!h){let e=u.error instanceof we&&u.error.status===403;return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{description:`Runtime secret store`}),(0,B.jsx)(`div`,{className:`empty-state`,children:e?`You do not have permission to view secret metadata.`:`Failed to load secrets: ${H(u.error)}`})]})}let _=m?.actions.includes(`secret.overwrite`)??!1,v=m?.actions.includes(`secret.unset`)??!1,b=_||v;return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{description:`Runtime credential store. Values are write-only — set or rotate them here; they are never read back to the browser.`,actions:(0,B.jsx)(`input`,{className:`compact-search`,value:c,onChange:e=>l(e.target.value),placeholder:`Filter secrets`,"aria-label":`Filter secrets by name`})}),(0,B.jsxs)(`section`,{className:_g.section,"aria-label":`Set`,children:[(0,B.jsxs)(`div`,{className:_g.sectionHead,children:[(0,B.jsxs)(`h2`,{className:_g.sectionTitle,children:[`Set `,(0,B.jsx)(`span`,{className:_g.count,children:h.setAll.length})]}),(0,B.jsx)(`p`,{className:_g.caption,children:`Stored values, shown only as metadata — length and a SHA-256 fingerprint, never the value itself.`})]}),h.setEntries.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:h.setAll.length===0?`No secrets are currently set.`:`No set secrets match this filter.`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Name`}),(0,B.jsx)(`th`,{children:`Length`}),(0,B.jsx)(`th`,{children:`Fingerprint`}),(0,B.jsx)(`th`,{children:`Last rotated`}),b?(0,B.jsx)(`th`,{className:_g.actionsHead,children:`Actions`}):null]})}),(0,B.jsx)(`tbody`,{children:h.setEntries.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:(0,B.jsx)(`strong`,{className:_g.name,children:e.name})}),(0,B.jsx)(`td`,{children:vg(e)}),(0,B.jsx)(`td`,{children:(0,B.jsx)(`code`,{className:_g.fingerprint,children:yg(e)})}),(0,B.jsx)(`td`,{title:e.last_rotated_at??void 0,children:bg(e.last_rotated_at)}),b?(0,B.jsx)(`td`,{children:(0,B.jsxs)(`div`,{className:_g.actions,children:[_?(0,B.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(e.name),children:`Rotate`}):null,v?(0,B.jsx)(Z,{type:`button`,variant:`danger`,size:`sm`,onClick:()=>s(e.name),children:`Unset`}):null]})}):null]},e.name))})]})})]}),(0,B.jsxs)(`section`,{className:_g.section,"aria-label":`Declared but unset`,children:[(0,B.jsxs)(`div`,{className:_g.sectionHead,children:[(0,B.jsxs)(`h2`,{className:_g.sectionTitle,children:[`Declared but unset`,` `,(0,B.jsx)(`span`,{className:_g.count,children:h.unsetAll.length})]}),(0,B.jsx)(`p`,{className:_g.caption,children:`Referenced by a skill, connector, or provider, with no value yet.`})]}),h.unsetEntries.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:h.unsetAll.length===0?`No declared-but-unset secrets.`:`No declared secrets match this filter.`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Name`}),_?(0,B.jsx)(`th`,{className:_g.actionsHead,children:`Actions`}):null]})}),(0,B.jsx)(`tbody`,{children:h.unsetEntries.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:(0,B.jsx)(`strong`,{className:_g.name,children:e.name})}),_?(0,B.jsx)(`td`,{children:(0,B.jsx)(`div`,{className:_g.actions,children:(0,B.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(e.name),children:`Set`})})}):null]},e.name))})]})})]}),(0,B.jsx)(Sg,{name:r,onClose:()=>i(null),pending:f.isPending,onSubmit:e=>{if(!r)return;let t=h.setAll.some(e=>e.name===r);f.mutate({name:r,value:e,wasSet:t})}}),(0,B.jsx)(Cg,{name:a,onClose:()=>s(null),pending:p.isPending,onConfirm:()=>{a&&p.mutate(a)}})]})}function Sg(e){let t=e.name!==null,n=(0,R.useRef)(null),r=(0,R.useId)(),i=(0,R.useId)();return(0,B.jsx)(ui,{open:t,onOpenChange:t=>{t||(n.current&&(n.current.value=``),e.onClose())},children:(0,B.jsxs)(di,{role:`dialog`,size:`default`,preventCloseOnOutsideClick:e.pending,children:[(0,B.jsxs)(fi,{children:[(0,B.jsxs)(pi,{children:[`Set value for `,(0,B.jsx)(`code`,{children:e.name})]}),(0,B.jsx)(mi,{children:`The new value is sent to the gateway and immediately discarded from this form. There is no way to read the stored value back.`})]}),(0,B.jsxs)(`form`,{className:_g.overwriteForm,onSubmit:t=>{t.preventDefault();let r=n.current;if(!r)return;let i=r.value;i.trim()&&e.onSubmit(i)},children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{htmlFor:r,children:`New value`}),(0,B.jsx)(Y,{id:r,ref:n,type:`password`,autoComplete:`new-password`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,required:!0,"aria-describedby":i,disabled:e.pending}),(0,B.jsx)(`p`,{id:i,className:_g.overwriteNote,children:`Pasted value is not echoed. Once submitted, the value lives only in the runtime secret store; this page cannot show it again.`})]}),(0,B.jsxs)(hi,{children:[(0,B.jsx)(gi,{className:`ghost-button`,disabled:e.pending,children:`Cancel`}),(0,B.jsx)(Z,{type:`submit`,disabled:e.pending,children:e.pending?`Saving…`:`Save value`})]})]})]})})}function Cg(e){return(0,B.jsx)(ui,{open:e.name!==null,onOpenChange:t=>{t||e.onClose()},children:(0,B.jsxs)(di,{role:`alertdialog`,size:`default`,preventCloseOnOutsideClick:e.pending,children:[(0,B.jsxs)(fi,{children:[(0,B.jsxs)(pi,{children:[`Unset `,(0,B.jsx)(`code`,{children:e.name}),`?`]}),(0,B.jsx)(mi,{children:`The stored value will be removed from the runtime secret store. Skills or connectors that depend on this secret will fail their preflight checks until a new value is set.`})]}),(0,B.jsxs)(hi,{children:[(0,B.jsx)(gi,{className:`ghost-button`,disabled:e.pending,children:`Cancel`}),(0,B.jsx)(Z,{type:`button`,variant:`danger`,disabled:e.pending,onClick:e.onConfirm,children:e.pending?`Removing…`:`Unset secret`})]})]})})}function wg(){let e=Zn(),t=o(),n=Ss(),r=j(),i=ee({strict:!1}).sessionId?.trim()||null,a=(0,R.useRef)(i),[s,c]=(0,R.useState)(``),[l,u]=(0,R.useState)(()=>i),[d,f]=(0,R.useState)(!1),p=(0,R.useDeferredValue)(s),m=y({queryKey:[`sessions`,e.token],queryFn:()=>Et(e.token)}),h=g({mutationFn:t=>jt(e.token,t),onSuccess:(e,i)=>{t.invalidateQueries({queryKey:[`sessions`]}),t.invalidateQueries({queryKey:[`overview`]}),n.success(`Session deleted`,`Removed ${e.deletedMessages} messages and ${e.deletedTasks} tasks.`),l===i&&(u(null),r({to:`/admin/sessions`,replace:!0,search:{sessionId:void 0}}).catch(Fs))},onError:e=>{n.error(`Delete failed`,H(e))}}),_=(m.data||[]).filter(e=>[e.id,e.channelId,e.guildId||``,e.effectiveModel,e.summary||``].join(` `).toLowerCase().includes(p.trim().toLowerCase())),v=_.find(e=>e.id===l)||_[0]||null;(0,R.useEffect)(()=>{v&&v.id!==l&&u(v.id)},[l,v]),(0,R.useEffect)(()=>{i!==a.current&&(a.current=i,i&&i!==l&&u(i))},[i,l]);function b(e){u(e),r({to:`/admin/sessions`,replace:!0,search:{sessionId:e}}).catch(Fs)}return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{actions:(0,B.jsx)(`input`,{className:`compact-search`,value:s,onChange:e=>c(e.target.value),placeholder:`Filter by session, channel, model`})}),(0,B.jsxs)(`div`,{className:`two-column-grid sessions-layout`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Session list`}),(0,B.jsx)(vo,{children:`${_.length} result${_.length===1?``:`s`}`})]}),(0,B.jsx)(K,{children:m.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading sessions...`}):_.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No sessions match this filter.`}):(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:_.map(e=>(0,B.jsxs)(`button`,{className:e.id===v?.id?`selectable-row active`:`selectable-row`,type:`button`,onClick:()=>b(e.id),children:[(0,B.jsxs)(`div`,{className:`session-row-main`,children:[(0,B.jsx)(`strong`,{children:e.id}),(0,B.jsxs)(`small`,{className:`session-row-meta`,children:[e.channelId,` · `,e.effectiveModel]})]}),(0,B.jsx)(`span`,{className:`session-row-time`,children:io(e.lastActive)})]},e.id))})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Inspection`})}),(0,B.jsx)(K,{children:v?(0,B.jsxs)(`div`,{className:`detail-stack`,children:[(0,B.jsxs)(`div`,{className:`key-value-grid`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Session`}),(0,B.jsx)(`strong`,{children:v.id})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Channel`}),(0,B.jsx)(`strong`,{children:v.channelId})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Guild`}),(0,B.jsx)(`strong`,{children:v.guildId||`direct/web`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Model`}),(0,B.jsx)(`strong`,{children:v.effectiveModel})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Messages`}),(0,B.jsx)(`strong`,{children:v.messageCount})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Scheduled tasks`}),(0,B.jsx)(`strong`,{children:v.taskCount})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`RAG`}),(0,B.jsx)(Qa,{value:v.ragEnabled,trueLabel:`on`,falseLabel:`off`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{children:`Last active`}),(0,B.jsx)(`strong`,{children:io(v.lastActive)})]})]}),(0,B.jsxs)(`div`,{className:`summary-block`,children:[(0,B.jsx)(`span`,{children:`Summary`}),(0,B.jsx)(`p`,{children:v.summary||`No summary stored for this session.`})]}),(0,B.jsx)(`button`,{className:`danger-button`,type:`button`,disabled:h.isPending,onClick:()=>f(!0),children:h.isPending?`Deleting...`:`Delete session`})]}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Select a session to inspect it.`})})]})]}),(0,B.jsx)(ui,{open:d,onOpenChange:f,children:(0,B.jsxs)(di,{size:`sm`,role:`alertdialog`,children:[(0,B.jsxs)(fi,{children:[(0,B.jsx)(pi,{children:`Delete session?`}),(0,B.jsx)(mi,{children:`This will permanently remove the session and all associated audit events.`})]}),(0,B.jsxs)(hi,{children:[(0,B.jsx)(gi,{className:`ghost-button`,children:`Cancel`}),(0,B.jsx)(gi,{className:`danger-button`,onClick:()=>{v&&h.mutate(v.id)},children:`Delete`})]})]})})]})}function Tg(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Eg=Tg();function Dg(e){Eg=e}var Og={exec:()=>null};function kg(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(jg.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Ag=(()=>{try{return!0}catch{return!1}})(),jg={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Mg=/^(?:[ \t]*(?:\n|$))+/,Ng=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Pg=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Fg=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ig=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Lg=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Rg=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zg=kg(Rg).replace(/bull/g,Lg).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Bg=kg(Rg).replace(/bull/g,Lg).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Vg=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Hg=/^[^\n]+/,Ug=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Wg=kg(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Ug).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Gg=kg(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Lg).getRegex(),Kg=`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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,qg=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Jg=kg(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,qg).replace(`tag`,Kg).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Yg=kg(Vg).replace(`hr`,Fg).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Kg).getRegex(),Xg={blockquote:kg(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Yg).getRegex(),code:Ng,def:Wg,fences:Pg,heading:Ig,hr:Fg,html:Jg,lheading:zg,list:Gg,newline:Mg,paragraph:Yg,table:Og,text:Hg},Zg=kg(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Fg).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Kg).getRegex(),Qg={...Xg,lheading:Bg,table:Zg,paragraph:kg(Vg).replace(`hr`,Fg).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Zg).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Kg).getRegex()},$g={...Xg,html:kg(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,qg).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Og,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:kg(Vg).replace(`hr`,Fg).replace(`heading`,` *#{1,6} *[^
73
+ ]`).replace(`lheading`,zg).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},e_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,t_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,n_=/^( {2,}|\\)\n(?!\s*$)/,r_=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,i_=/[\p{P}\p{S}]/u,a_=/[\s\p{P}\p{S}]/u,o_=/[^\s\p{P}\p{S}]/u,s_=kg(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,a_).getRegex(),c_=/(?!~)[\p{P}\p{S}]/u,l_=/(?!~)[\s\p{P}\p{S}]/u,u_=/(?:[^\s\p{P}\p{S}]|~)/u,d_=/(?![*_])[\p{P}\p{S}]/u,f_=/(?![*_])[\s\p{P}\p{S}]/u,p_=/(?:[^\s\p{P}\p{S}]|[*_])/u,m_=kg(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Ag?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),h_=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,g_=kg(h_,`u`).replace(/punct/g,i_).getRegex(),__=kg(h_,`u`).replace(/punct/g,c_).getRegex(),v_=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,y_=kg(v_,`gu`).replace(/notPunctSpace/g,o_).replace(/punctSpace/g,a_).replace(/punct/g,i_).getRegex(),b_=kg(v_,`gu`).replace(/notPunctSpace/g,u_).replace(/punctSpace/g,l_).replace(/punct/g,c_).getRegex(),x_=kg(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,o_).replace(/punctSpace/g,a_).replace(/punct/g,i_).getRegex(),S_=kg(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,d_).getRegex(),C_=kg(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,p_).replace(/punctSpace/g,f_).replace(/punct/g,d_).getRegex(),w_=kg(/\\(punct)/,`gu`).replace(/punct/g,i_).getRegex(),T_=kg(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[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])?)+(?![-_])/).getRegex(),E_=kg(qg).replace(`(?:-->|$)`,`-->`).getRegex(),D_=kg(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,E_).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),O_=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,k_=kg(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,O_).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),A_=kg(/^!?\[(label)\]\[(ref)\]/).replace(`label`,O_).replace(`ref`,Ug).getRegex(),j_=kg(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Ug).getRegex(),M_=kg(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,A_).replace(`nolink`,j_).getRegex(),N_=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,P_={_backpedal:Og,anyPunctuation:w_,autolink:T_,blockSkip:m_,br:n_,code:t_,del:Og,delLDelim:Og,delRDelim:Og,emStrongLDelim:g_,emStrongRDelimAst:y_,emStrongRDelimUnd:x_,escape:e_,link:k_,nolink:j_,punctuation:s_,reflink:A_,reflinkSearch:M_,tag:D_,text:r_,url:Og},F_={...P_,link:kg(/^!?\[(label)\]\((.*?)\)/).replace(`label`,O_).getRegex(),reflink:kg(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,O_).getRegex()},I_={...P_,emStrongRDelimAst:b_,emStrongLDelim:__,delLDelim:S_,delRDelim:C_,url:kg(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,N_).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:kg(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,N_).getRegex()},L_={...I_,br:kg(n_).replace(`{2,}`,`*`).getRegex(),text:kg(I_.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},R_={normal:Xg,gfm:Qg,pedantic:$g},z_={normal:P_,gfm:I_,breaks:L_,pedantic:F_},B_={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},V_=e=>B_[e];function H_(e,t){if(t){if(jg.escapeTest.test(e))return e.replace(jg.escapeReplace,V_)}else if(jg.escapeTestNoEncode.test(e))return e.replace(jg.escapeReplaceNoEncode,V_);return e}function U_(e){try{e=encodeURI(e).replace(jg.percentDecode,`%`)}catch{return null}return e}function W_(e,t){let n=e.replace(jg.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(jg.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(jg.slashPipe,`|`);return n}function G_(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function K_(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function q_(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function J_(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function Y_(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
74
74
  `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
75
- `)}var U_=class{options;rules;lexer;constructor(e){this.options=e||yg}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:R_(e,`
76
- `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=H_(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=R_(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:R_(t[0],`
77
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=R_(t[0],`
75
+ `)}var X_=class{options;rules;lexer;constructor(e){this.options=e||Eg}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:G_(e,`
76
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Y_(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=G_(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:G_(t[0],`
77
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=G_(t[0],`
78
78
  `).split(`
79
79
  `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
80
80
  `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
@@ -85,17 +85,17 @@ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
85
85
  `),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
86
86
  `+e.join(`
87
87
  `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
88
- `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=B_(t[2].split(`
88
+ `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=q_(t[2].split(`
89
89
  `,1)[0],t[1].length),l=e.split(`
90
90
  `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
91
91
  `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
92
92
  `,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
93
93
  `+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
94
94
  `+l}u=!l.trim(),r+=p+`
95
- `,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=L_(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
96
- `):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(L_(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
97
- `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=R_(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=z_(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),V_(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return V_(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},W_=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||yg,this.options.tokenizer=this.options.tokenizer||new U_,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:wg,block:j_.normal,inline:M_.normal};this.options.pedantic?(t.block=j_.pedantic,t.inline=M_.pedantic):this.options.gfm&&(t.block=j_.gfm,this.options.breaks?t.inline=M_.breaks:t.inline=M_.gfm),this.tokenizer.rules=t}static get rules(){return{block:j_,inline:M_}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(wg.carriageReturn,`
98
- `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(wg.tabCharGlobal,` `).replace(wg.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
95
+ `,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=W_(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
96
+ `):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(W_(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
97
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=G_(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=K_(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),J_(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return J_(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},Z_=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Eg,this.options.tokenizer=this.options.tokenizer||new X_,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:jg,block:R_.normal,inline:z_.normal};this.options.pedantic?(t.block=R_.pedantic,t.inline=z_.pedantic):this.options.gfm&&(t.block=R_.gfm,this.options.breaks?t.inline=z_.breaks:t.inline=z_.gfm),this.tokenizer.rules=t}static get rules(){return{block:R_,inline:z_}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(jg.carriageReturn,`
98
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(jg.tabCharGlobal,` `).replace(jg.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
99
99
  `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
100
100
  `)?``:`
101
101
  `)+r.raw,n.text+=`
@@ -108,9 +108,9 @@ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
108
108
  `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
109
109
  `)?``:`
110
110
  `)+r.raw,n.text+=`
111
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},G_=class{options;parser;constructor(e){this.options=e||yg}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(wg.notSpaceStart)?.[0],i=e.replace(wg.endingNewline,``)+`
112
- `;return r?`<pre><code class="language-`+F_(r)+`">`+(n?i:F_(i,!0))+`</code></pre>
113
- `:`<pre><code>`+(n?i:F_(i,!0))+`</code></pre>
111
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},Q_=class{options;parser;constructor(e){this.options=e||Eg}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(jg.notSpaceStart)?.[0],i=e.replace(jg.endingNewline,``)+`
112
+ `;return r?`<pre><code class="language-`+H_(r)+`">`+(n?i:H_(i,!0))+`</code></pre>
113
+ `:`<pre><code>`+(n?i:H_(i,!0))+`</code></pre>
114
114
  `}blockquote({tokens:e}){return`<blockquote>
115
115
  ${this.parser.parse(e)}</blockquote>
116
116
  `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
@@ -126,16 +126,16 @@ ${this.parser.parse(e)}</blockquote>
126
126
  `}tablerow({text:e}){return`<tr>
127
127
  ${e}</tr>
128
128
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
129
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${F_(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=I_(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+F_(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=I_(e);if(i===null)return F_(n);e=i;let a=`<img src="${e}" alt="${F_(n)}"`;return t&&(a+=` title="${F_(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:F_(e.text)}},K_=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},q_=class e{options;renderer;textRenderer;constructor(e){this.options=e||yg,this.options.renderer=this.options.renderer||new G_,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new K_}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},J_=class{options;block;constructor(e){this.options=e||yg}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?W_.lex:W_.lexInline}provideParser(){return this.block?q_.parse:q_.parseInline}},Y_=class{defaults=vg();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=q_;Renderer=G_;TextRenderer=K_;Lexer=W_;Tokenizer=U_;Hooks=J_;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new G_(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new U_(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new J_;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];J_.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&J_.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return W_.lex(e,t??this.defaults)}parser(e,t){return q_.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?W_.lex:W_.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?q_.parse:q_.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?W_.lex:W_.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?q_.parse:q_.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
130
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+F_(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},X_=new Y_;function Z_(e,t){return X_.parse(e,t)}Z_.options=Z_.setOptions=function(e){return X_.setOptions(e),Z_.defaults=X_.defaults,bg(Z_.defaults),Z_},Z_.getDefaults=vg,Z_.defaults=yg,Z_.use=function(...e){return X_.use(...e),Z_.defaults=X_.defaults,bg(Z_.defaults),Z_},Z_.walkTokens=function(e,t){return X_.walkTokens(e,t)},Z_.parseInline=X_.parseInline,Z_.Parser=q_,Z_.parser=q_.parse,Z_.Renderer=G_,Z_.TextRenderer=K_,Z_.Lexer=W_,Z_.lexer=W_.lex,Z_.Tokenizer=U_,Z_.Hooks=J_,Z_.parse=Z_,Z_.options,Z_.setOptions,Z_.use,Z_.walkTokens,Z_.parseInline,q_.parse,W_.lex;var Q_=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fromCodePoint=void 0,e.replaceCodePoint=n,e.decodeCodePoint=r;var t=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]]);e.fromCodePoint=String.fromCodePoint??(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 n(e){return e>=55296&&e<=57343||e>1114111?65533:t.get(e)??e}function r(t){return(0,e.fromCodePoint)(n(t))}})),$_=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.decodeBase64=t;function t(e){let t=typeof atob==`function`?atob(e):typeof Buffer.from==`function`?Buffer.from(e,`base64`).toString(`binary`):new Buffer(e,`base64`).toString(`binary`),n=t.length&-2,r=new Uint16Array(n/2);for(let e=0,i=0;e<n;e+=2){let n=t.charCodeAt(e),a=t.charCodeAt(e+1);r[i++]=n|a<<8}return r}})),ev=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.htmlDecodeTree=void 0,e.htmlDecodeTree=(0,$_().decodeBase64)(`QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXEAAKBOIgAHSE9hY2RlZmhpbG9yc3UXARoBHwE6AVIBVQFiAWQBZgGCAakB6QHtAfIBYwB5ACdkUABZADuAqQCpQIABY3B5ACUBKAE1AfUhdGUGYWmg0iJ0KGFsRGlmZmVyZW50aWFsRAAAoEUhbCJleXMAAKAtIQACYWVpb0EBRAFKAU0B8iFvbgxhZABpAGwAO4DHAMdAcgBjAAhhbiJpbnQAAKAwIm8AdAAKYQABZG5ZAV0BaSJsbGEAuGB0I2VyRG90ALdg8gA5AWkAp2NyImNsZQAAAkRNUFRwAXQBeQF9AW8AdAAAoJkiaSJudXMAAKCWIuwhdXMAoJUiaSJtZXMAAKCXIm8AAAFjc4cBlAFrKndpc2VDb250b3VySW50ZWdyYWwAAKAyImUjQ3VybHkAAAFEUZwBpAFvJXVibGVRdW90ZQAAoB0gdSJvdGUAAKAZIAACbG5wdbABtgHNAdgBbwBuAGWgNyIAoHQqgAFnaXQAvAHBAcUB8iJ1ZW50AKBhIm4AdAAAoC8i7yV1ckludGVncmFsAKAuIgABZnLRAdMBAKACIe8iZHVjdACgECJuLnRlckNsb2Nrd2lzZUNvbnRvdXJJbnRlZ3JhbAAAoDMi7yFzcwCgLypjAHIAAOA12J7ccABDoNMiYQBwAACgTSKABURKU1phY2VmaW9zAAsCEgIVAhgCGwIsAjQCOQI9AnMCfwNvoEUh9CJyYWhkAKARKWMAeQACZGMAeQAFZGMAeQAPZIABZ3JzACECJQIoAuchZXIAoCEgcgAAoKEhaAB2AACg5CoAAWF5MAIzAvIhb24OYRRkbAB0oAciYQCUY3IAAOA12AfdAAFhZkECawIAAWNtRQJnAvIjaXRpY2FsAAJBREdUUAJUAl8CYwJjInV0ZQC0YG8AdAFZAloC2WJiJGxlQWN1dGUA3WJyImF2ZQBgYGkibGRlANxi7yFuZACgxCJmJWVyZW50aWFsRAAAoEYhcAR9AgAAAAAAAIECjgIAABoDZgAA4DXYO91EoagAhQKJAm8AdAAAoNwgcSJ1YWwAAKBQIuIhbGUAA0NETFJVVpkCqAK1Au8C/wIRA28AbgB0AG8AdQByAEkAbgB0AGUAZwByAGEA7ADEAW8AdAKvAgAAAACwAqhgbiNBcnJvdwAAoNMhAAFlb7kC0AJmAHQAgAFBUlQAwQLGAs0CciJyb3cAAKDQIekkZ2h0QXJyb3cAoNQhZQDlACsCbgBnAAABTFLWAugC5SFmdAABQVLcAuECciJyb3cAAKD4J+kkZ2h0QXJyb3cAoPon6SRnaHRBcnJvdwCg+SdpImdodAAAAUFU9gL7AnIicm93AACg0iFlAGUAAKCoInAAQQIGAwAAAAALA3Iicm93AACg0SFvJHduQXJyb3cAAKDVIWUlcnRpY2FsQmFyAACgJSJuAAADQUJMUlRhJAM2AzoDWgNxA3oDciJyb3cAAKGTIUJVLAMwA2EAcgAAoBMpcCNBcnJvdwAAoPUhciJldmUAEWPlIWZ00gJDAwAASwMAAFIDaSVnaHRWZWN0b3IAAKBQKWUkZVZlY3RvcgAAoF4p5SJjdG9yQqC9IWEAcgAAoFYpaSJnaHQA1AFiAwAAaQNlJGVWZWN0b3IAAKBfKeUiY3RvckKgwSFhAHIAAKBXKWUAZQBBoKQiciJyb3cAAKCnIXIAcgBvAPcAtAIAAWN0gwOHA3IAAOA12J/c8iFvaxBhAAhOVGFjZGZnbG1vcHFzdHV4owOlA6kDsAO/A8IDxgPNA9ID8gP9AwEEFAQeBCAEJQRHAEphSAA7gNAA0EBjAHUAdABlADuAyQDJQIABYWl5ALYDuQO+A/Ihb24aYXIAYwA7gMoAykAtZG8AdAAWYXIAAOA12AjdcgBhAHYAZQA7gMgAyEDlIm1lbnQAoAgiAAFhcNYD2QNjAHIAEmF0AHkAUwLhAwAAAADpA20lYWxsU3F1YXJlAACg+yVlJ3J5U21hbGxTcXVhcmUAAKCrJQABZ3D2A/kDbwBuABhhZgAA4DXYPN3zImlsb26VY3UAAAFhaQYEDgRsAFSgdSppImxkZQAAoEIi7CNpYnJpdW0AoMwhAAFjaRgEGwRyAACgMCFtAACgcyphAJdjbQBsADuAywDLQAABaXApBC0E8yF0cwCgAyLvJG5lbnRpYWxFAKBHIYACY2Zpb3MAPQQ/BEMEXQRyBHkAJGRyAADgNdgJ3WwibGVkAFMCTAQAAAAAVARtJWFsbFNxdWFyZQAAoPwlZSdyeVNtYWxsU3F1YXJlAACgqiVwA2UEAABpBAAAAABtBGYAAOA12D3dwSFsbACgACLyI2llcnRyZgCgMSFjAPIAcQQABkpUYWJjZGZnb3JzdIgEiwSOBJMElwSkBKcEqwStBLIE5QTqBGMAeQADZDuAPgA+QO0hbWFkoJMD3GNyImV2ZQAeYYABZWl5AJ0EoASjBOQhaWwiYXIAYwAcYRNkbwB0ACBhcgAA4DXYCt0AoNkicABmAADgNdg+3eUiYXRlcgADRUZHTFNUvwTIBM8E1QTZBOAEcSJ1YWwATKBlIuUhc3MAoNsidSRsbEVxdWFsAACgZyJyI2VhdGVyAACgoirlIXNzAKB3IuwkYW50RXF1YWwAoH4qaSJsZGUAAKBzImMAcgAA4DXYotwAoGsiAARBYWNmaW9zdfkE/QQFBQgFCwUTBSIFKwVSIkRjeQAqZAABY3QBBQQFZQBrAMdiXmDpIXJjJGFyAACgDCFsJWJlcnRTcGFjZQAAoAsh8AEYBQAAGwVmAACgDSHpJXpvbnRhbExpbmUAoAAlAAFjdCYFKAXyABIF8iFvayZhbQBwAEQBMQU5BW8AdwBuAEgAdQBtAPAAAAFxInVhbAAAoE8iAAdFSk9hY2RmZ21ub3N0dVMFVgVZBVwFYwVtBXAFcwV6BZAFtgXFBckFzQVjAHkAFWTsIWlnMmFjAHkAAWRjAHUAdABlADuAzQDNQAABaXlnBWwFcgBjADuAzgDOQBhkbwB0ADBhcgAAoBEhcgBhAHYAZQA7gMwAzEAAoREhYXB/BYsFAAFjZ4MFhQVyACphaSNuYXJ5SQAAoEghbABpAGUA8wD6AvQBlQUAAKUFZaAsIgABZ3KaBZ4F8iFhbACgKyLzI2VjdGlvbgCgwiJpI3NpYmxlAAABQ1SsBbEFbyJtbWEAAKBjIGkibWVzAACgYiCAAWdwdAC8Bb8FwwVvAG4ALmFmAADgNdhA3WEAmWNjAHIAAKAQIWkibGRlAChh6wHSBQAA1QVjAHkABmRsADuAzwDPQIACY2Zvc3UA4QXpBe0F8gX9BQABaXnlBegFcgBjADRhGWRyAADgNdgN3XAAZgAA4DXYQd3jAfcFAAD7BXIAAOA12KXc8iFjeQhk6yFjeQRkgANISmFjZm9zAAwGDwYSBhUGHQYhBiYGYwB5ACVkYwB5AAxk8CFwYZpjAAFleRkGHAbkIWlsNmEaZHIAAOA12A7dcABmAADgNdhC3WMAcgAA4DXYptyABUpUYWNlZmxtb3N0AD0GQAZDBl4GawZkB2gHcAd0B80H2gdjAHkACWQ7gDwAPECAAmNtbnByAEwGTwZSBlUGWwb1IXRlOWHiIWRhm2NnAACg6ifsI2FjZXRyZgCgEiFyAACgniGAAWFleQBkBmcGagbyIW9uPWHkIWlsO2EbZAABZnNvBjQHdAAABUFDREZSVFVWYXKABp4GpAbGBssG3AYDByEHwQIqBwABbnKEBowGZyVsZUJyYWNrZXQAAKDoJ/Ihb3cAoZAhQlKTBpcGYQByAACg5CHpJGdodEFycm93AKDGIWUjaWxpbmcAAKAII28A9QGqBgAAsgZiJWxlQnJhY2tldAAAoOYnbgDUAbcGAAC+BmUkZVZlY3RvcgAAoGEp5SJjdG9yQqDDIWEAcgAAoFkpbCJvb3IAAKAKI2kiZ2h0AAABQVbSBtcGciJyb3cAAKCUIeUiY3RvcgCgTikAAWVy4AbwBmUAAKGjIkFW5gbrBnIicm93AACgpCHlImN0b3IAoFopaSNhbmdsZQBCorIi+wYAAAAA/wZhAHIAAKDPKXEidWFsAACgtCJwAIABRFRWAAoHEQcYB+8kd25WZWN0b3IAoFEpZSRlVmVjdG9yAACgYCnlImN0b3JCoL8hYQByAACgWCnlImN0b3JCoLwhYQByAACgUilpAGcAaAB0AGEAcgByAG8A9wDMAnMAAANFRkdMU1Q/B0cHTgdUB1gHXwfxJXVhbEdyZWF0ZXIAoNoidSRsbEVxdWFsAACgZiJyI2VhdGVyAACgdiLlIXNzAKChKuwkYW50RXF1YWwAoH0qaSJsZGUAAKByInIAAOA12A/dZaDYIuYjdGFycm93AKDaIWkiZG90AD9hgAFucHcAege1B7kHZwAAAkxSbHKCB5QHmwerB+UhZnQAAUFSiAeNB3Iicm93AACg9SfpJGdodEFycm93AKD3J+kkZ2h0QXJyb3cAoPYn5SFmdAABYXLcAqEHaQBnAGgAdABhAHIAcgBvAPcA5wJpAGcAaAB0AGEAcgByAG8A9wDuAmYAAOA12EPdZQByAAABTFK/B8YHZSRmdEFycm93AACgmSHpJGdodEFycm93AKCYIYABY2h0ANMH1QfXB/IAWgYAoLAh8iFva0FhAKBqIgAEYWNlZmlvc3XpB+wH7gf/BwMICQgOCBEIcAAAoAUpeQAcZAABZGzyB/kHaSR1bVNwYWNlAACgXyBsI2ludHJmAACgMyFyAADgNdgQ3e4jdXNQbHVzAKATInAAZgAA4DXYRN1jAPIA/gecY4AESmFjZWZvc3R1ACEIJAgoCDUIgQiFCDsKQApHCmMAeQAKZGMidXRlAENhgAFhZXkALggxCDQI8iFvbkdh5CFpbEVhHWSAAWdzdwA7CGEIfQjhInRpdmWAAU1UVgBECEwIWQhlJWRpdW1TcGFjZQAAoAsgaABpAAABY25SCFMIawBTAHAAYQBjAOUASwhlAHIAeQBUAGgAaQDuAFQI9CFlZAABR0xnCHUIcgBlAGEAdABlAHIARwByAGUAYQB0AGUA8gDrBGUAcwBzAEwAZQBzAPMA2wdMImluZQAKYHIAAOA12BHdAAJCbnB0jAiRCJkInAhyImVhawAAoGAgwiZyZWFraW5nU3BhY2WgYGYAAKAVIUOq7CqzCMIIzQgAAOcIGwkAAAAAAAAtCQAAbwkAAIcJAACdCcAJGQoAADQKAAFvdbYIvAjuI2dydWVudACgYiJwIkNhcAAAoG0ibyh1YmxlVmVydGljYWxCYXIAAKAmIoABbHF4ANII1wjhCOUibWVudACgCSL1IWFsVKBgImkibGRlAADgQiI4A2kic3RzAACgBCJyI2VhdGVyAACjbyJFRkdMU1T1CPoIAgkJCQ0JFQlxInVhbAAAoHEidSRsbEVxdWFsAADgZyI4A3IjZWF0ZXIAAOBrIjgD5SFzcwCgeSLsJGFudEVxdWFsAOB+KjgDaSJsZGUAAKB1IvUhbXBEASAJJwnvI3duSHVtcADgTiI4A3EidWFsAADgTyI4A2UAAAFmczEJRgn0JFRyaWFuZ2xlQqLqIj0JAAAAAEIJYQByAADgzyk4A3EidWFsAACg7CJzAICibiJFR0xTVABRCVYJXAlhCWkJcSJ1YWwAAKBwInIjZWF0ZXIAAKB4IuUhc3MA4GoiOAPsJGFudEVxdWFsAOB9KjgDaSJsZGUAAKB0IuUic3RlZAABR0x1CX8J8iZlYXRlckdyZWF0ZXIA4KIqOAPlI3NzTGVzcwDgoSo4A/IjZWNlZGVzAKGAIkVTjwmVCXEidWFsAADgryo4A+wkYW50RXF1YWwAoOAiAAFlaaAJqQl2JmVyc2VFbGVtZW50AACgDCLnJWh0VHJpYW5nbGVCousitgkAAAAAuwlhAHIAAODQKTgDcSJ1YWwAAKDtIgABcXXDCeAJdSNhcmVTdQAAAWJwywnVCfMhZXRF4I8iOANxInVhbAAAoOIi5SJyc2V0ReCQIjgDcSJ1YWwAAKDjIoABYmNwAOYJ8AkNCvMhZXRF4IIi0iBxInVhbAAAoIgi4yJlZWRzgKGBIkVTVAD6CQAKBwpxInVhbAAA4LAqOAPsJGFudEVxdWFsAKDhImkibGRlAADgfyI4A+UicnNldEXggyLSIHEidWFsAACgiSJpImxkZQCAoUEiRUZUACIKJwouCnEidWFsAACgRCJ1JGxsRXF1YWwAAKBHImkibGRlAACgSSJlJXJ0aWNhbEJhcgAAoCQiYwByAADgNdip3GkAbABkAGUAO4DRANFAnWMAB0VhY2RmZ21vcHJzdHV2XgphCmgKcgp2CnoKgQqRCpYKqwqtCrsKyArNCuwhaWdSYWMAdQB0AGUAO4DTANNAAAFpeWwKcQpyAGMAO4DUANRAHmRiImxhYwBQYXIAAOA12BLdcgBhAHYAZQA7gNIA0kCAAWFlaQCHCooKjQpjAHIATGFnAGEAqWNjInJvbgCfY3AAZgAA4DXYRt3lI25DdXJseQABRFGeCqYKbyV1YmxlUXVvdGUAAKAcIHUib3RlAACgGCAAoFQqAAFjbLEKtQpyAADgNdiq3GEAcwBoADuA2ADYQGkAbAHACsUKZABlADuA1QDVQGUAcwAAoDcqbQBsADuA1gDWQGUAcgAAAUJQ0wrmCgABYXLXCtoKcgAAoD4gYQBjAAABZWvgCuIKAKDeI2UAdAAAoLQjYSVyZW50aGVzaXMAAKDcI4AEYWNmaGlsb3JzAP0KAwsFCwkLCwsMCxELIwtaC3IjdGlhbEQAAKACInkAH2RyAADgNdgT3WkApmOgY/Ujc01pbnVzsWAAAWlwFQsgC24AYwBhAHIAZQBwAGwAYQBuAOUACgVmAACgGSGAobsqZWlvACoLRQtJC+MiZWRlc4CheiJFU1QANAs5C0ALcSJ1YWwAAKCvKuwkYW50RXF1YWwAoHwiaSJsZGUAAKB+Im0AZQAAoDMgAAFkcE0LUQv1IWN0AKAPIm8jcnRpb24AYaA3ImwAAKAdIgABY2leC2ILcgAA4DXYq9yoYwACVWZvc2oLbwtzC3cLTwBUADuAIgAiQHIAAOA12BTdcABmAACgGiFjAHIAAOA12KzcAAZCRWFjZWZoaW9yc3WPC5MLlwupC7YL2AvbC90LhQyTDJoMowzhIXJyAKAQKUcAO4CuAK5AgAFjbnIAnQugC6ML9SF0ZVRhZwAAoOsncgB0oKAhbAAAoBYpgAFhZXkArwuyC7UL8iFvblhh5CFpbFZhIGR2oBwhZSJyc2UAAAFFVb8LzwsAAWxxwwvIC+UibWVudACgCyL1JGlsaWJyaXVtAKDLIXAmRXF1aWxpYnJpdW0AAKBvKXIAAKAcIW8AoWPnIWh0AARBQ0RGVFVWYewLCgwQDDIMNwxeDHwM9gIAAW5y8Av4C2clbGVCcmFja2V0AACg6SfyIW93AKGSIUJM/wsDDGEAcgAAoOUhZSRmdEFycm93AACgxCFlI2lsaW5nAACgCSNvAPUBFgwAAB4MYiVsZUJyYWNrZXQAAKDnJ24A1AEjDAAAKgxlJGVWZWN0b3IAAKBdKeUiY3RvckKgwiFhAHIAAKBVKWwib29yAACgCyMAAWVyOwxLDGUAAKGiIkFWQQxGDHIicm93AACgpiHlImN0b3IAoFspaSNhbmdsZQBCorMiVgwAAAAAWgxhAHIAAKDQKXEidWFsAACgtSJwAIABRFRWAGUMbAxzDO8kd25WZWN0b3IAoE8pZSRlVmVjdG9yAACgXCnlImN0b3JCoL4hYQByAACgVCnlImN0b3JCoMAhYQByAACgUykAAXB1iQyMDGYAAKAdIe4kZEltcGxpZXMAoHAp6SRnaHRhcnJvdwCg2yEAAWNongyhDHIAAKAbIQCgsSHsJGVEZWxheWVkAKD0KYAGSE9hY2ZoaW1vcXN0dQC/DMgMzAzQDOIM5gwKDQ0NFA0ZDU8NVA1YDQABQ2PDDMYMyCFjeSlkeQAoZEYiVGN5ACxkYyJ1dGUAWmEAorwqYWVpedgM2wzeDOEM8iFvbmBh5CFpbF5hcgBjAFxhIWRyAADgNdgW3e8hcnQAAkRMUlXvDPYM/QwEDW8kd25BcnJvdwAAoJMhZSRmdEFycm93AACgkCHpJGdodEFycm93AKCSIXAjQXJyb3cAAKCRIechbWGjY+EkbGxDaXJjbGUAoBgicABmAADgNdhK3XICHw0AAAAAIg10AACgGiLhIXJlgKGhJUlTVQAqDTINSg3uJXRlcnNlY3Rpb24AoJMidQAAAWJwNw1ADfMhZXRFoI8icSJ1YWwAAKCRIuUicnNldEWgkCJxInVhbAAAoJIibiJpb24AAKCUImMAcgAA4DXYrtxhAHIAAKDGIgACYmNtcF8Nag2ODZANc6DQImUAdABFoNAicSJ1YWwAAKCGIgABY2huDYkNZSJlZHMAgKF7IkVTVAB4DX0NhA1xInVhbAAAoLAq7CRhbnRFcXVhbACgfSJpImxkZQAAoH8iVABoAGEA9ADHCwCgESIAodEiZXOVDZ8NciJzZXQARaCDInEidWFsAACghyJlAHQAAKDRIoAFSFJTYWNmaGlvcnMAtQ27Db8NyA3ODdsN3w3+DRgOHQ4jDk8AUgBOADuA3gDeQMEhREUAoCIhAAFIY8MNxg1jAHkAC2R5ACZkAAFidcwNzQ0JYKRjgAFhZXkA1A3XDdoN8iFvbmRh5CFpbGJhImRyAADgNdgX3QABZWnjDe4N8gHoDQAA7Q3lImZvcmUAoDQiYQCYYwABY27yDfkNayNTcGFjZQAA4F8gCiDTInBhY2UAoAkg7CFkZYChPCJFRlQABw4MDhMOcSJ1YWwAAKBDInUkbGxFcXVhbAAAoEUiaSJsZGUAAKBIInAAZgAA4DXYS93pI3BsZURvdACg2yAAAWN0Jw4rDnIAAOA12K/c8iFva2Zh4QpFDlYOYA5qDgAAbg5yDgAAAAAAAAAAAAB5DnwOqA6zDgAADg8RDxYPGg8AAWNySA5ODnUAdABlADuA2gDaQHIAb6CfIeMhaXIAoEkpcgDjAVsOAABdDnkADmR2AGUAbGEAAWl5Yw5oDnIAYwA7gNsA20AjZGIibGFjAHBhcgAA4DXYGN1yAGEAdgBlADuA2QDZQOEhY3JqYQABZGl/Dp8OZQByAAABQlCFDpcOAAFhcokOiw5yAF9gYQBjAAABZWuRDpMOAKDfI2UAdAAAoLUjYSVyZW50aGVzaXMAAKDdI28AbgBQoMMi7CF1cwCgjiIAAWdwqw6uDm8AbgByYWYAAOA12EzdAARBREVUYWRwc78O0g7ZDuEOBQPqDvMOBw9yInJvdwDCoZEhyA4AAMwOYQByAACgEilvJHduQXJyb3cAAKDFIW8kd25BcnJvdwAAoJUhcSV1aWxpYnJpdW0AAKBuKWUAZQBBoKUiciJyb3cAAKClIW8AdwBuAGEAcgByAG8A9wAQA2UAcgAAAUxS+Q4AD2UkZnRBcnJvdwAAoJYh6SRnaHRBcnJvdwCglyFpAGyg0gNvAG4ApWPpIW5nbmFjAHIAAOA12LDcaSJsZGUAaGFtAGwAO4DcANxAgAREYmNkZWZvc3YALQ8xDzUPNw89D3IPdg97D4AP4SFzaACgqyJhAHIAAKDrKnkAEmThIXNobKCpIgCg5ioAAWVyQQ9DDwCgwSKAAWJ0eQBJD00Paw9hAHIAAKAWIGmgFiDjIWFsAAJCTFNUWA9cD18PZg9hAHIAAKAjIukhbmV8YGUkcGFyYXRvcgAAoFgnaSJsZGUAAKBAItQkaGluU3BhY2UAoAogcgAA4DXYGd1wAGYAAOA12E3dYwByAADgNdix3GQiYXNoAACgqiKAAmNlZm9zAI4PkQ+VD5kPng/pIXJjdGHkIWdlAKDAInIAAOA12BrdcABmAADgNdhO3WMAcgAA4DXYstwAAmZpb3OqD64Prw+0D3IAAOA12BvdnmNwAGYAAOA12E/dYwByAADgNdiz3IAEQUlVYWNmb3N1AMgPyw/OD9EP2A/gD+QP6Q/uD2MAeQAvZGMAeQAHZGMAeQAuZGMAdQB0AGUAO4DdAN1AAAFpedwP3w9yAGMAdmErZHIAAOA12BzdcABmAADgNdhQ3WMAcgAA4DXYtNxtAGwAeGEABEhhY2RlZm9z/g8BEAUQDRAQEB0QIBAkEGMAeQAWZGMidXRlAHlhAAFheQkQDBDyIW9ufWEXZG8AdAB7YfIBFRAAABwQbwBXAGkAZAB0AOgAVAhhAJZjcgAAoCghcABmAACgJCFjAHIAAOA12LXc4QtCEEkQTRAAAGcQbRByEAAAAAAAAAAAeRCKEJcQ8hD9EAAAGxEhETIROREAAD4RYwB1AHQAZQA7gOEA4UByImV2ZQADYYCiPiJFZGl1eQBWEFkQWxBgEGUQAOA+IjMDAKA/InIAYwA7gOIA4kB0AGUAO4C0ALRAMGRsAGkAZwA7gOYA5kByoGEgAOA12B7dcgBhAHYAZQA7gOAA4EAAAWVwfBCGEAABZnCAEIQQ8yF5bQCgNSHoAIMQaABhALFjAAFhcI0QWwAAAWNskRCTEHIAAWFnAACgPypkApwQAAAAALEQAKInImFkc3ajEKcQqRCuEG4AZAAAoFUqAKBcKmwib3BlAACgWCoAoFoqAKMgImVsbXJzersQvRDAEN0Q5RDtEACgpCllAACgICJzAGQAYaAhImEEzhDQENIQ1BDWENgQ2hDcEACgqCkAoKkpAKCqKQCgqykAoKwpAKCtKQCgrikAoK8pdAB2oB8iYgBkoL4iAKCdKQABcHTpEOwQaAAAoCIixWDhIXJyAKB8IwABZ3D1EPgQbwBuAAVhZgAA4DXYUt0Ao0giRWFlaW9wBxEJEQ0RDxESERQRAKBwKuMhaXIAoG8qAKBKImQAAKBLInMAJ2DyIW94ZaBIIvEADhFpAG4AZwA7gOUA5UCAAWN0eQAmESoRKxFyAADgNdi23CpgbQBwAGWgSCLxAPgBaQBsAGQAZQA7gOMA40BtAGwAO4DkAORAAAFjaUERRxFvAG4AaQBuAPQA6AFuAHQAAKARKgAITmFiY2RlZmlrbG5vcHJzdWQRaBGXEZ8RpxGrEdIR1hErEjASexKKEn0RThNbE3oTbwB0AACg7SoAAWNybBGJEWsAAAJjZXBzdBF4EX0RghHvIW5nAKBMInAjc2lsb24A9mNyImltZQAAoDUgaQBtAGWgPSJxAACgzSJ2AY0RkRFlAGUAAKC9ImUAZABnoAUjZQAAoAUjcgBrAHSgtSPiIXJrAKC2IwABb3mjEaYRbgDnAHcRMWTxIXVvAKAeIIACY21wcnQAtBG5Eb4RwRHFEeEhdXPloDUi5ABwInR5dgAAoLApcwDpAH0RbgBvAPUA6gCAAWFodwDLEcwRzhGyYwCgNiHlIWVuAKBsInIAAOA12B/dZwCAA2Nvc3R1dncA4xHyEQUSEhIhEiYSKRKAAWFpdQDpEesR7xHwAKMFcgBjAACg7yVwAACgwyKAAWRwdAD4EfwRABJvAHQAAKAAKuwhdXMAoAEqaSJtZXMAAKACKnECCxIAAAAADxLjIXVwAKAGKmEAcgAAoAUm8iNpYW5nbGUAAWR1GhIeEu8hd24AoL0lcAAAoLMlcCJsdXMAAKAEKmUA5QBCD+UAkg9hInJvdwAAoA0pgAFha28ANhJoEncSAAFjbjoSZRJrAIABbHN0AEESRxJNEm8jemVuZ2UAAKDrKXEAdQBhAHIA5QBcBPIjaWFuZ2xlgKG0JWRscgBYElwSYBLvIXduAKC+JeUhZnQAoMIlaSJnaHQAAKC4JWsAAKAjJLEBbRIAAHUSsgFxEgAAcxIAoJIlAKCRJTQAAKCTJWMAawAAoIglAAFlb38ShxJx4D0A5SD1IWl2AOBhIuUgdAAAoBAjAAJwdHd4kRKVEpsSnxJmAADgNdhT3XSgpSJvAG0AAKClIvQhaWUAoMgiAAZESFVWYmRobXB0dXayEsES0RLgEvcS+xIKExoTHxMjEygTNxMAAkxSbHK5ErsSvRK/EgCgVyUAoFQlAKBWJQCgUyUAolAlRFVkdckSyxLNEs8SAKBmJQCgaSUAoGQlAKBnJQACTFJsctgS2hLcEt4SAKBdJQCgWiUAoFwlAKBZJQCjUSVITFJobHLrEu0S7xLxEvMS9RIAoGwlAKBjJQCgYCUAoGslAKBiJQCgXyVvAHgAAKDJKQACTFJscgITBBMGEwgTAKBVJQCgUiUAoBAlAKAMJQCiACVEVWR1EhMUExYTGBMAoGUlAKBoJQCgLCUAoDQlaSJudXMAAKCfIuwhdXMAoJ4iaSJtZXMAAKCgIgACTFJsci8TMRMzEzUTAKBbJQCgWCUAoBglAKAUJQCjAiVITFJobHJCE0QTRhNIE0oTTBMAoGolAKBhJQCgXiUAoDwlAKAkJQCgHCUAAWV2UhNVE3YA5QD5AGIAYQByADuApgCmQAACY2Vpb2ITZhNqE24TcgAA4DXYt9xtAGkAAKBPIG0A5aA9IogRbAAAoVwAYmh0E3YTAKDFKfMhdWIAoMgnbAF+E4QTbABloCIgdAAAoCIgcAAAoU4iRWWJE4sTAKCuKvGgTyI8BeEMqRMAAN8TABQDFB8UAAAjFDQUAAAAAIUUAAAAAI0UAAAAANcU4xT3FPsUAACIFQAAlhWAAWNwcgCuE7ET1RP1IXRlB2GAoikiYWJjZHMAuxO/E8QTzhPSE24AZAAAoEQqciJjdXAAAKBJKgABYXXIE8sTcAAAoEsqcAAAoEcqbwB0AACgQCoA4CkiAP4AAWVv2RPcE3QAAKBBIO4ABAUAAmFlaXXlE+8T9RP4E/AB6hMAAO0TcwAAoE0qbwBuAA1hZABpAGwAO4DnAOdAcgBjAAlhcABzAHOgTCptAACgUCpvAHQAC2GAAWRtbgAIFA0UEhRpAGwAO4C4ALhAcCJ0eXYAAKCyKXQAAIGiADtlGBQZFKJAcgBkAG8A9ABiAXIAAOA12CDdgAFjZWkAKBQqFDIUeQBHZGMAawBtoBMn4SFyawCgEyfHY3IAAKPLJUVjZWZtcz8UQRRHFHcUfBSAFACgwykAocYCZWxGFEkUcQAAoFciZQBhAlAUAAAAAGAUciJyb3cAAAFsclYUWhTlIWZ0AKC6IWkiZ2h0AACguyGAAlJTYWNkAGgUaRRrFG8UcxSuYACgyCRzAHQAAKCbIukhcmMAoJoi4SFzaACgnSJuImludAAAoBAqaQBkAACg7yrjIWlyAKDCKfUhYnN1oGMmaQB0AACgYybsApMUmhS2FAAAwxRvAG4AZaA6APGgVCKrAG0CnxQAAAAAoxRhAHSgLABAYAChASJmbKcUqRTuABMNZQAAAW14rhSyFOUhbnQAoAEiZQDzANIB5wG6FAAAwBRkoEUibwB0AACgbSpuAPQAzAGAAWZyeQDIFMsUzhQA4DXYVN1vAOQA1wEAgakAO3MeAdMUcgAAoBchAAFhb9oU3hRyAHIAAKC1IXMAcwAAoBcnAAFjdeYU6hRyAADgNdi43AABYnDuFPIUZaDPKgCg0SploNAqAKDSKuQhb3QAoO8igANkZWxwcnZ3AAYVEBUbFSEVRBVlFYQV4SFycgABbHIMFQ4VAKA4KQCgNSlwAhYVAAAAABkVcgAAoN4iYwAAoN8i4SFycnCgtiEAoD0pgKIqImJjZG9zACsVMBU6FT4VQRVyImNhcAAAoEgqAAFhdTQVNxVwAACgRipwAACgSipvAHQAAKCNInIAAKBFKgDgKiIA/gACYWxydksVURVuFXMVcgByAG2gtyEAoDwpeQCAAWV2dwBYFWUVaRVxAHACXxUAAAAAYxVyAGUA4wAXFXUA4wAZFWUAZQAAoM4iZSJkZ2UAAKDPImUAbgA7gKQApEBlI2Fycm93AAABbHJ7FX8V5SFmdACgtiFpImdodAAAoLchZQDkAG0VAAFjaYsVkRVvAG4AaQBuAPQAkwFuAHQAAKAxImwiY3R5AACgLSOACUFIYWJjZGVmaGlqbG9yc3R1d3oAuBW7Fb8V1RXgFegV+RUKFhUWHxZUFlcWZRbFFtsW7xb7FgUXChdyAPIAtAJhAHIAAKBlKQACZ2xyc8YVyhXOFdAV5yFlcgCgICDlIXRoAKA4IfIA9QxoAHagECAAoKMiawHZFd4VYSJyb3cAAKAPKWEA4wBfAgABYXnkFecV8iFvbg9hNGQAoUYhYW/tFfQVAAFnciEC8RVyAACgyiF0InNlcQAAoHcqgAFnbG0A/xUCFgUWO4CwALBAdABhALRjcCJ0eXYAAKCxKQABaXIOFhIW8yFodACgfykA4DXYId1hAHIAAAFschsWHRYAoMMhAKDCIYACYWVnc3YAKBauAjYWOhY+Fm0AAKHEIm9zLhY0Fm4AZABzoMQi9SFpdACgZiZhIm1tYQDdY2kAbgAAoPIiAKH3AGlvQxZRFmQAZQAAgfcAO29KFksW90BuI3RpbWVzAACgxyJuAPgAUBZjAHkAUmRjAG8CXhYAAAAAYhZyAG4AAKAeI28AcAAAoA0jgAJscHR1dwBuFnEWdRaSFp4W7CFhciRgZgAA4DXYVd0AotkCZW1wc30WhBaJFo0WcQBkoFAibwB0AACgUSJpIm51cwAAoDgi7CF1cwCgFCLxInVhcmUAoKEiYgBsAGUAYgBhAHIAdwBlAGQAZwDlANcAbgCAAWFkaAClFqoWtBZyAHIAbwD3APUMbwB3AG4AYQByAHIAbwB3APMA8xVhI3Jwb29uAAABbHK8FsAWZQBmAPQAHBZpAGcAaAD0AB4WYgHJFs8WawBhAHIAbwD3AJILbwLUFgAAAADYFnIAbgAAoB8jbwBwAACgDCOAAWNvdADhFukW7BYAAXJ55RboFgDgNdi53FVkbAAAoPYp8iFvaxFhAAFkcvMW9xZvAHQAAKDxImkA5qC/JVsSAAFhaP8WAhdyAPIANQNhAPIA1wvhIm5nbGUAoKYpAAFjaQ4XEBd5AF9k5yJyYXJyAKD/JwAJRGFjZGVmZ2xtbm9wcXJzdHV4MRc4F0YXWxcyBF4XaRd5F40XrBe0F78X2RcVGCEYLRg1GEAYAAFEbzUXgRZvAPQA+BUAAWNzPBdCF3UAdABlADuA6QDpQPQhZXIAoG4qAAJhaW95TRdQF1YXWhfyIW9uG2FyAGOgViI7gOoA6kDsIW9uAKBVIk1kbwB0ABdhAAFEcmIXZhdvAHQAAKBSIgDgNdgi3XKhmipuF3QXYQB2AGUAO4DoAOhAZKCWKm8AdAAAoJgqgKGZKmlscwCAF4UXhxfuInRlcnMAoOcjAKATIWSglSpvAHQAAKCXKoABYXBzAJMXlheiF2MAcgATYXQAeQBzogUinxcAAAAAoRdlAHQAAKAFInAAMaADIDMBqRerFwCgBCAAoAUgAAFnc7AXsRdLYXAAAKACIAABZ3C4F7sXbwBuABlhZgAA4DXYVt2AAWFscwDFF8sXzxdyAHOg1SJsAACg4yl1AHMAAKBxKmkAAKG1A2x21RfYF28AbgC1Y/VjAAJjc3V24BfoF/0XEBgAAWlv5BdWF3IAYwAAoFYiaQLuFwAAAADwF+0ADQThIW50AAFnbPUX+Rd0AHIAAKCWKuUhc3MAoJUqgAFhZWkAAxgGGAoYbABzAD1gcwB0AACgXyJ2AESgYSJEAACgeCrwImFyc2wAoOUpAAFEYRkYHRhvAHQAAKBTInIAcgAAoHEpgAFjZGkAJxgqGO0XcgAAoC8hbwD0AIwCAAFhaDEYMhi3YzuA8ADwQAABbXI5GD0YbAA7gOsA60BvAACgrCCAAWNpcABGGEgYSxhsACFgcwD0ACwEAAFlb08YVxhjAHQAYQB0AGkAbwDuABoEbgBlAG4AdABpAGEAbADlADME4Ql1GAAAgRgAAIMYiBgAAAAAoRilGAAAqhgAALsYvhjRGAAA1xgnGWwAbABpAG4AZwBkAG8AdABzAGUA8QBlF3kARGRtImFsZQAAoEAmgAFpbHIAjRiRGJ0Y7CFpZwCgA/tpApcYAAAAAJoYZwAAoAD7aQBnAACgBPsA4DXYI93sIWlnAKAB++whaWcA4GYAagCAAWFsdACvGLIYthh0AACgbSZpAGcAAKAC+24AcwAAoLElbwBmAJJh8AHCGAAAxhhmAADgNdhX3QABYWvJGMwYbADsAGsEdqDUIgCg2SphI3J0aW50AACgDSoAAWFv2hgiGQABY3PeGB8ZsQPnGP0YBRkSGRUZAAAdGbID7xjyGPQY9xj5GAAA+xg7gL0AvUAAoFMhO4C8ALxAAKBVIQCgWSEAoFshswEBGQAAAxkAoFQhAKBWIbQCCxkOGQAAAAAQGTuAvgC+QACgVyEAoFwhNQAAoFghtgEZGQAAGxkAoFohAKBdITgAAKBeIWwAAKBEIHcAbgAAoCIjYwByAADgNdi73IAIRWFiY2RlZmdpamxub3JzdHYARhlKGVoZXhlmGWkZkhmWGZkZnRmgGa0ZxhnLGc8Z4BkjGmygZyIAoIwqgAFjbXAAUBlTGVgZ9SF0ZfVhbQBhAOSgswM6FgCghipyImV2ZQAfYQABaXliGWUZcgBjAB1hM2RvAHQAIWGAoWUibHFzAMYEcBl6GfGhZSLOBAAAdhlsAGEAbgD0AN8EgKF+KmNkbACBGYQZjBljAACgqSpvAHQAb6CAKmyggioAoIQqZeDbIgD+cwAAoJQqcgAA4DXYJN3noGsirATtIWVsAKA3IWMAeQBTZIChdyJFYWoApxmpGasZAKCSKgCgpSoAoKQqAAJFYWVztBm2Gb0ZwhkAoGkicABwoIoq8iFveACgiipxoIgq8aCIKrUZaQBtAACg5yJwAGYAAOA12FjdYQB2AOUAYwIAAWNp0xnWGXIAAKAKIW0AAKFzImVs3BneGQCgjioAoJAqAIM+ADtjZGxxco0E6xn0GfgZ/BkBGgABY2nvGfEZAKCnKnIAAKB6Km8AdAAAoNci0CFhcgCglSl1ImVzdAAAoHwqgAJhZGVscwAKGvQZFhrVBCAa8AEPGgAAFBpwAHIAbwD4AFkZcgAAoHgpcQAAAWxxxAQbGmwAZQBzAPMASRlpAO0A5AQAAWVuJxouGnIjdG5lcXEAAOBpIgD+xQAsGgAFQWFiY2Vma29zeUAaQxpmGmoabRqDGocalhrCGtMacgDyAMwCAAJpbG1yShpOGlAaVBpyAHMA8ABxD2YAvWBpAGwA9AASBQABZHJYGlsaYwB5AEpkAKGUIWN3YBpkGmkAcgAAoEgpAKCtIWEAcgAAoA8h6SFyYyVhgAFhbHIAcxp7Gn8a8iF0c3WgZSZpAHQAAKBlJuwhaXAAoCYg4yFvbgCguSJyAADgNdgl3XMAAAFld4wakRphInJvdwAAoCUpYSJyb3cAAKAmKYACYW1vcHIAnxqjGqcauhq+GnIAcgAAoP8h9CFodACgOyJrAAABbHKsGrMaZSRmdGFycm93AACgqSHpJGdodGFycm93AKCqIWYAAOA12Fnd4iFhcgCgFSCAAWNsdADIGswa0BpyAADgNdi93GEAcwDoAGka8iFvaydhAAFicNca2xr1IWxsAKBDIOghZW4AoBAg4Qr2GgAA/RoAAAgbExsaGwAAIRs7GwAAAAA+G2IbmRuVG6sbAACyG80b0htjAHUAdABlADuA7QDtQAChYyBpeQEbBhtyAGMAO4DuAO5AOGQAAWN4CxsNG3kANWRjAGwAO4ChAKFAAAFmcssCFhsA4DXYJt1yAGEAdgBlADuA7ADsQIChSCFpbm8AJxsyGzYbAAFpbisbLxtuAHQAAKAMKnQAAKAtIuYhaW4AoNwpdABhAACgKSHsIWlnM2GAAWFvcABDG1sbXhuAAWNndABJG0sbWRtyACthgAFlbHAAcQVRG1UbaQBuAOUAyAVhAHIA9AByBWgAMWFmAACgtyJlAGQAtWEAoggiY2ZvdGkbbRt1G3kb4SFyZQCgBSFpAG4AdKAeImkAZQAAoN0pZABvAPQAWxsAoisiY2VscIEbhRuPG5QbYQBsAACguiIAAWdyiRuNG2UAcgDzACMQ4wCCG2EicmhrAACgFyryIW9kAKA8KgACY2dwdJ8boRukG6gbeQBRZG8AbgAvYWYAAOA12FrdYQC5Y3UAZQBzAHQAO4C/AL9AAAFjabUbuRtyAADgNdi+3G4AAKIIIkVkc3bCG8QbyBvQAwCg+SJvAHQAAKD1Inag9CIAoPMiaaBiIOwhZGUpYesB1hsAANkbYwB5AFZkbAA7gO8A70AAA2NmbW9zdeYb7hvyG/Ub+hsFHAABaXnqG+0bcgBjADVhOWRyAADgNdgn3eEhdGg3YnAAZgAA4DXYW93jAf8bAAADHHIAAOA12L/c8iFjeVhk6yFjeVRkAARhY2ZnaGpvcxUcGhwiHCYcKhwtHDAcNRzwIXBhdqC6A/BjAAFleR4cIRzkIWlsN2E6ZHIAAOA12CjdciJlZW4AOGFjAHkARWRjAHkAXGRwAGYAAOA12FzdYwByAADgNdjA3IALQUJFSGFiY2RlZmdoamxtbm9wcnN0dXYAXhxtHHEcdRx5HN8cBx0dHTwd3B3tHfEdAR4EHh0eLB5FHrwewx7hHgkfPR9LH4ABYXJ0AGQcZxxpHHIA8gBvB/IAxQLhIWlsAKAbKeEhcnIAoA4pZ6BmIgCgiyphAHIAAKBiKWMJjRwAAJAcAACVHAAAAAAAAAAAAACZHJwcAACmHKgcrRwAANIc9SF0ZTph7SJwdHl2AKC0KXIAYQDuAFoG4iFkYbtjZwAAoegnZGyhHKMcAKCRKeUAiwYAoIUqdQBvADuAqwCrQHIAgKOQIWJmaGxwc3QAuhy/HMIcxBzHHMoczhxmoOQhcwAAoB8pcwAAoB0p6wCyGnAAAKCrIWwAAKA5KWkAbQAAoHMpbAAAoKIhAKGrKmFl1hzaHGkAbAAAoBkpc6CtKgDgrSoA/oABYWJyAOUc6RztHHIAcgAAoAwpcgBrAACgcicAAWFr8Rz4HGMAAAFla/Yc9xx7YFtgAAFlc/wc/hwAoIspbAAAAWR1Ax0FHQCgjykAoI0pAAJhZXV5Dh0RHRodHB3yIW9uPmEAAWRpFR0YHWkAbAA8YewAowbiAPccO2QAAmNxcnMkHScdLB05HWEAAKA2KXUAbwDyoBwgqhEAAWR1MB00HeghYXIAoGcpcyJoYXIAAKBLKWgAAKCyIQCiZCJmZ3FzRB1FB5Qdnh10AIACYWhscnQATh1WHWUdbB2NHXIicm93AHSgkCFhAOkAzxxhI3Jwb29uAAABZHVeHWId7yF3bgCgvSFwAACgvCHlJGZ0YXJyb3dzAKDHIWkiZ2h0AIABYWhzAHUdex2DHXIicm93APOglCGdBmEAcgBwAG8AbwBuAPMAzgtxAHUAaQBnAGEAcgByAG8A9wBlGugkcmVldGltZXMAoMsi8aFkIk0HAACaHWwAYQBuAPQAXgcAon0qY2Rnc6YdqR2xHbcdYwAAoKgqbwB0AG+gfypyoIEqAKCDKmXg2iIA/nMAAKCTKoACYWRlZ3MAwB3GHcod1h3ZHXAAcAByAG8A+ACmHG8AdAAAoNYicQAAAWdxzx3SHXQA8gBGB2cAdADyAHQcdADyAFMHaQDtAGMHgAFpbHIA4h3mHeod8yFodACgfClvAG8A8gDKBgDgNdgp3UWgdiIAoJEqYQH1Hf4dcgAAAWR1YB35HWygvCEAoGopbABrAACghCVjAHkAWWQAomoiYWNodAweDx4VHhkecgDyAGsdbwByAG4AZQDyAGAW4SFyZACgaylyAGkAAKD6JQABaW8hHiQe5CFvdEBh9SFzdGGgsCPjIWhlAKCwIwACRWFlczMeNR48HkEeAKBoInAAcKCJKvIhb3gAoIkqcaCHKvGghyo0HmkAbQAAoOYiAARhYm5vcHR3elIeXB5fHoUelh6mHqsetB4AAW5yVh5ZHmcAAKDsJ3IAAKD9IXIA6wCwBmcAgAFsbXIAZh52Hnse5SFmdAABYXKIB2weaQBnAGgAdABhAHIAcgBvAPcAkwfhInBzdG8AoPwnaQBnAGgAdABhAHIAcgBvAPcAmgdwI2Fycm93AAABbHKNHpEeZQBmAPQAxhxpImdodAAAoKwhgAFhZmwAnB6fHqIecgAAoIUpAOA12F3ddQBzAACgLSppIm1lcwAAoDQqYQGvHrMecwB0AACgFyLhAIoOZaHKJbkeRhLuIWdlAKDKJWEAcgBsoCgAdAAAoJMpgAJhY2htdADMHs8e1R7bHt0ecgDyAJ0GbwByAG4AZQDyANYWYQByAGSgyyEAoG0pAKAOIHIAaQAAoL8iAANhY2hpcXTrHu8e1QfzHv0eBh/xIXVvAKA5IHIAAOA12MHcbQDloXIi+h4AAPweAKCNKgCgjyoAAWJ19xwBH28AcqAYIACgGiDyIW9rQmEAhDwAO2NkaGlscXJCBhcfxh0gHyQfKB8sHzEfAAFjaRsfHR8AoKYqcgAAoHkqcgBlAOUAkx3tIWVzAKDJIuEhcnIAoHYpdSJlc3QAAKB7KgABUGk1HzkfYQByAACglillocMlAgdfEnIAAAFkdUIfRx9zImhhcgAAoEop6CFhcgCgZikAAWVuTx9WH3IjdG5lcXEAAOBoIgD+xQBUHwAHRGFjZGVmaGlsbm9wc3VuH3Ifoh+rH68ftx+7H74f5h/uH/MfBwj/HwsgxCFvdACgOiIAAmNscHJ5H30fiR+eH3IAO4CvAK9AAAFldIEfgx8AoEImZaAgJ3MAZQAAoCAnc6CmIXQAbwCAoaYhZGx1AJQfmB+cH28AdwDuAHkDZQBmAPQA6gbwAOkO6yFlcgCgriUAAW95ph+qH+0hbWEAoCkqPGThIXNoAKAUIOElc3VyZWRhbmdsZQCgISJyAADgNdgq3W8AAKAnIYABY2RuAMQfyR/bH3IAbwA7gLUAtUBhoiMi0B8AANMf1x9zAPQAKxFpAHIAAKDwKm8AdAA7gLcAt0B1AHMA4qESIh4TAADjH3WgOCIAoCoqYwHqH+0fcAAAoNsq8gB+GnAAbAB1APMACAgAAWRw9x/7H+UhbHMAoKciZgAA4DXYXt0AAWN0AyAHIHIAAOA12MLc8CFvcwCgPiJsobwDECAVIPQiaW1hcACguCJhAPAAEyAADEdMUlZhYmNkZWZnaGlqbG1vcHJzdHV2dzwgRyBmIG0geSCqILgg2iDeIBEhFSEyIUMhTSFQIZwhnyHSIQAiIyKLIrEivyIUIwABZ3RAIEMgAODZIjgD9uBrItIgBwmAAWVsdABNIF8gYiBmAHQAAAFhclMgWCByInJvdwAAoM0h6SRnaHRhcnJvdwCgziEA4NgiOAP24Goi0iBfCekkZ2h0YXJyb3cAoM8hAAFEZHEgdSDhIXNoAKCvIuEhc2gAoK4igAJiY25wdACCIIYgiSCNIKIgbABhAACgByL1IXRlRGFnAADgICLSIACiSSJFaW9wlSCYIJwgniAA4HAqOANkAADgSyI4A3MASWFyAG8A+AAyCnUAcgBhoG4mbADzoG4mmwjzAa8gAACzIHAAO4CgAKBAbQBwAOXgTiI4AyoJgAJhZW91eQDBIMogzSDWINkg8AHGIAAAyCAAoEMqbwBuAEhh5CFpbEZhbgBnAGSgRyJvAHQAAOBtKjgDcAAAoEIqPWThIXNoAKATIACjYCJBYWRxc3jpIO0g+SD+IAIhDCFyAHIAAKDXIXIAAAFocvIg9SBrAACgJClvoJch9wAGD28AdAAA4FAiOAN1AGkA9gC7CAABZWkGIQohYQByAACgKCntAN8I6SFzdPOgBCLlCHIAAOA12CvdAAJFZXN0/wgcISshLiHxoXEiIiEAABMJ8aFxIgAJAAAnIWwAYQBuAPQAEwlpAO0AGQlyoG8iAKBvIoABQWFwADghOyE/IXIA8gBeIHIAcgAAoK4hYQByAACg8ipzogsiSiEAAAAAxwtkoPwiAKD6ImMAeQBaZIADQUVhZGVzdABcIV8hYiFmIWkhkyGWIXIA8gBXIADgZiI4A3IAcgAAoJohcgAAoCUggKFwImZxcwBwIYQhjiF0AAABYXJ1IXohcgByAG8A9wBlIWkAZwBoAHQAYQByAHIAbwD3AD4h8aFwImAhAACKIWwAYQBuAPQAZwlz4H0qOAMAoG4iaQDtAG0JcqBuImkA5aDqIkUJaQDkADoKAAFwdKMhpyFmAADgNdhf3YCBrAA7aW4AriGvIcchrEBuAIChCSJFZHYAtyG6Ib8hAOD5IjgDbwB0AADg9SI4A+EB1gjEIcYhAKD3IgCg9iJpAHagDCLhAagJzyHRIQCg/iIAoP0igAFhb3IA2CHsIfEhcgCAoSYiYXN0AOAh5SHpIWwAbABlAOwAywhsAADg/SrlIADgAiI4A2wiaW50AACgFCrjoYAi9yEAAPohdQDlAJsJY+CvKjgDZaCAIvEAkwkAAkFhaXQHIgoiFyIeInIA8gBsIHIAcgAAoZshY3cRIhQiAOAzKTgDAOCdITgDZyRodGFycm93AACgmyFyAGkA5aDrIr4JgANjaGltcHF1AC8iPCJHIpwhTSJQIloigKGBImNlcgA2Iv0JOSJ1AOUABgoA4DXYw9zvIXJ0bQKdIQAAAABEImEAcgDhAOEhbQBloEEi8aBEIiYKYQDyAMsIcwB1AAABYnBWIlgi5QDUCeUA3wmAAWJjcABgInMieCKAoYQiRWVzAGci7glqIgDgxSo4A2UAdABl4IIi0iBxAPGgiCJoImMAZaCBIvEA/gmAoYUiRWVzAH8iFgqCIgDgxio4A2UAdABl4IMi0iBxAPGgiSKAIgACZ2lscpIilCKaIpwi7AAMCWwAZABlADuA8QDxQOcAWwlpI2FuZ2xlAAABbHKkIqoi5SFmdGWg6iLxAEUJaSJnaHQAZaDrIvEAvgltoL0DAKEjAGVzuCK8InIAbwAAoBYhcAAAoAcggARESGFkZ2lscnMAziLSItYi2iLeIugi7SICIw8j4SFzaACgrSLhIXJyAKAEKXAAAOBNItIg4SFzaACgrCIAAWV04iLlIgDgZSLSIADgPgDSIG4iZmluAACg3imAAUFldADzIvci+iJyAHIAAKACKQDgZCLSIHLgPADSIGkAZQAA4LQi0iAAAUF0BiMKI3IAcgAAoAMp8iFpZQDgtSLSIGkAbQAA4Dwi0iCAAUFhbgAaIx4jKiNyAHIAAKDWIXIAAAFociMjJiNrAACgIylvoJYh9wD/DuUhYXIAoCcpUxJqFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVCMAAF4jaSN/I4IjjSOeI8AUAAAAAKYjwCMAANoj3yMAAO8jHiQvJD8kRCQAAWNzVyNsFHUAdABlADuA8wDzQAABaXlhI2cjcgBjoJoiO4D0APRAPmSAAmFiaW9zAHEjdCN3I3EBeiNzAOgAdhTsIWFjUWF2AACgOCrvIWxkAKC8KewhaWdTYQABY3KFI4kjaQByAACgvykA4DXYLN1vA5QjAAAAAJYjAACcI24A22JhAHYAZQA7gPIA8kAAoMEpAAFibaEjjAphAHIAAKC1KQACYWNpdKwjryO6I70jcgDyAFkUAAFpcrMjtiNyAACgvinvIXNzAKC7KW4A5QDZCgCgwCmAAWFlaQDFI8gjyyNjAHIATWFnAGEAyWOAAWNkbgDRI9Qj1iPyIW9uv2MAoLYpdQDzAHgBcABmAADgNdhg3YABYWVsAOQj5yPrI3IAAKC3KXIAcAAAoLkpdQDzAHwBAKMoImFkaW9zdvkj/CMPJBMkFiQbJHIA8gBeFIChXSplZm0AAyQJJAwkcgBvoDQhZgAAoDQhO4CqAKpAO4C6ALpA5yFvZgCgtiJyAACgVipsIm9wZQAAoFcqAKBbKoABY2xvACMkJSQrJPIACCRhAHMAaAA7gPgA+EBsAACgmCJpAGwBMyQ4JGQAZQA7gPUA9UBlAHMAYaCXInMAAKA2Km0AbAA7gPYA9kDiIWFyAKA9I+EKXiQAAHokAAB8JJQkAACYJKkkAAAAALUkEQsAAPAkAAAAAAQleiUAAIMlcgCAoSUiYXN0AGUkbyQBCwCBtgA7bGokayS2QGwAZQDsABgDaQJ1JAAAAAB4JG0AAKDzKgCg/Sp5AD9kcgCAAmNpbXB0AIUkiCSLJJkSjyRuAHQAJWBvAGQALmBpAGwAAKAwIOUhbmsAoDEgcgAA4DXYLd2AAWltbwCdJKAkpCR2oMYD1WNtAGEA9AD+B24AZQAAoA4m9KHAA64kAAC0JGMjaGZvcmsAAKDUItZjAAFhdbgkxCRuAAABY2u9JMIkawBooA8hAKAOIfYAaRpzAACkKwBhYmNkZW1zdNMkIRPXJNsk4STjJOck6yTjIWlyAKAjKmkAcgAAoCIqAAFvdYsW3yQAoCUqAKByKm4AO4CxALFAaQBtAACgJip3AG8AAKAnKoABaXB1APUk+iT+JO4idGludACgFSpmAADgNdhh3W4AZAA7gKMAo0CApHoiRWFjZWlub3N1ABMlFSUYJRslTCVRJVklSSV1JQCgsypwAACgtyp1AOUAPwtjoK8qgKJ6ImFjZW5zACclLSU0JTYlSSVwAHAAcgBvAPgAFyV1AHIAbAB5AGUA8QA/C/EAOAuAAWFlcwA8JUElRSXwInByb3gAoLkqcQBxAACgtSppAG0AAKDoImkA7QBEC20AZQDzoDIgIguAAUVhcwBDJVclRSXwAEAlgAFkZnAATwtfJXElgAFhbHMAZSVpJW0l7CFhcgCgLiPpIW5lAKASI/UhcmYAoBMjdKAdIu8AWQvyIWVsAKCwIgABY2l9JYElcgAA4DXYxdzIY24iY3NwAACgCCAAA2Zpb3BzdZElKxuVJZolnyWkJXIAAOA12C7dcABmAADgNdhi3XIiaW1lAACgVyBjAHIAAOA12MbcgAFhZW8AqiW6JcAldAAAAWVpryW2JXIAbgBpAG8AbgDzABkFbgB0AACgFipzAHQAZaA/APEACRj0AG0LgApBQkhhYmNkZWZoaWxtbm9wcnN0dXgA4yXyJfYl+iVpJpAmpia9JtUm5ib4JlonaCdxJ3UnnietJ7EnyCfiJ+cngAFhcnQA6SXsJe4lcgDyAJkM8gD6AuEhaWwAoBwpYQByAPIA3BVhAHIAAKBkKYADY2RlbnFydAAGJhAmEyYYJiYmKyZaJgABZXUKJg0mAOA9IjEDdABlAFVhaQDjACAN7SJwdHl2AKCzKWcAgKHpJ2RlbAAgJiImJCYAoJIpAKClKeUA9wt1AG8AO4C7ALtAcgAApZIhYWJjZmhscHN0dz0mQCZFJkcmSiZMJk4mUSZVJlgmcAAAoHUpZqDlIXMAAKAgKQCgMylzAACgHinrALka8ACVHmwAAKBFKWkAbQAAoHQpbAAAoKMhAKCdIQABYWleJmImaQBsAACgGilvAG6gNiJhAGwA8wB2C4ABYWJyAG8mciZ2JnIA8gAvEnIAawAAoHMnAAFha3omgSZjAAABZWt/JoAmfWBdYAABZXOFJocmAKCMKWwAAAFkdYwmjiYAoI4pAKCQKQACYWV1eZcmmiajJqUm8iFvbllhAAFkaZ4moSZpAGwAV2HsAA8M4gCAJkBkAAJjbHFzrSawJrUmuiZhAACgNylkImhhcgAAoGkpdQBvAPKgHSCjAWgAAKCzIYABYWNnAMMm0iaUC2wAgKEcIWlwcwDLJs4migxuAOUAoAxhAHIA9ADaC3QAAKCtJYABaWxyANsm3ybjJvMhaHQAoH0pbwBvAPIANgwA4DXYL90AAWFv6ib1JnIAAAFkde8m8SYAoMEhbKDAIQCgbCl2oMED8WOAAWducwD+Jk4nUCdoAHQAAANhaGxyc3QKJxInISc1Jz0nRydyInJvdwB0oJIhYQDpAFYmYSNycG9vbgAAAWR1GiceJ28AdwDuAPAmcAAAoMAh5SFmdAABYWgnJy0ncgByAG8AdwDzAAkMYQByAHAAbwBvAG4A8wATBGklZ2h0YXJyb3dzAACgySFxAHUAaQBnAGEAcgByAG8A9wBZJugkcmVldGltZXMAoMwiZwDaYmkAbgBnAGQAbwB0AHMAZQDxABwYgAFhaG0AYCdjJ2YncgDyAAkMYQDyABMEAKAPIG8idXN0AGGgsSPjIWhlAKCxI+0haWQAoO4qAAJhYnB0fCeGJ4knmScAAW5ygCeDJ2cAAKDtJ3IAAKD+IXIA6wAcDIABYWZsAI8nkieVJ3IAAKCGKQDgNdhj3XUAcwAAoC4qaSJtZXMAAKA1KgABYXCiJ6gncgBnoCkAdAAAoJQp7yJsaW50AKASKmEAcgDyADwnAAJhY2hxuCe8J6EMwCfxIXVvAKA6IHIAAOA12MfcAAFidYAmxCdvAPKgGSCoAYABaGlyAM4n0ifWJ3IAZQDlAE0n7SFlcwCgyiJpAIChuSVlZmwAXAxjEt4n9CFyaQCgzinsInVoYXIAoGgpAKAeIWENBSgJKA0oSyhVKIYoAACLKLAoAAAAAOMo5ygAABApJCkxKW0pcSmHKaYpAACYKgAAAACxKmMidXRlAFthcQB1AO8ABR+ApHsiRWFjZWlucHN5ABwoHignKCooLygyKEEoRihJKACgtCrwASMoAAAlKACguCpvAG4AYWF1AOUAgw1koLAqaQBsAF9hcgBjAF1hgAFFYXMAOCg6KD0oAKC2KnAAAKC6KmkAbQAAoOki7yJsaW50AKATKmkA7QCIDUFkbwB0AGKixSKRFgAAAABTKACgZiqAA0FhY21zdHgAYChkKG8ocyh1KHkogihyAHIAAKDYIXIAAAFocmkoayjrAJAab6CYIfcAzAd0ADuApwCnQGkAO2D3IWFyAKApKW0AAAFpbn4ozQBuAHUA8wDOAHQAAKA2J3IA7+A12DDdIxkAAmFjb3mRKJUonSisKHIAcAAAoG8mAAFoeZkonChjAHkASWRIZHIAdABtAqUoAAAAAKgoaQDkAFsPYQByAGEA7ABsJDuArQCtQAABZ22zKLsobQBhAAChwwNmdroouijCY4CjPCJkZWdsbnByAMgozCjPKNMo1yjaKN4obwB0AACgairxoEMiCw5FoJ4qAKCgKkWgnSoAoJ8qZQAAoEYi7CF1cwCgJCrhIXJyAKByKWEAcgDyAPwMAAJhZWl07Sj8KAEpCCkAAWxz8Sj4KGwAcwBlAHQAbQDpAH8oaABwAACgMyrwImFyc2wAoOQpAAFkbFoPBSllAACgIyNloKoqc6CsKgDgrCoA/oABZmxwABUpGCkfKfQhY3lMZGKgLwBhoMQpcgAAoD8jZgAA4DXYZN1hAAABZHIoKRcDZQBzAHWgYCZpAHQAAKBgJoABY3N1ADYpRilhKQABYXU6KUApcABzoJMiAOCTIgD+cABzoJQiAOCUIgD+dQAAAWJwSylWKQChjyJlcz4NUCllAHQAZaCPIvEAPw0AoZAiZXNIDVspZQB0AGWgkCLxAEkNAKGhJWFmZilbBHIAZQFrKVwEAKChJWEAcgDyAAMNAAJjZW10dyl7KX8pgilyAADgNdjI3HQAbQDuAM4AaQDsAAYpYQByAOYAVw0AAWFyiimOKXIA5qAGJhESAAFhbpIpoylpImdodAAAAWVwmSmgKXAAcwBpAGwAbwDuANkXaADpAKAkcwCvYIACYmNtbnAArin8KY4NJSooKgCkgiJFZGVtbnByc7wpvinCKcgpzCnUKdgp3CkAoMUqbwB0AACgvSpkoIYibwB0AACgwyr1IWx0AKDBKgABRWXQKdIpAKDLKgCgiiLsIXVzAKC/KuEhcnIAoHkpgAFlaXUA4inxKfQpdAAAoYIiZW7oKewpcQDxoIYivSllAHEA8aCKItEpbQAAoMcqAAFicPgp+ikAoNUqAKDTKmMAgKJ7ImFjZW5zAAcqDSoUKhYqRihwAHAAcgBvAPgAIyh1AHIAbAB5AGUA8QCDDfEAfA2AAWFlcwAcKiIqPShwAHAAcgBvAPgAPChxAPEAOShnAACgaiYApoMiMTIzRWRlaGxtbnBzPCo/KkIqRSpHKlIqWCpjKmcqaypzKncqO4C5ALlAO4CyALJAO4CzALNAAKDGKgABb3NLKk4qdAAAoL4qdQBiAACg2CpkoIcibwB0AACgxCpzAAABb3VdKmAqbAAAoMknYgAAoNcq4SFycgCgeyn1IWx0AKDCKgABRWVvKnEqAKDMKgCgiyLsIXVzAKDAKoABZWl1AH0qjCqPKnQAAKGDImVugyqHKnEA8aCHIkYqZQBxAPGgiyJwKm0AAKDIKgABYnCTKpUqAKDUKgCg1iqAAUFhbgCdKqEqrCpyAHIAAKDZIXIAAAFocqYqqCrrAJUab6CZIfcAxQf3IWFyAKAqKWwAaQBnADuA3wDfQOELzyrZKtwq6SrsKvEqAAD1KjQrAAAAAAAAAAAAAEwrbCsAAHErvSsAAAAAAADRK3IC1CoAAAAA2CrnIWV0AKAWI8RjcgDrAOUKgAFhZXkA4SrkKucq8iFvbmVh5CFpbGNhQmRvAPQAIg5sInJlYwAAoBUjcgAA4DXYMd0AAmVpa2/7KhIrKCsuK/IBACsAAAkrZQAAATRm6g0EK28AcgDlAOsNYQBzorgDECsAAAAAEit5AG0A0WMAAWNuFislK2sAAAFhcxsrIStwAHAAcgBvAPgAFw5pAG0AAKA8InMA8AD9DQABYXMsKyEr8AAXDnIAbgA7gP4A/kDsATgrOyswG2QA5QBnAmUAcwCAgdcAO2JkAEMrRCtJK9dAYaCgInIAAKAxKgCgMCqAAWVwcwBRK1MraSvhAAkh4qKkIlsrXysAAAAAYytvAHQAAKA2I2kAcgAAoPEqb+A12GXdcgBrAACg2irhAHgociJpbWUAAKA0IIABYWlwAHYreSu3K2QA5QC+DYADYWRlbXBzdACFK6MrmiunK6wrsCuzK24iZ2xlAACitSVkbHFykCuUK5ornCvvIXduAKC/JeUhZnRloMMl8QACBwCgXCJpImdodABloLkl8QBdDG8AdAAAoOwlaSJudXMAAKA6KuwhdXMAoDkqYgAAoM0p6SFtZQCgOyrlInppdW0AoOIjgAFjaHQAwivKK80rAAFyecYrySsA4DXYydxGZGMAeQBbZPIhb2tnYQABaW/UK9creAD0ANERaCJlYWQAAAFsct4r5ytlAGYAdABhAHIAcgBvAPcAXQbpJGdodGFycm93AKCgIQAJQUhhYmNkZmdobG1vcHJzdHV3CiwNLBEsHSwnLDEsQCxLLFIsYix6LIQsjyzLLOgs7Sz/LAotcgDyAAkDYQByAACgYykAAWNyFSwbLHUAdABlADuA+gD6QPIACQ1yAOMBIywAACUseQBeZHYAZQBtYQABaXkrLDAscgBjADuA+wD7QENkgAFhYmgANyw6LD0scgDyANEO7CFhY3FhYQDyAOAOAAFpckQsSCzzIWh0AKB+KQDgNdgy3XIAYQB2AGUAO4D5APlAYQFWLF8scgAAAWxyWixcLACgvyEAoL4hbABrAACggCUAAWN0Zix2LG8CbCwAAAAAcyxyAG4AZaAcI3IAAKAcI28AcAAAoA8jcgBpAACg+CUAAWFsfiyBLGMAcgBrYTuAqACoQAABZ3CILIssbwBuAHNhZgAA4DXYZt0AA2FkaGxzdZksniynLLgsuyzFLHIAcgBvAPcACQ1vAHcAbgBhAHIAcgBvAPcA2A5hI3Jwb29uAAABbHKvLLMsZQBmAPQAWyxpAGcAaAD0AF0sdQDzAKYOaQAAocUDaGzBLMIs0mNvAG4AxWPwI2Fycm93cwCgyCGAAWNpdADRLOEs5CxvAtcsAAAAAN4scgBuAGWgHSNyAACgHSNvAHAAAKAOI24AZwBvYXIAaQAAoPklYwByAADgNdjK3IABZGlyAPMs9yz6LG8AdAAAoPAi7CFkZWlhaQBmoLUlAKC0JQABYW0DLQYtcgDyAMosbAA7gPwA/EDhIm5nbGUAoKcpgAdBQkRhY2RlZmxub3Byc3oAJy0qLTAtNC2bLZ0toS2/LcMtxy3TLdgt3C3gLfwtcgDyABADYQByAHag6CoAoOkqYQBzAOgA/gIAAW5yOC08LechcnQAoJwpgANla25wcnN0AJkpSC1NLVQtXi1iLYItYQBwAHAA4QAaHG8AdABoAGkAbgDnAKEXgAFoaXIAoSmzJFotbwBwAPQAdCVooJUh7wD4JgABaXVmLWotZwBtAOEAuygAAWJwbi14LXMjZXRuZXEAceCKIgD+AODLKgD+cyNldG5lcQBx4IsiAP4A4MwqAP4AAWhyhi2KLWUAdADhABIraSNhbmdsZQAAAWxyki2WLeUhZnQAoLIiaSJnaHQAAKCzInkAMmThIXNoAKCiIoABZWxyAKcttC24LWKiKCKuLQAAAACyLWEAcgAAoLsicQAAoFoi7CFpcACg7iIAAWJ0vC1eD2EA8gBfD3IAAOA12DPddAByAOkAlS1zAHUAAAFicM0t0C0A4IIi0iAA4IMi0iBwAGYAAOA12GfdcgBvAPAAWQt0AHIA6QCaLQABY3XkLegtcgAA4DXYy9wAAWJw7C30LW4AAAFFZXUt8S0A4IoiAP5uAAABRWV/LfktAOCLIgD+6SJnemFnAKCaKYADY2Vmb3BycwANLhAuJS4pLiMuLi40LukhcmN1YQABZGkULiEuAAFiZxguHC5hAHIAAKBfKmUAcaAnIgCgWSLlIXJwAKAYIXIAAOA12DTdcABmAADgNdho3WWgQCJhAHQA6ABqD2MAcgAA4DXYzNzjCuQRUC4AAFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg`)})),tv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.xmlDecodeTree=void 0,e.xmlDecodeTree=(0,$_().decodeBase64)(`AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg`)})),nv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BinTrieFlags=void 0;var t;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.FLAG13=8192]=`FLAG13`,e[e.BRANCH_LENGTH=8064]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(t||(e.BinTrieFlags=t={}))})),rv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.xmlDecodeTree=e.htmlDecodeTree=e.replaceCodePoint=e.fromCodePoint=e.decodeCodePoint=e.EntityDecoder=e.DecodingMode=void 0,e.determineBranch=h,e.decodeHTML=v,e.decodeHTMLAttribute=y,e.decodeHTMLStrict=b,e.decodeXML=x;var t=Q_(),n=ev(),r=tv(),i=nv(),a;(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`})(a||={});var o=32;function s(e){return e>=a.ZERO&&e<=a.NINE}function c(e){return e>=a.UPPER_A&&e<=a.UPPER_F||e>=a.LOWER_A&&e<=a.LOWER_F}function l(e){return e>=a.UPPER_A&&e<=a.UPPER_Z||e>=a.LOWER_A&&e<=a.LOWER_Z||s(e)}function u(e){return e===a.EQUALS||l(e)}var d;(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`})(d||={});var f;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(f||(e.DecodingMode=f={}));var p=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=d.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=f.Strict,this.runConsumed=0}startEntity(e){this.decodeMode=e,this.state=d.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case d.EntityStart:return e.charCodeAt(t)===a.NUM?(this.state=d.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=d.NamedEntity,this.stateNamedEntity(e,t));case d.NumericStart:return this.stateNumericStart(e,t);case d.NumericDecimal:return this.stateNumericDecimal(e,t);case d.NumericHex:return this.stateNumericHex(e,t);case d.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|o)===a.LOWER_X?(this.state=d.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=d.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(s(n)||c(n)){let e=n<=a.NINE?n-a.ZERO:(n|o)-a.LOWER_A+10;this.result=this.result*16+e,this.consumed++,t++}else return this.emitNumericEntity(n,3)}return-1}stateNumericDecimal(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(s(n))this.result=this.result*10+(n-a.ZERO),this.consumed++,t++;else return this.emitNumericEntity(n,2)}return-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)==null||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===a.SEMI)this.consumed+=1;else if(this.decodeMode===f.Strict)return 0;return this.emitCodePoint((0,t.replaceCodePoint)(this.result),this.consumed),this.errors&&(e!==a.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],o=(r&i.BinTrieFlags.VALUE_LENGTH)>>14;for(;t<e.length;){if(o===0&&(r&i.BinTrieFlags.FLAG13)!==0){let a=(r&i.BinTrieFlags.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let n=r&i.BinTrieFlags.JUMP_TABLE;if(e.charCodeAt(t)!==n)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(t>=e.length)return-1;let r=this.runConsumed-1,i=n[this.treeIndex+1+(r>>1)],a=r%2==0?i&255:i>>8&255;if(e.charCodeAt(t)!==a)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),r=n[this.treeIndex],o=(r&i.BinTrieFlags.VALUE_LENGTH)>>14}if(t>=e.length)break;let s=e.charCodeAt(t);if(s===a.SEMI&&o!==0&&(r&i.BinTrieFlags.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);if(this.treeIndex=h(n,r,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===f.Attribute&&(o===0||u(s))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],o=(r&i.BinTrieFlags.VALUE_LENGTH)>>14,o!==0){if(s===a.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==f.Strict&&(r&i.BinTrieFlags.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&i.BinTrieFlags.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]&~(i.BinTrieFlags.VALUE_LENGTH|i.BinTrieFlags.FLAG13):r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case d.NamedEntity:return this.result!==0&&(this.decodeMode!==f.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case d.NumericDecimal:return this.emitNumericEntity(0,2);case d.NumericHex:return this.emitNumericEntity(0,3);case d.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case d.EntityStart:return 0}}};e.EntityDecoder=p;function m(e){let n=``,r=new p(e,e=>n+=(0,t.fromCodePoint)(e));return function(e,t){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){n+=e.slice(i,a),r.startEntity(t);let o=r.write(e,a+1);if(o<0){i=a+r.end();break}i=a+o,a=o===0?i+1:i}let o=n+e.slice(i);return n=``,o}}function h(e,t,n,r){let a=(t&i.BinTrieFlags.BRANCH_LENGTH)>>7,o=t&i.BinTrieFlags.JUMP_TABLE;if(a===0)return o!==0&&r===o?n:-1;if(o){let t=r-o;return t<0||t>=a?-1:e[n+t]-1}let s=a+1>>1,c=0,l=a-1;for(;c<=l;){let t=c+l>>>1,i=e[n+(t>>1)]>>(t&1)*8&255;if(i<r)c=t+1;else if(i>r)l=t-1;else return e[n+s+t]}return-1}var g=m(n.htmlDecodeTree),_=m(r.xmlDecodeTree);function v(e,t=f.Legacy){return g(e,t)}function y(e){return g(e,f.Attribute)}function b(e){return g(e,f.Strict)}function x(e){return _(e,f.Strict)}var S=Q_();Object.defineProperty(e,"decodeCodePoint",{enumerable:!0,get:function(){return S.decodeCodePoint}}),Object.defineProperty(e,"fromCodePoint",{enumerable:!0,get:function(){return S.fromCodePoint}}),Object.defineProperty(e,"replaceCodePoint",{enumerable:!0,get:function(){return S.replaceCodePoint}});var C=ev();Object.defineProperty(e,"htmlDecodeTree",{enumerable:!0,get:function(){return C.htmlDecodeTree}});var w=tv();Object.defineProperty(e,"xmlDecodeTree",{enumerable:!0,get:function(){return w.xmlDecodeTree}})})),iv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.QuoteType=void 0;var t=rv(),n;(function(e){e[e.Tab=9]=`Tab`,e[e.NewLine=10]=`NewLine`,e[e.FormFeed=12]=`FormFeed`,e[e.CarriageReturn=13]=`CarriageReturn`,e[e.Space=32]=`Space`,e[e.ExclamationMark=33]=`ExclamationMark`,e[e.Number=35]=`Number`,e[e.Amp=38]=`Amp`,e[e.SingleQuote=39]=`SingleQuote`,e[e.DoubleQuote=34]=`DoubleQuote`,e[e.Dash=45]=`Dash`,e[e.Slash=47]=`Slash`,e[e.Zero=48]=`Zero`,e[e.Nine=57]=`Nine`,e[e.Semi=59]=`Semi`,e[e.Lt=60]=`Lt`,e[e.Eq=61]=`Eq`,e[e.Gt=62]=`Gt`,e[e.Questionmark=63]=`Questionmark`,e[e.UpperA=65]=`UpperA`,e[e.LowerA=97]=`LowerA`,e[e.UpperF=70]=`UpperF`,e[e.LowerF=102]=`LowerF`,e[e.UpperZ=90]=`UpperZ`,e[e.LowerZ=122]=`LowerZ`,e[e.LowerX=120]=`LowerX`,e[e.OpeningSquareBracket=91]=`OpeningSquareBracket`})(n||={});var r;(function(e){e[e.Text=1]=`Text`,e[e.BeforeTagName=2]=`BeforeTagName`,e[e.InTagName=3]=`InTagName`,e[e.InSelfClosingTag=4]=`InSelfClosingTag`,e[e.BeforeClosingTagName=5]=`BeforeClosingTagName`,e[e.InClosingTagName=6]=`InClosingTagName`,e[e.AfterClosingTagName=7]=`AfterClosingTagName`,e[e.BeforeAttributeName=8]=`BeforeAttributeName`,e[e.InAttributeName=9]=`InAttributeName`,e[e.AfterAttributeName=10]=`AfterAttributeName`,e[e.BeforeAttributeValue=11]=`BeforeAttributeValue`,e[e.InAttributeValueDq=12]=`InAttributeValueDq`,e[e.InAttributeValueSq=13]=`InAttributeValueSq`,e[e.InAttributeValueNq=14]=`InAttributeValueNq`,e[e.BeforeDeclaration=15]=`BeforeDeclaration`,e[e.InDeclaration=16]=`InDeclaration`,e[e.InProcessingInstruction=17]=`InProcessingInstruction`,e[e.BeforeComment=18]=`BeforeComment`,e[e.CDATASequence=19]=`CDATASequence`,e[e.InSpecialComment=20]=`InSpecialComment`,e[e.InCommentLike=21]=`InCommentLike`,e[e.BeforeSpecialS=22]=`BeforeSpecialS`,e[e.BeforeSpecialT=23]=`BeforeSpecialT`,e[e.SpecialStartSequence=24]=`SpecialStartSequence`,e[e.InSpecialTag=25]=`InSpecialTag`,e[e.InEntity=26]=`InEntity`})(r||={});function i(e){return e===n.Space||e===n.NewLine||e===n.Tab||e===n.FormFeed||e===n.CarriageReturn}function a(e){return e===n.Slash||e===n.Gt||i(e)}function o(e){return e>=n.LowerA&&e<=n.LowerZ||e>=n.UpperA&&e<=n.UpperZ}var s;(function(e){e[e.NoValue=0]=`NoValue`,e[e.Unquoted=1]=`Unquoted`,e[e.Single=2]=`Single`,e[e.Double=3]=`Double`})(s||(e.QuoteType=s={}));var c={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])};e.default=class{constructor({xmlMode:e=!1,decodeEntities:n=!0},i){this.cbs=i,this.state=r.Text,this.buffer=``,this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=r.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=e,this.decodeEntities=n,this.entityDecoder=new t.EntityDecoder(e?t.xmlDecodeTree:t.htmlDecodeTree,(e,t)=>this.emitCodePoint(e,t))}reset(){this.state=r.Text,this.buffer=``,this.sectionStart=0,this.index=0,this.baseState=r.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(e){e===n.Lt||!this.decodeEntities&&this.fastForwardTo(n.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=r.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===n.Amp&&this.startEntity()}stateSpecialStartSequence(e){let t=this.sequenceIndex===this.currentSequence.length;if(!(t?a(e):(e|32)===this.currentSequence[this.sequenceIndex]))this.isSpecial=!1;else if(!t){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=r.InTagName,this.stateInTagName(e)}stateInSpecialTag(e){if(this.sequenceIndex===this.currentSequence.length){if(e===n.Gt||i(e)){let t=this.index-this.currentSequence.length;if(this.sectionStart<t){let e=this.index;this.index=t,this.cbs.ontext(this.sectionStart,t),this.index=e}this.isSpecial=!1,this.sectionStart=t+2,this.stateInClosingTagName(e);return}this.sequenceIndex=0}(e|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===c.TitleEnd?this.decodeEntities&&e===n.Amp&&this.startEntity():this.fastForwardTo(n.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=Number(e===n.Lt)}stateCDATASequence(e){e===c.Cdata[this.sequenceIndex]?++this.sequenceIndex===c.Cdata.length&&(this.state=r.InCommentLike,this.currentSequence=c.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=r.InDeclaration,this.stateInDeclaration(e))}fastForwardTo(e){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===e)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(e){e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===c.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=r.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(e){return this.xmlMode?!a(e):o(e)}startSpecial(e,t){this.isSpecial=!0,this.currentSequence=e,this.sequenceIndex=t,this.state=r.SpecialStartSequence}stateBeforeTagName(e){if(e===n.ExclamationMark)this.state=r.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===n.Questionmark)this.state=r.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(e)){let t=e|32;this.sectionStart=this.index,this.xmlMode?this.state=r.InTagName:t===c.ScriptEnd[2]?this.state=r.BeforeSpecialS:t===c.TitleEnd[2]||t===c.XmpEnd[2]?this.state=r.BeforeSpecialT:this.state=r.InTagName}else e===n.Slash?this.state=r.BeforeClosingTagName:(this.state=r.Text,this.stateText(e))}stateInTagName(e){a(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateBeforeClosingTagName(e){i(e)||(e===n.Gt?this.state=r.Text:(this.state=this.isTagStartChar(e)?r.InClosingTagName:r.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(e){(e===n.Gt||i(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=r.AfterClosingTagName,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){(e===n.Gt||this.fastForwardTo(n.Gt))&&(this.state=r.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(e){e===n.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=r.InSpecialTag,this.sequenceIndex=0):this.state=r.Text,this.sectionStart=this.index+1):e===n.Slash?this.state=r.InSelfClosingTag:i(e)||(this.state=r.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(e){e===n.Gt?(this.cbs.onselfclosingtag(this.index),this.state=r.Text,this.sectionStart=this.index+1,this.isSpecial=!1):i(e)||(this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateInAttributeName(e){(e===n.Eq||a(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=r.AfterAttributeName,this.stateAfterAttributeName(e))}stateAfterAttributeName(e){e===n.Eq?this.state=r.BeforeAttributeValue:e===n.Slash||e===n.Gt?(this.cbs.onattribend(s.NoValue,this.sectionStart),this.sectionStart=-1,this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(e)):i(e)||(this.cbs.onattribend(s.NoValue,this.sectionStart),this.state=r.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(e){e===n.DoubleQuote?(this.state=r.InAttributeValueDq,this.sectionStart=this.index+1):e===n.SingleQuote?(this.state=r.InAttributeValueSq,this.sectionStart=this.index+1):i(e)||(this.sectionStart=this.index,this.state=r.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))}handleInAttributeValue(e,t){e===t||!this.decodeEntities&&this.fastForwardTo(t)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(t===n.DoubleQuote?s.Double:s.Single,this.index+1),this.state=r.BeforeAttributeName):this.decodeEntities&&e===n.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(e){this.handleInAttributeValue(e,n.DoubleQuote)}stateInAttributeValueSingleQuotes(e){this.handleInAttributeValue(e,n.SingleQuote)}stateInAttributeValueNoQuotes(e){i(e)||e===n.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(s.Unquoted,this.index),this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===n.Amp&&this.startEntity()}stateBeforeDeclaration(e){e===n.OpeningSquareBracket?(this.state=r.CDATASequence,this.sequenceIndex=0):this.state=e===n.Dash?r.BeforeComment:r.InDeclaration}stateInDeclaration(e){(e===n.Gt||this.fastForwardTo(n.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=r.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){(e===n.Gt||this.fastForwardTo(n.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=r.Text,this.sectionStart=this.index+1)}stateBeforeComment(e){e===n.Dash?(this.state=r.InCommentLike,this.currentSequence=c.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=r.InDeclaration}stateInSpecialComment(e){(e===n.Gt||this.fastForwardTo(n.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=r.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(e){let t=e|32;t===c.ScriptEnd[3]?this.startSpecial(c.ScriptEnd,4):t===c.StyleEnd[3]?this.startSpecial(c.StyleEnd,4):(this.state=r.InTagName,this.stateInTagName(e))}stateBeforeSpecialT(e){switch(e|32){case c.TitleEnd[3]:this.startSpecial(c.TitleEnd,4);break;case c.TextareaEnd[3]:this.startSpecial(c.TextareaEnd,4);break;case c.XmpEnd[3]:this.startSpecial(c.XmpEnd,4);break;default:this.state=r.InTagName,this.stateInTagName(e)}}startEntity(){this.baseState=this.state,this.state=r.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?t.DecodingMode.Strict:this.baseState===r.Text||this.baseState===r.InSpecialTag?t.DecodingMode.Legacy:t.DecodingMode.Attribute)}stateInEntity(){let e=this.index-this.offset,t=this.entityDecoder.write(this.buffer,e);if(t>=0)this.state=this.baseState,t===0&&--this.index;else{if(e<this.buffer.length&&this.buffer.charCodeAt(e)===n.Amp){this.state=this.baseState,--this.index;return}this.index=this.offset+this.buffer.length-1}}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===r.Text||this.state===r.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===r.InAttributeValueDq||this.state===r.InAttributeValueSq||this.state===r.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){let e=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case r.Text:this.stateText(e);break;case r.SpecialStartSequence:this.stateSpecialStartSequence(e);break;case r.InSpecialTag:this.stateInSpecialTag(e);break;case r.CDATASequence:this.stateCDATASequence(e);break;case r.InAttributeValueDq:this.stateInAttributeValueDoubleQuotes(e);break;case r.InAttributeName:this.stateInAttributeName(e);break;case r.InCommentLike:this.stateInCommentLike(e);break;case r.InSpecialComment:this.stateInSpecialComment(e);break;case r.BeforeAttributeName:this.stateBeforeAttributeName(e);break;case r.InTagName:this.stateInTagName(e);break;case r.InClosingTagName:this.stateInClosingTagName(e);break;case r.BeforeTagName:this.stateBeforeTagName(e);break;case r.AfterAttributeName:this.stateAfterAttributeName(e);break;case r.InAttributeValueSq:this.stateInAttributeValueSingleQuotes(e);break;case r.BeforeAttributeValue:this.stateBeforeAttributeValue(e);break;case r.BeforeClosingTagName:this.stateBeforeClosingTagName(e);break;case r.AfterClosingTagName:this.stateAfterClosingTagName(e);break;case r.BeforeSpecialS:this.stateBeforeSpecialS(e);break;case r.BeforeSpecialT:this.stateBeforeSpecialT(e);break;case r.InAttributeValueNq:this.stateInAttributeValueNoQuotes(e);break;case r.InSelfClosingTag:this.stateInSelfClosingTag(e);break;case r.InDeclaration:this.stateInDeclaration(e);break;case r.BeforeDeclaration:this.stateBeforeDeclaration(e);break;case r.BeforeComment:this.stateBeforeComment(e);break;case r.InProcessingInstruction:this.stateInProcessingInstruction(e);break;case r.InEntity:this.stateInEntity();break}this.index++}this.cleanup()}finish(){this.state===r.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){let e=this.buffer.length+this.offset;this.sectionStart>=e||(this.state===r.InCommentLike?this.currentSequence===c.CdataEnd?this.cbs.oncdata(this.sectionStart,e,0):this.cbs.oncomment(this.sectionStart,e,0):this.state===r.InTagName||this.state===r.BeforeAttributeName||this.state===r.BeforeAttributeValue||this.state===r.AfterAttributeName||this.state===r.InAttributeName||this.state===r.InAttributeValueSq||this.state===r.InAttributeValueDq||this.state===r.InAttributeValueNq||this.state===r.InClosingTagName||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,t){this.baseState!==r.Text&&this.baseState!==r.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+t,this.index=this.sectionStart-1,this.cbs.onattribentity(e)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+t,this.index=this.sectionStart-1,this.cbs.ontextentity(e,this.sectionStart))}}})),av=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;o<a.length;o++)a[o]!=="default"&&t(i,r,a[o]);return n(i,r),i}})();Object.defineProperty(e,"__esModule",{value:!0}),e.Parser=void 0;var i=r(iv()),a=rv(),o=new Set([`input`,`option`,`optgroup`,`select`,`button`,`datalist`,`textarea`]),s=new Set([`p`]),c=new Set([`thead`,`tbody`]),l=new Set([`dd`,`dt`]),u=new Set([`rt`,`rp`]),d=new Map([[`tr`,new Set([`tr`,`th`,`td`])],[`th`,new Set([`th`])],[`td`,new Set([`thead`,`th`,`td`])],[`body`,new Set([`head`,`link`,`script`])],[`li`,new Set([`li`])],[`p`,s],[`h1`,s],[`h2`,s],[`h3`,s],[`h4`,s],[`h5`,s],[`h6`,s],[`select`,o],[`input`,o],[`output`,o],[`button`,o],[`datalist`,o],[`textarea`,o],[`option`,new Set([`option`])],[`optgroup`,new Set([`optgroup`,`option`])],[`dd`,l],[`dt`,l],[`address`,s],[`article`,s],[`aside`,s],[`blockquote`,s],[`details`,s],[`div`,s],[`dl`,s],[`fieldset`,s],[`figcaption`,s],[`figure`,s],[`footer`,s],[`form`,s],[`header`,s],[`hr`,s],[`main`,s],[`nav`,s],[`ol`,s],[`pre`,s],[`section`,s],[`table`,s],[`ul`,s],[`rt`,u],[`rp`,u],[`tbody`,c],[`tfoot`,c]]),f=new Set([`area`,`base`,`basefont`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`img`,`input`,`isindex`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),p=new Set([`math`,`svg`]),m=new Set([`mi`,`mo`,`mn`,`ms`,`mtext`,`annotation-xml`,`foreignobject`,`desc`,`title`]),h=/\s|\//;e.Parser=class{constructor(e,t={}){var n,r;this.options=t,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname=``,this.attribname=``,this.attribvalue=``,this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=e??{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=t.lowerCaseTags??this.htmlMode,this.lowerCaseAttributeNames=t.lowerCaseAttributeNames??this.htmlMode,this.recognizeSelfClosing=t.recognizeSelfClosing??!this.htmlMode,this.tokenizer=new(t.Tokenizer??i.default)(this.options,this),this.foreignContext=[!this.htmlMode],(r=(n=this.cbs).onparserinit)==null||r.call(n,this)}ontext(e,t){var n,r;let i=this.getSlice(e,t);this.endIndex=t-1,(r=(n=this.cbs).ontext)==null||r.call(n,i),this.startIndex=t}ontextentity(e,t){var n,r;this.endIndex=t-1,(r=(n=this.cbs).ontext)==null||r.call(n,(0,a.fromCodePoint)(e)),this.startIndex=t}isVoidElement(e){return this.htmlMode&&f.has(e)}onopentagname(e,t){this.endIndex=t;let n=this.getSlice(e,t);this.lowerCaseTagNames&&(n=n.toLowerCase()),this.emitOpenTag(n)}emitOpenTag(e){var t,n,r,i;this.openTagStart=this.startIndex,this.tagname=e;let a=this.htmlMode&&d.get(e);if(a)for(;this.stack.length>0&&a.has(this.stack[0]);){let e=this.stack.shift();(n=(t=this.cbs).onclosetag)==null||n.call(t,e,!0)}this.isVoidElement(e)||(this.stack.unshift(e),this.htmlMode&&(p.has(e)?this.foreignContext.unshift(!0):m.has(e)&&this.foreignContext.unshift(!1))),(i=(r=this.cbs).onopentagname)==null||i.call(r,e),this.cbs.onopentag&&(this.attribs={})}endOpenTag(e){var t,n;this.startIndex=this.openTagStart,this.attribs&&=((n=(t=this.cbs).onopentag)==null||n.call(t,this.tagname,this.attribs,e),null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=``}onopentagend(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1}onclosetag(e,t){var n,r,i,a,o,s,c,l;this.endIndex=t;let u=this.getSlice(e,t);if(this.lowerCaseTagNames&&(u=u.toLowerCase()),this.htmlMode&&(p.has(u)||m.has(u))&&this.foreignContext.shift(),this.isVoidElement(u))this.htmlMode&&u===`br`&&((a=(i=this.cbs).onopentagname)==null||a.call(i,`br`),(s=(o=this.cbs).onopentag)==null||s.call(o,`br`,{},!0),(l=(c=this.cbs).onclosetag)==null||l.call(c,`br`,!1));else{let e=this.stack.indexOf(u);if(e!==-1)for(let t=0;t<=e;t++){let i=this.stack.shift();(r=(n=this.cbs).onclosetag)==null||r.call(n,i,t!==e)}else this.htmlMode&&u===`p`&&(this.emitOpenTag(`p`),this.closeCurrentTag(!0))}this.startIndex=t+1}onselfclosingtag(e){this.endIndex=e,this.recognizeSelfClosing||this.foreignContext[0]?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)}closeCurrentTag(e){var t,n;let r=this.tagname;this.endOpenTag(e),this.stack[0]===r&&((n=(t=this.cbs).onclosetag)==null||n.call(t,r,!e),this.stack.shift())}onattribname(e,t){this.startIndex=e;let n=this.getSlice(e,t);this.attribname=this.lowerCaseAttributeNames?n.toLowerCase():n}onattribdata(e,t){this.attribvalue+=this.getSlice(e,t)}onattribentity(e){this.attribvalue+=(0,a.fromCodePoint)(e)}onattribend(e,t){var n,r;this.endIndex=t,(r=(n=this.cbs).onattribute)==null||r.call(n,this.attribname,this.attribvalue,e===i.QuoteType.Double?`"`:e===i.QuoteType.Single?`'`:e===i.QuoteType.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=``}getInstructionName(e){let t=e.search(h),n=t<0?e:e.substr(0,t);return this.lowerCaseTagNames&&(n=n.toLowerCase()),n}ondeclaration(e,t){this.endIndex=t;let n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){let e=this.getInstructionName(n);this.cbs.onprocessinginstruction(`!${e}`,`!${n}`)}this.startIndex=t+1}onprocessinginstruction(e,t){this.endIndex=t;let n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){let e=this.getInstructionName(n);this.cbs.onprocessinginstruction(`?${e}`,`?${n}`)}this.startIndex=t+1}oncomment(e,t,n){var r,i,a,o;this.endIndex=t,(i=(r=this.cbs).oncomment)==null||i.call(r,this.getSlice(e,t-n)),(o=(a=this.cbs).oncommentend)==null||o.call(a),this.startIndex=t+1}oncdata(e,t,n){var r,i,a,o,s,c,l,u,d,f;this.endIndex=t;let p=this.getSlice(e,t-n);!this.htmlMode||this.options.recognizeCDATA?((i=(r=this.cbs).oncdatastart)==null||i.call(r),(o=(a=this.cbs).ontext)==null||o.call(a,p),(c=(s=this.cbs).oncdataend)==null||c.call(s)):((u=(l=this.cbs).oncomment)==null||u.call(l,`[CDATA[${p}]]`),(f=(d=this.cbs).oncommentend)==null||f.call(d)),this.startIndex=t+1}onend(){var e,t;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let e=0;e<this.stack.length;e++)this.cbs.onclosetag(this.stack[e],!0)}(t=(e=this.cbs).onend)==null||t.call(e)}reset(){var e,t,n,r;(t=(e=this.cbs).onreset)==null||t.call(e),this.tokenizer.reset(),this.tagname=``,this.attribname=``,this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(r=(n=this.cbs).onparserinit)==null||r.call(n,this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(!this.htmlMode),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(e){this.reset(),this.end(e)}getSlice(e,t){for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let n=this.buffers[0].slice(e-this.bufferOffset,t-this.bufferOffset);for(;t-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),n+=this.buffers[0].slice(0,t-this.bufferOffset);return n}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(e){var t,n;if(this.ended){(n=(t=this.cbs).onerror)==null||n.call(t,Error(`.write() after done!`));return}this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++)}end(e){var t,n;if(this.ended){(n=(t=this.cbs).onerror)==null||n.call(t,Error(`.end() after done!`));return}e&&this.write(e),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}parseChunk(e){this.write(e)}done(e){this.end(e)}}})),ov=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var t;(function(e){e.Root=`root`,e.Text=`text`,e.Directive=`directive`,e.Comment=`comment`,e.Script=`script`,e.Style=`style`,e.Tag=`tag`,e.CDATA=`cdata`,e.Doctype=`doctype`})(t=e.ElementType||={});function n(e){return e.type===t.Tag||e.type===t.Script||e.type===t.Style}e.isTag=n,e.Root=t.Root,e.Text=t.Text,e.Directive=t.Directive,e.Comment=t.Comment,e.Script=t.Script,e.Style=t.Style,e.Tag=t.Tag,e.CDATA=t.CDATA,e.Doctype=t.Doctype})),sv=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),n=e&&e.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.cloneNode=e.hasChildren=e.isDocument=e.isDirective=e.isComment=e.isText=e.isCDATA=e.isTag=e.Element=e.Document=e.CDATA=e.NodeWithChildren=e.ProcessingInstruction=e.Comment=e.Text=e.DataNode=e.Node=void 0;var r=ov(),i=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(e){return e===void 0&&(e=!1),b(this,e)},e}();e.Node=i;var a=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.data=t,n}return Object.defineProperty(n.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!1,configurable:!0}),n}(i);e.DataNode=a;var o=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=r.ElementType.Text,t}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),n}(a);e.Text=o;var s=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=r.ElementType.Comment,t}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),n}(a);e.Comment=s;var c=function(e){t(n,e);function n(t,n){var i=e.call(this,n)||this;return i.name=t,i.type=r.ElementType.Directive,i}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),n}(a);e.ProcessingInstruction=c;var l=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.children=t,n}return Object.defineProperty(n.prototype,"firstChild",{get:function(){return this.children[0]??null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),n}(i);e.NodeWithChildren=l;var u=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=r.ElementType.CDATA,t}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),n}(l);e.CDATA=u;var d=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=r.ElementType.Root,t}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),n}(l);e.Document=d;var f=function(e){t(n,e);function n(t,n,i,a){i===void 0&&(i=[]),a===void 0&&(a=t===`script`?r.ElementType.Script:t===`style`?r.ElementType.Style:r.ElementType.Tag);var o=e.call(this,i)||this;return o.name=t,o.attribs=n,o.type=a,o}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map(function(t){return{name:t,value:e.attribs[t],namespace:e[`x-attribsNamespace`]?.[t],prefix:e[`x-attribsPrefix`]?.[t]}})},enumerable:!1,configurable:!0}),n}(l);e.Element=f;function p(e){return(0,r.isTag)(e)}e.isTag=p;function m(e){return e.type===r.ElementType.CDATA}e.isCDATA=m;function h(e){return e.type===r.ElementType.Text}e.isText=h;function g(e){return e.type===r.ElementType.Comment}e.isComment=g;function _(e){return e.type===r.ElementType.Directive}e.isDirective=_;function v(e){return e.type===r.ElementType.Root}e.isDocument=v;function y(e){return Object.prototype.hasOwnProperty.call(e,`children`)}e.hasChildren=y;function b(e,t){t===void 0&&(t=!1);var r;if(h(e))r=new o(e.data);else if(g(e))r=new s(e.data);else if(p(e)){var i=t?x(e.children):[],a=new f(e.name,n({},e.attribs),i);i.forEach(function(e){return e.parent=a}),e.namespace!=null&&(a.namespace=e.namespace),e[`x-attribsNamespace`]&&(a[`x-attribsNamespace`]=n({},e[`x-attribsNamespace`])),e[`x-attribsPrefix`]&&(a[`x-attribsPrefix`]=n({},e[`x-attribsPrefix`])),r=a}else if(m(e)){var i=t?x(e.children):[],l=new u(i);i.forEach(function(e){return e.parent=l}),r=l}else if(v(e)){var i=t?x(e.children):[],y=new d(i);i.forEach(function(e){return e.parent=y}),e[`x-mode`]&&(y[`x-mode`]=e[`x-mode`]),r=y}else if(_(e)){var b=new c(e.name,e.data);e[`x-name`]!=null&&(b[`x-name`]=e[`x-name`],b[`x-publicId`]=e[`x-publicId`],b[`x-systemId`]=e[`x-systemId`]),r=b}else throw Error(`Not implemented yet: ${e.type}`);return r.startIndex=e.startIndex,r.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(r.sourceCodeLocation=e.sourceCodeLocation),r}e.cloneNode=b;function x(e){for(var t=e.map(function(e){return b(e,!0)}),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}})),cv=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var r=ov(),i=sv();n(sv(),e);var a={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},o=function(){function e(e,t,n){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof t==`function`&&(n=t,t=a),typeof e==`object`&&(t=e,e=void 0),this.callback=e??null,this.options=t??a,this.elementCB=n??null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?r.ElementType.Tag:void 0,a=new i.Element(e,t,void 0,n);this.addNode(a),this.tagStack.push(a)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===r.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new i.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment){this.lastNode.data+=e;return}var t=new i.Comment(e);this.addNode(t),this.lastNode=t},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new i.Text(``),t=new i.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new i.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if(typeof this.callback==`function`)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();e.DomHandler=o,e.default=o})),lv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=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(function(e){return e.charCodeAt(0)}))})),uv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=new Uint16Array(`Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢`.split(``).map(function(e){return e.charCodeAt(0)}))})),dv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.replaceCodePoint=e.fromCodePoint=void 0;var t=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]]);e.fromCodePoint=String.fromCodePoint??function(e){var t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function n(e){return e>=55296&&e<=57343||e>1114111?65533:t.get(e)??e}e.replaceCodePoint=n;function r(t){return(0,e.fromCodePoint)(n(t))}e.default=r})),fv=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.decodeXML=e.decodeHTMLStrict=e.decodeHTMLAttribute=e.decodeHTML=e.determineBranch=e.EntityDecoder=e.DecodingMode=e.BinTrieFlags=e.fromCodePoint=e.replaceCodePoint=e.decodeCodePoint=e.xmlDecodeTree=e.htmlDecodeTree=void 0;var a=i(lv());e.htmlDecodeTree=a.default;var o=i(uv());e.xmlDecodeTree=o.default;var s=r(dv());e.decodeCodePoint=s.default;var c=dv();Object.defineProperty(e,"replaceCodePoint",{enumerable:!0,get:function(){return c.replaceCodePoint}}),Object.defineProperty(e,"fromCodePoint",{enumerable:!0,get:function(){return c.fromCodePoint}});var l;(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`})(l||={});var u=32,d;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(d=e.BinTrieFlags||={});function f(e){return e>=l.ZERO&&e<=l.NINE}function p(e){return e>=l.UPPER_A&&e<=l.UPPER_F||e>=l.LOWER_A&&e<=l.LOWER_F}function m(e){return e>=l.UPPER_A&&e<=l.UPPER_Z||e>=l.LOWER_A&&e<=l.LOWER_Z||f(e)}function h(e){return e===l.EQUALS||m(e)}var g;(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`})(g||={});var _;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(_=e.DecodingMode||={});var v=function(){function e(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=g.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=_.Strict}return e.prototype.startEntity=function(e){this.decodeMode=e,this.state=g.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1},e.prototype.write=function(e,t){switch(this.state){case g.EntityStart:return e.charCodeAt(t)===l.NUM?(this.state=g.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=g.NamedEntity,this.stateNamedEntity(e,t));case g.NumericStart:return this.stateNumericStart(e,t);case g.NumericDecimal:return this.stateNumericDecimal(e,t);case g.NumericHex:return this.stateNumericHex(e,t);case g.NamedEntity:return this.stateNamedEntity(e,t)}},e.prototype.stateNumericStart=function(e,t){return t>=e.length?-1:(e.charCodeAt(t)|u)===l.LOWER_X?(this.state=g.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=g.NumericDecimal,this.stateNumericDecimal(e,t))},e.prototype.addToNumericResult=function(e,t,n,r){if(t!==n){var i=n-t;this.result=this.result*r**+i+parseInt(e.substr(t,i),r),this.consumed+=i}},e.prototype.stateNumericHex=function(e,t){for(var n=t;t<e.length;){var r=e.charCodeAt(t);if(f(r)||p(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1},e.prototype.stateNumericDecimal=function(e,t){for(var n=t;t<e.length;){var r=e.charCodeAt(t);if(f(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1},e.prototype.emitNumericEntity=function(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===l.SEMI)this.consumed+=1;else if(this.decodeMode===_.Strict)return 0;return this.emitCodePoint((0,s.replaceCodePoint)(this.result),this.consumed),this.errors&&(e!==l.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed},e.prototype.stateNamedEntity=function(e,t){for(var n=this.decodeTree,r=n[this.treeIndex],i=(r&d.VALUE_LENGTH)>>14;t<e.length;t++,this.excess++){var a=e.charCodeAt(t);if(this.treeIndex=b(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===_.Attribute&&(i===0||h(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&d.VALUE_LENGTH)>>14,i!==0){if(a===l.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==_.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1},e.prototype.emitNotTerminatedNamedEntity=function(){var e,t=this,n=t.result,r=(t.decodeTree[n]&d.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed},e.prototype.emitNamedEntityData=function(e,t,n){var r=this.decodeTree;return this.emitCodePoint(t===1?r[e]&~d.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n},e.prototype.end=function(){var e;switch(this.state){case g.NamedEntity:return this.result!==0&&(this.decodeMode!==_.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case g.NumericDecimal:return this.emitNumericEntity(0,2);case g.NumericHex:return this.emitNumericEntity(0,3);case g.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case g.EntityStart:return 0}},e}();e.EntityDecoder=v;function y(e){var t=``,n=new v(e,function(e){return t+=(0,s.fromCodePoint)(e)});return function(e,r){for(var i=0,a=0;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);var o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}var s=t+e.slice(i);return t=``,s}}function b(e,t,n,r){var i=(t&d.BRANCH_LENGTH)>>7,a=t&d.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){var o=r-a;return o<0||o>=i?-1:e[n+o]-1}for(var s=n,c=s+i-1;s<=c;){var l=s+c>>>1,u=e[l];if(u<r)s=l+1;else if(u>r)c=l-1;else return e[l+i]}return-1}e.determineBranch=b;var x=y(a.default),S=y(o.default);function C(e,t){return t===void 0&&(t=_.Legacy),x(e,t)}e.decodeHTML=C;function w(e){return x(e,_.Attribute)}e.decodeHTMLAttribute=w;function T(e){return x(e,_.Strict)}e.decodeHTMLStrict=T;function E(e){return S(e,_.Strict)}e.decodeXML=E})),pv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){for(var t=1;t<e.length;t++)e[t][0]+=e[t-1][0]+1;return e}e.default=new Map(t([[9,`&Tab;`],[0,`&NewLine;`],[22,`&excl;`],[0,`&quot;`],[0,`&num;`],[0,`&dollar;`],[0,`&percnt;`],[0,`&amp;`],[0,`&apos;`],[0,`&lpar;`],[0,`&rpar;`],[0,`&ast;`],[0,`&plus;`],[0,`&comma;`],[1,`&period;`],[0,`&sol;`],[10,`&colon;`],[0,`&semi;`],[0,{v:`&lt;`,n:8402,o:`&nvlt;`}],[0,{v:`&equals;`,n:8421,o:`&bne;`}],[0,{v:`&gt;`,n:8402,o:`&nvgt;`}],[0,`&quest;`],[0,`&commat;`],[26,`&lbrack;`],[0,`&bsol;`],[0,`&rbrack;`],[0,`&Hat;`],[0,`&lowbar;`],[0,`&DiacriticalGrave;`],[5,{n:106,o:`&fjlig;`}],[20,`&lbrace;`],[0,`&verbar;`],[0,`&rbrace;`],[34,`&nbsp;`],[0,`&iexcl;`],[0,`&cent;`],[0,`&pound;`],[0,`&curren;`],[0,`&yen;`],[0,`&brvbar;`],[0,`&sect;`],[0,`&die;`],[0,`&copy;`],[0,`&ordf;`],[0,`&laquo;`],[0,`&not;`],[0,`&shy;`],[0,`&circledR;`],[0,`&macr;`],[0,`&deg;`],[0,`&PlusMinus;`],[0,`&sup2;`],[0,`&sup3;`],[0,`&acute;`],[0,`&micro;`],[0,`&para;`],[0,`&centerdot;`],[0,`&cedil;`],[0,`&sup1;`],[0,`&ordm;`],[0,`&raquo;`],[0,`&frac14;`],[0,`&frac12;`],[0,`&frac34;`],[0,`&iquest;`],[0,`&Agrave;`],[0,`&Aacute;`],[0,`&Acirc;`],[0,`&Atilde;`],[0,`&Auml;`],[0,`&angst;`],[0,`&AElig;`],[0,`&Ccedil;`],[0,`&Egrave;`],[0,`&Eacute;`],[0,`&Ecirc;`],[0,`&Euml;`],[0,`&Igrave;`],[0,`&Iacute;`],[0,`&Icirc;`],[0,`&Iuml;`],[0,`&ETH;`],[0,`&Ntilde;`],[0,`&Ograve;`],[0,`&Oacute;`],[0,`&Ocirc;`],[0,`&Otilde;`],[0,`&Ouml;`],[0,`&times;`],[0,`&Oslash;`],[0,`&Ugrave;`],[0,`&Uacute;`],[0,`&Ucirc;`],[0,`&Uuml;`],[0,`&Yacute;`],[0,`&THORN;`],[0,`&szlig;`],[0,`&agrave;`],[0,`&aacute;`],[0,`&acirc;`],[0,`&atilde;`],[0,`&auml;`],[0,`&aring;`],[0,`&aelig;`],[0,`&ccedil;`],[0,`&egrave;`],[0,`&eacute;`],[0,`&ecirc;`],[0,`&euml;`],[0,`&igrave;`],[0,`&iacute;`],[0,`&icirc;`],[0,`&iuml;`],[0,`&eth;`],[0,`&ntilde;`],[0,`&ograve;`],[0,`&oacute;`],[0,`&ocirc;`],[0,`&otilde;`],[0,`&ouml;`],[0,`&div;`],[0,`&oslash;`],[0,`&ugrave;`],[0,`&uacute;`],[0,`&ucirc;`],[0,`&uuml;`],[0,`&yacute;`],[0,`&thorn;`],[0,`&yuml;`],[0,`&Amacr;`],[0,`&amacr;`],[0,`&Abreve;`],[0,`&abreve;`],[0,`&Aogon;`],[0,`&aogon;`],[0,`&Cacute;`],[0,`&cacute;`],[0,`&Ccirc;`],[0,`&ccirc;`],[0,`&Cdot;`],[0,`&cdot;`],[0,`&Ccaron;`],[0,`&ccaron;`],[0,`&Dcaron;`],[0,`&dcaron;`],[0,`&Dstrok;`],[0,`&dstrok;`],[0,`&Emacr;`],[0,`&emacr;`],[2,`&Edot;`],[0,`&edot;`],[0,`&Eogon;`],[0,`&eogon;`],[0,`&Ecaron;`],[0,`&ecaron;`],[0,`&Gcirc;`],[0,`&gcirc;`],[0,`&Gbreve;`],[0,`&gbreve;`],[0,`&Gdot;`],[0,`&gdot;`],[0,`&Gcedil;`],[1,`&Hcirc;`],[0,`&hcirc;`],[0,`&Hstrok;`],[0,`&hstrok;`],[0,`&Itilde;`],[0,`&itilde;`],[0,`&Imacr;`],[0,`&imacr;`],[2,`&Iogon;`],[0,`&iogon;`],[0,`&Idot;`],[0,`&imath;`],[0,`&IJlig;`],[0,`&ijlig;`],[0,`&Jcirc;`],[0,`&jcirc;`],[0,`&Kcedil;`],[0,`&kcedil;`],[0,`&kgreen;`],[0,`&Lacute;`],[0,`&lacute;`],[0,`&Lcedil;`],[0,`&lcedil;`],[0,`&Lcaron;`],[0,`&lcaron;`],[0,`&Lmidot;`],[0,`&lmidot;`],[0,`&Lstrok;`],[0,`&lstrok;`],[0,`&Nacute;`],[0,`&nacute;`],[0,`&Ncedil;`],[0,`&ncedil;`],[0,`&Ncaron;`],[0,`&ncaron;`],[0,`&napos;`],[0,`&ENG;`],[0,`&eng;`],[0,`&Omacr;`],[0,`&omacr;`],[2,`&Odblac;`],[0,`&odblac;`],[0,`&OElig;`],[0,`&oelig;`],[0,`&Racute;`],[0,`&racute;`],[0,`&Rcedil;`],[0,`&rcedil;`],[0,`&Rcaron;`],[0,`&rcaron;`],[0,`&Sacute;`],[0,`&sacute;`],[0,`&Scirc;`],[0,`&scirc;`],[0,`&Scedil;`],[0,`&scedil;`],[0,`&Scaron;`],[0,`&scaron;`],[0,`&Tcedil;`],[0,`&tcedil;`],[0,`&Tcaron;`],[0,`&tcaron;`],[0,`&Tstrok;`],[0,`&tstrok;`],[0,`&Utilde;`],[0,`&utilde;`],[0,`&Umacr;`],[0,`&umacr;`],[0,`&Ubreve;`],[0,`&ubreve;`],[0,`&Uring;`],[0,`&uring;`],[0,`&Udblac;`],[0,`&udblac;`],[0,`&Uogon;`],[0,`&uogon;`],[0,`&Wcirc;`],[0,`&wcirc;`],[0,`&Ycirc;`],[0,`&ycirc;`],[0,`&Yuml;`],[0,`&Zacute;`],[0,`&zacute;`],[0,`&Zdot;`],[0,`&zdot;`],[0,`&Zcaron;`],[0,`&zcaron;`],[19,`&fnof;`],[34,`&imped;`],[63,`&gacute;`],[65,`&jmath;`],[142,`&circ;`],[0,`&caron;`],[16,`&breve;`],[0,`&DiacriticalDot;`],[0,`&ring;`],[0,`&ogon;`],[0,`&DiacriticalTilde;`],[0,`&dblac;`],[51,`&DownBreve;`],[127,`&Alpha;`],[0,`&Beta;`],[0,`&Gamma;`],[0,`&Delta;`],[0,`&Epsilon;`],[0,`&Zeta;`],[0,`&Eta;`],[0,`&Theta;`],[0,`&Iota;`],[0,`&Kappa;`],[0,`&Lambda;`],[0,`&Mu;`],[0,`&Nu;`],[0,`&Xi;`],[0,`&Omicron;`],[0,`&Pi;`],[0,`&Rho;`],[1,`&Sigma;`],[0,`&Tau;`],[0,`&Upsilon;`],[0,`&Phi;`],[0,`&Chi;`],[0,`&Psi;`],[0,`&ohm;`],[7,`&alpha;`],[0,`&beta;`],[0,`&gamma;`],[0,`&delta;`],[0,`&epsi;`],[0,`&zeta;`],[0,`&eta;`],[0,`&theta;`],[0,`&iota;`],[0,`&kappa;`],[0,`&lambda;`],[0,`&mu;`],[0,`&nu;`],[0,`&xi;`],[0,`&omicron;`],[0,`&pi;`],[0,`&rho;`],[0,`&sigmaf;`],[0,`&sigma;`],[0,`&tau;`],[0,`&upsi;`],[0,`&phi;`],[0,`&chi;`],[0,`&psi;`],[0,`&omega;`],[7,`&thetasym;`],[0,`&Upsi;`],[2,`&phiv;`],[0,`&piv;`],[5,`&Gammad;`],[0,`&digamma;`],[18,`&kappav;`],[0,`&rhov;`],[3,`&epsiv;`],[0,`&backepsilon;`],[10,`&IOcy;`],[0,`&DJcy;`],[0,`&GJcy;`],[0,`&Jukcy;`],[0,`&DScy;`],[0,`&Iukcy;`],[0,`&YIcy;`],[0,`&Jsercy;`],[0,`&LJcy;`],[0,`&NJcy;`],[0,`&TSHcy;`],[0,`&KJcy;`],[1,`&Ubrcy;`],[0,`&DZcy;`],[0,`&Acy;`],[0,`&Bcy;`],[0,`&Vcy;`],[0,`&Gcy;`],[0,`&Dcy;`],[0,`&IEcy;`],[0,`&ZHcy;`],[0,`&Zcy;`],[0,`&Icy;`],[0,`&Jcy;`],[0,`&Kcy;`],[0,`&Lcy;`],[0,`&Mcy;`],[0,`&Ncy;`],[0,`&Ocy;`],[0,`&Pcy;`],[0,`&Rcy;`],[0,`&Scy;`],[0,`&Tcy;`],[0,`&Ucy;`],[0,`&Fcy;`],[0,`&KHcy;`],[0,`&TScy;`],[0,`&CHcy;`],[0,`&SHcy;`],[0,`&SHCHcy;`],[0,`&HARDcy;`],[0,`&Ycy;`],[0,`&SOFTcy;`],[0,`&Ecy;`],[0,`&YUcy;`],[0,`&YAcy;`],[0,`&acy;`],[0,`&bcy;`],[0,`&vcy;`],[0,`&gcy;`],[0,`&dcy;`],[0,`&iecy;`],[0,`&zhcy;`],[0,`&zcy;`],[0,`&icy;`],[0,`&jcy;`],[0,`&kcy;`],[0,`&lcy;`],[0,`&mcy;`],[0,`&ncy;`],[0,`&ocy;`],[0,`&pcy;`],[0,`&rcy;`],[0,`&scy;`],[0,`&tcy;`],[0,`&ucy;`],[0,`&fcy;`],[0,`&khcy;`],[0,`&tscy;`],[0,`&chcy;`],[0,`&shcy;`],[0,`&shchcy;`],[0,`&hardcy;`],[0,`&ycy;`],[0,`&softcy;`],[0,`&ecy;`],[0,`&yucy;`],[0,`&yacy;`],[1,`&iocy;`],[0,`&djcy;`],[0,`&gjcy;`],[0,`&jukcy;`],[0,`&dscy;`],[0,`&iukcy;`],[0,`&yicy;`],[0,`&jsercy;`],[0,`&ljcy;`],[0,`&njcy;`],[0,`&tshcy;`],[0,`&kjcy;`],[1,`&ubrcy;`],[0,`&dzcy;`],[7074,`&ensp;`],[0,`&emsp;`],[0,`&emsp13;`],[0,`&emsp14;`],[1,`&numsp;`],[0,`&puncsp;`],[0,`&ThinSpace;`],[0,`&hairsp;`],[0,`&NegativeMediumSpace;`],[0,`&zwnj;`],[0,`&zwj;`],[0,`&lrm;`],[0,`&rlm;`],[0,`&dash;`],[2,`&ndash;`],[0,`&mdash;`],[0,`&horbar;`],[0,`&Verbar;`],[1,`&lsquo;`],[0,`&CloseCurlyQuote;`],[0,`&lsquor;`],[1,`&ldquo;`],[0,`&CloseCurlyDoubleQuote;`],[0,`&bdquo;`],[1,`&dagger;`],[0,`&Dagger;`],[0,`&bull;`],[2,`&nldr;`],[0,`&hellip;`],[9,`&permil;`],[0,`&pertenk;`],[0,`&prime;`],[0,`&Prime;`],[0,`&tprime;`],[0,`&backprime;`],[3,`&lsaquo;`],[0,`&rsaquo;`],[3,`&oline;`],[2,`&caret;`],[1,`&hybull;`],[0,`&frasl;`],[10,`&bsemi;`],[7,`&qprime;`],[7,{v:`&MediumSpace;`,n:8202,o:`&ThickSpace;`}],[0,`&NoBreak;`],[0,`&af;`],[0,`&InvisibleTimes;`],[0,`&ic;`],[72,`&euro;`],[46,`&tdot;`],[0,`&DotDot;`],[37,`&complexes;`],[2,`&incare;`],[4,`&gscr;`],[0,`&hamilt;`],[0,`&Hfr;`],[0,`&Hopf;`],[0,`&planckh;`],[0,`&hbar;`],[0,`&imagline;`],[0,`&Ifr;`],[0,`&lagran;`],[0,`&ell;`],[1,`&naturals;`],[0,`&numero;`],[0,`&copysr;`],[0,`&weierp;`],[0,`&Popf;`],[0,`&Qopf;`],[0,`&realine;`],[0,`&real;`],[0,`&reals;`],[0,`&rx;`],[3,`&trade;`],[1,`&integers;`],[2,`&mho;`],[0,`&zeetrf;`],[0,`&iiota;`],[2,`&bernou;`],[0,`&Cayleys;`],[1,`&escr;`],[0,`&Escr;`],[0,`&Fouriertrf;`],[1,`&Mellintrf;`],[0,`&order;`],[0,`&alefsym;`],[0,`&beth;`],[0,`&gimel;`],[0,`&daleth;`],[12,`&CapitalDifferentialD;`],[0,`&dd;`],[0,`&ee;`],[0,`&ii;`],[10,`&frac13;`],[0,`&frac23;`],[0,`&frac15;`],[0,`&frac25;`],[0,`&frac35;`],[0,`&frac45;`],[0,`&frac16;`],[0,`&frac56;`],[0,`&frac18;`],[0,`&frac38;`],[0,`&frac58;`],[0,`&frac78;`],[49,`&larr;`],[0,`&ShortUpArrow;`],[0,`&rarr;`],[0,`&darr;`],[0,`&harr;`],[0,`&updownarrow;`],[0,`&nwarr;`],[0,`&nearr;`],[0,`&LowerRightArrow;`],[0,`&LowerLeftArrow;`],[0,`&nlarr;`],[0,`&nrarr;`],[1,{v:`&rarrw;`,n:824,o:`&nrarrw;`}],[0,`&Larr;`],[0,`&Uarr;`],[0,`&Rarr;`],[0,`&Darr;`],[0,`&larrtl;`],[0,`&rarrtl;`],[0,`&LeftTeeArrow;`],[0,`&mapstoup;`],[0,`&map;`],[0,`&DownTeeArrow;`],[1,`&hookleftarrow;`],[0,`&hookrightarrow;`],[0,`&larrlp;`],[0,`&looparrowright;`],[0,`&harrw;`],[0,`&nharr;`],[1,`&lsh;`],[0,`&rsh;`],[0,`&ldsh;`],[0,`&rdsh;`],[1,`&crarr;`],[0,`&cularr;`],[0,`&curarr;`],[2,`&circlearrowleft;`],[0,`&circlearrowright;`],[0,`&leftharpoonup;`],[0,`&DownLeftVector;`],[0,`&RightUpVector;`],[0,`&LeftUpVector;`],[0,`&rharu;`],[0,`&DownRightVector;`],[0,`&dharr;`],[0,`&dharl;`],[0,`&RightArrowLeftArrow;`],[0,`&udarr;`],[0,`&LeftArrowRightArrow;`],[0,`&leftleftarrows;`],[0,`&upuparrows;`],[0,`&rightrightarrows;`],[0,`&ddarr;`],[0,`&leftrightharpoons;`],[0,`&Equilibrium;`],[0,`&nlArr;`],[0,`&nhArr;`],[0,`&nrArr;`],[0,`&DoubleLeftArrow;`],[0,`&DoubleUpArrow;`],[0,`&DoubleRightArrow;`],[0,`&dArr;`],[0,`&DoubleLeftRightArrow;`],[0,`&DoubleUpDownArrow;`],[0,`&nwArr;`],[0,`&neArr;`],[0,`&seArr;`],[0,`&swArr;`],[0,`&lAarr;`],[0,`&rAarr;`],[1,`&zigrarr;`],[6,`&larrb;`],[0,`&rarrb;`],[15,`&DownArrowUpArrow;`],[7,`&loarr;`],[0,`&roarr;`],[0,`&hoarr;`],[0,`&forall;`],[0,`&comp;`],[0,{v:`&part;`,n:824,o:`&npart;`}],[0,`&exist;`],[0,`&nexist;`],[0,`&empty;`],[1,`&Del;`],[0,`&Element;`],[0,`&NotElement;`],[1,`&ni;`],[0,`&notni;`],[2,`&prod;`],[0,`&coprod;`],[0,`&sum;`],[0,`&minus;`],[0,`&MinusPlus;`],[0,`&dotplus;`],[1,`&Backslash;`],[0,`&lowast;`],[0,`&compfn;`],[1,`&radic;`],[2,`&prop;`],[0,`&infin;`],[0,`&angrt;`],[0,{v:`&ang;`,n:8402,o:`&nang;`}],[0,`&angmsd;`],[0,`&angsph;`],[0,`&mid;`],[0,`&nmid;`],[0,`&DoubleVerticalBar;`],[0,`&NotDoubleVerticalBar;`],[0,`&and;`],[0,`&or;`],[0,{v:`&cap;`,n:65024,o:`&caps;`}],[0,{v:`&cup;`,n:65024,o:`&cups;`}],[0,`&int;`],[0,`&Int;`],[0,`&iiint;`],[0,`&conint;`],[0,`&Conint;`],[0,`&Cconint;`],[0,`&cwint;`],[0,`&ClockwiseContourIntegral;`],[0,`&awconint;`],[0,`&there4;`],[0,`&becaus;`],[0,`&ratio;`],[0,`&Colon;`],[0,`&dotminus;`],[1,`&mDDot;`],[0,`&homtht;`],[0,{v:`&sim;`,n:8402,o:`&nvsim;`}],[0,{v:`&backsim;`,n:817,o:`&race;`}],[0,{v:`&ac;`,n:819,o:`&acE;`}],[0,`&acd;`],[0,`&VerticalTilde;`],[0,`&NotTilde;`],[0,{v:`&eqsim;`,n:824,o:`&nesim;`}],[0,`&sime;`],[0,`&NotTildeEqual;`],[0,`&cong;`],[0,`&simne;`],[0,`&ncong;`],[0,`&ap;`],[0,`&nap;`],[0,`&ape;`],[0,{v:`&apid;`,n:824,o:`&napid;`}],[0,`&backcong;`],[0,{v:`&asympeq;`,n:8402,o:`&nvap;`}],[0,{v:`&bump;`,n:824,o:`&nbump;`}],[0,{v:`&bumpe;`,n:824,o:`&nbumpe;`}],[0,{v:`&doteq;`,n:824,o:`&nedot;`}],[0,`&doteqdot;`],[0,`&efDot;`],[0,`&erDot;`],[0,`&Assign;`],[0,`&ecolon;`],[0,`&ecir;`],[0,`&circeq;`],[1,`&wedgeq;`],[0,`&veeeq;`],[1,`&triangleq;`],[2,`&equest;`],[0,`&ne;`],[0,{v:`&Congruent;`,n:8421,o:`&bnequiv;`}],[0,`&nequiv;`],[1,{v:`&le;`,n:8402,o:`&nvle;`}],[0,{v:`&ge;`,n:8402,o:`&nvge;`}],[0,{v:`&lE;`,n:824,o:`&nlE;`}],[0,{v:`&gE;`,n:824,o:`&ngE;`}],[0,{v:`&lnE;`,n:65024,o:`&lvertneqq;`}],[0,{v:`&gnE;`,n:65024,o:`&gvertneqq;`}],[0,{v:`&ll;`,n:new Map(t([[824,`&nLtv;`],[7577,`&nLt;`]]))}],[0,{v:`&gg;`,n:new Map(t([[824,`&nGtv;`],[7577,`&nGt;`]]))}],[0,`&between;`],[0,`&NotCupCap;`],[0,`&nless;`],[0,`&ngt;`],[0,`&nle;`],[0,`&nge;`],[0,`&lesssim;`],[0,`&GreaterTilde;`],[0,`&nlsim;`],[0,`&ngsim;`],[0,`&LessGreater;`],[0,`&gl;`],[0,`&NotLessGreater;`],[0,`&NotGreaterLess;`],[0,`&pr;`],[0,`&sc;`],[0,`&prcue;`],[0,`&sccue;`],[0,`&PrecedesTilde;`],[0,{v:`&scsim;`,n:824,o:`&NotSucceedsTilde;`}],[0,`&NotPrecedes;`],[0,`&NotSucceeds;`],[0,{v:`&sub;`,n:8402,o:`&NotSubset;`}],[0,{v:`&sup;`,n:8402,o:`&NotSuperset;`}],[0,`&nsub;`],[0,`&nsup;`],[0,`&sube;`],[0,`&supe;`],[0,`&NotSubsetEqual;`],[0,`&NotSupersetEqual;`],[0,{v:`&subne;`,n:65024,o:`&varsubsetneq;`}],[0,{v:`&supne;`,n:65024,o:`&varsupsetneq;`}],[1,`&cupdot;`],[0,`&UnionPlus;`],[0,{v:`&sqsub;`,n:824,o:`&NotSquareSubset;`}],[0,{v:`&sqsup;`,n:824,o:`&NotSquareSuperset;`}],[0,`&sqsube;`],[0,`&sqsupe;`],[0,{v:`&sqcap;`,n:65024,o:`&sqcaps;`}],[0,{v:`&sqcup;`,n:65024,o:`&sqcups;`}],[0,`&CirclePlus;`],[0,`&CircleMinus;`],[0,`&CircleTimes;`],[0,`&osol;`],[0,`&CircleDot;`],[0,`&circledcirc;`],[0,`&circledast;`],[1,`&circleddash;`],[0,`&boxplus;`],[0,`&boxminus;`],[0,`&boxtimes;`],[0,`&dotsquare;`],[0,`&RightTee;`],[0,`&dashv;`],[0,`&DownTee;`],[0,`&bot;`],[1,`&models;`],[0,`&DoubleRightTee;`],[0,`&Vdash;`],[0,`&Vvdash;`],[0,`&VDash;`],[0,`&nvdash;`],[0,`&nvDash;`],[0,`&nVdash;`],[0,`&nVDash;`],[0,`&prurel;`],[1,`&LeftTriangle;`],[0,`&RightTriangle;`],[0,{v:`&LeftTriangleEqual;`,n:8402,o:`&nvltrie;`}],[0,{v:`&RightTriangleEqual;`,n:8402,o:`&nvrtrie;`}],[0,`&origof;`],[0,`&imof;`],[0,`&multimap;`],[0,`&hercon;`],[0,`&intcal;`],[0,`&veebar;`],[1,`&barvee;`],[0,`&angrtvb;`],[0,`&lrtri;`],[0,`&bigwedge;`],[0,`&bigvee;`],[0,`&bigcap;`],[0,`&bigcup;`],[0,`&diam;`],[0,`&sdot;`],[0,`&sstarf;`],[0,`&divideontimes;`],[0,`&bowtie;`],[0,`&ltimes;`],[0,`&rtimes;`],[0,`&leftthreetimes;`],[0,`&rightthreetimes;`],[0,`&backsimeq;`],[0,`&curlyvee;`],[0,`&curlywedge;`],[0,`&Sub;`],[0,`&Sup;`],[0,`&Cap;`],[0,`&Cup;`],[0,`&fork;`],[0,`&epar;`],[0,`&lessdot;`],[0,`&gtdot;`],[0,{v:`&Ll;`,n:824,o:`&nLl;`}],[0,{v:`&Gg;`,n:824,o:`&nGg;`}],[0,{v:`&leg;`,n:65024,o:`&lesg;`}],[0,{v:`&gel;`,n:65024,o:`&gesl;`}],[2,`&cuepr;`],[0,`&cuesc;`],[0,`&NotPrecedesSlantEqual;`],[0,`&NotSucceedsSlantEqual;`],[0,`&NotSquareSubsetEqual;`],[0,`&NotSquareSupersetEqual;`],[2,`&lnsim;`],[0,`&gnsim;`],[0,`&precnsim;`],[0,`&scnsim;`],[0,`&nltri;`],[0,`&NotRightTriangle;`],[0,`&nltrie;`],[0,`&NotRightTriangleEqual;`],[0,`&vellip;`],[0,`&ctdot;`],[0,`&utdot;`],[0,`&dtdot;`],[0,`&disin;`],[0,`&isinsv;`],[0,`&isins;`],[0,{v:`&isindot;`,n:824,o:`&notindot;`}],[0,`&notinvc;`],[0,`&notinvb;`],[1,{v:`&isinE;`,n:824,o:`&notinE;`}],[0,`&nisd;`],[0,`&xnis;`],[0,`&nis;`],[0,`&notnivc;`],[0,`&notnivb;`],[6,`&barwed;`],[0,`&Barwed;`],[1,`&lceil;`],[0,`&rceil;`],[0,`&LeftFloor;`],[0,`&rfloor;`],[0,`&drcrop;`],[0,`&dlcrop;`],[0,`&urcrop;`],[0,`&ulcrop;`],[0,`&bnot;`],[1,`&profline;`],[0,`&profsurf;`],[1,`&telrec;`],[0,`&target;`],[5,`&ulcorn;`],[0,`&urcorn;`],[0,`&dlcorn;`],[0,`&drcorn;`],[2,`&frown;`],[0,`&smile;`],[9,`&cylcty;`],[0,`&profalar;`],[7,`&topbot;`],[6,`&ovbar;`],[1,`&solbar;`],[60,`&angzarr;`],[51,`&lmoustache;`],[0,`&rmoustache;`],[2,`&OverBracket;`],[0,`&bbrk;`],[0,`&bbrktbrk;`],[37,`&OverParenthesis;`],[0,`&UnderParenthesis;`],[0,`&OverBrace;`],[0,`&UnderBrace;`],[2,`&trpezium;`],[4,`&elinters;`],[59,`&blank;`],[164,`&circledS;`],[55,`&boxh;`],[1,`&boxv;`],[9,`&boxdr;`],[3,`&boxdl;`],[3,`&boxur;`],[3,`&boxul;`],[3,`&boxvr;`],[7,`&boxvl;`],[7,`&boxhd;`],[7,`&boxhu;`],[7,`&boxvh;`],[19,`&boxH;`],[0,`&boxV;`],[0,`&boxdR;`],[0,`&boxDr;`],[0,`&boxDR;`],[0,`&boxdL;`],[0,`&boxDl;`],[0,`&boxDL;`],[0,`&boxuR;`],[0,`&boxUr;`],[0,`&boxUR;`],[0,`&boxuL;`],[0,`&boxUl;`],[0,`&boxUL;`],[0,`&boxvR;`],[0,`&boxVr;`],[0,`&boxVR;`],[0,`&boxvL;`],[0,`&boxVl;`],[0,`&boxVL;`],[0,`&boxHd;`],[0,`&boxhD;`],[0,`&boxHD;`],[0,`&boxHu;`],[0,`&boxhU;`],[0,`&boxHU;`],[0,`&boxvH;`],[0,`&boxVh;`],[0,`&boxVH;`],[19,`&uhblk;`],[3,`&lhblk;`],[3,`&block;`],[8,`&blk14;`],[0,`&blk12;`],[0,`&blk34;`],[13,`&square;`],[8,`&blacksquare;`],[0,`&EmptyVerySmallSquare;`],[1,`&rect;`],[0,`&marker;`],[2,`&fltns;`],[1,`&bigtriangleup;`],[0,`&blacktriangle;`],[0,`&triangle;`],[2,`&blacktriangleright;`],[0,`&rtri;`],[3,`&bigtriangledown;`],[0,`&blacktriangledown;`],[0,`&dtri;`],[2,`&blacktriangleleft;`],[0,`&ltri;`],[6,`&loz;`],[0,`&cir;`],[32,`&tridot;`],[2,`&bigcirc;`],[8,`&ultri;`],[0,`&urtri;`],[0,`&lltri;`],[0,`&EmptySmallSquare;`],[0,`&FilledSmallSquare;`],[8,`&bigstar;`],[0,`&star;`],[7,`&phone;`],[49,`&female;`],[1,`&male;`],[29,`&spades;`],[2,`&clubs;`],[1,`&hearts;`],[0,`&diamondsuit;`],[3,`&sung;`],[2,`&flat;`],[0,`&natural;`],[0,`&sharp;`],[163,`&check;`],[3,`&cross;`],[8,`&malt;`],[21,`&sext;`],[33,`&VerticalSeparator;`],[25,`&lbbrk;`],[0,`&rbbrk;`],[84,`&bsolhsub;`],[0,`&suphsol;`],[28,`&LeftDoubleBracket;`],[0,`&RightDoubleBracket;`],[0,`&lang;`],[0,`&rang;`],[0,`&Lang;`],[0,`&Rang;`],[0,`&loang;`],[0,`&roang;`],[7,`&longleftarrow;`],[0,`&longrightarrow;`],[0,`&longleftrightarrow;`],[0,`&DoubleLongLeftArrow;`],[0,`&DoubleLongRightArrow;`],[0,`&DoubleLongLeftRightArrow;`],[1,`&longmapsto;`],[2,`&dzigrarr;`],[258,`&nvlArr;`],[0,`&nvrArr;`],[0,`&nvHarr;`],[0,`&Map;`],[6,`&lbarr;`],[0,`&bkarow;`],[0,`&lBarr;`],[0,`&dbkarow;`],[0,`&drbkarow;`],[0,`&DDotrahd;`],[0,`&UpArrowBar;`],[0,`&DownArrowBar;`],[2,`&Rarrtl;`],[2,`&latail;`],[0,`&ratail;`],[0,`&lAtail;`],[0,`&rAtail;`],[0,`&larrfs;`],[0,`&rarrfs;`],[0,`&larrbfs;`],[0,`&rarrbfs;`],[2,`&nwarhk;`],[0,`&nearhk;`],[0,`&hksearow;`],[0,`&hkswarow;`],[0,`&nwnear;`],[0,`&nesear;`],[0,`&seswar;`],[0,`&swnwar;`],[8,{v:`&rarrc;`,n:824,o:`&nrarrc;`}],[1,`&cudarrr;`],[0,`&ldca;`],[0,`&rdca;`],[0,`&cudarrl;`],[0,`&larrpl;`],[2,`&curarrm;`],[0,`&cularrp;`],[7,`&rarrpl;`],[2,`&harrcir;`],[0,`&Uarrocir;`],[0,`&lurdshar;`],[0,`&ldrushar;`],[2,`&LeftRightVector;`],[0,`&RightUpDownVector;`],[0,`&DownLeftRightVector;`],[0,`&LeftUpDownVector;`],[0,`&LeftVectorBar;`],[0,`&RightVectorBar;`],[0,`&RightUpVectorBar;`],[0,`&RightDownVectorBar;`],[0,`&DownLeftVectorBar;`],[0,`&DownRightVectorBar;`],[0,`&LeftUpVectorBar;`],[0,`&LeftDownVectorBar;`],[0,`&LeftTeeVector;`],[0,`&RightTeeVector;`],[0,`&RightUpTeeVector;`],[0,`&RightDownTeeVector;`],[0,`&DownLeftTeeVector;`],[0,`&DownRightTeeVector;`],[0,`&LeftUpTeeVector;`],[0,`&LeftDownTeeVector;`],[0,`&lHar;`],[0,`&uHar;`],[0,`&rHar;`],[0,`&dHar;`],[0,`&luruhar;`],[0,`&ldrdhar;`],[0,`&ruluhar;`],[0,`&rdldhar;`],[0,`&lharul;`],[0,`&llhard;`],[0,`&rharul;`],[0,`&lrhard;`],[0,`&udhar;`],[0,`&duhar;`],[0,`&RoundImplies;`],[0,`&erarr;`],[0,`&simrarr;`],[0,`&larrsim;`],[0,`&rarrsim;`],[0,`&rarrap;`],[0,`&ltlarr;`],[1,`&gtrarr;`],[0,`&subrarr;`],[1,`&suplarr;`],[0,`&lfisht;`],[0,`&rfisht;`],[0,`&ufisht;`],[0,`&dfisht;`],[5,`&lopar;`],[0,`&ropar;`],[4,`&lbrke;`],[0,`&rbrke;`],[0,`&lbrkslu;`],[0,`&rbrksld;`],[0,`&lbrksld;`],[0,`&rbrkslu;`],[0,`&langd;`],[0,`&rangd;`],[0,`&lparlt;`],[0,`&rpargt;`],[0,`&gtlPar;`],[0,`&ltrPar;`],[3,`&vzigzag;`],[1,`&vangrt;`],[0,`&angrtvbd;`],[6,`&ange;`],[0,`&range;`],[0,`&dwangle;`],[0,`&uwangle;`],[0,`&angmsdaa;`],[0,`&angmsdab;`],[0,`&angmsdac;`],[0,`&angmsdad;`],[0,`&angmsdae;`],[0,`&angmsdaf;`],[0,`&angmsdag;`],[0,`&angmsdah;`],[0,`&bemptyv;`],[0,`&demptyv;`],[0,`&cemptyv;`],[0,`&raemptyv;`],[0,`&laemptyv;`],[0,`&ohbar;`],[0,`&omid;`],[0,`&opar;`],[1,`&operp;`],[1,`&olcross;`],[0,`&odsold;`],[1,`&olcir;`],[0,`&ofcir;`],[0,`&olt;`],[0,`&ogt;`],[0,`&cirscir;`],[0,`&cirE;`],[0,`&solb;`],[0,`&bsolb;`],[3,`&boxbox;`],[3,`&trisb;`],[0,`&rtriltri;`],[0,{v:`&LeftTriangleBar;`,n:824,o:`&NotLeftTriangleBar;`}],[0,{v:`&RightTriangleBar;`,n:824,o:`&NotRightTriangleBar;`}],[11,`&iinfin;`],[0,`&infintie;`],[0,`&nvinfin;`],[4,`&eparsl;`],[0,`&smeparsl;`],[0,`&eqvparsl;`],[5,`&blacklozenge;`],[8,`&RuleDelayed;`],[1,`&dsol;`],[9,`&bigodot;`],[0,`&bigoplus;`],[0,`&bigotimes;`],[1,`&biguplus;`],[1,`&bigsqcup;`],[5,`&iiiint;`],[0,`&fpartint;`],[2,`&cirfnint;`],[0,`&awint;`],[0,`&rppolint;`],[0,`&scpolint;`],[0,`&npolint;`],[0,`&pointint;`],[0,`&quatint;`],[0,`&intlarhk;`],[10,`&pluscir;`],[0,`&plusacir;`],[0,`&simplus;`],[0,`&plusdu;`],[0,`&plussim;`],[0,`&plustwo;`],[1,`&mcomma;`],[0,`&minusdu;`],[2,`&loplus;`],[0,`&roplus;`],[0,`&Cross;`],[0,`&timesd;`],[0,`&timesbar;`],[1,`&smashp;`],[0,`&lotimes;`],[0,`&rotimes;`],[0,`&otimesas;`],[0,`&Otimes;`],[0,`&odiv;`],[0,`&triplus;`],[0,`&triminus;`],[0,`&tritime;`],[0,`&intprod;`],[2,`&amalg;`],[0,`&capdot;`],[1,`&ncup;`],[0,`&ncap;`],[0,`&capand;`],[0,`&cupor;`],[0,`&cupcap;`],[0,`&capcup;`],[0,`&cupbrcap;`],[0,`&capbrcup;`],[0,`&cupcup;`],[0,`&capcap;`],[0,`&ccups;`],[0,`&ccaps;`],[2,`&ccupssm;`],[2,`&And;`],[0,`&Or;`],[0,`&andand;`],[0,`&oror;`],[0,`&orslope;`],[0,`&andslope;`],[1,`&andv;`],[0,`&orv;`],[0,`&andd;`],[0,`&ord;`],[1,`&wedbar;`],[6,`&sdote;`],[3,`&simdot;`],[2,{v:`&congdot;`,n:824,o:`&ncongdot;`}],[0,`&easter;`],[0,`&apacir;`],[0,{v:`&apE;`,n:824,o:`&napE;`}],[0,`&eplus;`],[0,`&pluse;`],[0,`&Esim;`],[0,`&Colone;`],[0,`&Equal;`],[1,`&ddotseq;`],[0,`&equivDD;`],[0,`&ltcir;`],[0,`&gtcir;`],[0,`&ltquest;`],[0,`&gtquest;`],[0,{v:`&leqslant;`,n:824,o:`&nleqslant;`}],[0,{v:`&geqslant;`,n:824,o:`&ngeqslant;`}],[0,`&lesdot;`],[0,`&gesdot;`],[0,`&lesdoto;`],[0,`&gesdoto;`],[0,`&lesdotor;`],[0,`&gesdotol;`],[0,`&lap;`],[0,`&gap;`],[0,`&lne;`],[0,`&gne;`],[0,`&lnap;`],[0,`&gnap;`],[0,`&lEg;`],[0,`&gEl;`],[0,`&lsime;`],[0,`&gsime;`],[0,`&lsimg;`],[0,`&gsiml;`],[0,`&lgE;`],[0,`&glE;`],[0,`&lesges;`],[0,`&gesles;`],[0,`&els;`],[0,`&egs;`],[0,`&elsdot;`],[0,`&egsdot;`],[0,`&el;`],[0,`&eg;`],[2,`&siml;`],[0,`&simg;`],[0,`&simlE;`],[0,`&simgE;`],[0,{v:`&LessLess;`,n:824,o:`&NotNestedLessLess;`}],[0,{v:`&GreaterGreater;`,n:824,o:`&NotNestedGreaterGreater;`}],[1,`&glj;`],[0,`&gla;`],[0,`&ltcc;`],[0,`&gtcc;`],[0,`&lescc;`],[0,`&gescc;`],[0,`&smt;`],[0,`&lat;`],[0,{v:`&smte;`,n:65024,o:`&smtes;`}],[0,{v:`&late;`,n:65024,o:`&lates;`}],[0,`&bumpE;`],[0,{v:`&PrecedesEqual;`,n:824,o:`&NotPrecedesEqual;`}],[0,{v:`&sce;`,n:824,o:`&NotSucceedsEqual;`}],[2,`&prE;`],[0,`&scE;`],[0,`&precneqq;`],[0,`&scnE;`],[0,`&prap;`],[0,`&scap;`],[0,`&precnapprox;`],[0,`&scnap;`],[0,`&Pr;`],[0,`&Sc;`],[0,`&subdot;`],[0,`&supdot;`],[0,`&subplus;`],[0,`&supplus;`],[0,`&submult;`],[0,`&supmult;`],[0,`&subedot;`],[0,`&supedot;`],[0,{v:`&subE;`,n:824,o:`&nsubE;`}],[0,{v:`&supE;`,n:824,o:`&nsupE;`}],[0,`&subsim;`],[0,`&supsim;`],[2,{v:`&subnE;`,n:65024,o:`&varsubsetneqq;`}],[0,{v:`&supnE;`,n:65024,o:`&varsupsetneqq;`}],[2,`&csub;`],[0,`&csup;`],[0,`&csube;`],[0,`&csupe;`],[0,`&subsup;`],[0,`&supsub;`],[0,`&subsub;`],[0,`&supsup;`],[0,`&suphsub;`],[0,`&supdsub;`],[0,`&forkv;`],[0,`&topfork;`],[0,`&mlcp;`],[8,`&Dashv;`],[1,`&Vdashl;`],[0,`&Barv;`],[0,`&vBar;`],[0,`&vBarv;`],[1,`&Vbar;`],[0,`&Not;`],[0,`&bNot;`],[0,`&rnmid;`],[0,`&cirmid;`],[0,`&midcir;`],[0,`&topcir;`],[0,`&nhpar;`],[0,`&parsim;`],[9,{v:`&parsl;`,n:8421,o:`&nparsl;`}],[44343,{n:new Map(t([[56476,`&Ascr;`],[1,`&Cscr;`],[0,`&Dscr;`],[2,`&Gscr;`],[2,`&Jscr;`],[0,`&Kscr;`],[2,`&Nscr;`],[0,`&Oscr;`],[0,`&Pscr;`],[0,`&Qscr;`],[1,`&Sscr;`],[0,`&Tscr;`],[0,`&Uscr;`],[0,`&Vscr;`],[0,`&Wscr;`],[0,`&Xscr;`],[0,`&Yscr;`],[0,`&Zscr;`],[0,`&ascr;`],[0,`&bscr;`],[0,`&cscr;`],[0,`&dscr;`],[1,`&fscr;`],[1,`&hscr;`],[0,`&iscr;`],[0,`&jscr;`],[0,`&kscr;`],[0,`&lscr;`],[0,`&mscr;`],[0,`&nscr;`],[1,`&pscr;`],[0,`&qscr;`],[0,`&rscr;`],[0,`&sscr;`],[0,`&tscr;`],[0,`&uscr;`],[0,`&vscr;`],[0,`&wscr;`],[0,`&xscr;`],[0,`&yscr;`],[0,`&zscr;`],[52,`&Afr;`],[0,`&Bfr;`],[1,`&Dfr;`],[0,`&Efr;`],[0,`&Ffr;`],[0,`&Gfr;`],[2,`&Jfr;`],[0,`&Kfr;`],[0,`&Lfr;`],[0,`&Mfr;`],[0,`&Nfr;`],[0,`&Ofr;`],[0,`&Pfr;`],[0,`&Qfr;`],[1,`&Sfr;`],[0,`&Tfr;`],[0,`&Ufr;`],[0,`&Vfr;`],[0,`&Wfr;`],[0,`&Xfr;`],[0,`&Yfr;`],[1,`&afr;`],[0,`&bfr;`],[0,`&cfr;`],[0,`&dfr;`],[0,`&efr;`],[0,`&ffr;`],[0,`&gfr;`],[0,`&hfr;`],[0,`&ifr;`],[0,`&jfr;`],[0,`&kfr;`],[0,`&lfr;`],[0,`&mfr;`],[0,`&nfr;`],[0,`&ofr;`],[0,`&pfr;`],[0,`&qfr;`],[0,`&rfr;`],[0,`&sfr;`],[0,`&tfr;`],[0,`&ufr;`],[0,`&vfr;`],[0,`&wfr;`],[0,`&xfr;`],[0,`&yfr;`],[0,`&zfr;`],[0,`&Aopf;`],[0,`&Bopf;`],[1,`&Dopf;`],[0,`&Eopf;`],[0,`&Fopf;`],[0,`&Gopf;`],[1,`&Iopf;`],[0,`&Jopf;`],[0,`&Kopf;`],[0,`&Lopf;`],[0,`&Mopf;`],[1,`&Oopf;`],[3,`&Sopf;`],[0,`&Topf;`],[0,`&Uopf;`],[0,`&Vopf;`],[0,`&Wopf;`],[0,`&Xopf;`],[0,`&Yopf;`],[1,`&aopf;`],[0,`&bopf;`],[0,`&copf;`],[0,`&dopf;`],[0,`&eopf;`],[0,`&fopf;`],[0,`&gopf;`],[0,`&hopf;`],[0,`&iopf;`],[0,`&jopf;`],[0,`&kopf;`],[0,`&lopf;`],[0,`&mopf;`],[0,`&nopf;`],[0,`&oopf;`],[0,`&popf;`],[0,`&qopf;`],[0,`&ropf;`],[0,`&sopf;`],[0,`&topf;`],[0,`&uopf;`],[0,`&vopf;`],[0,`&wopf;`],[0,`&xopf;`],[0,`&yopf;`],[0,`&zopf;`]]))}],[8906,`&fflig;`],[0,`&filig;`],[0,`&fllig;`],[0,`&ffilig;`],[0,`&ffllig;`]]))})),mv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.escapeText=e.escapeAttribute=e.escapeUTF8=e.escape=e.encodeXML=e.getCodePoint=e.xmlReplacer=void 0,e.xmlReplacer=/["&'<>$\x80-\uFFFF]/g;var t=new Map([[34,`&quot;`],[38,`&amp;`],[39,`&apos;`],[60,`&lt;`],[62,`&gt;`]]);e.getCodePoint=String.prototype.codePointAt==null?function(e,t){return(e.charCodeAt(t)&64512)==55296?(e.charCodeAt(t)-55296)*1024+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t)}:function(e,t){return e.codePointAt(t)};function n(n){for(var r=``,i=0,a;(a=e.xmlReplacer.exec(n))!==null;){var o=a.index,s=n.charCodeAt(o),c=t.get(s);c===void 0?(r+=`${n.substring(i,o)}&#x${(0,e.getCodePoint)(n,o).toString(16)};`,i=e.xmlReplacer.lastIndex+=Number((s&64512)==55296)):(r+=n.substring(i,o)+c,i=o+1)}return r+n.substr(i)}e.encodeXML=n,e.escape=n;function r(e,t){return function(n){for(var r,i=0,a=``;r=e.exec(n);)i!==r.index&&(a+=n.substring(i,r.index)),a+=t.get(r[0].charCodeAt(0)),i=r.index+1;return a+n.substring(i)}}e.escapeUTF8=r(/[&<>'"]/g,t),e.escapeAttribute=r(/["&\u00A0]/g,new Map([[34,`&quot;`],[38,`&amp;`],[160,`&nbsp;`]])),e.escapeText=r(/[&<>\u00A0]/g,new Map([[38,`&amp;`],[60,`&lt;`],[62,`&gt;`],[160,`&nbsp;`]]))})),hv=t((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.encodeNonAsciiHTML=e.encodeHTML=void 0;var n=t(pv()),r=mv(),i=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function a(e){return s(i,e)}e.encodeHTML=a;function o(e){return s(r.xmlReplacer,e)}e.encodeNonAsciiHTML=o;function s(e,t){for(var i=``,a=0,o;(o=e.exec(t))!==null;){var s=o.index;i+=t.substring(a,s);var c=t.charCodeAt(s),l=n.default.get(c);if(typeof l==`object`){if(s+1<t.length){var u=t.charCodeAt(s+1),d=typeof l.n==`number`?l.n===u?l.o:void 0:l.n.get(u);if(d!==void 0){i+=d,a=e.lastIndex+=1;continue}}l=l.v}if(l!==void 0)i+=l,a=s+1;else{var f=(0,r.getCodePoint)(t,s);i+=`&#x${f.toString(16)};`,a=e.lastIndex+=Number(f!==c)}}return i+t.substr(a)}})),gv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.decodeXMLStrict=e.decodeHTML5Strict=e.decodeHTML4Strict=e.decodeHTML5=e.decodeHTML4=e.decodeHTMLAttribute=e.decodeHTMLStrict=e.decodeHTML=e.decodeXML=e.DecodingMode=e.EntityDecoder=e.encodeHTML5=e.encodeHTML4=e.encodeNonAsciiHTML=e.encodeHTML=e.escapeText=e.escapeAttribute=e.escapeUTF8=e.escape=e.encodeXML=e.encode=e.decodeStrict=e.decode=e.EncodingMode=e.EntityLevel=void 0;var t=fv(),n=hv(),r=mv(),i;(function(e){e[e.XML=0]=`XML`,e[e.HTML=1]=`HTML`})(i=e.EntityLevel||={});var a;(function(e){e[e.UTF8=0]=`UTF8`,e[e.ASCII=1]=`ASCII`,e[e.Extensive=2]=`Extensive`,e[e.Attribute=3]=`Attribute`,e[e.Text=4]=`Text`})(a=e.EncodingMode||={});function o(e,n){if(n===void 0&&(n=i.XML),(typeof n==`number`?n:n.level)===i.HTML){var r=typeof n==`object`?n.mode:void 0;return(0,t.decodeHTML)(e,r)}return(0,t.decodeXML)(e)}e.decode=o;function s(e,n){n===void 0&&(n=i.XML);var r=typeof n==`number`?{level:n}:n;return r.mode??=t.DecodingMode.Strict,o(e,r)}e.decodeStrict=s;function c(e,t){t===void 0&&(t=i.XML);var o=typeof t==`number`?{level:t}:t;return o.mode===a.UTF8?(0,r.escapeUTF8)(e):o.mode===a.Attribute?(0,r.escapeAttribute)(e):o.mode===a.Text?(0,r.escapeText)(e):o.level===i.HTML?o.mode===a.ASCII?(0,n.encodeNonAsciiHTML)(e):(0,n.encodeHTML)(e):(0,r.encodeXML)(e)}e.encode=c;var l=mv();Object.defineProperty(e,"encodeXML",{enumerable:!0,get:function(){return l.encodeXML}}),Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return l.escape}}),Object.defineProperty(e,"escapeUTF8",{enumerable:!0,get:function(){return l.escapeUTF8}}),Object.defineProperty(e,"escapeAttribute",{enumerable:!0,get:function(){return l.escapeAttribute}}),Object.defineProperty(e,"escapeText",{enumerable:!0,get:function(){return l.escapeText}});var u=hv();Object.defineProperty(e,"encodeHTML",{enumerable:!0,get:function(){return u.encodeHTML}}),Object.defineProperty(e,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return u.encodeNonAsciiHTML}}),Object.defineProperty(e,"encodeHTML4",{enumerable:!0,get:function(){return u.encodeHTML}}),Object.defineProperty(e,"encodeHTML5",{enumerable:!0,get:function(){return u.encodeHTML}});var d=fv();Object.defineProperty(e,"EntityDecoder",{enumerable:!0,get:function(){return d.EntityDecoder}}),Object.defineProperty(e,"DecodingMode",{enumerable:!0,get:function(){return d.DecodingMode}}),Object.defineProperty(e,"decodeXML",{enumerable:!0,get:function(){return d.decodeXML}}),Object.defineProperty(e,"decodeHTML",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(e,"decodeHTMLStrict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTMLAttribute",{enumerable:!0,get:function(){return d.decodeHTMLAttribute}}),Object.defineProperty(e,"decodeHTML4",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(e,"decodeHTML5",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(e,"decodeHTML4Strict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTML5Strict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(e,"decodeXMLStrict",{enumerable:!0,get:function(){return d.decodeXML}})})),_v=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.attributeNames=e.elementNames=void 0,e.elementNames=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.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.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(function(e){return[e.toLowerCase(),e]})),e.attributeNames=new Map(`definitionURL.attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(function(e){return[e.toLowerCase(),e]}))})),vv=t((e=>{var t=e&&e.__assign||function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)},n=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t};Object.defineProperty(e,"__esModule",{value:!0}),e.render=void 0;var a=i(ov()),o=gv(),s=_v(),c=new Set([`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`]);function l(e){return e.replace(/"/g,`&quot;`)}function u(e,t){if(e){var n=(t.encodeEntities??t.decodeEntities)===!1?l:t.xmlMode||t.encodeEntities!==`utf8`?o.encodeXML:o.escapeAttribute;return Object.keys(e).map(function(r){var i=e[r]??``;return t.xmlMode===`foreign`&&(r=s.attributeNames.get(r)??r),!t.emptyAttrs&&!t.xmlMode&&i===``?r:`${r}="${n(i)}"`}).join(` `)}}var d=new Set([`area`,`base`,`basefont`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`img`,`input`,`isindex`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function f(e,t){t===void 0&&(t={});for(var n=(`length`in e)?e:[e],r=``,i=0;i<n.length;i++)r+=p(n[i],t);return r}e.render=f,e.default=f;function p(e,t){switch(e.type){case a.Root:return f(e.children,t);case a.Doctype:case a.Directive:return _(e);case a.Comment:return b(e);case a.CDATA:return y(e);case a.Script:case a.Style:case a.Tag:return g(e,t);case a.Text:return v(e,t)}}var m=new Set([`mi`,`mo`,`mn`,`ms`,`mtext`,`annotation-xml`,`foreignObject`,`desc`,`title`]),h=new Set([`svg`,`math`]);function g(e,n){n.xmlMode===`foreign`&&(e.name=s.elementNames.get(e.name)??e.name,e.parent&&m.has(e.parent.name)&&(n=t(t({},n),{xmlMode:!1}))),!n.xmlMode&&h.has(e.name)&&(n=t(t({},n),{xmlMode:`foreign`}));var r=`<${e.name}`,i=u(e.attribs,n);return i&&(r+=` ${i}`),e.children.length===0&&(n.xmlMode?n.selfClosingTags!==!1:n.selfClosingTags&&d.has(e.name))?(n.xmlMode||(r+=` `),r+=`/>`):(r+=`>`,e.children.length>0&&(r+=f(e.children,n)),(n.xmlMode||!d.has(e.name))&&(r+=`</${e.name}>`)),r}function _(e){return`<${e.data}>`}function v(e,t){var n=e.data||``;return(t.encodeEntities??t.decodeEntities)!==!1&&!(!t.xmlMode&&e.parent&&c.has(e.parent.name))&&(n=t.xmlMode||t.encodeEntities!==`utf8`?(0,o.encodeXML)(n):(0,o.escapeText)(n)),n}function y(e){return`<![CDATA[${e.children[0].data}]]>`}function b(e){return`<!--${e.data}-->`}})),yv=t((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.getOuterHTML=a,e.getInnerHTML=o,e.getText=s,e.textContent=c,e.innerText=l;var n=cv(),r=t(vv()),i=ov();function a(e,t){return(0,r.default)(e,t)}function o(e,t){return(0,n.hasChildren)(e)?e.children.map(function(e){return a(e,t)}).join(``):``}function s(e){return Array.isArray(e)?e.map(s).join(``):(0,n.isTag)(e)?e.name===`br`?`
131
- `:s(e.children):(0,n.isCDATA)(e)?s(e.children):(0,n.isText)(e)?e.data:``}function c(e){return Array.isArray(e)?e.map(c).join(``):(0,n.hasChildren)(e)&&!(0,n.isComment)(e)?c(e.children):(0,n.isText)(e)?e.data:``}function l(e){return Array.isArray(e)?e.map(l).join(``):(0,n.hasChildren)(e)&&(e.type===i.ElementType.Tag||(0,n.isCDATA)(e))?l(e.children):(0,n.isText)(e)?e.data:``}})),bv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getChildren=n,e.getParent=r,e.getSiblings=i,e.getAttributeValue=a,e.hasAttrib=o,e.getName=s,e.nextElementSibling=c,e.prevElementSibling=l;var t=cv();function n(e){return(0,t.hasChildren)(e)?e.children:[]}function r(e){return e.parent||null}function i(e){var t,i,a=r(e);if(a!=null)return n(a);for(var o=[e],s=e.prev,c=e.next;s!=null;)o.unshift(s),t=s,s=t.prev;for(;c!=null;)o.push(c),i=c,c=i.next;return o}function a(e,t){return e.attribs?.[t]}function o(e,t){return e.attribs!=null&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&e.attribs[t]!=null}function s(e){return e.name}function c(e){for(var n,r=e.next;r!==null&&!(0,t.isTag)(r);)n=r,r=n.next;return r}function l(e){for(var n,r=e.prev;r!==null&&!(0,t.isTag)(r);)n=r,r=n.prev;return r}})),xv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.removeElement=t,e.replaceElement=n,e.appendChild=r,e.append=i,e.prependChild=a,e.prepend=o;function t(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){var t=e.parent.children,n=t.lastIndexOf(e);n>=0&&t.splice(n,1)}e.next=null,e.prev=null,e.parent=null}function n(e,t){var n=t.prev=e.prev;n&&(n.next=t);var r=t.next=e.next;r&&(r.prev=t);var i=t.parent=e.parent;if(i){var a=i.children;a[a.lastIndexOf(e)]=t,e.parent=null}}function r(e,n){if(t(n),n.next=null,n.parent=e,e.children.push(n)>1){var r=e.children[e.children.length-2];r.next=n,n.prev=r}else n.prev=null}function i(e,n){t(n);var r=e.parent,i=e.next;if(n.next=i,n.prev=e,e.next=n,n.parent=r,i){if(i.prev=n,r){var a=r.children;a.splice(a.lastIndexOf(i),0,n)}}else r&&r.children.push(n)}function a(e,n){if(t(n),n.parent=e,n.prev=null,e.children.unshift(n)!==1){var r=e.children[1];r.prev=n,n.next=r}else n.next=null}function o(e,n){t(n);var r=e.parent;if(r){var i=r.children;i.splice(i.indexOf(e),0,n)}e.prev&&(e.prev.next=n),n.parent=r,n.prev=e.prev,n.next=e,e.prev=n}})),Sv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.filter=n,e.find=r,e.findOneChild=i,e.findOne=a,e.existsOne=o,e.findAll=s;var t=cv();function n(e,t,n,i){return n===void 0&&(n=!0),i===void 0&&(i=1/0),r(e,Array.isArray(t)?t:[t],n,i)}function r(e,n,r,i){for(var a=[],o=[Array.isArray(n)?n:[n]],s=[0];;){if(s[0]>=o[0].length){if(s.length===1)return a;o.shift(),s.shift();continue}var c=o[0][s[0]++];if(e(c)&&(a.push(c),--i<=0))return a;r&&(0,t.hasChildren)(c)&&c.children.length>0&&(s.unshift(0),o.unshift(c.children))}}function i(e,t){return t.find(e)}function a(e,n,r){r===void 0&&(r=!0);for(var i=Array.isArray(n)?n:[n],o=0;o<i.length;o++){var s=i[o];if((0,t.isTag)(s)&&e(s))return s;if(r&&(0,t.hasChildren)(s)&&s.children.length>0){var c=a(e,s.children,!0);if(c)return c}}return null}function o(e,n){return(Array.isArray(n)?n:[n]).some(function(n){return(0,t.isTag)(n)&&e(n)||(0,t.hasChildren)(n)&&o(e,n.children)})}function s(e,n){for(var r=[],i=[Array.isArray(n)?n:[n]],a=[0];;){if(a[0]>=i[0].length){if(i.length===1)return r;i.shift(),a.shift();continue}var o=i[0][a[0]++];(0,t.isTag)(o)&&e(o)&&r.push(o),(0,t.hasChildren)(o)&&o.children.length>0&&(a.unshift(0),i.unshift(o.children))}}})),Cv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.testElement=s,e.getElements=c,e.getElementById=l,e.getElementsByTagName=u,e.getElementsByClassName=d,e.getElementsByTagType=f;var t=cv(),n=Sv(),r={tag_name:function(e){return typeof e==`function`?function(n){return(0,t.isTag)(n)&&e(n.name)}:e===`*`?t.isTag:function(n){return(0,t.isTag)(n)&&n.name===e}},tag_type:function(e){return typeof e==`function`?function(t){return e(t.type)}:function(t){return t.type===e}},tag_contains:function(e){return typeof e==`function`?function(n){return(0,t.isText)(n)&&e(n.data)}:function(n){return(0,t.isText)(n)&&n.data===e}}};function i(e,n){return typeof n==`function`?function(r){return(0,t.isTag)(r)&&n(r.attribs[e])}:function(r){return(0,t.isTag)(r)&&r.attribs[e]===n}}function a(e,t){return function(n){return e(n)||t(n)}}function o(e){var t=Object.keys(e).map(function(t){var n=e[t];return Object.prototype.hasOwnProperty.call(r,t)?r[t](n):i(t,n)});return t.length===0?null:t.reduce(a)}function s(e,t){var n=o(e);return n?n(t):!0}function c(e,t,r,i){i===void 0&&(i=1/0);var a=o(e);return a?(0,n.filter)(a,t,r,i):[]}function l(e,t,r){return r===void 0&&(r=!0),Array.isArray(t)||(t=[t]),(0,n.findOne)(i(`id`,e),t,r)}function u(e,t,i,a){return i===void 0&&(i=!0),a===void 0&&(a=1/0),(0,n.filter)(r.tag_name(e),t,i,a)}function d(e,t,r,a){return r===void 0&&(r=!0),a===void 0&&(a=1/0),(0,n.filter)(i(`class`,e),t,r,a)}function f(e,t,i,a){return i===void 0&&(i=!0),a===void 0&&(a=1/0),(0,n.filter)(r.tag_type(e),t,i,a)}})),wv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DocumentPosition=void 0,e.removeSubsets=n,e.compareDocumentPosition=i,e.uniqueSort=a;var t=cv();function n(e){for(var t=e.length;--t>=0;){var n=e[t];if(t>0&&e.lastIndexOf(n,t-1)>=0){e.splice(t,1);continue}for(var r=n.parent;r;r=r.parent)if(e.includes(r)){e.splice(t,1);break}}return e}var r;(function(e){e[e.DISCONNECTED=1]=`DISCONNECTED`,e[e.PRECEDING=2]=`PRECEDING`,e[e.FOLLOWING=4]=`FOLLOWING`,e[e.CONTAINS=8]=`CONTAINS`,e[e.CONTAINED_BY=16]=`CONTAINED_BY`})(r||(e.DocumentPosition=r={}));function i(e,n){var i=[],a=[];if(e===n)return 0;for(var o=(0,t.hasChildren)(e)?e:e.parent;o;)i.unshift(o),o=o.parent;for(o=(0,t.hasChildren)(n)?n:n.parent;o;)a.unshift(o),o=o.parent;for(var s=Math.min(i.length,a.length),c=0;c<s&&i[c]===a[c];)c++;if(c===0)return r.DISCONNECTED;var l=i[c-1],u=l.children,d=i[c],f=a[c];return u.indexOf(d)>u.indexOf(f)?l===n?r.FOLLOWING|r.CONTAINED_BY:r.FOLLOWING:l===e?r.PRECEDING|r.CONTAINS:r.PRECEDING}function a(e){return e=e.filter(function(e,t,n){return!n.includes(e,t+1)}),e.sort(function(e,t){var n=i(e,t);return n&r.PRECEDING?-1:n&r.FOLLOWING?1:0}),e}})),Tv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getFeed=r;var t=yv(),n=Cv();function r(e){var t=l(f,e);return t?t.name===`feed`?i(t):a(t):null}function i(e){var t=e.children,r={type:`atom`,items:(0,n.getElementsByTagName)(`entry`,t).map(function(e){var t=e.children,n={media:c(t)};d(n,`id`,`id`,t),d(n,`title`,`title`,t);var r=l(`link`,t)?.attribs.href;r&&(n.link=r);var i=u(`summary`,t)||u(`content`,t);i&&(n.description=i);var a=u(`updated`,t);return a&&(n.pubDate=new Date(a)),n})};d(r,`id`,`id`,t),d(r,`title`,`title`,t);var i=l(`link`,t)?.attribs.href;i&&(r.link=i),d(r,`description`,`subtitle`,t);var a=u(`updated`,t);return a&&(r.updated=new Date(a)),d(r,`author`,`email`,t,!0),r}function a(e){var t=l(`channel`,e.children)?.children??[],r={type:e.name.substr(0,3),id:``,items:(0,n.getElementsByTagName)(`item`,e.children).map(function(e){var t=e.children,n={media:c(t)};d(n,`id`,`guid`,t),d(n,`title`,`title`,t),d(n,`link`,`link`,t),d(n,`description`,`description`,t);var r=u(`pubDate`,t)||u(`dc:date`,t);return r&&(n.pubDate=new Date(r)),n})};d(r,`title`,`title`,t),d(r,`link`,`link`,t),d(r,`description`,`description`,t);var i=u(`lastBuildDate`,t);return i&&(r.updated=new Date(i)),d(r,`author`,`managingEditor`,t,!0),r}var o=[`url`,`type`,`lang`],s=[`fileSize`,`bitrate`,`framerate`,`samplingrate`,`channels`,`duration`,`height`,`width`];function c(e){return(0,n.getElementsByTagName)(`media:content`,e).map(function(e){for(var t=e.attribs,n={medium:t.medium,isDefault:!!t.isDefault},r=0,i=o;r<i.length;r++){var a=i[r];t[a]&&(n[a]=t[a])}for(var c=0,l=s;c<l.length;c++){var a=l[c];t[a]&&(n[a]=parseInt(t[a],10))}return t.expression&&(n.expression=t.expression),n})}function l(e,t){return(0,n.getElementsByTagName)(e,t,!0,1)[0]}function u(e,r,i){return i===void 0&&(i=!1),(0,t.textContent)((0,n.getElementsByTagName)(e,r,i,1)).trim()}function d(e,t,n,r,i){i===void 0&&(i=!1);var a=u(n,r,i);a&&(e[t]=a)}function f(e){return e===`rss`||e===`feed`||e===`rdf:RDF`}})),Ev=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.hasChildren=e.isDocument=e.isComment=e.isText=e.isCDATA=e.isTag=void 0,n(yv(),e),n(bv(),e),n(xv(),e),n(Sv(),e),n(Cv(),e),n(wv(),e),n(Tv(),e);var r=cv();Object.defineProperty(e,"isTag",{enumerable:!0,get:function(){return r.isTag}}),Object.defineProperty(e,"isCDATA",{enumerable:!0,get:function(){return r.isCDATA}}),Object.defineProperty(e,"isText",{enumerable:!0,get:function(){return r.isText}}),Object.defineProperty(e,"isComment",{enumerable:!0,get:function(){return r.isComment}}),Object.defineProperty(e,"isDocument",{enumerable:!0,get:function(){return r.isDocument}}),Object.defineProperty(e,"hasChildren",{enumerable:!0,get:function(){return r.hasChildren}})})),Dv=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;o<a.length;o++)a[o]!=="default"&&t(i,r,a[o]);return n(i,r),i}})(),i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.DomUtils=e.getFeed=e.ElementType=e.QuoteType=e.Tokenizer=e.DefaultHandler=e.DomHandler=e.Parser=void 0,e.parseDocument=l,e.parseDOM=u,e.createDocumentStream=d,e.createDomStream=f,e.parseFeed=_;var a=av(),o=av();Object.defineProperty(e,"Parser",{enumerable:!0,get:function(){return o.Parser}});var s=cv(),c=cv();Object.defineProperty(e,"DomHandler",{enumerable:!0,get:function(){return c.DomHandler}}),Object.defineProperty(e,"DefaultHandler",{enumerable:!0,get:function(){return c.DomHandler}});function l(e,t){let n=new s.DomHandler(void 0,t);return new a.Parser(n,t).end(e),n.root}function u(e,t){return l(e,t).children}function d(e,t,n){let r=new s.DomHandler(t=>e(t,r.root),t,n);return new a.Parser(r,t)}function f(e,t,n){let r=new s.DomHandler(e,t,n);return new a.Parser(r,t)}var p=iv();Object.defineProperty(e,"Tokenizer",{enumerable:!0,get:function(){return i(p).default}}),Object.defineProperty(e,"QuoteType",{enumerable:!0,get:function(){return p.QuoteType}}),e.ElementType=r(ov());var m=Ev(),h=Ev();Object.defineProperty(e,"getFeed",{enumerable:!0,get:function(){return h.getFeed}});var g={xmlMode:!0};function _(e,t=g){return(0,m.getFeed)(u(e,t))}e.DomUtils=r(Ev())})),Ov=t(((e,t)=>{t.exports=e=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}})),kv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){return Object.prototype.toString.call(e)===`[object Object]`}function n(e){var n,r;return t(e)===!1?!1:(n=e.constructor,n===void 0?!0:(r=n.prototype,!(t(r)===!1||r.hasOwnProperty(`isPrototypeOf`)===!1)))}e.isPlainObject=n})),Av=t(((e,t)=>{var n=function(e){return r(e)&&!i(e)};function r(e){return!!e&&typeof e==`object`}function i(e){var t=Object.prototype.toString.call(e);return t===`[object RegExp]`||t===`[object Date]`||o(e)}var a=typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.element`):60103;function o(e){return e.$$typeof===a}function s(e){return Array.isArray(e)?[]:{}}function c(e,t){return t.clone!==!1&&t.isMergeableObject(e)?g(s(e),e,t):e}function l(e,t,n){return e.concat(t).map(function(e){return c(e,n)})}function u(e,t){if(!t.customMerge)return g;var n=t.customMerge(e);return typeof n==`function`?n:g}function d(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function f(e){return Object.keys(e).concat(d(e))}function p(e,t){try{return t in e}catch{return!1}}function m(e,t){return p(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function h(e,t,n){var r={};return n.isMergeableObject(e)&&f(e).forEach(function(t){r[t]=c(e[t],n)}),f(t).forEach(function(i){m(e,i)||(p(e,i)&&n.isMergeableObject(t[i])?r[i]=u(i,n)(e[i],t[i],n):r[i]=c(t[i],n))}),r}function g(e,t,r){r||={},r.arrayMerge=r.arrayMerge||l,r.isMergeableObject=r.isMergeableObject||n,r.cloneUnlessOtherwiseSpecified=c;var i=Array.isArray(t);return i===Array.isArray(e)?i?r.arrayMerge(e,t,r):h(e,t,r):c(t,r)}g.all=function(e,t){if(!Array.isArray(e))throw Error(`first argument should be an array`);return e.reduce(function(e,n){return g(e,n,t)},{})},t.exports=g})),jv=t(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define([],n):typeof t==`object`&&t.exports?t.exports=n():e.parseSrcset=n()})(e,function(){return function(e){function t(e){return e===` `||e===` `||e===`
132
- `||e===`\f`||e===`\r`}function n(t){var n,r=t.exec(e.substring(h));if(r)return n=r[0],h+=n.length,n}for(var r=e.length,i=/^[ \t\n\r\u000c]+/,a=/^[, \t\n\r\u000c]+/,o=/^[^ \t\n\r\u000c]+/,s=/[,]+$/,c=/^\d+$/,l=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,u,d,f,p,m,h=0,g=[];;){if(n(a),h>=r)return g;u=n(o),d=[],u.slice(-1)===`,`?(u=u.replace(s,``),v()):_()}function _(){for(n(i),f=``,p=`in descriptor`;;){if(m=e.charAt(h),p===`in descriptor`)if(t(m))f&&(d.push(f),f=``,p=`after descriptor`);else if(m===`,`){h+=1,f&&d.push(f),v();return}else if(m===`(`)f+=m,p=`in parens`;else if(m===``){f&&d.push(f),v();return}else f+=m;else if(p===`in parens`)if(m===`)`)f+=m,p=`in descriptor`;else if(m===``){d.push(f),v();return}else f+=m;else if(p===`after descriptor`&&!t(m))if(m===``){v();return}else p=`in descriptor`,--h;h+=1}}function v(){var t=!1,n,r,i,a,o={},s,f,p,m,h;for(a=0;a<d.length;a++)s=d[a],f=s[s.length-1],p=s.substring(0,s.length-1),m=parseInt(p,10),h=parseFloat(p),c.test(p)&&f===`w`?((n||r)&&(t=!0),m===0?t=!0:n=m):l.test(p)&&f===`x`?((n||r||i)&&(t=!0),h<0?t=!0:r=h):c.test(p)&&f===`h`?((i||r)&&(t=!0),m===0?t=!0:i=m):t=!0;t?console&&console.log&&console.log(`Invalid srcset descriptor found in '`+e+`' at '`+s+`'.`):(o.url=u,n&&(o.w=n),r&&(o.d=r),i&&(o.h=i),g.push(o))}}})})),Mv=t(((e,t)=>{var n=String,r=function(){return{isColorSupported:!1,reset:n,bold:n,dim:n,italic:n,underline:n,inverse:n,hidden:n,strikethrough:n,black:n,red:n,green:n,yellow:n,blue:n,magenta:n,cyan:n,white:n,gray:n,bgBlack:n,bgRed:n,bgGreen:n,bgYellow:n,bgBlue:n,bgMagenta:n,bgCyan:n,bgWhite:n,blackBright:n,redBright:n,greenBright:n,yellowBright:n,blueBright:n,magentaBright:n,cyanBright:n,whiteBright:n,bgBlackBright:n,bgRedBright:n,bgGreenBright:n,bgYellowBright:n,bgBlueBright:n,bgMagentaBright:n,bgCyanBright:n,bgWhiteBright:n}};t.exports=r(),t.exports.createColors=r})),Nv=t(((e,t)=>{t.exports={}})),Pv=t(((e,t)=>{var n=Mv(),r=Nv(),i=class e extends Error{constructor(t,n,r,i,a,o){super(t),this.name=`CssSyntaxError`,this.reason=t,a&&(this.file=a),i&&(this.source=i),o&&(this.plugin=o),n!==void 0&&r!==void 0&&(typeof n==`number`?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+`: `:``,this.message+=this.file?this.file:`<css input>`,this.line!==void 0&&(this.message+=`:`+this.line+`:`+this.column),this.message+=`: `+this.reason}showSourceCode(e){if(!this.source)return``;let t=this.source;e??=n.isColorSupported;let i=e=>e,a=e=>e,o=e=>e;if(e){let{bold:e,gray:t,red:s}=n.createColors(!0);a=t=>e(s(t)),i=e=>t(e),r&&(o=e=>r(e))}let s=t.split(/\r?\n/),c=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;return s.slice(c,l).map((e,t)=>{let n=c+1+t,r=` `+(` `+n).slice(-u)+` | `;if(n===this.line){if(e.length>160){let t=Math.max(0,this.column-20),n=Math.max(this.column+20,this.endColumn+20),s=e.slice(t,n),c=i(r.replace(/\d/g,` `))+e.slice(0,Math.min(this.column-1,19)).replace(/[^\t]/g,` `);return a(`>`)+i(r)+o(s)+`
129
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${H_(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=U_(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+H_(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=U_(e);if(i===null)return H_(n);e=i;let a=`<img src="${e}" alt="${H_(n)}"`;return t&&(a+=` title="${H_(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:H_(e.text)}},$_=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},ev=class e{options;renderer;textRenderer;constructor(e){this.options=e||Eg,this.options.renderer=this.options.renderer||new Q_,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $_}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},tv=class{options;block;constructor(e){this.options=e||Eg}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Z_.lex:Z_.lexInline}provideParser(){return this.block?ev.parse:ev.parseInline}},nv=class{defaults=Tg();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ev;Renderer=Q_;TextRenderer=$_;Lexer=Z_;Tokenizer=X_;Hooks=tv;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Q_(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new X_(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new tv;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];tv.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&tv.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Z_.lex(e,t??this.defaults)}parser(e,t){return ev.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?Z_.lex:Z_.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?ev.parse:ev.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?Z_.lex:Z_.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?ev.parse:ev.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
130
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+H_(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},rv=new nv;function iv(e,t){return rv.parse(e,t)}iv.options=iv.setOptions=function(e){return rv.setOptions(e),iv.defaults=rv.defaults,Dg(iv.defaults),iv},iv.getDefaults=Tg,iv.defaults=Eg,iv.use=function(...e){return rv.use(...e),iv.defaults=rv.defaults,Dg(iv.defaults),iv},iv.walkTokens=function(e,t){return rv.walkTokens(e,t)},iv.parseInline=rv.parseInline,iv.Parser=ev,iv.parser=ev.parse,iv.Renderer=Q_,iv.TextRenderer=$_,iv.Lexer=Z_,iv.lexer=Z_.lex,iv.Tokenizer=X_,iv.Hooks=tv,iv.parse=iv,iv.options,iv.setOptions,iv.use,iv.walkTokens,iv.parseInline,ev.parse,Z_.lex;var av=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fromCodePoint=void 0,e.replaceCodePoint=n,e.decodeCodePoint=r;var t=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]]);e.fromCodePoint=String.fromCodePoint??(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 n(e){return e>=55296&&e<=57343||e>1114111?65533:t.get(e)??e}function r(t){return(0,e.fromCodePoint)(n(t))}})),ov=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.decodeBase64=t;function t(e){let t=typeof atob==`function`?atob(e):typeof Buffer.from==`function`?Buffer.from(e,`base64`).toString(`binary`):new Buffer(e,`base64`).toString(`binary`),n=t.length&-2,r=new Uint16Array(n/2);for(let e=0,i=0;e<n;e+=2){let n=t.charCodeAt(e),a=t.charCodeAt(e+1);r[i++]=n|a<<8}return r}})),sv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.htmlDecodeTree=void 0,e.htmlDecodeTree=(0,ov().decodeBase64)(`QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXEAAKBOIgAHSE9hY2RlZmhpbG9yc3UXARoBHwE6AVIBVQFiAWQBZgGCAakB6QHtAfIBYwB5ACdkUABZADuAqQCpQIABY3B5ACUBKAE1AfUhdGUGYWmg0iJ0KGFsRGlmZmVyZW50aWFsRAAAoEUhbCJleXMAAKAtIQACYWVpb0EBRAFKAU0B8iFvbgxhZABpAGwAO4DHAMdAcgBjAAhhbiJpbnQAAKAwIm8AdAAKYQABZG5ZAV0BaSJsbGEAuGB0I2VyRG90ALdg8gA5AWkAp2NyImNsZQAAAkRNUFRwAXQBeQF9AW8AdAAAoJkiaSJudXMAAKCWIuwhdXMAoJUiaSJtZXMAAKCXIm8AAAFjc4cBlAFrKndpc2VDb250b3VySW50ZWdyYWwAAKAyImUjQ3VybHkAAAFEUZwBpAFvJXVibGVRdW90ZQAAoB0gdSJvdGUAAKAZIAACbG5wdbABtgHNAdgBbwBuAGWgNyIAoHQqgAFnaXQAvAHBAcUB8iJ1ZW50AKBhIm4AdAAAoC8i7yV1ckludGVncmFsAKAuIgABZnLRAdMBAKACIe8iZHVjdACgECJuLnRlckNsb2Nrd2lzZUNvbnRvdXJJbnRlZ3JhbAAAoDMi7yFzcwCgLypjAHIAAOA12J7ccABDoNMiYQBwAACgTSKABURKU1phY2VmaW9zAAsCEgIVAhgCGwIsAjQCOQI9AnMCfwNvoEUh9CJyYWhkAKARKWMAeQACZGMAeQAFZGMAeQAPZIABZ3JzACECJQIoAuchZXIAoCEgcgAAoKEhaAB2AACg5CoAAWF5MAIzAvIhb24OYRRkbAB0oAciYQCUY3IAAOA12AfdAAFhZkECawIAAWNtRQJnAvIjaXRpY2FsAAJBREdUUAJUAl8CYwJjInV0ZQC0YG8AdAFZAloC2WJiJGxlQWN1dGUA3WJyImF2ZQBgYGkibGRlANxi7yFuZACgxCJmJWVyZW50aWFsRAAAoEYhcAR9AgAAAAAAAIECjgIAABoDZgAA4DXYO91EoagAhQKJAm8AdAAAoNwgcSJ1YWwAAKBQIuIhbGUAA0NETFJVVpkCqAK1Au8C/wIRA28AbgB0AG8AdQByAEkAbgB0AGUAZwByAGEA7ADEAW8AdAKvAgAAAACwAqhgbiNBcnJvdwAAoNMhAAFlb7kC0AJmAHQAgAFBUlQAwQLGAs0CciJyb3cAAKDQIekkZ2h0QXJyb3cAoNQhZQDlACsCbgBnAAABTFLWAugC5SFmdAABQVLcAuECciJyb3cAAKD4J+kkZ2h0QXJyb3cAoPon6SRnaHRBcnJvdwCg+SdpImdodAAAAUFU9gL7AnIicm93AACg0iFlAGUAAKCoInAAQQIGAwAAAAALA3Iicm93AACg0SFvJHduQXJyb3cAAKDVIWUlcnRpY2FsQmFyAACgJSJuAAADQUJMUlRhJAM2AzoDWgNxA3oDciJyb3cAAKGTIUJVLAMwA2EAcgAAoBMpcCNBcnJvdwAAoPUhciJldmUAEWPlIWZ00gJDAwAASwMAAFIDaSVnaHRWZWN0b3IAAKBQKWUkZVZlY3RvcgAAoF4p5SJjdG9yQqC9IWEAcgAAoFYpaSJnaHQA1AFiAwAAaQNlJGVWZWN0b3IAAKBfKeUiY3RvckKgwSFhAHIAAKBXKWUAZQBBoKQiciJyb3cAAKCnIXIAcgBvAPcAtAIAAWN0gwOHA3IAAOA12J/c8iFvaxBhAAhOVGFjZGZnbG1vcHFzdHV4owOlA6kDsAO/A8IDxgPNA9ID8gP9AwEEFAQeBCAEJQRHAEphSAA7gNAA0EBjAHUAdABlADuAyQDJQIABYWl5ALYDuQO+A/Ihb24aYXIAYwA7gMoAykAtZG8AdAAWYXIAAOA12AjdcgBhAHYAZQA7gMgAyEDlIm1lbnQAoAgiAAFhcNYD2QNjAHIAEmF0AHkAUwLhAwAAAADpA20lYWxsU3F1YXJlAACg+yVlJ3J5U21hbGxTcXVhcmUAAKCrJQABZ3D2A/kDbwBuABhhZgAA4DXYPN3zImlsb26VY3UAAAFhaQYEDgRsAFSgdSppImxkZQAAoEIi7CNpYnJpdW0AoMwhAAFjaRgEGwRyAACgMCFtAACgcyphAJdjbQBsADuAywDLQAABaXApBC0E8yF0cwCgAyLvJG5lbnRpYWxFAKBHIYACY2Zpb3MAPQQ/BEMEXQRyBHkAJGRyAADgNdgJ3WwibGVkAFMCTAQAAAAAVARtJWFsbFNxdWFyZQAAoPwlZSdyeVNtYWxsU3F1YXJlAACgqiVwA2UEAABpBAAAAABtBGYAAOA12D3dwSFsbACgACLyI2llcnRyZgCgMSFjAPIAcQQABkpUYWJjZGZnb3JzdIgEiwSOBJMElwSkBKcEqwStBLIE5QTqBGMAeQADZDuAPgA+QO0hbWFkoJMD3GNyImV2ZQAeYYABZWl5AJ0EoASjBOQhaWwiYXIAYwAcYRNkbwB0ACBhcgAA4DXYCt0AoNkicABmAADgNdg+3eUiYXRlcgADRUZHTFNUvwTIBM8E1QTZBOAEcSJ1YWwATKBlIuUhc3MAoNsidSRsbEVxdWFsAACgZyJyI2VhdGVyAACgoirlIXNzAKB3IuwkYW50RXF1YWwAoH4qaSJsZGUAAKBzImMAcgAA4DXYotwAoGsiAARBYWNmaW9zdfkE/QQFBQgFCwUTBSIFKwVSIkRjeQAqZAABY3QBBQQFZQBrAMdiXmDpIXJjJGFyAACgDCFsJWJlcnRTcGFjZQAAoAsh8AEYBQAAGwVmAACgDSHpJXpvbnRhbExpbmUAoAAlAAFjdCYFKAXyABIF8iFvayZhbQBwAEQBMQU5BW8AdwBuAEgAdQBtAPAAAAFxInVhbAAAoE8iAAdFSk9hY2RmZ21ub3N0dVMFVgVZBVwFYwVtBXAFcwV6BZAFtgXFBckFzQVjAHkAFWTsIWlnMmFjAHkAAWRjAHUAdABlADuAzQDNQAABaXlnBWwFcgBjADuAzgDOQBhkbwB0ADBhcgAAoBEhcgBhAHYAZQA7gMwAzEAAoREhYXB/BYsFAAFjZ4MFhQVyACphaSNuYXJ5SQAAoEghbABpAGUA8wD6AvQBlQUAAKUFZaAsIgABZ3KaBZ4F8iFhbACgKyLzI2VjdGlvbgCgwiJpI3NpYmxlAAABQ1SsBbEFbyJtbWEAAKBjIGkibWVzAACgYiCAAWdwdAC8Bb8FwwVvAG4ALmFmAADgNdhA3WEAmWNjAHIAAKAQIWkibGRlAChh6wHSBQAA1QVjAHkABmRsADuAzwDPQIACY2Zvc3UA4QXpBe0F8gX9BQABaXnlBegFcgBjADRhGWRyAADgNdgN3XAAZgAA4DXYQd3jAfcFAAD7BXIAAOA12KXc8iFjeQhk6yFjeQRkgANISmFjZm9zAAwGDwYSBhUGHQYhBiYGYwB5ACVkYwB5AAxk8CFwYZpjAAFleRkGHAbkIWlsNmEaZHIAAOA12A7dcABmAADgNdhC3WMAcgAA4DXYptyABUpUYWNlZmxtb3N0AD0GQAZDBl4GawZkB2gHcAd0B80H2gdjAHkACWQ7gDwAPECAAmNtbnByAEwGTwZSBlUGWwb1IXRlOWHiIWRhm2NnAACg6ifsI2FjZXRyZgCgEiFyAACgniGAAWFleQBkBmcGagbyIW9uPWHkIWlsO2EbZAABZnNvBjQHdAAABUFDREZSVFVWYXKABp4GpAbGBssG3AYDByEHwQIqBwABbnKEBowGZyVsZUJyYWNrZXQAAKDoJ/Ihb3cAoZAhQlKTBpcGYQByAACg5CHpJGdodEFycm93AKDGIWUjaWxpbmcAAKAII28A9QGqBgAAsgZiJWxlQnJhY2tldAAAoOYnbgDUAbcGAAC+BmUkZVZlY3RvcgAAoGEp5SJjdG9yQqDDIWEAcgAAoFkpbCJvb3IAAKAKI2kiZ2h0AAABQVbSBtcGciJyb3cAAKCUIeUiY3RvcgCgTikAAWVy4AbwBmUAAKGjIkFW5gbrBnIicm93AACgpCHlImN0b3IAoFopaSNhbmdsZQBCorIi+wYAAAAA/wZhAHIAAKDPKXEidWFsAACgtCJwAIABRFRWAAoHEQcYB+8kd25WZWN0b3IAoFEpZSRlVmVjdG9yAACgYCnlImN0b3JCoL8hYQByAACgWCnlImN0b3JCoLwhYQByAACgUilpAGcAaAB0AGEAcgByAG8A9wDMAnMAAANFRkdMU1Q/B0cHTgdUB1gHXwfxJXVhbEdyZWF0ZXIAoNoidSRsbEVxdWFsAACgZiJyI2VhdGVyAACgdiLlIXNzAKChKuwkYW50RXF1YWwAoH0qaSJsZGUAAKByInIAAOA12A/dZaDYIuYjdGFycm93AKDaIWkiZG90AD9hgAFucHcAege1B7kHZwAAAkxSbHKCB5QHmwerB+UhZnQAAUFSiAeNB3Iicm93AACg9SfpJGdodEFycm93AKD3J+kkZ2h0QXJyb3cAoPYn5SFmdAABYXLcAqEHaQBnAGgAdABhAHIAcgBvAPcA5wJpAGcAaAB0AGEAcgByAG8A9wDuAmYAAOA12EPdZQByAAABTFK/B8YHZSRmdEFycm93AACgmSHpJGdodEFycm93AKCYIYABY2h0ANMH1QfXB/IAWgYAoLAh8iFva0FhAKBqIgAEYWNlZmlvc3XpB+wH7gf/BwMICQgOCBEIcAAAoAUpeQAcZAABZGzyB/kHaSR1bVNwYWNlAACgXyBsI2ludHJmAACgMyFyAADgNdgQ3e4jdXNQbHVzAKATInAAZgAA4DXYRN1jAPIA/gecY4AESmFjZWZvc3R1ACEIJAgoCDUIgQiFCDsKQApHCmMAeQAKZGMidXRlAENhgAFhZXkALggxCDQI8iFvbkdh5CFpbEVhHWSAAWdzdwA7CGEIfQjhInRpdmWAAU1UVgBECEwIWQhlJWRpdW1TcGFjZQAAoAsgaABpAAABY25SCFMIawBTAHAAYQBjAOUASwhlAHIAeQBUAGgAaQDuAFQI9CFlZAABR0xnCHUIcgBlAGEAdABlAHIARwByAGUAYQB0AGUA8gDrBGUAcwBzAEwAZQBzAPMA2wdMImluZQAKYHIAAOA12BHdAAJCbnB0jAiRCJkInAhyImVhawAAoGAgwiZyZWFraW5nU3BhY2WgYGYAAKAVIUOq7CqzCMIIzQgAAOcIGwkAAAAAAAAtCQAAbwkAAIcJAACdCcAJGQoAADQKAAFvdbYIvAjuI2dydWVudACgYiJwIkNhcAAAoG0ibyh1YmxlVmVydGljYWxCYXIAAKAmIoABbHF4ANII1wjhCOUibWVudACgCSL1IWFsVKBgImkibGRlAADgQiI4A2kic3RzAACgBCJyI2VhdGVyAACjbyJFRkdMU1T1CPoIAgkJCQ0JFQlxInVhbAAAoHEidSRsbEVxdWFsAADgZyI4A3IjZWF0ZXIAAOBrIjgD5SFzcwCgeSLsJGFudEVxdWFsAOB+KjgDaSJsZGUAAKB1IvUhbXBEASAJJwnvI3duSHVtcADgTiI4A3EidWFsAADgTyI4A2UAAAFmczEJRgn0JFRyaWFuZ2xlQqLqIj0JAAAAAEIJYQByAADgzyk4A3EidWFsAACg7CJzAICibiJFR0xTVABRCVYJXAlhCWkJcSJ1YWwAAKBwInIjZWF0ZXIAAKB4IuUhc3MA4GoiOAPsJGFudEVxdWFsAOB9KjgDaSJsZGUAAKB0IuUic3RlZAABR0x1CX8J8iZlYXRlckdyZWF0ZXIA4KIqOAPlI3NzTGVzcwDgoSo4A/IjZWNlZGVzAKGAIkVTjwmVCXEidWFsAADgryo4A+wkYW50RXF1YWwAoOAiAAFlaaAJqQl2JmVyc2VFbGVtZW50AACgDCLnJWh0VHJpYW5nbGVCousitgkAAAAAuwlhAHIAAODQKTgDcSJ1YWwAAKDtIgABcXXDCeAJdSNhcmVTdQAAAWJwywnVCfMhZXRF4I8iOANxInVhbAAAoOIi5SJyc2V0ReCQIjgDcSJ1YWwAAKDjIoABYmNwAOYJ8AkNCvMhZXRF4IIi0iBxInVhbAAAoIgi4yJlZWRzgKGBIkVTVAD6CQAKBwpxInVhbAAA4LAqOAPsJGFudEVxdWFsAKDhImkibGRlAADgfyI4A+UicnNldEXggyLSIHEidWFsAACgiSJpImxkZQCAoUEiRUZUACIKJwouCnEidWFsAACgRCJ1JGxsRXF1YWwAAKBHImkibGRlAACgSSJlJXJ0aWNhbEJhcgAAoCQiYwByAADgNdip3GkAbABkAGUAO4DRANFAnWMAB0VhY2RmZ21vcHJzdHV2XgphCmgKcgp2CnoKgQqRCpYKqwqtCrsKyArNCuwhaWdSYWMAdQB0AGUAO4DTANNAAAFpeWwKcQpyAGMAO4DUANRAHmRiImxhYwBQYXIAAOA12BLdcgBhAHYAZQA7gNIA0kCAAWFlaQCHCooKjQpjAHIATGFnAGEAqWNjInJvbgCfY3AAZgAA4DXYRt3lI25DdXJseQABRFGeCqYKbyV1YmxlUXVvdGUAAKAcIHUib3RlAACgGCAAoFQqAAFjbLEKtQpyAADgNdiq3GEAcwBoADuA2ADYQGkAbAHACsUKZABlADuA1QDVQGUAcwAAoDcqbQBsADuA1gDWQGUAcgAAAUJQ0wrmCgABYXLXCtoKcgAAoD4gYQBjAAABZWvgCuIKAKDeI2UAdAAAoLQjYSVyZW50aGVzaXMAAKDcI4AEYWNmaGlsb3JzAP0KAwsFCwkLCwsMCxELIwtaC3IjdGlhbEQAAKACInkAH2RyAADgNdgT3WkApmOgY/Ujc01pbnVzsWAAAWlwFQsgC24AYwBhAHIAZQBwAGwAYQBuAOUACgVmAACgGSGAobsqZWlvACoLRQtJC+MiZWRlc4CheiJFU1QANAs5C0ALcSJ1YWwAAKCvKuwkYW50RXF1YWwAoHwiaSJsZGUAAKB+Im0AZQAAoDMgAAFkcE0LUQv1IWN0AKAPIm8jcnRpb24AYaA3ImwAAKAdIgABY2leC2ILcgAA4DXYq9yoYwACVWZvc2oLbwtzC3cLTwBUADuAIgAiQHIAAOA12BTdcABmAACgGiFjAHIAAOA12KzcAAZCRWFjZWZoaW9yc3WPC5MLlwupC7YL2AvbC90LhQyTDJoMowzhIXJyAKAQKUcAO4CuAK5AgAFjbnIAnQugC6ML9SF0ZVRhZwAAoOsncgB0oKAhbAAAoBYpgAFhZXkArwuyC7UL8iFvblhh5CFpbFZhIGR2oBwhZSJyc2UAAAFFVb8LzwsAAWxxwwvIC+UibWVudACgCyL1JGlsaWJyaXVtAKDLIXAmRXF1aWxpYnJpdW0AAKBvKXIAAKAcIW8AoWPnIWh0AARBQ0RGVFVWYewLCgwQDDIMNwxeDHwM9gIAAW5y8Av4C2clbGVCcmFja2V0AACg6SfyIW93AKGSIUJM/wsDDGEAcgAAoOUhZSRmdEFycm93AACgxCFlI2lsaW5nAACgCSNvAPUBFgwAAB4MYiVsZUJyYWNrZXQAAKDnJ24A1AEjDAAAKgxlJGVWZWN0b3IAAKBdKeUiY3RvckKgwiFhAHIAAKBVKWwib29yAACgCyMAAWVyOwxLDGUAAKGiIkFWQQxGDHIicm93AACgpiHlImN0b3IAoFspaSNhbmdsZQBCorMiVgwAAAAAWgxhAHIAAKDQKXEidWFsAACgtSJwAIABRFRWAGUMbAxzDO8kd25WZWN0b3IAoE8pZSRlVmVjdG9yAACgXCnlImN0b3JCoL4hYQByAACgVCnlImN0b3JCoMAhYQByAACgUykAAXB1iQyMDGYAAKAdIe4kZEltcGxpZXMAoHAp6SRnaHRhcnJvdwCg2yEAAWNongyhDHIAAKAbIQCgsSHsJGVEZWxheWVkAKD0KYAGSE9hY2ZoaW1vcXN0dQC/DMgMzAzQDOIM5gwKDQ0NFA0ZDU8NVA1YDQABQ2PDDMYMyCFjeSlkeQAoZEYiVGN5ACxkYyJ1dGUAWmEAorwqYWVpedgM2wzeDOEM8iFvbmBh5CFpbF5hcgBjAFxhIWRyAADgNdgW3e8hcnQAAkRMUlXvDPYM/QwEDW8kd25BcnJvdwAAoJMhZSRmdEFycm93AACgkCHpJGdodEFycm93AKCSIXAjQXJyb3cAAKCRIechbWGjY+EkbGxDaXJjbGUAoBgicABmAADgNdhK3XICHw0AAAAAIg10AACgGiLhIXJlgKGhJUlTVQAqDTINSg3uJXRlcnNlY3Rpb24AoJMidQAAAWJwNw1ADfMhZXRFoI8icSJ1YWwAAKCRIuUicnNldEWgkCJxInVhbAAAoJIibiJpb24AAKCUImMAcgAA4DXYrtxhAHIAAKDGIgACYmNtcF8Nag2ODZANc6DQImUAdABFoNAicSJ1YWwAAKCGIgABY2huDYkNZSJlZHMAgKF7IkVTVAB4DX0NhA1xInVhbAAAoLAq7CRhbnRFcXVhbACgfSJpImxkZQAAoH8iVABoAGEA9ADHCwCgESIAodEiZXOVDZ8NciJzZXQARaCDInEidWFsAACghyJlAHQAAKDRIoAFSFJTYWNmaGlvcnMAtQ27Db8NyA3ODdsN3w3+DRgOHQ4jDk8AUgBOADuA3gDeQMEhREUAoCIhAAFIY8MNxg1jAHkAC2R5ACZkAAFidcwNzQ0JYKRjgAFhZXkA1A3XDdoN8iFvbmRh5CFpbGJhImRyAADgNdgX3QABZWnjDe4N8gHoDQAA7Q3lImZvcmUAoDQiYQCYYwABY27yDfkNayNTcGFjZQAA4F8gCiDTInBhY2UAoAkg7CFkZYChPCJFRlQABw4MDhMOcSJ1YWwAAKBDInUkbGxFcXVhbAAAoEUiaSJsZGUAAKBIInAAZgAA4DXYS93pI3BsZURvdACg2yAAAWN0Jw4rDnIAAOA12K/c8iFva2Zh4QpFDlYOYA5qDgAAbg5yDgAAAAAAAAAAAAB5DnwOqA6zDgAADg8RDxYPGg8AAWNySA5ODnUAdABlADuA2gDaQHIAb6CfIeMhaXIAoEkpcgDjAVsOAABdDnkADmR2AGUAbGEAAWl5Yw5oDnIAYwA7gNsA20AjZGIibGFjAHBhcgAA4DXYGN1yAGEAdgBlADuA2QDZQOEhY3JqYQABZGl/Dp8OZQByAAABQlCFDpcOAAFhcokOiw5yAF9gYQBjAAABZWuRDpMOAKDfI2UAdAAAoLUjYSVyZW50aGVzaXMAAKDdI28AbgBQoMMi7CF1cwCgjiIAAWdwqw6uDm8AbgByYWYAAOA12EzdAARBREVUYWRwc78O0g7ZDuEOBQPqDvMOBw9yInJvdwDCoZEhyA4AAMwOYQByAACgEilvJHduQXJyb3cAAKDFIW8kd25BcnJvdwAAoJUhcSV1aWxpYnJpdW0AAKBuKWUAZQBBoKUiciJyb3cAAKClIW8AdwBuAGEAcgByAG8A9wAQA2UAcgAAAUxS+Q4AD2UkZnRBcnJvdwAAoJYh6SRnaHRBcnJvdwCglyFpAGyg0gNvAG4ApWPpIW5nbmFjAHIAAOA12LDcaSJsZGUAaGFtAGwAO4DcANxAgAREYmNkZWZvc3YALQ8xDzUPNw89D3IPdg97D4AP4SFzaACgqyJhAHIAAKDrKnkAEmThIXNobKCpIgCg5ioAAWVyQQ9DDwCgwSKAAWJ0eQBJD00Paw9hAHIAAKAWIGmgFiDjIWFsAAJCTFNUWA9cD18PZg9hAHIAAKAjIukhbmV8YGUkcGFyYXRvcgAAoFgnaSJsZGUAAKBAItQkaGluU3BhY2UAoAogcgAA4DXYGd1wAGYAAOA12E3dYwByAADgNdix3GQiYXNoAACgqiKAAmNlZm9zAI4PkQ+VD5kPng/pIXJjdGHkIWdlAKDAInIAAOA12BrdcABmAADgNdhO3WMAcgAA4DXYstwAAmZpb3OqD64Prw+0D3IAAOA12BvdnmNwAGYAAOA12E/dYwByAADgNdiz3IAEQUlVYWNmb3N1AMgPyw/OD9EP2A/gD+QP6Q/uD2MAeQAvZGMAeQAHZGMAeQAuZGMAdQB0AGUAO4DdAN1AAAFpedwP3w9yAGMAdmErZHIAAOA12BzdcABmAADgNdhQ3WMAcgAA4DXYtNxtAGwAeGEABEhhY2RlZm9z/g8BEAUQDRAQEB0QIBAkEGMAeQAWZGMidXRlAHlhAAFheQkQDBDyIW9ufWEXZG8AdAB7YfIBFRAAABwQbwBXAGkAZAB0AOgAVAhhAJZjcgAAoCghcABmAACgJCFjAHIAAOA12LXc4QtCEEkQTRAAAGcQbRByEAAAAAAAAAAAeRCKEJcQ8hD9EAAAGxEhETIROREAAD4RYwB1AHQAZQA7gOEA4UByImV2ZQADYYCiPiJFZGl1eQBWEFkQWxBgEGUQAOA+IjMDAKA/InIAYwA7gOIA4kB0AGUAO4C0ALRAMGRsAGkAZwA7gOYA5kByoGEgAOA12B7dcgBhAHYAZQA7gOAA4EAAAWVwfBCGEAABZnCAEIQQ8yF5bQCgNSHoAIMQaABhALFjAAFhcI0QWwAAAWNskRCTEHIAAWFnAACgPypkApwQAAAAALEQAKInImFkc3ajEKcQqRCuEG4AZAAAoFUqAKBcKmwib3BlAACgWCoAoFoqAKMgImVsbXJzersQvRDAEN0Q5RDtEACgpCllAACgICJzAGQAYaAhImEEzhDQENIQ1BDWENgQ2hDcEACgqCkAoKkpAKCqKQCgqykAoKwpAKCtKQCgrikAoK8pdAB2oB8iYgBkoL4iAKCdKQABcHTpEOwQaAAAoCIixWDhIXJyAKB8IwABZ3D1EPgQbwBuAAVhZgAA4DXYUt0Ao0giRWFlaW9wBxEJEQ0RDxESERQRAKBwKuMhaXIAoG8qAKBKImQAAKBLInMAJ2DyIW94ZaBIIvEADhFpAG4AZwA7gOUA5UCAAWN0eQAmESoRKxFyAADgNdi23CpgbQBwAGWgSCLxAPgBaQBsAGQAZQA7gOMA40BtAGwAO4DkAORAAAFjaUERRxFvAG4AaQBuAPQA6AFuAHQAAKARKgAITmFiY2RlZmlrbG5vcHJzdWQRaBGXEZ8RpxGrEdIR1hErEjASexKKEn0RThNbE3oTbwB0AACg7SoAAWNybBGJEWsAAAJjZXBzdBF4EX0RghHvIW5nAKBMInAjc2lsb24A9mNyImltZQAAoDUgaQBtAGWgPSJxAACgzSJ2AY0RkRFlAGUAAKC9ImUAZABnoAUjZQAAoAUjcgBrAHSgtSPiIXJrAKC2IwABb3mjEaYRbgDnAHcRMWTxIXVvAKAeIIACY21wcnQAtBG5Eb4RwRHFEeEhdXPloDUi5ABwInR5dgAAoLApcwDpAH0RbgBvAPUA6gCAAWFodwDLEcwRzhGyYwCgNiHlIWVuAKBsInIAAOA12B/dZwCAA2Nvc3R1dncA4xHyEQUSEhIhEiYSKRKAAWFpdQDpEesR7xHwAKMFcgBjAACg7yVwAACgwyKAAWRwdAD4EfwRABJvAHQAAKAAKuwhdXMAoAEqaSJtZXMAAKACKnECCxIAAAAADxLjIXVwAKAGKmEAcgAAoAUm8iNpYW5nbGUAAWR1GhIeEu8hd24AoL0lcAAAoLMlcCJsdXMAAKAEKmUA5QBCD+UAkg9hInJvdwAAoA0pgAFha28ANhJoEncSAAFjbjoSZRJrAIABbHN0AEESRxJNEm8jemVuZ2UAAKDrKXEAdQBhAHIA5QBcBPIjaWFuZ2xlgKG0JWRscgBYElwSYBLvIXduAKC+JeUhZnQAoMIlaSJnaHQAAKC4JWsAAKAjJLEBbRIAAHUSsgFxEgAAcxIAoJIlAKCRJTQAAKCTJWMAawAAoIglAAFlb38ShxJx4D0A5SD1IWl2AOBhIuUgdAAAoBAjAAJwdHd4kRKVEpsSnxJmAADgNdhT3XSgpSJvAG0AAKClIvQhaWUAoMgiAAZESFVWYmRobXB0dXayEsES0RLgEvcS+xIKExoTHxMjEygTNxMAAkxSbHK5ErsSvRK/EgCgVyUAoFQlAKBWJQCgUyUAolAlRFVkdckSyxLNEs8SAKBmJQCgaSUAoGQlAKBnJQACTFJsctgS2hLcEt4SAKBdJQCgWiUAoFwlAKBZJQCjUSVITFJobHLrEu0S7xLxEvMS9RIAoGwlAKBjJQCgYCUAoGslAKBiJQCgXyVvAHgAAKDJKQACTFJscgITBBMGEwgTAKBVJQCgUiUAoBAlAKAMJQCiACVEVWR1EhMUExYTGBMAoGUlAKBoJQCgLCUAoDQlaSJudXMAAKCfIuwhdXMAoJ4iaSJtZXMAAKCgIgACTFJsci8TMRMzEzUTAKBbJQCgWCUAoBglAKAUJQCjAiVITFJobHJCE0QTRhNIE0oTTBMAoGolAKBhJQCgXiUAoDwlAKAkJQCgHCUAAWV2UhNVE3YA5QD5AGIAYQByADuApgCmQAACY2Vpb2ITZhNqE24TcgAA4DXYt9xtAGkAAKBPIG0A5aA9IogRbAAAoVwAYmh0E3YTAKDFKfMhdWIAoMgnbAF+E4QTbABloCIgdAAAoCIgcAAAoU4iRWWJE4sTAKCuKvGgTyI8BeEMqRMAAN8TABQDFB8UAAAjFDQUAAAAAIUUAAAAAI0UAAAAANcU4xT3FPsUAACIFQAAlhWAAWNwcgCuE7ET1RP1IXRlB2GAoikiYWJjZHMAuxO/E8QTzhPSE24AZAAAoEQqciJjdXAAAKBJKgABYXXIE8sTcAAAoEsqcAAAoEcqbwB0AACgQCoA4CkiAP4AAWVv2RPcE3QAAKBBIO4ABAUAAmFlaXXlE+8T9RP4E/AB6hMAAO0TcwAAoE0qbwBuAA1hZABpAGwAO4DnAOdAcgBjAAlhcABzAHOgTCptAACgUCpvAHQAC2GAAWRtbgAIFA0UEhRpAGwAO4C4ALhAcCJ0eXYAAKCyKXQAAIGiADtlGBQZFKJAcgBkAG8A9ABiAXIAAOA12CDdgAFjZWkAKBQqFDIUeQBHZGMAawBtoBMn4SFyawCgEyfHY3IAAKPLJUVjZWZtcz8UQRRHFHcUfBSAFACgwykAocYCZWxGFEkUcQAAoFciZQBhAlAUAAAAAGAUciJyb3cAAAFsclYUWhTlIWZ0AKC6IWkiZ2h0AACguyGAAlJTYWNkAGgUaRRrFG8UcxSuYACgyCRzAHQAAKCbIukhcmMAoJoi4SFzaACgnSJuImludAAAoBAqaQBkAACg7yrjIWlyAKDCKfUhYnN1oGMmaQB0AACgYybsApMUmhS2FAAAwxRvAG4AZaA6APGgVCKrAG0CnxQAAAAAoxRhAHSgLABAYAChASJmbKcUqRTuABMNZQAAAW14rhSyFOUhbnQAoAEiZQDzANIB5wG6FAAAwBRkoEUibwB0AACgbSpuAPQAzAGAAWZyeQDIFMsUzhQA4DXYVN1vAOQA1wEAgakAO3MeAdMUcgAAoBchAAFhb9oU3hRyAHIAAKC1IXMAcwAAoBcnAAFjdeYU6hRyAADgNdi43AABYnDuFPIUZaDPKgCg0SploNAqAKDSKuQhb3QAoO8igANkZWxwcnZ3AAYVEBUbFSEVRBVlFYQV4SFycgABbHIMFQ4VAKA4KQCgNSlwAhYVAAAAABkVcgAAoN4iYwAAoN8i4SFycnCgtiEAoD0pgKIqImJjZG9zACsVMBU6FT4VQRVyImNhcAAAoEgqAAFhdTQVNxVwAACgRipwAACgSipvAHQAAKCNInIAAKBFKgDgKiIA/gACYWxydksVURVuFXMVcgByAG2gtyEAoDwpeQCAAWV2dwBYFWUVaRVxAHACXxUAAAAAYxVyAGUA4wAXFXUA4wAZFWUAZQAAoM4iZSJkZ2UAAKDPImUAbgA7gKQApEBlI2Fycm93AAABbHJ7FX8V5SFmdACgtiFpImdodAAAoLchZQDkAG0VAAFjaYsVkRVvAG4AaQBuAPQAkwFuAHQAAKAxImwiY3R5AACgLSOACUFIYWJjZGVmaGlqbG9yc3R1d3oAuBW7Fb8V1RXgFegV+RUKFhUWHxZUFlcWZRbFFtsW7xb7FgUXChdyAPIAtAJhAHIAAKBlKQACZ2xyc8YVyhXOFdAV5yFlcgCgICDlIXRoAKA4IfIA9QxoAHagECAAoKMiawHZFd4VYSJyb3cAAKAPKWEA4wBfAgABYXnkFecV8iFvbg9hNGQAoUYhYW/tFfQVAAFnciEC8RVyAACgyiF0InNlcQAAoHcqgAFnbG0A/xUCFgUWO4CwALBAdABhALRjcCJ0eXYAAKCxKQABaXIOFhIW8yFodACgfykA4DXYId1hAHIAAAFschsWHRYAoMMhAKDCIYACYWVnc3YAKBauAjYWOhY+Fm0AAKHEIm9zLhY0Fm4AZABzoMQi9SFpdACgZiZhIm1tYQDdY2kAbgAAoPIiAKH3AGlvQxZRFmQAZQAAgfcAO29KFksW90BuI3RpbWVzAACgxyJuAPgAUBZjAHkAUmRjAG8CXhYAAAAAYhZyAG4AAKAeI28AcAAAoA0jgAJscHR1dwBuFnEWdRaSFp4W7CFhciRgZgAA4DXYVd0AotkCZW1wc30WhBaJFo0WcQBkoFAibwB0AACgUSJpIm51cwAAoDgi7CF1cwCgFCLxInVhcmUAoKEiYgBsAGUAYgBhAHIAdwBlAGQAZwDlANcAbgCAAWFkaAClFqoWtBZyAHIAbwD3APUMbwB3AG4AYQByAHIAbwB3APMA8xVhI3Jwb29uAAABbHK8FsAWZQBmAPQAHBZpAGcAaAD0AB4WYgHJFs8WawBhAHIAbwD3AJILbwLUFgAAAADYFnIAbgAAoB8jbwBwAACgDCOAAWNvdADhFukW7BYAAXJ55RboFgDgNdi53FVkbAAAoPYp8iFvaxFhAAFkcvMW9xZvAHQAAKDxImkA5qC/JVsSAAFhaP8WAhdyAPIANQNhAPIA1wvhIm5nbGUAoKYpAAFjaQ4XEBd5AF9k5yJyYXJyAKD/JwAJRGFjZGVmZ2xtbm9wcXJzdHV4MRc4F0YXWxcyBF4XaRd5F40XrBe0F78X2RcVGCEYLRg1GEAYAAFEbzUXgRZvAPQA+BUAAWNzPBdCF3UAdABlADuA6QDpQPQhZXIAoG4qAAJhaW95TRdQF1YXWhfyIW9uG2FyAGOgViI7gOoA6kDsIW9uAKBVIk1kbwB0ABdhAAFEcmIXZhdvAHQAAKBSIgDgNdgi3XKhmipuF3QXYQB2AGUAO4DoAOhAZKCWKm8AdAAAoJgqgKGZKmlscwCAF4UXhxfuInRlcnMAoOcjAKATIWSglSpvAHQAAKCXKoABYXBzAJMXlheiF2MAcgATYXQAeQBzogUinxcAAAAAoRdlAHQAAKAFInAAMaADIDMBqRerFwCgBCAAoAUgAAFnc7AXsRdLYXAAAKACIAABZ3C4F7sXbwBuABlhZgAA4DXYVt2AAWFscwDFF8sXzxdyAHOg1SJsAACg4yl1AHMAAKBxKmkAAKG1A2x21RfYF28AbgC1Y/VjAAJjc3V24BfoF/0XEBgAAWlv5BdWF3IAYwAAoFYiaQLuFwAAAADwF+0ADQThIW50AAFnbPUX+Rd0AHIAAKCWKuUhc3MAoJUqgAFhZWkAAxgGGAoYbABzAD1gcwB0AACgXyJ2AESgYSJEAACgeCrwImFyc2wAoOUpAAFEYRkYHRhvAHQAAKBTInIAcgAAoHEpgAFjZGkAJxgqGO0XcgAAoC8hbwD0AIwCAAFhaDEYMhi3YzuA8ADwQAABbXI5GD0YbAA7gOsA60BvAACgrCCAAWNpcABGGEgYSxhsACFgcwD0ACwEAAFlb08YVxhjAHQAYQB0AGkAbwDuABoEbgBlAG4AdABpAGEAbADlADME4Ql1GAAAgRgAAIMYiBgAAAAAoRilGAAAqhgAALsYvhjRGAAA1xgnGWwAbABpAG4AZwBkAG8AdABzAGUA8QBlF3kARGRtImFsZQAAoEAmgAFpbHIAjRiRGJ0Y7CFpZwCgA/tpApcYAAAAAJoYZwAAoAD7aQBnAACgBPsA4DXYI93sIWlnAKAB++whaWcA4GYAagCAAWFsdACvGLIYthh0AACgbSZpAGcAAKAC+24AcwAAoLElbwBmAJJh8AHCGAAAxhhmAADgNdhX3QABYWvJGMwYbADsAGsEdqDUIgCg2SphI3J0aW50AACgDSoAAWFv2hgiGQABY3PeGB8ZsQPnGP0YBRkSGRUZAAAdGbID7xjyGPQY9xj5GAAA+xg7gL0AvUAAoFMhO4C8ALxAAKBVIQCgWSEAoFshswEBGQAAAxkAoFQhAKBWIbQCCxkOGQAAAAAQGTuAvgC+QACgVyEAoFwhNQAAoFghtgEZGQAAGxkAoFohAKBdITgAAKBeIWwAAKBEIHcAbgAAoCIjYwByAADgNdi73IAIRWFiY2RlZmdpamxub3JzdHYARhlKGVoZXhlmGWkZkhmWGZkZnRmgGa0ZxhnLGc8Z4BkjGmygZyIAoIwqgAFjbXAAUBlTGVgZ9SF0ZfVhbQBhAOSgswM6FgCghipyImV2ZQAfYQABaXliGWUZcgBjAB1hM2RvAHQAIWGAoWUibHFzAMYEcBl6GfGhZSLOBAAAdhlsAGEAbgD0AN8EgKF+KmNkbACBGYQZjBljAACgqSpvAHQAb6CAKmyggioAoIQqZeDbIgD+cwAAoJQqcgAA4DXYJN3noGsirATtIWVsAKA3IWMAeQBTZIChdyJFYWoApxmpGasZAKCSKgCgpSoAoKQqAAJFYWVztBm2Gb0ZwhkAoGkicABwoIoq8iFveACgiipxoIgq8aCIKrUZaQBtAACg5yJwAGYAAOA12FjdYQB2AOUAYwIAAWNp0xnWGXIAAKAKIW0AAKFzImVs3BneGQCgjioAoJAqAIM+ADtjZGxxco0E6xn0GfgZ/BkBGgABY2nvGfEZAKCnKnIAAKB6Km8AdAAAoNci0CFhcgCglSl1ImVzdAAAoHwqgAJhZGVscwAKGvQZFhrVBCAa8AEPGgAAFBpwAHIAbwD4AFkZcgAAoHgpcQAAAWxxxAQbGmwAZQBzAPMASRlpAO0A5AQAAWVuJxouGnIjdG5lcXEAAOBpIgD+xQAsGgAFQWFiY2Vma29zeUAaQxpmGmoabRqDGocalhrCGtMacgDyAMwCAAJpbG1yShpOGlAaVBpyAHMA8ABxD2YAvWBpAGwA9AASBQABZHJYGlsaYwB5AEpkAKGUIWN3YBpkGmkAcgAAoEgpAKCtIWEAcgAAoA8h6SFyYyVhgAFhbHIAcxp7Gn8a8iF0c3WgZSZpAHQAAKBlJuwhaXAAoCYg4yFvbgCguSJyAADgNdgl3XMAAAFld4wakRphInJvdwAAoCUpYSJyb3cAAKAmKYACYW1vcHIAnxqjGqcauhq+GnIAcgAAoP8h9CFodACgOyJrAAABbHKsGrMaZSRmdGFycm93AACgqSHpJGdodGFycm93AKCqIWYAAOA12Fnd4iFhcgCgFSCAAWNsdADIGswa0BpyAADgNdi93GEAcwDoAGka8iFvaydhAAFicNca2xr1IWxsAKBDIOghZW4AoBAg4Qr2GgAA/RoAAAgbExsaGwAAIRs7GwAAAAA+G2IbmRuVG6sbAACyG80b0htjAHUAdABlADuA7QDtQAChYyBpeQEbBhtyAGMAO4DuAO5AOGQAAWN4CxsNG3kANWRjAGwAO4ChAKFAAAFmcssCFhsA4DXYJt1yAGEAdgBlADuA7ADsQIChSCFpbm8AJxsyGzYbAAFpbisbLxtuAHQAAKAMKnQAAKAtIuYhaW4AoNwpdABhAACgKSHsIWlnM2GAAWFvcABDG1sbXhuAAWNndABJG0sbWRtyACthgAFlbHAAcQVRG1UbaQBuAOUAyAVhAHIA9AByBWgAMWFmAACgtyJlAGQAtWEAoggiY2ZvdGkbbRt1G3kb4SFyZQCgBSFpAG4AdKAeImkAZQAAoN0pZABvAPQAWxsAoisiY2VscIEbhRuPG5QbYQBsAACguiIAAWdyiRuNG2UAcgDzACMQ4wCCG2EicmhrAACgFyryIW9kAKA8KgACY2dwdJ8boRukG6gbeQBRZG8AbgAvYWYAAOA12FrdYQC5Y3UAZQBzAHQAO4C/AL9AAAFjabUbuRtyAADgNdi+3G4AAKIIIkVkc3bCG8QbyBvQAwCg+SJvAHQAAKD1Inag9CIAoPMiaaBiIOwhZGUpYesB1hsAANkbYwB5AFZkbAA7gO8A70AAA2NmbW9zdeYb7hvyG/Ub+hsFHAABaXnqG+0bcgBjADVhOWRyAADgNdgn3eEhdGg3YnAAZgAA4DXYW93jAf8bAAADHHIAAOA12L/c8iFjeVhk6yFjeVRkAARhY2ZnaGpvcxUcGhwiHCYcKhwtHDAcNRzwIXBhdqC6A/BjAAFleR4cIRzkIWlsN2E6ZHIAAOA12CjdciJlZW4AOGFjAHkARWRjAHkAXGRwAGYAAOA12FzdYwByAADgNdjA3IALQUJFSGFiY2RlZmdoamxtbm9wcnN0dXYAXhxtHHEcdRx5HN8cBx0dHTwd3B3tHfEdAR4EHh0eLB5FHrwewx7hHgkfPR9LH4ABYXJ0AGQcZxxpHHIA8gBvB/IAxQLhIWlsAKAbKeEhcnIAoA4pZ6BmIgCgiyphAHIAAKBiKWMJjRwAAJAcAACVHAAAAAAAAAAAAACZHJwcAACmHKgcrRwAANIc9SF0ZTph7SJwdHl2AKC0KXIAYQDuAFoG4iFkYbtjZwAAoegnZGyhHKMcAKCRKeUAiwYAoIUqdQBvADuAqwCrQHIAgKOQIWJmaGxwc3QAuhy/HMIcxBzHHMoczhxmoOQhcwAAoB8pcwAAoB0p6wCyGnAAAKCrIWwAAKA5KWkAbQAAoHMpbAAAoKIhAKGrKmFl1hzaHGkAbAAAoBkpc6CtKgDgrSoA/oABYWJyAOUc6RztHHIAcgAAoAwpcgBrAACgcicAAWFr8Rz4HGMAAAFla/Yc9xx7YFtgAAFlc/wc/hwAoIspbAAAAWR1Ax0FHQCgjykAoI0pAAJhZXV5Dh0RHRodHB3yIW9uPmEAAWRpFR0YHWkAbAA8YewAowbiAPccO2QAAmNxcnMkHScdLB05HWEAAKA2KXUAbwDyoBwgqhEAAWR1MB00HeghYXIAoGcpcyJoYXIAAKBLKWgAAKCyIQCiZCJmZ3FzRB1FB5Qdnh10AIACYWhscnQATh1WHWUdbB2NHXIicm93AHSgkCFhAOkAzxxhI3Jwb29uAAABZHVeHWId7yF3bgCgvSFwAACgvCHlJGZ0YXJyb3dzAKDHIWkiZ2h0AIABYWhzAHUdex2DHXIicm93APOglCGdBmEAcgBwAG8AbwBuAPMAzgtxAHUAaQBnAGEAcgByAG8A9wBlGugkcmVldGltZXMAoMsi8aFkIk0HAACaHWwAYQBuAPQAXgcAon0qY2Rnc6YdqR2xHbcdYwAAoKgqbwB0AG+gfypyoIEqAKCDKmXg2iIA/nMAAKCTKoACYWRlZ3MAwB3GHcod1h3ZHXAAcAByAG8A+ACmHG8AdAAAoNYicQAAAWdxzx3SHXQA8gBGB2cAdADyAHQcdADyAFMHaQDtAGMHgAFpbHIA4h3mHeod8yFodACgfClvAG8A8gDKBgDgNdgp3UWgdiIAoJEqYQH1Hf4dcgAAAWR1YB35HWygvCEAoGopbABrAACghCVjAHkAWWQAomoiYWNodAweDx4VHhkecgDyAGsdbwByAG4AZQDyAGAW4SFyZACgaylyAGkAAKD6JQABaW8hHiQe5CFvdEBh9SFzdGGgsCPjIWhlAKCwIwACRWFlczMeNR48HkEeAKBoInAAcKCJKvIhb3gAoIkqcaCHKvGghyo0HmkAbQAAoOYiAARhYm5vcHR3elIeXB5fHoUelh6mHqsetB4AAW5yVh5ZHmcAAKDsJ3IAAKD9IXIA6wCwBmcAgAFsbXIAZh52Hnse5SFmdAABYXKIB2weaQBnAGgAdABhAHIAcgBvAPcAkwfhInBzdG8AoPwnaQBnAGgAdABhAHIAcgBvAPcAmgdwI2Fycm93AAABbHKNHpEeZQBmAPQAxhxpImdodAAAoKwhgAFhZmwAnB6fHqIecgAAoIUpAOA12F3ddQBzAACgLSppIm1lcwAAoDQqYQGvHrMecwB0AACgFyLhAIoOZaHKJbkeRhLuIWdlAKDKJWEAcgBsoCgAdAAAoJMpgAJhY2htdADMHs8e1R7bHt0ecgDyAJ0GbwByAG4AZQDyANYWYQByAGSgyyEAoG0pAKAOIHIAaQAAoL8iAANhY2hpcXTrHu8e1QfzHv0eBh/xIXVvAKA5IHIAAOA12MHcbQDloXIi+h4AAPweAKCNKgCgjyoAAWJ19xwBH28AcqAYIACgGiDyIW9rQmEAhDwAO2NkaGlscXJCBhcfxh0gHyQfKB8sHzEfAAFjaRsfHR8AoKYqcgAAoHkqcgBlAOUAkx3tIWVzAKDJIuEhcnIAoHYpdSJlc3QAAKB7KgABUGk1HzkfYQByAACglillocMlAgdfEnIAAAFkdUIfRx9zImhhcgAAoEop6CFhcgCgZikAAWVuTx9WH3IjdG5lcXEAAOBoIgD+xQBUHwAHRGFjZGVmaGlsbm9wc3VuH3Ifoh+rH68ftx+7H74f5h/uH/MfBwj/HwsgxCFvdACgOiIAAmNscHJ5H30fiR+eH3IAO4CvAK9AAAFldIEfgx8AoEImZaAgJ3MAZQAAoCAnc6CmIXQAbwCAoaYhZGx1AJQfmB+cH28AdwDuAHkDZQBmAPQA6gbwAOkO6yFlcgCgriUAAW95ph+qH+0hbWEAoCkqPGThIXNoAKAUIOElc3VyZWRhbmdsZQCgISJyAADgNdgq3W8AAKAnIYABY2RuAMQfyR/bH3IAbwA7gLUAtUBhoiMi0B8AANMf1x9zAPQAKxFpAHIAAKDwKm8AdAA7gLcAt0B1AHMA4qESIh4TAADjH3WgOCIAoCoqYwHqH+0fcAAAoNsq8gB+GnAAbAB1APMACAgAAWRw9x/7H+UhbHMAoKciZgAA4DXYXt0AAWN0AyAHIHIAAOA12MLc8CFvcwCgPiJsobwDECAVIPQiaW1hcACguCJhAPAAEyAADEdMUlZhYmNkZWZnaGlqbG1vcHJzdHV2dzwgRyBmIG0geSCqILgg2iDeIBEhFSEyIUMhTSFQIZwhnyHSIQAiIyKLIrEivyIUIwABZ3RAIEMgAODZIjgD9uBrItIgBwmAAWVsdABNIF8gYiBmAHQAAAFhclMgWCByInJvdwAAoM0h6SRnaHRhcnJvdwCgziEA4NgiOAP24Goi0iBfCekkZ2h0YXJyb3cAoM8hAAFEZHEgdSDhIXNoAKCvIuEhc2gAoK4igAJiY25wdACCIIYgiSCNIKIgbABhAACgByL1IXRlRGFnAADgICLSIACiSSJFaW9wlSCYIJwgniAA4HAqOANkAADgSyI4A3MASWFyAG8A+AAyCnUAcgBhoG4mbADzoG4mmwjzAa8gAACzIHAAO4CgAKBAbQBwAOXgTiI4AyoJgAJhZW91eQDBIMogzSDWINkg8AHGIAAAyCAAoEMqbwBuAEhh5CFpbEZhbgBnAGSgRyJvAHQAAOBtKjgDcAAAoEIqPWThIXNoAKATIACjYCJBYWRxc3jpIO0g+SD+IAIhDCFyAHIAAKDXIXIAAAFocvIg9SBrAACgJClvoJch9wAGD28AdAAA4FAiOAN1AGkA9gC7CAABZWkGIQohYQByAACgKCntAN8I6SFzdPOgBCLlCHIAAOA12CvdAAJFZXN0/wgcISshLiHxoXEiIiEAABMJ8aFxIgAJAAAnIWwAYQBuAPQAEwlpAO0AGQlyoG8iAKBvIoABQWFwADghOyE/IXIA8gBeIHIAcgAAoK4hYQByAACg8ipzogsiSiEAAAAAxwtkoPwiAKD6ImMAeQBaZIADQUVhZGVzdABcIV8hYiFmIWkhkyGWIXIA8gBXIADgZiI4A3IAcgAAoJohcgAAoCUggKFwImZxcwBwIYQhjiF0AAABYXJ1IXohcgByAG8A9wBlIWkAZwBoAHQAYQByAHIAbwD3AD4h8aFwImAhAACKIWwAYQBuAPQAZwlz4H0qOAMAoG4iaQDtAG0JcqBuImkA5aDqIkUJaQDkADoKAAFwdKMhpyFmAADgNdhf3YCBrAA7aW4AriGvIcchrEBuAIChCSJFZHYAtyG6Ib8hAOD5IjgDbwB0AADg9SI4A+EB1gjEIcYhAKD3IgCg9iJpAHagDCLhAagJzyHRIQCg/iIAoP0igAFhb3IA2CHsIfEhcgCAoSYiYXN0AOAh5SHpIWwAbABlAOwAywhsAADg/SrlIADgAiI4A2wiaW50AACgFCrjoYAi9yEAAPohdQDlAJsJY+CvKjgDZaCAIvEAkwkAAkFhaXQHIgoiFyIeInIA8gBsIHIAcgAAoZshY3cRIhQiAOAzKTgDAOCdITgDZyRodGFycm93AACgmyFyAGkA5aDrIr4JgANjaGltcHF1AC8iPCJHIpwhTSJQIloigKGBImNlcgA2Iv0JOSJ1AOUABgoA4DXYw9zvIXJ0bQKdIQAAAABEImEAcgDhAOEhbQBloEEi8aBEIiYKYQDyAMsIcwB1AAABYnBWIlgi5QDUCeUA3wmAAWJjcABgInMieCKAoYQiRWVzAGci7glqIgDgxSo4A2UAdABl4IIi0iBxAPGgiCJoImMAZaCBIvEA/gmAoYUiRWVzAH8iFgqCIgDgxio4A2UAdABl4IMi0iBxAPGgiSKAIgACZ2lscpIilCKaIpwi7AAMCWwAZABlADuA8QDxQOcAWwlpI2FuZ2xlAAABbHKkIqoi5SFmdGWg6iLxAEUJaSJnaHQAZaDrIvEAvgltoL0DAKEjAGVzuCK8InIAbwAAoBYhcAAAoAcggARESGFkZ2lscnMAziLSItYi2iLeIugi7SICIw8j4SFzaACgrSLhIXJyAKAEKXAAAOBNItIg4SFzaACgrCIAAWV04iLlIgDgZSLSIADgPgDSIG4iZmluAACg3imAAUFldADzIvci+iJyAHIAAKACKQDgZCLSIHLgPADSIGkAZQAA4LQi0iAAAUF0BiMKI3IAcgAAoAMp8iFpZQDgtSLSIGkAbQAA4Dwi0iCAAUFhbgAaIx4jKiNyAHIAAKDWIXIAAAFociMjJiNrAACgIylvoJYh9wD/DuUhYXIAoCcpUxJqFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVCMAAF4jaSN/I4IjjSOeI8AUAAAAAKYjwCMAANoj3yMAAO8jHiQvJD8kRCQAAWNzVyNsFHUAdABlADuA8wDzQAABaXlhI2cjcgBjoJoiO4D0APRAPmSAAmFiaW9zAHEjdCN3I3EBeiNzAOgAdhTsIWFjUWF2AACgOCrvIWxkAKC8KewhaWdTYQABY3KFI4kjaQByAACgvykA4DXYLN1vA5QjAAAAAJYjAACcI24A22JhAHYAZQA7gPIA8kAAoMEpAAFibaEjjAphAHIAAKC1KQACYWNpdKwjryO6I70jcgDyAFkUAAFpcrMjtiNyAACgvinvIXNzAKC7KW4A5QDZCgCgwCmAAWFlaQDFI8gjyyNjAHIATWFnAGEAyWOAAWNkbgDRI9Qj1iPyIW9uv2MAoLYpdQDzAHgBcABmAADgNdhg3YABYWVsAOQj5yPrI3IAAKC3KXIAcAAAoLkpdQDzAHwBAKMoImFkaW9zdvkj/CMPJBMkFiQbJHIA8gBeFIChXSplZm0AAyQJJAwkcgBvoDQhZgAAoDQhO4CqAKpAO4C6ALpA5yFvZgCgtiJyAACgVipsIm9wZQAAoFcqAKBbKoABY2xvACMkJSQrJPIACCRhAHMAaAA7gPgA+EBsAACgmCJpAGwBMyQ4JGQAZQA7gPUA9UBlAHMAYaCXInMAAKA2Km0AbAA7gPYA9kDiIWFyAKA9I+EKXiQAAHokAAB8JJQkAACYJKkkAAAAALUkEQsAAPAkAAAAAAQleiUAAIMlcgCAoSUiYXN0AGUkbyQBCwCBtgA7bGokayS2QGwAZQDsABgDaQJ1JAAAAAB4JG0AAKDzKgCg/Sp5AD9kcgCAAmNpbXB0AIUkiCSLJJkSjyRuAHQAJWBvAGQALmBpAGwAAKAwIOUhbmsAoDEgcgAA4DXYLd2AAWltbwCdJKAkpCR2oMYD1WNtAGEA9AD+B24AZQAAoA4m9KHAA64kAAC0JGMjaGZvcmsAAKDUItZjAAFhdbgkxCRuAAABY2u9JMIkawBooA8hAKAOIfYAaRpzAACkKwBhYmNkZW1zdNMkIRPXJNsk4STjJOck6yTjIWlyAKAjKmkAcgAAoCIqAAFvdYsW3yQAoCUqAKByKm4AO4CxALFAaQBtAACgJip3AG8AAKAnKoABaXB1APUk+iT+JO4idGludACgFSpmAADgNdhh3W4AZAA7gKMAo0CApHoiRWFjZWlub3N1ABMlFSUYJRslTCVRJVklSSV1JQCgsypwAACgtyp1AOUAPwtjoK8qgKJ6ImFjZW5zACclLSU0JTYlSSVwAHAAcgBvAPgAFyV1AHIAbAB5AGUA8QA/C/EAOAuAAWFlcwA8JUElRSXwInByb3gAoLkqcQBxAACgtSppAG0AAKDoImkA7QBEC20AZQDzoDIgIguAAUVhcwBDJVclRSXwAEAlgAFkZnAATwtfJXElgAFhbHMAZSVpJW0l7CFhcgCgLiPpIW5lAKASI/UhcmYAoBMjdKAdIu8AWQvyIWVsAKCwIgABY2l9JYElcgAA4DXYxdzIY24iY3NwAACgCCAAA2Zpb3BzdZElKxuVJZolnyWkJXIAAOA12C7dcABmAADgNdhi3XIiaW1lAACgVyBjAHIAAOA12MbcgAFhZW8AqiW6JcAldAAAAWVpryW2JXIAbgBpAG8AbgDzABkFbgB0AACgFipzAHQAZaA/APEACRj0AG0LgApBQkhhYmNkZWZoaWxtbm9wcnN0dXgA4yXyJfYl+iVpJpAmpia9JtUm5ib4JlonaCdxJ3UnnietJ7EnyCfiJ+cngAFhcnQA6SXsJe4lcgDyAJkM8gD6AuEhaWwAoBwpYQByAPIA3BVhAHIAAKBkKYADY2RlbnFydAAGJhAmEyYYJiYmKyZaJgABZXUKJg0mAOA9IjEDdABlAFVhaQDjACAN7SJwdHl2AKCzKWcAgKHpJ2RlbAAgJiImJCYAoJIpAKClKeUA9wt1AG8AO4C7ALtAcgAApZIhYWJjZmhscHN0dz0mQCZFJkcmSiZMJk4mUSZVJlgmcAAAoHUpZqDlIXMAAKAgKQCgMylzAACgHinrALka8ACVHmwAAKBFKWkAbQAAoHQpbAAAoKMhAKCdIQABYWleJmImaQBsAACgGilvAG6gNiJhAGwA8wB2C4ABYWJyAG8mciZ2JnIA8gAvEnIAawAAoHMnAAFha3omgSZjAAABZWt/JoAmfWBdYAABZXOFJocmAKCMKWwAAAFkdYwmjiYAoI4pAKCQKQACYWV1eZcmmiajJqUm8iFvbllhAAFkaZ4moSZpAGwAV2HsAA8M4gCAJkBkAAJjbHFzrSawJrUmuiZhAACgNylkImhhcgAAoGkpdQBvAPKgHSCjAWgAAKCzIYABYWNnAMMm0iaUC2wAgKEcIWlwcwDLJs4migxuAOUAoAxhAHIA9ADaC3QAAKCtJYABaWxyANsm3ybjJvMhaHQAoH0pbwBvAPIANgwA4DXYL90AAWFv6ib1JnIAAAFkde8m8SYAoMEhbKDAIQCgbCl2oMED8WOAAWducwD+Jk4nUCdoAHQAAANhaGxyc3QKJxInISc1Jz0nRydyInJvdwB0oJIhYQDpAFYmYSNycG9vbgAAAWR1GiceJ28AdwDuAPAmcAAAoMAh5SFmdAABYWgnJy0ncgByAG8AdwDzAAkMYQByAHAAbwBvAG4A8wATBGklZ2h0YXJyb3dzAACgySFxAHUAaQBnAGEAcgByAG8A9wBZJugkcmVldGltZXMAoMwiZwDaYmkAbgBnAGQAbwB0AHMAZQDxABwYgAFhaG0AYCdjJ2YncgDyAAkMYQDyABMEAKAPIG8idXN0AGGgsSPjIWhlAKCxI+0haWQAoO4qAAJhYnB0fCeGJ4knmScAAW5ygCeDJ2cAAKDtJ3IAAKD+IXIA6wAcDIABYWZsAI8nkieVJ3IAAKCGKQDgNdhj3XUAcwAAoC4qaSJtZXMAAKA1KgABYXCiJ6gncgBnoCkAdAAAoJQp7yJsaW50AKASKmEAcgDyADwnAAJhY2hxuCe8J6EMwCfxIXVvAKA6IHIAAOA12MfcAAFidYAmxCdvAPKgGSCoAYABaGlyAM4n0ifWJ3IAZQDlAE0n7SFlcwCgyiJpAIChuSVlZmwAXAxjEt4n9CFyaQCgzinsInVoYXIAoGgpAKAeIWENBSgJKA0oSyhVKIYoAACLKLAoAAAAAOMo5ygAABApJCkxKW0pcSmHKaYpAACYKgAAAACxKmMidXRlAFthcQB1AO8ABR+ApHsiRWFjZWlucHN5ABwoHignKCooLygyKEEoRihJKACgtCrwASMoAAAlKACguCpvAG4AYWF1AOUAgw1koLAqaQBsAF9hcgBjAF1hgAFFYXMAOCg6KD0oAKC2KnAAAKC6KmkAbQAAoOki7yJsaW50AKATKmkA7QCIDUFkbwB0AGKixSKRFgAAAABTKACgZiqAA0FhY21zdHgAYChkKG8ocyh1KHkogihyAHIAAKDYIXIAAAFocmkoayjrAJAab6CYIfcAzAd0ADuApwCnQGkAO2D3IWFyAKApKW0AAAFpbn4ozQBuAHUA8wDOAHQAAKA2J3IA7+A12DDdIxkAAmFjb3mRKJUonSisKHIAcAAAoG8mAAFoeZkonChjAHkASWRIZHIAdABtAqUoAAAAAKgoaQDkAFsPYQByAGEA7ABsJDuArQCtQAABZ22zKLsobQBhAAChwwNmdroouijCY4CjPCJkZWdsbnByAMgozCjPKNMo1yjaKN4obwB0AACgairxoEMiCw5FoJ4qAKCgKkWgnSoAoJ8qZQAAoEYi7CF1cwCgJCrhIXJyAKByKWEAcgDyAPwMAAJhZWl07Sj8KAEpCCkAAWxz8Sj4KGwAcwBlAHQAbQDpAH8oaABwAACgMyrwImFyc2wAoOQpAAFkbFoPBSllAACgIyNloKoqc6CsKgDgrCoA/oABZmxwABUpGCkfKfQhY3lMZGKgLwBhoMQpcgAAoD8jZgAA4DXYZN1hAAABZHIoKRcDZQBzAHWgYCZpAHQAAKBgJoABY3N1ADYpRilhKQABYXU6KUApcABzoJMiAOCTIgD+cABzoJQiAOCUIgD+dQAAAWJwSylWKQChjyJlcz4NUCllAHQAZaCPIvEAPw0AoZAiZXNIDVspZQB0AGWgkCLxAEkNAKGhJWFmZilbBHIAZQFrKVwEAKChJWEAcgDyAAMNAAJjZW10dyl7KX8pgilyAADgNdjI3HQAbQDuAM4AaQDsAAYpYQByAOYAVw0AAWFyiimOKXIA5qAGJhESAAFhbpIpoylpImdodAAAAWVwmSmgKXAAcwBpAGwAbwDuANkXaADpAKAkcwCvYIACYmNtbnAArin8KY4NJSooKgCkgiJFZGVtbnByc7wpvinCKcgpzCnUKdgp3CkAoMUqbwB0AACgvSpkoIYibwB0AACgwyr1IWx0AKDBKgABRWXQKdIpAKDLKgCgiiLsIXVzAKC/KuEhcnIAoHkpgAFlaXUA4inxKfQpdAAAoYIiZW7oKewpcQDxoIYivSllAHEA8aCKItEpbQAAoMcqAAFicPgp+ikAoNUqAKDTKmMAgKJ7ImFjZW5zAAcqDSoUKhYqRihwAHAAcgBvAPgAIyh1AHIAbAB5AGUA8QCDDfEAfA2AAWFlcwAcKiIqPShwAHAAcgBvAPgAPChxAPEAOShnAACgaiYApoMiMTIzRWRlaGxtbnBzPCo/KkIqRSpHKlIqWCpjKmcqaypzKncqO4C5ALlAO4CyALJAO4CzALNAAKDGKgABb3NLKk4qdAAAoL4qdQBiAACg2CpkoIcibwB0AACgxCpzAAABb3VdKmAqbAAAoMknYgAAoNcq4SFycgCgeyn1IWx0AKDCKgABRWVvKnEqAKDMKgCgiyLsIXVzAKDAKoABZWl1AH0qjCqPKnQAAKGDImVugyqHKnEA8aCHIkYqZQBxAPGgiyJwKm0AAKDIKgABYnCTKpUqAKDUKgCg1iqAAUFhbgCdKqEqrCpyAHIAAKDZIXIAAAFocqYqqCrrAJUab6CZIfcAxQf3IWFyAKAqKWwAaQBnADuA3wDfQOELzyrZKtwq6SrsKvEqAAD1KjQrAAAAAAAAAAAAAEwrbCsAAHErvSsAAAAAAADRK3IC1CoAAAAA2CrnIWV0AKAWI8RjcgDrAOUKgAFhZXkA4SrkKucq8iFvbmVh5CFpbGNhQmRvAPQAIg5sInJlYwAAoBUjcgAA4DXYMd0AAmVpa2/7KhIrKCsuK/IBACsAAAkrZQAAATRm6g0EK28AcgDlAOsNYQBzorgDECsAAAAAEit5AG0A0WMAAWNuFislK2sAAAFhcxsrIStwAHAAcgBvAPgAFw5pAG0AAKA8InMA8AD9DQABYXMsKyEr8AAXDnIAbgA7gP4A/kDsATgrOyswG2QA5QBnAmUAcwCAgdcAO2JkAEMrRCtJK9dAYaCgInIAAKAxKgCgMCqAAWVwcwBRK1MraSvhAAkh4qKkIlsrXysAAAAAYytvAHQAAKA2I2kAcgAAoPEqb+A12GXdcgBrAACg2irhAHgociJpbWUAAKA0IIABYWlwAHYreSu3K2QA5QC+DYADYWRlbXBzdACFK6MrmiunK6wrsCuzK24iZ2xlAACitSVkbHFykCuUK5ornCvvIXduAKC/JeUhZnRloMMl8QACBwCgXCJpImdodABloLkl8QBdDG8AdAAAoOwlaSJudXMAAKA6KuwhdXMAoDkqYgAAoM0p6SFtZQCgOyrlInppdW0AoOIjgAFjaHQAwivKK80rAAFyecYrySsA4DXYydxGZGMAeQBbZPIhb2tnYQABaW/UK9creAD0ANERaCJlYWQAAAFsct4r5ytlAGYAdABhAHIAcgBvAPcAXQbpJGdodGFycm93AKCgIQAJQUhhYmNkZmdobG1vcHJzdHV3CiwNLBEsHSwnLDEsQCxLLFIsYix6LIQsjyzLLOgs7Sz/LAotcgDyAAkDYQByAACgYykAAWNyFSwbLHUAdABlADuA+gD6QPIACQ1yAOMBIywAACUseQBeZHYAZQBtYQABaXkrLDAscgBjADuA+wD7QENkgAFhYmgANyw6LD0scgDyANEO7CFhY3FhYQDyAOAOAAFpckQsSCzzIWh0AKB+KQDgNdgy3XIAYQB2AGUAO4D5APlAYQFWLF8scgAAAWxyWixcLACgvyEAoL4hbABrAACggCUAAWN0Zix2LG8CbCwAAAAAcyxyAG4AZaAcI3IAAKAcI28AcAAAoA8jcgBpAACg+CUAAWFsfiyBLGMAcgBrYTuAqACoQAABZ3CILIssbwBuAHNhZgAA4DXYZt0AA2FkaGxzdZksniynLLgsuyzFLHIAcgBvAPcACQ1vAHcAbgBhAHIAcgBvAPcA2A5hI3Jwb29uAAABbHKvLLMsZQBmAPQAWyxpAGcAaAD0AF0sdQDzAKYOaQAAocUDaGzBLMIs0mNvAG4AxWPwI2Fycm93cwCgyCGAAWNpdADRLOEs5CxvAtcsAAAAAN4scgBuAGWgHSNyAACgHSNvAHAAAKAOI24AZwBvYXIAaQAAoPklYwByAADgNdjK3IABZGlyAPMs9yz6LG8AdAAAoPAi7CFkZWlhaQBmoLUlAKC0JQABYW0DLQYtcgDyAMosbAA7gPwA/EDhIm5nbGUAoKcpgAdBQkRhY2RlZmxub3Byc3oAJy0qLTAtNC2bLZ0toS2/LcMtxy3TLdgt3C3gLfwtcgDyABADYQByAHag6CoAoOkqYQBzAOgA/gIAAW5yOC08LechcnQAoJwpgANla25wcnN0AJkpSC1NLVQtXi1iLYItYQBwAHAA4QAaHG8AdABoAGkAbgDnAKEXgAFoaXIAoSmzJFotbwBwAPQAdCVooJUh7wD4JgABaXVmLWotZwBtAOEAuygAAWJwbi14LXMjZXRuZXEAceCKIgD+AODLKgD+cyNldG5lcQBx4IsiAP4A4MwqAP4AAWhyhi2KLWUAdADhABIraSNhbmdsZQAAAWxyki2WLeUhZnQAoLIiaSJnaHQAAKCzInkAMmThIXNoAKCiIoABZWxyAKcttC24LWKiKCKuLQAAAACyLWEAcgAAoLsicQAAoFoi7CFpcACg7iIAAWJ0vC1eD2EA8gBfD3IAAOA12DPddAByAOkAlS1zAHUAAAFicM0t0C0A4IIi0iAA4IMi0iBwAGYAAOA12GfdcgBvAPAAWQt0AHIA6QCaLQABY3XkLegtcgAA4DXYy9wAAWJw7C30LW4AAAFFZXUt8S0A4IoiAP5uAAABRWV/LfktAOCLIgD+6SJnemFnAKCaKYADY2Vmb3BycwANLhAuJS4pLiMuLi40LukhcmN1YQABZGkULiEuAAFiZxguHC5hAHIAAKBfKmUAcaAnIgCgWSLlIXJwAKAYIXIAAOA12DTdcABmAADgNdho3WWgQCJhAHQA6ABqD2MAcgAA4DXYzNzjCuQRUC4AAFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg`)})),cv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.xmlDecodeTree=void 0,e.xmlDecodeTree=(0,ov().decodeBase64)(`AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg`)})),lv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BinTrieFlags=void 0;var t;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.FLAG13=8192]=`FLAG13`,e[e.BRANCH_LENGTH=8064]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(t||(e.BinTrieFlags=t={}))})),uv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.xmlDecodeTree=e.htmlDecodeTree=e.replaceCodePoint=e.fromCodePoint=e.decodeCodePoint=e.EntityDecoder=e.DecodingMode=void 0,e.determineBranch=h,e.decodeHTML=v,e.decodeHTMLAttribute=y,e.decodeHTMLStrict=b,e.decodeXML=x;var t=av(),n=sv(),r=cv(),i=lv(),a;(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`})(a||={});var o=32;function s(e){return e>=a.ZERO&&e<=a.NINE}function c(e){return e>=a.UPPER_A&&e<=a.UPPER_F||e>=a.LOWER_A&&e<=a.LOWER_F}function l(e){return e>=a.UPPER_A&&e<=a.UPPER_Z||e>=a.LOWER_A&&e<=a.LOWER_Z||s(e)}function u(e){return e===a.EQUALS||l(e)}var d;(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`})(d||={});var f;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(f||(e.DecodingMode=f={}));var p=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=d.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=f.Strict,this.runConsumed=0}startEntity(e){this.decodeMode=e,this.state=d.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case d.EntityStart:return e.charCodeAt(t)===a.NUM?(this.state=d.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=d.NamedEntity,this.stateNamedEntity(e,t));case d.NumericStart:return this.stateNumericStart(e,t);case d.NumericDecimal:return this.stateNumericDecimal(e,t);case d.NumericHex:return this.stateNumericHex(e,t);case d.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|o)===a.LOWER_X?(this.state=d.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=d.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(s(n)||c(n)){let e=n<=a.NINE?n-a.ZERO:(n|o)-a.LOWER_A+10;this.result=this.result*16+e,this.consumed++,t++}else return this.emitNumericEntity(n,3)}return-1}stateNumericDecimal(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(s(n))this.result=this.result*10+(n-a.ZERO),this.consumed++,t++;else return this.emitNumericEntity(n,2)}return-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)==null||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===a.SEMI)this.consumed+=1;else if(this.decodeMode===f.Strict)return 0;return this.emitCodePoint((0,t.replaceCodePoint)(this.result),this.consumed),this.errors&&(e!==a.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],o=(r&i.BinTrieFlags.VALUE_LENGTH)>>14;for(;t<e.length;){if(o===0&&(r&i.BinTrieFlags.FLAG13)!==0){let a=(r&i.BinTrieFlags.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let n=r&i.BinTrieFlags.JUMP_TABLE;if(e.charCodeAt(t)!==n)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(t>=e.length)return-1;let r=this.runConsumed-1,i=n[this.treeIndex+1+(r>>1)],a=r%2==0?i&255:i>>8&255;if(e.charCodeAt(t)!==a)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),r=n[this.treeIndex],o=(r&i.BinTrieFlags.VALUE_LENGTH)>>14}if(t>=e.length)break;let s=e.charCodeAt(t);if(s===a.SEMI&&o!==0&&(r&i.BinTrieFlags.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);if(this.treeIndex=h(n,r,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===f.Attribute&&(o===0||u(s))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],o=(r&i.BinTrieFlags.VALUE_LENGTH)>>14,o!==0){if(s===a.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==f.Strict&&(r&i.BinTrieFlags.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&i.BinTrieFlags.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]&~(i.BinTrieFlags.VALUE_LENGTH|i.BinTrieFlags.FLAG13):r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case d.NamedEntity:return this.result!==0&&(this.decodeMode!==f.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case d.NumericDecimal:return this.emitNumericEntity(0,2);case d.NumericHex:return this.emitNumericEntity(0,3);case d.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case d.EntityStart:return 0}}};e.EntityDecoder=p;function m(e){let n=``,r=new p(e,e=>n+=(0,t.fromCodePoint)(e));return function(e,t){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){n+=e.slice(i,a),r.startEntity(t);let o=r.write(e,a+1);if(o<0){i=a+r.end();break}i=a+o,a=o===0?i+1:i}let o=n+e.slice(i);return n=``,o}}function h(e,t,n,r){let a=(t&i.BinTrieFlags.BRANCH_LENGTH)>>7,o=t&i.BinTrieFlags.JUMP_TABLE;if(a===0)return o!==0&&r===o?n:-1;if(o){let t=r-o;return t<0||t>=a?-1:e[n+t]-1}let s=a+1>>1,c=0,l=a-1;for(;c<=l;){let t=c+l>>>1,i=e[n+(t>>1)]>>(t&1)*8&255;if(i<r)c=t+1;else if(i>r)l=t-1;else return e[n+s+t]}return-1}var g=m(n.htmlDecodeTree),_=m(r.xmlDecodeTree);function v(e,t=f.Legacy){return g(e,t)}function y(e){return g(e,f.Attribute)}function b(e){return g(e,f.Strict)}function x(e){return _(e,f.Strict)}var S=av();Object.defineProperty(e,"decodeCodePoint",{enumerable:!0,get:function(){return S.decodeCodePoint}}),Object.defineProperty(e,"fromCodePoint",{enumerable:!0,get:function(){return S.fromCodePoint}}),Object.defineProperty(e,"replaceCodePoint",{enumerable:!0,get:function(){return S.replaceCodePoint}});var C=sv();Object.defineProperty(e,"htmlDecodeTree",{enumerable:!0,get:function(){return C.htmlDecodeTree}});var w=cv();Object.defineProperty(e,"xmlDecodeTree",{enumerable:!0,get:function(){return w.xmlDecodeTree}})})),dv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.QuoteType=void 0;var t=uv(),n;(function(e){e[e.Tab=9]=`Tab`,e[e.NewLine=10]=`NewLine`,e[e.FormFeed=12]=`FormFeed`,e[e.CarriageReturn=13]=`CarriageReturn`,e[e.Space=32]=`Space`,e[e.ExclamationMark=33]=`ExclamationMark`,e[e.Number=35]=`Number`,e[e.Amp=38]=`Amp`,e[e.SingleQuote=39]=`SingleQuote`,e[e.DoubleQuote=34]=`DoubleQuote`,e[e.Dash=45]=`Dash`,e[e.Slash=47]=`Slash`,e[e.Zero=48]=`Zero`,e[e.Nine=57]=`Nine`,e[e.Semi=59]=`Semi`,e[e.Lt=60]=`Lt`,e[e.Eq=61]=`Eq`,e[e.Gt=62]=`Gt`,e[e.Questionmark=63]=`Questionmark`,e[e.UpperA=65]=`UpperA`,e[e.LowerA=97]=`LowerA`,e[e.UpperF=70]=`UpperF`,e[e.LowerF=102]=`LowerF`,e[e.UpperZ=90]=`UpperZ`,e[e.LowerZ=122]=`LowerZ`,e[e.LowerX=120]=`LowerX`,e[e.OpeningSquareBracket=91]=`OpeningSquareBracket`})(n||={});var r;(function(e){e[e.Text=1]=`Text`,e[e.BeforeTagName=2]=`BeforeTagName`,e[e.InTagName=3]=`InTagName`,e[e.InSelfClosingTag=4]=`InSelfClosingTag`,e[e.BeforeClosingTagName=5]=`BeforeClosingTagName`,e[e.InClosingTagName=6]=`InClosingTagName`,e[e.AfterClosingTagName=7]=`AfterClosingTagName`,e[e.BeforeAttributeName=8]=`BeforeAttributeName`,e[e.InAttributeName=9]=`InAttributeName`,e[e.AfterAttributeName=10]=`AfterAttributeName`,e[e.BeforeAttributeValue=11]=`BeforeAttributeValue`,e[e.InAttributeValueDq=12]=`InAttributeValueDq`,e[e.InAttributeValueSq=13]=`InAttributeValueSq`,e[e.InAttributeValueNq=14]=`InAttributeValueNq`,e[e.BeforeDeclaration=15]=`BeforeDeclaration`,e[e.InDeclaration=16]=`InDeclaration`,e[e.InProcessingInstruction=17]=`InProcessingInstruction`,e[e.BeforeComment=18]=`BeforeComment`,e[e.CDATASequence=19]=`CDATASequence`,e[e.InSpecialComment=20]=`InSpecialComment`,e[e.InCommentLike=21]=`InCommentLike`,e[e.BeforeSpecialS=22]=`BeforeSpecialS`,e[e.BeforeSpecialT=23]=`BeforeSpecialT`,e[e.SpecialStartSequence=24]=`SpecialStartSequence`,e[e.InSpecialTag=25]=`InSpecialTag`,e[e.InEntity=26]=`InEntity`})(r||={});function i(e){return e===n.Space||e===n.NewLine||e===n.Tab||e===n.FormFeed||e===n.CarriageReturn}function a(e){return e===n.Slash||e===n.Gt||i(e)}function o(e){return e>=n.LowerA&&e<=n.LowerZ||e>=n.UpperA&&e<=n.UpperZ}var s;(function(e){e[e.NoValue=0]=`NoValue`,e[e.Unquoted=1]=`Unquoted`,e[e.Single=2]=`Single`,e[e.Double=3]=`Double`})(s||(e.QuoteType=s={}));var c={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])};e.default=class{constructor({xmlMode:e=!1,decodeEntities:n=!0},i){this.cbs=i,this.state=r.Text,this.buffer=``,this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=r.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=e,this.decodeEntities=n,this.entityDecoder=new t.EntityDecoder(e?t.xmlDecodeTree:t.htmlDecodeTree,(e,t)=>this.emitCodePoint(e,t))}reset(){this.state=r.Text,this.buffer=``,this.sectionStart=0,this.index=0,this.baseState=r.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(e){e===n.Lt||!this.decodeEntities&&this.fastForwardTo(n.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=r.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===n.Amp&&this.startEntity()}stateSpecialStartSequence(e){let t=this.sequenceIndex===this.currentSequence.length;if(!(t?a(e):(e|32)===this.currentSequence[this.sequenceIndex]))this.isSpecial=!1;else if(!t){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=r.InTagName,this.stateInTagName(e)}stateInSpecialTag(e){if(this.sequenceIndex===this.currentSequence.length){if(e===n.Gt||i(e)){let t=this.index-this.currentSequence.length;if(this.sectionStart<t){let e=this.index;this.index=t,this.cbs.ontext(this.sectionStart,t),this.index=e}this.isSpecial=!1,this.sectionStart=t+2,this.stateInClosingTagName(e);return}this.sequenceIndex=0}(e|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===c.TitleEnd?this.decodeEntities&&e===n.Amp&&this.startEntity():this.fastForwardTo(n.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=Number(e===n.Lt)}stateCDATASequence(e){e===c.Cdata[this.sequenceIndex]?++this.sequenceIndex===c.Cdata.length&&(this.state=r.InCommentLike,this.currentSequence=c.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=r.InDeclaration,this.stateInDeclaration(e))}fastForwardTo(e){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===e)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(e){e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===c.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=r.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(e){return this.xmlMode?!a(e):o(e)}startSpecial(e,t){this.isSpecial=!0,this.currentSequence=e,this.sequenceIndex=t,this.state=r.SpecialStartSequence}stateBeforeTagName(e){if(e===n.ExclamationMark)this.state=r.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===n.Questionmark)this.state=r.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(e)){let t=e|32;this.sectionStart=this.index,this.xmlMode?this.state=r.InTagName:t===c.ScriptEnd[2]?this.state=r.BeforeSpecialS:t===c.TitleEnd[2]||t===c.XmpEnd[2]?this.state=r.BeforeSpecialT:this.state=r.InTagName}else e===n.Slash?this.state=r.BeforeClosingTagName:(this.state=r.Text,this.stateText(e))}stateInTagName(e){a(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateBeforeClosingTagName(e){i(e)||(e===n.Gt?this.state=r.Text:(this.state=this.isTagStartChar(e)?r.InClosingTagName:r.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(e){(e===n.Gt||i(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=r.AfterClosingTagName,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){(e===n.Gt||this.fastForwardTo(n.Gt))&&(this.state=r.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(e){e===n.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=r.InSpecialTag,this.sequenceIndex=0):this.state=r.Text,this.sectionStart=this.index+1):e===n.Slash?this.state=r.InSelfClosingTag:i(e)||(this.state=r.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(e){e===n.Gt?(this.cbs.onselfclosingtag(this.index),this.state=r.Text,this.sectionStart=this.index+1,this.isSpecial=!1):i(e)||(this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateInAttributeName(e){(e===n.Eq||a(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=r.AfterAttributeName,this.stateAfterAttributeName(e))}stateAfterAttributeName(e){e===n.Eq?this.state=r.BeforeAttributeValue:e===n.Slash||e===n.Gt?(this.cbs.onattribend(s.NoValue,this.sectionStart),this.sectionStart=-1,this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(e)):i(e)||(this.cbs.onattribend(s.NoValue,this.sectionStart),this.state=r.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(e){e===n.DoubleQuote?(this.state=r.InAttributeValueDq,this.sectionStart=this.index+1):e===n.SingleQuote?(this.state=r.InAttributeValueSq,this.sectionStart=this.index+1):i(e)||(this.sectionStart=this.index,this.state=r.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))}handleInAttributeValue(e,t){e===t||!this.decodeEntities&&this.fastForwardTo(t)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(t===n.DoubleQuote?s.Double:s.Single,this.index+1),this.state=r.BeforeAttributeName):this.decodeEntities&&e===n.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(e){this.handleInAttributeValue(e,n.DoubleQuote)}stateInAttributeValueSingleQuotes(e){this.handleInAttributeValue(e,n.SingleQuote)}stateInAttributeValueNoQuotes(e){i(e)||e===n.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(s.Unquoted,this.index),this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===n.Amp&&this.startEntity()}stateBeforeDeclaration(e){e===n.OpeningSquareBracket?(this.state=r.CDATASequence,this.sequenceIndex=0):this.state=e===n.Dash?r.BeforeComment:r.InDeclaration}stateInDeclaration(e){(e===n.Gt||this.fastForwardTo(n.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=r.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){(e===n.Gt||this.fastForwardTo(n.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=r.Text,this.sectionStart=this.index+1)}stateBeforeComment(e){e===n.Dash?(this.state=r.InCommentLike,this.currentSequence=c.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=r.InDeclaration}stateInSpecialComment(e){(e===n.Gt||this.fastForwardTo(n.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=r.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(e){let t=e|32;t===c.ScriptEnd[3]?this.startSpecial(c.ScriptEnd,4):t===c.StyleEnd[3]?this.startSpecial(c.StyleEnd,4):(this.state=r.InTagName,this.stateInTagName(e))}stateBeforeSpecialT(e){switch(e|32){case c.TitleEnd[3]:this.startSpecial(c.TitleEnd,4);break;case c.TextareaEnd[3]:this.startSpecial(c.TextareaEnd,4);break;case c.XmpEnd[3]:this.startSpecial(c.XmpEnd,4);break;default:this.state=r.InTagName,this.stateInTagName(e)}}startEntity(){this.baseState=this.state,this.state=r.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?t.DecodingMode.Strict:this.baseState===r.Text||this.baseState===r.InSpecialTag?t.DecodingMode.Legacy:t.DecodingMode.Attribute)}stateInEntity(){let e=this.index-this.offset,t=this.entityDecoder.write(this.buffer,e);if(t>=0)this.state=this.baseState,t===0&&--this.index;else{if(e<this.buffer.length&&this.buffer.charCodeAt(e)===n.Amp){this.state=this.baseState,--this.index;return}this.index=this.offset+this.buffer.length-1}}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===r.Text||this.state===r.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===r.InAttributeValueDq||this.state===r.InAttributeValueSq||this.state===r.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){let e=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case r.Text:this.stateText(e);break;case r.SpecialStartSequence:this.stateSpecialStartSequence(e);break;case r.InSpecialTag:this.stateInSpecialTag(e);break;case r.CDATASequence:this.stateCDATASequence(e);break;case r.InAttributeValueDq:this.stateInAttributeValueDoubleQuotes(e);break;case r.InAttributeName:this.stateInAttributeName(e);break;case r.InCommentLike:this.stateInCommentLike(e);break;case r.InSpecialComment:this.stateInSpecialComment(e);break;case r.BeforeAttributeName:this.stateBeforeAttributeName(e);break;case r.InTagName:this.stateInTagName(e);break;case r.InClosingTagName:this.stateInClosingTagName(e);break;case r.BeforeTagName:this.stateBeforeTagName(e);break;case r.AfterAttributeName:this.stateAfterAttributeName(e);break;case r.InAttributeValueSq:this.stateInAttributeValueSingleQuotes(e);break;case r.BeforeAttributeValue:this.stateBeforeAttributeValue(e);break;case r.BeforeClosingTagName:this.stateBeforeClosingTagName(e);break;case r.AfterClosingTagName:this.stateAfterClosingTagName(e);break;case r.BeforeSpecialS:this.stateBeforeSpecialS(e);break;case r.BeforeSpecialT:this.stateBeforeSpecialT(e);break;case r.InAttributeValueNq:this.stateInAttributeValueNoQuotes(e);break;case r.InSelfClosingTag:this.stateInSelfClosingTag(e);break;case r.InDeclaration:this.stateInDeclaration(e);break;case r.BeforeDeclaration:this.stateBeforeDeclaration(e);break;case r.BeforeComment:this.stateBeforeComment(e);break;case r.InProcessingInstruction:this.stateInProcessingInstruction(e);break;case r.InEntity:this.stateInEntity();break}this.index++}this.cleanup()}finish(){this.state===r.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){let e=this.buffer.length+this.offset;this.sectionStart>=e||(this.state===r.InCommentLike?this.currentSequence===c.CdataEnd?this.cbs.oncdata(this.sectionStart,e,0):this.cbs.oncomment(this.sectionStart,e,0):this.state===r.InTagName||this.state===r.BeforeAttributeName||this.state===r.BeforeAttributeValue||this.state===r.AfterAttributeName||this.state===r.InAttributeName||this.state===r.InAttributeValueSq||this.state===r.InAttributeValueDq||this.state===r.InAttributeValueNq||this.state===r.InClosingTagName||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,t){this.baseState!==r.Text&&this.baseState!==r.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+t,this.index=this.sectionStart-1,this.cbs.onattribentity(e)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+t,this.index=this.sectionStart-1,this.cbs.ontextentity(e,this.sectionStart))}}})),fv=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;o<a.length;o++)a[o]!=="default"&&t(i,r,a[o]);return n(i,r),i}})();Object.defineProperty(e,"__esModule",{value:!0}),e.Parser=void 0;var i=r(dv()),a=uv(),o=new Set([`input`,`option`,`optgroup`,`select`,`button`,`datalist`,`textarea`]),s=new Set([`p`]),c=new Set([`thead`,`tbody`]),l=new Set([`dd`,`dt`]),u=new Set([`rt`,`rp`]),d=new Map([[`tr`,new Set([`tr`,`th`,`td`])],[`th`,new Set([`th`])],[`td`,new Set([`thead`,`th`,`td`])],[`body`,new Set([`head`,`link`,`script`])],[`li`,new Set([`li`])],[`p`,s],[`h1`,s],[`h2`,s],[`h3`,s],[`h4`,s],[`h5`,s],[`h6`,s],[`select`,o],[`input`,o],[`output`,o],[`button`,o],[`datalist`,o],[`textarea`,o],[`option`,new Set([`option`])],[`optgroup`,new Set([`optgroup`,`option`])],[`dd`,l],[`dt`,l],[`address`,s],[`article`,s],[`aside`,s],[`blockquote`,s],[`details`,s],[`div`,s],[`dl`,s],[`fieldset`,s],[`figcaption`,s],[`figure`,s],[`footer`,s],[`form`,s],[`header`,s],[`hr`,s],[`main`,s],[`nav`,s],[`ol`,s],[`pre`,s],[`section`,s],[`table`,s],[`ul`,s],[`rt`,u],[`rp`,u],[`tbody`,c],[`tfoot`,c]]),f=new Set([`area`,`base`,`basefont`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`img`,`input`,`isindex`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),p=new Set([`math`,`svg`]),m=new Set([`mi`,`mo`,`mn`,`ms`,`mtext`,`annotation-xml`,`foreignobject`,`desc`,`title`]),h=/\s|\//;e.Parser=class{constructor(e,t={}){var n,r;this.options=t,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname=``,this.attribname=``,this.attribvalue=``,this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=e??{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=t.lowerCaseTags??this.htmlMode,this.lowerCaseAttributeNames=t.lowerCaseAttributeNames??this.htmlMode,this.recognizeSelfClosing=t.recognizeSelfClosing??!this.htmlMode,this.tokenizer=new(t.Tokenizer??i.default)(this.options,this),this.foreignContext=[!this.htmlMode],(r=(n=this.cbs).onparserinit)==null||r.call(n,this)}ontext(e,t){var n,r;let i=this.getSlice(e,t);this.endIndex=t-1,(r=(n=this.cbs).ontext)==null||r.call(n,i),this.startIndex=t}ontextentity(e,t){var n,r;this.endIndex=t-1,(r=(n=this.cbs).ontext)==null||r.call(n,(0,a.fromCodePoint)(e)),this.startIndex=t}isVoidElement(e){return this.htmlMode&&f.has(e)}onopentagname(e,t){this.endIndex=t;let n=this.getSlice(e,t);this.lowerCaseTagNames&&(n=n.toLowerCase()),this.emitOpenTag(n)}emitOpenTag(e){var t,n,r,i;this.openTagStart=this.startIndex,this.tagname=e;let a=this.htmlMode&&d.get(e);if(a)for(;this.stack.length>0&&a.has(this.stack[0]);){let e=this.stack.shift();(n=(t=this.cbs).onclosetag)==null||n.call(t,e,!0)}this.isVoidElement(e)||(this.stack.unshift(e),this.htmlMode&&(p.has(e)?this.foreignContext.unshift(!0):m.has(e)&&this.foreignContext.unshift(!1))),(i=(r=this.cbs).onopentagname)==null||i.call(r,e),this.cbs.onopentag&&(this.attribs={})}endOpenTag(e){var t,n;this.startIndex=this.openTagStart,this.attribs&&=((n=(t=this.cbs).onopentag)==null||n.call(t,this.tagname,this.attribs,e),null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=``}onopentagend(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1}onclosetag(e,t){var n,r,i,a,o,s,c,l;this.endIndex=t;let u=this.getSlice(e,t);if(this.lowerCaseTagNames&&(u=u.toLowerCase()),this.htmlMode&&(p.has(u)||m.has(u))&&this.foreignContext.shift(),this.isVoidElement(u))this.htmlMode&&u===`br`&&((a=(i=this.cbs).onopentagname)==null||a.call(i,`br`),(s=(o=this.cbs).onopentag)==null||s.call(o,`br`,{},!0),(l=(c=this.cbs).onclosetag)==null||l.call(c,`br`,!1));else{let e=this.stack.indexOf(u);if(e!==-1)for(let t=0;t<=e;t++){let i=this.stack.shift();(r=(n=this.cbs).onclosetag)==null||r.call(n,i,t!==e)}else this.htmlMode&&u===`p`&&(this.emitOpenTag(`p`),this.closeCurrentTag(!0))}this.startIndex=t+1}onselfclosingtag(e){this.endIndex=e,this.recognizeSelfClosing||this.foreignContext[0]?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)}closeCurrentTag(e){var t,n;let r=this.tagname;this.endOpenTag(e),this.stack[0]===r&&((n=(t=this.cbs).onclosetag)==null||n.call(t,r,!e),this.stack.shift())}onattribname(e,t){this.startIndex=e;let n=this.getSlice(e,t);this.attribname=this.lowerCaseAttributeNames?n.toLowerCase():n}onattribdata(e,t){this.attribvalue+=this.getSlice(e,t)}onattribentity(e){this.attribvalue+=(0,a.fromCodePoint)(e)}onattribend(e,t){var n,r;this.endIndex=t,(r=(n=this.cbs).onattribute)==null||r.call(n,this.attribname,this.attribvalue,e===i.QuoteType.Double?`"`:e===i.QuoteType.Single?`'`:e===i.QuoteType.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=``}getInstructionName(e){let t=e.search(h),n=t<0?e:e.substr(0,t);return this.lowerCaseTagNames&&(n=n.toLowerCase()),n}ondeclaration(e,t){this.endIndex=t;let n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){let e=this.getInstructionName(n);this.cbs.onprocessinginstruction(`!${e}`,`!${n}`)}this.startIndex=t+1}onprocessinginstruction(e,t){this.endIndex=t;let n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){let e=this.getInstructionName(n);this.cbs.onprocessinginstruction(`?${e}`,`?${n}`)}this.startIndex=t+1}oncomment(e,t,n){var r,i,a,o;this.endIndex=t,(i=(r=this.cbs).oncomment)==null||i.call(r,this.getSlice(e,t-n)),(o=(a=this.cbs).oncommentend)==null||o.call(a),this.startIndex=t+1}oncdata(e,t,n){var r,i,a,o,s,c,l,u,d,f;this.endIndex=t;let p=this.getSlice(e,t-n);!this.htmlMode||this.options.recognizeCDATA?((i=(r=this.cbs).oncdatastart)==null||i.call(r),(o=(a=this.cbs).ontext)==null||o.call(a,p),(c=(s=this.cbs).oncdataend)==null||c.call(s)):((u=(l=this.cbs).oncomment)==null||u.call(l,`[CDATA[${p}]]`),(f=(d=this.cbs).oncommentend)==null||f.call(d)),this.startIndex=t+1}onend(){var e,t;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let e=0;e<this.stack.length;e++)this.cbs.onclosetag(this.stack[e],!0)}(t=(e=this.cbs).onend)==null||t.call(e)}reset(){var e,t,n,r;(t=(e=this.cbs).onreset)==null||t.call(e),this.tokenizer.reset(),this.tagname=``,this.attribname=``,this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(r=(n=this.cbs).onparserinit)==null||r.call(n,this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(!this.htmlMode),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(e){this.reset(),this.end(e)}getSlice(e,t){for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let n=this.buffers[0].slice(e-this.bufferOffset,t-this.bufferOffset);for(;t-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),n+=this.buffers[0].slice(0,t-this.bufferOffset);return n}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(e){var t,n;if(this.ended){(n=(t=this.cbs).onerror)==null||n.call(t,Error(`.write() after done!`));return}this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++)}end(e){var t,n;if(this.ended){(n=(t=this.cbs).onerror)==null||n.call(t,Error(`.end() after done!`));return}e&&this.write(e),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}parseChunk(e){this.write(e)}done(e){this.end(e)}}})),pv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var t;(function(e){e.Root=`root`,e.Text=`text`,e.Directive=`directive`,e.Comment=`comment`,e.Script=`script`,e.Style=`style`,e.Tag=`tag`,e.CDATA=`cdata`,e.Doctype=`doctype`})(t=e.ElementType||={});function n(e){return e.type===t.Tag||e.type===t.Script||e.type===t.Style}e.isTag=n,e.Root=t.Root,e.Text=t.Text,e.Directive=t.Directive,e.Comment=t.Comment,e.Script=t.Script,e.Style=t.Style,e.Tag=t.Tag,e.CDATA=t.CDATA,e.Doctype=t.Doctype})),mv=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),n=e&&e.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.cloneNode=e.hasChildren=e.isDocument=e.isDirective=e.isComment=e.isText=e.isCDATA=e.isTag=e.Element=e.Document=e.CDATA=e.NodeWithChildren=e.ProcessingInstruction=e.Comment=e.Text=e.DataNode=e.Node=void 0;var r=pv(),i=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(e){return e===void 0&&(e=!1),b(this,e)},e}();e.Node=i;var a=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.data=t,n}return Object.defineProperty(n.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!1,configurable:!0}),n}(i);e.DataNode=a;var o=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=r.ElementType.Text,t}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),n}(a);e.Text=o;var s=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=r.ElementType.Comment,t}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),n}(a);e.Comment=s;var c=function(e){t(n,e);function n(t,n){var i=e.call(this,n)||this;return i.name=t,i.type=r.ElementType.Directive,i}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),n}(a);e.ProcessingInstruction=c;var l=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.children=t,n}return Object.defineProperty(n.prototype,"firstChild",{get:function(){return this.children[0]??null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),n}(i);e.NodeWithChildren=l;var u=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=r.ElementType.CDATA,t}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),n}(l);e.CDATA=u;var d=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=r.ElementType.Root,t}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),n}(l);e.Document=d;var f=function(e){t(n,e);function n(t,n,i,a){i===void 0&&(i=[]),a===void 0&&(a=t===`script`?r.ElementType.Script:t===`style`?r.ElementType.Style:r.ElementType.Tag);var o=e.call(this,i)||this;return o.name=t,o.attribs=n,o.type=a,o}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map(function(t){return{name:t,value:e.attribs[t],namespace:e[`x-attribsNamespace`]?.[t],prefix:e[`x-attribsPrefix`]?.[t]}})},enumerable:!1,configurable:!0}),n}(l);e.Element=f;function p(e){return(0,r.isTag)(e)}e.isTag=p;function m(e){return e.type===r.ElementType.CDATA}e.isCDATA=m;function h(e){return e.type===r.ElementType.Text}e.isText=h;function g(e){return e.type===r.ElementType.Comment}e.isComment=g;function _(e){return e.type===r.ElementType.Directive}e.isDirective=_;function v(e){return e.type===r.ElementType.Root}e.isDocument=v;function y(e){return Object.prototype.hasOwnProperty.call(e,`children`)}e.hasChildren=y;function b(e,t){t===void 0&&(t=!1);var r;if(h(e))r=new o(e.data);else if(g(e))r=new s(e.data);else if(p(e)){var i=t?x(e.children):[],a=new f(e.name,n({},e.attribs),i);i.forEach(function(e){return e.parent=a}),e.namespace!=null&&(a.namespace=e.namespace),e[`x-attribsNamespace`]&&(a[`x-attribsNamespace`]=n({},e[`x-attribsNamespace`])),e[`x-attribsPrefix`]&&(a[`x-attribsPrefix`]=n({},e[`x-attribsPrefix`])),r=a}else if(m(e)){var i=t?x(e.children):[],l=new u(i);i.forEach(function(e){return e.parent=l}),r=l}else if(v(e)){var i=t?x(e.children):[],y=new d(i);i.forEach(function(e){return e.parent=y}),e[`x-mode`]&&(y[`x-mode`]=e[`x-mode`]),r=y}else if(_(e)){var b=new c(e.name,e.data);e[`x-name`]!=null&&(b[`x-name`]=e[`x-name`],b[`x-publicId`]=e[`x-publicId`],b[`x-systemId`]=e[`x-systemId`]),r=b}else throw Error(`Not implemented yet: ${e.type}`);return r.startIndex=e.startIndex,r.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(r.sourceCodeLocation=e.sourceCodeLocation),r}e.cloneNode=b;function x(e){for(var t=e.map(function(e){return b(e,!0)}),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}})),hv=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var r=pv(),i=mv();n(mv(),e);var a={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},o=function(){function e(e,t,n){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof t==`function`&&(n=t,t=a),typeof e==`object`&&(t=e,e=void 0),this.callback=e??null,this.options=t??a,this.elementCB=n??null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?r.ElementType.Tag:void 0,a=new i.Element(e,t,void 0,n);this.addNode(a),this.tagStack.push(a)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===r.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new i.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment){this.lastNode.data+=e;return}var t=new i.Comment(e);this.addNode(t),this.lastNode=t},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new i.Text(``),t=new i.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new i.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if(typeof this.callback==`function`)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();e.DomHandler=o,e.default=o})),gv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=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(function(e){return e.charCodeAt(0)}))})),_v=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=new Uint16Array(`Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢`.split(``).map(function(e){return e.charCodeAt(0)}))})),vv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.replaceCodePoint=e.fromCodePoint=void 0;var t=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]]);e.fromCodePoint=String.fromCodePoint??function(e){var t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function n(e){return e>=55296&&e<=57343||e>1114111?65533:t.get(e)??e}e.replaceCodePoint=n;function r(t){return(0,e.fromCodePoint)(n(t))}e.default=r})),yv=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.decodeXML=e.decodeHTMLStrict=e.decodeHTMLAttribute=e.decodeHTML=e.determineBranch=e.EntityDecoder=e.DecodingMode=e.BinTrieFlags=e.fromCodePoint=e.replaceCodePoint=e.decodeCodePoint=e.xmlDecodeTree=e.htmlDecodeTree=void 0;var a=i(gv());e.htmlDecodeTree=a.default;var o=i(_v());e.xmlDecodeTree=o.default;var s=r(vv());e.decodeCodePoint=s.default;var c=vv();Object.defineProperty(e,"replaceCodePoint",{enumerable:!0,get:function(){return c.replaceCodePoint}}),Object.defineProperty(e,"fromCodePoint",{enumerable:!0,get:function(){return c.fromCodePoint}});var l;(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`})(l||={});var u=32,d;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(d=e.BinTrieFlags||={});function f(e){return e>=l.ZERO&&e<=l.NINE}function p(e){return e>=l.UPPER_A&&e<=l.UPPER_F||e>=l.LOWER_A&&e<=l.LOWER_F}function m(e){return e>=l.UPPER_A&&e<=l.UPPER_Z||e>=l.LOWER_A&&e<=l.LOWER_Z||f(e)}function h(e){return e===l.EQUALS||m(e)}var g;(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`})(g||={});var _;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(_=e.DecodingMode||={});var v=function(){function e(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=g.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=_.Strict}return e.prototype.startEntity=function(e){this.decodeMode=e,this.state=g.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1},e.prototype.write=function(e,t){switch(this.state){case g.EntityStart:return e.charCodeAt(t)===l.NUM?(this.state=g.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=g.NamedEntity,this.stateNamedEntity(e,t));case g.NumericStart:return this.stateNumericStart(e,t);case g.NumericDecimal:return this.stateNumericDecimal(e,t);case g.NumericHex:return this.stateNumericHex(e,t);case g.NamedEntity:return this.stateNamedEntity(e,t)}},e.prototype.stateNumericStart=function(e,t){return t>=e.length?-1:(e.charCodeAt(t)|u)===l.LOWER_X?(this.state=g.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=g.NumericDecimal,this.stateNumericDecimal(e,t))},e.prototype.addToNumericResult=function(e,t,n,r){if(t!==n){var i=n-t;this.result=this.result*r**+i+parseInt(e.substr(t,i),r),this.consumed+=i}},e.prototype.stateNumericHex=function(e,t){for(var n=t;t<e.length;){var r=e.charCodeAt(t);if(f(r)||p(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1},e.prototype.stateNumericDecimal=function(e,t){for(var n=t;t<e.length;){var r=e.charCodeAt(t);if(f(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1},e.prototype.emitNumericEntity=function(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===l.SEMI)this.consumed+=1;else if(this.decodeMode===_.Strict)return 0;return this.emitCodePoint((0,s.replaceCodePoint)(this.result),this.consumed),this.errors&&(e!==l.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed},e.prototype.stateNamedEntity=function(e,t){for(var n=this.decodeTree,r=n[this.treeIndex],i=(r&d.VALUE_LENGTH)>>14;t<e.length;t++,this.excess++){var a=e.charCodeAt(t);if(this.treeIndex=b(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===_.Attribute&&(i===0||h(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&d.VALUE_LENGTH)>>14,i!==0){if(a===l.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==_.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1},e.prototype.emitNotTerminatedNamedEntity=function(){var e,t=this,n=t.result,r=(t.decodeTree[n]&d.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed},e.prototype.emitNamedEntityData=function(e,t,n){var r=this.decodeTree;return this.emitCodePoint(t===1?r[e]&~d.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n},e.prototype.end=function(){var e;switch(this.state){case g.NamedEntity:return this.result!==0&&(this.decodeMode!==_.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case g.NumericDecimal:return this.emitNumericEntity(0,2);case g.NumericHex:return this.emitNumericEntity(0,3);case g.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case g.EntityStart:return 0}},e}();e.EntityDecoder=v;function y(e){var t=``,n=new v(e,function(e){return t+=(0,s.fromCodePoint)(e)});return function(e,r){for(var i=0,a=0;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);var o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}var s=t+e.slice(i);return t=``,s}}function b(e,t,n,r){var i=(t&d.BRANCH_LENGTH)>>7,a=t&d.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){var o=r-a;return o<0||o>=i?-1:e[n+o]-1}for(var s=n,c=s+i-1;s<=c;){var l=s+c>>>1,u=e[l];if(u<r)s=l+1;else if(u>r)c=l-1;else return e[l+i]}return-1}e.determineBranch=b;var x=y(a.default),S=y(o.default);function C(e,t){return t===void 0&&(t=_.Legacy),x(e,t)}e.decodeHTML=C;function w(e){return x(e,_.Attribute)}e.decodeHTMLAttribute=w;function T(e){return x(e,_.Strict)}e.decodeHTMLStrict=T;function E(e){return S(e,_.Strict)}e.decodeXML=E})),bv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){for(var t=1;t<e.length;t++)e[t][0]+=e[t-1][0]+1;return e}e.default=new Map(t([[9,`&Tab;`],[0,`&NewLine;`],[22,`&excl;`],[0,`&quot;`],[0,`&num;`],[0,`&dollar;`],[0,`&percnt;`],[0,`&amp;`],[0,`&apos;`],[0,`&lpar;`],[0,`&rpar;`],[0,`&ast;`],[0,`&plus;`],[0,`&comma;`],[1,`&period;`],[0,`&sol;`],[10,`&colon;`],[0,`&semi;`],[0,{v:`&lt;`,n:8402,o:`&nvlt;`}],[0,{v:`&equals;`,n:8421,o:`&bne;`}],[0,{v:`&gt;`,n:8402,o:`&nvgt;`}],[0,`&quest;`],[0,`&commat;`],[26,`&lbrack;`],[0,`&bsol;`],[0,`&rbrack;`],[0,`&Hat;`],[0,`&lowbar;`],[0,`&DiacriticalGrave;`],[5,{n:106,o:`&fjlig;`}],[20,`&lbrace;`],[0,`&verbar;`],[0,`&rbrace;`],[34,`&nbsp;`],[0,`&iexcl;`],[0,`&cent;`],[0,`&pound;`],[0,`&curren;`],[0,`&yen;`],[0,`&brvbar;`],[0,`&sect;`],[0,`&die;`],[0,`&copy;`],[0,`&ordf;`],[0,`&laquo;`],[0,`&not;`],[0,`&shy;`],[0,`&circledR;`],[0,`&macr;`],[0,`&deg;`],[0,`&PlusMinus;`],[0,`&sup2;`],[0,`&sup3;`],[0,`&acute;`],[0,`&micro;`],[0,`&para;`],[0,`&centerdot;`],[0,`&cedil;`],[0,`&sup1;`],[0,`&ordm;`],[0,`&raquo;`],[0,`&frac14;`],[0,`&frac12;`],[0,`&frac34;`],[0,`&iquest;`],[0,`&Agrave;`],[0,`&Aacute;`],[0,`&Acirc;`],[0,`&Atilde;`],[0,`&Auml;`],[0,`&angst;`],[0,`&AElig;`],[0,`&Ccedil;`],[0,`&Egrave;`],[0,`&Eacute;`],[0,`&Ecirc;`],[0,`&Euml;`],[0,`&Igrave;`],[0,`&Iacute;`],[0,`&Icirc;`],[0,`&Iuml;`],[0,`&ETH;`],[0,`&Ntilde;`],[0,`&Ograve;`],[0,`&Oacute;`],[0,`&Ocirc;`],[0,`&Otilde;`],[0,`&Ouml;`],[0,`&times;`],[0,`&Oslash;`],[0,`&Ugrave;`],[0,`&Uacute;`],[0,`&Ucirc;`],[0,`&Uuml;`],[0,`&Yacute;`],[0,`&THORN;`],[0,`&szlig;`],[0,`&agrave;`],[0,`&aacute;`],[0,`&acirc;`],[0,`&atilde;`],[0,`&auml;`],[0,`&aring;`],[0,`&aelig;`],[0,`&ccedil;`],[0,`&egrave;`],[0,`&eacute;`],[0,`&ecirc;`],[0,`&euml;`],[0,`&igrave;`],[0,`&iacute;`],[0,`&icirc;`],[0,`&iuml;`],[0,`&eth;`],[0,`&ntilde;`],[0,`&ograve;`],[0,`&oacute;`],[0,`&ocirc;`],[0,`&otilde;`],[0,`&ouml;`],[0,`&div;`],[0,`&oslash;`],[0,`&ugrave;`],[0,`&uacute;`],[0,`&ucirc;`],[0,`&uuml;`],[0,`&yacute;`],[0,`&thorn;`],[0,`&yuml;`],[0,`&Amacr;`],[0,`&amacr;`],[0,`&Abreve;`],[0,`&abreve;`],[0,`&Aogon;`],[0,`&aogon;`],[0,`&Cacute;`],[0,`&cacute;`],[0,`&Ccirc;`],[0,`&ccirc;`],[0,`&Cdot;`],[0,`&cdot;`],[0,`&Ccaron;`],[0,`&ccaron;`],[0,`&Dcaron;`],[0,`&dcaron;`],[0,`&Dstrok;`],[0,`&dstrok;`],[0,`&Emacr;`],[0,`&emacr;`],[2,`&Edot;`],[0,`&edot;`],[0,`&Eogon;`],[0,`&eogon;`],[0,`&Ecaron;`],[0,`&ecaron;`],[0,`&Gcirc;`],[0,`&gcirc;`],[0,`&Gbreve;`],[0,`&gbreve;`],[0,`&Gdot;`],[0,`&gdot;`],[0,`&Gcedil;`],[1,`&Hcirc;`],[0,`&hcirc;`],[0,`&Hstrok;`],[0,`&hstrok;`],[0,`&Itilde;`],[0,`&itilde;`],[0,`&Imacr;`],[0,`&imacr;`],[2,`&Iogon;`],[0,`&iogon;`],[0,`&Idot;`],[0,`&imath;`],[0,`&IJlig;`],[0,`&ijlig;`],[0,`&Jcirc;`],[0,`&jcirc;`],[0,`&Kcedil;`],[0,`&kcedil;`],[0,`&kgreen;`],[0,`&Lacute;`],[0,`&lacute;`],[0,`&Lcedil;`],[0,`&lcedil;`],[0,`&Lcaron;`],[0,`&lcaron;`],[0,`&Lmidot;`],[0,`&lmidot;`],[0,`&Lstrok;`],[0,`&lstrok;`],[0,`&Nacute;`],[0,`&nacute;`],[0,`&Ncedil;`],[0,`&ncedil;`],[0,`&Ncaron;`],[0,`&ncaron;`],[0,`&napos;`],[0,`&ENG;`],[0,`&eng;`],[0,`&Omacr;`],[0,`&omacr;`],[2,`&Odblac;`],[0,`&odblac;`],[0,`&OElig;`],[0,`&oelig;`],[0,`&Racute;`],[0,`&racute;`],[0,`&Rcedil;`],[0,`&rcedil;`],[0,`&Rcaron;`],[0,`&rcaron;`],[0,`&Sacute;`],[0,`&sacute;`],[0,`&Scirc;`],[0,`&scirc;`],[0,`&Scedil;`],[0,`&scedil;`],[0,`&Scaron;`],[0,`&scaron;`],[0,`&Tcedil;`],[0,`&tcedil;`],[0,`&Tcaron;`],[0,`&tcaron;`],[0,`&Tstrok;`],[0,`&tstrok;`],[0,`&Utilde;`],[0,`&utilde;`],[0,`&Umacr;`],[0,`&umacr;`],[0,`&Ubreve;`],[0,`&ubreve;`],[0,`&Uring;`],[0,`&uring;`],[0,`&Udblac;`],[0,`&udblac;`],[0,`&Uogon;`],[0,`&uogon;`],[0,`&Wcirc;`],[0,`&wcirc;`],[0,`&Ycirc;`],[0,`&ycirc;`],[0,`&Yuml;`],[0,`&Zacute;`],[0,`&zacute;`],[0,`&Zdot;`],[0,`&zdot;`],[0,`&Zcaron;`],[0,`&zcaron;`],[19,`&fnof;`],[34,`&imped;`],[63,`&gacute;`],[65,`&jmath;`],[142,`&circ;`],[0,`&caron;`],[16,`&breve;`],[0,`&DiacriticalDot;`],[0,`&ring;`],[0,`&ogon;`],[0,`&DiacriticalTilde;`],[0,`&dblac;`],[51,`&DownBreve;`],[127,`&Alpha;`],[0,`&Beta;`],[0,`&Gamma;`],[0,`&Delta;`],[0,`&Epsilon;`],[0,`&Zeta;`],[0,`&Eta;`],[0,`&Theta;`],[0,`&Iota;`],[0,`&Kappa;`],[0,`&Lambda;`],[0,`&Mu;`],[0,`&Nu;`],[0,`&Xi;`],[0,`&Omicron;`],[0,`&Pi;`],[0,`&Rho;`],[1,`&Sigma;`],[0,`&Tau;`],[0,`&Upsilon;`],[0,`&Phi;`],[0,`&Chi;`],[0,`&Psi;`],[0,`&ohm;`],[7,`&alpha;`],[0,`&beta;`],[0,`&gamma;`],[0,`&delta;`],[0,`&epsi;`],[0,`&zeta;`],[0,`&eta;`],[0,`&theta;`],[0,`&iota;`],[0,`&kappa;`],[0,`&lambda;`],[0,`&mu;`],[0,`&nu;`],[0,`&xi;`],[0,`&omicron;`],[0,`&pi;`],[0,`&rho;`],[0,`&sigmaf;`],[0,`&sigma;`],[0,`&tau;`],[0,`&upsi;`],[0,`&phi;`],[0,`&chi;`],[0,`&psi;`],[0,`&omega;`],[7,`&thetasym;`],[0,`&Upsi;`],[2,`&phiv;`],[0,`&piv;`],[5,`&Gammad;`],[0,`&digamma;`],[18,`&kappav;`],[0,`&rhov;`],[3,`&epsiv;`],[0,`&backepsilon;`],[10,`&IOcy;`],[0,`&DJcy;`],[0,`&GJcy;`],[0,`&Jukcy;`],[0,`&DScy;`],[0,`&Iukcy;`],[0,`&YIcy;`],[0,`&Jsercy;`],[0,`&LJcy;`],[0,`&NJcy;`],[0,`&TSHcy;`],[0,`&KJcy;`],[1,`&Ubrcy;`],[0,`&DZcy;`],[0,`&Acy;`],[0,`&Bcy;`],[0,`&Vcy;`],[0,`&Gcy;`],[0,`&Dcy;`],[0,`&IEcy;`],[0,`&ZHcy;`],[0,`&Zcy;`],[0,`&Icy;`],[0,`&Jcy;`],[0,`&Kcy;`],[0,`&Lcy;`],[0,`&Mcy;`],[0,`&Ncy;`],[0,`&Ocy;`],[0,`&Pcy;`],[0,`&Rcy;`],[0,`&Scy;`],[0,`&Tcy;`],[0,`&Ucy;`],[0,`&Fcy;`],[0,`&KHcy;`],[0,`&TScy;`],[0,`&CHcy;`],[0,`&SHcy;`],[0,`&SHCHcy;`],[0,`&HARDcy;`],[0,`&Ycy;`],[0,`&SOFTcy;`],[0,`&Ecy;`],[0,`&YUcy;`],[0,`&YAcy;`],[0,`&acy;`],[0,`&bcy;`],[0,`&vcy;`],[0,`&gcy;`],[0,`&dcy;`],[0,`&iecy;`],[0,`&zhcy;`],[0,`&zcy;`],[0,`&icy;`],[0,`&jcy;`],[0,`&kcy;`],[0,`&lcy;`],[0,`&mcy;`],[0,`&ncy;`],[0,`&ocy;`],[0,`&pcy;`],[0,`&rcy;`],[0,`&scy;`],[0,`&tcy;`],[0,`&ucy;`],[0,`&fcy;`],[0,`&khcy;`],[0,`&tscy;`],[0,`&chcy;`],[0,`&shcy;`],[0,`&shchcy;`],[0,`&hardcy;`],[0,`&ycy;`],[0,`&softcy;`],[0,`&ecy;`],[0,`&yucy;`],[0,`&yacy;`],[1,`&iocy;`],[0,`&djcy;`],[0,`&gjcy;`],[0,`&jukcy;`],[0,`&dscy;`],[0,`&iukcy;`],[0,`&yicy;`],[0,`&jsercy;`],[0,`&ljcy;`],[0,`&njcy;`],[0,`&tshcy;`],[0,`&kjcy;`],[1,`&ubrcy;`],[0,`&dzcy;`],[7074,`&ensp;`],[0,`&emsp;`],[0,`&emsp13;`],[0,`&emsp14;`],[1,`&numsp;`],[0,`&puncsp;`],[0,`&ThinSpace;`],[0,`&hairsp;`],[0,`&NegativeMediumSpace;`],[0,`&zwnj;`],[0,`&zwj;`],[0,`&lrm;`],[0,`&rlm;`],[0,`&dash;`],[2,`&ndash;`],[0,`&mdash;`],[0,`&horbar;`],[0,`&Verbar;`],[1,`&lsquo;`],[0,`&CloseCurlyQuote;`],[0,`&lsquor;`],[1,`&ldquo;`],[0,`&CloseCurlyDoubleQuote;`],[0,`&bdquo;`],[1,`&dagger;`],[0,`&Dagger;`],[0,`&bull;`],[2,`&nldr;`],[0,`&hellip;`],[9,`&permil;`],[0,`&pertenk;`],[0,`&prime;`],[0,`&Prime;`],[0,`&tprime;`],[0,`&backprime;`],[3,`&lsaquo;`],[0,`&rsaquo;`],[3,`&oline;`],[2,`&caret;`],[1,`&hybull;`],[0,`&frasl;`],[10,`&bsemi;`],[7,`&qprime;`],[7,{v:`&MediumSpace;`,n:8202,o:`&ThickSpace;`}],[0,`&NoBreak;`],[0,`&af;`],[0,`&InvisibleTimes;`],[0,`&ic;`],[72,`&euro;`],[46,`&tdot;`],[0,`&DotDot;`],[37,`&complexes;`],[2,`&incare;`],[4,`&gscr;`],[0,`&hamilt;`],[0,`&Hfr;`],[0,`&Hopf;`],[0,`&planckh;`],[0,`&hbar;`],[0,`&imagline;`],[0,`&Ifr;`],[0,`&lagran;`],[0,`&ell;`],[1,`&naturals;`],[0,`&numero;`],[0,`&copysr;`],[0,`&weierp;`],[0,`&Popf;`],[0,`&Qopf;`],[0,`&realine;`],[0,`&real;`],[0,`&reals;`],[0,`&rx;`],[3,`&trade;`],[1,`&integers;`],[2,`&mho;`],[0,`&zeetrf;`],[0,`&iiota;`],[2,`&bernou;`],[0,`&Cayleys;`],[1,`&escr;`],[0,`&Escr;`],[0,`&Fouriertrf;`],[1,`&Mellintrf;`],[0,`&order;`],[0,`&alefsym;`],[0,`&beth;`],[0,`&gimel;`],[0,`&daleth;`],[12,`&CapitalDifferentialD;`],[0,`&dd;`],[0,`&ee;`],[0,`&ii;`],[10,`&frac13;`],[0,`&frac23;`],[0,`&frac15;`],[0,`&frac25;`],[0,`&frac35;`],[0,`&frac45;`],[0,`&frac16;`],[0,`&frac56;`],[0,`&frac18;`],[0,`&frac38;`],[0,`&frac58;`],[0,`&frac78;`],[49,`&larr;`],[0,`&ShortUpArrow;`],[0,`&rarr;`],[0,`&darr;`],[0,`&harr;`],[0,`&updownarrow;`],[0,`&nwarr;`],[0,`&nearr;`],[0,`&LowerRightArrow;`],[0,`&LowerLeftArrow;`],[0,`&nlarr;`],[0,`&nrarr;`],[1,{v:`&rarrw;`,n:824,o:`&nrarrw;`}],[0,`&Larr;`],[0,`&Uarr;`],[0,`&Rarr;`],[0,`&Darr;`],[0,`&larrtl;`],[0,`&rarrtl;`],[0,`&LeftTeeArrow;`],[0,`&mapstoup;`],[0,`&map;`],[0,`&DownTeeArrow;`],[1,`&hookleftarrow;`],[0,`&hookrightarrow;`],[0,`&larrlp;`],[0,`&looparrowright;`],[0,`&harrw;`],[0,`&nharr;`],[1,`&lsh;`],[0,`&rsh;`],[0,`&ldsh;`],[0,`&rdsh;`],[1,`&crarr;`],[0,`&cularr;`],[0,`&curarr;`],[2,`&circlearrowleft;`],[0,`&circlearrowright;`],[0,`&leftharpoonup;`],[0,`&DownLeftVector;`],[0,`&RightUpVector;`],[0,`&LeftUpVector;`],[0,`&rharu;`],[0,`&DownRightVector;`],[0,`&dharr;`],[0,`&dharl;`],[0,`&RightArrowLeftArrow;`],[0,`&udarr;`],[0,`&LeftArrowRightArrow;`],[0,`&leftleftarrows;`],[0,`&upuparrows;`],[0,`&rightrightarrows;`],[0,`&ddarr;`],[0,`&leftrightharpoons;`],[0,`&Equilibrium;`],[0,`&nlArr;`],[0,`&nhArr;`],[0,`&nrArr;`],[0,`&DoubleLeftArrow;`],[0,`&DoubleUpArrow;`],[0,`&DoubleRightArrow;`],[0,`&dArr;`],[0,`&DoubleLeftRightArrow;`],[0,`&DoubleUpDownArrow;`],[0,`&nwArr;`],[0,`&neArr;`],[0,`&seArr;`],[0,`&swArr;`],[0,`&lAarr;`],[0,`&rAarr;`],[1,`&zigrarr;`],[6,`&larrb;`],[0,`&rarrb;`],[15,`&DownArrowUpArrow;`],[7,`&loarr;`],[0,`&roarr;`],[0,`&hoarr;`],[0,`&forall;`],[0,`&comp;`],[0,{v:`&part;`,n:824,o:`&npart;`}],[0,`&exist;`],[0,`&nexist;`],[0,`&empty;`],[1,`&Del;`],[0,`&Element;`],[0,`&NotElement;`],[1,`&ni;`],[0,`&notni;`],[2,`&prod;`],[0,`&coprod;`],[0,`&sum;`],[0,`&minus;`],[0,`&MinusPlus;`],[0,`&dotplus;`],[1,`&Backslash;`],[0,`&lowast;`],[0,`&compfn;`],[1,`&radic;`],[2,`&prop;`],[0,`&infin;`],[0,`&angrt;`],[0,{v:`&ang;`,n:8402,o:`&nang;`}],[0,`&angmsd;`],[0,`&angsph;`],[0,`&mid;`],[0,`&nmid;`],[0,`&DoubleVerticalBar;`],[0,`&NotDoubleVerticalBar;`],[0,`&and;`],[0,`&or;`],[0,{v:`&cap;`,n:65024,o:`&caps;`}],[0,{v:`&cup;`,n:65024,o:`&cups;`}],[0,`&int;`],[0,`&Int;`],[0,`&iiint;`],[0,`&conint;`],[0,`&Conint;`],[0,`&Cconint;`],[0,`&cwint;`],[0,`&ClockwiseContourIntegral;`],[0,`&awconint;`],[0,`&there4;`],[0,`&becaus;`],[0,`&ratio;`],[0,`&Colon;`],[0,`&dotminus;`],[1,`&mDDot;`],[0,`&homtht;`],[0,{v:`&sim;`,n:8402,o:`&nvsim;`}],[0,{v:`&backsim;`,n:817,o:`&race;`}],[0,{v:`&ac;`,n:819,o:`&acE;`}],[0,`&acd;`],[0,`&VerticalTilde;`],[0,`&NotTilde;`],[0,{v:`&eqsim;`,n:824,o:`&nesim;`}],[0,`&sime;`],[0,`&NotTildeEqual;`],[0,`&cong;`],[0,`&simne;`],[0,`&ncong;`],[0,`&ap;`],[0,`&nap;`],[0,`&ape;`],[0,{v:`&apid;`,n:824,o:`&napid;`}],[0,`&backcong;`],[0,{v:`&asympeq;`,n:8402,o:`&nvap;`}],[0,{v:`&bump;`,n:824,o:`&nbump;`}],[0,{v:`&bumpe;`,n:824,o:`&nbumpe;`}],[0,{v:`&doteq;`,n:824,o:`&nedot;`}],[0,`&doteqdot;`],[0,`&efDot;`],[0,`&erDot;`],[0,`&Assign;`],[0,`&ecolon;`],[0,`&ecir;`],[0,`&circeq;`],[1,`&wedgeq;`],[0,`&veeeq;`],[1,`&triangleq;`],[2,`&equest;`],[0,`&ne;`],[0,{v:`&Congruent;`,n:8421,o:`&bnequiv;`}],[0,`&nequiv;`],[1,{v:`&le;`,n:8402,o:`&nvle;`}],[0,{v:`&ge;`,n:8402,o:`&nvge;`}],[0,{v:`&lE;`,n:824,o:`&nlE;`}],[0,{v:`&gE;`,n:824,o:`&ngE;`}],[0,{v:`&lnE;`,n:65024,o:`&lvertneqq;`}],[0,{v:`&gnE;`,n:65024,o:`&gvertneqq;`}],[0,{v:`&ll;`,n:new Map(t([[824,`&nLtv;`],[7577,`&nLt;`]]))}],[0,{v:`&gg;`,n:new Map(t([[824,`&nGtv;`],[7577,`&nGt;`]]))}],[0,`&between;`],[0,`&NotCupCap;`],[0,`&nless;`],[0,`&ngt;`],[0,`&nle;`],[0,`&nge;`],[0,`&lesssim;`],[0,`&GreaterTilde;`],[0,`&nlsim;`],[0,`&ngsim;`],[0,`&LessGreater;`],[0,`&gl;`],[0,`&NotLessGreater;`],[0,`&NotGreaterLess;`],[0,`&pr;`],[0,`&sc;`],[0,`&prcue;`],[0,`&sccue;`],[0,`&PrecedesTilde;`],[0,{v:`&scsim;`,n:824,o:`&NotSucceedsTilde;`}],[0,`&NotPrecedes;`],[0,`&NotSucceeds;`],[0,{v:`&sub;`,n:8402,o:`&NotSubset;`}],[0,{v:`&sup;`,n:8402,o:`&NotSuperset;`}],[0,`&nsub;`],[0,`&nsup;`],[0,`&sube;`],[0,`&supe;`],[0,`&NotSubsetEqual;`],[0,`&NotSupersetEqual;`],[0,{v:`&subne;`,n:65024,o:`&varsubsetneq;`}],[0,{v:`&supne;`,n:65024,o:`&varsupsetneq;`}],[1,`&cupdot;`],[0,`&UnionPlus;`],[0,{v:`&sqsub;`,n:824,o:`&NotSquareSubset;`}],[0,{v:`&sqsup;`,n:824,o:`&NotSquareSuperset;`}],[0,`&sqsube;`],[0,`&sqsupe;`],[0,{v:`&sqcap;`,n:65024,o:`&sqcaps;`}],[0,{v:`&sqcup;`,n:65024,o:`&sqcups;`}],[0,`&CirclePlus;`],[0,`&CircleMinus;`],[0,`&CircleTimes;`],[0,`&osol;`],[0,`&CircleDot;`],[0,`&circledcirc;`],[0,`&circledast;`],[1,`&circleddash;`],[0,`&boxplus;`],[0,`&boxminus;`],[0,`&boxtimes;`],[0,`&dotsquare;`],[0,`&RightTee;`],[0,`&dashv;`],[0,`&DownTee;`],[0,`&bot;`],[1,`&models;`],[0,`&DoubleRightTee;`],[0,`&Vdash;`],[0,`&Vvdash;`],[0,`&VDash;`],[0,`&nvdash;`],[0,`&nvDash;`],[0,`&nVdash;`],[0,`&nVDash;`],[0,`&prurel;`],[1,`&LeftTriangle;`],[0,`&RightTriangle;`],[0,{v:`&LeftTriangleEqual;`,n:8402,o:`&nvltrie;`}],[0,{v:`&RightTriangleEqual;`,n:8402,o:`&nvrtrie;`}],[0,`&origof;`],[0,`&imof;`],[0,`&multimap;`],[0,`&hercon;`],[0,`&intcal;`],[0,`&veebar;`],[1,`&barvee;`],[0,`&angrtvb;`],[0,`&lrtri;`],[0,`&bigwedge;`],[0,`&bigvee;`],[0,`&bigcap;`],[0,`&bigcup;`],[0,`&diam;`],[0,`&sdot;`],[0,`&sstarf;`],[0,`&divideontimes;`],[0,`&bowtie;`],[0,`&ltimes;`],[0,`&rtimes;`],[0,`&leftthreetimes;`],[0,`&rightthreetimes;`],[0,`&backsimeq;`],[0,`&curlyvee;`],[0,`&curlywedge;`],[0,`&Sub;`],[0,`&Sup;`],[0,`&Cap;`],[0,`&Cup;`],[0,`&fork;`],[0,`&epar;`],[0,`&lessdot;`],[0,`&gtdot;`],[0,{v:`&Ll;`,n:824,o:`&nLl;`}],[0,{v:`&Gg;`,n:824,o:`&nGg;`}],[0,{v:`&leg;`,n:65024,o:`&lesg;`}],[0,{v:`&gel;`,n:65024,o:`&gesl;`}],[2,`&cuepr;`],[0,`&cuesc;`],[0,`&NotPrecedesSlantEqual;`],[0,`&NotSucceedsSlantEqual;`],[0,`&NotSquareSubsetEqual;`],[0,`&NotSquareSupersetEqual;`],[2,`&lnsim;`],[0,`&gnsim;`],[0,`&precnsim;`],[0,`&scnsim;`],[0,`&nltri;`],[0,`&NotRightTriangle;`],[0,`&nltrie;`],[0,`&NotRightTriangleEqual;`],[0,`&vellip;`],[0,`&ctdot;`],[0,`&utdot;`],[0,`&dtdot;`],[0,`&disin;`],[0,`&isinsv;`],[0,`&isins;`],[0,{v:`&isindot;`,n:824,o:`&notindot;`}],[0,`&notinvc;`],[0,`&notinvb;`],[1,{v:`&isinE;`,n:824,o:`&notinE;`}],[0,`&nisd;`],[0,`&xnis;`],[0,`&nis;`],[0,`&notnivc;`],[0,`&notnivb;`],[6,`&barwed;`],[0,`&Barwed;`],[1,`&lceil;`],[0,`&rceil;`],[0,`&LeftFloor;`],[0,`&rfloor;`],[0,`&drcrop;`],[0,`&dlcrop;`],[0,`&urcrop;`],[0,`&ulcrop;`],[0,`&bnot;`],[1,`&profline;`],[0,`&profsurf;`],[1,`&telrec;`],[0,`&target;`],[5,`&ulcorn;`],[0,`&urcorn;`],[0,`&dlcorn;`],[0,`&drcorn;`],[2,`&frown;`],[0,`&smile;`],[9,`&cylcty;`],[0,`&profalar;`],[7,`&topbot;`],[6,`&ovbar;`],[1,`&solbar;`],[60,`&angzarr;`],[51,`&lmoustache;`],[0,`&rmoustache;`],[2,`&OverBracket;`],[0,`&bbrk;`],[0,`&bbrktbrk;`],[37,`&OverParenthesis;`],[0,`&UnderParenthesis;`],[0,`&OverBrace;`],[0,`&UnderBrace;`],[2,`&trpezium;`],[4,`&elinters;`],[59,`&blank;`],[164,`&circledS;`],[55,`&boxh;`],[1,`&boxv;`],[9,`&boxdr;`],[3,`&boxdl;`],[3,`&boxur;`],[3,`&boxul;`],[3,`&boxvr;`],[7,`&boxvl;`],[7,`&boxhd;`],[7,`&boxhu;`],[7,`&boxvh;`],[19,`&boxH;`],[0,`&boxV;`],[0,`&boxdR;`],[0,`&boxDr;`],[0,`&boxDR;`],[0,`&boxdL;`],[0,`&boxDl;`],[0,`&boxDL;`],[0,`&boxuR;`],[0,`&boxUr;`],[0,`&boxUR;`],[0,`&boxuL;`],[0,`&boxUl;`],[0,`&boxUL;`],[0,`&boxvR;`],[0,`&boxVr;`],[0,`&boxVR;`],[0,`&boxvL;`],[0,`&boxVl;`],[0,`&boxVL;`],[0,`&boxHd;`],[0,`&boxhD;`],[0,`&boxHD;`],[0,`&boxHu;`],[0,`&boxhU;`],[0,`&boxHU;`],[0,`&boxvH;`],[0,`&boxVh;`],[0,`&boxVH;`],[19,`&uhblk;`],[3,`&lhblk;`],[3,`&block;`],[8,`&blk14;`],[0,`&blk12;`],[0,`&blk34;`],[13,`&square;`],[8,`&blacksquare;`],[0,`&EmptyVerySmallSquare;`],[1,`&rect;`],[0,`&marker;`],[2,`&fltns;`],[1,`&bigtriangleup;`],[0,`&blacktriangle;`],[0,`&triangle;`],[2,`&blacktriangleright;`],[0,`&rtri;`],[3,`&bigtriangledown;`],[0,`&blacktriangledown;`],[0,`&dtri;`],[2,`&blacktriangleleft;`],[0,`&ltri;`],[6,`&loz;`],[0,`&cir;`],[32,`&tridot;`],[2,`&bigcirc;`],[8,`&ultri;`],[0,`&urtri;`],[0,`&lltri;`],[0,`&EmptySmallSquare;`],[0,`&FilledSmallSquare;`],[8,`&bigstar;`],[0,`&star;`],[7,`&phone;`],[49,`&female;`],[1,`&male;`],[29,`&spades;`],[2,`&clubs;`],[1,`&hearts;`],[0,`&diamondsuit;`],[3,`&sung;`],[2,`&flat;`],[0,`&natural;`],[0,`&sharp;`],[163,`&check;`],[3,`&cross;`],[8,`&malt;`],[21,`&sext;`],[33,`&VerticalSeparator;`],[25,`&lbbrk;`],[0,`&rbbrk;`],[84,`&bsolhsub;`],[0,`&suphsol;`],[28,`&LeftDoubleBracket;`],[0,`&RightDoubleBracket;`],[0,`&lang;`],[0,`&rang;`],[0,`&Lang;`],[0,`&Rang;`],[0,`&loang;`],[0,`&roang;`],[7,`&longleftarrow;`],[0,`&longrightarrow;`],[0,`&longleftrightarrow;`],[0,`&DoubleLongLeftArrow;`],[0,`&DoubleLongRightArrow;`],[0,`&DoubleLongLeftRightArrow;`],[1,`&longmapsto;`],[2,`&dzigrarr;`],[258,`&nvlArr;`],[0,`&nvrArr;`],[0,`&nvHarr;`],[0,`&Map;`],[6,`&lbarr;`],[0,`&bkarow;`],[0,`&lBarr;`],[0,`&dbkarow;`],[0,`&drbkarow;`],[0,`&DDotrahd;`],[0,`&UpArrowBar;`],[0,`&DownArrowBar;`],[2,`&Rarrtl;`],[2,`&latail;`],[0,`&ratail;`],[0,`&lAtail;`],[0,`&rAtail;`],[0,`&larrfs;`],[0,`&rarrfs;`],[0,`&larrbfs;`],[0,`&rarrbfs;`],[2,`&nwarhk;`],[0,`&nearhk;`],[0,`&hksearow;`],[0,`&hkswarow;`],[0,`&nwnear;`],[0,`&nesear;`],[0,`&seswar;`],[0,`&swnwar;`],[8,{v:`&rarrc;`,n:824,o:`&nrarrc;`}],[1,`&cudarrr;`],[0,`&ldca;`],[0,`&rdca;`],[0,`&cudarrl;`],[0,`&larrpl;`],[2,`&curarrm;`],[0,`&cularrp;`],[7,`&rarrpl;`],[2,`&harrcir;`],[0,`&Uarrocir;`],[0,`&lurdshar;`],[0,`&ldrushar;`],[2,`&LeftRightVector;`],[0,`&RightUpDownVector;`],[0,`&DownLeftRightVector;`],[0,`&LeftUpDownVector;`],[0,`&LeftVectorBar;`],[0,`&RightVectorBar;`],[0,`&RightUpVectorBar;`],[0,`&RightDownVectorBar;`],[0,`&DownLeftVectorBar;`],[0,`&DownRightVectorBar;`],[0,`&LeftUpVectorBar;`],[0,`&LeftDownVectorBar;`],[0,`&LeftTeeVector;`],[0,`&RightTeeVector;`],[0,`&RightUpTeeVector;`],[0,`&RightDownTeeVector;`],[0,`&DownLeftTeeVector;`],[0,`&DownRightTeeVector;`],[0,`&LeftUpTeeVector;`],[0,`&LeftDownTeeVector;`],[0,`&lHar;`],[0,`&uHar;`],[0,`&rHar;`],[0,`&dHar;`],[0,`&luruhar;`],[0,`&ldrdhar;`],[0,`&ruluhar;`],[0,`&rdldhar;`],[0,`&lharul;`],[0,`&llhard;`],[0,`&rharul;`],[0,`&lrhard;`],[0,`&udhar;`],[0,`&duhar;`],[0,`&RoundImplies;`],[0,`&erarr;`],[0,`&simrarr;`],[0,`&larrsim;`],[0,`&rarrsim;`],[0,`&rarrap;`],[0,`&ltlarr;`],[1,`&gtrarr;`],[0,`&subrarr;`],[1,`&suplarr;`],[0,`&lfisht;`],[0,`&rfisht;`],[0,`&ufisht;`],[0,`&dfisht;`],[5,`&lopar;`],[0,`&ropar;`],[4,`&lbrke;`],[0,`&rbrke;`],[0,`&lbrkslu;`],[0,`&rbrksld;`],[0,`&lbrksld;`],[0,`&rbrkslu;`],[0,`&langd;`],[0,`&rangd;`],[0,`&lparlt;`],[0,`&rpargt;`],[0,`&gtlPar;`],[0,`&ltrPar;`],[3,`&vzigzag;`],[1,`&vangrt;`],[0,`&angrtvbd;`],[6,`&ange;`],[0,`&range;`],[0,`&dwangle;`],[0,`&uwangle;`],[0,`&angmsdaa;`],[0,`&angmsdab;`],[0,`&angmsdac;`],[0,`&angmsdad;`],[0,`&angmsdae;`],[0,`&angmsdaf;`],[0,`&angmsdag;`],[0,`&angmsdah;`],[0,`&bemptyv;`],[0,`&demptyv;`],[0,`&cemptyv;`],[0,`&raemptyv;`],[0,`&laemptyv;`],[0,`&ohbar;`],[0,`&omid;`],[0,`&opar;`],[1,`&operp;`],[1,`&olcross;`],[0,`&odsold;`],[1,`&olcir;`],[0,`&ofcir;`],[0,`&olt;`],[0,`&ogt;`],[0,`&cirscir;`],[0,`&cirE;`],[0,`&solb;`],[0,`&bsolb;`],[3,`&boxbox;`],[3,`&trisb;`],[0,`&rtriltri;`],[0,{v:`&LeftTriangleBar;`,n:824,o:`&NotLeftTriangleBar;`}],[0,{v:`&RightTriangleBar;`,n:824,o:`&NotRightTriangleBar;`}],[11,`&iinfin;`],[0,`&infintie;`],[0,`&nvinfin;`],[4,`&eparsl;`],[0,`&smeparsl;`],[0,`&eqvparsl;`],[5,`&blacklozenge;`],[8,`&RuleDelayed;`],[1,`&dsol;`],[9,`&bigodot;`],[0,`&bigoplus;`],[0,`&bigotimes;`],[1,`&biguplus;`],[1,`&bigsqcup;`],[5,`&iiiint;`],[0,`&fpartint;`],[2,`&cirfnint;`],[0,`&awint;`],[0,`&rppolint;`],[0,`&scpolint;`],[0,`&npolint;`],[0,`&pointint;`],[0,`&quatint;`],[0,`&intlarhk;`],[10,`&pluscir;`],[0,`&plusacir;`],[0,`&simplus;`],[0,`&plusdu;`],[0,`&plussim;`],[0,`&plustwo;`],[1,`&mcomma;`],[0,`&minusdu;`],[2,`&loplus;`],[0,`&roplus;`],[0,`&Cross;`],[0,`&timesd;`],[0,`&timesbar;`],[1,`&smashp;`],[0,`&lotimes;`],[0,`&rotimes;`],[0,`&otimesas;`],[0,`&Otimes;`],[0,`&odiv;`],[0,`&triplus;`],[0,`&triminus;`],[0,`&tritime;`],[0,`&intprod;`],[2,`&amalg;`],[0,`&capdot;`],[1,`&ncup;`],[0,`&ncap;`],[0,`&capand;`],[0,`&cupor;`],[0,`&cupcap;`],[0,`&capcup;`],[0,`&cupbrcap;`],[0,`&capbrcup;`],[0,`&cupcup;`],[0,`&capcap;`],[0,`&ccups;`],[0,`&ccaps;`],[2,`&ccupssm;`],[2,`&And;`],[0,`&Or;`],[0,`&andand;`],[0,`&oror;`],[0,`&orslope;`],[0,`&andslope;`],[1,`&andv;`],[0,`&orv;`],[0,`&andd;`],[0,`&ord;`],[1,`&wedbar;`],[6,`&sdote;`],[3,`&simdot;`],[2,{v:`&congdot;`,n:824,o:`&ncongdot;`}],[0,`&easter;`],[0,`&apacir;`],[0,{v:`&apE;`,n:824,o:`&napE;`}],[0,`&eplus;`],[0,`&pluse;`],[0,`&Esim;`],[0,`&Colone;`],[0,`&Equal;`],[1,`&ddotseq;`],[0,`&equivDD;`],[0,`&ltcir;`],[0,`&gtcir;`],[0,`&ltquest;`],[0,`&gtquest;`],[0,{v:`&leqslant;`,n:824,o:`&nleqslant;`}],[0,{v:`&geqslant;`,n:824,o:`&ngeqslant;`}],[0,`&lesdot;`],[0,`&gesdot;`],[0,`&lesdoto;`],[0,`&gesdoto;`],[0,`&lesdotor;`],[0,`&gesdotol;`],[0,`&lap;`],[0,`&gap;`],[0,`&lne;`],[0,`&gne;`],[0,`&lnap;`],[0,`&gnap;`],[0,`&lEg;`],[0,`&gEl;`],[0,`&lsime;`],[0,`&gsime;`],[0,`&lsimg;`],[0,`&gsiml;`],[0,`&lgE;`],[0,`&glE;`],[0,`&lesges;`],[0,`&gesles;`],[0,`&els;`],[0,`&egs;`],[0,`&elsdot;`],[0,`&egsdot;`],[0,`&el;`],[0,`&eg;`],[2,`&siml;`],[0,`&simg;`],[0,`&simlE;`],[0,`&simgE;`],[0,{v:`&LessLess;`,n:824,o:`&NotNestedLessLess;`}],[0,{v:`&GreaterGreater;`,n:824,o:`&NotNestedGreaterGreater;`}],[1,`&glj;`],[0,`&gla;`],[0,`&ltcc;`],[0,`&gtcc;`],[0,`&lescc;`],[0,`&gescc;`],[0,`&smt;`],[0,`&lat;`],[0,{v:`&smte;`,n:65024,o:`&smtes;`}],[0,{v:`&late;`,n:65024,o:`&lates;`}],[0,`&bumpE;`],[0,{v:`&PrecedesEqual;`,n:824,o:`&NotPrecedesEqual;`}],[0,{v:`&sce;`,n:824,o:`&NotSucceedsEqual;`}],[2,`&prE;`],[0,`&scE;`],[0,`&precneqq;`],[0,`&scnE;`],[0,`&prap;`],[0,`&scap;`],[0,`&precnapprox;`],[0,`&scnap;`],[0,`&Pr;`],[0,`&Sc;`],[0,`&subdot;`],[0,`&supdot;`],[0,`&subplus;`],[0,`&supplus;`],[0,`&submult;`],[0,`&supmult;`],[0,`&subedot;`],[0,`&supedot;`],[0,{v:`&subE;`,n:824,o:`&nsubE;`}],[0,{v:`&supE;`,n:824,o:`&nsupE;`}],[0,`&subsim;`],[0,`&supsim;`],[2,{v:`&subnE;`,n:65024,o:`&varsubsetneqq;`}],[0,{v:`&supnE;`,n:65024,o:`&varsupsetneqq;`}],[2,`&csub;`],[0,`&csup;`],[0,`&csube;`],[0,`&csupe;`],[0,`&subsup;`],[0,`&supsub;`],[0,`&subsub;`],[0,`&supsup;`],[0,`&suphsub;`],[0,`&supdsub;`],[0,`&forkv;`],[0,`&topfork;`],[0,`&mlcp;`],[8,`&Dashv;`],[1,`&Vdashl;`],[0,`&Barv;`],[0,`&vBar;`],[0,`&vBarv;`],[1,`&Vbar;`],[0,`&Not;`],[0,`&bNot;`],[0,`&rnmid;`],[0,`&cirmid;`],[0,`&midcir;`],[0,`&topcir;`],[0,`&nhpar;`],[0,`&parsim;`],[9,{v:`&parsl;`,n:8421,o:`&nparsl;`}],[44343,{n:new Map(t([[56476,`&Ascr;`],[1,`&Cscr;`],[0,`&Dscr;`],[2,`&Gscr;`],[2,`&Jscr;`],[0,`&Kscr;`],[2,`&Nscr;`],[0,`&Oscr;`],[0,`&Pscr;`],[0,`&Qscr;`],[1,`&Sscr;`],[0,`&Tscr;`],[0,`&Uscr;`],[0,`&Vscr;`],[0,`&Wscr;`],[0,`&Xscr;`],[0,`&Yscr;`],[0,`&Zscr;`],[0,`&ascr;`],[0,`&bscr;`],[0,`&cscr;`],[0,`&dscr;`],[1,`&fscr;`],[1,`&hscr;`],[0,`&iscr;`],[0,`&jscr;`],[0,`&kscr;`],[0,`&lscr;`],[0,`&mscr;`],[0,`&nscr;`],[1,`&pscr;`],[0,`&qscr;`],[0,`&rscr;`],[0,`&sscr;`],[0,`&tscr;`],[0,`&uscr;`],[0,`&vscr;`],[0,`&wscr;`],[0,`&xscr;`],[0,`&yscr;`],[0,`&zscr;`],[52,`&Afr;`],[0,`&Bfr;`],[1,`&Dfr;`],[0,`&Efr;`],[0,`&Ffr;`],[0,`&Gfr;`],[2,`&Jfr;`],[0,`&Kfr;`],[0,`&Lfr;`],[0,`&Mfr;`],[0,`&Nfr;`],[0,`&Ofr;`],[0,`&Pfr;`],[0,`&Qfr;`],[1,`&Sfr;`],[0,`&Tfr;`],[0,`&Ufr;`],[0,`&Vfr;`],[0,`&Wfr;`],[0,`&Xfr;`],[0,`&Yfr;`],[1,`&afr;`],[0,`&bfr;`],[0,`&cfr;`],[0,`&dfr;`],[0,`&efr;`],[0,`&ffr;`],[0,`&gfr;`],[0,`&hfr;`],[0,`&ifr;`],[0,`&jfr;`],[0,`&kfr;`],[0,`&lfr;`],[0,`&mfr;`],[0,`&nfr;`],[0,`&ofr;`],[0,`&pfr;`],[0,`&qfr;`],[0,`&rfr;`],[0,`&sfr;`],[0,`&tfr;`],[0,`&ufr;`],[0,`&vfr;`],[0,`&wfr;`],[0,`&xfr;`],[0,`&yfr;`],[0,`&zfr;`],[0,`&Aopf;`],[0,`&Bopf;`],[1,`&Dopf;`],[0,`&Eopf;`],[0,`&Fopf;`],[0,`&Gopf;`],[1,`&Iopf;`],[0,`&Jopf;`],[0,`&Kopf;`],[0,`&Lopf;`],[0,`&Mopf;`],[1,`&Oopf;`],[3,`&Sopf;`],[0,`&Topf;`],[0,`&Uopf;`],[0,`&Vopf;`],[0,`&Wopf;`],[0,`&Xopf;`],[0,`&Yopf;`],[1,`&aopf;`],[0,`&bopf;`],[0,`&copf;`],[0,`&dopf;`],[0,`&eopf;`],[0,`&fopf;`],[0,`&gopf;`],[0,`&hopf;`],[0,`&iopf;`],[0,`&jopf;`],[0,`&kopf;`],[0,`&lopf;`],[0,`&mopf;`],[0,`&nopf;`],[0,`&oopf;`],[0,`&popf;`],[0,`&qopf;`],[0,`&ropf;`],[0,`&sopf;`],[0,`&topf;`],[0,`&uopf;`],[0,`&vopf;`],[0,`&wopf;`],[0,`&xopf;`],[0,`&yopf;`],[0,`&zopf;`]]))}],[8906,`&fflig;`],[0,`&filig;`],[0,`&fllig;`],[0,`&ffilig;`],[0,`&ffllig;`]]))})),xv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.escapeText=e.escapeAttribute=e.escapeUTF8=e.escape=e.encodeXML=e.getCodePoint=e.xmlReplacer=void 0,e.xmlReplacer=/["&'<>$\x80-\uFFFF]/g;var t=new Map([[34,`&quot;`],[38,`&amp;`],[39,`&apos;`],[60,`&lt;`],[62,`&gt;`]]);e.getCodePoint=String.prototype.codePointAt==null?function(e,t){return(e.charCodeAt(t)&64512)==55296?(e.charCodeAt(t)-55296)*1024+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t)}:function(e,t){return e.codePointAt(t)};function n(n){for(var r=``,i=0,a;(a=e.xmlReplacer.exec(n))!==null;){var o=a.index,s=n.charCodeAt(o),c=t.get(s);c===void 0?(r+=`${n.substring(i,o)}&#x${(0,e.getCodePoint)(n,o).toString(16)};`,i=e.xmlReplacer.lastIndex+=Number((s&64512)==55296)):(r+=n.substring(i,o)+c,i=o+1)}return r+n.substr(i)}e.encodeXML=n,e.escape=n;function r(e,t){return function(n){for(var r,i=0,a=``;r=e.exec(n);)i!==r.index&&(a+=n.substring(i,r.index)),a+=t.get(r[0].charCodeAt(0)),i=r.index+1;return a+n.substring(i)}}e.escapeUTF8=r(/[&<>'"]/g,t),e.escapeAttribute=r(/["&\u00A0]/g,new Map([[34,`&quot;`],[38,`&amp;`],[160,`&nbsp;`]])),e.escapeText=r(/[&<>\u00A0]/g,new Map([[38,`&amp;`],[60,`&lt;`],[62,`&gt;`],[160,`&nbsp;`]]))})),Sv=t((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.encodeNonAsciiHTML=e.encodeHTML=void 0;var n=t(bv()),r=xv(),i=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function a(e){return s(i,e)}e.encodeHTML=a;function o(e){return s(r.xmlReplacer,e)}e.encodeNonAsciiHTML=o;function s(e,t){for(var i=``,a=0,o;(o=e.exec(t))!==null;){var s=o.index;i+=t.substring(a,s);var c=t.charCodeAt(s),l=n.default.get(c);if(typeof l==`object`){if(s+1<t.length){var u=t.charCodeAt(s+1),d=typeof l.n==`number`?l.n===u?l.o:void 0:l.n.get(u);if(d!==void 0){i+=d,a=e.lastIndex+=1;continue}}l=l.v}if(l!==void 0)i+=l,a=s+1;else{var f=(0,r.getCodePoint)(t,s);i+=`&#x${f.toString(16)};`,a=e.lastIndex+=Number(f!==c)}}return i+t.substr(a)}})),Cv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.decodeXMLStrict=e.decodeHTML5Strict=e.decodeHTML4Strict=e.decodeHTML5=e.decodeHTML4=e.decodeHTMLAttribute=e.decodeHTMLStrict=e.decodeHTML=e.decodeXML=e.DecodingMode=e.EntityDecoder=e.encodeHTML5=e.encodeHTML4=e.encodeNonAsciiHTML=e.encodeHTML=e.escapeText=e.escapeAttribute=e.escapeUTF8=e.escape=e.encodeXML=e.encode=e.decodeStrict=e.decode=e.EncodingMode=e.EntityLevel=void 0;var t=yv(),n=Sv(),r=xv(),i;(function(e){e[e.XML=0]=`XML`,e[e.HTML=1]=`HTML`})(i=e.EntityLevel||={});var a;(function(e){e[e.UTF8=0]=`UTF8`,e[e.ASCII=1]=`ASCII`,e[e.Extensive=2]=`Extensive`,e[e.Attribute=3]=`Attribute`,e[e.Text=4]=`Text`})(a=e.EncodingMode||={});function o(e,n){if(n===void 0&&(n=i.XML),(typeof n==`number`?n:n.level)===i.HTML){var r=typeof n==`object`?n.mode:void 0;return(0,t.decodeHTML)(e,r)}return(0,t.decodeXML)(e)}e.decode=o;function s(e,n){n===void 0&&(n=i.XML);var r=typeof n==`number`?{level:n}:n;return r.mode??=t.DecodingMode.Strict,o(e,r)}e.decodeStrict=s;function c(e,t){t===void 0&&(t=i.XML);var o=typeof t==`number`?{level:t}:t;return o.mode===a.UTF8?(0,r.escapeUTF8)(e):o.mode===a.Attribute?(0,r.escapeAttribute)(e):o.mode===a.Text?(0,r.escapeText)(e):o.level===i.HTML?o.mode===a.ASCII?(0,n.encodeNonAsciiHTML)(e):(0,n.encodeHTML)(e):(0,r.encodeXML)(e)}e.encode=c;var l=xv();Object.defineProperty(e,"encodeXML",{enumerable:!0,get:function(){return l.encodeXML}}),Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return l.escape}}),Object.defineProperty(e,"escapeUTF8",{enumerable:!0,get:function(){return l.escapeUTF8}}),Object.defineProperty(e,"escapeAttribute",{enumerable:!0,get:function(){return l.escapeAttribute}}),Object.defineProperty(e,"escapeText",{enumerable:!0,get:function(){return l.escapeText}});var u=Sv();Object.defineProperty(e,"encodeHTML",{enumerable:!0,get:function(){return u.encodeHTML}}),Object.defineProperty(e,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return u.encodeNonAsciiHTML}}),Object.defineProperty(e,"encodeHTML4",{enumerable:!0,get:function(){return u.encodeHTML}}),Object.defineProperty(e,"encodeHTML5",{enumerable:!0,get:function(){return u.encodeHTML}});var d=yv();Object.defineProperty(e,"EntityDecoder",{enumerable:!0,get:function(){return d.EntityDecoder}}),Object.defineProperty(e,"DecodingMode",{enumerable:!0,get:function(){return d.DecodingMode}}),Object.defineProperty(e,"decodeXML",{enumerable:!0,get:function(){return d.decodeXML}}),Object.defineProperty(e,"decodeHTML",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(e,"decodeHTMLStrict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTMLAttribute",{enumerable:!0,get:function(){return d.decodeHTMLAttribute}}),Object.defineProperty(e,"decodeHTML4",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(e,"decodeHTML5",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(e,"decodeHTML4Strict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTML5Strict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(e,"decodeXMLStrict",{enumerable:!0,get:function(){return d.decodeXML}})})),wv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.attributeNames=e.elementNames=void 0,e.elementNames=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.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.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(function(e){return[e.toLowerCase(),e]})),e.attributeNames=new Map(`definitionURL.attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(function(e){return[e.toLowerCase(),e]}))})),Tv=t((e=>{var t=e&&e.__assign||function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)},n=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t};Object.defineProperty(e,"__esModule",{value:!0}),e.render=void 0;var a=i(pv()),o=Cv(),s=wv(),c=new Set([`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`]);function l(e){return e.replace(/"/g,`&quot;`)}function u(e,t){if(e){var n=(t.encodeEntities??t.decodeEntities)===!1?l:t.xmlMode||t.encodeEntities!==`utf8`?o.encodeXML:o.escapeAttribute;return Object.keys(e).map(function(r){var i=e[r]??``;return t.xmlMode===`foreign`&&(r=s.attributeNames.get(r)??r),!t.emptyAttrs&&!t.xmlMode&&i===``?r:`${r}="${n(i)}"`}).join(` `)}}var d=new Set([`area`,`base`,`basefont`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`img`,`input`,`isindex`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function f(e,t){t===void 0&&(t={});for(var n=(`length`in e)?e:[e],r=``,i=0;i<n.length;i++)r+=p(n[i],t);return r}e.render=f,e.default=f;function p(e,t){switch(e.type){case a.Root:return f(e.children,t);case a.Doctype:case a.Directive:return _(e);case a.Comment:return b(e);case a.CDATA:return y(e);case a.Script:case a.Style:case a.Tag:return g(e,t);case a.Text:return v(e,t)}}var m=new Set([`mi`,`mo`,`mn`,`ms`,`mtext`,`annotation-xml`,`foreignObject`,`desc`,`title`]),h=new Set([`svg`,`math`]);function g(e,n){n.xmlMode===`foreign`&&(e.name=s.elementNames.get(e.name)??e.name,e.parent&&m.has(e.parent.name)&&(n=t(t({},n),{xmlMode:!1}))),!n.xmlMode&&h.has(e.name)&&(n=t(t({},n),{xmlMode:`foreign`}));var r=`<${e.name}`,i=u(e.attribs,n);return i&&(r+=` ${i}`),e.children.length===0&&(n.xmlMode?n.selfClosingTags!==!1:n.selfClosingTags&&d.has(e.name))?(n.xmlMode||(r+=` `),r+=`/>`):(r+=`>`,e.children.length>0&&(r+=f(e.children,n)),(n.xmlMode||!d.has(e.name))&&(r+=`</${e.name}>`)),r}function _(e){return`<${e.data}>`}function v(e,t){var n=e.data||``;return(t.encodeEntities??t.decodeEntities)!==!1&&!(!t.xmlMode&&e.parent&&c.has(e.parent.name))&&(n=t.xmlMode||t.encodeEntities!==`utf8`?(0,o.encodeXML)(n):(0,o.escapeText)(n)),n}function y(e){return`<![CDATA[${e.children[0].data}]]>`}function b(e){return`<!--${e.data}-->`}})),Ev=t((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.getOuterHTML=a,e.getInnerHTML=o,e.getText=s,e.textContent=c,e.innerText=l;var n=hv(),r=t(Tv()),i=pv();function a(e,t){return(0,r.default)(e,t)}function o(e,t){return(0,n.hasChildren)(e)?e.children.map(function(e){return a(e,t)}).join(``):``}function s(e){return Array.isArray(e)?e.map(s).join(``):(0,n.isTag)(e)?e.name===`br`?`
131
+ `:s(e.children):(0,n.isCDATA)(e)?s(e.children):(0,n.isText)(e)?e.data:``}function c(e){return Array.isArray(e)?e.map(c).join(``):(0,n.hasChildren)(e)&&!(0,n.isComment)(e)?c(e.children):(0,n.isText)(e)?e.data:``}function l(e){return Array.isArray(e)?e.map(l).join(``):(0,n.hasChildren)(e)&&(e.type===i.ElementType.Tag||(0,n.isCDATA)(e))?l(e.children):(0,n.isText)(e)?e.data:``}})),Dv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getChildren=n,e.getParent=r,e.getSiblings=i,e.getAttributeValue=a,e.hasAttrib=o,e.getName=s,e.nextElementSibling=c,e.prevElementSibling=l;var t=hv();function n(e){return(0,t.hasChildren)(e)?e.children:[]}function r(e){return e.parent||null}function i(e){var t,i,a=r(e);if(a!=null)return n(a);for(var o=[e],s=e.prev,c=e.next;s!=null;)o.unshift(s),t=s,s=t.prev;for(;c!=null;)o.push(c),i=c,c=i.next;return o}function a(e,t){return e.attribs?.[t]}function o(e,t){return e.attribs!=null&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&e.attribs[t]!=null}function s(e){return e.name}function c(e){for(var n,r=e.next;r!==null&&!(0,t.isTag)(r);)n=r,r=n.next;return r}function l(e){for(var n,r=e.prev;r!==null&&!(0,t.isTag)(r);)n=r,r=n.prev;return r}})),Ov=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.removeElement=t,e.replaceElement=n,e.appendChild=r,e.append=i,e.prependChild=a,e.prepend=o;function t(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){var t=e.parent.children,n=t.lastIndexOf(e);n>=0&&t.splice(n,1)}e.next=null,e.prev=null,e.parent=null}function n(e,t){var n=t.prev=e.prev;n&&(n.next=t);var r=t.next=e.next;r&&(r.prev=t);var i=t.parent=e.parent;if(i){var a=i.children;a[a.lastIndexOf(e)]=t,e.parent=null}}function r(e,n){if(t(n),n.next=null,n.parent=e,e.children.push(n)>1){var r=e.children[e.children.length-2];r.next=n,n.prev=r}else n.prev=null}function i(e,n){t(n);var r=e.parent,i=e.next;if(n.next=i,n.prev=e,e.next=n,n.parent=r,i){if(i.prev=n,r){var a=r.children;a.splice(a.lastIndexOf(i),0,n)}}else r&&r.children.push(n)}function a(e,n){if(t(n),n.parent=e,n.prev=null,e.children.unshift(n)!==1){var r=e.children[1];r.prev=n,n.next=r}else n.next=null}function o(e,n){t(n);var r=e.parent;if(r){var i=r.children;i.splice(i.indexOf(e),0,n)}e.prev&&(e.prev.next=n),n.parent=r,n.prev=e.prev,n.next=e,e.prev=n}})),kv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.filter=n,e.find=r,e.findOneChild=i,e.findOne=a,e.existsOne=o,e.findAll=s;var t=hv();function n(e,t,n,i){return n===void 0&&(n=!0),i===void 0&&(i=1/0),r(e,Array.isArray(t)?t:[t],n,i)}function r(e,n,r,i){for(var a=[],o=[Array.isArray(n)?n:[n]],s=[0];;){if(s[0]>=o[0].length){if(s.length===1)return a;o.shift(),s.shift();continue}var c=o[0][s[0]++];if(e(c)&&(a.push(c),--i<=0))return a;r&&(0,t.hasChildren)(c)&&c.children.length>0&&(s.unshift(0),o.unshift(c.children))}}function i(e,t){return t.find(e)}function a(e,n,r){r===void 0&&(r=!0);for(var i=Array.isArray(n)?n:[n],o=0;o<i.length;o++){var s=i[o];if((0,t.isTag)(s)&&e(s))return s;if(r&&(0,t.hasChildren)(s)&&s.children.length>0){var c=a(e,s.children,!0);if(c)return c}}return null}function o(e,n){return(Array.isArray(n)?n:[n]).some(function(n){return(0,t.isTag)(n)&&e(n)||(0,t.hasChildren)(n)&&o(e,n.children)})}function s(e,n){for(var r=[],i=[Array.isArray(n)?n:[n]],a=[0];;){if(a[0]>=i[0].length){if(i.length===1)return r;i.shift(),a.shift();continue}var o=i[0][a[0]++];(0,t.isTag)(o)&&e(o)&&r.push(o),(0,t.hasChildren)(o)&&o.children.length>0&&(a.unshift(0),i.unshift(o.children))}}})),Av=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.testElement=s,e.getElements=c,e.getElementById=l,e.getElementsByTagName=u,e.getElementsByClassName=d,e.getElementsByTagType=f;var t=hv(),n=kv(),r={tag_name:function(e){return typeof e==`function`?function(n){return(0,t.isTag)(n)&&e(n.name)}:e===`*`?t.isTag:function(n){return(0,t.isTag)(n)&&n.name===e}},tag_type:function(e){return typeof e==`function`?function(t){return e(t.type)}:function(t){return t.type===e}},tag_contains:function(e){return typeof e==`function`?function(n){return(0,t.isText)(n)&&e(n.data)}:function(n){return(0,t.isText)(n)&&n.data===e}}};function i(e,n){return typeof n==`function`?function(r){return(0,t.isTag)(r)&&n(r.attribs[e])}:function(r){return(0,t.isTag)(r)&&r.attribs[e]===n}}function a(e,t){return function(n){return e(n)||t(n)}}function o(e){var t=Object.keys(e).map(function(t){var n=e[t];return Object.prototype.hasOwnProperty.call(r,t)?r[t](n):i(t,n)});return t.length===0?null:t.reduce(a)}function s(e,t){var n=o(e);return n?n(t):!0}function c(e,t,r,i){i===void 0&&(i=1/0);var a=o(e);return a?(0,n.filter)(a,t,r,i):[]}function l(e,t,r){return r===void 0&&(r=!0),Array.isArray(t)||(t=[t]),(0,n.findOne)(i(`id`,e),t,r)}function u(e,t,i,a){return i===void 0&&(i=!0),a===void 0&&(a=1/0),(0,n.filter)(r.tag_name(e),t,i,a)}function d(e,t,r,a){return r===void 0&&(r=!0),a===void 0&&(a=1/0),(0,n.filter)(i(`class`,e),t,r,a)}function f(e,t,i,a){return i===void 0&&(i=!0),a===void 0&&(a=1/0),(0,n.filter)(r.tag_type(e),t,i,a)}})),jv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DocumentPosition=void 0,e.removeSubsets=n,e.compareDocumentPosition=i,e.uniqueSort=a;var t=hv();function n(e){for(var t=e.length;--t>=0;){var n=e[t];if(t>0&&e.lastIndexOf(n,t-1)>=0){e.splice(t,1);continue}for(var r=n.parent;r;r=r.parent)if(e.includes(r)){e.splice(t,1);break}}return e}var r;(function(e){e[e.DISCONNECTED=1]=`DISCONNECTED`,e[e.PRECEDING=2]=`PRECEDING`,e[e.FOLLOWING=4]=`FOLLOWING`,e[e.CONTAINS=8]=`CONTAINS`,e[e.CONTAINED_BY=16]=`CONTAINED_BY`})(r||(e.DocumentPosition=r={}));function i(e,n){var i=[],a=[];if(e===n)return 0;for(var o=(0,t.hasChildren)(e)?e:e.parent;o;)i.unshift(o),o=o.parent;for(o=(0,t.hasChildren)(n)?n:n.parent;o;)a.unshift(o),o=o.parent;for(var s=Math.min(i.length,a.length),c=0;c<s&&i[c]===a[c];)c++;if(c===0)return r.DISCONNECTED;var l=i[c-1],u=l.children,d=i[c],f=a[c];return u.indexOf(d)>u.indexOf(f)?l===n?r.FOLLOWING|r.CONTAINED_BY:r.FOLLOWING:l===e?r.PRECEDING|r.CONTAINS:r.PRECEDING}function a(e){return e=e.filter(function(e,t,n){return!n.includes(e,t+1)}),e.sort(function(e,t){var n=i(e,t);return n&r.PRECEDING?-1:n&r.FOLLOWING?1:0}),e}})),Mv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getFeed=r;var t=Ev(),n=Av();function r(e){var t=l(f,e);return t?t.name===`feed`?i(t):a(t):null}function i(e){var t=e.children,r={type:`atom`,items:(0,n.getElementsByTagName)(`entry`,t).map(function(e){var t=e.children,n={media:c(t)};d(n,`id`,`id`,t),d(n,`title`,`title`,t);var r=l(`link`,t)?.attribs.href;r&&(n.link=r);var i=u(`summary`,t)||u(`content`,t);i&&(n.description=i);var a=u(`updated`,t);return a&&(n.pubDate=new Date(a)),n})};d(r,`id`,`id`,t),d(r,`title`,`title`,t);var i=l(`link`,t)?.attribs.href;i&&(r.link=i),d(r,`description`,`subtitle`,t);var a=u(`updated`,t);return a&&(r.updated=new Date(a)),d(r,`author`,`email`,t,!0),r}function a(e){var t=l(`channel`,e.children)?.children??[],r={type:e.name.substr(0,3),id:``,items:(0,n.getElementsByTagName)(`item`,e.children).map(function(e){var t=e.children,n={media:c(t)};d(n,`id`,`guid`,t),d(n,`title`,`title`,t),d(n,`link`,`link`,t),d(n,`description`,`description`,t);var r=u(`pubDate`,t)||u(`dc:date`,t);return r&&(n.pubDate=new Date(r)),n})};d(r,`title`,`title`,t),d(r,`link`,`link`,t),d(r,`description`,`description`,t);var i=u(`lastBuildDate`,t);return i&&(r.updated=new Date(i)),d(r,`author`,`managingEditor`,t,!0),r}var o=[`url`,`type`,`lang`],s=[`fileSize`,`bitrate`,`framerate`,`samplingrate`,`channels`,`duration`,`height`,`width`];function c(e){return(0,n.getElementsByTagName)(`media:content`,e).map(function(e){for(var t=e.attribs,n={medium:t.medium,isDefault:!!t.isDefault},r=0,i=o;r<i.length;r++){var a=i[r];t[a]&&(n[a]=t[a])}for(var c=0,l=s;c<l.length;c++){var a=l[c];t[a]&&(n[a]=parseInt(t[a],10))}return t.expression&&(n.expression=t.expression),n})}function l(e,t){return(0,n.getElementsByTagName)(e,t,!0,1)[0]}function u(e,r,i){return i===void 0&&(i=!1),(0,t.textContent)((0,n.getElementsByTagName)(e,r,i,1)).trim()}function d(e,t,n,r,i){i===void 0&&(i=!1);var a=u(n,r,i);a&&(e[t]=a)}function f(e){return e===`rss`||e===`feed`||e===`rdf:RDF`}})),Nv=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.hasChildren=e.isDocument=e.isComment=e.isText=e.isCDATA=e.isTag=void 0,n(Ev(),e),n(Dv(),e),n(Ov(),e),n(kv(),e),n(Av(),e),n(jv(),e),n(Mv(),e);var r=hv();Object.defineProperty(e,"isTag",{enumerable:!0,get:function(){return r.isTag}}),Object.defineProperty(e,"isCDATA",{enumerable:!0,get:function(){return r.isCDATA}}),Object.defineProperty(e,"isText",{enumerable:!0,get:function(){return r.isText}}),Object.defineProperty(e,"isComment",{enumerable:!0,get:function(){return r.isComment}}),Object.defineProperty(e,"isDocument",{enumerable:!0,get:function(){return r.isDocument}}),Object.defineProperty(e,"hasChildren",{enumerable:!0,get:function(){return r.hasChildren}})})),Pv=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;o<a.length;o++)a[o]!=="default"&&t(i,r,a[o]);return n(i,r),i}})(),i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.DomUtils=e.getFeed=e.ElementType=e.QuoteType=e.Tokenizer=e.DefaultHandler=e.DomHandler=e.Parser=void 0,e.parseDocument=l,e.parseDOM=u,e.createDocumentStream=d,e.createDomStream=f,e.parseFeed=_;var a=fv(),o=fv();Object.defineProperty(e,"Parser",{enumerable:!0,get:function(){return o.Parser}});var s=hv(),c=hv();Object.defineProperty(e,"DomHandler",{enumerable:!0,get:function(){return c.DomHandler}}),Object.defineProperty(e,"DefaultHandler",{enumerable:!0,get:function(){return c.DomHandler}});function l(e,t){let n=new s.DomHandler(void 0,t);return new a.Parser(n,t).end(e),n.root}function u(e,t){return l(e,t).children}function d(e,t,n){let r=new s.DomHandler(t=>e(t,r.root),t,n);return new a.Parser(r,t)}function f(e,t,n){let r=new s.DomHandler(e,t,n);return new a.Parser(r,t)}var p=dv();Object.defineProperty(e,"Tokenizer",{enumerable:!0,get:function(){return i(p).default}}),Object.defineProperty(e,"QuoteType",{enumerable:!0,get:function(){return p.QuoteType}}),e.ElementType=r(pv());var m=Nv(),h=Nv();Object.defineProperty(e,"getFeed",{enumerable:!0,get:function(){return h.getFeed}});var g={xmlMode:!0};function _(e,t=g){return(0,m.getFeed)(u(e,t))}e.DomUtils=r(Nv())})),Fv=t(((e,t)=>{t.exports=e=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}})),Iv=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){return Object.prototype.toString.call(e)===`[object Object]`}function n(e){var n,r;return t(e)===!1?!1:(n=e.constructor,n===void 0?!0:(r=n.prototype,!(t(r)===!1||r.hasOwnProperty(`isPrototypeOf`)===!1)))}e.isPlainObject=n})),Lv=t(((e,t)=>{var n=function(e){return r(e)&&!i(e)};function r(e){return!!e&&typeof e==`object`}function i(e){var t=Object.prototype.toString.call(e);return t===`[object RegExp]`||t===`[object Date]`||o(e)}var a=typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.element`):60103;function o(e){return e.$$typeof===a}function s(e){return Array.isArray(e)?[]:{}}function c(e,t){return t.clone!==!1&&t.isMergeableObject(e)?g(s(e),e,t):e}function l(e,t,n){return e.concat(t).map(function(e){return c(e,n)})}function u(e,t){if(!t.customMerge)return g;var n=t.customMerge(e);return typeof n==`function`?n:g}function d(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function f(e){return Object.keys(e).concat(d(e))}function p(e,t){try{return t in e}catch{return!1}}function m(e,t){return p(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function h(e,t,n){var r={};return n.isMergeableObject(e)&&f(e).forEach(function(t){r[t]=c(e[t],n)}),f(t).forEach(function(i){m(e,i)||(p(e,i)&&n.isMergeableObject(t[i])?r[i]=u(i,n)(e[i],t[i],n):r[i]=c(t[i],n))}),r}function g(e,t,r){r||={},r.arrayMerge=r.arrayMerge||l,r.isMergeableObject=r.isMergeableObject||n,r.cloneUnlessOtherwiseSpecified=c;var i=Array.isArray(t);return i===Array.isArray(e)?i?r.arrayMerge(e,t,r):h(e,t,r):c(t,r)}g.all=function(e,t){if(!Array.isArray(e))throw Error(`first argument should be an array`);return e.reduce(function(e,n){return g(e,n,t)},{})},t.exports=g})),Rv=t(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define([],n):typeof t==`object`&&t.exports?t.exports=n():e.parseSrcset=n()})(e,function(){return function(e){function t(e){return e===` `||e===` `||e===`
132
+ `||e===`\f`||e===`\r`}function n(t){var n,r=t.exec(e.substring(h));if(r)return n=r[0],h+=n.length,n}for(var r=e.length,i=/^[ \t\n\r\u000c]+/,a=/^[, \t\n\r\u000c]+/,o=/^[^ \t\n\r\u000c]+/,s=/[,]+$/,c=/^\d+$/,l=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,u,d,f,p,m,h=0,g=[];;){if(n(a),h>=r)return g;u=n(o),d=[],u.slice(-1)===`,`?(u=u.replace(s,``),v()):_()}function _(){for(n(i),f=``,p=`in descriptor`;;){if(m=e.charAt(h),p===`in descriptor`)if(t(m))f&&(d.push(f),f=``,p=`after descriptor`);else if(m===`,`){h+=1,f&&d.push(f),v();return}else if(m===`(`)f+=m,p=`in parens`;else if(m===``){f&&d.push(f),v();return}else f+=m;else if(p===`in parens`)if(m===`)`)f+=m,p=`in descriptor`;else if(m===``){d.push(f),v();return}else f+=m;else if(p===`after descriptor`&&!t(m))if(m===``){v();return}else p=`in descriptor`,--h;h+=1}}function v(){var t=!1,n,r,i,a,o={},s,f,p,m,h;for(a=0;a<d.length;a++)s=d[a],f=s[s.length-1],p=s.substring(0,s.length-1),m=parseInt(p,10),h=parseFloat(p),c.test(p)&&f===`w`?((n||r)&&(t=!0),m===0?t=!0:n=m):l.test(p)&&f===`x`?((n||r||i)&&(t=!0),h<0?t=!0:r=h):c.test(p)&&f===`h`?((i||r)&&(t=!0),m===0?t=!0:i=m):t=!0;t?console&&console.log&&console.log(`Invalid srcset descriptor found in '`+e+`' at '`+s+`'.`):(o.url=u,n&&(o.w=n),r&&(o.d=r),i&&(o.h=i),g.push(o))}}})})),zv=t(((e,t)=>{var n=String,r=function(){return{isColorSupported:!1,reset:n,bold:n,dim:n,italic:n,underline:n,inverse:n,hidden:n,strikethrough:n,black:n,red:n,green:n,yellow:n,blue:n,magenta:n,cyan:n,white:n,gray:n,bgBlack:n,bgRed:n,bgGreen:n,bgYellow:n,bgBlue:n,bgMagenta:n,bgCyan:n,bgWhite:n,blackBright:n,redBright:n,greenBright:n,yellowBright:n,blueBright:n,magentaBright:n,cyanBright:n,whiteBright:n,bgBlackBright:n,bgRedBright:n,bgGreenBright:n,bgYellowBright:n,bgBlueBright:n,bgMagentaBright:n,bgCyanBright:n,bgWhiteBright:n}};t.exports=r(),t.exports.createColors=r})),Bv=t(((e,t)=>{t.exports={}})),Vv=t(((e,t)=>{var n=zv(),r=Bv(),i=class e extends Error{constructor(t,n,r,i,a,o){super(t),this.name=`CssSyntaxError`,this.reason=t,a&&(this.file=a),i&&(this.source=i),o&&(this.plugin=o),n!==void 0&&r!==void 0&&(typeof n==`number`?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+`: `:``,this.message+=this.file?this.file:`<css input>`,this.line!==void 0&&(this.message+=`:`+this.line+`:`+this.column),this.message+=`: `+this.reason}showSourceCode(e){if(!this.source)return``;let t=this.source;e??=n.isColorSupported;let i=e=>e,a=e=>e,o=e=>e;if(e){let{bold:e,gray:t,red:s}=n.createColors(!0);a=t=>e(s(t)),i=e=>t(e),r&&(o=e=>r(e))}let s=t.split(/\r?\n/),c=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;return s.slice(c,l).map((e,t)=>{let n=c+1+t,r=` `+(` `+n).slice(-u)+` | `;if(n===this.line){if(e.length>160){let t=Math.max(0,this.column-20),n=Math.max(this.column+20,this.endColumn+20),s=e.slice(t,n),c=i(r.replace(/\d/g,` `))+e.slice(0,Math.min(this.column-1,19)).replace(/[^\t]/g,` `);return a(`>`)+i(r)+o(s)+`
133
133
  `+c+a(`^`)}let t=i(r.replace(/\d/g,` `))+e.slice(0,this.column-1).replace(/[^\t]/g,` `);return a(`>`)+i(r)+o(e)+`
134
134
  `+t+a(`^`)}return` `+i(r)+o(e)}).join(`
135
135
  `)}toString(){let e=this.showSourceCode();return e&&=`
136
136
 
137
137
  `+e+`
138
- `,this.name+`: `+this.message+e}};t.exports=i,i.default=i})),Fv=t(((e,t)=>{var n=/(<)(\/?style\b)/gi,r=/(<)(!--)/g;function i(e){return typeof e!=`string`||!e.includes(`<`)?e:e.replace(n,`\\3c $2`).replace(r,`\\3c $2`)}var a={after:`
138
+ `,this.name+`: `+this.message+e}};t.exports=i,i.default=i})),Hv=t(((e,t)=>{var n=/(<)(\/?style\b)/gi,r=/(<)(!--)/g;function i(e){return typeof e!=`string`||!e.includes(`<`)?e:e.replace(n,`\\3c $2`).replace(r,`\\3c $2`)}var a={after:`
139
139
  `,beforeClose:`
140
140
  `,beforeComment:`
141
141
  `,beforeDecl:`
@@ -146,29 +146,30 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
146
146
  `)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeDecl`):n&&=n.replace(/\S/g,``),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(e.raws.before!==void 0)return n=e.raws.before,n.includes(`
147
147
  `)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeRule`):n&&=n.replace(/\S/g,``),n}rawBeforeOpen(e){let t;return e.walk(e=>{if(e.type!==`decl`&&(t=e.raws.between,t!==void 0))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&n.raws.before!==void 0)return t=n.raws.before,t.includes(`
148
148
  `)&&(t=t.replace(/[^\n]+$/,``)),!1}),t&&=t.replace(/\S/g,``),t}rawColon(e){let t;return e.walkDecls(e=>{if(e.raws.between!==void 0)return t=e.raws.between.replace(/[^\s:]/g,``),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length===0&&(t=e.raws.after,t!==void 0))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&n.raws.before!==void 0){let e=n.raws.before.split(`
149
- `);return t=e[e.length-1],t=t.replace(/\S/g,``),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&e.last.type===`decl`&&(t=e.raws.semicolon,t!==void 0))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){if(this.body(e),e.raws.after){let t=e.raws.after,n=e.parent&&e.parent.type===`document`;this.builder(n?t:i(t))}}rule(e){this.block(e,this.rawValue(e,`selector`)),e.raws.ownSemicolon&&this.builder(i(e.raws.ownSemicolon),e,`end`)}stringify(e,t){if(!this[e.type])throw Error(`Unknown AST node type `+e.type+`. Maybe you need to change PostCSS stringifier.`);this[e.type](e,t)}};t.exports=s,s.default=s})),Iv=t(((e,t)=>{var n=Fv();function r(e,t){new n(t).stringify(e)}t.exports=r,r.default=r})),Lv=t(((e,t)=>{t.exports.isClean=Symbol(`isClean`),t.exports.my=Symbol(`my`)})),Rv=t(((e,t)=>{var n=Pv(),r=Fv(),i=Iv(),{isClean:a,my:o}=Lv();function s(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r===`proxyCache`)continue;let i=e[r],a=typeof i;r===`parent`&&a===`object`?t&&(n[r]=t):r===`source`?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>s(e,n)):(a===`object`&&i!==null&&(i=s(i)),n[r]=i)}return n}function c(e,t){if(t&&t.offset!==void 0)return t.offset;let n=1,r=1,i=0;for(let a=0;a<e.length;a++){if(r===t.line&&n===t.column){i=a;break}e[a]===`
149
+ `);return t=e[e.length-1],t=t.replace(/\S/g,``),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&e.last.type===`decl`&&(t=e.raws.semicolon,t!==void 0))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){if(this.body(e),e.raws.after){let t=e.raws.after,n=e.parent&&e.parent.type===`document`;this.builder(n?t:i(t))}}rule(e){this.block(e,this.rawValue(e,`selector`)),e.raws.ownSemicolon&&this.builder(i(e.raws.ownSemicolon),e,`end`)}stringify(e,t){if(!this[e.type])throw Error(`Unknown AST node type `+e.type+`. Maybe you need to change PostCSS stringifier.`);this[e.type](e,t)}};t.exports=s,s.default=s})),Uv=t(((e,t)=>{var n=Hv();function r(e,t){new n(t).stringify(e)}t.exports=r,r.default=r})),Wv=t(((e,t)=>{t.exports.isClean=Symbol(`isClean`),t.exports.my=Symbol(`my`)})),Gv=t(((e,t)=>{var n=Vv(),r=Hv(),i=Uv(),{isClean:a,my:o}=Wv();function s(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r===`proxyCache`)continue;let i=e[r],a=typeof i;r===`parent`&&a===`object`?t&&(n[r]=t):r===`source`?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>s(e,n)):(a===`object`&&i!==null&&(i=s(i)),n[r]=i)}return n}function c(e,t){if(t&&t.offset!==void 0)return t.offset;let n=1,r=1,i=0;for(let a=0;a<e.length;a++){if(r===t.line&&n===t.column){i=a;break}e[a]===`
150
150
  `?(n=1,r+=1):n+=1}return i}var l=class{get proxyOf(){return this}constructor(e={}){this.raws={},this[a]=!1,this[o]=!0;for(let t in e)if(t===`nodes`){this.nodes=[];for(let n of e[t])typeof n.clone==`function`?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=s(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new n(e)}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:t===`root`?()=>e.root().toProxy():e[t]},set(e,t,n){return e[t]===n?!0:(e[t]=n,(t===`prop`||t===`value`||t===`name`||t===`params`||t===`important`||t===`text`)&&e.markDirty(),!0)}}}markClean(){this[a]=!0}markDirty(){if(this[a]){this[a]=!1;let e=this;for(;e=e.parent;)e[a]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let n=`document`in this.source.input?this.source.input.document:this.source.input.css,r=n.slice(c(n,this.source.start),c(n,this.source.end)).indexOf(e.word);r!==-1&&(t=this.positionInside(r))}return t}positionInside(e){let t=this.source.start.column,n=this.source.start.line,r=`document`in this.source.input?this.source.input.document:this.source.input.css,i=c(r,this.source.start),a=i+e;for(let e=i;e<a;e++)r[e]===`
151
- `?(t=1,n+=1):t+=1;return{column:t,line:n,offset:a}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t=`document`in this.source.input?this.source.input.document:this.source.input.css,n={column:this.source.start.column,line:this.source.start.line,offset:c(t,this.source.start)},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset==`number`?this.source.end.offset:c(t,this.source.end)+1}:{column:n.column+1,line:n.line,offset:n.offset+1};if(e.word){let i=t.slice(c(t,this.source.start),c(t,this.source.end)).indexOf(e.word);i!==-1&&(n=this.positionInside(i),r=this.positionInside(i+e.word.length))}else e.start?n={column:e.start.column,line:e.start.line,offset:c(t,e.start)}:e.index&&(n=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line,offset:c(t,e.end)}:typeof e.endIndex==`number`?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<n.line||r.line===n.line&&r.column<=n.column)&&(r={column:n.column+1,line:n.line,offset:n.offset+1}),{end:r,start:n}}raw(e,t){return new r().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!==`document`;)e=e.parent;return e}toJSON(e,t){let n={},r=t==null;t||=new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e)||e===`parent`||e===`proxyCache`)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>typeof e==`object`&&e.toJSON?e.toJSON(null,t):e);else if(typeof r==`object`&&r.toJSON)n[e]=r.toJSON(null,t);else if(e===`source`){if(r==null)continue;let a=t.get(r.input);a??(a=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:a,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||=new Proxy(this,this.getProxyProcessor()),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t=``;return e(this,e=>{t+=e}),t}warn(e,t,n={}){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}};t.exports=l,l.default=l})),zv=t(((e,t)=>{var n=Rv(),r=class extends n{constructor(e){super(e),this.type=`comment`}};t.exports=r,r.default=r})),Bv=t(((e,t)=>{var n=Rv(),r=class extends n{get variable(){return this.prop.startsWith(`--`)||this.prop[0]===`$`}constructor(e){e&&e.value!==void 0&&typeof e.value!=`string`&&(e={...e,value:String(e.value)}),super(e),this.type=`decl`}};t.exports=r,r.default=r})),Vv=t(((e,t)=>{var n=zv(),r=Bv(),i=Rv(),{isClean:a,my:o}=Lv(),s,c,l,u;function d(e){return e.map(e=>(e.nodes&&=d(e.nodes),delete e.source,e))}function f(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)f(t)}var p=class e extends i{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),n,r;for(;this.indexes[t]<this.proxyOf.nodes.length&&(n=this.indexes[t],r=e(this.proxyOf.nodes[n],n),r!==!1);)this.indexes[t]+=1;return delete this.indexes[t],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||=0,this.indexes||={},this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:e[t]?t===`each`||typeof t==`string`&&t.startsWith(`walk`)?(...n)=>e[t](...n.map(e=>typeof e==`function`?(t,n)=>e(t.toProxy(),n):e)):t===`every`||t===`some`?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):t===`root`?()=>e.root().toProxy():t===`nodes`?e.nodes.map(e=>e.toProxy()):t===`first`||t===`last`?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n?!0:(e[t]=n,(t===`name`||t===`params`||t===`selector`)&&e.markDirty(),!0)}}}index(e){return typeof e==`number`?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n=this.index(e),r=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of r)this.proxyOf.nodes.splice(n+1,0,e);let i;for(let e in this.indexes)i=this.indexes[e],n<i&&(this.indexes[e]=i+r.length);return this.markDirty(),this}insertBefore(e,t){let n=this.index(e),r=n===0?`prepend`:!1,i=this.normalize(t,this.proxyOf.nodes[n],r).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);let a;for(let e in this.indexes)a=this.indexes[e],n<=a&&(this.indexes[e]=a+i.length);return this.markDirty(),this}normalize(t,i){if(typeof t==`string`)t=d(c(t).nodes);else if(t===void 0)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,`ignore`)}else if(t.type===`root`&&this.type!==`document`){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,`ignore`)}else if(t.type)t=[t];else if(t.prop){if(t.value===void 0)throw Error(`Value field is missed in node creation`);typeof t.value!=`string`&&(t.value=String(t.value)),t=[new r(t)]}else if(t.selector||t.selectors)t=[new u(t)];else if(t.name)t=[new s(t)];else if(t.text)t=[new n(t)];else throw Error(`Unknown node type in node creation`);return t.map(t=>(t[o]||e.rebuild(t),t=t.proxyOf,t.parent&&t.parent.removeChild(t),t[a]&&f(t),t.raws||={},t.raws.before===void 0&&i&&i.raws.before!==void 0&&(t.raws.before=i.raws.before.replace(/\S/g,``)),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,`prepend`).reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return r!==!1&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`atrule`&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if(n.type===`atrule`&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`atrule`)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if(t.type===`comment`)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`decl`&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if(n.type===`decl`&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`decl`)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`rule`&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if(n.type===`rule`&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`rule`)return t(e,n)}))}};p.registerParse=e=>{c=e},p.registerRule=e=>{u=e},p.registerAtRule=e=>{s=e},p.registerRoot=e=>{l=e},t.exports=p,p.default=p,p.rebuild=e=>{e.type===`atrule`?Object.setPrototypeOf(e,s.prototype):e.type===`rule`?Object.setPrototypeOf(e,u.prototype):e.type===`decl`?Object.setPrototypeOf(e,r.prototype):e.type===`comment`?Object.setPrototypeOf(e,n.prototype):e.type===`root`&&Object.setPrototypeOf(e,l.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{p.rebuild(e)})}})),Hv=t(((e,t)=>{var n=Vv(),r=class extends n{constructor(e){super(e),this.type=`atrule`}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};t.exports=r,r.default=r,n.registerAtRule(r)})),Uv=t(((e,t)=>{var n=Vv(),r,i,a=class extends n{constructor(e){super({type:`document`,...e}),this.nodes||=[]}toResult(e={}){return new r(new i,this,e).stringify()}};a.registerLazyResult=e=>{r=e},a.registerProcessor=e=>{i=e},t.exports=a,a.default=a})),Wv=t(((e,t)=>{var n=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;t.exports={nanoid:(e=21)=>{let t=``,r=e|0;for(;r--;)t+=n[Math.random()*64|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r=``,i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r}}})),Gv=t(((e,t)=>{var{existsSync:n,readFileSync:r}=Nv(),{dirname:i,join:a}=Nv(),{SourceMapConsumer:o,SourceMapGenerator:s}=Nv();function c(e){return Buffer?Buffer.from(e,`base64`).toString():window.atob(e)}var l=class{constructor(e,t){if(t.map===!1)return;t.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(e),this.inline=this.startWith(this.annotation,`data:`);let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||=new o(this.json||this.text),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/,r=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(r)return decodeURIComponent(e.substr(r[0].length));let i=e.match(t)||e.match(n);if(i)return c(e.substr(i[0].length));let a=e.slice(22);throw a=a.slice(0,a.indexOf(`,`)),Error(`Unsupported source map encoding `+a)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,``).trim()}isMap(e){return typeof e==`object`?typeof e.mappings==`string`||typeof e._mappings==`string`||Array.isArray(e.sections):!1}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf(`*/`,n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e,t,a){if(!(!a&&!this.unsafeMap&&!/\.map$/i.test(e))&&(this.root=i(e),n(e)))return this.mapFile=e,r(e,`utf-8`).toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t==`string`)return t;if(typeof t==`function`){let n=t(e);if(n){let t=this.loadFile(n,e,!0);if(!t)throw Error(`Unable to load previous source map: `+n.toString());return t}}else if(t instanceof o)return s.fromSourceMap(t).toString();else if(t instanceof s)return t.toString();else if(this.isMap(t))return JSON.stringify(t);else throw Error(`Unsupported previous source map format: `+t.toString())}else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let t=this.annotation;e&&(t=a(i(e),t));let n=this.loadFile(t,e,!1);if(n)try{this.json=JSON.parse(n.replace(/^\)]}'[^\n]*\n/,``))}catch{return}return n}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};t.exports=l,l.default=l})),Kv=t(((e,t)=>{var{nanoid:n}=Wv(),{isAbsolute:r,resolve:i}=Nv(),{SourceMapConsumer:a,SourceMapGenerator:o}=Nv(),{fileURLToPath:s,pathToFileURL:c}=Nv(),l=Pv(),u=Gv(),d=Nv(),f=Symbol(`lineToIndexCache`),p=!!(a&&o),m=!!(i&&r);function h(e){if(e[f])return e[f];let t=e.css.split(`
152
- `),n=Array(t.length),r=0;for(let e=0,i=t.length;e<i;e++)n[e]=r,r+=t[e].length+1;return e[f]=n,n}var g=class{get from(){return this.file||this.id}constructor(e,t={}){if(e==null||typeof e==`object`&&!e.toString)throw Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]===``||this.css[0]===`￾`?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,t.document&&(this.document=t.document.toString()),t.from&&(!m||/^\w+:\/\//.test(t.from)||r(t.from)?this.file=t.from:this.file=i(t.from)),m&&p){let e=new u(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id=`<input css `+n(6)+`>`),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let i,a,o,s,u;if(t&&typeof t==`object`){let e=t,r=n;if(typeof e.offset==`number`){s=e.offset;let r=this.fromOffset(s);t=r.line,n=r.col}else t=e.line,n=e.column,s=this.fromLineAndColumn(t,n);if(typeof r.offset==`number`){o=r.offset;let e=this.fromOffset(o);a=e.line,i=e.col}else a=r.line,i=r.column,o=this.fromLineAndColumn(r.line,r.column)}else if(n)s=this.fromLineAndColumn(t,n);else{s=t;let e=this.fromOffset(s);t=e.line,n=e.col}let d=this.origin(t,n,a,i);return u=d?new l(e,d.endLine===void 0?d.line:{column:d.column,line:d.line},d.endLine===void 0?d.column:{column:d.endColumn,line:d.endLine},d.source,d.file,r.plugin):new l(e,a===void 0?t:{column:n,line:t},a===void 0?n:{column:i,line:a},this.css,this.file,r.plugin),u.input={column:n,endColumn:i,endLine:a,endOffset:o,line:t,offset:s,source:this.css},this.file&&(c&&(u.input.url=c(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return h(this)[e-1]+t-1}fromOffset(e){let t=h(this),n=t[t.length-1],r=0;if(e>=n)r=t.length-1;else{let n=t.length-2,i;for(;r<n;)if(i=r+(n-r>>1),e<t[i])n=i-1;else if(e>=t[i+1])r=i+1;else{r=i;break}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:i(this.map.consumer().sourceRoot||this.map.root||`.`,e)}origin(e,t,n,i){if(!this.map)return!1;let a=this.map.consumer(),o=a.originalPositionFor({column:t,line:e});if(!o.source)return!1;let l;typeof n==`number`&&(l=a.originalPositionFor({column:i,line:n}));let u;u=r(o.source)?c(o.source):new URL(o.source,this.map.consumer().sourceRoot||c(this.map.mapFile));let d={column:o.column,endColumn:l&&l.column,endLine:l&&l.line,line:o.line,url:u.toString()};if(u.protocol===`file:`)if(s)d.file=s(u);else throw Error(`file: protocol is not available in this PostCSS build`);let f=a.sourceContentFor(o.source);return f&&(d.source=f),d}toJSON(){let e={};for(let t of[`hasBOM`,`css`,`file`,`id`])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};t.exports=g,g.default=g,d&&d.registerInput&&d.registerInput(g)})),qv=t(((e,t)=>{var n=Vv(),r,i,a=class extends n{constructor(e){super(e),this.type=`root`,this.nodes||=[]}normalize(e,t,n){let r=super.normalize(e);if(t){if(n===`prepend`)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before}return r}removeChild(e,t){let n=this.index(e);return!t&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new r(new i,this,e).stringify()}};a.registerLazyResult=e=>{r=e},a.registerProcessor=e=>{i=e},t.exports=a,a.default=a,n.registerRoot(a)})),Jv=t(((e,t)=>{var n={comma(e){return n.split(e,[`,`],!0)},space(e){return n.split(e,[` `,`
153
- `,` `])},split(e,t,n){let r=[],i=``,a=!1,o=0,s=!1,c=``,l=!1;for(let n of e)l?l=!1:n===`\\`?l=!0:s?n===c&&(s=!1):n===`"`||n===`'`?(s=!0,c=n):n===`(`?o+=1:n===`)`?o>0&&--o:o===0&&t.includes(n)&&(a=!0),a?(i!==``&&r.push(i.trim()),i=``,a=!1):i+=n;return(n||i!==``)&&r.push(i.trim()),r}};t.exports=n,n.default=n})),Yv=t(((e,t)=>{var n=Vv(),r=Jv(),i=class extends n{get selectors(){return r.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:`,`+this.raw(`between`,`beforeOpen`);this.selector=e.join(n)}constructor(e){super(e),this.type=`rule`,this.nodes||=[]}};t.exports=i,i.default=i,n.registerRule(i)})),Xv=t(((e,t)=>{var n=Hv(),r=zv(),i=Bv(),a=Kv(),o=Gv(),s=qv(),c=Yv();function l(e,t){if(Array.isArray(e))return e.map(e=>l(e));let{inputs:u,...d}=e;if(u){t=[];for(let e of u){let n={...e,__proto__:a.prototype};n.map&&={...n.map,__proto__:o.prototype},t.push(n)}}if(d.nodes&&=e.nodes.map(e=>l(e,t)),d.source){let{inputId:e,...n}=d.source;d.source=n,e!=null&&(d.source.input=t[e])}if(d.type===`root`)return new s(d);if(d.type===`decl`)return new i(d);if(d.type===`rule`)return new c(d);if(d.type===`comment`)return new r(d);if(d.type===`atrule`)return new n(d);throw Error(`Unknown node type: `+e.type)}t.exports=l,l.default=l})),Zv=t(((e,t)=>{var{dirname:n,relative:r,resolve:i,sep:a}=Nv(),{SourceMapConsumer:o,SourceMapGenerator:s}=Nv(),{pathToFileURL:c}=Nv(),l=Kv(),u=!!(o&&s),d=!!(n&&i&&r&&a);t.exports=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?`data:application/json;base64,`+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation==`string`?this.mapOpts.annotation:typeof this.mapOpts.annotation==`function`?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+`.map`;let t=`
151
+ `?(t=1,n+=1):t+=1;return{column:t,line:n,offset:a}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t=`document`in this.source.input?this.source.input.document:this.source.input.css,n={column:this.source.start.column,line:this.source.start.line,offset:c(t,this.source.start)},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset==`number`?this.source.end.offset:c(t,this.source.end)+1}:{column:n.column+1,line:n.line,offset:n.offset+1};if(e.word){let i=t.slice(c(t,this.source.start),c(t,this.source.end)).indexOf(e.word);i!==-1&&(n=this.positionInside(i),r=this.positionInside(i+e.word.length))}else e.start?n={column:e.start.column,line:e.start.line,offset:c(t,e.start)}:e.index&&(n=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line,offset:c(t,e.end)}:typeof e.endIndex==`number`?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<n.line||r.line===n.line&&r.column<=n.column)&&(r={column:n.column+1,line:n.line,offset:n.offset+1}),{end:r,start:n}}raw(e,t){return new r().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!==`document`;)e=e.parent;return e}toJSON(e,t){let n={},r=t==null;t||=new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e)||e===`parent`||e===`proxyCache`)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>typeof e==`object`&&e.toJSON?e.toJSON(null,t):e);else if(typeof r==`object`&&r.toJSON)n[e]=r.toJSON(null,t);else if(e===`source`){if(r==null)continue;let a=t.get(r.input);a??(a=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:a,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||=new Proxy(this,this.getProxyProcessor()),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t=``;return e(this,e=>{t+=e}),t}warn(e,t,n={}){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}};t.exports=l,l.default=l})),Kv=t(((e,t)=>{var n=Gv(),r=class extends n{constructor(e){super(e),this.type=`comment`}};t.exports=r,r.default=r})),qv=t(((e,t)=>{var n=Gv(),r=class extends n{get variable(){return this.prop.startsWith(`--`)||this.prop[0]===`$`}constructor(e){e&&e.value!==void 0&&typeof e.value!=`string`&&(e={...e,value:String(e.value)}),super(e),this.type=`decl`}};t.exports=r,r.default=r})),Jv=t(((e,t)=>{var n=Kv(),r=qv(),i=Gv(),{isClean:a,my:o}=Wv(),s,c,l,u;function d(e){return e.map(e=>(e.nodes&&=d(e.nodes),delete e.source,e))}function f(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)f(t)}var p=class e extends i{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),n,r;for(;this.indexes[t]<this.proxyOf.nodes.length&&(n=this.indexes[t],r=e(this.proxyOf.nodes[n],n),r!==!1);)this.indexes[t]+=1;return delete this.indexes[t],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||=0,this.indexes||={},this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:e[t]?t===`each`||typeof t==`string`&&t.startsWith(`walk`)?(...n)=>e[t](...n.map(e=>typeof e==`function`?(t,n)=>e(t.toProxy(),n):e)):t===`every`||t===`some`?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):t===`root`?()=>e.root().toProxy():t===`nodes`?e.nodes.map(e=>e.toProxy()):t===`first`||t===`last`?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n?!0:(e[t]=n,(t===`name`||t===`params`||t===`selector`)&&e.markDirty(),!0)}}}index(e){return typeof e==`number`?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n=this.index(e),r=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of r)this.proxyOf.nodes.splice(n+1,0,e);let i;for(let e in this.indexes)i=this.indexes[e],n<i&&(this.indexes[e]=i+r.length);return this.markDirty(),this}insertBefore(e,t){let n=this.index(e),r=n===0?`prepend`:!1,i=this.normalize(t,this.proxyOf.nodes[n],r).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);let a;for(let e in this.indexes)a=this.indexes[e],n<=a&&(this.indexes[e]=a+i.length);return this.markDirty(),this}normalize(t,i){if(typeof t==`string`)t=d(c(t).nodes);else if(t===void 0)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,`ignore`)}else if(t.type===`root`&&this.type!==`document`){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,`ignore`)}else if(t.type)t=[t];else if(t.prop){if(t.value===void 0)throw Error(`Value field is missed in node creation`);typeof t.value!=`string`&&(t.value=String(t.value)),t=[new r(t)]}else if(t.selector||t.selectors)t=[new u(t)];else if(t.name)t=[new s(t)];else if(t.text)t=[new n(t)];else throw Error(`Unknown node type in node creation`);return t.map(t=>(t[o]||e.rebuild(t),t=t.proxyOf,t.parent&&t.parent.removeChild(t),t[a]&&f(t),t.raws||={},t.raws.before===void 0&&i&&i.raws.before!==void 0&&(t.raws.before=i.raws.before.replace(/\S/g,``)),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,`prepend`).reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return r!==!1&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`atrule`&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if(n.type===`atrule`&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`atrule`)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if(t.type===`comment`)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`decl`&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if(n.type===`decl`&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`decl`)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`rule`&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if(n.type===`rule`&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`rule`)return t(e,n)}))}};p.registerParse=e=>{c=e},p.registerRule=e=>{u=e},p.registerAtRule=e=>{s=e},p.registerRoot=e=>{l=e},t.exports=p,p.default=p,p.rebuild=e=>{e.type===`atrule`?Object.setPrototypeOf(e,s.prototype):e.type===`rule`?Object.setPrototypeOf(e,u.prototype):e.type===`decl`?Object.setPrototypeOf(e,r.prototype):e.type===`comment`?Object.setPrototypeOf(e,n.prototype):e.type===`root`&&Object.setPrototypeOf(e,l.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{p.rebuild(e)})}})),Yv=t(((e,t)=>{var n=Jv(),r=class extends n{constructor(e){super(e),this.type=`atrule`}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};t.exports=r,r.default=r,n.registerAtRule(r)})),Xv=t(((e,t)=>{var n=Jv(),r,i,a=class extends n{constructor(e){super({type:`document`,...e}),this.nodes||=[]}toResult(e={}){return new r(new i,this,e).stringify()}};a.registerLazyResult=e=>{r=e},a.registerProcessor=e=>{i=e},t.exports=a,a.default=a})),Zv=t(((e,t)=>{var n=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;t.exports={nanoid:(e=21)=>{let t=``,r=e|0;for(;r--;)t+=n[Math.random()*64|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r=``,i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r}}})),Qv=t(((e,t)=>{var{existsSync:n,readFileSync:r}=Bv(),{dirname:i,join:a}=Bv(),{SourceMapConsumer:o,SourceMapGenerator:s}=Bv();function c(e){return Buffer?Buffer.from(e,`base64`).toString():window.atob(e)}var l=class{constructor(e,t){if(t.map===!1)return;t.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(e),this.inline=this.startWith(this.annotation,`data:`);let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||=new o(this.json||this.text),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/,r=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(r)return decodeURIComponent(e.substr(r[0].length));let i=e.match(t)||e.match(n);if(i)return c(e.substr(i[0].length));let a=e.slice(22);throw a=a.slice(0,a.indexOf(`,`)),Error(`Unsupported source map encoding `+a)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,``).trim()}isMap(e){return typeof e==`object`?typeof e.mappings==`string`||typeof e._mappings==`string`||Array.isArray(e.sections):!1}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf(`*/`,n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e,t,a){if(!(!a&&!this.unsafeMap&&!/\.map$/i.test(e))&&(this.root=i(e),n(e)))return this.mapFile=e,r(e,`utf-8`).toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t==`string`)return t;if(typeof t==`function`){let n=t(e);if(n){let t=this.loadFile(n,e,!0);if(!t)throw Error(`Unable to load previous source map: `+n.toString());return t}}else if(t instanceof o)return s.fromSourceMap(t).toString();else if(t instanceof s)return t.toString();else if(this.isMap(t))return JSON.stringify(t);else throw Error(`Unsupported previous source map format: `+t.toString())}else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let t=this.annotation;e&&(t=a(i(e),t));let n=this.loadFile(t,e,!1);if(n)try{this.json=JSON.parse(n.replace(/^\)]}'[^\n]*\n/,``))}catch{return}return n}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};t.exports=l,l.default=l})),$v=t(((e,t)=>{var{nanoid:n}=Zv(),{isAbsolute:r,resolve:i}=Bv(),{SourceMapConsumer:a,SourceMapGenerator:o}=Bv(),{fileURLToPath:s,pathToFileURL:c}=Bv(),l=Vv(),u=Qv(),d=Bv(),f=Symbol(`lineToIndexCache`),p=!!(a&&o),m=!!(i&&r);function h(e){if(e[f])return e[f];let t=e.css.split(`
152
+ `),n=Array(t.length),r=0;for(let e=0,i=t.length;e<i;e++)n[e]=r,r+=t[e].length+1;return e[f]=n,n}var g=class{get from(){return this.file||this.id}constructor(e,t={}){if(e==null||typeof e==`object`&&!e.toString)throw Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]===``||this.css[0]===`￾`?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,t.document&&(this.document=t.document.toString()),t.from&&(!m||/^\w+:\/\//.test(t.from)||r(t.from)?this.file=t.from:this.file=i(t.from)),m&&p){let e=new u(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id=`<input css `+n(6)+`>`),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let i,a,o,s,u;if(t&&typeof t==`object`){let e=t,r=n;if(typeof e.offset==`number`){s=e.offset;let r=this.fromOffset(s);t=r.line,n=r.col}else t=e.line,n=e.column,s=this.fromLineAndColumn(t,n);if(typeof r.offset==`number`){o=r.offset;let e=this.fromOffset(o);a=e.line,i=e.col}else a=r.line,i=r.column,o=this.fromLineAndColumn(r.line,r.column)}else if(n)s=this.fromLineAndColumn(t,n);else{s=t;let e=this.fromOffset(s);t=e.line,n=e.col}let d=this.origin(t,n,a,i);return u=d?new l(e,d.endLine===void 0?d.line:{column:d.column,line:d.line},d.endLine===void 0?d.column:{column:d.endColumn,line:d.endLine},d.source,d.file,r.plugin):new l(e,a===void 0?t:{column:n,line:t},a===void 0?n:{column:i,line:a},this.css,this.file,r.plugin),u.input={column:n,endColumn:i,endLine:a,endOffset:o,line:t,offset:s,source:this.css},this.file&&(c&&(u.input.url=c(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return h(this)[e-1]+t-1}fromOffset(e){let t=h(this),n=t[t.length-1],r=0;if(e>=n)r=t.length-1;else{let n=t.length-2,i;for(;r<n;)if(i=r+(n-r>>1),e<t[i])n=i-1;else if(e>=t[i+1])r=i+1;else{r=i;break}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:i(this.map.consumer().sourceRoot||this.map.root||`.`,e)}origin(e,t,n,i){if(!this.map)return!1;let a=this.map.consumer(),o=a.originalPositionFor({column:t,line:e});if(!o.source)return!1;let l;typeof n==`number`&&(l=a.originalPositionFor({column:i,line:n}));let u;u=r(o.source)?c(o.source):new URL(o.source,this.map.consumer().sourceRoot||c(this.map.mapFile));let d={column:o.column,endColumn:l&&l.column,endLine:l&&l.line,line:o.line,url:u.toString()};if(u.protocol===`file:`)if(s)d.file=s(u);else throw Error(`file: protocol is not available in this PostCSS build`);let f=a.sourceContentFor(o.source);return f&&(d.source=f),d}toJSON(){let e={};for(let t of[`hasBOM`,`css`,`file`,`id`])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};t.exports=g,g.default=g,d&&d.registerInput&&d.registerInput(g)})),ey=t(((e,t)=>{var n=Jv(),r,i,a=class extends n{constructor(e){super(e),this.type=`root`,this.nodes||=[]}normalize(e,t,n){let r=super.normalize(e);if(t){if(n===`prepend`)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before}return r}removeChild(e,t){let n=this.index(e);return!t&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new r(new i,this,e).stringify()}};a.registerLazyResult=e=>{r=e},a.registerProcessor=e=>{i=e},t.exports=a,a.default=a,n.registerRoot(a)})),ty=t(((e,t)=>{var n={comma(e){return n.split(e,[`,`],!0)},space(e){return n.split(e,[` `,`
153
+ `,` `])},split(e,t,n){let r=[],i=``,a=!1,o=0,s=!1,c=``,l=!1;for(let n of e)l?l=!1:n===`\\`?l=!0:s?n===c&&(s=!1):n===`"`||n===`'`?(s=!0,c=n):n===`(`?o+=1:n===`)`?o>0&&--o:o===0&&t.includes(n)&&(a=!0),a?(i!==``&&r.push(i.trim()),i=``,a=!1):i+=n;return(n||i!==``)&&r.push(i.trim()),r}};t.exports=n,n.default=n})),ny=t(((e,t)=>{var n=Jv(),r=ty(),i=class extends n{get selectors(){return r.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:`,`+this.raw(`between`,`beforeOpen`);this.selector=e.join(n)}constructor(e){super(e),this.type=`rule`,this.nodes||=[]}};t.exports=i,i.default=i,n.registerRule(i)})),ry=t(((e,t)=>{var n=Yv(),r=Kv(),i=qv(),a=$v(),o=Qv(),s=ey(),c=ny();function l(e,t){if(Array.isArray(e))return e.map(e=>l(e));let{inputs:u,...d}=e;if(u){t=[];for(let e of u){let n={...e,__proto__:a.prototype};n.map&&={...n.map,__proto__:o.prototype},t.push(n)}}if(d.nodes&&=e.nodes.map(e=>l(e,t)),d.source){let{inputId:e,...n}=d.source;d.source=n,e!=null&&(d.source.input=t[e])}if(d.type===`root`)return new s(d);if(d.type===`decl`)return new i(d);if(d.type===`rule`)return new c(d);if(d.type===`comment`)return new r(d);if(d.type===`atrule`)return new n(d);throw Error(`Unknown node type: `+e.type)}t.exports=l,l.default=l})),iy=t(((e,t)=>{var{dirname:n,relative:r,resolve:i,sep:a}=Bv(),{SourceMapConsumer:o,SourceMapGenerator:s}=Bv(),{pathToFileURL:c}=Bv(),l=$v(),u=!!(o&&s),d=!!(n&&i&&r&&a);t.exports=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?`data:application/json;base64,`+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation==`string`?this.mapOpts.annotation:typeof this.mapOpts.annotation==`function`?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+`.map`;let t=`
154
154
  `;this.css.includes(`\r
155
155
  `)&&(t=`\r
156
156
  `),this.css+=t+`/*# sourceMappingURL=`+e+` */`}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||n(e.file),i;this.mapOpts.sourcesContent===!1?(i=new o(e.text),i.sourcesContent&&=null):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type===`comment`&&e.text.startsWith(`# sourceMappingURL=`)&&this.root.removeChild(t)}else if(this.css){let e;for(;(e=this.css.lastIndexOf(`/*#`))!==-1;){let t=this.css.indexOf(`*/`,e+3);if(t===-1)break;for(;e>0&&this.css[e-1]===`
157
157
  `;)e--;this.css=this.css.slice(0,e)+this.css.slice(t+2)}}}}generate(){if(this.clearAnnotation(),d&&u&&this.isMap())return this.generateMap();{let e=``;return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=s.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new s({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css=``,this.map=new s({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,n=`<no source>`,r={generated:{column:0,line:0},original:{column:0,line:0},source:``},i,a;this.stringify(this.root,(o,s,c)=>{if(this.css+=o,s&&c!==`end`&&(r.generated.line=e,r.generated.column=t-1,s.source&&s.source.start?(r.source=this.sourcePath(s),r.original.line=s.source.start.line,r.original.column=s.source.start.column-1,this.map.addMapping(r)):(r.source=n,r.original.line=1,r.original.column=0,this.map.addMapping(r))),a=o.match(/\n/g),a?(e+=a.length,i=o.lastIndexOf(`
158
- `),t=o.length-i):t+=o.length,s&&c!==`start`){let i=s.parent||{raws:{}};(!(s.type===`decl`||s.type===`atrule`&&!s.nodes)||s!==i.last||i.raws.semicolon)&&(s.source&&s.source.end?(r.source=this.sourcePath(s),r.original.line=s.source.end.line,r.original.column=s.source.end.column-1,r.generated.line=e,r.generated.column=t-2,this.map.addMapping(r)):(r.source=n,r.original.line=1,r.original.column=0,r.generated.line=e,r.generated.column=t-1,this.map.addMapping(r)))}})}isAnnotation(){return this.isInline()?!0:this.mapOpts.annotation===void 0?this.previous().length?this.previous().some(e=>e.annotation):!0:this.mapOpts.annotation}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return e!==void 0&&e!==!0?!1:this.previous().length?this.previous().some(e=>e.inline):!0}isMap(){return this.opts.map===void 0?this.previous().length>0:!!this.opts.map}isSourcesContent(){return this.mapOpts.sourcesContent===void 0?this.previous().length?this.previous().some(e=>e.withContent()):!0:this.mapOpts.sourcesContent}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):`to.css`}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let a=this.opts.to?n(this.opts.to):`.`;typeof this.mapOpts.annotation==`string`&&(a=n(i(a,this.mapOpts.annotation)));let o=r(a,e);return this.memoizedPaths.set(e,o),o}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new l(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`;this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString(`base64`):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(c){let t=c(e).toString();return this.memoizedFileURLs.set(e,t),t}else throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;a===`\\`&&(e=e.replace(/\\/g,`/`));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}})),Qv=t(((e,t)=>{var n=39,r=34,i=92,a=47,o=10,s=32,c=12,l=9,u=13,d=91,f=93,p=40,m=41,h=123,g=125,_=59,v=42,y=58,b=64,x=/[\t\n\f\r "#'()/;[\\\]{}]/g,S=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,C=/.[\r\n"'(/\\]/,w=/[\da-f]/i;t.exports=function(e,t={}){let T=e.css.valueOf(),E=t.ignoreErrors,D,O,k,A,j,M,N,P,F,I,ee=T.length,L=0,te=[],ne=[],re=-1;function ie(){return L}function ae(t){throw e.error(`Unclosed `+t,L)}function oe(){return ne.length===0&&L>=ee}function se(e){if(ne.length)return ne.pop();if(L>=ee)return;let t=e?e.ignoreUnclosed:!1;switch(D=T.charCodeAt(L),D){case o:case s:case l:case u:case c:A=L;do A+=1,D=T.charCodeAt(A);while(D===s||D===o||D===l||D===u||D===c);M=[`space`,T.slice(L,A)],L=A-1;break;case d:case f:case h:case g:case y:case _:case m:{let e=String.fromCharCode(D);M=[e,e,L];break}case p:if(I=te.length?te.pop()[1]:``,F=T.charCodeAt(L+1),I===`url`&&F!==n&&F!==r&&F!==s&&F!==o&&F!==l&&F!==c&&F!==u){A=L;do{if(N=!1,A=T.indexOf(`)`,A+1),A===-1)if(E||t){A=L;break}else ae(`bracket`);for(P=A;T.charCodeAt(P-1)===i;)--P,N=!N}while(N);M=[`brackets`,T.slice(L,A+1),L,A],L=A}else L<=re?M=[`(`,`(`,L]:(A=T.indexOf(`)`,L+1),O=T.slice(L,A+1),A===-1||C.test(O)?(re=A===-1?ee:A,M=[`(`,`(`,L]):(M=[`brackets`,O,L,A],L=A));break;case n:case r:j=D===n?`'`:`"`,A=L;do{if(N=!1,A=T.indexOf(j,A+1),A===-1)if(E||t){A=L+1;break}else ae(`string`);for(P=A;T.charCodeAt(P-1)===i;)--P,N=!N}while(N);M=[`string`,T.slice(L,A+1),L,A],L=A;break;case b:x.lastIndex=L+1,x.test(T),A=x.lastIndex===0?T.length-1:x.lastIndex-2,M=[`at-word`,T.slice(L,A+1),L,A],L=A;break;case i:for(A=L,k=!0;T.charCodeAt(A+1)===i;)A+=1,k=!k;if(D=T.charCodeAt(A+1),k&&D!==a&&D!==s&&D!==o&&D!==l&&D!==u&&D!==c&&(A+=1,w.test(T.charAt(A)))){for(;w.test(T.charAt(A+1));)A+=1;T.charCodeAt(A+1)===s&&(A+=1)}M=[`word`,T.slice(L,A+1),L,A],L=A;break;default:D===a&&T.charCodeAt(L+1)===v?(A=T.indexOf(`*/`,L+2)+1,A===0&&(E||t?A=T.length:ae(`comment`)),M=[`comment`,T.slice(L,A+1),L,A],L=A):(S.lastIndex=L+1,S.test(T),A=S.lastIndex===0?T.length-1:S.lastIndex-2,M=[`word`,T.slice(L,A+1),L,A],te.push(M),L=A);break}return L++,M}function ce(e){ne.push(e)}return{back:ce,endOfFile:oe,nextToken:se,position:ie}}})),$v=t(((e,t)=>{var n=Hv(),r=zv(),i=Bv(),a=qv(),o=Yv(),s=Qv(),c={empty:!0,space:!0};function l(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}function u(e,t,n){let r=``;for(let i=t;i<n;i++)r+=e[i][1];return r}t.exports=class{constructor(e){this.input=e,this.root=new a,this.current=this.root,this.spaces=``,this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new n;t.name=e[1].slice(1),t.name===``&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,a,o=!1,s=!1,c=[],l=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r===`(`||r===`[`?l.push(r===`(`?`)`:`]`):r===`{`&&l.length>0?l.push(`}`):r===l[l.length-1]&&l.pop(),l.length===0)if(r===`;`){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r===`{`){s=!0;break}else if(r===`}`){if(c.length>0){for(a=c.length-1,i=c[a];i&&i[0]===`space`;)i=c[--a];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else c.push(e);else c.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(t.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(t,`params`,c),o&&(e=c[c.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between=``)):(t.raws.afterName=``,t.params=``),s&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let n=0,r;for(let i=t-1;i>=0&&(r=e[i],!(r[0]!==`space`&&(n+=1,n===2)));i--);throw this.input.error(`Missed semicolon`,r[0]===`word`?r[3]+1:r[2])}colon(e){let t=0,n,r,i;for(let[a,o]of e.entries()){if(r=o,i=r[0],i===`(`&&(t+=1),i===`)`&&--t,t===0&&i===`:`)if(!n)this.doubleColon(r);else if(n[0]===`word`&&n[1]===`progid`)continue;else return a;n=r}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(!n.trim())t.text=``,t.raws.left=n,t.raws.right=``;else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=s(this.input)}decl(e,t){let n=new i;this.init(n,e[0][2]);let r=e[e.length-1];r[0]===`;`&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(r[3]||r[2]||l(e)),n.source.end.offset++;let a=0;for(;e[a][0]!==`word`;)a===e.length-1&&this.unknownWord([e[a]]),a++;n.raws.before+=u(e,0,a),n.source.start=this.getPosition(e[a][2]);let o=a;for(;a<e.length;){let t=e[a][0];if(t===`:`||t===`space`||t===`comment`)break;a++}n.prop=u(e,o,a);let s=a,c;for(;a<e.length&&(c=e[a],a++,c[0]!==`:`);)c[0]===`word`&&/\w/.test(c[1])&&this.unknownWord([c]);n.raws.between=u(e,s,a),(n.prop[0]===`_`||n.prop[0]===`*`)&&(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let d=a;for(;a<e.length;){let t=e[a][0];if(t!==`space`&&t!==`comment`)break;a++}let f=e.slice(d,a);e=e.slice(a),this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(c=e[t],c[1].toLowerCase()===`!important`){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r,r!==` !important`&&(n.raws.important=r);break}else if(c[1].toLowerCase()===`important`){let r=e.slice(0),i=``;for(let e=t;e>0;e--){let t=r[e][0];if(i.trim().startsWith(`!`)&&t!==`space`)break;i=r.pop()[1]+i}i.trim().startsWith(`!`)&&(n.important=!0,n.raws.important=i,e=r)}if(c[0]!==`space`&&c[0]!==`comment`)break}e.some(e=>e[0]!==`space`&&e[0]!==`comment`)&&(n.raws.between+=f.map(e=>e[1]).join(``),f=[]),this.raw(n,`value`,f.concat(e),t),n.value.includes(`:`)&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error(`Double colon`,{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;this.init(t,e[2]),t.selector=``,t.raws.between=``,this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.spaces=``,this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type===`rule`&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces=``,t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces=``,e.type!==`comment`&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,a=[],o=e[1].startsWith(`--`),s=[],c=e;for(;c;){if(n=c[0],s.push(c),n===`(`||n===`[`)i||=c,a.push(n===`(`?`)`:`]`);else if(o&&r&&n===`{`)i||=c,a.push(`}`);else if(a.length===0)if(n===`;`)if(r){this.decl(s,o);return}else break;else if(n===`{`){this.rule(s);return}else if(n===`}`){this.tokenizer.back(s.pop()),t=!0;break}else n===`:`&&(r=!0);else n===a[a.length-1]&&(a.pop(),a.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),a.length>0&&this.unclosedBracket(i),t&&r){if(!o)for(;s.length&&(c=s[s.length-1][0],!(c!==`space`&&c!==`comment`));)this.tokenizer.back(s.pop());this.decl(s,o)}else this.unknownWord(s)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case`space`:this.spaces+=e[1];break;case`;`:this.freeSemicolon(e);break;case`}`:this.end(e);break;case`comment`:this.comment(e);break;case`at-word`:this.atrule(e);break;case`{`:this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,a,o=n.length,s=``,l=!0,u,d;for(let e=0;e<o;e+=1)i=n[e],a=i[0],a===`space`&&e===o-1&&!r?l=!1:a===`comment`?(d=n[e-1]?n[e-1][0]:`empty`,u=n[e+1]?n[e+1][0]:`empty`,!c[d]&&!c[u]?s.slice(-1)===`,`?l=!1:s+=i[1]:l=!1):s+=i[1];if(!l){let r=n.reduce((e,t)=>e+t[1],``);e.raws[t]={raw:r,value:s}}e[t]=s}rule(e){e.pop();let t=new o;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,`selector`,e),this.current=t}spacesAndCommentsFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],!(t!==`space`&&t!==`comment`));)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n=``;for(;e.length&&(t=e[0][0],!(t!==`space`&&t!==`comment`));)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],t===`space`);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n=``;for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error(`Unclosed block`,e.line,e.column)}unclosedBracket(e){throw this.input.error(`Unclosed bracket`,{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error(`Unexpected }`,{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error(`Unknown word `+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error(`At-rule without name`,{offset:t[2]},{offset:t[2]+t[1].length})}}})),ey=t(((e,t)=>{var n=Vv(),r=Kv(),i=$v();function a(e,t){let n=new i(new r(e,t));try{n.parse()}catch(e){throw e}return n.root}t.exports=a,a.default=a,n.registerParse(a)})),ty=t(((e,t)=>{var n=class{constructor(e,t={}){if(this.type=`warning`,this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+`: `+this.text:this.text}};t.exports=n,n.default=n})),ny=t(((e,t)=>{var n=ty(),r=class{get content(){return this.css}constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=``,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new n(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type===`warning`)}};t.exports=r,r.default=r})),ry=t(((e,t)=>{var n={};t.exports=function(e){n[e]||(n[e]=!0,typeof console<`u`&&console.warn&&console.warn(e))}})),iy=t(((e,t)=>{var n=Vv(),r=Uv(),i=Zv(),a=ey(),o=ny(),s=qv(),c=Iv(),{isClean:l,my:u}=Lv();ry();var d={atrule:`AtRule`,comment:`Comment`,decl:`Declaration`,document:`Document`,root:`Root`,rule:`Rule`},f={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},p={Once:!0,postcssPlugin:!0,prepare:!0},m=0;function h(e){return typeof e==`object`&&typeof e.then==`function`}function g(e){let t=!1,n=d[e.type];return e.type===`decl`?t=e.prop.toLowerCase():e.type===`atrule`&&(t=e.name.toLowerCase()),t&&e.append?[n,n+`-`+t,m,n+`Exit`,n+`Exit-`+t]:t?[n,n+`-`+t,n+`Exit`,n+`Exit-`+t]:e.append?[n,m,n+`Exit`]:[n,n+`Exit`]}function _(e){let t;return t=e.type===`document`?[`Document`,m,`DocumentExit`]:e.type===`root`?[`Root`,m,`RootExit`]:g(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function v(e){return e[l]=!1,e.nodes&&e.nodes.forEach(e=>v(e)),e}var y={},b=class e{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return`LazyResult`}constructor(t,r,i){this.stringified=!1,this.processed=!1;let s;if(typeof r==`object`&&r&&(r.type===`root`||r.type===`document`))s=v(r);else if(r instanceof e||r instanceof o)s=v(r.root),r.map&&(i.map===void 0&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{let e=a;i.syntax&&(e=i.syntax.parse),i.parser&&(e=i.parser),e.parse&&(e=e.parse);try{s=e(r,i)}catch(e){this.processed=!0,this.error=e}s&&!s[u]&&n.rebuild(s)}this.result=new o(t,s,i),this.helpers={...y,postcss:y,result:this.result},this.plugins=this.processor.plugins.map(e=>typeof e==`object`&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||=this.runAsync(),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw Error(`Use process(css).then(cb) to work with async plugins`)}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name===`CssSyntaxError`&&!e.plugin?(e.plugin=n.postcssPlugin,e.setMessage()):n.postcssVersion}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if(typeof t==`object`)for(let n in t){if(!f[n]&&/^[A-Z]/.test(n))throw Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[n])if(typeof t[n]==`object`)for(let r in t[n])r===`*`?e(t,n,t[n][r]):e(t,n+`-`+r.toLowerCase(),t[n][r]);else typeof t[n]==`function`&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(h(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[l];){e[l]=!0;let t=[_(e)];for(;t.length>0;){let e=this.visitTick(t);if(h(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type===`document`){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e==`object`&&e.Once){if(this.result.root.type===`document`){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return h(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e==`function`)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=c;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=this.result.root.source;if(e.map===void 0&&!(n&&n.input&&n.input.map)){let e=``;return t(this.result.root,t=>{e+=t}),this.result.css=e,this.result}let r=new i(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(h(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[l];)e[l]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type===`document`)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){this.result.lastPlugin=n;let e;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if(t.type!==`root`&&t.type!==`document`&&!t.parent)return!0;if(h(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if(n.type!==`root`&&n.type!==`document`&&!n.parent){e.pop();return}if(r.length>0&&t.visitorIndex<r.length){let[e,i]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(t.iterator!==0){let r=t.iterator,i;for(;i=n.nodes[n.indexes[r]];)if(n.indexes[r]+=1,!i[l]){i[l]=!0,e.push(_(i));return}t.iterator=0,delete n.indexes[r]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,e===m){n.nodes&&n.nodes.length&&(n[l]=!0,t.iterator=n.getIterator());return}else if(this.listeners[e]){t.visitors=this.listeners[e];return}}e.pop()}walkSync(e){e[l]=!0;let t=g(e);for(let n of t)if(n===m)e.nodes&&e.each(e=>{e[l]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}};b.registerPostcss=e=>{y=e},t.exports=b,b.default=b,s.registerLazyResult(b),r.registerLazyResult(b)})),ay=t(((e,t)=>{var n=Zv(),r=ey(),i=ny(),a=Iv();ry();var o=class{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=r;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return`NoWorkResult`}constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let o=a;this.result=new i(this._processor,void 0,this._opts),this.result.css=t;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let c=new n(o,void 0,this._opts,t);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}};t.exports=o,o.default=o})),oy=t(((e,t)=>{var n=Uv(),r=iy(),i=ay(),a=qv(),o=class{constructor(e=[]){this.version=`8.5.15`,this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n==`object`&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if(typeof n==`object`&&n.postcssPlugin)t.push(n);else if(typeof n==`function`)t.push(n);else if(!(typeof n==`object`&&(n.parse||n.stringify)))throw Error(n+` is not a PostCSS plugin`);return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new i(this,e,t):new r(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};t.exports=o,o.default=o,a.registerProcessor(o),n.registerProcessor(o)})),sy=t(((e,t)=>{var n=Hv(),r=zv(),i=Vv(),a=Pv(),o=Bv(),s=Uv(),c=Xv(),l=Kv(),u=iy(),d=Jv(),f=Rv(),p=ey(),m=oy(),h=ny(),g=qv(),_=Yv(),v=Iv(),y=ty();function b(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new m(e)}b.plugin=function(e,t){let n=!1;function r(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
158
+ `),t=o.length-i):t+=o.length,s&&c!==`start`){let i=s.parent||{raws:{}};(!(s.type===`decl`||s.type===`atrule`&&!s.nodes)||s!==i.last||i.raws.semicolon)&&(s.source&&s.source.end?(r.source=this.sourcePath(s),r.original.line=s.source.end.line,r.original.column=s.source.end.column-1,r.generated.line=e,r.generated.column=t-2,this.map.addMapping(r)):(r.source=n,r.original.line=1,r.original.column=0,r.generated.line=e,r.generated.column=t-1,this.map.addMapping(r)))}})}isAnnotation(){return this.isInline()?!0:this.mapOpts.annotation===void 0?this.previous().length?this.previous().some(e=>e.annotation):!0:this.mapOpts.annotation}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return e!==void 0&&e!==!0?!1:this.previous().length?this.previous().some(e=>e.inline):!0}isMap(){return this.opts.map===void 0?this.previous().length>0:!!this.opts.map}isSourcesContent(){return this.mapOpts.sourcesContent===void 0?this.previous().length?this.previous().some(e=>e.withContent()):!0:this.mapOpts.sourcesContent}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):`to.css`}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let a=this.opts.to?n(this.opts.to):`.`;typeof this.mapOpts.annotation==`string`&&(a=n(i(a,this.mapOpts.annotation)));let o=r(a,e);return this.memoizedPaths.set(e,o),o}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new l(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`;this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString(`base64`):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(c){let t=c(e).toString();return this.memoizedFileURLs.set(e,t),t}else throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;a===`\\`&&(e=e.replace(/\\/g,`/`));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}})),ay=t(((e,t)=>{var n=39,r=34,i=92,a=47,o=10,s=32,c=12,l=9,u=13,d=91,f=93,p=40,m=41,h=123,g=125,_=59,v=42,y=58,b=64,x=/[\t\n\f\r "#'()/;[\\\]{}]/g,S=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,C=/.[\r\n"'(/\\]/,w=/[\da-f]/i;t.exports=function(e,t={}){let T=e.css.valueOf(),E=t.ignoreErrors,D,O,k,A,j,M,N,P,F,I,ee=T.length,L=0,te=[],ne=[],re=-1;function ie(){return L}function ae(t){throw e.error(`Unclosed `+t,L)}function oe(){return ne.length===0&&L>=ee}function se(e){if(ne.length)return ne.pop();if(L>=ee)return;let t=e?e.ignoreUnclosed:!1;switch(D=T.charCodeAt(L),D){case o:case s:case l:case u:case c:A=L;do A+=1,D=T.charCodeAt(A);while(D===s||D===o||D===l||D===u||D===c);M=[`space`,T.slice(L,A)],L=A-1;break;case d:case f:case h:case g:case y:case _:case m:{let e=String.fromCharCode(D);M=[e,e,L];break}case p:if(I=te.length?te.pop()[1]:``,F=T.charCodeAt(L+1),I===`url`&&F!==n&&F!==r&&F!==s&&F!==o&&F!==l&&F!==c&&F!==u){A=L;do{if(N=!1,A=T.indexOf(`)`,A+1),A===-1)if(E||t){A=L;break}else ae(`bracket`);for(P=A;T.charCodeAt(P-1)===i;)--P,N=!N}while(N);M=[`brackets`,T.slice(L,A+1),L,A],L=A}else L<=re?M=[`(`,`(`,L]:(A=T.indexOf(`)`,L+1),O=T.slice(L,A+1),A===-1||C.test(O)?(re=A===-1?ee:A,M=[`(`,`(`,L]):(M=[`brackets`,O,L,A],L=A));break;case n:case r:j=D===n?`'`:`"`,A=L;do{if(N=!1,A=T.indexOf(j,A+1),A===-1)if(E||t){A=L+1;break}else ae(`string`);for(P=A;T.charCodeAt(P-1)===i;)--P,N=!N}while(N);M=[`string`,T.slice(L,A+1),L,A],L=A;break;case b:x.lastIndex=L+1,x.test(T),A=x.lastIndex===0?T.length-1:x.lastIndex-2,M=[`at-word`,T.slice(L,A+1),L,A],L=A;break;case i:for(A=L,k=!0;T.charCodeAt(A+1)===i;)A+=1,k=!k;if(D=T.charCodeAt(A+1),k&&D!==a&&D!==s&&D!==o&&D!==l&&D!==u&&D!==c&&(A+=1,w.test(T.charAt(A)))){for(;w.test(T.charAt(A+1));)A+=1;T.charCodeAt(A+1)===s&&(A+=1)}M=[`word`,T.slice(L,A+1),L,A],L=A;break;default:D===a&&T.charCodeAt(L+1)===v?(A=T.indexOf(`*/`,L+2)+1,A===0&&(E||t?A=T.length:ae(`comment`)),M=[`comment`,T.slice(L,A+1),L,A],L=A):(S.lastIndex=L+1,S.test(T),A=S.lastIndex===0?T.length-1:S.lastIndex-2,M=[`word`,T.slice(L,A+1),L,A],te.push(M),L=A);break}return L++,M}function ce(e){ne.push(e)}return{back:ce,endOfFile:oe,nextToken:se,position:ie}}})),oy=t(((e,t)=>{var n=Yv(),r=Kv(),i=qv(),a=ey(),o=ny(),s=ay(),c={empty:!0,space:!0};function l(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}function u(e,t,n){let r=``;for(let i=t;i<n;i++)r+=e[i][1];return r}t.exports=class{constructor(e){this.input=e,this.root=new a,this.current=this.root,this.spaces=``,this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new n;t.name=e[1].slice(1),t.name===``&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,a,o=!1,s=!1,c=[],l=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r===`(`||r===`[`?l.push(r===`(`?`)`:`]`):r===`{`&&l.length>0?l.push(`}`):r===l[l.length-1]&&l.pop(),l.length===0)if(r===`;`){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r===`{`){s=!0;break}else if(r===`}`){if(c.length>0){for(a=c.length-1,i=c[a];i&&i[0]===`space`;)i=c[--a];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else c.push(e);else c.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(t.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(t,`params`,c),o&&(e=c[c.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between=``)):(t.raws.afterName=``,t.params=``),s&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let n=0,r;for(let i=t-1;i>=0&&(r=e[i],!(r[0]!==`space`&&(n+=1,n===2)));i--);throw this.input.error(`Missed semicolon`,r[0]===`word`?r[3]+1:r[2])}colon(e){let t=0,n,r,i;for(let[a,o]of e.entries()){if(r=o,i=r[0],i===`(`&&(t+=1),i===`)`&&--t,t===0&&i===`:`)if(!n)this.doubleColon(r);else if(n[0]===`word`&&n[1]===`progid`)continue;else return a;n=r}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(!n.trim())t.text=``,t.raws.left=n,t.raws.right=``;else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=s(this.input)}decl(e,t){let n=new i;this.init(n,e[0][2]);let r=e[e.length-1];r[0]===`;`&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(r[3]||r[2]||l(e)),n.source.end.offset++;let a=0;for(;e[a][0]!==`word`;)a===e.length-1&&this.unknownWord([e[a]]),a++;n.raws.before+=u(e,0,a),n.source.start=this.getPosition(e[a][2]);let o=a;for(;a<e.length;){let t=e[a][0];if(t===`:`||t===`space`||t===`comment`)break;a++}n.prop=u(e,o,a);let s=a,c;for(;a<e.length&&(c=e[a],a++,c[0]!==`:`);)c[0]===`word`&&/\w/.test(c[1])&&this.unknownWord([c]);n.raws.between=u(e,s,a),(n.prop[0]===`_`||n.prop[0]===`*`)&&(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let d=a;for(;a<e.length;){let t=e[a][0];if(t!==`space`&&t!==`comment`)break;a++}let f=e.slice(d,a);e=e.slice(a),this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(c=e[t],c[1].toLowerCase()===`!important`){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r,r!==` !important`&&(n.raws.important=r);break}else if(c[1].toLowerCase()===`important`){let r=e.slice(0),i=``;for(let e=t;e>0;e--){let t=r[e][0];if(i.trim().startsWith(`!`)&&t!==`space`)break;i=r.pop()[1]+i}i.trim().startsWith(`!`)&&(n.important=!0,n.raws.important=i,e=r)}if(c[0]!==`space`&&c[0]!==`comment`)break}e.some(e=>e[0]!==`space`&&e[0]!==`comment`)&&(n.raws.between+=f.map(e=>e[1]).join(``),f=[]),this.raw(n,`value`,f.concat(e),t),n.value.includes(`:`)&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error(`Double colon`,{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;this.init(t,e[2]),t.selector=``,t.raws.between=``,this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.spaces=``,this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type===`rule`&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces=``,t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces=``,e.type!==`comment`&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,a=[],o=e[1].startsWith(`--`),s=[],c=e;for(;c;){if(n=c[0],s.push(c),n===`(`||n===`[`)i||=c,a.push(n===`(`?`)`:`]`);else if(o&&r&&n===`{`)i||=c,a.push(`}`);else if(a.length===0)if(n===`;`)if(r){this.decl(s,o);return}else break;else if(n===`{`){this.rule(s);return}else if(n===`}`){this.tokenizer.back(s.pop()),t=!0;break}else n===`:`&&(r=!0);else n===a[a.length-1]&&(a.pop(),a.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),a.length>0&&this.unclosedBracket(i),t&&r){if(!o)for(;s.length&&(c=s[s.length-1][0],!(c!==`space`&&c!==`comment`));)this.tokenizer.back(s.pop());this.decl(s,o)}else this.unknownWord(s)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case`space`:this.spaces+=e[1];break;case`;`:this.freeSemicolon(e);break;case`}`:this.end(e);break;case`comment`:this.comment(e);break;case`at-word`:this.atrule(e);break;case`{`:this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,a,o=n.length,s=``,l=!0,u,d;for(let e=0;e<o;e+=1)i=n[e],a=i[0],a===`space`&&e===o-1&&!r?l=!1:a===`comment`?(d=n[e-1]?n[e-1][0]:`empty`,u=n[e+1]?n[e+1][0]:`empty`,!c[d]&&!c[u]?s.slice(-1)===`,`?l=!1:s+=i[1]:l=!1):s+=i[1];if(!l){let r=n.reduce((e,t)=>e+t[1],``);e.raws[t]={raw:r,value:s}}e[t]=s}rule(e){e.pop();let t=new o;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,`selector`,e),this.current=t}spacesAndCommentsFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],!(t!==`space`&&t!==`comment`));)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n=``;for(;e.length&&(t=e[0][0],!(t!==`space`&&t!==`comment`));)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],t===`space`);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n=``;for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error(`Unclosed block`,e.line,e.column)}unclosedBracket(e){throw this.input.error(`Unclosed bracket`,{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error(`Unexpected }`,{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error(`Unknown word `+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error(`At-rule without name`,{offset:t[2]},{offset:t[2]+t[1].length})}}})),sy=t(((e,t)=>{var n=Jv(),r=$v(),i=oy();function a(e,t){let n=new i(new r(e,t));try{n.parse()}catch(e){throw e}return n.root}t.exports=a,a.default=a,n.registerParse(a)})),cy=t(((e,t)=>{var n=class{constructor(e,t={}){if(this.type=`warning`,this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+`: `+this.text:this.text}};t.exports=n,n.default=n})),ly=t(((e,t)=>{var n=cy(),r=class{get content(){return this.css}constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=``,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new n(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type===`warning`)}};t.exports=r,r.default=r})),uy=t(((e,t)=>{var n={};t.exports=function(e){n[e]||(n[e]=!0,typeof console<`u`&&console.warn&&console.warn(e))}})),dy=t(((e,t)=>{var n=Jv(),r=Xv(),i=iy(),a=sy(),o=ly(),s=ey(),c=Uv(),{isClean:l,my:u}=Wv();uy();var d={atrule:`AtRule`,comment:`Comment`,decl:`Declaration`,document:`Document`,root:`Root`,rule:`Rule`},f={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},p={Once:!0,postcssPlugin:!0,prepare:!0},m=0;function h(e){return typeof e==`object`&&typeof e.then==`function`}function g(e){let t=!1,n=d[e.type];return e.type===`decl`?t=e.prop.toLowerCase():e.type===`atrule`&&(t=e.name.toLowerCase()),t&&e.append?[n,n+`-`+t,m,n+`Exit`,n+`Exit-`+t]:t?[n,n+`-`+t,n+`Exit`,n+`Exit-`+t]:e.append?[n,m,n+`Exit`]:[n,n+`Exit`]}function _(e){let t;return t=e.type===`document`?[`Document`,m,`DocumentExit`]:e.type===`root`?[`Root`,m,`RootExit`]:g(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function v(e){return e[l]=!1,e.nodes&&e.nodes.forEach(e=>v(e)),e}var y={},b=class e{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return`LazyResult`}constructor(t,r,i){this.stringified=!1,this.processed=!1;let s;if(typeof r==`object`&&r&&(r.type===`root`||r.type===`document`))s=v(r);else if(r instanceof e||r instanceof o)s=v(r.root),r.map&&(i.map===void 0&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{let e=a;i.syntax&&(e=i.syntax.parse),i.parser&&(e=i.parser),e.parse&&(e=e.parse);try{s=e(r,i)}catch(e){this.processed=!0,this.error=e}s&&!s[u]&&n.rebuild(s)}this.result=new o(t,s,i),this.helpers={...y,postcss:y,result:this.result},this.plugins=this.processor.plugins.map(e=>typeof e==`object`&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||=this.runAsync(),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw Error(`Use process(css).then(cb) to work with async plugins`)}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name===`CssSyntaxError`&&!e.plugin?(e.plugin=n.postcssPlugin,e.setMessage()):n.postcssVersion}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if(typeof t==`object`)for(let n in t){if(!f[n]&&/^[A-Z]/.test(n))throw Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[n])if(typeof t[n]==`object`)for(let r in t[n])r===`*`?e(t,n,t[n][r]):e(t,n+`-`+r.toLowerCase(),t[n][r]);else typeof t[n]==`function`&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(h(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[l];){e[l]=!0;let t=[_(e)];for(;t.length>0;){let e=this.visitTick(t);if(h(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type===`document`){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e==`object`&&e.Once){if(this.result.root.type===`document`){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return h(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e==`function`)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=c;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=this.result.root.source;if(e.map===void 0&&!(n&&n.input&&n.input.map)){let e=``;return t(this.result.root,t=>{e+=t}),this.result.css=e,this.result}let r=new i(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(h(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[l];)e[l]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type===`document`)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){this.result.lastPlugin=n;let e;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if(t.type!==`root`&&t.type!==`document`&&!t.parent)return!0;if(h(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if(n.type!==`root`&&n.type!==`document`&&!n.parent){e.pop();return}if(r.length>0&&t.visitorIndex<r.length){let[e,i]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(t.iterator!==0){let r=t.iterator,i;for(;i=n.nodes[n.indexes[r]];)if(n.indexes[r]+=1,!i[l]){i[l]=!0,e.push(_(i));return}t.iterator=0,delete n.indexes[r]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,e===m){n.nodes&&n.nodes.length&&(n[l]=!0,t.iterator=n.getIterator());return}else if(this.listeners[e]){t.visitors=this.listeners[e];return}}e.pop()}walkSync(e){e[l]=!0;let t=g(e);for(let n of t)if(n===m)e.nodes&&e.each(e=>{e[l]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}};b.registerPostcss=e=>{y=e},t.exports=b,b.default=b,s.registerLazyResult(b),r.registerLazyResult(b)})),fy=t(((e,t)=>{var n=iy(),r=sy(),i=ly(),a=Uv();uy();var o=class{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=r;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return`NoWorkResult`}constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let o=a;this.result=new i(this._processor,void 0,this._opts),this.result.css=t;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let c=new n(o,void 0,this._opts,t);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}};t.exports=o,o.default=o})),py=t(((e,t)=>{var n=Xv(),r=dy(),i=fy(),a=ey(),o=class{constructor(e=[]){this.version=`8.5.15`,this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n==`object`&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if(typeof n==`object`&&n.postcssPlugin)t.push(n);else if(typeof n==`function`)t.push(n);else if(!(typeof n==`object`&&(n.parse||n.stringify)))throw Error(n+` is not a PostCSS plugin`);return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new i(this,e,t):new r(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};t.exports=o,o.default=o,a.registerProcessor(o),n.registerProcessor(o)})),my=t(((e,t)=>{var n=Yv(),r=Kv(),i=Jv(),a=Vv(),o=qv(),s=Xv(),c=ry(),l=$v(),u=dy(),d=ty(),f=Gv(),p=sy(),m=py(),h=ly(),g=ey(),_=ny(),v=Uv(),y=cy();function b(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new m(e)}b.plugin=function(e,t){let n=!1;function r(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
159
159
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),{}.LANG&&{}.LANG.startsWith(`cn`)&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
160
- https://www.w3ctech.com/topic/2226`));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=new m().version,i}let i;return Object.defineProperty(r,"postcss",{get(){return i||=r(),i}}),r.process=function(e,t,n){return b([r(n)]).process(e,t)},r},b.stringify=v,b.parse=p,b.fromJSON=c,b.list=d,b.comment=e=>new r(e),b.atRule=e=>new n(e),b.decl=e=>new o(e),b.rule=e=>new _(e),b.root=e=>new g(e),b.document=e=>new s(e),b.CssSyntaxError=a,b.Declaration=o,b.Container=i,b.Processor=m,b.Document=s,b.Comment=r,b.Warning=y,b.AtRule=n,b.Result=h,b.Input=l,b.Rule=_,b.Root=g,b.Node=f,u.registerPostcss(b),t.exports=b,b.default=b})),cy=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),ly=t(((e,t)=>{var n=cy();function r(e){for(e=e.replace(/[\x00-\x20]+/g,``);;){let t=e.indexOf(`<!--`);if(t===-1)break;let n=e.indexOf(`-->`,t+4);if(n===-1)break;e=e.substring(0,t)+e.substring(n+3)}return e}function i(e,t){t||={};let n=t.allowedSchemes||[`http`,`https`,`ftp`,`mailto`,`tel`,`sms`],i=t.allowProtocolRelative!==!1;if(typeof e!=`string`)return!1;e=r(e);let a=e.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!a)return e.match(/^[/\\]{2}/)?!i:!1;let o=a[1].toLowerCase();return n.indexOf(o)===-1}t.exports=function(e){let t={};return t.options=e||{},t.filterTag=t.options.filterTag||function(e){return e=e.trim(),e.toLowerCase()},t.string=function(e,t){return typeof e!=`string`&&(typeof e==`number`||typeof e==`boolean`?e+=``:e=``),e=e.trim(),t!==void 0&&e===``&&(e=t),e},t.strings=function(e){return Array.isArray(e)?e.map(function(e){return t.string(e)}):[]},t.integer=function(e,t,n,r){if(t===void 0&&(t=0),typeof e==`number`)e=Math.floor(e);else try{e=parseInt(e,10),isNaN(e)&&(e=t)}catch{e=t}return typeof n==`number`&&e<n&&(e=n),typeof r==`number`&&e>r&&(e=r),e},t.padInteger=function(e,t){let n=e+``;for(;n.length<t;)n=`0`+n;return n},t.float=function(e,t,n,r){if(t===void 0&&(t=0),typeof e!=`number`)try{e=parseFloat(e,10),isNaN(e)&&(e=t)}catch{e=t}return typeof n==`number`&&e<n&&(e=n),typeof r==`number`&&e>r&&(e=r),e},t.naughtyHref=i,t.url=function(e,n,a){if(e=t.string(e,n),e===n)return e;if(e=r(e),i(e)||(e=o(e),e===null))return n;return e;function o(e){return e.match(/^(((https?|ftp):\/\/)|((mailto|tel|sms):)|#|([^/.]+)?\/|[^/.]+$)/)?e:e.match(/^[^/.]+\.[^/.]+/)?(a?`https://`:`http://`)+e:null}},t.select=function(e,n,r){if(e=t.string(e),!n||!n.length)return r;let i;return typeof n[0]==`object`?(i=n.find(function(t){return t.value===null||t.value===void 0?!1:t.value.toString()===e}),i==null?r:i.value):(i=n.find(function(t){return t==null?!1:t.toString()===e}),i===void 0?r:i)},t.boolean=function(e,n){return e===!0?!0:e===!1?!1:(e=t.string(e,n),e===n?e===void 0?!1:e:(e=e.toLowerCase().charAt(0),e===``||e===`n`||e===`0`||e===`f`?!1:e===`t`||e===`y`||e===`1`))},t.addBooleanFilterToCriteria=function(e,n,r,i){i===void 0&&(i=null);let a=typeof e==`object`&&e?e[n]:e;a=a===void 0?i:a,a=t.booleanOrNull(a),a===null||(a?r[n]=!0:r[n]={$ne:!0})},t.booleanOrNull=function(e,n){return e===!0||e===!1||e===null?e:(e=t.string(e,n),e===n?n===void 0?null:e:e===`null`?null:(e=e.toLowerCase().charAt(0),e===``||e===`n`||e===`0`||e===`f`?!1:e===`t`||e===`y`||e===`1`?!0:e===`a`?null:n))},t.date=function(e,r,i){let a;function o(){return r===void 0&&(r=n().format(`YYYY-MM-DD`)),r}if(typeof e==`string`){if(e.match(/\//)){if(a=e.split(`/`),a.length===2)return(i||new Date).getFullYear()+`-`+t.padInteger(a[0],2)+`-`+t.padInteger(a[1],2);if(a.length===3){if(a[2]<100){let e=i||new Date,t=e.getFullYear()%100,n=e.getFullYear()-t,r=parseInt(a[2])+n;r-e.getFullYear()>50&&(r-=100),a[2]=r}return t.padInteger(a[2],4)+`-`+t.padInteger(a[0],2)+`-`+t.padInteger(a[1],2)}else return o()}else if(e.match(/-/))return a=e.split(`-`),a.length===2?(i||new Date).getFullYear()+`-`+t.padInteger(a[0],2)+`-`+t.padInteger(a[1],2):a.length===3?t.padInteger(a[0],4)+`-`+t.padInteger(a[1],2)+`-`+t.padInteger(a[2],2):o()}try{return e===null||(e=i||new Date(e),isNaN(e.getTime()))?o():e.getFullYear()+`-`+t.padInteger(e.getMonth()+1,2)+`-`+t.padInteger(e.getDate(),2)}catch{return o()}},t.formatDate=function(e){return n(e).format(`YYYY-MM-DD`)},t.time=function(e,r){e=t.string(e).toLowerCase(),e=e.trim();let i=e.match(/^(\d+)([:|.](\d+))?([:|.](\d+))?\s*(am|pm|AM|PM|a|p|A|M)?$/);if(i){let e=parseInt(i[1],10),n=i[3]===void 0?0:parseInt(i[3],10),r=i[5]===void 0?0:parseInt(i[5],10),a=i[6]?i[6].toLowerCase():i[6];return a&&=a.charAt(0),e===12&&a===`a`?e-=12:e===12&&a===`p`||a===`p`&&(e+=12),(e===24||e===`24`)&&(e=0),t.padInteger(e,2)+`:`+t.padInteger(n,2)+`:`+t.padInteger(r,2)}else return r===void 0?n().format(`HH:mm`):r},t.formatTime=function(e){return n(e).format(`HH:mm:ss`)},t.tags=function(e,n){return typeof e==`string`&&(e=e.split(/,\s*/)),Array.isArray(e)?e.map(e=>t.string(e)).map(n||t.filterTag).filter(e=>e.length>0):[]},t.idRegExp=t.options.idRegExp||/^[A-Za-z0-9_]+$/,t.id=function(e,n){let r=t.string(e,n);return r===n||r.match(t.idRegExp)?r:n},t.ids=function(e){return Array.isArray(e)?e.filter(function(e){return t.id(e)!==void 0}):[]},t},t.exports.naughtyHref=i})),uy=t(((e,t)=>{var n=Dv(),r=Ov(),{isPlainObject:i}=kv(),a=Av(),o=jv(),{parse:s}=sy(),{naughtyHref:c}=ly(),l=[`img`,`audio`,`video`,`picture`,`svg`,`object`,`map`,`iframe`,`embed`],u=[`script`,`style`];function d(e,t){e&&Object.keys(e).forEach(function(n){t(e[n],n)})}function f(e,t){return{}.hasOwnProperty.call(e,t)}function p(e,t){let n=[];return d(e,function(e){t(e)&&n.push(e)}),n}function m(e){for(let t in e)if(f(e,t))return!1;return!0}function h(e){return e.map(function(e){if(!e.url)throw Error(`URL missing`);return e.url+(e.w?` ${e.w}w`:``)+(e.h?` ${e.h}h`:``)+(e.d?` ${e.d}x`:``)}).join(`, `)}t.exports=_;var g=/^[^\0\t\n\f\r /<=>]+$/;function _(e,t,y){if(e==null)return``;typeof e==`number`&&(e=e.toString());let b=``,x=``;function S(e,t){let n=this;this.tag=e,this.attribs=t||{},this.tagPosition=b.length,this.text=``,this.openingTagLength=0,this.mediaChildren=[],this.updateParentNodeText=function(){if(N.length){let e=N[N.length-1];e.text+=n.text}},this.updateParentNodeMediaChildren=function(){N.length&&l.includes(this.tag)&&N[N.length-1].mediaChildren.push(this.tag)}}t=Object.assign({},_.defaults,t),t.parser=Object.assign({},v,t.parser);let C=function(e){return t.allowedTags===!1||(t.allowedTags||[]).indexOf(e)>-1};u.forEach(function(e){C(e)&&!t.allowVulnerableTags&&console.warn(`\n\n⚠️ Your \`allowedTags\` option includes, \`${e}\`, which is inherently\nvulnerable to XSS attacks. Please remove it from \`allowedTags\`.\nOr, to disable this warning, add the \`allowVulnerableTags\` option\nand ensure you are accounting for this risk.\n\n`)});let w=t.nonTextTags||[`script`,`style`,`textarea`,`option`,`xmp`],T,E;t.allowedAttributes&&(T={},E={},d(t.allowedAttributes,function(e,t){T[t]=[];let n=[];e.forEach(function(e){typeof e==`string`&&e.indexOf(`*`)>=0?n.push(r(e).replace(/\\\*/g,`.*`)):T[t].push(e)}),n.length&&(E[t]=RegExp(`^(`+n.join(`|`)+`)$`))}));let D={},O={},k={};d(t.allowedClasses,function(e,t){if(T&&(f(T,t)||(T[t]=[]),T[t].push(`class`)),D[t]=e,Array.isArray(e)){let n=[];D[t]=[],k[t]=[],e.forEach(function(e){typeof e==`string`&&e.indexOf(`*`)>=0?n.push(r(e).replace(/\\\*/g,`.*`)):e instanceof RegExp?k[t].push(e):D[t].push(e)}),n.length&&(O[t]=RegExp(`^(`+n.join(`|`)+`)$`))}});let A={},j;d(t.transformTags,function(e,t){let n;typeof e==`function`?n=e:typeof e==`string`&&(n=_.simpleTransform(e)),t===`*`?j=n:A[t]=n});let M,N,P,F,I,ee,L=!1;ne();let te=new n.Parser({onopentag:function(e,n){if(t.onOpenTag&&t.onOpenTag(e,n),t.enforceHtmlBoundary&&e===`html`&&ne(),I){ee++;return}let r=new S(e,n);N.push(r);let c=!1,l=!!r.text,u;if(f(A,e)&&(u=A[e](e,n),r.attribs=n=u.attribs,u.text!==void 0&&(r.innerText=u.text),e!==u.tagName&&(r.name=e=u.tagName,F[M]=u.tagName)),j&&(u=j(e,n),r.attribs=n=u.attribs,e!==u.tagName&&(r.name=e=u.tagName,F[M]=u.tagName)),(!C(e)||t.disallowedTagsMode===`recursiveEscape`&&!m(P)||t.nestingLimit!=null&&M>=t.nestingLimit)&&(c=!0,P[M]=!0,(t.disallowedTagsMode===`discard`||t.disallowedTagsMode===`completelyDiscard`)&&w.indexOf(e)!==-1&&(I=!0,ee=1)),M++,c){if(t.disallowedTagsMode===`discard`||t.disallowedTagsMode===`completelyDiscard`){if(r.innerText&&!l){let n=re(r.innerText);t.textFilter?b+=t.textFilter(n,e):b+=n,L=!0}return}x=b,b=``}b+=`<`+e,e===`script`&&(t.allowedScriptHostnames||t.allowedScriptDomains)&&(r.innerText=``),c&&(t.disallowedTagsMode===`escape`||t.disallowedTagsMode===`recursiveEscape`)&&t.preserveEscapedAttributes?d(n,function(e,t){b+=` `+t+`="`+re(e||``,!0)+`"`}):(!T||f(T,e)||T[`*`])&&d(n,function(n,c){if(!g.test(c)){delete r.attribs[c];return}if(n===``&&!t.allowedEmptyAttributes.includes(c)&&(t.nonBooleanAttributes.includes(c)||t.nonBooleanAttributes.includes(`*`))){delete r.attribs[c];return}let l=!1;if(!T||f(T,e)&&T[e].indexOf(c)!==-1||T[`*`]&&T[`*`].indexOf(c)!==-1||f(E,e)&&E[e].test(c)||E[`*`]&&E[`*`].test(c))l=!0;else if(T&&T[e]){for(let t of T[e])if(i(t)&&t.name&&t.name===c){l=!0;let e=``;if(t.multiple===!0){let r=n.split(` `);for(let n of r)t.values.indexOf(n)!==-1&&(e===``?e=n:e+=` `+n)}else t.values.indexOf(n)>=0&&(e=n);n=e}}if(l){if(t.allowedSchemesAppliedToAttributes.indexOf(c)!==-1&&ie(e,n)){delete r.attribs[c];return}if(e===`script`&&c===`src`){let e=!0;try{let r=ae(n);if(t.allowedScriptHostnames||t.allowedScriptDomains){let n=(t.allowedScriptHostnames||[]).find(function(e){return e===r.url.hostname}),i=(t.allowedScriptDomains||[]).find(function(e){return r.url.hostname===e||r.url.hostname.endsWith(`.${e}`)});e=n||i}}catch{e=!1}if(!e){delete r.attribs[c];return}}if(e===`iframe`&&c===`src`){let e=!0;try{let r=ae(n);if(r.isRelativeUrl)e=f(t,`allowIframeRelativeUrls`)?t.allowIframeRelativeUrls:!t.allowedIframeHostnames&&!t.allowedIframeDomains;else if(t.allowedIframeHostnames||t.allowedIframeDomains){let n=(t.allowedIframeHostnames||[]).find(function(e){return e===r.url.hostname}),i=(t.allowedIframeDomains||[]).find(function(e){return r.url.hostname===e||r.url.hostname.endsWith(`.${e}`)});e=n||i}}catch{e=!1}if(!e){delete r.attribs[c];return}}if(c===`srcset`)try{let e=o(n);if(e.forEach(function(e){ie(`srcset`,e.url)&&(e.evil=!0)}),e=p(e,function(e){return!e.evil}),e.length)n=h(p(e,function(e){return!e.evil})),r.attribs[c]=n;else{delete r.attribs[c];return}}catch{delete r.attribs[c];return}if(c===`class`){let t=D[e],i=D[`*`],o=O[e],s=k[e],l=k[`*`],u=[o,O[`*`]].concat(s,l).filter(function(e){return e});if(n=t&&i?le(n,a(t,i),u):le(n,t||i,u),!n.length){delete r.attribs[c];return}}if(c===`style`){if(t.parseStyleAttributes)try{if(n=se(oe(s(e+` {`+n+`}`,{map:!1}),t.allowedStyles)),n.length===0){delete r.attribs[c];return}}catch{typeof window<`u`&&console.warn(`Failed to parse "`+e+` {`+n+`}", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547`),delete r.attribs[c];return}else if(t.allowedStyles)throw Error(`allowedStyles option cannot be used together with parseStyleAttributes: false.`)}b+=` `+c,n&&n.length?b+=`="`+re(n,!0)+`"`:t.allowedEmptyAttributes.includes(c)&&(b+=`=""`)}else delete r.attribs[c]}),t.selfClosing.indexOf(e)===-1?(b+=`>`,r.innerText&&!l&&!t.textFilter&&(b+=re(r.innerText),L=!0)):b+=` />`,c&&(b=x+re(b),x=``),r.openingTagLength=b.length-r.tagPosition},ontext:function(e){if(I)return;let n=N[N.length-1],r;if(n&&(r=n.tag,e=n.innerText===void 0?e:n.innerText),t.disallowedTagsMode===`completelyDiscard`&&!C(r))e=``;else if((t.disallowedTagsMode===`discard`||t.disallowedTagsMode===`completelyDiscard`)&&(r===`script`||r===`style`))b+=e;else if((t.disallowedTagsMode===`discard`||t.disallowedTagsMode===`completelyDiscard`)&&(r===`textarea`||r===`xmp`))b+=e;else if(!L){let n=re(e,!1);t.textFilter?b+=t.textFilter(n,r):b+=n}if(N.length){let t=N[N.length-1];t.text+=e}},onclosetag:function(e,n){if(t.onCloseTag&&t.onCloseTag(e,n),I)if(ee--,!ee)I=!1;else return;let r=N.pop();if(!r)return;if(r.tag!==e){N.push(r);return}I=t.enforceHtmlBoundary?e===`html`:!1,M--;let i=P[M];if(i){if(delete P[M],t.disallowedTagsMode===`discard`||t.disallowedTagsMode===`completelyDiscard`){r.updateParentNodeText();return}x=b,b=``}if(F[M]&&(e=F[M],delete F[M]),t.exclusiveFilter){let e=t.exclusiveFilter(r);if(e===`excludeTag`){i&&(b=x,x=``),b=b.substring(0,r.tagPosition)+b.substring(r.tagPosition+r.openingTagLength);return}else if(e){b=b.substring(0,r.tagPosition);return}}if(r.updateParentNodeMediaChildren(),r.updateParentNodeText(),t.selfClosing.indexOf(e)!==-1||n&&!C(e)&&[`escape`,`recursiveEscape`].indexOf(t.disallowedTagsMode)>=0){i&&(b=x,x=``);return}b+=`</`+e+`>`,i&&(b=x+re(b),x=``),L=!1}},t.parser);if(te.write(e),te.end(),t.disallowedTagsMode===`escape`||t.disallowedTagsMode===`recursiveEscape`){let t=te.endIndex;if(t!=null&&t>=0&&t<e.length){let n=e.substring(t);b+=re(n)}else (t==null||t<0)&&e.length>0&&b===``&&(b=re(e))}return b;function ne(){b=``,M=0,N=[],P={},F={},I=!1,ee=0}function re(e,n){return typeof e!=`string`&&(e+=``),t.parser.decodeEntities&&(e=e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),n&&(e=e.replace(/"/g,`&quot;`))),e=e.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),n&&(e=e.replace(/"/g,`&quot;`)),e}function ie(e,n){return c(n,{allowedSchemes:f(t.allowedSchemesByTag,e)?t.allowedSchemesByTag[e]:t.allowedSchemes||[],allowProtocolRelative:t.allowProtocolRelative})}function ae(e){if(e=e.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,`$1//`),e.startsWith(`relative:`))throw Error(`relative: exploit attempt`);let t=`relative://relative-site`;for(let e=0;e<100;e++)t+=`/${e}`;let n=new URL(e,t);return{isRelativeUrl:n&&n.hostname===`relative-site`&&n.protocol===`relative:`,url:n}}function oe(e,t){if(!t)return e;let n=e.nodes[0],r;return r=t[n.selector]&&t[`*`]?a(t[n.selector],t[`*`]):t[n.selector]||t[`*`],r&&(e.nodes[0].nodes=n.nodes.reduce(ce(r),[])),e}function se(e){return e.nodes[0].nodes.reduce(function(e,t){return e.push(`${t.prop}:${t.value}${t.important?` !important`:``}`),e},[]).join(`;`)}function ce(e){return function(t,n){return f(e,n.prop)&&e[n.prop].some(function(e){return e.test(n.value)})&&t.push(n),t}}function le(e,t,n){return t?(e=e.split(/\s+/),e.filter(function(e){return t.indexOf(e)!==-1||n.some(function(t){return t.test(e)})}).join(` `)):e}}var v={decodeEntities:!0};_.defaults={allowedTags:`address.article.aside.footer.header.h1.h2.h3.h4.h5.h6.hgroup.main.nav.section.blockquote.dd.div.dl.dt.figcaption.figure.hr.li.menu.ol.p.pre.ul.a.abbr.b.bdi.bdo.br.cite.code.data.dfn.em.i.kbd.mark.q.rb.rp.rt.rtc.ruby.s.samp.small.span.strong.sub.sup.time.u.var.wbr.caption.col.colgroup.table.tbody.td.tfoot.th.thead.tr`.split(`.`),nonBooleanAttributes:`abbr.accept.accept-charset.accesskey.action.allow.alt.as.autocapitalize.autocomplete.blocking.charset.cite.class.color.cols.colspan.content.contenteditable.coords.crossorigin.data.datetime.decoding.dir.dirname.download.draggable.enctype.enterkeyhint.fetchpriority.for.form.formaction.formenctype.formmethod.formtarget.headers.height.hidden.high.href.hreflang.http-equiv.id.imagesizes.imagesrcset.inputmode.integrity.is.itemid.itemprop.itemref.itemtype.kind.label.lang.list.loading.low.max.maxlength.media.method.min.minlength.name.nonce.optimum.pattern.ping.placeholder.popover.popovertarget.popovertargetaction.poster.preload.referrerpolicy.rel.rows.rowspan.sandbox.scope.shape.size.sizes.slot.span.spellcheck.src.srcdoc.srclang.srcset.start.step.style.tabindex.target.title.translate.type.usemap.value.width.wrap.onauxclick.onafterprint.onbeforematch.onbeforeprint.onbeforeunload.onbeforetoggle.onblur.oncancel.oncanplay.oncanplaythrough.onchange.onclick.onclose.oncontextlost.oncontextmenu.oncontextrestored.oncopy.oncuechange.oncut.ondblclick.ondrag.ondragend.ondragenter.ondragleave.ondragover.ondragstart.ondrop.ondurationchange.onemptied.onended.onerror.onfocus.onformdata.onhashchange.oninput.oninvalid.onkeydown.onkeypress.onkeyup.onlanguagechange.onload.onloadeddata.onloadedmetadata.onloadstart.onmessage.onmessageerror.onmousedown.onmouseenter.onmouseleave.onmousemove.onmouseout.onmouseover.onmouseup.onoffline.ononline.onpagehide.onpageshow.onpaste.onpause.onplay.onplaying.onpopstate.onprogress.onratechange.onreset.onresize.onrejectionhandled.onscroll.onscrollend.onsecuritypolicyviolation.onseeked.onseeking.onselect.onslotchange.onstalled.onstorage.onsubmit.onsuspend.ontimeupdate.ontoggle.onunhandledrejection.onunload.onvolumechange.onwaiting.onwheel`.split(`.`),disallowedTagsMode:`discard`,allowedAttributes:{a:[`href`,`name`,`target`],img:[`src`,`srcset`,`alt`,`title`,`width`,`height`,`loading`]},allowedEmptyAttributes:[`alt`],selfClosing:[`img`,`br`,`hr`,`area`,`base`,`basefont`,`input`,`link`,`meta`],allowedSchemes:[`http`,`https`,`ftp`,`mailto`,`tel`],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:[`href`,`src`,`cite`],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0,preserveEscapedAttributes:!1},_.simpleTransform=function(e,t,n){return n=n===void 0?!0:n,t||={},function(r,i){let a;if(n)for(a in t)i[a]=t[a];else i=t;return{tagName:e,attribs:i}}}})),dy=t(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},N={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},P={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},ee=I(`//`,`$`),L=I(`/\\*`,`\\*/`),te=I(`#`,`$`),ne=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:{scope:`number`,begin:k,relevance:0},BINARY_NUMBER_RE:k,COMMENT:I,C_BLOCK_COMMENT_MODE:L,C_LINE_COMMENT_MODE:ee,C_NUMBER_MODE:{scope:`number`,begin:O,relevance:0},C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:te,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:D,relevance:0},NUMBER_RE:D,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:P,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:{scope:`title`,begin:T,relevance:0},UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:E,relevance:0}});function re(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function ie(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ae(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=re,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function oe(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function se(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function ce(e,t){e.relevance===void 0&&(e.relevance=1)}var le=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},R=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],ue=`keyword`;function de(e,t,n=ue){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,de(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,fe(n[0],n[1])]})}}function fe(e,t){return t?Number(t):+!pe(e)}function pe(e){return R.includes(e.toLowerCase())}var me={},he=e=>{console.error(e)},ge=(e,...t)=>{console.log(`WARN: ${e}`,...t)},_e=(e,t)=>{me[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),me[`${e}/${t}`]=!0)},ve=Error();function ye(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function be(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw he(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),ve;if(typeof e.beginScope!=`object`||e.beginScope===null)throw he(`beginScope must be object`),ve;ye(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function xe(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw he(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),ve;if(typeof e.endScope!=`object`||e.endScope===null)throw he(`endScope must be object`),ve;ye(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Se(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Ce(e){Se(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),be(e),xe(e)}function we(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[ie,se,Ce,le].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[ae,oe,ce].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=de(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return z(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Te(e){return e?e.endsWithParent||Te(e.starts):!1}function z(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Te(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Ee=`11.11.1`,De=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Oe=i,ke=a,Ae=Symbol(`nomatch`),je=7,Me=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(ge(s.replace(`{}`,n[1])),ge(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||N(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(_e(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),_e(`10.7.0`,`Please use highlight(code, options) instead.
160
+ https://www.w3ctech.com/topic/2226`));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=new m().version,i}let i;return Object.defineProperty(r,"postcss",{get(){return i||=r(),i}}),r.process=function(e,t,n){return b([r(n)]).process(e,t)},r},b.stringify=v,b.parse=p,b.fromJSON=c,b.list=d,b.comment=e=>new r(e),b.atRule=e=>new n(e),b.decl=e=>new o(e),b.rule=e=>new _(e),b.root=e=>new g(e),b.document=e=>new s(e),b.CssSyntaxError=a,b.Declaration=o,b.Container=i,b.Processor=m,b.Document=s,b.Comment=r,b.Warning=y,b.AtRule=n,b.Result=h,b.Input=l,b.Rule=_,b.Root=g,b.Node=f,u.registerPostcss(b),t.exports=b,b.default=b})),hy=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),gy=t(((e,t)=>{var n=hy();function r(e){for(e=e.replace(/[\x00-\x20]+/g,``);;){let t=e.indexOf(`<!--`);if(t===-1)break;let n=e.indexOf(`-->`,t+4);if(n===-1)break;e=e.substring(0,t)+e.substring(n+3)}return e}function i(e,t){t||={};let n=t.allowedSchemes||[`http`,`https`,`ftp`,`mailto`,`tel`,`sms`],i=t.allowProtocolRelative!==!1;if(typeof e!=`string`)return!1;e=r(e);let a=e.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!a)return e.match(/^[/\\]{2}/)?!i:!1;let o=a[1].toLowerCase();return n.indexOf(o)===-1}t.exports=function(e){let t={};return t.options=e||{},t.filterTag=t.options.filterTag||function(e){return e=e.trim(),e.toLowerCase()},t.string=function(e,t){return typeof e!=`string`&&(typeof e==`number`||typeof e==`boolean`?e+=``:e=``),e=e.trim(),t!==void 0&&e===``&&(e=t),e},t.strings=function(e){return Array.isArray(e)?e.map(function(e){return t.string(e)}):[]},t.integer=function(e,t,n,r){if(t===void 0&&(t=0),typeof e==`number`)e=Math.floor(e);else try{e=parseInt(e,10),isNaN(e)&&(e=t)}catch{e=t}return typeof n==`number`&&e<n&&(e=n),typeof r==`number`&&e>r&&(e=r),e},t.padInteger=function(e,t){let n=e+``;for(;n.length<t;)n=`0`+n;return n},t.float=function(e,t,n,r){if(t===void 0&&(t=0),typeof e!=`number`)try{e=parseFloat(e,10),isNaN(e)&&(e=t)}catch{e=t}return typeof n==`number`&&e<n&&(e=n),typeof r==`number`&&e>r&&(e=r),e},t.naughtyHref=i,t.url=function(e,n,a){if(e=t.string(e,n),e===n)return e;if(e=r(e),i(e)||(e=o(e),e===null))return n;return e;function o(e){return e.match(/^(((https?|ftp):\/\/)|((mailto|tel|sms):)|#|([^/.]+)?\/|[^/.]+$)/)?e:e.match(/^[^/.]+\.[^/.]+/)?(a?`https://`:`http://`)+e:null}},t.select=function(e,n,r){if(e=t.string(e),!n||!n.length)return r;let i;return typeof n[0]==`object`?(i=n.find(function(t){return t.value===null||t.value===void 0?!1:t.value.toString()===e}),i==null?r:i.value):(i=n.find(function(t){return t==null?!1:t.toString()===e}),i===void 0?r:i)},t.boolean=function(e,n){return e===!0?!0:e===!1?!1:(e=t.string(e,n),e===n?e===void 0?!1:e:(e=e.toLowerCase().charAt(0),e===``||e===`n`||e===`0`||e===`f`?!1:e===`t`||e===`y`||e===`1`))},t.addBooleanFilterToCriteria=function(e,n,r,i){i===void 0&&(i=null);let a=typeof e==`object`&&e?e[n]:e;a=a===void 0?i:a,a=t.booleanOrNull(a),a===null||(a?r[n]=!0:r[n]={$ne:!0})},t.booleanOrNull=function(e,n){return e===!0||e===!1||e===null?e:(e=t.string(e,n),e===n?n===void 0?null:e:e===`null`?null:(e=e.toLowerCase().charAt(0),e===``||e===`n`||e===`0`||e===`f`?!1:e===`t`||e===`y`||e===`1`?!0:e===`a`?null:n))},t.date=function(e,r,i){let a;function o(){return r===void 0&&(r=n().format(`YYYY-MM-DD`)),r}if(typeof e==`string`){if(e.match(/\//)){if(a=e.split(`/`),a.length===2)return(i||new Date).getFullYear()+`-`+t.padInteger(a[0],2)+`-`+t.padInteger(a[1],2);if(a.length===3){if(a[2]<100){let e=i||new Date,t=e.getFullYear()%100,n=e.getFullYear()-t,r=parseInt(a[2])+n;r-e.getFullYear()>50&&(r-=100),a[2]=r}return t.padInteger(a[2],4)+`-`+t.padInteger(a[0],2)+`-`+t.padInteger(a[1],2)}else return o()}else if(e.match(/-/))return a=e.split(`-`),a.length===2?(i||new Date).getFullYear()+`-`+t.padInteger(a[0],2)+`-`+t.padInteger(a[1],2):a.length===3?t.padInteger(a[0],4)+`-`+t.padInteger(a[1],2)+`-`+t.padInteger(a[2],2):o()}try{return e===null||(e=i||new Date(e),isNaN(e.getTime()))?o():e.getFullYear()+`-`+t.padInteger(e.getMonth()+1,2)+`-`+t.padInteger(e.getDate(),2)}catch{return o()}},t.formatDate=function(e){return n(e).format(`YYYY-MM-DD`)},t.time=function(e,r){e=t.string(e).toLowerCase(),e=e.trim();let i=e.match(/^(\d+)([:|.](\d+))?([:|.](\d+))?\s*(am|pm|AM|PM|a|p|A|M)?$/);if(i){let e=parseInt(i[1],10),n=i[3]===void 0?0:parseInt(i[3],10),r=i[5]===void 0?0:parseInt(i[5],10),a=i[6]?i[6].toLowerCase():i[6];return a&&=a.charAt(0),e===12&&a===`a`?e-=12:e===12&&a===`p`||a===`p`&&(e+=12),(e===24||e===`24`)&&(e=0),t.padInteger(e,2)+`:`+t.padInteger(n,2)+`:`+t.padInteger(r,2)}else return r===void 0?n().format(`HH:mm`):r},t.formatTime=function(e){return n(e).format(`HH:mm:ss`)},t.tags=function(e,n){return typeof e==`string`&&(e=e.split(/,\s*/)),Array.isArray(e)?e.map(e=>t.string(e)).map(n||t.filterTag).filter(e=>e.length>0):[]},t.idRegExp=t.options.idRegExp||/^[A-Za-z0-9_]+$/,t.id=function(e,n){let r=t.string(e,n);return r===n||r.match(t.idRegExp)?r:n},t.ids=function(e){return Array.isArray(e)?e.filter(function(e){return t.id(e)!==void 0}):[]},t},t.exports.naughtyHref=i})),_y=t(((e,t)=>{var n=Pv(),r=Fv(),{isPlainObject:i}=Iv(),a=Lv(),o=Rv(),{parse:s}=my(),{naughtyHref:c}=gy(),l=[`img`,`audio`,`video`,`picture`,`svg`,`object`,`map`,`iframe`,`embed`],u=[`script`,`style`];function d(e,t){e&&Object.keys(e).forEach(function(n){t(e[n],n)})}function f(e,t){return{}.hasOwnProperty.call(e,t)}function p(e,t){let n=[];return d(e,function(e){t(e)&&n.push(e)}),n}function m(e){for(let t in e)if(f(e,t))return!1;return!0}function h(e){return e.map(function(e){if(!e.url)throw Error(`URL missing`);return e.url+(e.w?` ${e.w}w`:``)+(e.h?` ${e.h}h`:``)+(e.d?` ${e.d}x`:``)}).join(`, `)}t.exports=_;var g=/^[^\0\t\n\f\r /<=>]+$/;function _(e,t,y){if(e==null)return``;typeof e==`number`&&(e=e.toString());let b=``,x=``;function S(e,t){let n=this;this.tag=e,this.attribs=t||{},this.tagPosition=b.length,this.text=``,this.openingTagLength=0,this.mediaChildren=[],this.updateParentNodeText=function(){if(N.length){let e=N[N.length-1];e.text+=n.text}},this.updateParentNodeMediaChildren=function(){N.length&&l.includes(this.tag)&&N[N.length-1].mediaChildren.push(this.tag)}}t=Object.assign({},_.defaults,t),t.parser=Object.assign({},v,t.parser);let C=function(e){return t.allowedTags===!1||(t.allowedTags||[]).indexOf(e)>-1};u.forEach(function(e){C(e)&&!t.allowVulnerableTags&&console.warn(`\n\n⚠️ Your \`allowedTags\` option includes, \`${e}\`, which is inherently\nvulnerable to XSS attacks. Please remove it from \`allowedTags\`.\nOr, to disable this warning, add the \`allowVulnerableTags\` option\nand ensure you are accounting for this risk.\n\n`)});let w=t.nonTextTags||[`script`,`style`,`textarea`,`option`,`xmp`],T,E;t.allowedAttributes&&(T={},E={},d(t.allowedAttributes,function(e,t){T[t]=[];let n=[];e.forEach(function(e){typeof e==`string`&&e.indexOf(`*`)>=0?n.push(r(e).replace(/\\\*/g,`.*`)):T[t].push(e)}),n.length&&(E[t]=RegExp(`^(`+n.join(`|`)+`)$`))}));let D={},O={},k={};d(t.allowedClasses,function(e,t){if(T&&(f(T,t)||(T[t]=[]),T[t].push(`class`)),D[t]=e,Array.isArray(e)){let n=[];D[t]=[],k[t]=[],e.forEach(function(e){typeof e==`string`&&e.indexOf(`*`)>=0?n.push(r(e).replace(/\\\*/g,`.*`)):e instanceof RegExp?k[t].push(e):D[t].push(e)}),n.length&&(O[t]=RegExp(`^(`+n.join(`|`)+`)$`))}});let A={},j;d(t.transformTags,function(e,t){let n;typeof e==`function`?n=e:typeof e==`string`&&(n=_.simpleTransform(e)),t===`*`?j=n:A[t]=n});let M,N,P,F,I,ee,L=!1;ne();let te=new n.Parser({onopentag:function(e,n){if(t.onOpenTag&&t.onOpenTag(e,n),t.enforceHtmlBoundary&&e===`html`&&ne(),I){ee++;return}let r=new S(e,n);N.push(r);let c=!1,l=!!r.text,u;if(f(A,e)&&(u=A[e](e,n),r.attribs=n=u.attribs,u.text!==void 0&&(r.innerText=u.text),e!==u.tagName&&(r.name=e=u.tagName,F[M]=u.tagName)),j&&(u=j(e,n),r.attribs=n=u.attribs,e!==u.tagName&&(r.name=e=u.tagName,F[M]=u.tagName)),(!C(e)||t.disallowedTagsMode===`recursiveEscape`&&!m(P)||t.nestingLimit!=null&&M>=t.nestingLimit)&&(c=!0,P[M]=!0,(t.disallowedTagsMode===`discard`||t.disallowedTagsMode===`completelyDiscard`)&&w.indexOf(e)!==-1&&(I=!0,ee=1)),M++,c){if(t.disallowedTagsMode===`discard`||t.disallowedTagsMode===`completelyDiscard`){if(r.innerText&&!l){let n=re(r.innerText);t.textFilter?b+=t.textFilter(n,e):b+=n,L=!0}return}x=b,b=``}b+=`<`+e,e===`script`&&(t.allowedScriptHostnames||t.allowedScriptDomains)&&(r.innerText=``),c&&(t.disallowedTagsMode===`escape`||t.disallowedTagsMode===`recursiveEscape`)&&t.preserveEscapedAttributes?d(n,function(e,t){b+=` `+t+`="`+re(e||``,!0)+`"`}):(!T||f(T,e)||T[`*`])&&d(n,function(n,c){if(!g.test(c)){delete r.attribs[c];return}if(n===``&&!t.allowedEmptyAttributes.includes(c)&&(t.nonBooleanAttributes.includes(c)||t.nonBooleanAttributes.includes(`*`))){delete r.attribs[c];return}let l=!1;if(!T||f(T,e)&&T[e].indexOf(c)!==-1||T[`*`]&&T[`*`].indexOf(c)!==-1||f(E,e)&&E[e].test(c)||E[`*`]&&E[`*`].test(c))l=!0;else if(T&&T[e]){for(let t of T[e])if(i(t)&&t.name&&t.name===c){l=!0;let e=``;if(t.multiple===!0){let r=n.split(` `);for(let n of r)t.values.indexOf(n)!==-1&&(e===``?e=n:e+=` `+n)}else t.values.indexOf(n)>=0&&(e=n);n=e}}if(l){if(t.allowedSchemesAppliedToAttributes.indexOf(c)!==-1&&ie(e,n)){delete r.attribs[c];return}if(e===`script`&&c===`src`){let e=!0;try{let r=ae(n);if(t.allowedScriptHostnames||t.allowedScriptDomains){let n=(t.allowedScriptHostnames||[]).find(function(e){return e===r.url.hostname}),i=(t.allowedScriptDomains||[]).find(function(e){return r.url.hostname===e||r.url.hostname.endsWith(`.${e}`)});e=n||i}}catch{e=!1}if(!e){delete r.attribs[c];return}}if(e===`iframe`&&c===`src`){let e=!0;try{let r=ae(n);if(r.isRelativeUrl)e=f(t,`allowIframeRelativeUrls`)?t.allowIframeRelativeUrls:!t.allowedIframeHostnames&&!t.allowedIframeDomains;else if(t.allowedIframeHostnames||t.allowedIframeDomains){let n=(t.allowedIframeHostnames||[]).find(function(e){return e===r.url.hostname}),i=(t.allowedIframeDomains||[]).find(function(e){return r.url.hostname===e||r.url.hostname.endsWith(`.${e}`)});e=n||i}}catch{e=!1}if(!e){delete r.attribs[c];return}}if(c===`srcset`)try{let e=o(n);if(e.forEach(function(e){ie(`srcset`,e.url)&&(e.evil=!0)}),e=p(e,function(e){return!e.evil}),e.length)n=h(p(e,function(e){return!e.evil})),r.attribs[c]=n;else{delete r.attribs[c];return}}catch{delete r.attribs[c];return}if(c===`class`){let t=D[e],i=D[`*`],o=O[e],s=k[e],l=k[`*`],u=[o,O[`*`]].concat(s,l).filter(function(e){return e});if(n=t&&i?le(n,a(t,i),u):le(n,t||i,u),!n.length){delete r.attribs[c];return}}if(c===`style`){if(t.parseStyleAttributes)try{if(n=se(oe(s(e+` {`+n+`}`,{map:!1}),t.allowedStyles)),n.length===0){delete r.attribs[c];return}}catch{typeof window<`u`&&console.warn(`Failed to parse "`+e+` {`+n+`}", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547`),delete r.attribs[c];return}else if(t.allowedStyles)throw Error(`allowedStyles option cannot be used together with parseStyleAttributes: false.`)}b+=` `+c,n&&n.length?b+=`="`+re(n,!0)+`"`:t.allowedEmptyAttributes.includes(c)&&(b+=`=""`)}else delete r.attribs[c]}),t.selfClosing.indexOf(e)===-1?(b+=`>`,r.innerText&&!l&&!t.textFilter&&(b+=re(r.innerText),L=!0)):b+=` />`,c&&(b=x+re(b),x=``),r.openingTagLength=b.length-r.tagPosition},ontext:function(e){if(I)return;let n=N[N.length-1],r;if(n&&(r=n.tag,e=n.innerText===void 0?e:n.innerText),t.disallowedTagsMode===`completelyDiscard`&&!C(r))e=``;else if((t.disallowedTagsMode===`discard`||t.disallowedTagsMode===`completelyDiscard`)&&(r===`script`||r===`style`))b+=e;else if((t.disallowedTagsMode===`discard`||t.disallowedTagsMode===`completelyDiscard`)&&(r===`textarea`||r===`xmp`))b+=e;else if(!L){let n=re(e,!1);t.textFilter?b+=t.textFilter(n,r):b+=n}if(N.length){let t=N[N.length-1];t.text+=e}},onclosetag:function(e,n){if(t.onCloseTag&&t.onCloseTag(e,n),I)if(ee--,!ee)I=!1;else return;let r=N.pop();if(!r)return;if(r.tag!==e){N.push(r);return}I=t.enforceHtmlBoundary?e===`html`:!1,M--;let i=P[M];if(i){if(delete P[M],t.disallowedTagsMode===`discard`||t.disallowedTagsMode===`completelyDiscard`){r.updateParentNodeText();return}x=b,b=``}if(F[M]&&(e=F[M],delete F[M]),t.exclusiveFilter){let e=t.exclusiveFilter(r);if(e===`excludeTag`){i&&(b=x,x=``),b=b.substring(0,r.tagPosition)+b.substring(r.tagPosition+r.openingTagLength);return}else if(e){b=b.substring(0,r.tagPosition);return}}if(r.updateParentNodeMediaChildren(),r.updateParentNodeText(),t.selfClosing.indexOf(e)!==-1||n&&!C(e)&&[`escape`,`recursiveEscape`].indexOf(t.disallowedTagsMode)>=0){i&&(b=x,x=``);return}b+=`</`+e+`>`,i&&(b=x+re(b),x=``),L=!1}},t.parser);if(te.write(e),te.end(),t.disallowedTagsMode===`escape`||t.disallowedTagsMode===`recursiveEscape`){let t=te.endIndex;if(t!=null&&t>=0&&t<e.length){let n=e.substring(t);b+=re(n)}else (t==null||t<0)&&e.length>0&&b===``&&(b=re(e))}return b;function ne(){b=``,M=0,N=[],P={},F={},I=!1,ee=0}function re(e,n){return typeof e!=`string`&&(e+=``),t.parser.decodeEntities&&(e=e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),n&&(e=e.replace(/"/g,`&quot;`))),e=e.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),n&&(e=e.replace(/"/g,`&quot;`)),e}function ie(e,n){return c(n,{allowedSchemes:f(t.allowedSchemesByTag,e)?t.allowedSchemesByTag[e]:t.allowedSchemes||[],allowProtocolRelative:t.allowProtocolRelative})}function ae(e){if(e=e.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,`$1//`),e.startsWith(`relative:`))throw Error(`relative: exploit attempt`);let t=`relative://relative-site`;for(let e=0;e<100;e++)t+=`/${e}`;let n=new URL(e,t);return{isRelativeUrl:n&&n.hostname===`relative-site`&&n.protocol===`relative:`,url:n}}function oe(e,t){if(!t)return e;let n=e.nodes[0],r;return r=t[n.selector]&&t[`*`]?a(t[n.selector],t[`*`]):t[n.selector]||t[`*`],r&&(e.nodes[0].nodes=n.nodes.reduce(ce(r),[])),e}function se(e){return e.nodes[0].nodes.reduce(function(e,t){return e.push(`${t.prop}:${t.value}${t.important?` !important`:``}`),e},[]).join(`;`)}function ce(e){return function(t,n){return f(e,n.prop)&&e[n.prop].some(function(e){return e.test(n.value)})&&t.push(n),t}}function le(e,t,n){return t?(e=e.split(/\s+/),e.filter(function(e){return t.indexOf(e)!==-1||n.some(function(t){return t.test(e)})}).join(` `)):e}}var v={decodeEntities:!0};_.defaults={allowedTags:`address.article.aside.footer.header.h1.h2.h3.h4.h5.h6.hgroup.main.nav.section.blockquote.dd.div.dl.dt.figcaption.figure.hr.li.menu.ol.p.pre.ul.a.abbr.b.bdi.bdo.br.cite.code.data.dfn.em.i.kbd.mark.q.rb.rp.rt.rtc.ruby.s.samp.small.span.strong.sub.sup.time.u.var.wbr.caption.col.colgroup.table.tbody.td.tfoot.th.thead.tr`.split(`.`),nonBooleanAttributes:`abbr.accept.accept-charset.accesskey.action.allow.alt.as.autocapitalize.autocomplete.blocking.charset.cite.class.color.cols.colspan.content.contenteditable.coords.crossorigin.data.datetime.decoding.dir.dirname.download.draggable.enctype.enterkeyhint.fetchpriority.for.form.formaction.formenctype.formmethod.formtarget.headers.height.hidden.high.href.hreflang.http-equiv.id.imagesizes.imagesrcset.inputmode.integrity.is.itemid.itemprop.itemref.itemtype.kind.label.lang.list.loading.low.max.maxlength.media.method.min.minlength.name.nonce.optimum.pattern.ping.placeholder.popover.popovertarget.popovertargetaction.poster.preload.referrerpolicy.rel.rows.rowspan.sandbox.scope.shape.size.sizes.slot.span.spellcheck.src.srcdoc.srclang.srcset.start.step.style.tabindex.target.title.translate.type.usemap.value.width.wrap.onauxclick.onafterprint.onbeforematch.onbeforeprint.onbeforeunload.onbeforetoggle.onblur.oncancel.oncanplay.oncanplaythrough.onchange.onclick.onclose.oncontextlost.oncontextmenu.oncontextrestored.oncopy.oncuechange.oncut.ondblclick.ondrag.ondragend.ondragenter.ondragleave.ondragover.ondragstart.ondrop.ondurationchange.onemptied.onended.onerror.onfocus.onformdata.onhashchange.oninput.oninvalid.onkeydown.onkeypress.onkeyup.onlanguagechange.onload.onloadeddata.onloadedmetadata.onloadstart.onmessage.onmessageerror.onmousedown.onmouseenter.onmouseleave.onmousemove.onmouseout.onmouseover.onmouseup.onoffline.ononline.onpagehide.onpageshow.onpaste.onpause.onplay.onplaying.onpopstate.onprogress.onratechange.onreset.onresize.onrejectionhandled.onscroll.onscrollend.onsecuritypolicyviolation.onseeked.onseeking.onselect.onslotchange.onstalled.onstorage.onsubmit.onsuspend.ontimeupdate.ontoggle.onunhandledrejection.onunload.onvolumechange.onwaiting.onwheel`.split(`.`),disallowedTagsMode:`discard`,allowedAttributes:{a:[`href`,`name`,`target`],img:[`src`,`srcset`,`alt`,`title`,`width`,`height`,`loading`]},allowedEmptyAttributes:[`alt`],selfClosing:[`img`,`br`,`hr`,`area`,`base`,`basefont`,`input`,`link`,`meta`],allowedSchemes:[`http`,`https`,`ftp`,`mailto`,`tel`],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:[`href`,`src`,`cite`],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0,preserveEscapedAttributes:!1},_.simpleTransform=function(e,t,n){return n=n===void 0?!0:n,t||={},function(r,i){let a;if(n)for(a in t)i[a]=t[a];else i=t;return{tagName:e,attribs:i}}}})),vy=t(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},N={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},P={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},ee=I(`//`,`$`),L=I(`/\\*`,`\\*/`),te=I(`#`,`$`),ne=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:{scope:`number`,begin:k,relevance:0},BINARY_NUMBER_RE:k,COMMENT:I,C_BLOCK_COMMENT_MODE:L,C_LINE_COMMENT_MODE:ee,C_NUMBER_MODE:{scope:`number`,begin:O,relevance:0},C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:te,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:D,relevance:0},NUMBER_RE:D,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:P,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:{scope:`title`,begin:T,relevance:0},UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:E,relevance:0}});function re(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function ie(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ae(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=re,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function oe(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function se(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function ce(e,t){e.relevance===void 0&&(e.relevance=1)}var le=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},R=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],ue=`keyword`;function de(e,t,n=ue){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,de(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,fe(n[0],n[1])]})}}function fe(e,t){return t?Number(t):+!pe(e)}function pe(e){return R.includes(e.toLowerCase())}var me={},he=e=>{console.error(e)},ge=(e,...t)=>{console.log(`WARN: ${e}`,...t)},_e=(e,t)=>{me[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),me[`${e}/${t}`]=!0)},ve=Error();function ye(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function be(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw he(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),ve;if(typeof e.beginScope!=`object`||e.beginScope===null)throw he(`beginScope must be object`),ve;ye(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function xe(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw he(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),ve;if(typeof e.endScope!=`object`||e.endScope===null)throw he(`endScope must be object`),ve;ye(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Se(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Ce(e){Se(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),be(e),xe(e)}function we(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[ie,se,Ce,le].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[ae,oe,ce].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=de(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return z(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Te(e){return e?e.endsWithParent||Te(e.starts):!1}function z(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Te(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Ee=`11.11.1`,De=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Oe=i,ke=a,Ae=Symbol(`nomatch`),je=7,Me=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(ge(s.replace(`{}`,n[1])),ge(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||N(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(_e(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),_e(`10.7.0`,`Please use highlight(code, options) instead.
161
161
  https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};te(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,te(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){M.addText(P);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(P),n=``;for(;t;){n+=P.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(M.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=je&&(F+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(P)}n+=P.substring(e),M.addText(n)}function f(){if(P===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){M.addText(P);return}e=v(A.subLanguage,P,!0,j[A.subLanguage]),j[A.subLanguage]=e._top}else e=S(P,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(F+=e.relevance),M.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),P=``}function m(e,t){e!==``&&(M.startScope(t),M.addText(e),M.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(P=i,d(),P=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&M.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(P,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),P=``):e.beginScope._multi&&(h(e.beginScope,t),P=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(P+=e[0],1):(L=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?P+=t:(n.excludeBegin&&(P+=t),p(),!n.returnBegin&&!n.excludeBegin&&(P=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return Ae;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?P+=t:(a.returnEnd||a.excludeEnd||(P+=t),p(),a.excludeEnd&&(P=t));do A.scope&&M.closeNode(),!A.skip&&!A.subLanguage&&(F+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>M.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(P+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(P+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==Ae)return e}if(r.type===`illegal`&&a===``)return P+=`
162
- `,1;if(ee>1e5&&ee>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw he(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=we(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,ee=0,L=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){ee++,L?L=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Oe(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:Oe(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:Oe(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(te(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new De(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),te(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=ke(l,e)}let E=()=>{k(),_e(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),_e(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(he(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)he(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function ee(e){I(e),a.push(e)}function L(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function te(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function re(e){return _e(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),_e(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:re,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:ke,addPlugin:ee,removePlugin:L}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Ee,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in ne)typeof ne[e]==`object`&&n(ne[e]);return Object.assign(e,ne),e},Ne=Me({});Ne.newInstance=()=>Me({}),t.exports=Ne,Ne.HighlightJS=Ne,Ne.default=Ne})),fy=e(uy(),1),py=e(dy()).default;function my(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}var hy=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),gy=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),_y=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),vy=[...gy,..._y],yy=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),by=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),xy=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),Sy=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function Cy(e){let t=e.regex,n=hy(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+by.join(`|`)+`)`},{begin:`:(:)?(`+xy.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+Sy.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:yy.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+vy.join(`|`)+`)\\b`}]}}function wy(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}function Ty(e){let t={keyword:[`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`],type:[`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int8`,`int16`,`int32`,`int64`,`string`,`uint8`,`uint16`,`uint32`,`uint64`,`int`,`uint`,`uintptr`,`rune`],literal:[`true`,`false`,`iota`,`nil`],built_in:[`append`,`cap`,`close`,`complex`,`copy`,`imag`,`len`,`make`,`new`,`panic`,`print`,`println`,`real`,`recover`,`delete`]};return{name:`Go`,aliases:[`golang`],keywords:t,illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`string`,variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:`number`,variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:`function`,beginKeywords:`func`,end:`\\s*(\\{|$)`,excludeEnd:!0,contains:[e.TITLE_MODE,{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}var Ey=`[A-Za-z$_][0-9A-Za-z$_]*`,Dy=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),Oy=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],ky=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),Ay=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],jy=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],My=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],Ny=[].concat(jy,ky,Ay);function Py(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=Ey,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:Ey,keyword:Dy,literal:Oy,built_in:Ny,"variable.language":My},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...ky,...Ay]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...jy,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function Fy(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function Iy(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Ly(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function Ry(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o=`abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),s=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],c=`drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!`.split(`.`),l=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f32`,`f64`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:l,keyword:o,literal:s,built_in:c},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:`symbol`,begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:`string`,variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:`char.escape`,match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:`number`,variants:[{begin:`\\b0b([01_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b0o([0-7_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b0x([A-Fa-f0-9_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([ui](8|16|32|64|128|size)|f(32|64))?`}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:`keyword`,3:`title.function`}},{className:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:c,type:l}},{className:`punctuation`,begin:`->`},a]}}function zy(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}var By=`[A-Za-z$_][0-9A-Za-z$_]*`,Vy=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),Hy=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],Uy=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),Wy=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Gy=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],Ky=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],qy=[].concat(Gy,Uy,Wy);function Jy(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=By,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:By,keyword:Vy,literal:Hy,built_in:qy,"variable.language":Ky},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...Uy,...Wy]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...Gy,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function Yy(e){let t=e.regex,n=Jy(e),r=By,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:By,keyword:Vy.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:Hy,built_in:qy.concat(i),"variable.language":Ky},l={className:`meta`,begin:`@[A-Za-z$_][0-9A-Za-z$_]*`},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function Xy(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Zy(e){let t=`true false yes no null`,n={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},a={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},c={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},l={begin:/\{/,end:/\}/,contains:[c],illegal:`\\n`,relevance:0},u={begin:`\\[`,end:`\\]`,contains:[c],illegal:`\\n`,relevance:0},d=[n,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!<[\\w#;/?:@&=+$,.~*'()[\\]]+>`},{className:`type`,begin:`![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},s,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},l,u,i,a],f=[...d];return f.pop(),f.push(o),c.contains=f,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:d}}var Qy={bash:my,css:Cy,diff:wy,go:Ty,javascript:Py,json:Fy,markdown:Iy,python:Ly,rust:Ry,sql:zy,typescript:Yy,xml:Xy,yaml:Zy};for(let[e,t]of Object.entries(Qy))py.registerLanguage(e,t);function $y(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}function eb(e){return(e??``).trim().split(/\s+/)[0]?.toLowerCase().replace(/[^a-z0-9#+._-]/g,``)??``}function tb(e,t,n=!0){let r=String(e??``),i=eb(t),a=i?` language-${i}`:``;if(n&&i&&py.getLanguage(i))try{let{value:e}=py.highlight(r,{language:i,ignoreIllegals:!0});return`<pre><code class="hljs${a}">${e}</code></pre>\n`}catch{}return`<pre><code class="hljs${a}">${$y(r)}</code></pre>\n`}var nb={allowedTags:`a.blockquote.br.code.del.em.h1.h2.h3.h4.h5.h6.hr.li.ol.p.pre.span.strong.table.tbody.td.th.thead.tr.ul`.split(`.`),allowedAttributes:{a:[`href`,`rel`,`target`,`title`],code:[`class`],ol:[`start`],span:[`class`],td:[`style`],th:[`style`]},allowedStyles:{td:{"text-align":[/^left$/,/^center$/,/^right$/]},th:{"text-align":[/^left$/,/^center$/,/^right$/]}},allowedSchemes:[`http`,`https`,`mailto`],allowedSchemesAppliedToAttributes:[`href`],allowProtocolRelative:!1,transformTags:{a:(e,t)=>ib(typeof t.href==`string`?t.href:``)?{tagName:`a`,attribs:t}:{tagName:`a`,attribs:{...t,rel:`noopener noreferrer`,target:`_blank`}}}},rb=/(^|[\s>])((?:\/(?:admin|chat|docs)(?=$|[/?#\s<`.,;:!?)])(?:[/?#][^\s<`]*)?))/g;function ib(e){return/^\/(?:admin|chat|docs)(?:$|[/?#])/.test(e)}function ab(e){let t=e,n=``;for(;/[.,;:!?)]$/.test(t);)n=`${t.at(-1)}${n}`,t=t.slice(0,-1);return{href:t,trailing:n}}function ob(e){return e.replace(rb,(e,t,n)=>{let{href:r,trailing:i}=ab(n);return r?`${t}[${r}](${r})${i}`:`${t}${n}`})}function sb(e){if(!e.startsWith("`")||!e.endsWith("`"))return null;let t=e.slice(1,-1);return ib(t)?`[${t}](${t})`:null}function cb(e){let t=e.split(`
163
- `),n=!1;return t.map(e=>/^\s*(```|~~~)/.test(e)?(n=!n,e):n?e:e.split(/(`[^`]*`)/g).map(e=>sb(e)||(e.startsWith("`")&&e.endsWith("`")?e:ob(e))).join(``)).join(`
164
- `)}function lb(e){let t=new Y_({async:!1,breaks:!0,gfm:!0});return t.use({renderer:{code(t,n){return tb(typeof t==`string`?t:t.text,typeof t==`string`?n:t.lang,e)}}}),t}var ub=lb(!0),db=lb(!1);function fb(e,t){let n=String(e||``).replace(/\r\n/g,`
165
- `).replace(/^(\s*)\*\*(\d+)\.\s+(.+?)\*\*\s*$/gm,`$1$2. **$3**`);if(!n.trim())return``;let r=(t?.highlight===!1?db:ub).parse(cb(n));return(0,fy.default)(typeof r==`string`?r:String(r||``),nb).trim()}function pb(e){return`/admin/skills/${encodeURIComponent(e)}`}function mb(e){if(!e)return``;try{return decodeURIComponent(e)}catch{return e}}function hb(e){return e.docs?.examplePrompts.length??0}function gb(e){return e.label?.trim()?e.label.trim():e.package?`${e.kind}: ${e.package}`:e.formula?`${e.kind}: ${e.formula}`:e.module?`${e.kind}: ${e.module}`:e.url?`${e.kind}: ${e.url}`:e.id?`${e.kind}: ${e.id}`:e.kind}function _b(e){return`${e.id} · ${e.kind}${e.required?` · required`:``}`}function vb(e){return e.length===null?`unknown length`:`${e.length} bytes`}function yb(e){return e.fingerprint?`sha256:${e.fingerprint.sha256_prefix}`:`no fingerprint`}function bb(e){return e.last_rotated_at?Za(e.last_rotated_at):`never`}function xb(e){return{name:e,state:`unset`,created_at:null,last_rotated_at:null,length:null,fingerprint:null}}function Sb(e){return`${e.env}${e.required?` · required`:``}`}function Cb(e,t){let n=t.trim();return n?n.startsWith(`/`)?n:`/${e} ${n}`:`/${e}`}function wb(e,t){return`/chat?${new URLSearchParams({prompt:Cb(e,t)}).toString()}`}function Tb(e){return e.values.length===0?(0,B.jsx)(`p`,{className:`supporting-text`,children:e.empty}):(0,B.jsx)(`div`,{className:`skill-chip-list`,children:e.values.map(e=>(0,B.jsx)(`span`,{className:`meta-chip`,children:e},e))})}function Eb(e){let t=(0,R.useMemo)(()=>fb(e.markdown,{highlight:!1}),[e.markdown]);return t?(0,B.jsx)(`div`,{className:`skill-markdown`,dangerouslySetInnerHTML:{__html:t}}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No tutorial is documented yet.`})}function Db(e){let t=(0,R.useRef)(null);if(e.screenshots.length===0)return null;let n=e=>{let n=t.current;n&&n.scrollBy({left:e*Math.max(n.clientWidth*.8,320),behavior:`smooth`})};return(0,B.jsxs)(`section`,{className:`skill-screenshot-section`,"aria-labelledby":`screenshots`,children:[(0,B.jsxs)(`div`,{className:`skill-screenshot-header`,children:[(0,B.jsx)(`h2`,{id:`screenshots`,children:`Screenshots`}),e.screenshots.length>1?(0,B.jsxs)(`div`,{className:`skill-screenshot-controls`,children:[(0,B.jsx)(Z,{"aria-label":`Previous screenshot`,size:`icon`,variant:`outline`,onClick:()=>n(-1),children:(0,B.jsx)(tr,{"aria-hidden":`true`,width:18,height:18})}),(0,B.jsx)(Z,{"aria-label":`Next screenshot`,size:`icon`,variant:`outline`,onClick:()=>n(1),children:(0,B.jsx)(nr,{"aria-hidden":`true`,width:18,height:18})})]}):null]}),(0,B.jsx)(`div`,{className:`skill-screenshot-gallery`,ref:t,children:e.screenshots.map(e=>(0,B.jsxs)(`figure`,{className:`skill-screenshot-frame`,children:[(0,B.jsx)(`img`,{alt:e.alt,loading:`lazy`,src:e.src}),e.title?(0,B.jsx)(`figcaption`,{children:e.title}):null]},e.src))})]})}function Ob(e){return e===null?`directory`:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function kb(e){return e.find(e=>e.path===`SKILL.md`&&e.previewable)?.path||e.find(e=>e.previewable)?.path||e.find(e=>e.kind===`file`)?.path||e[0]?.path||null}function Ab(e,t){return!e||!t?null:`${e}:${t}`}function jb(e){let t=Gn(),n=y({queryKey:[`skill-invocations`,t.token,e.skillName],queryFn:()=>wn(t.token,e.skillName),refetchOnWindowFocus:!1}),r=n.data?.invocations||[];return(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Recent invocations`}),(0,B.jsx)(uo,{children:`Recent user prompts and responses for this skill.`})]}),(0,B.jsx)(K,{children:n.isError?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(n.error)}):n.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading recent invocations...`}):r.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No recent invocations found.`}):(0,B.jsx)(`div`,{className:`skill-invocation-list`,children:r.map(e=>(0,B.jsx)(Mb,{invocation:e},`${e.sessionId}-${e.userMessageId}`))})})]})}function Mb(e){let t=e.invocation,n=t.response||`No assistant response recorded.`;return(0,B.jsxs)(`details`,{className:`skill-invocation-row`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(`span`,{className:`skill-invocation-summary-main`,children:t.userPrompt}),(0,B.jsxs)(`span`,{className:`skill-invocation-summary-meta`,children:[Qa(t.createdAt),t.username?` · ${t.username}`:``,t.skillInput?` · ${t.skillInput}`:``]})]}),(0,B.jsxs)(`div`,{className:`skill-invocation-detail`,children:[(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h4`,{children:`User prompt`}),(0,B.jsx)(`pre`,{children:t.userPrompt})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h4`,{children:`Response`}),(0,B.jsx)(`pre`,{children:n})]})]})]})}function Nb(e){let t=Gn(),n=o(),r=hs(),[i,a]=(0,R.useState)(null),[s,c]=(0,R.useState)(``),l=(0,R.useRef)(null),u=(0,R.useRef)(``),d=y({queryKey:[`skill-package-files`,t.token,e.skillName],queryFn:()=>Cn(t.token,e.skillName),refetchOnWindowFocus:!1}),f=d.data?.files.find(e=>e.path===i)||null,p=Ab(e.skillName,i);(0,R.useEffect)(()=>{d.data&&(d.data.files.some(e=>e.path===i)||a(kb(d.data.files)))},[d.data,i]);let m=y({queryKey:[`skill-package-file`,t.token,e.skillName,i],queryFn:()=>Tn(t.token,{skillName:e.skillName,path:i||``}),enabled:!!(i&&f?.previewable),refetchOnWindowFocus:!1});(0,R.useEffect)(()=>{if(!p){l.current=null,u.current=``,c(``);return}if(!m.data)return;let e=m.data.file.content||``;(l.current!==p||s===u.current)&&(l.current=p,u.current=e,c(e))},[s,m.data,p]);let h=g({mutationFn:async()=>{if(!i)throw Error(`Select a skill file first.`);if(!f?.editable)throw Error(`Select an editable skill file first.`);return En(t.token,{skillName:e.skillName,path:i,content:s})},onSuccess:e=>{let i=Ab(e.skillName,e.file.path);n.setQueryData([`skill-package-file`,t.token,e.skillName,e.file.path],e),n.invalidateQueries({queryKey:[`skill-package-files`,t.token,e.skillName]}),l.current=i,u.current=e.file.content||``,c(e.file.content||``),r.success(`Saved ${e.file.path}.`)},onError:e=>{r.error(`Save failed`,H(e))}}),_=s!==u.current,v=m.data?.file,b=d.data?.files||[],x=!!f?.editable&&!!v&&v?.path===f?.path&&v?.content!==null;return(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Package files`}),(0,B.jsx)(uo,{children:d.data?.rootPath||`Loading package directory...`})]}),(0,B.jsx)(K,{children:d.isError?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(d.error)}):d.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading package files...`}):b.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No package files found.`}):(0,B.jsxs)(`div`,{className:`skill-file-browser`,children:[(0,B.jsx)(`div`,{className:`skill-file-list`,children:b.map(e=>(0,B.jsxs)(`button`,{className:`skill-file-row ${e.path===i?`is-selected`:``}`,onClick:()=>a(e.path),type:`button`,children:[(0,B.jsx)(`span`,{className:`skill-file-name`,children:e.path}),(0,B.jsxs)(`span`,{className:`skill-file-meta`,children:[e.kind,` · `,Ob(e.sizeBytes)]})]},e.path))}),(0,B.jsxs)(`div`,{className:`skill-file-editor`,children:[f?(0,B.jsxs)(`div`,{className:`skill-file-editor-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:f.path}),(0,B.jsx)(`span`,{children:f.updatedAt?Qa(f.updatedAt):`not modified`})]}),(0,B.jsxs)(`div`,{className:`skill-file-editor-actions`,children:[(0,B.jsx)(Z,{disabled:!x||!_||h.isPending,loading:h.isPending,onClick:()=>h.mutate(),size:`sm`,children:`Save`}),(0,B.jsx)(Z,{disabled:!_||h.isPending,onClick:()=>{c(u.current)},size:`sm`,variant:`outline`,children:`Discard`})]})]}):null,f?f.kind===`file`?f.previewable?m.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading file...`}):m.isError?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(m.error)}):(0,B.jsx)(Jo,{"aria-label":`Edit ${f.path}`,className:`code-editor skill-file-textarea`,onChange:e=>c(e.target.value),onInput:e=>c(e.currentTarget.value),readOnly:!x||h.isPending,spellCheck:!1,value:s}):(0,B.jsx)(`div`,{className:`empty-state`,children:`This file is not editable in the admin preview.`}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Directory selected.`}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Select a package file.`})]})]})})]})}function Pb(e){let t=Gn(),n=o(),r=hs(),[i,a]=(0,R.useState)(`description`),[s,c]=(0,R.useState)(null),[l,u]=(0,R.useState)(null),d=y({queryKey:[`skills`,t.token],queryFn:()=>yn(t.token)}),f=g({mutationFn:e=>Vn(t.token,e),onSuccess:e=>{n.setQueryData([`skills`,t.token],e)},onError:e=>{r.error(`Toggle failed`,H(e))}}),p=d.data?.skills.find(t=>t.name===e.skillName),m=y({queryKey:[`admin`,`secrets`,t.token],queryFn:()=>Ut(t.token),retry:!1,enabled:(p?.credentials.length??0)>0}),h=(0,R.useMemo)(()=>new Map((m.data?.secrets||[]).map(e=>[e.name,e])),[m.data?.secrets]),_=m.data?.actions.includes(`secret.overwrite`)??!1,v=m.data?.actions.includes(`secret.unset`)??!1,b=(0,R.useCallback)(()=>n.invalidateQueries({queryKey:[`admin`,`secrets`]}),[n]),x=g({mutationFn:e=>Wt(t.token,e.name,e.value),onSuccess:async(e,t)=>{r.success(`Set ${t.name}.`),c(null),await b()},onError:e=>{r.error(`Secret save failed`,H(e))}}),S=g({mutationFn:e=>Gt(t.token,e),onSuccess:async(e,t)=>{r.success(`Deleted ${t}.`),u(null),await b()},onError:e=>{r.error(`Secret delete failed`,H(e))}});if(d.isLoading)return(0,B.jsx)(`div`,{className:`page-stack`,children:(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading skill...`})});if(d.isError)return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Z,{variant:`ghost`,render:(0,B.jsx)(D,{to:`/admin/skills`,children:`Back to skills`})}),(0,B.jsx)(U,{children:(0,B.jsx)(K,{children:(0,B.jsx)(`div`,{className:`empty-state error`,children:H(d.error)})})})]});if(!p)return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Z,{variant:`ghost`,render:(0,B.jsx)(D,{to:`/admin/skills`,children:`Back to skills`})}),(0,B.jsx)(U,{children:(0,B.jsx)(K,{children:(0,B.jsx)(`div`,{className:`empty-state`,children:`Skill not found.`})})})]});let C=[...(p.capabilities||[]).map(e=>`capability: ${e}`),...(p.requires?.bins||[]).map(e=>`bin: ${e}`)],w=p.requires?.env||[],T=p.install||[],E=p.docs?.examplePrompts||[],O=p.docs?.screenshots||[],k=p.docs?.sourceHref;return(0,B.jsxs)(`div`,{className:`page-stack skill-detail-page`,children:[(0,B.jsx)(`div`,{className:`skill-detail-back-row`,children:(0,B.jsx)(Z,{variant:`ghost`,render:(0,B.jsx)(D,{to:`/admin/skills`,children:`Back to skills`})})}),(0,B.jsxs)(`section`,{className:`skill-detail-hero`,children:[(0,B.jsx)(`div`,{className:`skill-detail-icon`,"aria-hidden":p.logoUrl?void 0:!0,children:p.logoUrl?(0,B.jsx)(`img`,{src:p.logoUrl,alt:`${p.name} logo`}):p.name.slice(0,1).toUpperCase()}),(0,B.jsxs)(`div`,{className:`skill-detail-title`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{children:p.name}),(0,B.jsx)(`p`,{children:p.shortDescription||p.description})]}),(0,B.jsxs)(`div`,{className:`skill-detail-status-row`,children:[p.blocked?null:(0,B.jsxs)(`label`,{className:`skill-detail-enable-control`,children:[(0,B.jsx)(Pc,{checked:p.enabled,"aria-label":`${p.enabled?`Disable`:`Enable`} ${p.name}`,disabled:f.isPending||!p.available&&!p.enabled,onCheckedChange:e=>{e&&!p.available||f.mutate({name:p.name,enabled:e})}}),(0,B.jsx)(`span`,{children:f.isPending?`Saving...`:p.enabled?`Enabled`:`Enable`})]}),(0,B.jsx)(`span`,{className:`status-pill`,children:p.category}),(0,B.jsx)(`span`,{className:`status-pill`,children:p.source})]}),!p.blocked&&!p.available?(0,B.jsx)(`p`,{className:`skill-detail-status-note`,children:p.missing.join(`, `)||`missing requirements`}):null]})]}),(0,B.jsxs)(`div`,{className:`skill-detail-summary-grid`,children:[(0,B.jsxs)(`div`,{className:`skill-detail-summary-item`,children:[(0,B.jsx)(`span`,{children:`Developer`}),(0,B.jsx)(`strong`,{children:p.developer})]}),(0,B.jsxs)(`div`,{className:`skill-detail-summary-item`,children:[(0,B.jsx)(`span`,{children:`Tools`}),(0,B.jsx)(`strong`,{children:C.length})]}),(0,B.jsxs)(`div`,{className:`skill-detail-summary-item`,children:[(0,B.jsx)(`span`,{children:`Prompts`}),(0,B.jsx)(`strong`,{children:hb(p)})]}),(0,B.jsxs)(`div`,{className:`skill-detail-summary-item`,children:[(0,B.jsx)(`span`,{children:`Dependencies`}),(0,B.jsx)(`strong`,{children:T.length})]})]}),(0,B.jsx)(Db,{screenshots:O}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Overview`}),(0,B.jsx)(uo,{children:p.description})]}),(0,B.jsxs)(K,{children:[(0,B.jsx)(Wa,{ariaLabel:`Skill detail tabs`,value:i,size:`sm`,options:[{value:`description`,label:`Description`,activeTone:`is-on`},{value:`tutorial`,label:`Tutorial`,activeTone:`is-on`},{value:`prompts`,label:`Prompts`,activeTone:`is-on`}],onChange:a}),i===`description`?(0,B.jsxs)(`div`,{className:`skill-description-panel`,children:[(0,B.jsx)(`p`,{children:p.description}),p.relatedSkills.length>0?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h4`,{children:`Related skills`}),(0,B.jsx)(Tb,{values:p.relatedSkills,empty:``})]}):null,p.tags.length>0?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h4`,{children:`Tags`}),(0,B.jsx)(Tb,{values:p.tags,empty:``})]}):null]}):i===`tutorial`?(0,B.jsxs)(`div`,{className:`skill-tutorial-panel`,children:[k?(0,B.jsx)(`a`,{className:`skill-doc-source-link`,href:k,children:p.docs?.sourcePath}):null,(0,B.jsx)(Eb,{markdown:p.docs?.tutorialMarkdown||``})]}):(0,B.jsx)(`div`,{className:`skill-prompt-list`,children:E.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No example prompts documented.`}):E.map(e=>(0,B.jsxs)(`div`,{className:`skill-prompt-row`,children:[(0,B.jsx)(Z,{"aria-label":`Try it: ${Cb(p.name,e.prompt)}`,render:(0,B.jsx)(`a`,{href:wb(p.name,e.prompt),rel:`noreferrer`,target:`_blank`,children:`Try it`}),size:`sm`}),(0,B.jsx)(`code`,{children:e.prompt})]},`${e.kind}-${e.conversationId??`single`}-${e.turnIndex??e.prompt}`))})]})]}),(0,B.jsx)(jb,{skillName:p.name}),p.available&&!p.blocked?(0,B.jsx)(Nb,{skillName:p.name}):null,(0,B.jsxs)(`div`,{className:`two-column-grid skill-detail-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Tools`}),(0,B.jsx)(uo,{children:`Declared capabilities and required runtime binaries.`})]}),(0,B.jsx)(K,{children:(0,B.jsx)(Tb,{values:C,empty:`No explicit capabilities or binaries declared.`})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Dependencies`}),(0,B.jsx)(uo,{children:`Install metadata and required environment.`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`detail-stack`,children:[T.length>0?(0,B.jsx)(`div`,{className:`skill-detail-list`,children:T.map((e,t)=>(0,B.jsxs)(`div`,{className:`skill-detail-list-row`,children:[(0,B.jsx)(`strong`,{children:gb(e)}),e.bins?.length?(0,B.jsxs)(`small`,{children:[`bins: `,e.bins.join(`, `)]}):null]},e.id||t))}):(0,B.jsx)(`p`,{className:`supporting-text`,children:`No install dependencies declared.`}),(0,B.jsx)(Tb,{values:w.map(e=>`env: ${e}`),empty:`No required environment variables declared.`})]})})]})]}),(0,B.jsxs)(`div`,{className:`two-column-grid skill-detail-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Credentials`})}),(0,B.jsx)(K,{children:p.credentials.length===0?(0,B.jsx)(`p`,{className:`supporting-text`,children:`No credentials declared.`}):(0,B.jsxs)(B.Fragment,{children:[m.isLoading?(0,B.jsx)(`p`,{className:`supporting-text`,children:`Checking runtime secret store...`}):null,m.isError?(0,B.jsxs)(`p`,{className:`supporting-text error-text`,children:[`Secret metadata unavailable:`,` `,H(m.error)]}):null,(0,B.jsx)(`div`,{className:`skill-credential-list`,children:p.credentials.map(e=>{let t=e.secretRef.id,n=e.secretRef.source===`store`,r=h.get(t)||xb(t),i=n?m.isLoading?`checking`:m.isError?`unknown`:r.state===`set`?`set`:`missing`:`external`,a=n&&_&&i!==`checking`&&i!==`unknown`,o=n&&v&&i===`set`;return(0,B.jsxs)(`div`,{className:`skill-credential-row`,children:[(0,B.jsxs)(`div`,{className:`skill-credential-body`,children:[(0,B.jsx)(`strong`,{children:_b(e)}),(0,B.jsx)(`small`,{children:t}),e.scope?(0,B.jsx)(`small`,{children:e.scope}):null,i===`set`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`small`,{children:[vb(r),` · rotated`,` `,bb(r)]}),(0,B.jsx)(`code`,{className:`skill-credential-fingerprint`,children:yb(r)})]}):i===`missing`?(0,B.jsx)(`small`,{children:`Missing from the runtime secret store.`}):i===`checking`?(0,B.jsx)(`small`,{children:`Checking the runtime secret store.`}):i===`external`?(0,B.jsxs)(`small`,{children:[`Secret source: `,e.secretRef.source]}):(0,B.jsx)(`small`,{children:`Stored status could not be checked.`})]}),(0,B.jsxs)(`div`,{className:`skill-credential-actions`,children:[i===`set`?(0,B.jsxs)(`span`,{className:`boolean-pill is-on skill-credential-set-pill`,children:[(0,B.jsx)($n,{className:`skill-credential-set-icon`}),`set`]}):i===`missing`?(0,B.jsx)(Ga,{value:!1,trueLabel:`set`,falseLabel:`missing`,falseTone:`danger`}):(0,B.jsx)(`span`,{className:`status-pill`,children:i}),a?(0,B.jsx)(Z,{"aria-label":`Set ${t}`,onClick:()=>c({name:t}),size:`sm`,variant:`outline`,children:`Set`}):null,o?(0,B.jsx)(Z,{"aria-label":`Delete ${t}`,onClick:()=>u(t),size:`sm`,variant:`danger`,children:`Delete`}):null]})]},e.id)})})]})})]}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Configuration`})}),(0,B.jsx)(K,{children:p.configVariables.length===0?(0,B.jsx)(`p`,{className:`supporting-text`,children:`No config variables declared.`}):(0,B.jsx)(`div`,{className:`skill-detail-list`,children:p.configVariables.map(e=>(0,B.jsxs)(`div`,{className:`skill-detail-list-row`,children:[(0,B.jsx)(`strong`,{children:Sb(e)}),e.scope?(0,B.jsx)(`small`,{children:e.scope}):null]},e.id))})})]})]}),p.blocked?(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Guard findings`}),(0,B.jsx)(uo,{children:p.blockedReason})]}),(0,B.jsx)(K,{children:(0,B.jsx)(`div`,{className:`skill-detail-list`,children:(p.guardFindings||[]).map(e=>(0,B.jsxs)(`div`,{className:`skill-detail-list-row`,children:[(0,B.jsxs)(`strong`,{children:[e.severity,`/`,e.category]}),(0,B.jsxs)(`small`,{children:[e.file,`:`,e.line]}),(0,B.jsx)(`small`,{children:e.description})]},`${e.patternId}-${e.file}-${e.line}`))})})]}):null,(0,B.jsx)(Fb,{name:s?.name??null,onClose:()=>c(null),onSubmit:e=>{s&&x.mutate({name:s.name,value:e})},pending:x.isPending}),(0,B.jsx)(Ib,{name:l,onClose:()=>u(null),onConfirm:()=>{l&&S.mutate(l)},pending:S.isPending})]})}function Fb(e){let t=(0,R.useRef)(null),n=(0,R.useId)(),r=(0,R.useId)(),i=e.name!==null;return(0,B.jsx)(ri,{open:i,onOpenChange:n=>{n||(t.current&&(t.current.value=``),e.onClose())},children:(0,B.jsxs)(ii,{role:`dialog`,size:`default`,preventCloseOnOutsideClick:e.pending,children:[(0,B.jsxs)(ai,{children:[(0,B.jsxs)(oi,{children:[`Set value for `,(0,B.jsx)(`code`,{children:e.name})]}),(0,B.jsx)(si,{children:`The value is sent to the gateway and immediately discarded from this form. The stored value cannot be read back.`})]}),(0,B.jsxs)(`form`,{className:`skill-secret-dialog-form`,onSubmit:n=>{n.preventDefault();let r=t.current?.value||``;r.trim()&&e.onSubmit(r)},children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{htmlFor:n,children:`New value`}),(0,B.jsx)(Y,{id:n,ref:t,type:`password`,autoComplete:`new-password`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,required:!0,"aria-describedby":r,disabled:e.pending}),(0,B.jsx)(`p`,{id:r,className:`skill-secret-dialog-note`,children:`Pasted values are not echoed. Once submitted, the value lives only in the runtime secret store.`})]}),(0,B.jsxs)(ci,{children:[(0,B.jsx)(li,{className:`ghost-button`,disabled:e.pending,children:`Cancel`}),(0,B.jsx)(Z,{type:`submit`,disabled:e.pending,children:e.pending?`Saving...`:`Save value`})]})]})]})})}function Ib(e){return(0,B.jsx)(ri,{open:e.name!==null,onOpenChange:t=>{t||e.onClose()},children:(0,B.jsxs)(ii,{role:`alertdialog`,size:`default`,preventCloseOnOutsideClick:e.pending,children:[(0,B.jsxs)(ai,{children:[(0,B.jsxs)(oi,{children:[`Delete `,(0,B.jsx)(`code`,{children:e.name}),`?`]}),(0,B.jsx)(si,{children:`The stored value will be removed from the runtime secret store. Skills that depend on this secret will fail until a new value is set.`})]}),(0,B.jsxs)(ci,{children:[(0,B.jsx)(li,{className:`ghost-button`,disabled:e.pending,children:`Cancel`}),(0,B.jsx)(Z,{type:`button`,variant:`danger`,disabled:e.pending,onClick:e.onConfirm,children:e.pending?`Deleting...`:`Delete secret`})]})]})})}function Lb(){return(0,B.jsx)(Pb,{skillName:mb(O({strict:!1}).skillName)})}var Rb=[`agents`,`apple`,`business`,`communication`,`development`,`memory`,`misc`,`office`,`productivity`,`publishing`,`security`,`uncategorized`];function zb(e){return e.positive_feedback_count===0&&e.negative_feedback_count===0?null:`👍 ${e.positive_feedback_count} · 👎 ${e.negative_feedback_count}`}function Bb(e,t=120){let n=e.trim().replace(/\s+/g,` `);if(n.length<=t)return n;let r=n.slice(0,t-1),i=r.lastIndexOf(` `);return`${(i>=Math.floor(t*.6)?r.slice(0,i):r).trimEnd()}…`}function Vb(e){return`${e.status} · v${e.version}`}function Hb(e){return Za(e.applied_at||e.rejected_at||e.rolled_back_at||e.updated_at||e.created_at)}function Ub(e){return e?+!!e.degraded:2}var Wb={skill:(e,t)=>X(e.skill.name,t.skill.name),category:(e,t)=>X(e.skill.category,t.skill.category)||X(e.skill.name,t.skill.name),source:(e,t)=>X(e.skill.source,t.skill.source)||X(e.skill.name,t.skill.name),health:(e,t)=>$o(Ub(e.metrics),Ub(t.metrics))||$o(e.metrics?.total_executions,t.metrics?.total_executions)||X(e.skill.name,t.skill.name),tags:(e,t)=>X(e.skill.tags.join(`, `),t.skill.tags.join(`, `))||X(e.skill.name,t.skill.name),action:(e,t)=>es(e.skill.enabled,t.skill.enabled)||X(e.skill.name,t.skill.name)},Gb={action:`desc`};function Kb(e){return e.positive_feedback_count+e.negative_feedback_count}function qb(e,t){return e.total_executions>0?t/e.total_executions:0}function Jb(e,t){return`${Ya(qb(e,t))} (${t})`}function Yb(e){return`${Ya(e.tool_breakage_rate)} (${e.tool_calls_failed}/${e.tool_calls_attempted})`}var Xb={skill:(e,t)=>X(e.skill_name,t.skill_name),status:(e,t)=>es(!e.degraded,!t.degraded)||X(e.skill_name,t.skill_name),executions:(e,t)=>$o(e.total_executions,t.total_executions)||X(e.skill_name,t.skill_name),success:(e,t)=>$o(e.success_rate,t.success_rate)||X(e.skill_name,t.skill_name),partial:(e,t)=>$o(qb(e,e.partial_count),qb(t,t.partial_count))||X(e.skill_name,t.skill_name),failure:(e,t)=>$o(qb(e,e.failure_count),qb(t,t.failure_count))||X(e.skill_name,t.skill_name),toolBreakage:(e,t)=>$o(e.tool_breakage_rate,t.tool_breakage_rate)||X(e.skill_name,t.skill_name),feedback:(e,t)=>$o(Kb(e),Kb(t))||X(e.skill_name,t.skill_name),reasons:(e,t)=>X(e.degradation_reasons.join(`; `),t.degradation_reasons.join(`; `))||X(e.skill_name,t.skill_name)},Zb={status:`desc`,executions:`desc`,success:`desc`,partial:`desc`,failure:`desc`,toolBreakage:`desc`,feedback:`desc`},Qb=1;function $b(){return{name:``,description:``,category:``,shortDescription:``,userInvocable:!0,disableModelInvocation:!1,tags:``,body:``,files:[]}}function ex(){let e=Gn(),t=o(),n=hs(),[r,i]=(0,R.useState)(``),[a,s]=(0,R.useState)(!1),[c,l]=(0,R.useState)(``),[u,d]=(0,R.useState)(!1),[f,p]=(0,R.useState)(`form`),[m,h]=(0,R.useState)($b()),[_,v]=(0,R.useState)(null),[b,x]=(0,R.useState)(!1),S=(0,R.useDeferredValue)(r).trim().toLowerCase(),C=y({queryKey:[`skills`,e.token],queryFn:()=>yn(e.token)}),w=y({queryKey:[`adaptive-skills-health`,e.token],queryFn:()=>jn(e.token)}),T=y({queryKey:[`adaptive-skills-amendments`,e.token],queryFn:()=>In(e.token)}),E=g({mutationFn:t=>Vn(e.token,t),onSuccess:n=>{t.setQueryData([`skills`,e.token],n)},onError:e=>{n.error(`Toggle failed`,H(e))}}),O=g({mutationFn:t=>Sn(e.token,t),onSuccess:r=>{t.setQueryData([`skills`,e.token],r),n.success(`Skill unblocked`,`Scanner bypass marker was recorded for this skill.`)},onError:e=>{n.error(`Unblock failed`,H(e))}}),k=g({mutationFn:async t=>t.action===`apply`?Rn(e.token,t.skillName):zn(e.token,t.skillName),onSuccess:async(n,r)=>{await Promise.all([t.invalidateQueries({queryKey:[`adaptive-skills-health`,e.token]}),t.invalidateQueries({queryKey:[`adaptive-skills-amendments`,e.token]}),t.invalidateQueries({queryKey:[`adaptive-skills-history`,e.token,r.skillName]})])},onError:e=>{n.error(`Review failed`,H(e))}}),A=g({mutationFn:()=>{let t=m.tags.split(`,`).map(e=>e.trim()).filter(Boolean),n=m.files.filter(e=>e.path.trim()).map(e=>({path:e.path.trim(),content:e.content}));return bn(e.token,{name:m.name.trim(),description:m.description.trim(),category:m.category.trim(),shortDescription:m.shortDescription.trim()||void 0,userInvocable:m.userInvocable,disableModelInvocation:m.disableModelInvocation,tags:t.length>0?t:void 0,body:m.body.trim(),files:n.length>0?n:void 0})},onSuccess:n=>{t.setQueryData([`skills`,e.token],n),d(!1),h($b())},onError:e=>{n.error(`Create failed`,H(e))}}),j=g({mutationFn:()=>{if(!_)throw Error(`No file selected.`);return xn(e.token,_,{force:b})},onSuccess:n=>{t.setQueryData([`skills`,e.token],n),d(!1),v(null),x(!1)},onError:e=>{n.error(`Upload failed`,H(e))}}),M=w.data?.metrics||[],N=T.data?.amendments||[],P=Array.from(new Set([...Rb,...(C.data?.skills||[]).map(e=>e.category)])).sort((e,t)=>e.localeCompare(t)),F=new Set([...(C.data?.skills||[]).map(e=>e.name),...M.map(e=>e.skill_name),...N.map(e=>e.skill_name)]),I=c&&F.has(c)?c:N[0]?.skill_name||M[0]?.skill_name||C.data?.skills[0]?.name||``,ee=y({queryKey:[`adaptive-skills-history`,e.token,I],queryFn:()=>Ln(e.token,I),enabled:!!I}),L=(C.data?.skills||[]).filter(e=>a&&!e.enabled?!1:[e.name,e.category,e.description,e.shortDescription||``,e.source,e.blocked?`blocked`:``,e.blockedReason||``,...e.tags||[],...e.relatedSkills||[]].join(` `).toLowerCase().includes(S)),te=M.filter(e=>[e.skill_name,...e.degradation_reasons,...e.error_clusters.map(e=>e.category)].join(` `).toLowerCase().includes(S)),{sortedRows:ne,sortState:re,toggleSort:ie}=Ba(L.map(e=>({skill:e,metrics:M.find(t=>t.skill_name===e.name)||null})),{initialSort:{key:`skill`,direction:`asc`},sorters:Wb,defaultDirections:Gb}),{sortedRows:ae,sortState:oe,toggleSort:se}=Ba(te,{initialSort:{key:`skill`,direction:`asc`},sorters:Xb,defaultDirections:Zb}),ce=M.filter(e=>e.degraded).length,le=C.data?.skills.filter(e=>e.blocked).length||0,ue=ee.data?.amendments||[];return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{description:`Browse installed skills, review health, and manage amendments.`,actions:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Y,{className:`compact-search skills-header-search`,value:r,onChange:e=>i(e.target.value),placeholder:`Filter skills`}),(0,B.jsx)(Z,{className:`skills-header-button`,variant:`ghost`,type:`button`,onClick:()=>{d(!u),h($b()),v(null),x(!1),p(`form`),A.reset(),j.reset()},children:u?`Cancel`:`New`})]})}),u?(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Create skill`})}),(0,B.jsxs)(K,{children:[(0,B.jsx)(Wa,{ariaLabel:`Create mode`,value:f,options:[{value:`form`,label:`Form`,activeTone:`is-on`},{value:`zip`,label:`Upload ZIP`,activeTone:`is-on`}],onChange:e=>p(e)}),f===`zip`?(0,B.jsxs)(`div`,{className:`stack-form`,style:{marginTop:`1rem`},children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Skill archive (.zip)`}),(0,B.jsx)(Y,{type:`file`,accept:`.zip,.skill`,onChange:e=>v(e.target.files?.[0]||null)})]}),(0,B.jsxs)(`p`,{className:`supporting-text`,children:[`ZIP must contain a SKILL.md with a valid `,(0,B.jsx)(`code`,{children:`name`}),` `,`frontmatter field. May include scripts/, references/, and other files.`]}),(0,B.jsxs)(`label`,{className:`supporting-text`,style:{display:`inline-flex`,alignItems:`center`,gap:`0.4rem`,cursor:`pointer`,width:`fit-content`},children:[(0,B.jsx)(cf,{checked:b,onCheckedChange:x}),(0,B.jsx)(`span`,{children:`Overwrite existing skill (--force)`})]}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{type:`button`,loading:j.isPending,disabled:j.isPending||!_,onClick:()=>j.mutate(),children:j.isPending?`Uploading...`:`Upload skill`})})]}):(0,B.jsxs)(`div`,{className:`stack-form`,style:{marginTop:`1rem`},children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Name`}),(0,B.jsx)(Y,{value:m.name,onChange:e=>h(t=>({...t,name:e.target.value})),placeholder:`my-skill`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Category`}),(0,B.jsxs)(ds,{value:m.category,onChange:e=>h(t=>({...t,category:e.target.value})),children:[(0,B.jsx)(Q,{value:``,children:`Select category`}),P.map(e=>(0,B.jsx)(Q,{value:e,children:e},e))]})]})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Short description`}),(0,B.jsx)(Y,{value:m.shortDescription,onChange:e=>h(t=>({...t,shortDescription:e.target.value})),placeholder:`One-line summary used in metadata`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Tags`}),(0,B.jsx)(Y,{value:m.tags,onChange:e=>h(t=>({...t,tags:e.target.value})),placeholder:`tag1, tag2`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Description`}),(0,B.jsx)(Y,{value:m.description,onChange:e=>h(t=>({...t,description:e.target.value})),placeholder:`Short description of what this skill does`})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:m.userInvocable,onCheckedChange:e=>h(t=>({...t,userInvocable:e}))}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`User invocable`})})]}),(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Pc,{checked:!m.disableModelInvocation,onCheckedChange:e=>h(t=>({...t,disableModelInvocation:!e}))}),(0,B.jsx)(Bo,{children:(0,B.jsx)(J,{children:`Model invocable`})})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Skill body (Markdown)`}),(0,B.jsx)(Jo,{rows:10,value:m.body,onChange:e=>h(t=>({...t,body:e.target.value})),placeholder:`# My Skill
162
+ `,1;if(ee>1e5&&ee>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw he(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=we(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,ee=0,L=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){ee++,L?L=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Oe(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:Oe(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:Oe(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(te(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new De(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),te(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=ke(l,e)}let E=()=>{k(),_e(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),_e(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(he(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)he(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function ee(e){I(e),a.push(e)}function L(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function te(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function re(e){return _e(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),_e(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:re,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:ke,addPlugin:ee,removePlugin:L}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Ee,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in ne)typeof ne[e]==`object`&&n(ne[e]);return Object.assign(e,ne),e},Ne=Me({});Ne.newInstance=()=>Me({}),t.exports=Ne,Ne.HighlightJS=Ne,Ne.default=Ne})),yy=e(_y(),1),by=e(vy()).default;function xy(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}var Sy=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Cy=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),wy=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),Ty=[...Cy,...wy],Ey=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),Dy=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),Oy=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),ky=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function Ay(e){let t=e.regex,n=Sy(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+Dy.join(`|`)+`)`},{begin:`:(:)?(`+Oy.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+ky.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:Ey.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+Ty.join(`|`)+`)\\b`}]}}function jy(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}function My(e){let t={keyword:[`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`],type:[`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int8`,`int16`,`int32`,`int64`,`string`,`uint8`,`uint16`,`uint32`,`uint64`,`int`,`uint`,`uintptr`,`rune`],literal:[`true`,`false`,`iota`,`nil`],built_in:[`append`,`cap`,`close`,`complex`,`copy`,`imag`,`len`,`make`,`new`,`panic`,`print`,`println`,`real`,`recover`,`delete`]};return{name:`Go`,aliases:[`golang`],keywords:t,illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`string`,variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:`number`,variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:`function`,beginKeywords:`func`,end:`\\s*(\\{|$)`,excludeEnd:!0,contains:[e.TITLE_MODE,{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}var Ny=`[A-Za-z$_][0-9A-Za-z$_]*`,Py=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),Fy=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],Iy=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),Ly=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Ry=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],zy=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],By=[].concat(Ry,Iy,Ly);function Vy(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=Ny,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:Ny,keyword:Py,literal:Fy,built_in:By,"variable.language":zy},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...Iy,...Ly]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...Ry,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function Hy(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function Uy(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Wy(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function Gy(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o=`abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),s=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],c=`drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!`.split(`.`),l=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f32`,`f64`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:l,keyword:o,literal:s,built_in:c},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:`symbol`,begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:`string`,variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:`char.escape`,match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:`number`,variants:[{begin:`\\b0b([01_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b0o([0-7_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b0x([A-Fa-f0-9_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([ui](8|16|32|64|128|size)|f(32|64))?`}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:`keyword`,3:`title.function`}},{className:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:c,type:l}},{className:`punctuation`,begin:`->`},a]}}function Ky(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}var qy=`[A-Za-z$_][0-9A-Za-z$_]*`,Jy=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),Yy=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],Xy=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),Zy=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Qy=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],$y=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],eb=[].concat(Qy,Xy,Zy);function tb(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=qy,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:qy,keyword:Jy,literal:Yy,built_in:eb,"variable.language":$y},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...Xy,...Zy]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...Qy,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function nb(e){let t=e.regex,n=tb(e),r=qy,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:qy,keyword:Jy.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:Yy,built_in:eb.concat(i),"variable.language":$y},l={className:`meta`,begin:`@[A-Za-z$_][0-9A-Za-z$_]*`},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function rb(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function ib(e){let t=`true false yes no null`,n={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},a={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},c={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},l={begin:/\{/,end:/\}/,contains:[c],illegal:`\\n`,relevance:0},u={begin:`\\[`,end:`\\]`,contains:[c],illegal:`\\n`,relevance:0},d=[n,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!<[\\w#;/?:@&=+$,.~*'()[\\]]+>`},{className:`type`,begin:`![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},s,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},l,u,i,a],f=[...d];return f.pop(),f.push(o),c.contains=f,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:d}}var ab={bash:xy,css:Ay,diff:jy,go:My,javascript:Vy,json:Hy,markdown:Uy,python:Wy,rust:Gy,sql:Ky,typescript:nb,xml:rb,yaml:ib};for(let[e,t]of Object.entries(ab))by.registerLanguage(e,t);function ob(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}function sb(e){return(e??``).trim().split(/\s+/)[0]?.toLowerCase().replace(/[^a-z0-9#+._-]/g,``)??``}function cb(e,t,n=!0){let r=String(e??``),i=sb(t),a=i?` language-${i}`:``;if(n&&i&&by.getLanguage(i))try{let{value:e}=by.highlight(r,{language:i,ignoreIllegals:!0});return`<pre><code class="hljs${a}">${e}</code></pre>\n`}catch{}return`<pre><code class="hljs${a}">${ob(r)}</code></pre>\n`}var lb={allowedTags:`a.blockquote.br.code.del.em.h1.h2.h3.h4.h5.h6.hr.li.ol.p.pre.span.strong.table.tbody.td.th.thead.tr.ul`.split(`.`),allowedAttributes:{a:[`href`,`rel`,`target`,`title`],code:[`class`],ol:[`start`],span:[`class`],td:[`style`],th:[`style`]},allowedStyles:{td:{"text-align":[/^left$/,/^center$/,/^right$/]},th:{"text-align":[/^left$/,/^center$/,/^right$/]}},allowedSchemes:[`http`,`https`,`mailto`],allowedSchemesAppliedToAttributes:[`href`],allowProtocolRelative:!1,transformTags:{a:(e,t)=>db(typeof t.href==`string`?t.href:``)?{tagName:`a`,attribs:t}:{tagName:`a`,attribs:{...t,rel:`noopener noreferrer`,target:`_blank`}}}},ub=/(^|[\s>])((?:\/(?:admin|chat|docs)(?=$|[/?#\s<`.,;:!?)])(?:[/?#][^\s<`]*)?))/g;function db(e){return/^\/(?:admin|chat|docs)(?:$|[/?#])/.test(e)}function fb(e){let t=e,n=``;for(;/[.,;:!?)]$/.test(t);)n=`${t.at(-1)}${n}`,t=t.slice(0,-1);return{href:t,trailing:n}}function pb(e){return e.replace(ub,(e,t,n)=>{let{href:r,trailing:i}=fb(n);return r?`${t}[${r}](${r})${i}`:`${t}${n}`})}function mb(e){if(!e.startsWith("`")||!e.endsWith("`"))return null;let t=e.slice(1,-1);return db(t)?`[${t}](${t})`:null}function hb(e){let t=e.split(`
163
+ `),n=!1;return t.map(e=>/^\s*(```|~~~)/.test(e)?(n=!n,e):n?e:e.split(/(`[^`]*`)/g).map(e=>mb(e)||(e.startsWith("`")&&e.endsWith("`")?e:pb(e))).join(``)).join(`
164
+ `)}function gb(e){let t=new nv({async:!1,breaks:!0,gfm:!0});return t.use({renderer:{code(t,n){return cb(typeof t==`string`?t:t.text,typeof t==`string`?n:t.lang,e)}}}),t}var _b=gb(!0),vb=gb(!1);function yb(e,t){let n=String(e||``).replace(/\r\n/g,`
165
+ `).replace(/^(\s*)\*\*(\d+)\.\s+(.+?)\*\*\s*$/gm,`$1$2. **$3**`);if(!n.trim())return``;let r=(t?.highlight===!1?vb:_b).parse(hb(n));return(0,yy.default)(typeof r==`string`?r:String(r||``),lb).trim()}function bb(e){return`/admin/skills/${encodeURIComponent(e)}`}function xb(e){if(!e)return``;try{return decodeURIComponent(e)}catch{return e}}function Sb(e){return e.docs?.examplePrompts.length??0}function Cb(e){return e.label?.trim()?e.label.trim():e.package?`${e.kind}: ${e.package}`:e.formula?`${e.kind}: ${e.formula}`:e.module?`${e.kind}: ${e.module}`:e.url?`${e.kind}: ${e.url}`:e.id?`${e.kind}: ${e.id}`:e.kind}function wb(e){return`${e.id} · ${e.kind}${e.required?` · required`:``}`}function Tb(e){return e.length===null?`unknown length`:`${e.length} bytes`}function Eb(e){return e.fingerprint?`sha256:${e.fingerprint.sha256_prefix}`:`no fingerprint`}function Db(e){return e.last_rotated_at?io(e.last_rotated_at):`never`}function Ob(e){return{name:e,state:`unset`,created_at:null,last_rotated_at:null,length:null,fingerprint:null}}function kb(e){return`${e.env}${e.required?` · required`:``}`}function Ab(e,t){let n=t.trim();return n?n.startsWith(`/`)?n:`/${e} ${n}`:`/${e}`}function jb(e,t){return`/chat?${new URLSearchParams({prompt:Ab(e,t)}).toString()}`}function Mb(e){return e.values.length===0?(0,B.jsx)(`p`,{className:`supporting-text`,children:e.empty}):(0,B.jsx)(`div`,{className:`skill-chip-list`,children:e.values.map(e=>(0,B.jsx)(`span`,{className:`meta-chip`,children:e},e))})}function Nb(e){let t=(0,R.useMemo)(()=>yb(e.markdown,{highlight:!1}),[e.markdown]);return t?(0,B.jsx)(`div`,{className:`skill-markdown`,dangerouslySetInnerHTML:{__html:t}}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No tutorial is documented yet.`})}function Pb(e){let t=(0,R.useRef)(null);if(e.screenshots.length===0)return null;let n=e=>{let n=t.current;n&&n.scrollBy({left:e*Math.max(n.clientWidth*.8,320),behavior:`smooth`})};return(0,B.jsxs)(`section`,{className:`skill-screenshot-section`,"aria-labelledby":`screenshots`,children:[(0,B.jsxs)(`div`,{className:`skill-screenshot-header`,children:[(0,B.jsx)(`h2`,{id:`screenshots`,children:`Screenshots`}),e.screenshots.length>1?(0,B.jsxs)(`div`,{className:`skill-screenshot-controls`,children:[(0,B.jsx)(Z,{"aria-label":`Previous screenshot`,size:`icon`,variant:`outline`,onClick:()=>n(-1),children:(0,B.jsx)(sr,{"aria-hidden":`true`,width:18,height:18})}),(0,B.jsx)(Z,{"aria-label":`Next screenshot`,size:`icon`,variant:`outline`,onClick:()=>n(1),children:(0,B.jsx)(cr,{"aria-hidden":`true`,width:18,height:18})})]}):null]}),(0,B.jsx)(`div`,{className:`skill-screenshot-gallery`,ref:t,children:e.screenshots.map(e=>(0,B.jsxs)(`figure`,{className:`skill-screenshot-frame`,children:[(0,B.jsx)(`img`,{alt:e.alt,loading:`lazy`,src:e.src}),e.title?(0,B.jsx)(`figcaption`,{children:e.title}):null]},e.src))})]})}function Fb(e){return e===null?`directory`:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Ib(e){return e.find(e=>e.path===`SKILL.md`&&e.previewable)?.path||e.find(e=>e.previewable)?.path||e.find(e=>e.kind===`file`)?.path||e[0]?.path||null}function Lb(e,t){return!e||!t?null:`${e}:${t}`}function Rb(e){let t=Zn(),n=y({queryKey:[`skill-invocations`,t.token,e.skillName],queryFn:()=>An(t.token,e.skillName),refetchOnWindowFocus:!1}),r=n.data?.invocations||[];return(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Recent invocations`}),(0,B.jsx)(vo,{children:`Recent user prompts and responses for this skill.`})]}),(0,B.jsx)(K,{children:n.isError?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(n.error)}):n.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading recent invocations...`}):r.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No recent invocations found.`}):(0,B.jsx)(`div`,{className:`skill-invocation-list`,children:r.map(e=>(0,B.jsx)(zb,{invocation:e},`${e.sessionId}-${e.userMessageId}`))})})]})}function zb(e){let t=e.invocation,n=t.response||`No assistant response recorded.`;return(0,B.jsxs)(`details`,{className:`skill-invocation-row`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(`span`,{className:`skill-invocation-summary-main`,children:t.userPrompt}),(0,B.jsxs)(`span`,{className:`skill-invocation-summary-meta`,children:[ao(t.createdAt),t.username?` · ${t.username}`:``,t.skillInput?` · ${t.skillInput}`:``]})]}),(0,B.jsxs)(`div`,{className:`skill-invocation-detail`,children:[(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h4`,{children:`User prompt`}),(0,B.jsx)(`pre`,{children:t.userPrompt})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h4`,{children:`Response`}),(0,B.jsx)(`pre`,{children:n})]})]})]})}function Bb(e){let t=Zn(),n=o(),r=Ss(),[i,a]=(0,R.useState)(null),[s,c]=(0,R.useState)(``),l=(0,R.useRef)(null),u=(0,R.useRef)(``),d=y({queryKey:[`skill-package-files`,t.token,e.skillName],queryFn:()=>kn(t.token,e.skillName),refetchOnWindowFocus:!1}),f=d.data?.files.find(e=>e.path===i)||null,p=Lb(e.skillName,i);(0,R.useEffect)(()=>{d.data&&(d.data.files.some(e=>e.path===i)||a(Ib(d.data.files)))},[d.data,i]);let m=y({queryKey:[`skill-package-file`,t.token,e.skillName,i],queryFn:()=>jn(t.token,{skillName:e.skillName,path:i||``}),enabled:!!(i&&f?.previewable),refetchOnWindowFocus:!1});(0,R.useEffect)(()=>{if(!p){l.current=null,u.current=``,c(``);return}if(!m.data)return;let e=m.data.file.content||``;(l.current!==p||s===u.current)&&(l.current=p,u.current=e,c(e))},[s,m.data,p]);let h=g({mutationFn:async()=>{if(!i)throw Error(`Select a skill file first.`);if(!f?.editable)throw Error(`Select an editable skill file first.`);return Mn(t.token,{skillName:e.skillName,path:i,content:s})},onSuccess:e=>{let i=Lb(e.skillName,e.file.path);n.setQueryData([`skill-package-file`,t.token,e.skillName,e.file.path],e),n.invalidateQueries({queryKey:[`skill-package-files`,t.token,e.skillName]}),l.current=i,u.current=e.file.content||``,c(e.file.content||``),r.success(`Saved ${e.file.path}.`)},onError:e=>{r.error(`Save failed`,H(e))}}),_=s!==u.current,v=m.data?.file,b=d.data?.files||[],x=!!f?.editable&&!!v&&v?.path===f?.path&&v?.content!==null;return(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Package files`}),(0,B.jsx)(vo,{children:d.data?.rootPath||`Loading package directory...`})]}),(0,B.jsx)(K,{children:d.isError?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(d.error)}):d.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading package files...`}):b.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No package files found.`}):(0,B.jsxs)(`div`,{className:`skill-file-browser`,children:[(0,B.jsx)(`div`,{className:`skill-file-list`,children:b.map(e=>(0,B.jsxs)(`button`,{className:`skill-file-row ${e.path===i?`is-selected`:``}`,onClick:()=>a(e.path),type:`button`,children:[(0,B.jsx)(`span`,{className:`skill-file-name`,children:e.path}),(0,B.jsxs)(`span`,{className:`skill-file-meta`,children:[e.kind,` · `,Fb(e.sizeBytes)]})]},e.path))}),(0,B.jsxs)(`div`,{className:`skill-file-editor`,children:[f?(0,B.jsxs)(`div`,{className:`skill-file-editor-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:f.path}),(0,B.jsx)(`span`,{children:f.updatedAt?ao(f.updatedAt):`not modified`})]}),(0,B.jsxs)(`div`,{className:`skill-file-editor-actions`,children:[(0,B.jsx)(Z,{disabled:!x||!_||h.isPending,loading:h.isPending,onClick:()=>h.mutate(),size:`sm`,children:`Save`}),(0,B.jsx)(Z,{disabled:!_||h.isPending,onClick:()=>{c(u.current)},size:`sm`,variant:`outline`,children:`Discard`})]})]}):null,f?f.kind===`file`?f.previewable?m.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading file...`}):m.isError?(0,B.jsx)(`div`,{className:`empty-state error`,children:H(m.error)}):(0,B.jsx)(ts,{"aria-label":`Edit ${f.path}`,className:`code-editor skill-file-textarea`,onChange:e=>c(e.target.value),onInput:e=>c(e.currentTarget.value),readOnly:!x||h.isPending,spellCheck:!1,value:s}):(0,B.jsx)(`div`,{className:`empty-state`,children:`This file is not editable in the admin preview.`}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Directory selected.`}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Select a package file.`})]})]})})]})}function Vb(e){let t=Zn(),n=o(),r=Ss(),[i,a]=(0,R.useState)(`description`),[s,c]=(0,R.useState)(null),[l,u]=(0,R.useState)(null),d=y({queryKey:[`skills`,t.token],queryFn:()=>Tn(t.token)}),f=g({mutationFn:e=>qn(t.token,e),onSuccess:e=>{n.setQueryData([`skills`,t.token],e)},onError:e=>{r.error(`Toggle failed`,H(e))}}),p=d.data?.skills.find(t=>t.name===e.skillName),m=y({queryKey:[`admin`,`secrets`,t.token],queryFn:()=>Kt(t.token),retry:!1,enabled:(p?.credentials.length??0)>0}),h=(0,R.useMemo)(()=>new Map((m.data?.secrets||[]).map(e=>[e.name,e])),[m.data?.secrets]),_=m.data?.actions.includes(`secret.overwrite`)??!1,v=m.data?.actions.includes(`secret.unset`)??!1,b=(0,R.useCallback)(()=>n.invalidateQueries({queryKey:[`admin`,`secrets`]}),[n]),x=g({mutationFn:e=>qt(t.token,e.name,e.value),onSuccess:async(e,t)=>{r.success(`Set ${t.name}.`),c(null),await b()},onError:e=>{r.error(`Secret save failed`,H(e))}}),S=g({mutationFn:e=>Jt(t.token,e),onSuccess:async(e,t)=>{r.success(`Deleted ${t}.`),u(null),await b()},onError:e=>{r.error(`Secret delete failed`,H(e))}});if(d.isLoading)return(0,B.jsx)(`div`,{className:`page-stack`,children:(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading skill...`})});if(d.isError)return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Z,{variant:`ghost`,render:(0,B.jsx)(D,{to:`/admin/skills`,children:`Back to skills`})}),(0,B.jsx)(U,{children:(0,B.jsx)(K,{children:(0,B.jsx)(`div`,{className:`empty-state error`,children:H(d.error)})})})]});if(!p)return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Z,{variant:`ghost`,render:(0,B.jsx)(D,{to:`/admin/skills`,children:`Back to skills`})}),(0,B.jsx)(U,{children:(0,B.jsx)(K,{children:(0,B.jsx)(`div`,{className:`empty-state`,children:`Skill not found.`})})})]});let C=[...(p.capabilities||[]).map(e=>`capability: ${e}`),...(p.requires?.bins||[]).map(e=>`bin: ${e}`)],w=p.requires?.env||[],T=p.install||[],E=p.docs?.examplePrompts||[],O=p.docs?.screenshots||[],k=p.docs?.sourceHref;return(0,B.jsxs)(`div`,{className:`page-stack skill-detail-page`,children:[(0,B.jsx)(`div`,{className:`skill-detail-back-row`,children:(0,B.jsx)(Z,{variant:`ghost`,render:(0,B.jsx)(D,{to:`/admin/skills`,children:`Back to skills`})})}),(0,B.jsxs)(`section`,{className:`skill-detail-hero`,children:[(0,B.jsx)(`div`,{className:`skill-detail-icon`,"aria-hidden":p.logoUrl?void 0:!0,children:p.logoUrl?(0,B.jsx)(`img`,{src:p.logoUrl,alt:`${p.name} logo`}):p.name.slice(0,1).toUpperCase()}),(0,B.jsxs)(`div`,{className:`skill-detail-title`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{children:p.name}),(0,B.jsx)(`p`,{children:p.shortDescription||p.description})]}),(0,B.jsxs)(`div`,{className:`skill-detail-status-row`,children:[p.blocked?null:(0,B.jsxs)(`label`,{className:`skill-detail-enable-control`,children:[(0,B.jsx)(Vc,{checked:p.enabled,"aria-label":`${p.enabled?`Disable`:`Enable`} ${p.name}`,disabled:f.isPending||!p.available&&!p.enabled,onCheckedChange:e=>{e&&!p.available||f.mutate({name:p.name,enabled:e})}}),(0,B.jsx)(`span`,{children:f.isPending?`Saving...`:p.enabled?`Enabled`:`Enable`})]}),(0,B.jsx)(`span`,{className:`status-pill`,children:p.category}),(0,B.jsx)(`span`,{className:`status-pill`,children:p.source})]}),!p.blocked&&!p.available?(0,B.jsx)(`p`,{className:`skill-detail-status-note`,children:p.missing.join(`, `)||`missing requirements`}):null]})]}),(0,B.jsxs)(`div`,{className:`skill-detail-summary-grid`,children:[(0,B.jsxs)(`div`,{className:`skill-detail-summary-item`,children:[(0,B.jsx)(`span`,{children:`Developer`}),(0,B.jsx)(`strong`,{children:p.developer})]}),(0,B.jsxs)(`div`,{className:`skill-detail-summary-item`,children:[(0,B.jsx)(`span`,{children:`Tools`}),(0,B.jsx)(`strong`,{children:C.length})]}),(0,B.jsxs)(`div`,{className:`skill-detail-summary-item`,children:[(0,B.jsx)(`span`,{children:`Prompts`}),(0,B.jsx)(`strong`,{children:Sb(p)})]}),(0,B.jsxs)(`div`,{className:`skill-detail-summary-item`,children:[(0,B.jsx)(`span`,{children:`Dependencies`}),(0,B.jsx)(`strong`,{children:T.length})]})]}),(0,B.jsx)(Pb,{screenshots:O}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Overview`}),(0,B.jsx)(vo,{children:p.description})]}),(0,B.jsxs)(K,{children:[(0,B.jsx)(Za,{ariaLabel:`Skill detail tabs`,value:i,size:`sm`,options:[{value:`description`,label:`Description`,activeTone:`is-on`},{value:`tutorial`,label:`Tutorial`,activeTone:`is-on`},{value:`prompts`,label:`Prompts`,activeTone:`is-on`}],onChange:a}),i===`description`?(0,B.jsxs)(`div`,{className:`skill-description-panel`,children:[(0,B.jsx)(`p`,{children:p.description}),p.relatedSkills.length>0?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h4`,{children:`Related skills`}),(0,B.jsx)(Mb,{values:p.relatedSkills,empty:``})]}):null,p.tags.length>0?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h4`,{children:`Tags`}),(0,B.jsx)(Mb,{values:p.tags,empty:``})]}):null]}):i===`tutorial`?(0,B.jsxs)(`div`,{className:`skill-tutorial-panel`,children:[k?(0,B.jsx)(`a`,{className:`skill-doc-source-link`,href:k,children:p.docs?.sourcePath}):null,(0,B.jsx)(Nb,{markdown:p.docs?.tutorialMarkdown||``})]}):(0,B.jsx)(`div`,{className:`skill-prompt-list`,children:E.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No example prompts documented.`}):E.map(e=>(0,B.jsxs)(`div`,{className:`skill-prompt-row`,children:[(0,B.jsx)(Z,{"aria-label":`Try it: ${Ab(p.name,e.prompt)}`,render:(0,B.jsx)(`a`,{href:jb(p.name,e.prompt),rel:`noreferrer`,target:`_blank`,children:`Try it`}),size:`sm`}),(0,B.jsx)(`code`,{children:e.prompt})]},`${e.kind}-${e.conversationId??`single`}-${e.turnIndex??e.prompt}`))})]})]}),(0,B.jsx)(Rb,{skillName:p.name}),p.available&&!p.blocked?(0,B.jsx)(Bb,{skillName:p.name}):null,(0,B.jsxs)(`div`,{className:`two-column-grid skill-detail-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Tools`}),(0,B.jsx)(vo,{children:`Declared capabilities and required runtime binaries.`})]}),(0,B.jsx)(K,{children:(0,B.jsx)(Mb,{values:C,empty:`No explicit capabilities or binaries declared.`})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Dependencies`}),(0,B.jsx)(vo,{children:`Install metadata and required environment.`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`div`,{className:`detail-stack`,children:[T.length>0?(0,B.jsx)(`div`,{className:`skill-detail-list`,children:T.map((e,t)=>(0,B.jsxs)(`div`,{className:`skill-detail-list-row`,children:[(0,B.jsx)(`strong`,{children:Cb(e)}),e.bins?.length?(0,B.jsxs)(`small`,{children:[`bins: `,e.bins.join(`, `)]}):null]},e.id||t))}):(0,B.jsx)(`p`,{className:`supporting-text`,children:`No install dependencies declared.`}),(0,B.jsx)(Mb,{values:w.map(e=>`env: ${e}`),empty:`No required environment variables declared.`})]})})]})]}),(0,B.jsxs)(`div`,{className:`two-column-grid skill-detail-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Credentials`})}),(0,B.jsx)(K,{children:p.credentials.length===0?(0,B.jsx)(`p`,{className:`supporting-text`,children:`No credentials declared.`}):(0,B.jsxs)(B.Fragment,{children:[m.isLoading?(0,B.jsx)(`p`,{className:`supporting-text`,children:`Checking runtime secret store...`}):null,m.isError?(0,B.jsxs)(`p`,{className:`supporting-text error-text`,children:[`Secret metadata unavailable:`,` `,H(m.error)]}):null,(0,B.jsx)(`div`,{className:`skill-credential-list`,children:p.credentials.map(e=>{let t=e.secretRef.id,n=e.secretRef.source===`store`,r=h.get(t)||Ob(t),i=n?m.isLoading?`checking`:m.isError?`unknown`:r.state===`set`?`set`:`missing`:`external`,a=n&&_&&i!==`checking`&&i!==`unknown`,o=n&&v&&i===`set`;return(0,B.jsxs)(`div`,{className:`skill-credential-row`,children:[(0,B.jsxs)(`div`,{className:`skill-credential-body`,children:[(0,B.jsx)(`strong`,{children:wb(e)}),(0,B.jsx)(`small`,{children:t}),e.scope?(0,B.jsx)(`small`,{children:e.scope}):null,i===`set`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`small`,{children:[Tb(r),` · rotated`,` `,Db(r)]}),(0,B.jsx)(`code`,{className:`skill-credential-fingerprint`,children:Eb(r)})]}):i===`missing`?(0,B.jsx)(`small`,{children:`Missing from the runtime secret store.`}):i===`checking`?(0,B.jsx)(`small`,{children:`Checking the runtime secret store.`}):i===`external`?(0,B.jsxs)(`small`,{children:[`Secret source: `,e.secretRef.source]}):(0,B.jsx)(`small`,{children:`Stored status could not be checked.`})]}),(0,B.jsxs)(`div`,{className:`skill-credential-actions`,children:[i===`set`?(0,B.jsxs)(`span`,{className:`boolean-pill is-on skill-credential-set-pill`,children:[(0,B.jsx)(ar,{className:`skill-credential-set-icon`}),`set`]}):i===`missing`?(0,B.jsx)(Qa,{value:!1,trueLabel:`set`,falseLabel:`missing`,falseTone:`danger`}):(0,B.jsx)(`span`,{className:`status-pill`,children:i}),a?(0,B.jsx)(Z,{"aria-label":`Set ${t}`,onClick:()=>c({name:t}),size:`sm`,variant:`outline`,children:`Set`}):null,o?(0,B.jsx)(Z,{"aria-label":`Delete ${t}`,onClick:()=>u(t),size:`sm`,variant:`danger`,children:`Delete`}):null]})]},e.id)})})]})})]}),(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Configuration`})}),(0,B.jsx)(K,{children:p.configVariables.length===0?(0,B.jsx)(`p`,{className:`supporting-text`,children:`No config variables declared.`}):(0,B.jsx)(`div`,{className:`skill-detail-list`,children:p.configVariables.map(e=>(0,B.jsxs)(`div`,{className:`skill-detail-list-row`,children:[(0,B.jsx)(`strong`,{children:kb(e)}),e.scope?(0,B.jsx)(`small`,{children:e.scope}):null]},e.id))})})]})]}),p.blocked?(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Guard findings`}),(0,B.jsx)(vo,{children:p.blockedReason})]}),(0,B.jsx)(K,{children:(0,B.jsx)(`div`,{className:`skill-detail-list`,children:(p.guardFindings||[]).map(e=>(0,B.jsxs)(`div`,{className:`skill-detail-list-row`,children:[(0,B.jsxs)(`strong`,{children:[e.severity,`/`,e.category]}),(0,B.jsxs)(`small`,{children:[e.file,`:`,e.line]}),(0,B.jsx)(`small`,{children:e.description})]},`${e.patternId}-${e.file}-${e.line}`))})})]}):null,(0,B.jsx)(Hb,{name:s?.name??null,onClose:()=>c(null),onSubmit:e=>{s&&x.mutate({name:s.name,value:e})},pending:x.isPending}),(0,B.jsx)(Ub,{name:l,onClose:()=>u(null),onConfirm:()=>{l&&S.mutate(l)},pending:S.isPending})]})}function Hb(e){let t=(0,R.useRef)(null),n=(0,R.useId)(),r=(0,R.useId)(),i=e.name!==null;return(0,B.jsx)(ui,{open:i,onOpenChange:n=>{n||(t.current&&(t.current.value=``),e.onClose())},children:(0,B.jsxs)(di,{role:`dialog`,size:`default`,preventCloseOnOutsideClick:e.pending,children:[(0,B.jsxs)(fi,{children:[(0,B.jsxs)(pi,{children:[`Set value for `,(0,B.jsx)(`code`,{children:e.name})]}),(0,B.jsx)(mi,{children:`The value is sent to the gateway and immediately discarded from this form. The stored value cannot be read back.`})]}),(0,B.jsxs)(`form`,{className:`skill-secret-dialog-form`,onSubmit:n=>{n.preventDefault();let r=t.current?.value||``;r.trim()&&e.onSubmit(r)},children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{htmlFor:n,children:`New value`}),(0,B.jsx)(Y,{id:n,ref:t,type:`password`,autoComplete:`new-password`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,required:!0,"aria-describedby":r,disabled:e.pending}),(0,B.jsx)(`p`,{id:r,className:`skill-secret-dialog-note`,children:`Pasted values are not echoed. Once submitted, the value lives only in the runtime secret store.`})]}),(0,B.jsxs)(hi,{children:[(0,B.jsx)(gi,{className:`ghost-button`,disabled:e.pending,children:`Cancel`}),(0,B.jsx)(Z,{type:`submit`,disabled:e.pending,children:e.pending?`Saving...`:`Save value`})]})]})]})})}function Ub(e){return(0,B.jsx)(ui,{open:e.name!==null,onOpenChange:t=>{t||e.onClose()},children:(0,B.jsxs)(di,{role:`alertdialog`,size:`default`,preventCloseOnOutsideClick:e.pending,children:[(0,B.jsxs)(fi,{children:[(0,B.jsxs)(pi,{children:[`Delete `,(0,B.jsx)(`code`,{children:e.name}),`?`]}),(0,B.jsx)(mi,{children:`The stored value will be removed from the runtime secret store. Skills that depend on this secret will fail until a new value is set.`})]}),(0,B.jsxs)(hi,{children:[(0,B.jsx)(gi,{className:`ghost-button`,disabled:e.pending,children:`Cancel`}),(0,B.jsx)(Z,{type:`button`,variant:`danger`,disabled:e.pending,onClick:e.onConfirm,children:e.pending?`Deleting...`:`Delete secret`})]})]})})}function Wb(){return(0,B.jsx)(Vb,{skillName:xb(O({strict:!1}).skillName)})}var Gb=[`agents`,`apple`,`business`,`communication`,`development`,`memory`,`misc`,`office`,`productivity`,`publishing`,`security`,`uncategorized`];function Kb(e){return e.positive_feedback_count===0&&e.negative_feedback_count===0?null:`👍 ${e.positive_feedback_count} · 👎 ${e.negative_feedback_count}`}function qb(e,t=120){let n=e.trim().replace(/\s+/g,` `);if(n.length<=t)return n;let r=n.slice(0,t-1),i=r.lastIndexOf(` `);return`${(i>=Math.floor(t*.6)?r.slice(0,i):r).trimEnd()}…`}function Jb(e){return`${e.status} · v${e.version}`}function Yb(e){return io(e.applied_at||e.rejected_at||e.rolled_back_at||e.updated_at||e.created_at)}function Xb(e){return e?+!!e.degraded:2}var Zb={skill:(e,t)=>X(e.skill.name,t.skill.name),category:(e,t)=>X(e.skill.category,t.skill.category)||X(e.skill.name,t.skill.name),source:(e,t)=>X(e.skill.source,t.skill.source)||X(e.skill.name,t.skill.name),health:(e,t)=>os(Xb(e.metrics),Xb(t.metrics))||os(e.metrics?.total_executions,t.metrics?.total_executions)||X(e.skill.name,t.skill.name),tags:(e,t)=>X(e.skill.tags.join(`, `),t.skill.tags.join(`, `))||X(e.skill.name,t.skill.name),action:(e,t)=>ss(e.skill.enabled,t.skill.enabled)||X(e.skill.name,t.skill.name)},Qb={action:`desc`};function $b(e){return e.positive_feedback_count+e.negative_feedback_count}function ex(e,t){return e.total_executions>0?t/e.total_executions:0}function tx(e,t){return`${no(ex(e,t))} (${t})`}function nx(e){return`${no(e.tool_breakage_rate)} (${e.tool_calls_failed}/${e.tool_calls_attempted})`}var rx={skill:(e,t)=>X(e.skill_name,t.skill_name),status:(e,t)=>ss(!e.degraded,!t.degraded)||X(e.skill_name,t.skill_name),executions:(e,t)=>os(e.total_executions,t.total_executions)||X(e.skill_name,t.skill_name),success:(e,t)=>os(e.success_rate,t.success_rate)||X(e.skill_name,t.skill_name),partial:(e,t)=>os(ex(e,e.partial_count),ex(t,t.partial_count))||X(e.skill_name,t.skill_name),failure:(e,t)=>os(ex(e,e.failure_count),ex(t,t.failure_count))||X(e.skill_name,t.skill_name),toolBreakage:(e,t)=>os(e.tool_breakage_rate,t.tool_breakage_rate)||X(e.skill_name,t.skill_name),feedback:(e,t)=>os($b(e),$b(t))||X(e.skill_name,t.skill_name),reasons:(e,t)=>X(e.degradation_reasons.join(`; `),t.degradation_reasons.join(`; `))||X(e.skill_name,t.skill_name)},ix={status:`desc`,executions:`desc`,success:`desc`,partial:`desc`,failure:`desc`,toolBreakage:`desc`,feedback:`desc`},ax=1;function ox(){return{name:``,description:``,category:``,shortDescription:``,userInvocable:!0,disableModelInvocation:!1,tags:``,body:``,files:[]}}function sx(){let e=Zn(),t=o(),n=Ss(),[r,i]=(0,R.useState)(``),[a,s]=(0,R.useState)(!1),[c,l]=(0,R.useState)(``),[u,d]=(0,R.useState)(!1),[f,p]=(0,R.useState)(`form`),[m,h]=(0,R.useState)(ox()),[_,v]=(0,R.useState)(null),[b,x]=(0,R.useState)(!1),S=(0,R.useDeferredValue)(r).trim().toLowerCase(),C=y({queryKey:[`skills`,e.token],queryFn:()=>Tn(e.token)}),w=y({queryKey:[`adaptive-skills-health`,e.token],queryFn:()=>Ln(e.token)}),T=y({queryKey:[`adaptive-skills-amendments`,e.token],queryFn:()=>Hn(e.token)}),E=g({mutationFn:t=>qn(e.token,t),onSuccess:n=>{t.setQueryData([`skills`,e.token],n)},onError:e=>{n.error(`Toggle failed`,H(e))}}),O=g({mutationFn:t=>On(e.token,t),onSuccess:r=>{t.setQueryData([`skills`,e.token],r),n.success(`Skill unblocked`,`Scanner bypass marker was recorded for this skill.`)},onError:e=>{n.error(`Unblock failed`,H(e))}}),k=g({mutationFn:async t=>t.action===`apply`?Wn(e.token,t.skillName):Gn(e.token,t.skillName),onSuccess:async(n,r)=>{await Promise.all([t.invalidateQueries({queryKey:[`adaptive-skills-health`,e.token]}),t.invalidateQueries({queryKey:[`adaptive-skills-amendments`,e.token]}),t.invalidateQueries({queryKey:[`adaptive-skills-history`,e.token,r.skillName]})])},onError:e=>{n.error(`Review failed`,H(e))}}),A=g({mutationFn:()=>{let t=m.tags.split(`,`).map(e=>e.trim()).filter(Boolean),n=m.files.filter(e=>e.path.trim()).map(e=>({path:e.path.trim(),content:e.content}));return En(e.token,{name:m.name.trim(),description:m.description.trim(),category:m.category.trim(),shortDescription:m.shortDescription.trim()||void 0,userInvocable:m.userInvocable,disableModelInvocation:m.disableModelInvocation,tags:t.length>0?t:void 0,body:m.body.trim(),files:n.length>0?n:void 0})},onSuccess:n=>{t.setQueryData([`skills`,e.token],n),d(!1),h(ox())},onError:e=>{n.error(`Create failed`,H(e))}}),j=g({mutationFn:()=>{if(!_)throw Error(`No file selected.`);return Dn(e.token,_,{force:b})},onSuccess:n=>{t.setQueryData([`skills`,e.token],n),d(!1),v(null),x(!1)},onError:e=>{n.error(`Upload failed`,H(e))}}),M=w.data?.metrics||[],N=T.data?.amendments||[],P=Array.from(new Set([...Gb,...(C.data?.skills||[]).map(e=>e.category)])).sort((e,t)=>e.localeCompare(t)),F=new Set([...(C.data?.skills||[]).map(e=>e.name),...M.map(e=>e.skill_name),...N.map(e=>e.skill_name)]),I=c&&F.has(c)?c:N[0]?.skill_name||M[0]?.skill_name||C.data?.skills[0]?.name||``,ee=y({queryKey:[`adaptive-skills-history`,e.token,I],queryFn:()=>Un(e.token,I),enabled:!!I}),L=(C.data?.skills||[]).filter(e=>a&&!e.enabled?!1:[e.name,e.category,e.description,e.shortDescription||``,e.source,e.blocked?`blocked`:``,e.blockedReason||``,...e.tags||[],...e.relatedSkills||[]].join(` `).toLowerCase().includes(S)),te=M.filter(e=>[e.skill_name,...e.degradation_reasons,...e.error_clusters.map(e=>e.category)].join(` `).toLowerCase().includes(S)),{sortedRows:ne,sortState:re,toggleSort:ie}=qa(L.map(e=>({skill:e,metrics:M.find(t=>t.skill_name===e.name)||null})),{initialSort:{key:`skill`,direction:`asc`},sorters:Zb,defaultDirections:Qb}),{sortedRows:ae,sortState:oe,toggleSort:se}=qa(te,{initialSort:{key:`skill`,direction:`asc`},sorters:rx,defaultDirections:ix}),ce=M.filter(e=>e.degraded).length,le=C.data?.skills.filter(e=>e.blocked).length||0,ue=ee.data?.amendments||[];return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{description:`Browse installed skills, review health, and manage amendments.`,actions:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Y,{className:`compact-search skills-header-search`,value:r,onChange:e=>i(e.target.value),placeholder:`Filter skills`}),(0,B.jsx)(Z,{className:`skills-header-button`,variant:`ghost`,type:`button`,onClick:()=>{d(!u),h(ox()),v(null),x(!1),p(`form`),A.reset(),j.reset()},children:u?`Cancel`:`New`})]})}),u?(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Create skill`})}),(0,B.jsxs)(K,{children:[(0,B.jsx)(Za,{ariaLabel:`Create mode`,value:f,options:[{value:`form`,label:`Form`,activeTone:`is-on`},{value:`zip`,label:`Upload ZIP`,activeTone:`is-on`}],onChange:e=>p(e)}),f===`zip`?(0,B.jsxs)(`div`,{className:`stack-form`,style:{marginTop:`1rem`},children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Skill archive (.zip)`}),(0,B.jsx)(Y,{type:`file`,accept:`.zip,.skill`,onChange:e=>v(e.target.files?.[0]||null)})]}),(0,B.jsxs)(`p`,{className:`supporting-text`,children:[`ZIP must contain a SKILL.md with a valid `,(0,B.jsx)(`code`,{children:`name`}),` `,`frontmatter field. May include scripts/, references/, and other files.`]}),(0,B.jsxs)(`label`,{className:`supporting-text`,style:{display:`inline-flex`,alignItems:`center`,gap:`0.4rem`,cursor:`pointer`,width:`fit-content`},children:[(0,B.jsx)(hf,{checked:b,onCheckedChange:x}),(0,B.jsx)(`span`,{children:`Overwrite existing skill (--force)`})]}),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{type:`button`,loading:j.isPending,disabled:j.isPending||!_,onClick:()=>j.mutate(),children:j.isPending?`Uploading...`:`Upload skill`})})]}):(0,B.jsxs)(`div`,{className:`stack-form`,style:{marginTop:`1rem`},children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Name`}),(0,B.jsx)(Y,{value:m.name,onChange:e=>h(t=>({...t,name:e.target.value})),placeholder:`my-skill`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Category`}),(0,B.jsxs)(vs,{value:m.category,onChange:e=>h(t=>({...t,category:e.target.value})),children:[(0,B.jsx)(Q,{value:``,children:`Select category`}),P.map(e=>(0,B.jsx)(Q,{value:e,children:e},e))]})]})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Short description`}),(0,B.jsx)(Y,{value:m.shortDescription,onChange:e=>h(t=>({...t,shortDescription:e.target.value})),placeholder:`One-line summary used in metadata`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Tags`}),(0,B.jsx)(Y,{value:m.tags,onChange:e=>h(t=>({...t,tags:e.target.value})),placeholder:`tag1, tag2`})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Description`}),(0,B.jsx)(Y,{value:m.description,onChange:e=>h(t=>({...t,description:e.target.value})),placeholder:`Short description of what this skill does`})]}),(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:m.userInvocable,onCheckedChange:e=>h(t=>({...t,userInvocable:e}))}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`User invocable`})})]}),(0,B.jsxs)(q,{orientation:`horizontal`,children:[(0,B.jsx)(Vc,{checked:!m.disableModelInvocation,onCheckedChange:e=>h(t=>({...t,disableModelInvocation:!e}))}),(0,B.jsx)(qo,{children:(0,B.jsx)(J,{children:`Model invocable`})})]})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Skill body (Markdown)`}),(0,B.jsx)(ts,{rows:10,value:m.body,onChange:e=>h(t=>({...t,body:e.target.value})),placeholder:`# My Skill
166
166
 
167
167
  Use this skill when the user asks to ...
168
168
 
169
169
  ## Workflow
170
170
 
171
171
  1. ...
172
- 2. ...`})]}),(0,B.jsxs)(`div`,{className:`panel-header`,style:{marginTop:`0.5rem`},children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h4`,{children:`Files`}),(0,B.jsx)(`p`,{className:`supporting-text`,children:`Add scripts or references (e.g. scripts/run.mjs, references/guide.md)`})]}),(0,B.jsx)(Z,{variant:`ghost`,type:`button`,onClick:()=>h(e=>({...e,files:[...e.files,{id:Qb++,path:`scripts/new-file.mjs`,content:``}]})),children:`Add file`})]}),m.files.map((e,t)=>(0,B.jsxs)(`div`,{className:`stack-form`,style:{gap:`0.25rem`},children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Path`}),(0,B.jsx)(Y,{value:e.path,onChange:e=>h(n=>{let r=[...n.files];return r[t]={...r[t],path:e.target.value},{...n,files:r}}),placeholder:`scripts/my-tool.mjs`})]}),(0,B.jsx)(Z,{variant:`danger`,type:`button`,style:{alignSelf:`end`},onClick:()=>h(e=>({...e,files:e.files.filter((e,n)=>n!==t)})),children:`Remove`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Content`}),(0,B.jsx)(Jo,{rows:8,value:e.content,onChange:e=>h(n=>{let r=[...n.files];return r[t]={...r[t],content:e.target.value},{...n,files:r}}),placeholder:`// Script content...`,style:{fontFamily:`monospace`,fontSize:`0.85rem`}})]})]},e.id)),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{type:`button`,loading:A.isPending,disabled:A.isPending||!m.name.trim()||!m.description.trim()||!m.category.trim(),onClick:()=>A.mutate(),children:A.isPending?`Creating...`:`Create skill`})})]})]})]}):null,(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Ua,{label:`Installed skills`,value:String(C.data?.skills.length??0),detail:`${C.data?.disabled.length??0} disabled${le>0?` · ${le} blocked`:``}`,loading:!C.data}),(0,B.jsx)(Ua,{label:`Observed skills`,value:String(M.length),detail:`from AdaptiveSkills observations`,href:`#observed-skill-health`}),(0,B.jsx)(Ua,{label:`Degraded skills`,value:String(ce),detail:`current inspection window`}),(0,B.jsx)(Ua,{label:`Staged amendments`,value:String(N.length),detail:`awaiting human review`,href:`#staged-amendments`})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Installed skills`}),(0,B.jsx)(uo,{children:`${ne.length} skill${ne.length===1?``:`s`} visible`}),(0,B.jsx)(fo,{children:(0,B.jsxs)(`label`,{className:`skills-enabled-filter`,children:[(0,B.jsx)(Pc,{checked:a,"aria-label":`Show enabled skills only`,size:`sm`,onCheckedChange:s}),(0,B.jsx)(`span`,{children:`Enabled only`})]})})]}),(0,B.jsx)(K,{children:C.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading skill catalog...`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Va,{label:`Skill`,sortKey:`skill`,sortState:re,onToggle:ie}),(0,B.jsx)(Va,{label:`Category`,sortKey:`category`,sortState:re,onToggle:ie}),(0,B.jsx)(Va,{label:`Source`,sortKey:`source`,sortState:re,onToggle:ie}),(0,B.jsx)(Va,{label:`Health`,sortKey:`health`,sortState:re,onToggle:ie}),(0,B.jsx)(Va,{label:`Tags`,sortKey:`tags`,sortState:re,onToggle:ie}),(0,B.jsx)(Va,{label:`Action`,sortKey:`action`,sortState:re,onToggle:ie})]})}),(0,B.jsxs)(`tbody`,{children:[ne.map(({skill:e,metrics:t})=>{let n=t?zb(t):null,r=e.shortDescription?.trim()||Bb(e.description),i=e.guardFindings?.[0],a=O.isPending&&O.variables===e.name;return(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(D,{className:`table-link-button`,to:pb(e.name),children:e.name}),(0,B.jsx)(`small`,{children:r}),e.blocked&&i?(0,B.jsxs)(`small`,{className:`row-status-note-danger`,children:[i.severity,`/`,i.category,`:`,` `,i.description]}):null]}),(0,B.jsx)(`td`,{children:e.category}),(0,B.jsx)(`td`,{children:e.source}),(0,B.jsx)(`td`,{children:t?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ga,{value:!t.degraded,trueLabel:`healthy`,falseLabel:`degraded`,falseTone:`danger`}),(0,B.jsxs)(`small`,{children:[t.total_executions,` runs`,t.degraded||!n?``:` · `,t.degraded?`${Ya(t.success_rate)} full success`:n]})]}):null}),(0,B.jsx)(`td`,{children:e.tags.join(`, `)||`none`}),(0,B.jsx)(`td`,{children:(0,B.jsx)(`div`,{className:`row-status-stack`,children:e.blocked?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`skill-blocked-badge`,role:`status`,"aria-label":`${e.name} is blocked`,title:e.blockedReason||`guarded`,children:`blocked`}),(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:e.blockedReason||`guarded`}),(0,B.jsx)(`button`,{type:`button`,className:`skill-unblock-button`,disabled:O.isPending,onClick:()=>O.mutate(e.name),children:a?`Unblocking...`:`Unblock`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Pc,{checked:e.enabled,"aria-label":`${e.name} status`,disabled:E.isPending||!e.available&&!e.enabled,onCheckedChange:t=>{t&&!e.available||E.mutate({name:e.name,enabled:t})}}),e.available?null:(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:e.missing.join(`, `)||`missing requirements`})]})})})]},e.name)}),ne.length===0?(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{colSpan:6,children:(0,B.jsx)(`div`,{className:`empty-state`,children:`No skills match this filter.`})})}):null]})]})})})]}),(0,B.jsxs)(U,{id:`observed-skill-health`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Observed skill health`})}),(0,B.jsx)(K,{children:w.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading AdaptiveSkills health...`}):ae.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No observed skills match this filter.`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Va,{label:`Skill`,sortKey:`skill`,sortState:oe,onToggle:se}),(0,B.jsx)(Va,{label:`Status`,sortKey:`status`,sortState:oe,onToggle:se}),(0,B.jsx)(Va,{label:`Executions`,sortKey:`executions`,sortState:oe,onToggle:se}),(0,B.jsx)(Va,{label:`Full success`,sortKey:`success`,sortState:oe,onToggle:se}),(0,B.jsx)(Va,{label:`Partial success`,sortKey:`partial`,sortState:oe,onToggle:se}),(0,B.jsx)(Va,{label:`Failure`,sortKey:`failure`,sortState:oe,onToggle:se}),(0,B.jsx)(Va,{label:`Tool breakage`,sortKey:`toolBreakage`,sortState:oe,onToggle:se}),(0,B.jsx)(Va,{label:`Feedback`,sortKey:`feedback`,sortState:oe,onToggle:se}),(0,B.jsx)(Va,{label:`Reasons`,sortKey:`reasons`,sortState:oe,onToggle:se})]})}),(0,B.jsx)(`tbody`,{children:ae.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(D,{className:`table-link-button`,to:pb(e.skill_name),children:e.skill_name}),(0,B.jsxs)(`small`,{children:[`Window ending`,` `,Qa(e.window_ended_at)]})]}),(0,B.jsx)(`td`,{children:(0,B.jsx)(Ga,{value:!e.degraded,trueLabel:`healthy`,falseLabel:`degraded`,falseTone:`danger`})}),(0,B.jsx)(`td`,{children:e.total_executions}),(0,B.jsx)(`td`,{children:Jb(e,e.success_count)}),(0,B.jsx)(`td`,{children:Jb(e,e.partial_count)}),(0,B.jsx)(`td`,{children:Jb(e,e.failure_count)}),(0,B.jsx)(`td`,{children:Yb(e)}),(0,B.jsx)(`td`,{children:zb(e)||null}),(0,B.jsx)(`td`,{children:(0,B.jsx)(`small`,{children:e.degradation_reasons.join(`; `)||`healthy`})})]},e.skill_name))})]})})})]}),(0,B.jsxs)(`div`,{className:`two-column-grid skills-review-grid`,children:[(0,B.jsxs)(U,{id:`staged-amendments`,variant:`muted`,children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Staged amendments`}),(0,B.jsx)(uo,{children:`${N.length} waiting for review`})]}),(0,B.jsx)(K,{children:T.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading staged amendments...`}):N.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No staged amendments are waiting for review.`}):(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:N.map(e=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(D,{className:`table-link-button`,to:pb(e.skill_name),children:e.skill_name}),(0,B.jsxs)(`small`,{children:[Vb(e),` ·`,` `,Hb(e),` · guard`,` `,e.guard_verdict,`/`,e.guard_findings_count]}),(0,B.jsx)(`small`,{children:e.rationale||e.diff_summary})]}),(0,B.jsxs)(`div`,{className:`skill-review-actions`,children:[(0,B.jsx)(Z,{type:`button`,variant:`ghost`,onClick:()=>l(e.skill_name),children:`History`}),(0,B.jsx)(Z,{type:`button`,loading:k.isPending,disabled:k.isPending,onClick:()=>k.mutate({action:`apply`,skillName:e.skill_name}),children:`Apply`}),(0,B.jsx)(Z,{type:`button`,variant:`danger`,loading:k.isPending,disabled:k.isPending,onClick:()=>k.mutate({action:`reject`,skillName:e.skill_name}),children:`Reject`})]})]},e.id))})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:I?`Amendment history: ${I}`:`Amendment history`}),(0,B.jsx)(uo,{children:`Full review trail for the selected skill`})]}),(0,B.jsx)(K,{children:I?ee.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading amendment history...`}):ue.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No amendment history exists for this skill yet.`}):(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:ue.map(e=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`strong`,{children:[Vb(e),` ·`,` `,Hb(e)]}),(0,B.jsxs)(`small`,{children:[`Guard `,e.guard_verdict,`/`,e.guard_findings_count,` · runs since apply`,` `,e.runs_since_apply]}),(0,B.jsx)(`small`,{children:e.rationale||`No rationale recorded.`}),(0,B.jsx)(`small`,{children:e.diff_summary||`No diff summary recorded.`})]}),(0,B.jsx)(`span`,{className:e.status===`applied`?`list-status list-status-success`:e.status===`rejected`?`list-status list-status-danger`:`list-status`,children:e.status})]},e.id))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Select a skill to inspect its amendment history.`})})]})]})]})}var tx=[{value:7,label:`Last 7 days`},{value:14,label:`Last 14 days`},{value:30,label:`Last 30 days`},{value:60,label:`Last 60 days`},{value:90,label:`Last 90 days`}];function nx(){let e=Gn(),[t,n]=(0,R.useState)(30),r=y({queryKey:[`statistics`,e.token,t],queryFn:()=>Re(e.token,t),refetchInterval:6e4}),i=r.data,a=i?.trend??[],o=i?.channels??[],s=i?.totals,c=(0,B.jsxs)(`label`,{className:`header-actions`,children:[(0,B.jsx)(`span`,{className:`supporting-text`,style:{marginRight:8},children:`Range`}),(0,B.jsx)(`select`,{value:t,onChange:e=>n(Number.parseInt(e.target.value,10)),children:tx.map(e=>(0,B.jsx)(`option`,{value:e.value,children:e.label},e.value))})]});if(r.isLoading&&!i)return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{actions:c}),(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading statistics…`})]});if(r.isError&&!i)return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{actions:c}),(0,B.jsx)(`div`,{className:`empty-state error`,children:H(r.error)})]});if(!i||!s)return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{actions:c}),(0,B.jsx)(`div`,{className:`empty-state`,children:`No statistics available.`})]});let l=`${i.startDate} → ${i.endDate}`;return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{description:`Activity across the last ${eo(i.rangeDays,`day`)} (${l}).`,actions:c}),(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Ua,{label:`Active sessions`,value:Ka(s.activeSessions),detail:`${s.newSessions} new in range`}),(0,B.jsx)(Ua,{label:`Messages`,value:Ka(s.totalMessages),detail:`${Ka(s.userMessages)} user / ${Ka(s.assistantMessages)} assistant`}),(0,B.jsx)(Ua,{label:`Tokens`,value:Ka(s.totalTokens),detail:Ja({inputTokens:s.totalInputTokens,outputTokens:s.totalOutputTokens})}),(0,B.jsx)(Ua,{label:`Cost`,value:Xa(s.totalCostUsd),detail:`${eo(s.callCount,`call`)} · ${eo(s.totalToolCalls,`tool call`)}`})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Message trend`}),(0,B.jsx)(uo,{children:`User vs assistant messages per day`})]}),(0,B.jsx)(K,{children:(0,B.jsx)(rx,{trend:a,series:[{key:`userMessages`,label:`User`,color:`var(--primary)`},{key:`assistantMessages`,label:`Assistant`,color:`var(--success)`}]})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Session trend`}),(0,B.jsx)(uo,{children:`New vs active sessions per day`})]}),(0,B.jsx)(K,{children:(0,B.jsx)(rx,{trend:a,series:[{key:`newSessions`,label:`New`,color:`var(--primary)`},{key:`activeSessions`,label:`Active`,color:`var(--accent-foreground)`}],stacked:!1})})]})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Channel breakdown`}),(0,B.jsx)(uo,{children:`Distribution of sessions and messages by channel`})]}),(0,B.jsx)(K,{children:(0,B.jsx)(ix,{channels:o})})]})]})}function rx(e){let t=e.stacked!==!1,{maxValue:n,hasData:r}=(0,R.useMemo)(()=>{let n=0,r=!1;for(let i of e.trend)if(t){let t=e.series.reduce((e,t)=>e+(i[t.key]||0),0);t>0&&(r=!0),t>n&&(n=t)}else for(let t of e.series){let e=i[t.key]||0;e>0&&(r=!0),e>n&&(n=e)}return{maxValue:n,hasData:r}},[e.trend,e.series,t]);if(!r||e.trend.length===0)return(0,B.jsx)(`p`,{className:`supporting-text`,children:`No activity in the selected range.`});let i=Math.max(6,Math.min(28,Math.floor(480/Math.max(1,e.trend.length)))),a=e.trend.length*(i+6);return(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{style:{display:`flex`,gap:12,flexWrap:`wrap`,marginBottom:10},children:e.series.map(e=>(0,B.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:6,fontSize:`0.8rem`},children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-block`,width:10,height:10,borderRadius:2,background:e.color}}),e.label]},e.key))}),(0,B.jsxs)(`svg`,{role:`img`,"aria-label":`Daily activity chart`,viewBox:`0 0 ${a} 164`,width:`100%`,height:164,preserveAspectRatio:`none`,children:[(0,B.jsx)(`title`,{children:`Daily activity chart`}),e.trend.map((r,a)=>{let o=a*(i+6),s=0;return(0,B.jsxs)(`g`,{children:[e.series.map(e=>{let a=r[e.key]||0,c=n>0?a/n*140:0,l=t?140-s-c:140-c;return t&&(s+=c),(0,B.jsx)(`rect`,{x:o,y:l,width:i,height:Math.max(0,c),fill:e.color,opacity:t?1:.85,children:(0,B.jsx)(`title`,{children:`${r.date} · ${e.label}: ${a}`})},e.key)}),a===0||a===e.trend.length-1||a===Math.floor(e.trend.length/2)?(0,B.jsx)(`text`,{x:o+i/2,y:156,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,opacity:`0.6`,children:r.date.slice(5)}):null]},r.date)})]})]})}function ix(e){if(e.channels.length===0)return(0,B.jsx)(`p`,{className:`supporting-text`,children:`No channel activity recorded in the selected range.`});let t=e.channels.reduce((e,t)=>e+t.sessionCount,0),n=e.channels.reduce((e,t)=>e+t.totalMessages,0);return(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Channel`}),(0,B.jsx)(`th`,{style:{textAlign:`right`},children:`Sessions`}),(0,B.jsx)(`th`,{style:{textAlign:`right`},children:`Messages`}),(0,B.jsx)(`th`,{style:{textAlign:`right`},children:`User`}),(0,B.jsx)(`th`,{style:{textAlign:`right`},children:`Assistant`}),(0,B.jsx)(`th`,{style:{minWidth:140},children:`Share`})]})}),(0,B.jsx)(`tbody`,{children:e.channels.map(e=>{let r=n>0?e.totalMessages/n:0;return(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.channelId||`(unknown)`}),(0,B.jsx)(`small`,{children:t>0?`${Math.round(e.sessionCount/t*100)}% of sessions`:`—`})]}),(0,B.jsx)(`td`,{style:{textAlign:`right`},children:e.sessionCount}),(0,B.jsx)(`td`,{style:{textAlign:`right`},children:e.totalMessages}),(0,B.jsx)(`td`,{style:{textAlign:`right`},children:e.userMessages}),(0,B.jsx)(`td`,{style:{textAlign:`right`},children:e.assistantMessages}),(0,B.jsx)(`td`,{children:(0,B.jsx)(`div`,{role:`progressbar`,"aria-label":`${Math.round(r*100)}% of messages`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r*100),style:{background:`var(--accent-soft)`,borderRadius:4,height:8,overflow:`hidden`},children:(0,B.jsx)(`div`,{style:{width:r>0?`${r*100}%`:0,minWidth:r>0?2:0,height:`100%`,background:`var(--primary)`}})})})]},e.channelId)})})]})})}var ax={tool:(e,t)=>X(e.name,t.name),group:(e,t)=>X(e.groupLabel,t.groupLabel)||X(e.name,t.name),type:(e,t)=>X(e.kind,t.kind)||X(e.name,t.name),invocations:(e,t)=>$o(e.recentCalls,t.recentCalls)||X(e.name,t.name),lastUsed:(e,t)=>ts(e.lastUsedAt,t.lastUsedAt)||X(e.name,t.name)},ox={invocations:`desc`,lastUsed:`desc`};function sx(e){let[t,n]=(0,R.useState)(!1),r=(0,R.useRef)(null);return(0,R.useEffect)(()=>{if(!t)return;function e(e){e.key===`Escape`&&n(!1)}function i(e){let t=r.current;t&&!t.contains(e.target)&&n(!1)}return document.addEventListener(`keydown`,e),document.addEventListener(`mousedown`,i),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`mousedown`,i)}},[t]),e.recentErrors===0?(0,B.jsx)(`small`,{children:`no recent errors`}):e.samples.length===0?(0,B.jsxs)(`small`,{children:[e.recentErrors,` recent error`,e.recentErrors===1?``:`s`]}):(0,B.jsxs)(`details`,{ref:r,className:`inline-popover`,open:t,onToggle:e=>n(e.currentTarget.open),children:[(0,B.jsxs)(`summary`,{className:`inline-popover-trigger`,title:e.samples.map(e=>`${e.sessionId}: ${e.summary}`).join(`
172
+ 2. ...`})]}),(0,B.jsxs)(`div`,{className:`panel-header`,style:{marginTop:`0.5rem`},children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h4`,{children:`Files`}),(0,B.jsx)(`p`,{className:`supporting-text`,children:`Add scripts or references (e.g. scripts/run.mjs, references/guide.md)`})]}),(0,B.jsx)(Z,{variant:`ghost`,type:`button`,onClick:()=>h(e=>({...e,files:[...e.files,{id:ax++,path:`scripts/new-file.mjs`,content:``}]})),children:`Add file`})]}),m.files.map((e,t)=>(0,B.jsxs)(`div`,{className:`stack-form`,style:{gap:`0.25rem`},children:[(0,B.jsxs)(`div`,{className:`field-grid`,children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Path`}),(0,B.jsx)(Y,{value:e.path,onChange:e=>h(n=>{let r=[...n.files];return r[t]={...r[t],path:e.target.value},{...n,files:r}}),placeholder:`scripts/my-tool.mjs`})]}),(0,B.jsx)(Z,{variant:`danger`,type:`button`,style:{alignSelf:`end`},onClick:()=>h(e=>({...e,files:e.files.filter((e,n)=>n!==t)})),children:`Remove`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:`Content`}),(0,B.jsx)(ts,{rows:8,value:e.content,onChange:e=>h(n=>{let r=[...n.files];return r[t]={...r[t],content:e.target.value},{...n,files:r}}),placeholder:`// Script content...`,style:{fontFamily:`monospace`,fontSize:`0.85rem`}})]})]},e.id)),(0,B.jsx)(`div`,{className:`button-row`,children:(0,B.jsx)(Z,{type:`button`,loading:A.isPending,disabled:A.isPending||!m.name.trim()||!m.description.trim()||!m.category.trim(),onClick:()=>A.mutate(),children:A.isPending?`Creating...`:`Create skill`})})]})]})]}):null,(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Xa,{label:`Installed skills`,value:String(C.data?.skills.length??0),detail:`${C.data?.disabled.length??0} disabled${le>0?` · ${le} blocked`:``}`,loading:!C.data}),(0,B.jsx)(Xa,{label:`Observed skills`,value:String(M.length),detail:`from AdaptiveSkills observations`,href:`#observed-skill-health`}),(0,B.jsx)(Xa,{label:`Degraded skills`,value:String(ce),detail:`current inspection window`}),(0,B.jsx)(Xa,{label:`Staged amendments`,value:String(N.length),detail:`awaiting human review`,href:`#staged-amendments`})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Installed skills`}),(0,B.jsx)(vo,{children:`${ne.length} skill${ne.length===1?``:`s`} visible`}),(0,B.jsx)(yo,{children:(0,B.jsxs)(`label`,{className:`skills-enabled-filter`,children:[(0,B.jsx)(Vc,{checked:a,"aria-label":`Show enabled skills only`,size:`sm`,onCheckedChange:s}),(0,B.jsx)(`span`,{children:`Enabled only`})]})})]}),(0,B.jsx)(K,{children:C.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading skill catalog...`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Ja,{label:`Skill`,sortKey:`skill`,sortState:re,onToggle:ie}),(0,B.jsx)(Ja,{label:`Category`,sortKey:`category`,sortState:re,onToggle:ie}),(0,B.jsx)(Ja,{label:`Source`,sortKey:`source`,sortState:re,onToggle:ie}),(0,B.jsx)(Ja,{label:`Health`,sortKey:`health`,sortState:re,onToggle:ie}),(0,B.jsx)(Ja,{label:`Tags`,sortKey:`tags`,sortState:re,onToggle:ie}),(0,B.jsx)(Ja,{label:`Action`,sortKey:`action`,sortState:re,onToggle:ie})]})}),(0,B.jsxs)(`tbody`,{children:[ne.map(({skill:e,metrics:t})=>{let n=t?Kb(t):null,r=e.shortDescription?.trim()||qb(e.description),i=e.guardFindings?.[0],a=O.isPending&&O.variables===e.name;return(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(D,{className:`table-link-button`,to:bb(e.name),children:e.name}),(0,B.jsx)(`small`,{children:r}),e.blocked&&i?(0,B.jsxs)(`small`,{className:`row-status-note-danger`,children:[i.severity,`/`,i.category,`:`,` `,i.description]}):null]}),(0,B.jsx)(`td`,{children:e.category}),(0,B.jsx)(`td`,{children:e.source}),(0,B.jsx)(`td`,{children:t?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Qa,{value:!t.degraded,trueLabel:`healthy`,falseLabel:`degraded`,falseTone:`danger`}),(0,B.jsxs)(`small`,{children:[t.total_executions,` runs`,t.degraded||!n?``:` · `,t.degraded?`${no(t.success_rate)} full success`:n]})]}):null}),(0,B.jsx)(`td`,{children:e.tags.join(`, `)||`none`}),(0,B.jsx)(`td`,{children:(0,B.jsx)(`div`,{className:`row-status-stack`,children:e.blocked?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`skill-blocked-badge`,role:`status`,"aria-label":`${e.name} is blocked`,title:e.blockedReason||`guarded`,children:`blocked`}),(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:e.blockedReason||`guarded`}),(0,B.jsx)(`button`,{type:`button`,className:`skill-unblock-button`,disabled:O.isPending,onClick:()=>O.mutate(e.name),children:a?`Unblocking...`:`Unblock`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Vc,{checked:e.enabled,"aria-label":`${e.name} status`,disabled:E.isPending||!e.available&&!e.enabled,onCheckedChange:t=>{t&&!e.available||E.mutate({name:e.name,enabled:t})}}),e.available?null:(0,B.jsx)(`small`,{className:`row-status-note-danger`,children:e.missing.join(`, `)||`missing requirements`})]})})})]},e.name)}),ne.length===0?(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{colSpan:6,children:(0,B.jsx)(`div`,{className:`empty-state`,children:`No skills match this filter.`})})}):null]})]})})})]}),(0,B.jsxs)(U,{id:`observed-skill-health`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Observed skill health`})}),(0,B.jsx)(K,{children:w.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading AdaptiveSkills health...`}):ae.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No observed skills match this filter.`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Ja,{label:`Skill`,sortKey:`skill`,sortState:oe,onToggle:se}),(0,B.jsx)(Ja,{label:`Status`,sortKey:`status`,sortState:oe,onToggle:se}),(0,B.jsx)(Ja,{label:`Executions`,sortKey:`executions`,sortState:oe,onToggle:se}),(0,B.jsx)(Ja,{label:`Full success`,sortKey:`success`,sortState:oe,onToggle:se}),(0,B.jsx)(Ja,{label:`Partial success`,sortKey:`partial`,sortState:oe,onToggle:se}),(0,B.jsx)(Ja,{label:`Failure`,sortKey:`failure`,sortState:oe,onToggle:se}),(0,B.jsx)(Ja,{label:`Tool breakage`,sortKey:`toolBreakage`,sortState:oe,onToggle:se}),(0,B.jsx)(Ja,{label:`Feedback`,sortKey:`feedback`,sortState:oe,onToggle:se}),(0,B.jsx)(Ja,{label:`Reasons`,sortKey:`reasons`,sortState:oe,onToggle:se})]})}),(0,B.jsx)(`tbody`,{children:ae.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(D,{className:`table-link-button`,to:bb(e.skill_name),children:e.skill_name}),(0,B.jsxs)(`small`,{children:[`Window ending`,` `,ao(e.window_ended_at)]})]}),(0,B.jsx)(`td`,{children:(0,B.jsx)(Qa,{value:!e.degraded,trueLabel:`healthy`,falseLabel:`degraded`,falseTone:`danger`})}),(0,B.jsx)(`td`,{children:e.total_executions}),(0,B.jsx)(`td`,{children:tx(e,e.success_count)}),(0,B.jsx)(`td`,{children:tx(e,e.partial_count)}),(0,B.jsx)(`td`,{children:tx(e,e.failure_count)}),(0,B.jsx)(`td`,{children:nx(e)}),(0,B.jsx)(`td`,{children:Kb(e)||null}),(0,B.jsx)(`td`,{children:(0,B.jsx)(`small`,{children:e.degradation_reasons.join(`; `)||`healthy`})})]},e.skill_name))})]})})})]}),(0,B.jsxs)(`div`,{className:`two-column-grid skills-review-grid`,children:[(0,B.jsxs)(U,{id:`staged-amendments`,variant:`muted`,children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Staged amendments`}),(0,B.jsx)(vo,{children:`${N.length} waiting for review`})]}),(0,B.jsx)(K,{children:T.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading staged amendments...`}):N.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No staged amendments are waiting for review.`}):(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:N.map(e=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(D,{className:`table-link-button`,to:bb(e.skill_name),children:e.skill_name}),(0,B.jsxs)(`small`,{children:[Jb(e),` ·`,` `,Yb(e),` · guard`,` `,e.guard_verdict,`/`,e.guard_findings_count]}),(0,B.jsx)(`small`,{children:e.rationale||e.diff_summary})]}),(0,B.jsxs)(`div`,{className:`skill-review-actions`,children:[(0,B.jsx)(Z,{type:`button`,variant:`ghost`,onClick:()=>l(e.skill_name),children:`History`}),(0,B.jsx)(Z,{type:`button`,loading:k.isPending,disabled:k.isPending,onClick:()=>k.mutate({action:`apply`,skillName:e.skill_name}),children:`Apply`}),(0,B.jsx)(Z,{type:`button`,variant:`danger`,loading:k.isPending,disabled:k.isPending,onClick:()=>k.mutate({action:`reject`,skillName:e.skill_name}),children:`Reject`})]})]},e.id))})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:I?`Amendment history: ${I}`:`Amendment history`}),(0,B.jsx)(vo,{children:`Full review trail for the selected skill`})]}),(0,B.jsx)(K,{children:I?ee.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading amendment history...`}):ue.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No amendment history exists for this skill yet.`}):(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:ue.map(e=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`strong`,{children:[Jb(e),` ·`,` `,Yb(e)]}),(0,B.jsxs)(`small`,{children:[`Guard `,e.guard_verdict,`/`,e.guard_findings_count,` · runs since apply`,` `,e.runs_since_apply]}),(0,B.jsx)(`small`,{children:e.rationale||`No rationale recorded.`}),(0,B.jsx)(`small`,{children:e.diff_summary||`No diff summary recorded.`})]}),(0,B.jsx)(`span`,{className:e.status===`applied`?`list-status list-status-success`:e.status===`rejected`?`list-status list-status-danger`:`list-status`,children:e.status})]},e.id))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`Select a skill to inspect its amendment history.`})})]})]})]})}var cx=[{value:7,label:`Last 7 days`},{value:14,label:`Last 14 days`},{value:30,label:`Last 30 days`},{value:60,label:`Last 60 days`},{value:90,label:`Last 90 days`}];function lx(){let e=Zn(),[t,n]=(0,R.useState)(30),r=y({queryKey:[`statistics`,e.token,t],queryFn:()=>Re(e.token,t),refetchInterval:6e4}),i=r.data,a=i?.trend??[],o=i?.channels??[],s=i?.totals,c=(0,B.jsxs)(`label`,{className:`header-actions`,children:[(0,B.jsx)(`span`,{className:`supporting-text`,style:{marginRight:8},children:`Range`}),(0,B.jsx)(`select`,{value:t,onChange:e=>n(Number.parseInt(e.target.value,10)),children:cx.map(e=>(0,B.jsx)(`option`,{value:e.value,children:e.label},e.value))})]});if(r.isLoading&&!i)return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{actions:c}),(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading statistics…`})]});if(r.isError&&!i)return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{actions:c}),(0,B.jsx)(`div`,{className:`empty-state error`,children:H(r.error)})]});if(!i||!s)return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{actions:c}),(0,B.jsx)(`div`,{className:`empty-state`,children:`No statistics available.`})]});let l=`${i.startDate} → ${i.endDate}`;return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{description:`Activity across the last ${so(i.rangeDays,`day`)} (${l}).`,actions:c}),(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Xa,{label:`Active sessions`,value:$a(s.activeSessions),detail:`${s.newSessions} new in range`}),(0,B.jsx)(Xa,{label:`Messages`,value:$a(s.totalMessages),detail:`${$a(s.userMessages)} user / ${$a(s.assistantMessages)} assistant`}),(0,B.jsx)(Xa,{label:`Tokens`,value:$a(s.totalTokens),detail:to({inputTokens:s.totalInputTokens,outputTokens:s.totalOutputTokens})}),(0,B.jsx)(Xa,{label:`Cost`,value:ro(s.totalCostUsd),detail:`${so(s.callCount,`call`)} · ${so(s.totalToolCalls,`tool call`)}`})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Message trend`}),(0,B.jsx)(vo,{children:`User vs assistant messages per day`})]}),(0,B.jsx)(K,{children:(0,B.jsx)(ux,{trend:a,series:[{key:`userMessages`,label:`User`,color:`var(--primary)`},{key:`assistantMessages`,label:`Assistant`,color:`var(--success)`}]})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Session trend`}),(0,B.jsx)(vo,{children:`New vs active sessions per day`})]}),(0,B.jsx)(K,{children:(0,B.jsx)(ux,{trend:a,series:[{key:`newSessions`,label:`New`,color:`var(--primary)`},{key:`activeSessions`,label:`Active`,color:`var(--accent-foreground)`}],stacked:!1})})]})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Channel breakdown`}),(0,B.jsx)(vo,{children:`Distribution of sessions and messages by channel`})]}),(0,B.jsx)(K,{children:(0,B.jsx)(dx,{channels:o})})]})]})}function ux(e){let t=e.stacked!==!1,{maxValue:n,hasData:r}=(0,R.useMemo)(()=>{let n=0,r=!1;for(let i of e.trend)if(t){let t=e.series.reduce((e,t)=>e+(i[t.key]||0),0);t>0&&(r=!0),t>n&&(n=t)}else for(let t of e.series){let e=i[t.key]||0;e>0&&(r=!0),e>n&&(n=e)}return{maxValue:n,hasData:r}},[e.trend,e.series,t]);if(!r||e.trend.length===0)return(0,B.jsx)(`p`,{className:`supporting-text`,children:`No activity in the selected range.`});let i=Math.max(6,Math.min(28,Math.floor(480/Math.max(1,e.trend.length)))),a=e.trend.length*(i+6);return(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{style:{display:`flex`,gap:12,flexWrap:`wrap`,marginBottom:10},children:e.series.map(e=>(0,B.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:6,fontSize:`0.8rem`},children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-block`,width:10,height:10,borderRadius:2,background:e.color}}),e.label]},e.key))}),(0,B.jsxs)(`svg`,{role:`img`,"aria-label":`Daily activity chart`,viewBox:`0 0 ${a} 164`,width:`100%`,height:164,preserveAspectRatio:`none`,children:[(0,B.jsx)(`title`,{children:`Daily activity chart`}),e.trend.map((r,a)=>{let o=a*(i+6),s=0;return(0,B.jsxs)(`g`,{children:[e.series.map(e=>{let a=r[e.key]||0,c=n>0?a/n*140:0,l=t?140-s-c:140-c;return t&&(s+=c),(0,B.jsx)(`rect`,{x:o,y:l,width:i,height:Math.max(0,c),fill:e.color,opacity:t?1:.85,children:(0,B.jsx)(`title`,{children:`${r.date} · ${e.label}: ${a}`})},e.key)}),a===0||a===e.trend.length-1||a===Math.floor(e.trend.length/2)?(0,B.jsx)(`text`,{x:o+i/2,y:156,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,opacity:`0.6`,children:r.date.slice(5)}):null]},r.date)})]})]})}function dx(e){if(e.channels.length===0)return(0,B.jsx)(`p`,{className:`supporting-text`,children:`No channel activity recorded in the selected range.`});let t=e.channels.reduce((e,t)=>e+t.sessionCount,0),n=e.channels.reduce((e,t)=>e+t.totalMessages,0);return(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Channel`}),(0,B.jsx)(`th`,{style:{textAlign:`right`},children:`Sessions`}),(0,B.jsx)(`th`,{style:{textAlign:`right`},children:`Messages`}),(0,B.jsx)(`th`,{style:{textAlign:`right`},children:`User`}),(0,B.jsx)(`th`,{style:{textAlign:`right`},children:`Assistant`}),(0,B.jsx)(`th`,{style:{minWidth:140},children:`Share`})]})}),(0,B.jsx)(`tbody`,{children:e.channels.map(e=>{let r=n>0?e.totalMessages/n:0;return(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.channelId||`(unknown)`}),(0,B.jsx)(`small`,{children:t>0?`${Math.round(e.sessionCount/t*100)}% of sessions`:`—`})]}),(0,B.jsx)(`td`,{style:{textAlign:`right`},children:e.sessionCount}),(0,B.jsx)(`td`,{style:{textAlign:`right`},children:e.totalMessages}),(0,B.jsx)(`td`,{style:{textAlign:`right`},children:e.userMessages}),(0,B.jsx)(`td`,{style:{textAlign:`right`},children:e.assistantMessages}),(0,B.jsx)(`td`,{children:(0,B.jsx)(`div`,{role:`progressbar`,"aria-label":`${Math.round(r*100)}% of messages`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r*100),style:{background:`var(--accent-soft)`,borderRadius:4,height:8,overflow:`hidden`},children:(0,B.jsx)(`div`,{style:{width:r>0?`${r*100}%`:0,minWidth:r>0?2:0,height:`100%`,background:`var(--primary)`}})})})]},e.channelId)})})]})})}var fx={page:`_page_auczp_1`,grid:`_grid_auczp_12`,stack:`_stack_auczp_18`,row:`_row_auczp_24`,copyField:`_copyField_auczp_31`,copyLabel:`_copyLabel_auczp_37`,value:`_value_auczp_43`,muted:`_muted_auczp_51`,warning:`_warning_auczp_58`,actions:`_actions_auczp_69`,checkList:`_checkList_auczp_75`,checkItem:`_checkItem_auczp_84`,pill:`_pill_auczp_94`,pillOk:`_pillOk_auczp_95`};function px(e){return e.split(/[\n,]/).map(e=>e.trim()).filter(Boolean)}function mx(e){return e.tab??{enabled:!1,ssoAppId:``,appIdUri:``,allowFrom:[]}}function hx(e){return(0,B.jsx)(`span`,{className:e.ok?fx.pillOk:fx.pill,children:e.ok?`Ready`:`Missing`})}function gx(e){if(!e)return!1;try{let t=new URL(e);return t.protocol!==`https:`||t.hostname===`127.0.0.1`||t.hostname===`localhost`||t.hostname===`::1`}catch{return!0}}function _x(e){let t=Ss();return(0,B.jsxs)(`div`,{className:fx.copyField,children:[(0,B.jsx)(`span`,{className:fx.copyLabel,children:e.label}),(0,B.jsxs)(`div`,{className:fx.row,children:[(0,B.jsx)(`span`,{className:fx.value,children:e.value||`Not configured`}),(0,B.jsx)(Z,{variant:`outline`,size:`sm`,disabled:!e.value,onClick:async()=>{try{await navigator.clipboard.writeText(e.value),t.success(`${e.label} copied.`)}catch{t.error(`Could not copy value.`)}},children:`Copy`})]})]})}function vx(){let{token:e}=Zn(),t=Ss(),n=o(),[r,i]=(0,R.useState)(!1),[a,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(``),[u,d]=(0,R.useState)(``),[f,p]=(0,R.useState)(``),[m,h]=(0,R.useState)(!1),_=y({queryKey:[`config`,e],queryFn:()=>Nt(e),retry:!1}),v=y({queryKey:[`msteams-tab-status`,e],queryFn:()=>Pt(e),retry:!1});(0,R.useEffect)(()=>{let e=_.data?.config.msteams;if(!e)return;let t=mx(e);i(t.enabled),s(t.ssoAppId||e.appId||``),l(t.appIdUri||v.data?.appIdUri||``),d(t.allowFrom.join(`
173
+ `))},[_.data,v.data?.appIdUri]);let b=g({mutationFn:async()=>{let t=_.data?.config;if(!t)throw Error(`Runtime config is not loaded.`);return zt(e,{...t,msteams:{...t.msteams,tab:{enabled:r,ssoAppId:a.trim(),appIdUri:c.trim(),allowFrom:px(u)}}})},onSuccess:async r=>{n.setQueryData([`config`,e],r),await v.refetch(),t.success(`Teams settings saved.`)},onError:e=>{t.error(`Save failed: ${H(e)}`)}});async function x(){let e=(await v.refetch()).data;if(!e){p(`Status check failed.`);return}let t=[e.tenantId?``:`tenant ID`,e.ssoAppId?``:`SSO app ID`,e.appIdUri?``:`App ID URI`,e.enabled?``:`enabled tab SSO`].filter(Boolean);p(t.length>0?`Missing ${t.join(`, `)}.`:`Configuration values are present.`)}async function S(){if(!m){h(!0);try{let t=await Ft(e),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`hybridclaw-teams-app.zip`,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(n)}catch(e){t.error(`Download failed: ${H(e)}`)}finally{h(!1)}}}let C=v.data,w=gx(C?.publicOrigin);return _.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading Teams app setup…`}):_.isError?(0,B.jsxs)(`div`,{className:`empty-state`,children:[`Failed to load Teams app setup: `,H(_.error)]}):(0,B.jsxs)(`div`,{className:fx.page,children:[(0,B.jsx)(`h1`,{children:`Teams App Setup`}),(0,B.jsx)(Ya,{description:`Microsoft Teams tab sharing`}),(0,B.jsxs)(`div`,{className:fx.grid,children:[(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Detect`}),(0,B.jsx)(vo,{children:`Gateway and Entra values`})]}),(0,B.jsxs)(K,{className:fx.stack,children:[(0,B.jsx)(_x,{label:`Public origin`,value:C?.publicOrigin||``}),(0,B.jsx)(_x,{label:`Tenant ID`,value:C?.tenantId||``}),(0,B.jsx)(_x,{label:`App ID URI`,value:C?.appIdUri||c}),(0,B.jsx)(_x,{label:`Browser redirect URI`,value:C?.browserRedirectUri||``}),(0,B.jsx)(_x,{label:`Teams desktop and mobile client ID`,value:C?.teamsClientIds.desktopMobile||``}),(0,B.jsx)(_x,{label:`Teams web client ID`,value:C?.teamsClientIds.web||``}),w?(0,B.jsx)(`p`,{className:fx.warning,children:`Localhost is only for local browser testing. Teams requires a public HTTPS URL for this gateway before the app package or tab links will work.`}):null]})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Configure`}),(0,B.jsx)(vo,{children:`Tab SSO runtime settings`})]}),(0,B.jsxs)(K,{className:fx.stack,children:[(0,B.jsxs)(`label`,{className:fx.row,children:[(0,B.jsx)(`span`,{children:`Enable tab SSO`}),(0,B.jsx)(Vc,{checked:r,onCheckedChange:i})]}),(0,B.jsx)(Y,{value:a,placeholder:`SSO app ID`,onChange:e=>s(e.target.value)}),(0,B.jsx)(Y,{value:c,placeholder:`api://domain/app-id`,onChange:e=>l(e.target.value)}),(0,B.jsx)(ts,{value:u,placeholder:`Optional UPN or oid allowlist`,rows:4,onChange:e=>d(e.target.value)}),(0,B.jsxs)(`div`,{className:fx.actions,children:[(0,B.jsx)(Z,{loading:b.isPending,onClick:()=>b.mutate(),children:`Save Teams settings`}),(0,B.jsx)(Z,{variant:`outline`,onClick:x,children:`Test`})]}),f?(0,B.jsx)(`p`,{className:fx.muted,children:f}):null]})]})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Verify`}),(0,B.jsx)(vo,{children:`Required values for Teams SSO`})]}),(0,B.jsx)(K,{children:(0,B.jsxs)(`ul`,{className:fx.checkList,children:[(0,B.jsxs)(`li`,{className:fx.checkItem,children:[(0,B.jsx)(`span`,{children:`Tab SSO enabled`}),(0,B.jsx)(hx,{ok:C?.enabled===!0})]}),(0,B.jsxs)(`li`,{className:fx.checkItem,children:[(0,B.jsx)(`span`,{children:`Tenant ID`}),(0,B.jsx)(hx,{ok:!!C?.tenantId})]}),(0,B.jsxs)(`li`,{className:fx.checkItem,children:[(0,B.jsx)(`span`,{children:`SSO app ID`}),(0,B.jsx)(hx,{ok:!!C?.ssoAppId})]}),(0,B.jsxs)(`li`,{className:fx.checkItem,children:[(0,B.jsx)(`span`,{children:`App ID URI`}),(0,B.jsx)(hx,{ok:!!C?.appIdUri})]}),(0,B.jsxs)(`li`,{className:fx.checkItem,children:[(0,B.jsx)(`span`,{children:`Scope`}),(0,B.jsx)(hx,{ok:C?.scope===`access_as_user`})]})]})})]}),(0,B.jsxs)(U,{children:[(0,B.jsxs)(W,{children:[(0,B.jsx)(G,{children:`Install`}),(0,B.jsx)(vo,{children:`Org app package`})]}),(0,B.jsxs)(K,{className:fx.stack,children:[(0,B.jsx)(`p`,{className:fx.muted,children:`Upload this package to the Teams org catalog after the Entra app is configured.`}),(0,B.jsx)(`div`,{children:(0,B.jsx)(Z,{loading:m,disabled:!C?.enabled,onClick:S,children:`Download org app`})})]})]})]})}function yx(e){return e?io(e):`never`}function bx(e){return e.revoked_at?`Revoked`:e.expires_at&&Date.parse(e.expires_at)<=Date.now()?`Expired`:`Active`}function xx(e){return Object.entries(e).map(([e,t])=>Array.isArray(t)?`${e}: ${t.join(`, `)}`:`${e}: ${String(t)}`).join(` | `)||`actions: none`}var Sx=`openai.api,chat.send,status.read,agents.read,secret.list_metadata,secret.overwrite,secret.unset,admin.tokens.read,admin.overview.read,admin.tunnel.read,admin.tunnel.write,admin.tunnel.reconnect,admin.tunnel.stop,admin.statistics.read,admin.logs.read,admin.team.read,admin.team.write,admin.agents.read,admin.agents.write,admin.agents.delete,admin.hybridai.bots.read,admin.agent_scoreboard.read,admin.harness_evolution.read,admin.models.read,admin.models.write,admin.sessions.read,admin.sessions.delete,admin.email.read,admin.email.delete,admin.scheduler.read,admin.scheduler.write,admin.scheduler.delete,admin.channels.read,admin.channels.write,admin.channels.delete,admin.connectors.read,admin.mcp.read,admin.mcp.write,admin.mcp.delete,admin.config.read,admin.config.write,admin.config.reload,admin.browser_pool.read,admin.browser_pool.start,admin.webhook_targets.write,admin.a2a.read,admin.a2a.write,admin.a2a.delete,admin.fleet.read,admin.fleet.write,admin.fleet.delete,admin.signal.read,admin.signal.write,admin.email_config.fetch,admin.audit.read,admin.approvals.read,admin.policy.write,admin.policy.delete,admin.tools.read,admin.plugins.read,admin.output_guard.read,admin.output_guard.write,admin.output_guard.preview,admin.distill.read,admin.distill.write,admin.distill.delete,admin.skills.read,admin.skills.write,admin.skills.unblock,admin.skills.upload,admin.jobs.read,admin.jobs.write,admin.jobs.delete,admin.terminal.start,admin.terminal.stop,admin.terminal.stream,admin.gateway.shutdown,admin.gateway.restart`.split(`,`),Cx=[{label:`Current roles`,options:[[`admin.viewer`,`Viewer - read-only admin API access`],[`admin.operator`,`Operator - day-to-day admin operations`],[`admin.integrations_manager`,`Integrations manager - agent and channel APIs`],[`admin.config_manager`,`Config manager - runtime config APIs`],[`admin.security_manager`,`Security manager - secret, policy, and skill APIs`],[`admin.terminal_operator`,`Terminal operator - terminal and job APIs`],[`admin.full`,`Full admin - every admin action`]]},{label:`Compatibility roles`,options:[[`admin:auditor`,`Auditor - read-only admin access`],[`admin:operator`,`Operator - broad operational access`],[`admin:owner`,`Owner - full admin access`],[`admin:secret-manager`,`Secret manager - secret metadata and writes`]]}],wx=[[`never`,`No expiration`],[`7d`,`7 days`],[`30d`,`30 days`],[`90d`,`90 days`],[`custom`,`Custom date/time`]];function Tx(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Ex(e){let t={"openai.api":`OpenAI API`,"chat.send":`Chat send`,"status.read":`Status read`,"agents.read":`Agents read`,"admin.a2a.read":`A2A read`,"admin.a2a.write":`A2A write`,"admin.a2a.delete":`A2A delete`,"admin.mcp.read":`MCP read`,"admin.mcp.write":`MCP write`,"admin.mcp.delete":`MCP delete`};return t[e]?t[e]:e.split(`.`).map(Tx).join(` `)}function Dx(e){return e===`openai.api`?`Use OpenAI-compatible /v1 endpoints.`:e===`chat.send`?`Send chat and command requests.`:e===`status.read`?`Read gateway status.`:e===`agents.read`?`Read agent metadata.`:e.startsWith(`secret.`)?`Access admin secret management.`:e===`admin.tokens.read`?`Read admin API token metadata.`:e.startsWith(`admin.terminal.`)?`Control admin terminal sessions.`:e.startsWith(`admin.gateway.`)?`Control gateway process actions.`:e.endsWith(`.read`)||e.endsWith(`.fetch`)?`Read this admin console area.`:e.endsWith(`.write`)||e.endsWith(`.preview`)?`Modify this admin console area.`:e.endsWith(`.delete`)||e.endsWith(`.stop`)?`Remove or stop resources in this admin console area.`:e.endsWith(`.start`)||e.endsWith(`.restart`)?`Start or restart resources in this admin console area.`:e.endsWith(`.reload`)||e.endsWith(`.reconnect`)?`Refresh runtime state in this admin console area.`:e.endsWith(`.unblock`)||e.endsWith(`.upload`)?`Manage skill trust state and uploads.`:`Grant this exact RBAC action.`}function Ox(e){return[`openai.api`,`chat.send`,`status.read`,`agents.read`].includes(e)?`API access`:e.startsWith(`secret.`)?`Secrets`:e.startsWith(`admin.tokens.`)?`API tokens`:e.startsWith(`admin.terminal.`)||e.startsWith(`admin.gateway.`)?`Runtime controls`:e.endsWith(`.read`)||e.endsWith(`.fetch`)?`Admin reads`:`Admin changes`}var kx=Sx.map(e=>({value:e,label:Ex(e),description:Dx(e),group:Ox(e)})),Ax=[`API access`,`Secrets`,`API tokens`,`Admin reads`,`Admin changes`,`Runtime controls`];function jx(e){let t=new Set(e);return kx.map(e=>e.value).filter(e=>t.has(e))}function Mx(e,t){if(e===`custom`)return t.trim()||null;if(e===`never`)return null;let n=e===`7d`?7:e===`30d`?30:90;return new Date(Date.now()+n*24*60*60*1e3).toISOString()}function Nx(){let{token:e}=Zn(),t=Ss(),n=o(),[r,i]=(0,R.useState)(!1),[a,s]=(0,R.useState)(null),[c,l]=(0,R.useState)(null),[u,d]=(0,R.useState)(``),f=y({queryKey:[`admin`,`tokens`,e],queryFn:()=>Yt(e),retry:!1}),p=()=>n.invalidateQueries({queryKey:[`admin`,`tokens`]}),m=g({mutationFn:t=>Xt(e,t),onSuccess:async e=>{l(e.token),i(!1),t.success(`Created ${e.apiToken.label}.`),await p()},onError:e=>{t.error(`Create failed: ${H(e)}`)}}),h=g({mutationFn:t=>Zt(e,t),onSuccess:async e=>{t.success(`Revoked ${e.apiToken.label}.`),s(null),await p()},onError:e=>{t.error(`Revoke failed: ${H(e)}`)}}),_=(0,R.useMemo)(()=>{let e=f.data?.tokens??[],t=u.trim().toLowerCase();return t?e.filter(e=>e.id.includes(t)||e.label.toLowerCase().includes(t)):e},[u,f.data?.tokens]);if(f.isPending)return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{description:`Scoped API tokens`}),(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading API tokens...`})]});if(f.isError||!f.data){let e=f.error instanceof we&&f.error.status===403;return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{description:`Scoped API tokens`}),(0,B.jsx)(`div`,{className:`empty-state`,children:e?`You do not have permission to view API tokens.`:`Failed to load API tokens: ${H(f.error)}`})]})}let v=f.data.actions.includes(`admin.tokens.create`),b=f.data.actions.includes(`admin.tokens.revoke`);return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{description:`Revocable bearer tokens with scoped RBAC claims.`,actions:(0,B.jsxs)(`div`,{className:_g.actions,children:[(0,B.jsx)(`input`,{className:`compact-search`,value:u,onChange:e=>d(e.target.value),placeholder:`Filter tokens`,"aria-label":`Filter tokens by label or id`}),v?(0,B.jsx)(Z,{type:`button`,onClick:()=>i(!0),children:`Create token`}):null]})}),_.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:f.data.tokens.length===0?`No API tokens have been created.`:`No API tokens match this filter.`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Token`}),(0,B.jsx)(`th`,{children:`Status`}),(0,B.jsx)(`th`,{children:`Claims`}),(0,B.jsx)(`th`,{children:`Created`}),(0,B.jsx)(`th`,{children:`Last used`}),(0,B.jsx)(`th`,{children:`Expires`}),b?(0,B.jsx)(`th`,{className:_g.actionsHead,children:`Actions`}):null]})}),(0,B.jsx)(`tbody`,{children:_.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{className:_g.name,children:e.label}),(0,B.jsx)(`br`,{}),(0,B.jsx)(`code`,{className:_g.fingerprint,children:e.id})]}),(0,B.jsx)(`td`,{children:bx(e)}),(0,B.jsx)(`td`,{children:xx(e.claims)}),(0,B.jsx)(`td`,{title:e.created_at,children:yx(e.created_at)}),(0,B.jsx)(`td`,{title:e.last_used_at??void 0,children:yx(e.last_used_at)}),(0,B.jsx)(`td`,{title:e.expires_at??void 0,children:yx(e.expires_at)}),b?(0,B.jsx)(`td`,{children:(0,B.jsx)(`div`,{className:_g.actions,children:e.revoked_at?null:(0,B.jsx)(Z,{type:`button`,variant:`danger`,size:`sm`,onClick:()=>s(e),children:`Revoke`})})}):null]},e.id))})]})}),(0,B.jsx)(Px,{open:r,pending:m.isPending,onClose:()=>i(!1),onSubmit:e=>m.mutate(e)}),(0,B.jsx)(Lx,{token:a,pending:h.isPending,onClose:()=>s(null),onConfirm:()=>{a&&h.mutate(a.id)}}),(0,B.jsx)(Rx,{token:c,onClose:()=>l(null)})]})}function Px(e){let[t,n]=(0,R.useState)(``),[r,i]=(0,R.useState)(``),[a,o]=(0,R.useState)([]),[s,c]=(0,R.useState)(`never`),[l,u]=(0,R.useState)(``),d=(0,R.useId)(),f=(0,R.useId)(),p=(0,R.useId)(),m=(0,R.useId)(),h=(0,R.useId)(),g=t.trim().length>0&&(r.trim().length>0||a.length>0)&&(s!==`custom`||l.trim().length>0);return(0,R.useEffect)(()=>{e.open&&(n(``),i(``),o([]),c(`never`),u(``))},[e.open]),(0,B.jsx)(ui,{open:e.open,onOpenChange:t=>{t||e.onClose()},children:(0,B.jsxs)(di,{role:`dialog`,size:`default`,preventCloseOnOutsideClick:e.pending,children:[(0,B.jsxs)(fi,{children:[(0,B.jsx)(pi,{children:`Create API token`}),(0,B.jsx)(mi,{children:`The token value is shown once after creation.`})]}),(0,B.jsxs)(`form`,{className:_g.overwriteForm,onSubmit:n=>{n.preventDefault();let i=t.trim(),o=r.trim(),c=Mx(s,l);!i||!o&&a.length===0||s===`custom`&&!c||e.onSubmit({label:i,...o?{role:o}:{},...a.length>0?{actions:a}:{},...c?{expiresAt:c}:{}})},children:[(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{htmlFor:d,children:`Label`}),(0,B.jsx)(Y,{id:d,value:t,onChange:e=>n(e.target.value),disabled:e.pending})]}),(0,B.jsxs)(q,{controlId:p,children:[(0,B.jsx)(J,{children:`Actions`}),(0,B.jsx)(Fx,{id:p,value:a,onChange:o,disabled:e.pending})]}),(0,B.jsxs)(q,{controlId:f,children:[(0,B.jsx)(J,{children:`Role`}),(0,B.jsxs)(vs,{id:f,value:r,onChange:e=>i(e.target.value),disabled:e.pending,children:[(0,B.jsx)(Q,{value:``,children:`No role preset`}),Cx.map(e=>(0,B.jsx)(ys,{label:e.label,children:e.options.map(([e,t])=>(0,B.jsx)(Q,{value:e,children:t},e))},e.label))]})]}),(0,B.jsxs)(q,{controlId:m,children:[(0,B.jsx)(J,{children:`Expires at`}),(0,B.jsx)(vs,{id:m,value:s,onChange:e=>c(e.target.value),disabled:e.pending,children:wx.map(([e,t])=>(0,B.jsx)(Q,{value:e,children:t},e))})]}),s===`custom`?(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{htmlFor:h,children:`Custom expiration`}),(0,B.jsx)(Y,{id:h,value:l,onChange:e=>u(e.target.value),type:`datetime-local`,disabled:e.pending})]}):null,(0,B.jsxs)(hi,{children:[(0,B.jsx)(gi,{className:`ghost-button`,disabled:e.pending,children:`Cancel`}),(0,B.jsx)(Z,{type:`submit`,disabled:e.pending||!g,children:e.pending?`Creating...`:`Create token`})]})]})]})})}function Fx(e){let[t,n]=(0,R.useState)(``),r=(0,R.useMemo)(()=>new Set(e.value),[e.value]),i=(0,R.useMemo)(()=>{let e=t.trim().toLowerCase();return e?kx.filter(t=>t.value.toLowerCase().includes(e)||t.label.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)):kx},[t]),a=(0,R.useMemo)(()=>kx.filter(e=>r.has(e.value)).map(e=>e.label),[r]),o=a.length===0?`Select actions`:a.length<=2?a.join(`, `):`${a.length} actions selected`,s=t=>{e.onChange(jx([...t]))},c=e=>{let t=new Set(r);t.has(e)?t.delete(e):t.add(e),s(t)};return(0,B.jsxs)(Fi,{onOpenChange:e=>{e||n(``)},children:[(0,B.jsx)(Ix,{id:e.id,disabled:e.disabled,children:(0,B.jsx)(`span`,{className:a.length===0?_g.selectPlaceholder:_g.selectSummary,children:o})}),(0,B.jsxs)(Li,{align:`start`,className:_g.multiSelectContent,focusOnOpen:e=>{e.querySelector(`input`)?.focus()},role:`dialog`,"aria-label":`Select token actions`,children:[(0,B.jsx)(Y,{value:t,onChange:e=>n(e.target.value),placeholder:`Filter actions`,"aria-label":`Filter actions`,size:`sm`,className:_g.actionFilter}),(0,B.jsxs)(`div`,{className:_g.choiceList,children:[Ax.map(t=>{let n=i.filter(e=>e.group===t);return n.length===0?null:(0,B.jsxs)(`div`,{className:_g.choiceGroup,children:[(0,B.jsx)(`div`,{className:_g.choiceGroupLabel,children:t}),n.map(t=>{let n=r.has(t.value);return(0,B.jsxs)(`label`,{className:_g.choiceRow,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:n,disabled:e.disabled,className:_g.choiceInput,onChange:()=>c(t.value)}),(0,B.jsx)(`span`,{"aria-hidden":`true`,className:_g.choiceCheck,"data-checked":n||void 0,children:n?(0,B.jsx)(ar,{className:_g.choiceIcon}):null}),(0,B.jsxs)(`span`,{className:_g.choiceMeta,children:[(0,B.jsx)(`span`,{className:_g.choiceTitle,children:t.label}),(0,B.jsx)(`span`,{className:_g.choiceDescription,children:t.description})]}),(0,B.jsx)(`code`,{className:_g.choiceValue,children:t.value})]},t.value)})]},t)}),i.length===0?(0,B.jsx)(`div`,{className:_g.choiceEmpty,children:`No actions match.`}):null]}),(0,B.jsxs)(`div`,{className:_g.choiceFooter,children:[(0,B.jsx)(`span`,{className:_g.choiceCount,children:e.value.length===0?`No actions selected`:`${e.value.length} selected`}),(0,B.jsx)(Z,{type:`button`,variant:`ghost`,size:`sm`,disabled:e.disabled||e.value.length===0,onClick:()=>{e.onChange([])},children:`Clear`})]})]})]})}function Ix(e){let t=Pi(`ActionMultiSelectTrigger`);return(0,B.jsxs)(`button`,{id:e.id,ref:t.setTriggerEl,type:`button`,"aria-haspopup":`dialog`,"aria-expanded":t.open,"aria-controls":t.open?t.contentId:void 0,disabled:e.disabled,"data-state":t.open?`open`:`closed`,className:_g.multiSelectTrigger,onClick:t.toggle,children:[(0,B.jsx)(`span`,{className:_g.multiSelectTriggerText,children:e.children}),(0,B.jsx)(or,{"aria-hidden":`true`,className:_g.selectChevron})]})}function Lx(e){return(0,B.jsx)(ui,{open:e.token!==null,onOpenChange:t=>{t||e.onClose()},children:(0,B.jsxs)(di,{role:`alertdialog`,size:`default`,preventCloseOnOutsideClick:e.pending,children:[(0,B.jsxs)(fi,{children:[(0,B.jsxs)(pi,{children:[`Revoke `,e.token?.label,`?`]}),(0,B.jsx)(mi,{children:`Existing clients using this token will be rejected immediately.`})]}),(0,B.jsxs)(hi,{children:[(0,B.jsx)(gi,{className:`ghost-button`,disabled:e.pending,children:`Cancel`}),(0,B.jsx)(Z,{type:`button`,variant:`danger`,disabled:e.pending,onClick:e.onConfirm,children:e.pending?`Revoking...`:`Revoke token`})]})]})})}function Rx(e){let t=e.token!==null,n=(0,R.useId)();return(0,B.jsx)(ui,{open:t,onOpenChange:t=>{t||e.onClose()},children:(0,B.jsxs)(di,{role:`dialog`,size:`default`,children:[(0,B.jsxs)(fi,{children:[(0,B.jsx)(pi,{children:`API token created`}),(0,B.jsx)(mi,{children:`Store this value before closing the dialog.`})]}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{htmlFor:n,children:`Token`}),(0,B.jsx)(ts,{id:n,readOnly:!0,value:e.token||``,className:_g.tokenValue,rows:3})]}),(0,B.jsx)(hi,{children:(0,B.jsx)(Z,{type:`button`,onClick:e.onClose,children:`Close`})})]})})}var zx={tool:(e,t)=>X(e.name,t.name),group:(e,t)=>X(e.groupLabel,t.groupLabel)||X(e.name,t.name),type:(e,t)=>X(e.kind,t.kind)||X(e.name,t.name),invocations:(e,t)=>os(e.recentCalls,t.recentCalls)||X(e.name,t.name),lastUsed:(e,t)=>cs(e.lastUsedAt,t.lastUsedAt)||X(e.name,t.name)},Bx={invocations:`desc`,lastUsed:`desc`};function Vx(e){let[t,n]=(0,R.useState)(!1),r=(0,R.useRef)(null);return(0,R.useEffect)(()=>{if(!t)return;function e(e){e.key===`Escape`&&n(!1)}function i(e){let t=r.current;t&&!t.contains(e.target)&&n(!1)}return document.addEventListener(`keydown`,e),document.addEventListener(`mousedown`,i),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`mousedown`,i)}},[t]),e.recentErrors===0?(0,B.jsx)(`small`,{children:`no recent errors`}):e.samples.length===0?(0,B.jsxs)(`small`,{children:[e.recentErrors,` recent error`,e.recentErrors===1?``:`s`]}):(0,B.jsxs)(`details`,{ref:r,className:`inline-popover`,open:t,onToggle:e=>n(e.currentTarget.open),children:[(0,B.jsxs)(`summary`,{className:`inline-popover-trigger`,title:e.samples.map(e=>`${e.sessionId}: ${e.summary}`).join(`
173
174
 
174
- `),children:[e.recentErrors,` recent error`,e.recentErrors===1?``:`s`]}),(0,B.jsxs)(`div`,{className:`inline-popover-panel`,children:[(0,B.jsx)(`div`,{className:`inline-popover-header`,children:`Recent errors`}),(0,B.jsx)(`div`,{className:`inline-popover-list`,children:e.samples.map(e=>(0,B.jsxs)(`div`,{className:`inline-popover-entry`,children:[(0,B.jsx)(`strong`,{children:Za(e.timestamp)}),(0,B.jsx)(`small`,{children:e.sessionId}),(0,B.jsx)(`p`,{children:e.summary})]},e.id))})]})]})}function cx(){let e=Gn(),[t,n]=(0,R.useState)(``),r=(0,R.useDeferredValue)(t),i=y({queryKey:[`tools`,e.token],queryFn:()=>Bn(e.token)}),{sortedRows:a,sortState:o,toggleSort:s}=Ba((0,R.useMemo)(()=>{let e=r.trim().toLowerCase();return(i.data?.groups||[]).flatMap(t=>t.tools.filter(t=>[t.name,t.group,t.kind].join(` `).toLowerCase().includes(e)).map(e=>({...e,groupLabel:t.label})))},[r,i.data?.groups]),{initialSort:{key:`invocations`,direction:`desc`},sorters:ax,defaultDirections:ox});return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ha,{actions:(0,B.jsx)(`input`,{className:`compact-search`,value:t,onChange:e=>n(e.target.value),placeholder:`Filter tools`})}),(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Ua,{label:`Catalog tools`,value:String(i.data?.totals.totalTools??0),loading:!i.data}),(0,B.jsx)(Ua,{label:`MCP tools seen`,value:String(i.data?.totals.mcpTools??0),loading:!i.data}),(0,B.jsx)(Ua,{label:`Recent executions`,value:String(i.data?.totals.recentExecutions??0),loading:!i.data}),(0,B.jsx)(Ua,{label:`Recent errors`,value:String(i.data?.totals.recentErrors??0),loading:!i.data})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Catalog`})}),(0,B.jsx)(K,{children:i.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading tool catalog...`}):a.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No tools match this filter.`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Va,{label:`Tool`,sortKey:`tool`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Group`,sortKey:`group`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Type`,sortKey:`type`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Invocations`,sortKey:`invocations`,sortState:o,onToggle:s}),(0,B.jsx)(Va,{label:`Last used`,sortKey:`lastUsed`,sortState:o,onToggle:s})]})}),(0,B.jsx)(`tbody`,{children:a.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.name}),(0,B.jsx)(sx,{recentErrors:e.recentErrors,samples:e.recentErrorSamples})]}),(0,B.jsx)(`td`,{children:e.groupLabel}),(0,B.jsx)(`td`,{children:e.kind}),(0,B.jsx)(`td`,{children:e.recentCalls}),(0,B.jsx)(`td`,{children:Qa(e.lastUsedAt)})]},e.name))})]})})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Recent executions`})}),(0,B.jsx)(K,{children:i.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading recent executions...`}):i.data?.recentExecutions.length?(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:i.data.recentExecutions.map(e=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.toolName}),(0,B.jsxs)(`small`,{children:[e.sessionId,` ·`,` `,Za(e.timestamp),e.durationMs==null?``:` · ${e.durationMs}ms`]}),e.isError&&e.summary?(0,B.jsx)(`small`,{children:e.summary}):null]}),(0,B.jsxs)(`span`,{className:e.isError?`list-status list-status-danger`:`list-status list-status-success`,children:[(0,B.jsx)(`span`,{className:e.isError?`status-dot status-dot-danger`:`status-dot status-dot-success`}),e.isError?`error`:`ok`]})]},e.id))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No recent tool executions were found in structured audit events.`})})]})]})]})}var lx=`modulepreload`,ux=function(e){return`/`+e},dx={},fx=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=ux(t,n),t in dx)return;dx[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:lx,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},px=(0,R.lazy)(async()=>({default:(await fx(()=>import(`./terminal-CJP-btmG.js`),__vite__mapDeps([0,1,2,3,4]))).TerminalPage}));function mx(){return(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading terminal…`}),children:(0,B.jsx)(px,{})})}var hx=(0,R.lazy)(async()=>({default:(await fx(()=>import(`./chat-DtbW21G6.js`),__vite__mapDeps([5,1,6,7,2,8]))).ChatPage}));function gx(){return(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading chat…`}),children:(0,B.jsx)(hx,{})})}var _x=(0,R.lazy)(async()=>({default:(await fx(()=>import(`./apps-_oJDy7mi.js`),__vite__mapDeps([9,1,6,7,2,10]))).AppsPage}));function vx(){return(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading apps…`}),children:(0,B.jsx)(_x,{})})}function yx(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function bx(){let e=I({select:e=>e.location.pathname});return(0,R.useEffect)(()=>{document.title=Lr(e)},[e]),null}function xx(){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(bx,{}),(0,B.jsx)(E,{})]})}var Sx=N({component:xx});function Cx(){return(0,B.jsx)(Ma,{children:(0,B.jsx)(E,{})})}var wx=F({getParentRoute:()=>Sx,id:`_admin_layout`,component:Cx}),Tx=F({getParentRoute:()=>Sx,path:`/agents`,component:Bs}),Ex=F({getParentRoute:()=>wx,path:`/admin`,component:of}),Dx=F({getParentRoute:()=>wx,path:`/admin/statistics`,component:nx}),Ox=F({getParentRoute:()=>wx,path:`/admin/approvals`,component:Ys}),kx=F({getParentRoute:()=>wx,path:`/admin/a2a-inbox`,component:co}),Ax=F({getParentRoute:()=>wx,path:`/admin/a2a-trust`,component:Zo}),jx=F({getParentRoute:()=>wx,path:`/admin/agents`,component:Ds}),Mx=F({getParentRoute:()=>wx,path:`/admin/agent-scoreboard`,component:as}),Nx=F({getParentRoute:()=>wx,path:`/admin/terminal`,component:mx}),Px=F({getParentRoute:()=>wx,path:`/admin/gateway`,component:rp}),Fx=F({getParentRoute:()=>wx,path:`/admin/logs`,component:Gp}),Ix=F({getParentRoute:()=>wx,path:`/admin/fleet-topology`,component:Yf}),Lx=F({getParentRoute:()=>wx,path:`/admin/sessions`,validateSearch:e=>({sessionId:yx(e.sessionId)}),component:_g}),Rx=F({getParentRoute:()=>wx,path:`/admin/channels`,component:$l}),zx=F({getParentRoute:()=>wx,path:`/admin/email`,component:Gf}),Bx=F({getParentRoute:()=>wx,path:`/admin/config`,component:Mu}),Vx=F({getParentRoute:()=>wx,path:`/admin/models`,component:fm}),Hx=F({getParentRoute:()=>wx,path:`/admin/scheduler`,validateSearch:e=>({jobId:yx(e.jobId)}),component:lg}),Ux=F({getParentRoute:()=>wx,path:`/admin/jobs`,component:Fp}),Wx=F({getParentRoute:()=>wx,path:`/admin/harness-evolution`,component:up}),Gx=F({getParentRoute:()=>wx,path:`/admin/distill`,component:Of}),Kx=F({getParentRoute:()=>wx,path:`/admin/mcp`,component:tm}),qx=F({getParentRoute:()=>wx,path:`/admin/connectors`,component:Cd}),Jx=F({getParentRoute:()=>wx,path:`/admin/audit`,validateSearch:e=>({q:yx(e.q),range:yx(e.range)}),component:hc}),Yx=F({getParentRoute:()=>wx,path:`/admin/skills`,component:ex}),Xx=F({getParentRoute:()=>wx,path:`/admin/skills/$skillName`,component:Lb}),Zx=F({getParentRoute:()=>wx,path:`/admin/plugins`,component:Mh}),Qx=F({getParentRoute:()=>wx,path:`/admin/output-guard`,component:Dh}),$x=F({getParentRoute:()=>wx,path:`/admin/tools`,component:cx}),eS=F({getParentRoute:()=>wx,path:`/admin/secrets`,component:mg}),tS=F({getParentRoute:()=>Sx,path:`/chat`,validateSearch:e=>{let t=yx(e.prompt),n=yx(e.send),r=yx(e.agent),i=yx(e.app),a=yx(e.category),o=yx(e.kind);return{...t?{prompt:t}:{},...n?{send:n}:{},...r?{agent:r}:{},...i?{app:i}:{},...a?{category:a}:{},...o?{kind:o}:{}}},component:gx}),nS=F({getParentRoute:()=>tS,path:`$sessionId`}),rS=F({getParentRoute:()=>Sx,path:`/apps`,component:vx}),iS=A({routeTree:Sx.addChildren([wx.addChildren([Ex,Dx,Ox,kx,Ax,jx,Mx,Nx,Px,Fx,Ix,Lx,Rx,zx,Bx,Vx,Hx,Ux,Wx,Gx,qx,Kx,Jx,Yx,Xx,Zx,Qx,$x,eS]),Tx,tS.addChildren([nS]),rS])});function aS(){let e=Gn(),[t]=(0,R.useState)(()=>new le({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}));return(0,R.useEffect)(()=>{document.title=Lr(window.location.pathname)},[]),e.status===`checking`?(0,B.jsx)(`div`,{className:`loading-shell`,children:(0,B.jsxs)(`div`,{"aria-label":`Loading HybridClaw`,"aria-live":`polite`,className:`loading-panel`,role:`status`,children:[(0,B.jsx)(`div`,{className:`loading-mark-wrap`,children:(0,B.jsx)(pr,{className:`loading-mark`})}),(0,B.jsx)(`div`,{className:`loading-copy`,children:(0,B.jsx)(`h1`,{children:`Loading HybridClaw ...`})}),(0,B.jsx)(`div`,{className:`loading-progress`,"aria-hidden":`true`,children:(0,B.jsx)(`span`,{})})]})}):e.status===`error`?(0,B.jsx)(`div`,{className:`login-shell`,children:(0,B.jsxs)(`div`,{className:`login-card`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`HybridClaw Admin`}),(0,B.jsx)(`h1`,{children:`Console unavailable.`}),(0,B.jsx)(`p`,{className:`supporting-text`,children:e.error}),(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,onClick:e.retry,children:`Retry`})]})}):e.status===`prompt`?(0,B.jsx)(Ir,{}):(0,B.jsx)(p,{client:t,children:(0,B.jsx)(P,{router:iS})})}bi(),ue.createRoot(document.getElementById(`root`)).render((0,B.jsx)(Un,{children:(0,B.jsx)(vs,{children:(0,B.jsx)(aS,{})})}));export{Ai as $,eo as A,ta as B,Hc as C,_e as Ct,hs as D,Te as Dt,Wc as E,lt as Et,ha as F,Hi as G,Xi as H,_a as I,Pi as J,Vi as K,ia as L,Ha as M,ka as N,Z as O,je as Ot,Ca as P,ki as Q,Qi as R,$c as S,yn as St,Uc as T,ct as Tt,ra as U,$i as V,Zi as W,Ni as X,Fi as Y,Oi as Z,_m as _,ve as _t,Om as a,ai as at,Jc as b,ft as bt,Em as c,Fr as ct,Fm as d,Or as dt,ri as et,wm as f,Er as ft,ym as g,ut as gt,vm as h,Gn as ht,Cm as i,ci as it,H as j,Za as k,Mm as l,Nr as lt,gm as m,Wn as mt,gh as n,ii as nt,km as o,oi as ot,Tm as p,er as pt,Mi as q,zm as r,si as rt,Am as s,V as st,fb as t,li as tt,Pm as u,Mr as ut,Bc as v,At as vt,Kc as w,z as wt,qc as x,Kt as xt,Xc as y,ye as yt,ea as z};
175
+ `),children:[e.recentErrors,` recent error`,e.recentErrors===1?``:`s`]}),(0,B.jsxs)(`div`,{className:`inline-popover-panel`,children:[(0,B.jsx)(`div`,{className:`inline-popover-header`,children:`Recent errors`}),(0,B.jsx)(`div`,{className:`inline-popover-list`,children:e.samples.map(e=>(0,B.jsxs)(`div`,{className:`inline-popover-entry`,children:[(0,B.jsx)(`strong`,{children:io(e.timestamp)}),(0,B.jsx)(`small`,{children:e.sessionId}),(0,B.jsx)(`p`,{children:e.summary})]},e.id))})]})]})}function Hx(){let e=Zn(),[t,n]=(0,R.useState)(``),r=(0,R.useDeferredValue)(t),i=y({queryKey:[`tools`,e.token],queryFn:()=>Kn(e.token)}),{sortedRows:a,sortState:o,toggleSort:s}=qa((0,R.useMemo)(()=>{let e=r.trim().toLowerCase();return(i.data?.groups||[]).flatMap(t=>t.tools.filter(t=>[t.name,t.group,t.kind].join(` `).toLowerCase().includes(e)).map(e=>({...e,groupLabel:t.label})))},[r,i.data?.groups]),{initialSort:{key:`invocations`,direction:`desc`},sorters:zx,defaultDirections:Bx});return(0,B.jsxs)(`div`,{className:`page-stack`,children:[(0,B.jsx)(Ya,{actions:(0,B.jsx)(`input`,{className:`compact-search`,value:t,onChange:e=>n(e.target.value),placeholder:`Filter tools`})}),(0,B.jsxs)(`div`,{className:`metric-grid`,children:[(0,B.jsx)(Xa,{label:`Catalog tools`,value:String(i.data?.totals.totalTools??0),loading:!i.data}),(0,B.jsx)(Xa,{label:`MCP tools seen`,value:String(i.data?.totals.mcpTools??0),loading:!i.data}),(0,B.jsx)(Xa,{label:`Recent executions`,value:String(i.data?.totals.recentExecutions??0),loading:!i.data}),(0,B.jsx)(Xa,{label:`Recent errors`,value:String(i.data?.totals.recentErrors??0),loading:!i.data})]}),(0,B.jsxs)(`div`,{className:`two-column-grid`,children:[(0,B.jsxs)(U,{children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Catalog`})}),(0,B.jsx)(K,{children:i.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading tool catalog...`}):a.length===0?(0,B.jsx)(`div`,{className:`empty-state`,children:`No tools match this filter.`}):(0,B.jsx)(`div`,{className:`table-shell`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Ja,{label:`Tool`,sortKey:`tool`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Group`,sortKey:`group`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Type`,sortKey:`type`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Invocations`,sortKey:`invocations`,sortState:o,onToggle:s}),(0,B.jsx)(Ja,{label:`Last used`,sortKey:`lastUsed`,sortState:o,onToggle:s})]})}),(0,B.jsx)(`tbody`,{children:a.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:e.name}),(0,B.jsx)(Vx,{recentErrors:e.recentErrors,samples:e.recentErrorSamples})]}),(0,B.jsx)(`td`,{children:e.groupLabel}),(0,B.jsx)(`td`,{children:e.kind}),(0,B.jsx)(`td`,{children:e.recentCalls}),(0,B.jsx)(`td`,{children:ao(e.lastUsedAt)})]},e.name))})]})})})]}),(0,B.jsxs)(U,{variant:`muted`,children:[(0,B.jsx)(W,{children:(0,B.jsx)(G,{children:`Recent executions`})}),(0,B.jsx)(K,{children:i.isLoading?(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading recent executions...`}):i.data?.recentExecutions.length?(0,B.jsx)(`div`,{className:`list-stack selectable-list`,children:i.data.recentExecutions.map(e=>(0,B.jsxs)(`div`,{className:`list-row`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.toolName}),(0,B.jsxs)(`small`,{children:[e.sessionId,` ·`,` `,io(e.timestamp),e.durationMs==null?``:` · ${e.durationMs}ms`]}),e.isError&&e.summary?(0,B.jsx)(`small`,{children:e.summary}):null]}),(0,B.jsxs)(`span`,{className:e.isError?`list-status list-status-danger`:`list-status list-status-success`,children:[(0,B.jsx)(`span`,{className:e.isError?`status-dot status-dot-danger`:`status-dot status-dot-success`}),e.isError?`error`:`ok`]})]},e.id))}):(0,B.jsx)(`div`,{className:`empty-state`,children:`No recent tool executions were found in structured audit events.`})})]})]})]})}var Ux=`modulepreload`,Wx=function(e){return`/`+e},Gx={},Kx=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Wx(t,n),t in Gx)return;Gx[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Ux,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},qx=(0,R.lazy)(async()=>({default:(await Kx(()=>import(`./terminal-DW6yIbMu.js`),__vite__mapDeps([0,1,2,3,4]))).TerminalPage}));function Jx(){return(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading terminal…`}),children:(0,B.jsx)(qx,{})})}var Yx=(0,R.lazy)(async()=>({default:(await Kx(()=>import(`./chat-BdYrPyYT.js`),__vite__mapDeps([5,1,6,7,2,8]))).ChatPage}));function Xx(){return(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading chat…`}),children:(0,B.jsx)(Yx,{})})}var Zx=(0,R.lazy)(async()=>({default:(await Kx(()=>import(`./apps-zKDO-H6v.js`),__vite__mapDeps([9,1,6,7,2,10]))).AppsPage}));function Qx(){return(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(`div`,{className:`empty-state`,children:`Loading apps…`}),children:(0,B.jsx)(Zx,{})})}function $x(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function eS(){let e=I({select:e=>e.location.pathname});return(0,R.useEffect)(()=>{document.title=Wr(e)},[e]),null}function tS(){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(eS,{}),(0,B.jsx)(E,{})]})}var nS=N({component:tS});function rS(){return(0,B.jsx)(za,{children:(0,B.jsx)(E,{})})}var iS=F({getParentRoute:()=>nS,id:`_admin_layout`,component:rS}),aS=F({getParentRoute:()=>nS,path:`/agents`,component:qs}),oS=F({getParentRoute:()=>iS,path:`/admin`,component:pf}),sS=F({getParentRoute:()=>iS,path:`/admin/statistics`,component:lx}),cS=F({getParentRoute:()=>iS,path:`/admin/approvals`,component:nc}),lS=F({getParentRoute:()=>iS,path:`/admin/a2a-inbox`,component:go}),uS=F({getParentRoute:()=>iS,path:`/admin/a2a-trust`,component:is}),dS=F({getParentRoute:()=>iS,path:`/admin/agents`,component:Ps}),fS=F({getParentRoute:()=>iS,path:`/admin/agent-scoreboard`,component:fs}),pS=F({getParentRoute:()=>iS,path:`/admin/terminal`,component:Jx}),mS=F({getParentRoute:()=>iS,path:`/admin/gateway`,component:up}),hS=F({getParentRoute:()=>iS,path:`/admin/logs`,component:Qp}),gS=F({getParentRoute:()=>iS,path:`/admin/fleet-topology`,component:np}),_S=F({getParentRoute:()=>iS,path:`/admin/sessions`,validateSearch:e=>({sessionId:$x(e.sessionId)}),component:wg}),vS=F({getParentRoute:()=>iS,path:`/admin/channels`,component:ou}),yS=F({getParentRoute:()=>iS,path:`/admin/teams`,component:vx}),bS=F({getParentRoute:()=>iS,path:`/admin/email`,component:Qf}),xS=F({getParentRoute:()=>iS,path:`/admin/config`,component:zu}),SS=F({getParentRoute:()=>iS,path:`/admin/models`,component:ym}),CS=F({getParentRoute:()=>iS,path:`/admin/scheduler`,validateSearch:e=>({jobId:$x(e.jobId)}),component:gg}),wS=F({getParentRoute:()=>iS,path:`/admin/jobs`,component:Hp}),TS=F({getParentRoute:()=>iS,path:`/admin/harness-evolution`,component:_p}),ES=F({getParentRoute:()=>iS,path:`/admin/distill`,component:Ff}),DS=F({getParentRoute:()=>iS,path:`/admin/mcp`,component:cm}),OS=F({getParentRoute:()=>iS,path:`/admin/connectors`,component:Ad}),kS=F({getParentRoute:()=>iS,path:`/admin/audit`,validateSearch:e=>({q:$x(e.q),range:$x(e.range)}),component:Sc}),AS=F({getParentRoute:()=>iS,path:`/admin/skills`,component:sx}),jS=F({getParentRoute:()=>iS,path:`/admin/skills/$skillName`,component:Wb}),MS=F({getParentRoute:()=>iS,path:`/admin/plugins`,component:zh}),NS=F({getParentRoute:()=>iS,path:`/admin/output-guard`,component:Ph}),PS=F({getParentRoute:()=>iS,path:`/admin/tools`,component:Hx}),FS=F({getParentRoute:()=>iS,path:`/admin/secrets`,component:xg}),IS=F({getParentRoute:()=>iS,path:`/admin/tokens`,component:Nx}),LS=F({getParentRoute:()=>nS,path:`/chat`,validateSearch:e=>{let t=$x(e.prompt),n=$x(e.send),r=$x(e.agent),i=$x(e.app),a=$x(e.category),o=$x(e.kind);return{...t?{prompt:t}:{},...n?{send:n}:{},...r?{agent:r}:{},...i?{app:i}:{},...a?{category:a}:{},...o?{kind:o}:{}}},component:Xx}),RS=F({getParentRoute:()=>LS,path:`$sessionId`}),zS=F({getParentRoute:()=>nS,path:`/apps`,component:Qx}),BS=A({routeTree:nS.addChildren([iS.addChildren([oS,sS,cS,lS,uS,dS,fS,pS,mS,hS,gS,_S,vS,yS,bS,xS,SS,CS,wS,TS,ES,OS,DS,kS,AS,jS,MS,NS,PS,FS,IS]),aS,LS.addChildren([RS]),zS])});function VS(){let e=Zn(),[t]=(0,R.useState)(()=>new le({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}));return(0,R.useEffect)(()=>{document.title=Wr(window.location.pathname)},[]),e.status===`checking`?(0,B.jsx)(`div`,{className:`loading-shell`,children:(0,B.jsxs)(`div`,{"aria-label":`Loading HybridClaw`,"aria-live":`polite`,className:`loading-panel`,role:`status`,children:[(0,B.jsx)(`div`,{className:`loading-mark-wrap`,children:(0,B.jsx)(yr,{className:`loading-mark`})}),(0,B.jsx)(`div`,{className:`loading-copy`,children:(0,B.jsx)(`h1`,{children:`Loading HybridClaw ...`})}),(0,B.jsx)(`div`,{className:`loading-progress`,"aria-hidden":`true`,children:(0,B.jsx)(`span`,{})})]})}):e.status===`error`?(0,B.jsx)(`div`,{className:`login-shell`,children:(0,B.jsxs)(`div`,{className:`login-card`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`HybridClaw Admin`}),(0,B.jsx)(`h1`,{children:`Console unavailable.`}),(0,B.jsx)(`p`,{className:`supporting-text`,children:e.error}),(0,B.jsx)(`button`,{className:`primary-button`,type:`button`,onClick:e.retry,children:`Retry`})]})}):e.status===`prompt`?(0,B.jsx)(Ur,{}):(0,B.jsx)(p,{client:t,children:(0,B.jsx)(P,{router:BS})})}Di(),ue.createRoot(document.getElementById(`root`)).render((0,B.jsx)(Yn,{children:(0,B.jsx)(Ts,{children:(0,B.jsx)(VS,{})})}));export{Li as $,so as A,ut as At,ca as B,Yc as C,pt as Ct,Ss as D,_e as Dt,Zc as E,Tn as Et,Sa as F,Yi as G,ra as H,wa as I,Vi as J,Ji as K,da as L,Ya as M,je as Mt,Ia as N,Z as O,z as Ot,Aa as P,Ii as Q,aa as R,ol as S,et as St,Xc as T,Qt as Tt,ua as U,oa as V,ia as W,Bi as X,Hi as Y,Fi as Z,wm as _,dt as _t,Fm as a,fi as at,tl as b,jt as bt,Nm as c,Hr as ct,Hm as d,Ir as dt,ui as et,jm as f,Pr as ft,Em as g,Zn as gt,Tm as h,Xn as ht,Am as i,hi as it,H as j,Te as jt,io as k,lt as kt,zm as l,Br as lt,Cm as m,or as mt,Ch as n,di as nt,Im as o,pi as ot,Mm as p,Mr as pt,zi as q,Km as r,mi as rt,Lm as s,V as st,yb as t,gi as tt,Vm as u,zr as ut,qc as v,ve as vt,$c as w,Pt as wt,el as x,ye as xt,rl as y,Xt as yt,sa as z};